Monday, August 12, 2019

Other Gradle plugins can cause earlier than expected task configuration

One of my Gradle plugins registers a task immediately at apply time with a configuration action that references tasks created later by a different plugin. This worked perfectly fine at first because of task configuration avoidance - the action didn't run until configuration was needed, at which point the things it required had taken place. It stopped working when I added another plugin to the same project, at which point my first plugin's task tried to configure itself and failed. The new plugin was iterating over all tasks in the project, which caused them all to be configured. Evidently configuration avoidance shouldn't be relied on - I'll need to fix my first plugin.

No comments:

Post a Comment