Deprecation of configureForSourceSet


(Schalk Cronjé) #1

I have noted the following deprecation message introduced
in 4.0, however not mentioned in the release notes.

The configureForSourceSet(SourceSet, AbstractCompile) method has been deprecated and is scheduled to be removed in Gradle 5.0.

The method in question is https://docs.gradle.org/current/javadoc/org/gradle/api/plugins/JavaBasePlugin.html#configureForSourceSet(org.gradle.api.tasks.SourceSet,%20org.gradle.api.tasks.compile.AbstractCompile) and I suspect are used in a number of third-party language plugins. This is probably not a trivial migration to those maintainers.

What is the new appraoch here? Are there better APIs available since 4.0 for implementing JVM language plugins?


(Schalk Cronjé) #2

From looking at the Gradle source, usage of configureForSourceSet has been replaced by calling an internal API SourceSetUtils.configureForSourceSet. This is not a feasible solution for plugin developers.