mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-19 00:41:43 +00:00
Disable google tests on cross compilers (#1738)
Removes checks for onlyathena and onlyraspbian, and just disables gtest for cross compilers.
This commit is contained in:
committed by
Peter Johnson
parent
d9cb57a429
commit
2dc94e6052
@@ -9,7 +9,9 @@ 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 edu.wpi.first.toolchain.ToolchainExtension
|
||||
import org.gradle.model.Mutate;
|
||||
import org.gradle.api.plugins.ExtensionContainer;
|
||||
import org.gradle.nativeplatform.test.googletest.GoogleTestTestSuiteBinarySpec;
|
||||
import org.gradle.model.RuleSource;
|
||||
import org.gradle.model.Validate;
|
||||
@@ -52,6 +54,20 @@ class MultiBuilds implements Plugin<Project> {
|
||||
binary.buildable = false
|
||||
}
|
||||
|
||||
@Validate
|
||||
@CompileStatic
|
||||
// TODO: Move this to tc plugin
|
||||
void disableCrossTests(BinaryContainer binaries, ExtensionContainer extContainer) {
|
||||
final ToolchainExtension ext = extContainer.getByType(ToolchainExtension.class);
|
||||
|
||||
for (GoogleTestTestSuiteBinarySpec binary : binaries.withType(GoogleTestTestSuiteBinarySpec.class)) {
|
||||
if (ext.getCrossCompilers().findByName(binary.getTargetPlatform().getName()) != null) {
|
||||
setBuildableFalseDynamically(binary)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Mutate
|
||||
@CompileStatic
|
||||
void disableReleaseGoogleTest(BinaryContainer binaries, ProjectLayout projectLayout) {
|
||||
|
||||
@@ -103,11 +103,7 @@ model {
|
||||
}
|
||||
binaries {
|
||||
withType(GoogleTestTestSuiteBinarySpec) {
|
||||
if (!project.hasProperty('onlylinuxathena') && !project.hasProperty('onlylinuxraspbian')) {
|
||||
lib library: nativeName, linkage: 'shared'
|
||||
} else {
|
||||
it.buildable = false
|
||||
}
|
||||
lib library: nativeName, linkage: 'shared'
|
||||
}
|
||||
}
|
||||
tasks {
|
||||
|
||||
@@ -232,12 +232,8 @@ model {
|
||||
}
|
||||
binaries {
|
||||
withType(GoogleTestTestSuiteBinarySpec) {
|
||||
if (!project.hasProperty('onlylinuxathena') && !project.hasProperty('onlylinuxraspbian')) {
|
||||
lib library: nativeName, linkage: 'shared'
|
||||
lib project: ':wpiutil', library: 'wpiutil', linkage: 'shared'
|
||||
} else {
|
||||
it.buildable = false
|
||||
}
|
||||
lib library: nativeName, linkage: 'shared'
|
||||
lib project: ':wpiutil', library: 'wpiutil', linkage: 'shared'
|
||||
}
|
||||
}
|
||||
tasks {
|
||||
|
||||
@@ -203,16 +203,12 @@ model {
|
||||
}
|
||||
}
|
||||
withType(GoogleTestTestSuiteBinarySpec) {
|
||||
if (!project.hasProperty('onlylinuxathena') && !project.hasProperty('onlylinuxraspbian')) {
|
||||
lib project: ':ntcore', library: 'ntcore', linkage: 'shared'
|
||||
lib project: ':cscore', library: 'cscore', linkage: 'shared'
|
||||
project(':hal').addHalDependency(it, 'shared')
|
||||
lib project: ':wpiutil', library: 'wpiutil', linkage: 'shared'
|
||||
lib project: ':cameraserver', library: 'cameraserver', linkage: 'shared'
|
||||
lib library: nativeName, linkage: 'shared'
|
||||
} else {
|
||||
it.buildable = false
|
||||
}
|
||||
lib project: ':ntcore', library: 'ntcore', linkage: 'shared'
|
||||
lib project: ':cscore', library: 'cscore', linkage: 'shared'
|
||||
project(':hal').addHalDependency(it, 'shared')
|
||||
lib project: ':wpiutil', library: 'wpiutil', linkage: 'shared'
|
||||
lib project: ':cameraserver', library: 'cameraserver', linkage: 'shared'
|
||||
lib library: nativeName, linkage: 'shared'
|
||||
}
|
||||
}
|
||||
tasks {
|
||||
|
||||
Reference in New Issue
Block a user