Я новичок в Gradle, особенно в отношении сборки C / C ++. Я пытаюсь перевести SCons в Gradle. У меня есть каталог common / src, который содержит все файлы * .cc и * .h. Build.gradle состоит из следующего:
apply plugin: 'c'
apply plugin: 'cpp'
apply from: './gradle.properties'
model {
components {
common(NativeLibrarySpec)
}
binaries {
withType(SharedLibraryBinarySpec) {
if (targetPlatform.operatingSystem.windows) {
cppCompiler.args '/MT', '/ZI'
}
if (targetPlatform.operatingSystem.linux) {
cppCompiler.args '-c', '-g', '-fPIC'
linker.args '-pthread'
}
}
}
}
Я пытаюсь собрать .so, но ничего не получается, даже ошибка.
./gradlew commonSharedLibrary
Deprecated Gradle features were used in this build, making it incompatible with Gradle 5.0.
See https://docs.gradle.org/4.7/userguide/command_line_interface.html#sec:command_line_warnings
BUILD SUCCESSFUL in 0s
Чего мне не хватает?
Где я могу найти документацию и примеры по C / C ++?
$ ../gradlew -version
------------------------------------------------------------
Gradle 4.7
------------------------------------------------------------
Build time: 2018-04-18 09:09:12 UTC
Revision: b9a962bf70638332300e7f810689cb2febbd4a6c
Groovy: 2.4.12
Ant: Apache Ant(TM) version 1.9.9 compiled on February 2 2017
JVM: 1.8.0_151 (Oracle Corporation 25.151-b12)
OS: Linux 3.10.0-514.el7.x86_64 amd64