Hello everyone,
I have a multiproject build whose subprojects are composed primarily of scripting languages. Therefore, in most projects there is no actual compilation to be done when building the project. However in one leaf project, there is some java that needs to be compiled. Since I’ve defined the build task in the parent project, the “apply pluing: java” doesn’t seem to be working correctly.
In the parent I have the following build script:
subprojects {
task build {
dependsOn "buildDnaProject"
}
task buildDnaProject {
dependsOn "copyQ"
dependsOn "copyConfig"
dependsOn "copyLib"
}
task copyQ(type: Copy) {
description "Copies q scripts from src/main/q to the build directory"
from "src/main/q"
into "$buildDir/src/q"
}
task copyConfig(type: Copy) {
description "Copies config files from src/main/config to the build directory"
from "src/main/config"
into "$buildDir/etc"
}
task copyLib(type: Copy) {
description "Copies lib files from lib to the build directory"
from "lib"
into "$buildDir/lib"
}
}
And in the leaf project I have a build script with one line: apply plugin: “java”
When I run gradle build, it performs all the copy tasks as defined in the parent, but the leaf project with java is not compiled or tested. Is there a way that I can get the leaf project to “extend” the currently defined build task and also do java compilation?
Snippet of the output from my build:
:dnaProjects:yieldDatabase:copyConfig
:dnaProjects:yieldDatabase:copyLib UP-TO-DATE
:dnaProjects:yieldDatabase:copyQ
:dnaProjects:yieldDatabase:buildDnaProject
:dnaProjects:yieldDatabase:build