2018-04-29 13:29:07 -07:00
|
|
|
ext {
|
2018-09-19 21:57:58 -07:00
|
|
|
addHalDependency = { binary, shared->
|
|
|
|
|
binary.lib project: ':hal', library: 'hal', linkage: shared
|
|
|
|
|
}
|
|
|
|
|
|
2018-10-27 00:19:38 -07:00
|
|
|
addHalJniDependency = { binary->
|
|
|
|
|
binary.lib project: ':hal', library: 'halJNIShared', linkage: 'shared'
|
|
|
|
|
}
|
|
|
|
|
|
2018-04-29 13:29:07 -07:00
|
|
|
nativeName = 'hal'
|
|
|
|
|
setBaseName = 'wpiHal'
|
2020-06-26 11:10:34 -07:00
|
|
|
devMain = 'edu.wpi.first.hal.DevMain'
|
2018-04-29 13:29:07 -07:00
|
|
|
niLibraries = true
|
2023-12-03 18:53:24 -05:00
|
|
|
generatedHeaders = "src/generated/main/native/include"
|
2018-04-29 13:29:07 -07:00
|
|
|
splitSetup = {
|
2019-06-28 14:09:10 -07:00
|
|
|
if (it.targetPlatform.name == nativeUtils.wpi.platforms.roborio) {
|
2018-04-29 13:29:07 -07:00
|
|
|
it.sources {
|
|
|
|
|
athenaCpp(CppSourceSet) {
|
|
|
|
|
source {
|
2018-10-27 00:19:38 -07:00
|
|
|
srcDirs = ['src/main/native/athena']
|
2018-04-29 13:29:07 -07:00
|
|
|
include '**/*.cpp'
|
|
|
|
|
}
|
|
|
|
|
exportedHeaders {
|
2018-09-19 21:57:58 -07:00
|
|
|
srcDir 'src/main/native/include'
|
|
|
|
|
srcDir generatedHeaders
|
2018-04-29 13:29:07 -07:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
it.sources {
|
|
|
|
|
simCpp(CppSourceSet) {
|
|
|
|
|
source {
|
|
|
|
|
srcDirs 'src/main/native/sim'
|
|
|
|
|
include '**/*.cpp'
|
|
|
|
|
}
|
|
|
|
|
exportedHeaders {
|
2018-09-19 21:57:58 -07:00
|
|
|
srcDir 'src/main/native/include'
|
|
|
|
|
srcDir generatedHeaders
|
2018-04-29 13:29:07 -07:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2022-10-02 06:13:08 -07:00
|
|
|
exeSplitSetup = {
|
|
|
|
|
if (it.targetPlatform.name == nativeUtils.wpi.platforms.roborio) {
|
|
|
|
|
nativeUtils.useRequiredLibrary(it, 'ni_link_libraries', 'ni_runtime_libraries')
|
|
|
|
|
}
|
|
|
|
|
}
|
2018-04-29 13:29:07 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
apply from: "${rootDir}/shared/jni/setupBuild.gradle"
|
2015-08-19 11:12:54 -04:00
|
|
|
|
2023-12-29 21:56:38 -08:00
|
|
|
sourceSets.main.java.srcDir "${projectDir}/src/generated/main/java"
|
2018-09-19 21:57:58 -07:00
|
|
|
|
2018-04-29 13:29:07 -07:00
|
|
|
cppSourcesZip {
|
|
|
|
|
from('src/main/native/athena') {
|
|
|
|
|
into '/athena'
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
from('src/main/native/sim') {
|
|
|
|
|
into '/sim'
|
|
|
|
|
}
|
2017-08-18 21:35:53 -07:00
|
|
|
}
|
2016-10-25 20:46:09 -07:00
|
|
|
|
2018-09-19 21:57:58 -07:00
|
|
|
cppHeadersZip {
|
|
|
|
|
from(generatedHeaders) {
|
2018-09-21 10:51:17 -07:00
|
|
|
into '/'
|
2018-09-19 21:57:58 -07:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2021-09-19 17:59:14 -07:00
|
|
|
Action<List<String>> symbolFilter = { symbols ->
|
|
|
|
|
symbols.removeIf({ !it.startsWith('HAL_') && !it.startsWith('HALSIM_') })
|
|
|
|
|
} as Action<List<String>>;
|
|
|
|
|
|
2019-06-28 14:09:10 -07:00
|
|
|
nativeUtils.exportsConfigs {
|
|
|
|
|
hal {
|
|
|
|
|
}
|
|
|
|
|
halJNI {
|
2021-09-19 17:59:14 -07:00
|
|
|
x64SymbolFilter = symbolFilter
|
2017-08-18 21:35:53 -07:00
|
|
|
}
|
2016-10-25 20:46:09 -07:00
|
|
|
}
|
2019-11-13 21:35:52 -08:00
|
|
|
|
|
|
|
|
model {
|
|
|
|
|
binaries {
|
|
|
|
|
all {
|
|
|
|
|
if (!(it instanceof NativeBinarySpec)) return
|
2020-12-30 16:17:20 -08:00
|
|
|
if (it.component.name != 'hal' && it.component.name != 'halBase') return
|
|
|
|
|
if (it.targetPlatform.name != nativeUtils.wpi.platforms.roborio) return
|
2021-09-19 17:59:14 -07:00
|
|
|
nativeUtils.useRequiredLibrary(it, 'ni_link_libraries')
|
2019-11-13 21:35:52 -08:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|