plugins {
id 'org.bytedeco.gradle-javacpp-build' version '1.5.5'
}
...
subprojects { subproject ->
apply plugin: 'org.bytedeco.gradle-javacpp-build'
// This code can be more simpler like "javacppBuildParser { ... }".
tasks.withType(org.bytedeco.gradle.javacpp.BuildTask) {
if (it.name.equals("javacppBuildParser")) {
System.out.println("rootproject build.gradle set output directory changed to '$buildDir/generated/sources/javacpp'")
outputDirectory(file("$buildDir/generated/sources/javacpp"))
}
}
}
rootproject/settings.gradle
rootProject.name = "rootproject"
include 'subproject_1'
rootproject/subproject_1/build.gradle
...
javacppBuildParser {
System.out.println("subproject_1 build.gradle set output directory changed to '$buildDir/generated/sources/javacpp'")
outputDirectory(file("$buildDir/generated/sources/javacpp"))
}
...
And i execute 'javacppBuildParser' task. it works fine.
> Configure project :subproject_1
rootproject build.gradle set output directory changed to 'rootproject/subproject_1/build/generated/sources/javacpp'
subproject_1 build.gradle set output directory changed to 'rootproject/subproject_1/build/generated/sources/javacpp'
...
> Task :subproject_1:javacppBuildParser
jnijavacpp.cpp
rootproject/subproject_1/build/generated/sources/javacpp/jnijavacpp.cpp(433): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
...
(working on rootproject/subproject_1/build/generated/sources/javacpp/ directory)
But If i remove javacppBuildParser { ... } code in subproject_1/build.gradle and then I execute 'javacppBuildParser' task, working like not set outputDirectory.
> Configure project :subproject_1
rootproject build.gradle set output directory changed to 'rootproject/subproject_1/build/generated/sources/javacpp'
...
> Task :subproject_1:javacppBuildParser
jnijavacpp.cpp
rootproject/subproject_1/src/main/java/jnijavacpp.cpp(433): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
...
(working on rootproject/subproject_1/src/main/java/ directory)
Fix this issue