Gets wpilib compiling with skipAthena and onlyAthena flags (#625)

This commit is contained in:
Thad House
2017-08-31 21:29:35 -07:00
committed by Peter Johnson
parent 67d4da51ee
commit 94c31ceeb1
2 changed files with 51 additions and 43 deletions

View File

@@ -73,47 +73,30 @@ model {
}
}
components {
halAthena(NativeLibrarySpec) {
baseName = 'wpiHal'
sources {
cpp {
source {
srcDirs = [ 'src/main/native/shared', 'src/main/native/athena' ]
includes = ["**/*.cpp"]
}
exportedHeaders {
srcDirs = ["src/main/native/include"]
}
}
}
binaries.all { binary->
if (binary.targetPlatform.architecture.name != 'athena') {
binary.buildable = false
}
}
}
halSim(NativeLibrarySpec) {
baseName = 'wpiHal'
sources {
cpp {
source {
srcDirs = [ 'src/main/native/shared', 'src/main/native/sim' ]
includes = ["**/*.cpp"]
}
exportedHeaders {
srcDirs = ["src/main/native/include"]
}
}
}
}
if (project.hasProperty('buildHalStaticDeps')) {
halSimStaticDeps(NativeLibrarySpec) {
if (!project.hasProperty('skipAthena')) {
halAthena(NativeLibrarySpec) {
baseName = 'wpiHal'
binaries {
withType(StaticLibraryBinarySpec) {
buildable = false
sources {
cpp {
source {
srcDirs = [ 'src/main/native/shared', 'src/main/native/athena' ]
includes = ["**/*.cpp"]
}
exportedHeaders {
srcDirs = ["src/main/native/include"]
}
}
}
binaries.all { binary->
if (binary.targetPlatform.architecture.name != 'athena') {
binary.buildable = false
}
}
}
}
if (!project.hasProperty('onlyAthena')) {
halSim(NativeLibrarySpec) {
baseName = 'wpiHal'
sources {
cpp {
source {
@@ -126,6 +109,27 @@ model {
}
}
}
if (project.hasProperty('buildHalStaticDeps')) {
halSimStaticDeps(NativeLibrarySpec) {
baseName = 'wpiHal'
binaries {
withType(StaticLibraryBinarySpec) {
buildable = false
}
}
sources {
cpp {
source {
srcDirs = [ 'src/main/native/shared', 'src/main/native/sim' ]
includes = ["**/*.cpp"]
}
exportedHeaders {
srcDirs = ["src/main/native/include"]
}
}
}
}
}
}
// The TestingBase library is a workaround for an issue with the GoogleTest plugin.
// The plugin by default will rebuild the entire test source set, which increases

View File

@@ -131,7 +131,9 @@ model {
// The plugin by default will rebuild the entire test source set, which increases
// build time. By testing an empty library, and then just linking the already built component
// into the test, we save the extra build
wpilibcTestingBase(NativeLibrarySpec) { }
if (!project.hasProperty('onlyAthena')) {
wpilibcTestingBase(NativeLibrarySpec) { }
}
// By default, a development executable will be generated. This is to help the case of
// testing specific functionality of the library.
if (!project.hasProperty('skipDevExe')) {
@@ -154,10 +156,12 @@ model {
}
}
testSuites {
wpilibcTestingBaseTest {
sources {
cpp.source.srcDir 'src/test/native/cpp'
cpp.exportedHeaders.srcDir 'src/test/native/include'
if (!project.hasProperty('onlyAthena')) {
wpilibcTestingBaseTest {
sources {
cpp.source.srcDir 'src/test/native/cpp'
cpp.exportedHeaders.srcDir 'src/test/native/include'
}
}
}
}