mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-19 00:41:43 +00:00
Gradle publishing does not capture all of the source files that are used during a build. This should get most of them, and get it equivalent to what bazel pushes out.
123 lines
3.2 KiB
Groovy
123 lines
3.2 KiB
Groovy
ext {
|
|
useJava = true
|
|
useCpp = true
|
|
baseId = 'wpimath'
|
|
groupId = 'edu.wpi.first.wpimath'
|
|
|
|
nativeName = 'wpimath'
|
|
devMain = 'edu.wpi.first.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 "org.ejml:ejml-simple:0.43.1"
|
|
api "com.fasterxml.jackson.core:jackson-annotations:2.15.2"
|
|
api "com.fasterxml.jackson.core:jackson-core:2.15.2"
|
|
api "com.fasterxml.jackson.core:jackson-databind:2.15.2"
|
|
api "us.hebi.quickbuf:quickbuf-runtime:1.3.3"
|
|
}
|
|
|
|
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)
|