Skip to content

Commit

Permalink
Update build.gradle to tolerate being in a subproject
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesdooley4 committed Feb 15, 2020
1 parent 754e160 commit 5630d57
Showing 1 changed file with 41 additions and 1 deletion.
42 changes: 41 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
@@ -1,9 +1,49 @@
import org.gradle.internal.os.OperatingSystem

buildscript {
repositories {
mavenLocal()
gradlePluginPortal()
String frcYear = '2020'
File frcHome
if (OperatingSystem.current().isWindows()) {
String publicFolder = System.getenv('PUBLIC')
if (publicFolder == null) {
publicFolder = "C:\\Users\\Public"
}
def homeRoot = new File(publicFolder, "wpilib")
frcHome = new File(homeRoot, frcYear)
} else {
def userFolder = System.getProperty("user.home")
def homeRoot = new File(userFolder, "wpilib")
frcHome = new File(homeRoot, frcYear)
}
def frcHomeMaven = new File(frcHome, 'maven')
maven {
name 'frcHome'
url frcHomeMaven
}
}
dependencies {
classpath "edu.wpi.first.GradleRIO:edu.wpi.first.GradleRIO.gradle.plugin:2020.2.2"
}
}

plugins {
id "java"
id "edu.wpi.first.GradleRIO"
id "maven-publish"
id "eclipse"
}

def gradleRIOPluginId = 'edu.wpi.first.GradleRIO'
final hasPlugin = project.getPlugins().hasPlugin(gradleRIOPluginId);
if (hasPlugin) {
final Plugin plugin = project.getPlugins().getPlugin(gradleRIOPluginId)
println 'Plugin already applied - version ' + plugin.properties
} else {
apply plugin: "edu.wpi.first.GradleRIO"
}

sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11

Expand Down

0 comments on commit 5630d57

Please sign in to comment.