Files
allwpilib/datalog/build.gradle
2025-11-07 23:09:21 -08:00

77 lines
1.6 KiB
Groovy

ext {
useJava = true
useCpp = true
baseId = 'datalog'
groupId = 'org.wpilib.datalog'
nativeName = 'datalog'
devMain = 'org.wpilib.datalog.DevMain'
}
apply from: "${rootDir}/shared/jni/setupBuild.gradle"
nativeUtils.exportsConfigs {
datalog {
}
}
model {
components {
all {
it.sources.each {
it.exportedHeaders {
srcDirs 'src/main/native/include'
}
}
}
}
}
def examplesMap = [:];
file("$projectDir/examples").list(new FilenameFilter() {
@Override
public boolean accept(File current, String name) {
return new File(current, name).isDirectory();
}
}).each {
examplesMap.put(it, [])
}
model {
components {
examplesMap.each { key, value ->
"${key}"(NativeExecutableSpec) {
targetBuildTypes 'debug'
binaries.all {
lib library: 'datalog', linkage: 'shared'
lib project: ':wpiutil', library: 'wpiutil', linkage: 'shared'
}
sources {
cpp {
source {
srcDirs 'examples/' + "${key}"
include '**/*.cpp'
}
}
}
}
}
}
}
sourceSets {
printlog
}
task runPrintLog(type: JavaExec) {
classpath = sourceSets.printlog.runtimeClasspath
mainClass = 'printlog.PrintLog'
}
dependencies {
api project(":wpiutil")
printlogImplementation sourceSets.main.output
}