Hi to all,
I have a build script with mixed Java and C++ components:
plugins {
id 'cpp'
id 'idea'
id 'java-library'
id 'maven-publish'
id 'visual-studio'
id 'google-test-test-suite'
}
...
model {
buildTypes {
debug
release
}
platforms {
windows_x86_64 {
architecture "x86_64"
operatingSystem "windows"
}
windows_x86 {
architecture "x86"
operatingSystem "windows"
}
}
components {
'jvm-native'(NativeLibrarySpec) {
targetPlatform "windows_x86"
targetPlatform "windows_x86_64"
sources {
cpp {
exportedHeaders {
srcDirs "src/main/headers"
include "**/*.h", "**/*.hpp"
}
source {
srcDir "src/main/cpp"
include "**/*.cpp"
}
lib library: 'boost_log', linkage: 'static'
lib library: 'boost_filesystem', linkage: 'static'
lib library: 'boost_date_time', linkage: 'static'
lib library: 'boost_log_setup', linkage: 'static'
lib library: 'boost_thread', linkage: 'static'
lib library: 'boost_chrono', linkage: 'static'
lib library: 'boost_exception', linkage: 'static'
lib library: 'boost_atomic', linkage: 'static'
preCompiledHeader "pch.h"
}
}
binaries {
all {
cppCompiler.args "/EHsc"
}
}
/* Disabilita (per ora) la build delle librerie [*.lib] */
binaries.withType(StaticLibraryBinarySpec) {
buildable = false
}
}
}
testSuites {
'jvm-nativeTest'(GoogleTestTestSuiteSpec) {
testing $.components.'jvm-native'
sources {
cpp {
exportedHeaders {
srcDirs "src/test/headers"
include "**/*.h", "**/*.hpp"
}
source.srcDir 'src/test/cpp'
lib library: "googleTest", linkage: "static"
lib library: "googleTestMain", linkage: "static"
}
}
binaries {
all {
cppCompiler.args "/EHsc"
}
}
}
}
binaries {
withType( GoogleTestTestSuiteBinarySpec ) {
lib library: "googleTest", linkage: "static"
}
}
toolChains {
visualCpp(VisualCpp) {
eachPlatform { p ->
if ( p.platform.operatingSystem.windows ) {
cppCompiler.withArguments { args ->
args << "/I${Jvm.current().javaHome}/include"
args << "/I${Jvm.current().javaHome}/include/win32"
}
}
}
}
}
}
How I can to exclude all test tasks? Build and run, I have tried with -x test, but doesn’t works.
Thanks.
Marino