-
Notifications
You must be signed in to change notification settings - Fork 459
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Prefer using plugin extensions over deprecated conventions #1618
Conversation
dafe3c8
to
21201c6
Compare
CC @nedtwigg |
static final String VER_GRADLE_min = "6.1.1"; | ||
static final String VER_GRADLE_javaPluginExtension = "7.1"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
May need to bump VER_GRADLE_min
to 7.1
in the future, using conventions will start emitting deprecation warnings in Gradle 8.1, and will be removed in the later Gradle 8 versions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Roger. If we are throwing warnings that we can't easily workaround with a version check, then I'm happy to bump the minimum.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nedtwigg Are you planning to move on Gradle plugin 7? If so can we bump the min Gradle requirement to 7.1 for something like this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It thought that this
spotless/plugin-gradle/src/main/java/com/diffplug/gradle/spotless/JvmLang.java
Lines 37 to 49 in ed88d33
if (GradleVersion.current().compareTo(GradleVersion.version(SpotlessPlugin.VER_GRADLE_javaPluginExtension)) >= 0) { | |
final JavaPluginExtension javaPluginExtension = project.getExtensions().findByType(JavaPluginExtension.class); | |
if (javaPluginExtension == null) { | |
throw new GradleException(message); | |
} | |
sourceSets = javaPluginExtension.getSourceSets(); | |
} else { | |
final JavaPluginConvention javaPluginConvention = project.getConvention().findPlugin(JavaPluginConvention.class); | |
if (javaPluginConvention == null) { | |
throw new GradleException(message); | |
} | |
sourceSets = javaPluginConvention.getSourceSets(); | |
} |
would let us keep 6.1.1
as our min and not emit warnings. But if we are emitting warnings and its very difficult to workaround, then sure I'm okay with bumping the minimum.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And 682dcd6.
…nds as soon as possible.
e1d21aa
to
1c21d12
Compare
Thanks! |
Published in |
https://docs.gradle.org/current/userguide/upgrading_version_7.html#all_convention_deprecation