From bd64f81cf9204a9ae1cc68714f7020ac2d7b221e Mon Sep 17 00:00:00 2001 From: Thad House Date: Sun, 10 Sep 2023 08:08:28 -0700 Subject: [PATCH] [build] Run Google tests in release mode in CI (#5615) This reduces disk space usage in CI. Local builds still use debug mode. --- buildSrc/src/main/groovy/MultiBuilds.groovy | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/buildSrc/src/main/groovy/MultiBuilds.groovy b/buildSrc/src/main/groovy/MultiBuilds.groovy index 31530b8a4e..2ce5ddbea7 100644 --- a/buildSrc/src/main/groovy/MultiBuilds.groovy +++ b/buildSrc/src/main/groovy/MultiBuilds.groovy @@ -9,6 +9,7 @@ import org.gradle.language.base.internal.ProjectLayout; import org.gradle.language.base.plugins.ComponentModelBasePlugin; import org.gradle.language.nativeplatform.tasks.AbstractNativeSourceCompileTask; import org.gradle.model.ModelMap; +import org.gradle.internal.os.OperatingSystem import edu.wpi.first.toolchain.ToolchainExtension import org.gradle.model.Mutate; import org.gradle.api.plugins.ExtensionContainer; @@ -60,12 +61,16 @@ class MultiBuilds implements Plugin { @CompileStatic void disableReleaseGoogleTest(BinaryContainer binaries, ProjectLayout projectLayout) { def project = (Project) projectLayout.projectIdentifier - if (project.hasProperty('testRelease')) { + if (project.hasProperty('testOther')) { return } + def check_string = 'release' + if (project.hasProperty('buildServer') && !OperatingSystem.current().isWindows()) { + check_string = 'debug' + } binaries.withType(GoogleTestTestSuiteBinarySpec) { oSpec -> GoogleTestTestSuiteBinarySpec spec = (GoogleTestTestSuiteBinarySpec) oSpec - if (spec.buildType.name == 'release') { + if (spec.buildType.name == check_string) { Rules.setBuildableFalseDynamically(spec) } }