forbidden-apis: apply plugin: 'de.thetaphi.forbiddenapis' is very slow.

allprojects {
    apply plugin: 'de.thetaphi.forbiddenapis'
}

adds 25s to the configuration time of a multi-module build with about 500 modules.

The reason for this is that ForbiddenApisPlugin.java is compiling the plugin-init.groovy script for every single apply call.

You should instead re-implement the plugin-init.groovy functionality in Java or switch the ForbiddenApisPlugin to Groovy.

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 19 (13 by maintainers)

Commits related to this issue

Most upvoted comments

The Gradle API is on a Maven Repository so you can use it, but all “internal” stuff like the Java plugin is missing. So the plugin initializes itsself with dynamic scripting!

Thanks for the explanation. We are planning to make that easier in the future, as we’ve seen some other projects as well who are stuck on Maven, but still want to provide a Gradle plugin.

For several reasons I will not add precompiled Groovy code at the moment (not compatible to the setup of compiling the plugin for 3 build systems + CLI in one single artifact).

The only idea would be to only parse the groovy script once and reuse the compiled class. That should be easy to implement.