Files
allwpilib/ntcore/build.gradle
DeltaDizzy da47f06d70 [datalog] Move all DataLog functionality to new datalog library (#7641)
Currently the major DataLog backend API (reading and writing) is split between wpiutil and glass. In the interest of allowing code that wants to use these APIs to not need to link to glass and declutter wpiutil, all of those APIs are moved to a new library named "datalog".

Signed-off-by: Jade Turner <spacey-sooty@proton.me>
Co-authored-by: Jade Turner <spacey-sooty@proton.me>
Co-authored-by: Gold856 <117957790+Gold856@users.noreply.github.com>
2025-02-19 21:08:17 -08:00

72 lines
2.0 KiB
Groovy

ext {
addNtcoreDependency = { binary, shared->
binary.lib project: ':ntcore', library: 'ntcore', linkage: shared
binary.lib project: ':datalog', library: 'datalog', linkage: shared
}
addNtcoreJniDependency = { binary->
binary.lib project: ':ntcore', library: 'ntcoreJNIShared', linkage: 'shared'
binary.lib project: ':datalog', library: 'datalogJNIShared', linkage: 'shared'
}
nativeName = 'ntcore'
devMain = 'edu.wpi.first.ntcore.DevMain'
generatedSources = "$projectDir/src/generated/main/native/cpp"
generatedHeaders = "$projectDir/src/generated/main/native/include"
jniSplitSetup = {
}
splitSetup = {
it.tasks.withType(CppCompile) {
it.includes 'src/main/native/cpp'
}
}
exeSplitSetup = {
}
}
apply from: "${rootDir}/shared/jni/setupBuild.gradle"
model {
components {}
binaries {
all {
if (!it.buildable || !(it instanceof NativeBinarySpec)) {
return
}
if (it.component.name == "${nativeName}JNI") {
lib project: ':wpinet', library: 'wpinet', linkage: 'static'
lib project: ':wpiutil', library: 'wpiutil', linkage: 'static'
lib project: ':datalog', library: 'datalog', linkage: 'static'
} else {
lib project: ':wpinet', library: 'wpinet', linkage: 'shared'
lib project: ':wpiutil', library: 'wpiutil', linkage: 'shared'
lib project: ':datalog', library: 'datalog', linkage: 'shared'
}
}
}
}
sourceSets.main.java.srcDir "${projectDir}/src/generated/main/java"
cppHeadersZip {
from(generatedHeaders) {
into '/'
}
}
Action<List<String>> symbolFilter = { symbols ->
symbols.removeIf({ !it.startsWith('NT_') })
} as Action<List<String>>;
nativeUtils.exportsConfigs {
ntcore {
}
ntcoreJNI {
x64SymbolFilter = symbolFilter
}
}
dependencies {
api project(":datalog")
}