I've set up a Gradle task to auto generate one of the subprojects of my Gradle build on which another depends (reason for doing this: long story involving Apache Cordova!). So the root build.gradle contains this autogenerate task that creates a "CordovaLib" sub project. The build.gradle in the other sub project (that isn't autogenerated) depends on CordovaLib:
dependencies {
compile project(':CordovaLib')
}
Is there a way to execute the autogenerate task before the non-generated subproject's build.gradle is evaluated (specifically the above line)? I'm using Gradle 1.11 on JDK 1.7 and as it currently stands I can't even run gradle tasks
without it failing due to the missing project.
It isn't possible to execute a task before build files have been evaluated, at least not without complications such as one build executing another build using a GradleBuild
task. You are likely better off checking the generated project in to source control, or finding a solution that doesn't involve generating build scripts.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With