[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:
Tyler Veness
2023-09-27 21:45:25 -07:00
committed by GitHub
parent 65b26738d5
commit 5f651df5d5
14 changed files with 963 additions and 1002 deletions

View File

@@ -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'
}
}
}