Added skipArm flag to disable the arm build entirely

Change-Id: I49c6cb3bfb3b1eda60d5b99b634b1e82fb2afcc8
This commit is contained in:
Fredric Silberberg
2015-12-29 12:08:51 -05:00
parent 2aaaed34f9
commit 1ea5b21dcf
4 changed files with 31 additions and 14 deletions

View File

@@ -24,6 +24,12 @@ To build just the Native or ARM version, you must access the approriate subproje
./gradlew :native:build # Builds just the native version of ntcore
```
If you do not have the arm toolchain installed on your computer, you will run into build issues. To disable the arm platform entirely, run with the flag `-PskipArm`, and it will be entirely skipped.
```bash
./gradlew build -PskipArm # Builds native, disables the arm project
```
The native version of ntcore will run tests on build. The arm version will not, as the current platform likely does not allow running of an ARM binary.
## Testing

View File

@@ -7,6 +7,8 @@ if (!hasProperty('repo')) {
}
}
ext.buildArm = !project.hasProperty('skipArm')
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' +
@@ -161,19 +163,21 @@ def ntcoreZipTask = { project ->
}
}
project(':arm') {
apply plugin: 'cpp'
if (buildArm) {
project(':arm') {
apply plugin: 'cpp'
ext.buildPlatform = 'arm'
ext.isArm = true
ext.buildPlatform = 'arm'
ext.isArm = true
apply from: '../toolchains/arm.gradle'
if (includeJava) {
apply from: '../java/java.gradle'
apply from: '../toolchains/arm.gradle'
if (includeJava) {
apply from: '../java/java.gradle'
}
setupModel(project, true)
ntcoreZipTask(project)
}
setupModel(project, true)
ntcoreZipTask(project)
}
project(':native') {

View File

@@ -7,13 +7,14 @@ apply plugin: 'maven-publish'
publishing {
publications {
def nat = project('native')
def arm = project('arm')
if (!project.hasProperty('skipJava')) {
java(MavenPublication) {
artifact nat.jar
artifact arm.jar
artifact nat.networktablesJavaSource
artifact nat.networktablesJavadoc
if (project.buildArm) {
artifact project('arm').jar
}
if (project.hasProperty('makeDesktop')) {
artifact nat.jar, {
@@ -28,8 +29,10 @@ publishing {
}
cpp(MavenPublication) {
artifact nat.ntcoreZip
artifact arm.ntcoreZip
artifact ntcoreSourceZip
if (project.buildArm) {
artifact project(':arm').ntcoreZip
}
if (project.hasProperty('makeDesktop')) {
artifact nat.ntcoreZip, {

View File

@@ -1 +1,5 @@
include 'arm', 'native', 'gmock'
include 'native', 'gmock'
if (!hasProperty('skipArm')) {
include 'arm'
}