Skip to content

Improved Gradle Support #165

Closed
Closed
@breskeby

Description

@breskeby

This is a general ticket about some limitations I've seen in the existing gradle support that I would like to discuss.

  • The bootstrapping of compiling a groovy script within the plugin is very ineffective and adds a significant overhead to builds using a cold daemon.
  • The task CheckForbiddenApis has deprecated behaviour:
    • classesDir is not annotated with an input or output annotation
    • patternSet is not annotated with an input or output annotation

The bootstrapping issue is problematic in my opinion. It is quite costly , especially with cold Gradle daemons Can you elaborate why you've done it like this?
As what I can see you build the plugin against a certain set of Gradle artifacts that do not include the whole set of classes you would require to compile everything statically here. Usually when writing a Gradle plugin, plugin authors would rely on the gradleApi jar that is generated by Gradle at runtime.
Since you're using ant you do not have access to that jar. One option could be to ship the generated binary as part of the build and reference it from the build. That way we could relatively easily imo move this bootstrapping groovy script into the static typed plugin. What do you think.

As far as I understand you're concerned about backwards compatibility right? which Gradle versions do you want / need to keep supporting here? Gradle 3.2 is almost 4 years old already. Not sure how much sense it makes to keep supporting this version in newer plugins.

Would you be generally open to split out the Gradle specific logic into its own project / subproject? I'm happy to help with that. This would make working on the plugin way easier and we could detangle the version of the Gradle plugin from the general different forbidden-apis version.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions