I have a Gradle 1.11 multi-project build in which there are more than one project types e.g. some are java projects, some are mixed java/scala, some are javascript based, etc. I would like to define defaults for each of these types of projects in my root project build. Is there an easy way to do this?
I have tried:
configure(subprojects.findAll { project -> project.has('applyJavaDefaults') && project.applyJavaDefaults }) {
//sourceCompatibility = javaVersion
// dependencies, etc.
// test with a task that should show up on all projects with property applyJavaDefaults
task hello << {
println 'Hello world!'
println project.name
}
}
and in the relevant subprojects:
project.applyJavaDefaults = true
But for some reason it does not work.