[build] Remove RoboRIO specializations from build system (#7670)

This commit is contained in:
Thad House
2025-01-13 11:23:54 -08:00
committed by GitHub
parent 666d1638ce
commit 09a6bc9a25
31 changed files with 25 additions and 139 deletions

View File

@@ -61,9 +61,6 @@ model {
lib project: ':cscore', library: 'cscore', linkage: 'static'
lib project: ':wpinet', library: 'wpinet', linkage: 'static'
lib project: ':wpiutil', library: 'wpiutil', linkage: 'static'
if (binary.targetPlatform.name == nativeUtils.wpi.platforms.roborio) {
nativeUtils.useRequiredLibrary(binary, 'ni_link_libraries', 'ni_runtime_libraries')
}
}
}
}

View File

@@ -88,9 +88,6 @@ model {
lib project: ':wpinet', library: 'wpinet', linkage: 'shared'
lib project: ':wpiutil', library: 'wpiutil', linkage: 'shared'
lib project: ':thirdparty:googletest', library: 'googletest', linkage: 'static'
if (binary.targetPlatform.name == nativeUtils.wpi.platforms.roborio) {
nativeUtils.useRequiredLibrary(binary, 'ni_link_libraries', 'ni_runtime_libraries')
}
} else {
binary.sources {
simCpp(CppSourceSet) {

View File

@@ -22,7 +22,6 @@ model {
enableCheckTask true
javaCompileTasks << compileJava
jniCrossCompileOptions << JniCrossCompileOptions(nativeUtils.wpi.platforms.roborio)
jniCrossCompileOptions << JniCrossCompileOptions(nativeUtils.wpi.platforms.systemcore)
jniCrossCompileOptions << JniCrossCompileOptions(nativeUtils.wpi.platforms.linuxarm32)
jniCrossCompileOptions << JniCrossCompileOptions(nativeUtils.wpi.platforms.linuxarm64)
@@ -187,7 +186,7 @@ model {
lib project: ':wpigui', library: 'wpigui', linkage: 'static'
lib library: 'cscore', linkage: 'shared'
lib project: ':thirdparty:imgui_suite', library: 'imguiSuite', linkage: 'static'
if (it.targetPlatform.name == nativeUtils.wpi.platforms.roborio || it.targetPlatform.name == nativeUtils.wpi.platforms.systemcore) {
if (it.targetPlatform.name == nativeUtils.wpi.platforms.systemcore) {
it.buildable = false
return
}
@@ -201,9 +200,6 @@ model {
it.linker.args << '-lGL'
}
}
if (it.targetPlatform.name == nativeUtils.wpi.platforms.roborio) {
nativeUtils.useRequiredLibrary(it, 'ni_link_libraries', 'ni_runtime_libraries')
}
}
sources.cpp.source {
srcDirs 'examples/' + "${key}"
@@ -218,9 +214,6 @@ model {
lib project: ':wpiutil', library: 'wpiutil', linkage: 'shared'
lib project: ':wpinet', library: 'wpinet', linkage: 'shared'
lib library: 'cscore', linkage: 'shared'
if (it.targetPlatform.name == nativeUtils.wpi.platforms.roborio) {
nativeUtils.useRequiredLibrary(it, 'ni_link_libraries', 'ni_runtime_libraries')
}
}
sources.cpp.source {
srcDirs 'examples/' + "${key}"

View File

@@ -93,7 +93,7 @@ model {
}
}
binaries.all {
if (it.targetPlatform.name == nativeUtils.wpi.platforms.roborio || it.targetPlatform.name == nativeUtils.wpi.platforms.systemcore) {
if (it.targetPlatform.name == nativeUtils.wpi.platforms.systemcore) {
it.buildable = false
return
}

View File

@@ -85,7 +85,7 @@ model {
}
}
binaries.all {
if (it.targetPlatform.name == nativeUtils.wpi.platforms.roborio || it.targetPlatform.name == nativeUtils.wpi.platforms.systemcore) {
if (it.targetPlatform.name == nativeUtils.wpi.platforms.systemcore) {
it.buildable = false
return
}
@@ -112,7 +112,7 @@ model {
}
}
binaries.all {
if (it.targetPlatform.name == nativeUtils.wpi.platforms.roborio || it.targetPlatform.name == nativeUtils.wpi.platforms.systemcore) {
if (it.targetPlatform.name == nativeUtils.wpi.platforms.systemcore) {
it.buildable = false
return
}
@@ -153,7 +153,7 @@ model {
}
}
binaries.all {
if (it.targetPlatform.name == nativeUtils.wpi.platforms.roborio || it.targetPlatform.name == nativeUtils.wpi.platforms.systemcore) {
if (it.targetPlatform.name == nativeUtils.wpi.platforms.systemcore) {
it.buildable = false
return
}

View File

@@ -10,23 +10,9 @@ ext {
nativeName = 'hal'
setBaseName = 'wpiHal'
devMain = 'edu.wpi.first.hal.DevMain'
niLibraries = true
generatedHeaders = "src/generated/main/native/include"
splitSetup = {
if (it.targetPlatform.name == nativeUtils.wpi.platforms.roborio) {
it.sources {
athenaCpp(CppSourceSet) {
source {
srcDirs = ['src/main/native/athena']
include '**/*.cpp'
}
exportedHeaders {
srcDir 'src/main/native/include'
srcDir generatedHeaders
}
}
}
} else if (it.targetPlatform.name == nativeUtils.wpi.platforms.systemcore) {
if (it.targetPlatform.name == nativeUtils.wpi.platforms.systemcore) {
it.sources {
systemCoreCpp(CppSourceSet) {
source {
@@ -69,9 +55,6 @@ ext {
}
}
exeSplitSetup = {
if (it.targetPlatform.name == nativeUtils.wpi.platforms.roborio) {
nativeUtils.useRequiredLibrary(it, 'ni_link_libraries', 'ni_runtime_libraries')
}
}
}
@@ -111,17 +94,6 @@ nativeUtils.exportsConfigs {
}
}
model {
binaries {
all {
if (!(it instanceof NativeBinarySpec)) return
if (it.component.name != 'hal' && it.component.name != 'halBase') return
if (it.targetPlatform.name != nativeUtils.wpi.platforms.roborio) return
nativeUtils.useRequiredLibrary(it, 'ni_link_libraries')
}
}
}
model {
components {
all {

View File

@@ -74,9 +74,6 @@ model {
project(':ntcore').addNtcoreDependency(binary, 'static')
lib project: ':wpinet', library: 'wpinet', linkage: 'static'
lib project: ':wpiutil', library: 'wpiutil', linkage: 'static'
if (binary.targetPlatform.name == nativeUtils.wpi.platforms.roborio) {
nativeUtils.useRequiredLibrary(binary, 'netcomm', 'chipobject_headers')
}
}
}
}

View File

@@ -91,7 +91,7 @@ model {
}
}
binaries.all {
if (it.targetPlatform.name == nativeUtils.wpi.platforms.roborio || it.targetPlatform.name == nativeUtils.wpi.platforms.systemcore) {
if (it.targetPlatform.name == nativeUtils.wpi.platforms.systemcore) {
it.buildable = false
return
}

View File

@@ -33,7 +33,7 @@ model {
"${nativeName}"(NativeExecutableSpec) {
baseName = 'processstarter'
binaries.all {
if (it.targetPlatform.name == nativeUtils.wpi.platforms.roborio || it.targetPlatform.name == nativeUtils.wpi.platforms.systemcore) {
if (it.targetPlatform.name == nativeUtils.wpi.platforms.systemcore) {
it.buildable = false
return
}

View File

@@ -14,7 +14,6 @@ nativeUtils {
wpi {
configureDependencies {
opencvYear = "frc2025"
niLibVersion = "2025.0.0"
opencvVersion = "4.10.0-3"
}
}

View File

@@ -82,9 +82,6 @@ model {
lib library: nativeName, linkage: 'shared'
if (!project.hasProperty('noWpiutil')) {
lib project: ':wpiutil', library: 'wpiutil', linkage: 'shared'
if (it.targetPlatform.name == nativeUtils.wpi.platforms.roborio) {
nativeUtils.useRequiredLibrary(it, 'ni_link_libraries', 'ni_runtime_libraries')
}
}
if (project.hasProperty('exeSplitSetup')) {
exeSplitSetup(it)
@@ -133,9 +130,6 @@ model {
if (!project.hasProperty('noWpiutil')) {
lib project: ':wpiutil', library: 'wpiutil', linkage: 'shared'
lib project: ':wpiutil', library: 'wpiutilTestLib', linkage: 'shared'
if (it.targetPlatform.name == nativeUtils.wpi.platforms.roborio) {
nativeUtils.useRequiredLibrary(it, 'ni_link_libraries', 'ni_runtime_libraries')
}
}
if (project.hasProperty('exeSplitSetup')) {
exeSplitSetup(it)

View File

@@ -110,7 +110,6 @@ model {
enableCheckTask !project.hasProperty('skipJniCheck')
javaCompileTasks << compileJava
jniCrossCompileOptions << JniCrossCompileOptions(nativeUtils.wpi.platforms.roborio)
jniCrossCompileOptions << JniCrossCompileOptions(nativeUtils.wpi.platforms.systemcore)
jniCrossCompileOptions << JniCrossCompileOptions(nativeUtils.wpi.platforms.linuxarm32)
jniCrossCompileOptions << JniCrossCompileOptions(nativeUtils.wpi.platforms.linuxarm64)
@@ -159,7 +158,6 @@ model {
enableCheckTask !project.hasProperty('skipJniCheck')
javaCompileTasks << compileJava
jniCrossCompileOptions << JniCrossCompileOptions(nativeUtils.wpi.platforms.roborio)
jniCrossCompileOptions << JniCrossCompileOptions(nativeUtils.wpi.platforms.systemcore)
jniCrossCompileOptions << JniCrossCompileOptions(nativeUtils.wpi.platforms.linuxarm32)
jniCrossCompileOptions << JniCrossCompileOptions(nativeUtils.wpi.platforms.linuxarm64)
@@ -218,9 +216,6 @@ model {
if (!project.hasProperty('noWpiutil')) {
lib project: ':wpiutil', library: 'wpiutil', linkage: 'shared'
lib project: ':wpiutil', library: 'wpiutilJNIShared', linkage: 'shared'
if (it.targetPlatform.name == nativeUtils.wpi.platforms.roborio) {
nativeUtils.useRequiredLibrary(it, 'ni_link_libraries', 'ni_runtime_libraries')
}
}
if (project.hasProperty('exeSplitSetup')) {
exeSplitSetup(it)
@@ -271,9 +266,6 @@ model {
if (!project.hasProperty('noWpiutil')) {
lib project: ':wpiutil', library: 'wpiutil', linkage: 'shared'
lib project: ':wpiutil', library: 'wpiutilTestLib', linkage: 'shared'
if (it.targetPlatform.name == nativeUtils.wpi.platforms.roborio) {
nativeUtils.useRequiredLibrary(it, 'ni_link_libraries', 'ni_runtime_libraries')
}
}
if (project.hasProperty('exeSplitSetup')) {
exeSplitSetup(it)

View File

@@ -68,9 +68,6 @@ if (!project.hasProperty('onlylinuxathena') && !project.hasProperty('onlylinuxsy
lib project: ':wpinet', library: 'wpinet', linkage: 'shared'
}
lib project: ':wpiutil', library: 'wpiutil', linkage: 'shared'
if (it.targetPlatform.name == nativeUtils.wpi.platforms.roborio) {
nativeUtils.useRequiredLibrary(it, 'ni_link_libraries', 'ni_runtime_libraries')
}
} else {
it.buildable = false
}

View File

@@ -52,9 +52,6 @@ model {
lib project: ':wpinet', library: 'wpinet', linkage: 'shared'
lib project: ':wpiutil', library: 'wpiutil', linkage: 'shared'
lib library: pluginName, linkage: 'shared'
if (it.targetPlatform.name == nativeUtils.wpi.platforms.roborio) {
nativeUtils.useRequiredLibrary(it, 'ni_link_libraries', 'ni_runtime_libraries')
}
}
}
}

View File

@@ -32,7 +32,7 @@ model {
lib project: ':wpiutil', library: 'wpiutil', linkage: 'shared'
lib project: ':fieldImages', library: 'fieldImages', linkage: 'static'
lib project: ':thirdparty:imgui_suite', library: 'imguiSuite', linkage: 'static'
if (it.targetPlatform.name == nativeUtils.wpi.platforms.roborio || it.targetPlatform.name == nativeUtils.wpi.platforms.systemcore) {
if (it.targetPlatform.name == nativeUtils.wpi.platforms.systemcore) {
it.buildable = false
return
}

View File

@@ -23,7 +23,7 @@ apply from: "${rootDir}/shared/plugins/setupBuild.gradle"
model {
binaries {
all {
if (it.targetPlatform.name == nativeUtils.wpi.platforms.roborio || it.targetPlatform.name == nativeUtils.wpi.platforms.systemcore) {
if (it.targetPlatform.name == nativeUtils.wpi.platforms.systemcore) {
it.buildable = false
return
}

View File

@@ -50,7 +50,7 @@ model {
}
binaries {
all {
if (it.targetPlatform.name == nativeUtils.wpi.platforms.roborio || it.targetPlatform.name == nativeUtils.wpi.platforms.systemcore) {
if (it.targetPlatform.name == nativeUtils.wpi.platforms.systemcore) {
it.buildable = false
return
}

View File

@@ -44,7 +44,7 @@ model {
binaries {
all {
if (it.targetPlatform.name == nativeUtils.wpi.platforms.roborio || it.targetPlatform.name == nativeUtils.wpi.platforms.systemcore) {
if (it.targetPlatform.name == nativeUtils.wpi.platforms.systemcore) {
it.buildable = false
return
}
@@ -59,9 +59,6 @@ model {
project(':ntcore').addNtcoreDependency(it, 'shared')
lib project: ':wpiutil', library: 'wpiutil', linkage: 'shared'
lib library: pluginName, linkage: 'shared'
if (it.targetPlatform.name == nativeUtils.wpi.platforms.roborio) {
nativeUtils.useRequiredLibrary(it, 'ni_link_libraries', 'ni_runtime_libraries')
}
}
}
}

View File

@@ -23,7 +23,7 @@ apply from: "${rootDir}/shared/plugins/setupBuild.gradle"
model {
binaries {
all {
if (it.targetPlatform.name == nativeUtils.wpi.platforms.roborio || it.targetPlatform.name == nativeUtils.wpi.platforms.systemcore) {
if (it.targetPlatform.name == nativeUtils.wpi.platforms.systemcore) {
it.buildable = false
return
}

View File

@@ -92,7 +92,7 @@ model {
}
}
binaries.all {
if (it.targetPlatform.name == nativeUtils.wpi.platforms.roborio || it.targetPlatform.name == nativeUtils.wpi.platforms.systemcore) {
if (it.targetPlatform.name == nativeUtils.wpi.platforms.systemcore) {
it.buildable = false
return
}
@@ -131,7 +131,7 @@ model {
include "**/*.cpp"
}
binaries.all {
if (it.targetPlatform.name == nativeUtils.wpi.platforms.roborio || it.targetPlatform.name == nativeUtils.wpi.platforms.systemcore) {
if (it.targetPlatform.name == nativeUtils.wpi.platforms.systemcore) {
it.buildable = false
return
}

View File

@@ -49,7 +49,7 @@ model {
}
}
binaries.all {
if (it.targetPlatform.name == nativeUtils.wpi.platforms.roborio || it.targetPlatform.name == nativeUtils.wpi.platforms.systemcore) {
if (it.targetPlatform.name == nativeUtils.wpi.platforms.systemcore) {
it.buildable = false
return
}

View File

@@ -152,7 +152,7 @@ model {
}
}
binaries.all {
if (it.targetPlatform.name == nativeUtils.wpi.platforms.roborio || it.targetPlatform.name == nativeUtils.wpi.platforms.systemcore || it.targetPlatform.name.startsWith("linuxarm")) {
if (it.targetPlatform.name == nativeUtils.wpi.platforms.systemcore || it.targetPlatform.name.startsWith("linuxarm")) {
it.buildable = false
return
}
@@ -203,7 +203,7 @@ model {
}
}
binaries.all {
if (it.targetPlatform.name == nativeUtils.wpi.platforms.roborio || it.targetPlatform.name == nativeUtils.wpi.platforms.systemcore || it.targetPlatform.name.startsWith("linuxarm")) {
if (it.targetPlatform.name == nativeUtils.wpi.platforms.systemcore || it.targetPlatform.name.startsWith("linuxarm")) {
it.buildable = false
return
}

View File

@@ -36,7 +36,7 @@ model {
}
binaries.all {
lib project: ':thirdparty:imgui_suite', library: 'imguiSuite', linkage: 'static'
if (it.targetPlatform.name == nativeUtils.wpi.platforms.roborio || it.targetPlatform.name == nativeUtils.wpi.platforms.systemcore) {
if (it.targetPlatform.name == nativeUtils.wpi.platforms.systemcore) {
it.buildable = false
return
}
@@ -105,7 +105,7 @@ model {
}
binaries {
all {
if (it.targetPlatform.name == nativeUtils.wpi.platforms.roborio || it.targetPlatform.name == nativeUtils.wpi.platforms.systemcore) {
if (it.targetPlatform.name == nativeUtils.wpi.platforms.systemcore) {
it.buildable = false
return
}

View File

@@ -74,9 +74,6 @@ model {
nativeUtils.useRequiredLibrary(it, 'opencv_shared')
lib project: ':cscore', library: 'cscore', linkage: 'shared'
}
if ((it instanceof NativeExecutableBinarySpec || it instanceof GoogleTestTestSuiteBinarySpec) && it.targetPlatform.name == nativeUtils.wpi.platforms.roborio) {
nativeUtils.useRequiredLibrary(it, 'ni_link_libraries', 'ni_runtime_libraries')
}
}
}
tasks {

View File

@@ -171,9 +171,6 @@ model {
lib project: ':wpimath', library: 'wpimath', linkage: 'shared'
lib project: ':cameraserver', library: 'cameraserver', linkage: 'shared'
nativeUtils.useRequiredLibrary(it, 'opencv_shared')
if (it.targetPlatform.name == nativeUtils.wpi.platforms.roborio) {
nativeUtils.useRequiredLibrary(it, 'ni_link_libraries', 'ni_runtime_libraries')
}
}
}
}
@@ -223,9 +220,6 @@ model {
lib project: ':cameraserver', library: 'cameraserver', linkage: 'shared'
nativeUtils.useRequiredLibrary(it, 'opencv_shared')
lib library: nativeName, linkage: 'shared'
if (it.targetPlatform.name == nativeUtils.wpi.platforms.roborio) {
nativeUtils.useRequiredLibrary(it, 'ni_link_libraries', 'ni_runtime_libraries')
}
}
}
tasks {

View File

@@ -102,9 +102,6 @@ model {
lib project: ':cameraserver', library: 'cameraserver', linkage: 'shared'
lib project: ':wpinet', library: 'wpinet', linkage: 'shared'
lib project: ':wpiutil', library: 'wpiutil', linkage: 'shared'
if (binary.targetPlatform.name == nativeUtils.wpi.platforms.roborio) {
nativeUtils.useRequiredLibrary(binary, 'ni_link_libraries', 'ni_runtime_libraries')
}
if (binary.targetPlatform.name == getCurrentArch()) {
simModules.each {
lib project: ":simulation:$it", library: it, linkage: 'shared'
@@ -153,9 +150,6 @@ model {
lib project: ':cameraserver', library: 'cameraserver', linkage: 'shared'
lib project: ':wpinet', library: 'wpinet', linkage: 'shared'
lib project: ':wpiutil', library: 'wpiutil', linkage: 'shared'
if (binary.targetPlatform.name == nativeUtils.wpi.platforms.roborio) {
nativeUtils.useRequiredLibrary(binary, 'ni_link_libraries', 'ni_runtime_libraries')
}
}
sources {
cpp {
@@ -221,9 +215,6 @@ model {
lib project: ':cameraserver', library: 'cameraserver', linkage: 'shared'
lib project: ':wpinet', library: 'wpinet', linkage: 'shared'
lib project: ':wpiutil', library: 'wpiutil', linkage: 'shared'
if (it.targetPlatform.name == nativeUtils.wpi.platforms.roborio) {
nativeUtils.useRequiredLibrary(it, 'ni_link_libraries', 'ni_runtime_libraries')
}
nativeUtils.useRequiredLibrary(it, 'opencv_shared')
it.cppCompiler.define('RUNNING_FRC_TESTS')

View File

@@ -53,9 +53,6 @@ model {
lib project: ':wpinet', library: 'wpinet', linkage: 'shared'
lib project: ':cameraserver', library: 'cameraserver', linkage: 'shared'
lib project: ':thirdparty:googletest', library: 'googletest', linkage: 'static'
if (binary.targetPlatform.name == nativeUtils.wpi.platforms.roborio) {
nativeUtils.useRequiredLibrary(binary, 'ni_link_libraries', 'ni_runtime_libraries')
}
} else {
binary.sources {
simCpp(CppSourceSet) {

View File

@@ -119,9 +119,6 @@ model {
lib project: ':cameraserver', library: 'cameraserver', linkage: 'shared'
project(':hal').addHalDependency(it, 'shared')
project(':hal').addHalJniDependency(it)
if (it.targetPlatform.name == nativeUtils.wpi.platforms.roborio) {
nativeUtils.useRequiredLibrary(it, 'ni_link_libraries', 'ni_runtime_libraries')
}
}
}
}

View File

@@ -110,14 +110,12 @@ model {
lib project: ':wpiutil', library: 'wpiutilJNIShared', linkage: 'shared'
lib project: ':wpinet', library: 'wpinet', linkage: 'shared'
lib project: ':wpinet', library: 'wpinetJNIShared', linkage: 'shared'
if (binary.targetPlatform.name == nativeUtils.wpi.platforms.roborio) {
nativeUtils.useRequiredLibrary(binary, 'ni_link_libraries', 'ni_runtime_libraries')
} else {
def systemArch = getCurrentArch()
if (binary.targetPlatform.name == systemArch) {
lib project: ":simulation:halsim_gui", library: 'halsim_gui', linkage: 'shared'
}
def systemArch = getCurrentArch()
if (binary.targetPlatform.name == systemArch) {
lib project: ":simulation:halsim_gui", library: 'halsim_gui', linkage: 'shared'
}
nativeUtils.useRequiredLibrary(binary, 'opencv_shared')
}
}

View File

@@ -218,9 +218,6 @@ model {
binaries.all {
lib library: 'wpinet', linkage: 'shared'
lib project: ':wpiutil', library: 'wpiutil', linkage: 'shared'
if (it.targetPlatform.name == nativeUtils.wpi.platforms.roborio) {
nativeUtils.useRequiredLibrary(it, 'ni_link_libraries', 'ni_runtime_libraries')
}
}
sources {
cpp {
@@ -246,9 +243,6 @@ model {
binaries.all { binary ->
lib project: ':wpinet', library: 'wpinet', linkage: 'static'
lib project: ':wpiutil', library: 'wpiutil', linkage: 'static'
if (binary.targetPlatform.name == nativeUtils.wpi.platforms.roborio) {
nativeUtils.useRequiredLibrary(binary, 'ni_link_libraries', 'ni_runtime_libraries')
}
if (binary.targetPlatform.operatingSystem.isLinux()) {
linker.args "-lutil"
}
@@ -268,9 +262,6 @@ model {
binaries.all { binary ->
lib project: ':wpinet', library: 'wpinet', linkage: 'static'
lib project: ':wpiutil', library: 'wpiutil', linkage: 'static'
if (binary.targetPlatform.name == nativeUtils.wpi.platforms.roborio) {
nativeUtils.useRequiredLibrary(binary, 'ni_link_libraries', 'ni_runtime_libraries')
}
}
}
}

View File

@@ -293,17 +293,6 @@ model {
}
}
model {
binaries {
all {
if (!(it instanceof NativeBinarySpec)) return
if (it.component.name != 'wpiutil' && it.component.name != 'wpiutilBase') return
if (it.targetPlatform.name != nativeUtils.wpi.platforms.roborio) return
nativeUtils.useRequiredLibrary(it, 'chipobject_headers')
}
}
}
sourceSets {
printlog
}