jprante / gradle-plugin-jflex

A JFlex plugin for Gradle
Apache License 2.0
8 stars 6 forks source link

Make JFlex compatible with the Gradle Configuration Cache #21

Closed ryandens closed 1 year ago

ryandens commented 1 year ago

👋 Hello, I'm an engineer at Gradle and I came across your project in the scope of another project opentelemetry-java-instrumentation.

The Gradle Configuration Cache enables faster build times by caching task configuration on the local file system. This pull request does makes the JFlex task compatible with the configuration cache by changing the structure of the task so that it is better understood by Gradle at configuration time. This includes:

A slightly more idiomatic approach would be to remove the JFlexExtension altogether and instead have users configure the JFlexTask directly using the following code:


tasks.withType<org.xbib.gradle.plugin.JFlexTask>() {
// configuration here with sensible defaults defined in `JFlexTask`
}

but that would cause a breaking change for users who currently configure this plugin via the extension, which isn't ideal. I think the current approach is reasonable.

jprante commented 1 year ago

Wow! Thank you.

ryandens commented 1 year ago

Thank you for accepting the change!