2015-09-24 23:32:55 -04:00
|
|
|
import org.gradle.internal.os.OperatingSystem
|
2015-08-14 20:06:31 -07:00
|
|
|
|
2016-05-12 12:24:08 -04:00
|
|
|
buildscript {
|
|
|
|
|
repositories {
|
|
|
|
|
maven {
|
|
|
|
|
url "https://plugins.gradle.org/m2/"
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
dependencies {
|
|
|
|
|
classpath 'net.ltgt.gradle:gradle-errorprone-plugin:0.0.8'
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2015-11-24 15:58:28 -05:00
|
|
|
// Determine what repo to publish to. Default is development. Valid options are development, beta, stable, and release
|
|
|
|
|
if (!hasProperty('repo')) {
|
|
|
|
|
allprojects {
|
|
|
|
|
ext.repo = 'development'
|
2015-09-24 23:32:55 -04:00
|
|
|
}
|
2015-09-06 01:12:19 -04:00
|
|
|
}
|
|
|
|
|
|
2015-12-29 12:08:51 -05:00
|
|
|
ext.buildArm = !project.hasProperty('skipArm')
|
2016-07-27 22:18:56 -05:00
|
|
|
ext.includeJava = !project.hasProperty('skipJava')
|
2015-12-29 12:08:51 -05:00
|
|
|
|
2015-11-24 15:58:28 -05:00
|
|
|
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!'
|
2015-11-21 11:13:37 -05:00
|
|
|
}
|
|
|
|
|
|
2015-09-24 23:32:55 -04:00
|
|
|
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
|
2015-09-03 20:42:39 -07:00
|
|
|
}
|
2015-09-24 23:32:55 -04:00
|
|
|
} else if (binary.targetPlatform.operatingSystem.windows) {
|
|
|
|
|
if (binary.targetPlatform.architecture.amd64) {
|
|
|
|
|
return 'Windows/amd64'
|
|
|
|
|
} else {
|
|
|
|
|
return 'Windows/' + binary.targetPlatform.architecture.name
|
2015-09-03 20:42:39 -07:00
|
|
|
}
|
2015-11-16 09:56:47 -05:00
|
|
|
} 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
|
|
|
|
|
}
|
2015-09-24 23:32:55 -04:00
|
|
|
} else {
|
|
|
|
|
return binary.targetPlatform.operatingSystem.name + '/' + binary.targetPlatform.architecture.name
|
2015-08-14 20:06:31 -07:00
|
|
|
}
|
2015-09-24 23:32:55 -04:00
|
|
|
}
|
2015-08-14 20:06:31 -07:00
|
|
|
|
2016-07-27 22:18:56 -05:00
|
|
|
ext.setupDefines = { project, binaries ->
|
|
|
|
|
binaries.all {
|
|
|
|
|
if (project.hasProperty('debug')) {
|
|
|
|
|
project.setupDebugDefines(cppCompiler, linker)
|
|
|
|
|
} else {
|
|
|
|
|
project.setupReleaseDefines(cppCompiler, linker)
|
|
|
|
|
}
|
2015-11-01 22:27:51 -05:00
|
|
|
}
|
2015-11-24 15:58:28 -05:00
|
|
|
}
|
|
|
|
|
|
2016-07-27 22:18:56 -05:00
|
|
|
apply from: "ntcore.gradle"
|
|
|
|
|
apply from: "wpiutil.gradle"
|
2015-08-28 12:35:04 -07:00
|
|
|
|
2016-07-27 22:18:56 -05:00
|
|
|
// Empty task for build so that ntcoreSourceZip and wpiutilSourceZip will be
|
|
|
|
|
// built when running ./gradlew build
|
2015-12-24 14:42:09 -05:00
|
|
|
task build
|
|
|
|
|
|
|
|
|
|
build.dependsOn ntcoreSourceZip
|
2016-07-27 22:18:56 -05:00
|
|
|
build.dependsOn wpiutilSourceZip
|
2015-12-24 14:42:09 -05:00
|
|
|
|
2015-09-24 23:32:55 -04:00
|
|
|
apply from: 'publish.gradle'
|
2016-06-30 19:57:29 -07:00
|
|
|
|
|
|
|
|
task wrapper(type: Wrapper) {
|
2016-08-21 08:16:33 -07:00
|
|
|
gradleVersion = '3.0'
|
2016-06-30 19:57:29 -07:00
|
|
|
}
|