mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-22 01:11:42 +00:00
81 lines
2.4 KiB
Groovy
81 lines
2.4 KiB
Groovy
import org.gradle.internal.os.OperatingSystem
|
|
|
|
buildscript {
|
|
repositories {
|
|
maven {
|
|
url "https://plugins.gradle.org/m2/"
|
|
}
|
|
}
|
|
dependencies {
|
|
classpath 'net.ltgt.gradle:gradle-errorprone-plugin:0.0.8'
|
|
}
|
|
}
|
|
|
|
// Determine what repo to publish to. Default is development. Valid options are development, beta, stable, and release
|
|
if (!hasProperty('repo')) {
|
|
allprojects {
|
|
ext.repo = 'development'
|
|
}
|
|
}
|
|
|
|
ext.buildArm = !project.hasProperty('skipArm')
|
|
ext.includeJava = !project.hasProperty('skipJava')
|
|
|
|
if (hasProperty('makeDesktop')) {
|
|
println 'Making desktop classifier jar. NOTE: This desktop version should only be used for local testing.' +
|
|
'It will only support the current platform, and will override fetching the latest development version from' +
|
|
' the maven repo until you manually delete it!'
|
|
}
|
|
|
|
ext.getPlatformPath = { binary ->
|
|
if (binary.targetPlatform.architecture.arm) {
|
|
return 'Linux/arm'
|
|
} else if (binary.targetPlatform.operatingSystem.linux) {
|
|
if (binary.targetPlatform.architecture.amd64) {
|
|
return 'Linux/amd64'
|
|
} else {
|
|
return 'Linux/' + binary.targetPlatform.architecture.name
|
|
}
|
|
} else if (binary.targetPlatform.operatingSystem.windows) {
|
|
if (binary.targetPlatform.architecture.amd64) {
|
|
return 'Windows/amd64'
|
|
} else {
|
|
return 'Windows/' + binary.targetPlatform.architecture.name
|
|
}
|
|
} else if (binary.targetPlatform.operatingSystem.macOsX) {
|
|
if (binary.targetPlatform.architecture.amd64) {
|
|
return 'Mac OS X/x86_64'
|
|
} else {
|
|
return 'Mac OS X/' + binary.targetPlatform.architecture.name
|
|
}
|
|
} else {
|
|
return binary.targetPlatform.operatingSystem.name + '/' + binary.targetPlatform.architecture.name
|
|
}
|
|
}
|
|
|
|
ext.setupDefines = { project, binaries ->
|
|
binaries.all {
|
|
if (project.hasProperty('debug')) {
|
|
project.setupDebugDefines(cppCompiler, linker)
|
|
} else {
|
|
project.setupReleaseDefines(cppCompiler, linker)
|
|
}
|
|
}
|
|
}
|
|
|
|
apply from: "ntcore.gradle"
|
|
apply from: "wpiutil.gradle"
|
|
|
|
// Empty task for build so that ntcoreSourceZip and wpiutilSourceZip will be
|
|
// built when running ./gradlew build
|
|
task build
|
|
|
|
build.dependsOn ntcoreSourceZip
|
|
build.dependsOn wpiutilSourceZip
|
|
|
|
apply from: 'publish.gradle'
|
|
|
|
task wrapper(type: Wrapper) {
|
|
gradleVersion = '3.0'
|
|
}
|