I’ve just transitioned from gradle 2.x to 4.1 and hit a problem with this custom task:
task copyEcore(type: Copy) {
from "src-gen/com/magnicomp/model/magnicomp.ecore"
into "${sourceSets.main.output.classesDir}/com/magnicomp/model"
}
compileJava.dependsOn copyEcore
I get an error that classesDir is not supported. I do see a new classesDirs variable but I’m not sure if I should use that or not.
The purpose of the task above is to copy the .ecore file that is generated via Eclipse IDE into a directory that is included in the classpath when the jar file is created. The .ecore file is required in the classpath at runtime.
What’s the correct way of doing this with gradle 4.x?