Our multi-project build has the following structure:
root-project
\-project1
\-project2
\-build.gradle
\-settings.gradle
When I run a gradle build from the root-project directory the build artefacts in project1 (not a Kotlin project) remain under the project1/build directory as expected. However, a build directory appears under the root-directory containing only build/kotlin and build/kotlin-build directories.
Even if I run gradle build from root-project/project2 I see the same behaviour.
What am I missing to order force all of the kotlin build artefacts to be placed under:
root-dir/project2/build
I have the following in my root-dir/build.gradle which may be shed some light on the behaviour:
task root-project(dependsOn: ':project1:build') {
doLast {
copy {
from project(':project1:').file('dist')
into project(':project2:').file('build/resources/main/static/')
}
}
}
project(':project1') {
task UI(dependsOn: ':project1:runAll') {
doLast {
println 'UI'
}
}
}
project(':project2') {
task API(dependsOn: ':project2:bootRun') {
doLast {
println 'API'
}
}
}