forked from wpilibsuite/ntcore
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
74 lines (64 loc) · 2.29 KB
/
build.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
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'
classpath 'gradle.plugin.edu.wpi.first.wpilib.versioning:wpilib-version-plugin:1.6'
}
}
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'
}