mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-19 00:41:43 +00:00
Also fixes the google compile-testing library to 0.23.0 (the latest available at time of writing) instead of a wildcard Jackson versions were inconsistent across projects; most were on 2.19.2, but the fields subproject was on 2.15.2. All projects are now on 2.19.2 for consistency
121 lines
3.0 KiB
Groovy
121 lines
3.0 KiB
Groovy
ext {
|
|
useJava = true
|
|
useCpp = true
|
|
baseId = 'wpimath'
|
|
groupId = 'org.wpilib.wpimath'
|
|
|
|
nativeName = 'wpimath'
|
|
devMain = 'org.wpilib.math.DevMain'
|
|
|
|
splitSetup = {
|
|
it.sources {
|
|
sleipnirCpp(CppSourceSet) {
|
|
source {
|
|
srcDirs 'src/main/native/thirdparty/sleipnir/src'
|
|
include '**/*.cpp'
|
|
}
|
|
exportedHeaders {
|
|
srcDirs 'src/main/native/thirdparty/eigen/include',
|
|
'src/main/native/thirdparty/fmt/include',
|
|
'src/main/native/thirdparty/sleipnir/include',
|
|
'src/main/native/thirdparty/sleipnir/src'
|
|
}
|
|
}
|
|
nanopbCpp(CppSourceSet) {
|
|
source {
|
|
srcDirs 'src/generated/main/native/cpp'
|
|
include '**/*.cpp'
|
|
}
|
|
exportedHeaders {
|
|
srcDirs 'src/generated/main/native/cpp'
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
apply from: "${rootDir}/shared/jni/setupBuild.gradle"
|
|
|
|
cppHeadersZip {
|
|
from('src/main/native/thirdparty/eigen/include') {
|
|
into '/'
|
|
}
|
|
from('src/main/native/thirdparty/gcem/include') {
|
|
into '/'
|
|
}
|
|
from("src/generated/main/native/cpp/wpimath/protobuf") {
|
|
into '/wpimath/protobuf'
|
|
include '**/*.h'
|
|
}
|
|
from('src/main/native/thirdparty/sleipnir/include') {
|
|
into '/'
|
|
}
|
|
}
|
|
|
|
cppSourcesZip {
|
|
from('src/main/native/thirdparty/sleipnir/src') {
|
|
into '/'
|
|
}
|
|
}
|
|
|
|
model {
|
|
components {
|
|
all {
|
|
it.sources.each {
|
|
it.exportedHeaders {
|
|
srcDirs 'src/main/native/include',
|
|
'src/main/native/thirdparty/eigen/include',
|
|
'src/main/native/thirdparty/gcem/include',
|
|
'src/main/native/thirdparty/sleipnir/include',
|
|
'src/generated/main/native/cpp'
|
|
}
|
|
}
|
|
}
|
|
}
|
|
binaries {
|
|
all {
|
|
it.cppCompiler.define 'SLEIPNIR_EXPORTS'
|
|
}
|
|
}
|
|
}
|
|
|
|
nativeUtils.exportsConfigs {
|
|
wpimath {
|
|
objectFilterClosure = { file ->
|
|
return file.name.endsWith('.pb.obj') || file.name.endsWith('.npb.obj')
|
|
}
|
|
}
|
|
}
|
|
|
|
dependencies {
|
|
api project(":wpiunits")
|
|
api libs.bundles.ejml
|
|
api libs.bundles.jackson
|
|
api libs.quickbuf.runtime
|
|
}
|
|
|
|
sourceSets.main.java.srcDir "${projectDir}/src/generated/main/java"
|
|
sourceSets.main.resources.srcDir "${projectDir}/src/main/proto"
|
|
|
|
task unitsHeaders(type: Zip) {
|
|
destinationDirectory = file("$buildDir/outputs")
|
|
archiveBaseName = zipBaseName
|
|
archiveClassifier = "units"
|
|
|
|
from(licenseFile) {
|
|
into '/'
|
|
}
|
|
|
|
ext.includeDirs = [
|
|
project.file('src/main/native/include/units')
|
|
]
|
|
|
|
ext.includeDirs.each {
|
|
from(it) {
|
|
into '/units'
|
|
}
|
|
}
|
|
}
|
|
|
|
addTaskToCopyAllOutputs(unitsHeaders)
|