mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-07-01 02:41:48 +00:00
Use external dependencies for NI and NetComm libraries (#1304)
This removes a number of large binary files from the repo and enables vendors to depend on these libraries separately.
This commit is contained in:
committed by
Peter Johnson
parent
bedef476fd
commit
d2a5aaafdd
@@ -30,6 +30,18 @@ staticGtestConfigs["${nativeName}Test"] = []
|
||||
|
||||
apply from: "${rootDir}/shared/googletest.gradle"
|
||||
|
||||
if (project.hasProperty('niLibraries')) {
|
||||
ext {
|
||||
chipObjectComponents = ["$nativeName".toString(), "${nativeName}Dev".toString(), "${nativeName}Base".toString(),
|
||||
"${nativeName}JNI".toString(), "${nativeName}Test".toString()]
|
||||
netCommComponents = ["$nativeName".toString(), "${nativeName}Dev".toString(), "${nativeName}Base".toString(),
|
||||
"${nativeName}JNI".toString(), "${nativeName}Test".toString()]
|
||||
useNiJava = true
|
||||
}
|
||||
|
||||
apply from: "${rootDir}/shared/nilibraries.gradle"
|
||||
}
|
||||
|
||||
model {
|
||||
components {
|
||||
"${nativeName}Base"(JniNativeLibrarySpec) {
|
||||
@@ -45,7 +57,10 @@ model {
|
||||
include '**/*.cpp'
|
||||
}
|
||||
exportedHeaders {
|
||||
srcDirs 'src/main/native/include'
|
||||
srcDir 'src/main/native/include'
|
||||
if (project.hasProperty('generatedHeaders')) {
|
||||
srcDir generatedHeaders
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -58,9 +73,6 @@ model {
|
||||
if (project.hasProperty('splitSetup')) {
|
||||
splitSetup(it)
|
||||
}
|
||||
if (project.hasProperty('niLibraries')) {
|
||||
project(':ni-libraries').addNiLibrariesToLinker(it)
|
||||
}
|
||||
}
|
||||
}
|
||||
"${nativeName}"(JniNativeLibrarySpec) {
|
||||
@@ -77,15 +89,15 @@ model {
|
||||
include '**/*.cpp'
|
||||
}
|
||||
exportedHeaders {
|
||||
srcDirs 'src/main/native/include'
|
||||
srcDir 'src/main/native/include'
|
||||
if (project.hasProperty('generatedHeaders')) {
|
||||
srcDir generatedHeaders
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
binaries.all {
|
||||
lib project: ':wpiutil', library: 'wpiutil', linkage: 'shared'
|
||||
if (project.hasProperty('niLibraries')) {
|
||||
project(':ni-libraries').addNiLibrariesToLinker(it)
|
||||
}
|
||||
}
|
||||
}
|
||||
"${nativeName}JNI"(JniNativeLibrarySpec) {
|
||||
@@ -104,7 +116,10 @@ model {
|
||||
include '**/*.cpp'
|
||||
}
|
||||
exportedHeaders {
|
||||
srcDirs 'src/main/native/include'
|
||||
srcDir 'src/main/native/include'
|
||||
if (project.hasProperty('generatedHeaders')) {
|
||||
srcDir generatedHeaders
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -127,14 +142,14 @@ model {
|
||||
include '**/*.cpp'
|
||||
}
|
||||
exportedHeaders {
|
||||
srcDirs 'src/dev/native/include'
|
||||
srcDir 'src/main/native/include'
|
||||
if (project.hasProperty('generatedHeaders')) {
|
||||
srcDir generatedHeaders
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
binaries.all {
|
||||
if (project.hasProperty('niLibraries')) {
|
||||
project(':ni-libraries').addNiLibrariesToLinker(it)
|
||||
}
|
||||
lib library: nativeName, linkage: 'shared'
|
||||
lib project: ':wpiutil', library: 'wpiutil', linkage: 'shared'
|
||||
}
|
||||
@@ -156,6 +171,9 @@ model {
|
||||
}
|
||||
exportedHeaders {
|
||||
srcDirs 'src/test/native/include', 'src/main/native/cpp'
|
||||
if (project.hasProperty('generatedHeaders')) {
|
||||
srcDir generatedHeaders
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
33
shared/nilibraries.gradle
Normal file
33
shared/nilibraries.gradle
Normal file
@@ -0,0 +1,33 @@
|
||||
def netCommLibConfigs = [:];
|
||||
def chipObjectConfigs = [:];
|
||||
|
||||
project.chipObjectComponents.each { String s->
|
||||
chipObjectConfigs[s] = ['linux:athena']
|
||||
}
|
||||
|
||||
project.netCommComponents.each { String s->
|
||||
netCommLibConfigs[s] = ['linux:athena']
|
||||
}
|
||||
|
||||
model {
|
||||
dependencyConfigs {
|
||||
chipobject(DependencyConfig) {
|
||||
groupId = 'edu.wpi.first.ni-libraries'
|
||||
artifactId = 'chipobject'
|
||||
headerClassifier = 'headers'
|
||||
ext = 'zip'
|
||||
version = '2018.17.0'
|
||||
sharedConfigs = chipObjectConfigs
|
||||
staticConfigs = [:]
|
||||
}
|
||||
netcomm(DependencyConfig) {
|
||||
groupId = 'edu.wpi.first.ni-libraries'
|
||||
artifactId = 'netcomm-cpp'
|
||||
headerClassifier = 'headers'
|
||||
ext = 'zip'
|
||||
version = '2018.17.0'
|
||||
sharedConfigs = netCommLibConfigs
|
||||
staticConfigs = [:]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2,6 +2,14 @@ apply plugin: 'cpp'
|
||||
apply plugin: 'edu.wpi.first.NativeUtils'
|
||||
apply plugin: ExtraTasks
|
||||
|
||||
ext {
|
||||
chipObjectComponents = ["$pluginName".toString(), "${pluginName}Dev".toString(), "${pluginName}Test".toString()]
|
||||
netCommComponents = ["$pluginName".toString(), "${pluginName}Dev".toString(), "${pluginName}Test".toString()]
|
||||
useNiJava = false
|
||||
}
|
||||
|
||||
apply from: "${rootDir}/shared/nilibraries.gradle"
|
||||
|
||||
if (!project.hasProperty('onlyAthena')) {
|
||||
ext.skipAthena = true
|
||||
apply from: "${rootDir}/shared/config.gradle"
|
||||
@@ -25,7 +33,7 @@ if (!project.hasProperty('onlyAthena')) {
|
||||
it.buildable = false
|
||||
return
|
||||
}
|
||||
lib project: ':hal', library: 'hal', linkage: 'shared'
|
||||
project(':hal').addHalDependency(it, 'shared')
|
||||
if (project.hasProperty('includeNtCore')) {
|
||||
lib project: ':ntcore', library: 'ntcore', linkage: 'shared'
|
||||
}
|
||||
@@ -47,7 +55,7 @@ if (!project.hasProperty('onlyAthena')) {
|
||||
}
|
||||
}
|
||||
binaries.all {
|
||||
lib project: ':hal', library: 'hal', linkage: 'shared'
|
||||
project(':hal').addHalDependency(it, 'shared')
|
||||
lib library: pluginName
|
||||
if (project.hasProperty('includeNtCore')) {
|
||||
lib project: ':ntcore', library: 'ntcore', linkage: 'shared'
|
||||
|
||||
Reference in New Issue
Block a user