My company uses a custom Gradle distro which ships a custom init script packaged as a jar file inside the distro’s lib directory (DISTRO/lib/acme-extensions.jar). We currently use Gradle 2.14.1 and it works well.
I want to migrate this custom distro to Gradle 3.1 and I now have issues which seem to relate to the daemon being enabled by default since 3.0.
This is the scenario that I’ve identified:
- I run a first build with Gradle vanilla 3.1, this build starts the daemon and logs the message “Starting a Gradle Daemon (subsequent builds will be faster)”
- I try to run another build which depends on our custom Gradle distro based on 3.1. However since there’s already a Gradle daemon running, Gradle reuses the existing daemon whose classpath doesn’t contain the jar with my custom init script. The build fails with the error “Could not get unknown property ‘com’ for build of type org.gradle.invocation.DefaultGradle.”
- Killing the running Gradle daemon and running the second build works this time
It seems that the logic for reusing an existing daemon only considers the version of Gradle being used (3.1 here).
Can you confirm if using a custom Gradle distro is compatible with the use of the daemon. It looks to me that this use case isn’t supported.