Code: Select all
project.ext.set("myVersion", "v1")
dependencies {
// tried this, but it gives me a circular dependency error for my compile & zip tasks
compile files('${buildDir}/dist/my-jar-${project.myVersion}.jar') {
builtBy 'zipExternalClasses'
}
// tried either of these, but still get package does not exist
compile files('${buildDir}/dist/my-jar-${project.myVersion}.jar')
runtime files('${buildDir}/dist/my-jar-${project.myVersion}.jar')
}
// The dependent task compileExternalClasses compiles the classes from a source folder
// I can see that the jar is successfully created in 'build/dist'
task zipExternalClasses(dependsOn: 'compileExternalClasses', type: Jar) {
// code for zipping compiled external classes
}