[build] Enhance javacpp/setupBuild.gradle with catch2 support (#9022)

This commit is contained in:
Peter Johnson
2026-06-23 08:35:16 -07:00
committed by GitHub
parent cd17feaa40
commit a5c92df1f6

View File

@@ -20,7 +20,8 @@ ext {
staticGtestConfigs = [:]
}
staticGtestConfigs["${nativeName}Test"] = []
def nativeTestSuiteName = project.findProperty('nativeTestSuiteName') ?: "${nativeName}Test"
staticGtestConfigs[nativeTestSuiteName] = []
apply from: "${rootDir}/shared/googletest.gradle"
apply from: "${rootDir}/shared/catch2.gradle"
@@ -104,7 +105,7 @@ model {
}
}
testSuites {
"${nativeName}Test"(GoogleTestTestSuiteSpec) {
"${nativeTestSuiteName}"(GoogleTestTestSuiteSpec) {
for(NativeComponentSpec c : $.components) {
if (c.name == nativeName) {
testing c
@@ -122,6 +123,11 @@ model {
}
}
}
if (nativeTestSuiteName.contains('Catch2')) {
binaries.all {
lib project: ':thirdparty:catch2', library: 'catch2', linkage: 'static'
}
}
}
}
binaries {