mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-24 01:31:46 +00:00
This will allow dependencies such as wpilibc to update to use wpiutil without breaking "normal" ntcore static library use in the meantime. This commit also restructures the gradle files by creating a new (placeholder) wpiutil project, and moving the ntcore project into a separate gradle file. Added toolchains/native.gradle (refactored from ntcore). Also fixes ntcore skipJava on Windows by providing an alternate .def file for this case.
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 = '2.14'
|
|
}
|