mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-07-02 02:51:42 +00:00
[build] Clean up Gradle configs (#5685)
Putting an early exit if statement at the top instead of wrapping the whole file contents unbreaks unit test configs, as was discovered for SysId. It reduces nesting as well. Unused plugins were removed from the beginnings of files as well.
This commit is contained in:
@@ -1,3 +1,7 @@
|
||||
if (project.hasProperty('onlylinuxathena')) {
|
||||
return;
|
||||
}
|
||||
|
||||
description = "A plugin that listens on a socket so that you can use the real Driver Station software to connect to the simulation"
|
||||
|
||||
ext {
|
||||
@@ -7,7 +11,6 @@ ext {
|
||||
|
||||
apply plugin: 'google-test-test-suite'
|
||||
|
||||
|
||||
ext {
|
||||
staticGtestConfigs = [:]
|
||||
}
|
||||
@@ -17,28 +20,22 @@ apply from: "${rootDir}/shared/googletest.gradle"
|
||||
|
||||
apply from: "${rootDir}/shared/plugins/setupBuild.gradle"
|
||||
|
||||
|
||||
model {
|
||||
testSuites {
|
||||
def comps = $.components
|
||||
if (!project.hasProperty('onlylinuxathena')) {
|
||||
"${pluginName}Test"(GoogleTestTestSuiteSpec) {
|
||||
for(NativeComponentSpec c : comps) {
|
||||
if (c.name == pluginName) {
|
||||
testing c
|
||||
break
|
||||
}
|
||||
"${pluginName}Test"(GoogleTestTestSuiteSpec) {
|
||||
for(NativeComponentSpec c : $.components) {
|
||||
if (c.name == pluginName) {
|
||||
testing c
|
||||
break
|
||||
}
|
||||
sources {
|
||||
cpp {
|
||||
source {
|
||||
srcDirs 'src/test/native/cpp'
|
||||
include '**/*.cpp'
|
||||
}
|
||||
exportedHeaders {
|
||||
srcDirs 'src/test/native/include', 'src/main/native/cpp'
|
||||
}
|
||||
}
|
||||
}
|
||||
sources.cpp {
|
||||
source {
|
||||
srcDirs 'src/test/native/cpp'
|
||||
include '**/*.cpp'
|
||||
}
|
||||
exportedHeaders {
|
||||
srcDirs 'src/test/native/include', 'src/main/native/cpp'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,51 +1,51 @@
|
||||
if (!project.hasProperty('onlylinuxathena')) {
|
||||
if (project.hasProperty('onlylinuxathena')) {
|
||||
return;
|
||||
}
|
||||
|
||||
description = "A plugin that creates a simulation gui"
|
||||
description = "A plugin that creates a simulation gui"
|
||||
|
||||
ext {
|
||||
pluginName = 'halsim_gui'
|
||||
}
|
||||
ext {
|
||||
pluginName = 'halsim_gui'
|
||||
}
|
||||
|
||||
apply plugin: 'google-test-test-suite'
|
||||
apply plugin: 'google-test-test-suite'
|
||||
|
||||
ext {
|
||||
staticGtestConfigs = [:]
|
||||
}
|
||||
|
||||
staticGtestConfigs["${pluginName}Test"] = []
|
||||
apply from: "${rootDir}/shared/googletest.gradle"
|
||||
|
||||
apply from: "${rootDir}/shared/plugins/setupBuild.gradle"
|
||||
|
||||
|
||||
ext {
|
||||
staticGtestConfigs = [:]
|
||||
}
|
||||
apply from: "${rootDir}/shared/imgui.gradle"
|
||||
|
||||
staticGtestConfigs["${pluginName}Test"] = []
|
||||
apply from: "${rootDir}/shared/googletest.gradle"
|
||||
|
||||
apply from: "${rootDir}/shared/plugins/setupBuild.gradle"
|
||||
|
||||
|
||||
apply from: "${rootDir}/shared/imgui.gradle"
|
||||
|
||||
model {
|
||||
binaries {
|
||||
all {
|
||||
lib project: ':glass', library: 'glassnt', linkage: 'static'
|
||||
lib project: ':glass', library: 'glass', linkage: 'static'
|
||||
lib project: ':wpigui', library: 'wpigui', linkage: 'static'
|
||||
lib project: ':wpimath', library: 'wpimath', linkage: 'shared'
|
||||
project(':ntcore').addNtcoreDependency(it, 'shared')
|
||||
lib project: ':wpinet', library: 'wpinet', linkage: 'shared'
|
||||
lib project: ':wpiutil', library: 'wpiutil', linkage: 'shared'
|
||||
lib project: ':fieldImages', library: 'fieldImages', linkage: 'static'
|
||||
nativeUtils.useRequiredLibrary(it, 'imgui')
|
||||
if (it.targetPlatform.name == nativeUtils.wpi.platforms.roborio) {
|
||||
it.buildable = false
|
||||
return
|
||||
}
|
||||
if (it.targetPlatform.operatingSystem.isWindows()) {
|
||||
it.linker.args << 'Gdi32.lib' << 'Shell32.lib' << 'd3d11.lib' << 'd3dcompiler.lib'
|
||||
} else if (it.targetPlatform.operatingSystem.isMacOsX()) {
|
||||
it.linker.args << '-framework' << 'Metal' << '-framework' << 'MetalKit' << '-framework' << 'Cocoa' << '-framework' << 'IOKit' << '-framework' << 'CoreFoundation' << '-framework' << 'CoreVideo' << '-framework' << 'QuartzCore'
|
||||
} else {
|
||||
it.linker.args << '-lX11'
|
||||
if (it.targetPlatform.name.startsWith('linuxarm')) {
|
||||
it.linker.args << '-lGL'
|
||||
}
|
||||
model {
|
||||
binaries {
|
||||
all {
|
||||
lib project: ':glass', library: 'glassnt', linkage: 'static'
|
||||
lib project: ':glass', library: 'glass', linkage: 'static'
|
||||
lib project: ':wpigui', library: 'wpigui', linkage: 'static'
|
||||
lib project: ':wpimath', library: 'wpimath', linkage: 'shared'
|
||||
project(':ntcore').addNtcoreDependency(it, 'shared')
|
||||
lib project: ':wpinet', library: 'wpinet', linkage: 'shared'
|
||||
lib project: ':wpiutil', library: 'wpiutil', linkage: 'shared'
|
||||
lib project: ':fieldImages', library: 'fieldImages', linkage: 'static'
|
||||
nativeUtils.useRequiredLibrary(it, 'imgui')
|
||||
if (it.targetPlatform.name == nativeUtils.wpi.platforms.roborio) {
|
||||
it.buildable = false
|
||||
return
|
||||
}
|
||||
if (it.targetPlatform.operatingSystem.isWindows()) {
|
||||
it.linker.args << 'Gdi32.lib' << 'Shell32.lib' << 'd3d11.lib' << 'd3dcompiler.lib'
|
||||
} else if (it.targetPlatform.operatingSystem.isMacOsX()) {
|
||||
it.linker.args << '-framework' << 'Metal' << '-framework' << 'MetalKit' << '-framework' << 'Cocoa' << '-framework' << 'IOKit' << '-framework' << 'CoreFoundation' << '-framework' << 'CoreVideo' << '-framework' << 'QuartzCore'
|
||||
} else {
|
||||
it.linker.args << '-lX11'
|
||||
if (it.targetPlatform.name.startsWith('linuxarm')) {
|
||||
it.linker.args << '-lGL'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,35 +1,35 @@
|
||||
if (!project.hasProperty('onlylinuxathena')) {
|
||||
if (project.hasProperty('onlylinuxathena')) {
|
||||
return;
|
||||
}
|
||||
|
||||
description = "WebSocket Client Extension"
|
||||
description = "WebSocket Client Extension"
|
||||
|
||||
ext {
|
||||
includeWpiutil = true
|
||||
pluginName = 'halsim_ws_client'
|
||||
}
|
||||
ext {
|
||||
includeWpiutil = true
|
||||
pluginName = 'halsim_ws_client'
|
||||
}
|
||||
|
||||
apply plugin: 'google-test-test-suite'
|
||||
apply plugin: 'google-test-test-suite'
|
||||
|
||||
ext {
|
||||
staticGtestConfigs = [:]
|
||||
}
|
||||
|
||||
ext {
|
||||
staticGtestConfigs = [:]
|
||||
}
|
||||
staticGtestConfigs["${pluginName}Test"] = []
|
||||
apply from: "${rootDir}/shared/googletest.gradle"
|
||||
|
||||
staticGtestConfigs["${pluginName}Test"] = []
|
||||
apply from: "${rootDir}/shared/googletest.gradle"
|
||||
apply from: "${rootDir}/shared/plugins/setupBuild.gradle"
|
||||
|
||||
apply from: "${rootDir}/shared/plugins/setupBuild.gradle"
|
||||
|
||||
model {
|
||||
binaries {
|
||||
all {
|
||||
if (it.targetPlatform.name == nativeUtils.wpi.platforms.roborio) {
|
||||
it.buildable = false
|
||||
return
|
||||
}
|
||||
|
||||
lib project: ':wpinet', library: 'wpinet', linkage: 'shared'
|
||||
lib project: ":simulation:halsim_ws_core", library: "halsim_ws_core", linkage: "static"
|
||||
model {
|
||||
binaries {
|
||||
all {
|
||||
if (it.targetPlatform.name == nativeUtils.wpi.platforms.roborio) {
|
||||
it.buildable = false
|
||||
return
|
||||
}
|
||||
|
||||
lib project: ':wpinet', library: 'wpinet', linkage: 'shared'
|
||||
lib project: ":simulation:halsim_ws_core", library: "halsim_ws_core", linkage: "static"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,58 +1,57 @@
|
||||
if (project.hasProperty('onlylinuxathena')) {
|
||||
return;
|
||||
}
|
||||
|
||||
apply plugin: 'cpp'
|
||||
apply plugin: 'edu.wpi.first.NativeUtils'
|
||||
apply plugin: ExtraTasks
|
||||
|
||||
if (!project.hasProperty('onlylinuxathena')) {
|
||||
description = "Core library for WebSocket extensions"
|
||||
|
||||
description = "Core library for WebSocket extensions"
|
||||
ext {
|
||||
includeWpiutil = true
|
||||
includeWpinet = true
|
||||
pluginName = 'halsim_ws_core'
|
||||
}
|
||||
|
||||
ext {
|
||||
includeWpiutil = true
|
||||
includeWpinet = true
|
||||
pluginName = 'halsim_ws_core'
|
||||
}
|
||||
|
||||
apply plugin: 'google-test-test-suite'
|
||||
apply plugin: 'google-test-test-suite'
|
||||
|
||||
|
||||
ext {
|
||||
staticGtestConfigs = [:]
|
||||
}
|
||||
ext {
|
||||
staticGtestConfigs = [:]
|
||||
}
|
||||
|
||||
staticGtestConfigs["${pluginName}Test"] = []
|
||||
apply from: "${rootDir}/shared/googletest.gradle"
|
||||
staticGtestConfigs["${pluginName}Test"] = []
|
||||
apply from: "${rootDir}/shared/googletest.gradle"
|
||||
|
||||
apply from: "${rootDir}/shared/config.gradle"
|
||||
apply from: "${rootDir}/shared/plugins/publish.gradle"
|
||||
apply from: "${rootDir}/shared/config.gradle"
|
||||
apply from: "${rootDir}/shared/plugins/publish.gradle"
|
||||
|
||||
model {
|
||||
components {
|
||||
halsim_ws_core(NativeLibrarySpec) {
|
||||
sources {
|
||||
cpp {
|
||||
source {
|
||||
srcDirs = ['src/main/native/cpp']
|
||||
includes = ["**/*.cpp"]
|
||||
}
|
||||
exportedHeaders {
|
||||
srcDirs = ["src/main/native/include"]
|
||||
}
|
||||
}
|
||||
model {
|
||||
components {
|
||||
halsim_ws_core(NativeLibrarySpec) {
|
||||
sources.cpp {
|
||||
source {
|
||||
srcDirs = ['src/main/native/cpp']
|
||||
includes = ["**/*.cpp"]
|
||||
}
|
||||
binaries.all {
|
||||
project(':hal').addHalDependency(it, 'shared')
|
||||
lib project: ':wpinet', library: 'wpinet', linkage: 'shared'
|
||||
lib project: ':wpiutil', library: 'wpiutil', linkage: 'shared'
|
||||
exportedHeaders {
|
||||
srcDirs = ["src/main/native/include"]
|
||||
}
|
||||
appendDebugPathToBinaries(binaries)
|
||||
}
|
||||
binaries.all {
|
||||
project(':hal').addHalDependency(it, 'shared')
|
||||
lib project: ':wpinet', library: 'wpinet', linkage: 'shared'
|
||||
lib project: ':wpiutil', library: 'wpiutil', linkage: 'shared'
|
||||
}
|
||||
appendDebugPathToBinaries(binaries)
|
||||
}
|
||||
binaries {
|
||||
all {
|
||||
if (it.targetPlatform.name == nativeUtils.wpi.platforms.roborio) {
|
||||
it.buildable = false
|
||||
return
|
||||
}
|
||||
}
|
||||
binaries {
|
||||
all {
|
||||
if (it.targetPlatform.name == nativeUtils.wpi.platforms.roborio) {
|
||||
it.buildable = false
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
if (project.hasProperty('onlylinuxathena')) {
|
||||
return;
|
||||
}
|
||||
|
||||
description = "WebSocket Server Extension"
|
||||
|
||||
@@ -20,25 +23,20 @@ apply from: "${rootDir}/shared/plugins/setupBuild.gradle"
|
||||
|
||||
model {
|
||||
testSuites {
|
||||
def comps = $.components
|
||||
if (!project.hasProperty('onlylinuxathena')) {
|
||||
"${pluginName}Test"(GoogleTestTestSuiteSpec) {
|
||||
for(NativeComponentSpec c : comps) {
|
||||
if (c.name == pluginName) {
|
||||
testing c
|
||||
break
|
||||
}
|
||||
"${pluginName}Test"(GoogleTestTestSuiteSpec) {
|
||||
for(NativeComponentSpec c : $.components) {
|
||||
if (c.name == pluginName) {
|
||||
testing c
|
||||
break
|
||||
}
|
||||
sources {
|
||||
cpp {
|
||||
source {
|
||||
srcDirs 'src/test/native/cpp'
|
||||
include '**/*.cpp'
|
||||
}
|
||||
exportedHeaders {
|
||||
srcDirs 'src/test/native/include', 'src/main/native/cpp'
|
||||
}
|
||||
}
|
||||
}
|
||||
sources.cpp {
|
||||
source {
|
||||
srcDirs 'src/test/native/cpp'
|
||||
include '**/*.cpp'
|
||||
}
|
||||
exportedHeaders {
|
||||
srcDirs 'src/test/native/include', 'src/main/native/cpp'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,35 +1,35 @@
|
||||
if (!project.hasProperty('onlylinuxathena')) {
|
||||
if (project.hasProperty('onlylinuxathena')) {
|
||||
return;
|
||||
}
|
||||
|
||||
description = "XRP Extension"
|
||||
description = "XRP Extension"
|
||||
|
||||
ext {
|
||||
includeWpiutil = true
|
||||
pluginName = 'halsim_xrp'
|
||||
}
|
||||
ext {
|
||||
includeWpiutil = true
|
||||
pluginName = 'halsim_xrp'
|
||||
}
|
||||
|
||||
apply plugin: 'google-test-test-suite'
|
||||
apply plugin: 'google-test-test-suite'
|
||||
|
||||
ext {
|
||||
staticGtestConfigs = [:]
|
||||
}
|
||||
|
||||
ext {
|
||||
staticGtestConfigs = [:]
|
||||
}
|
||||
staticGtestConfigs["${pluginName}Test"] = []
|
||||
apply from: "${rootDir}/shared/googletest.gradle"
|
||||
|
||||
staticGtestConfigs["${pluginName}Test"] = []
|
||||
apply from: "${rootDir}/shared/googletest.gradle"
|
||||
apply from: "${rootDir}/shared/plugins/setupBuild.gradle"
|
||||
|
||||
apply from: "${rootDir}/shared/plugins/setupBuild.gradle"
|
||||
|
||||
model {
|
||||
binaries {
|
||||
all {
|
||||
if (it.targetPlatform.name == nativeUtils.wpi.platforms.roborio) {
|
||||
it.buildable = false
|
||||
return
|
||||
}
|
||||
|
||||
lib project: ':wpinet', library: 'wpinet', linkage: 'shared'
|
||||
lib project: ":simulation:halsim_ws_core", library: "halsim_ws_core", linkage: "static"
|
||||
model {
|
||||
binaries {
|
||||
all {
|
||||
if (it.targetPlatform.name == nativeUtils.wpi.platforms.roborio) {
|
||||
it.buildable = false
|
||||
return
|
||||
}
|
||||
|
||||
lib project: ':wpinet', library: 'wpinet', linkage: 'shared'
|
||||
lib project: ":simulation:halsim_ws_core", library: "halsim_ws_core", linkage: "static"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user