Open vlsi opened 1 year ago
Thanks a lot for the detailed report and offer to help address the problem. I lack some background here myself, but @sambsnyd or @shanman190 can maybe weigh in on your suggested approach, and help review once we get to that stage. Let us know if you need any help!
For the first case, I think using compileClasspath
directly would result in identical behavior and remove they deprecation. The only caveat is I don't remember if there's a variant that supports Gradle 4.x of that outside of compile
.
For the second use case, I agree that it's easiest to just swap those to isConsumable = false; isResolvable = true;
.
Does it really make sense spending time on Gradle 4 support now? Of course, it is your choice, but Gradle 4 is quite old
So to explain that part, it's not uncommon for an enterprise organization to be lagging way behind. The Gradle 4 target was set such that it gave the best possibility of supporting enterprise customers where they were already at and then using migration recipes to modernize their portfolio rapidly.
It's a balancing act in terms of choosing an archaic Gradle minimum versus being unable to support a prospective customer.
What version of OpenRewrite are you using?
org.openrewrite.rewrite.gradle.plugin:6.4.3
How are you running OpenRewrite?
What did you expect to see?
No deprecation warnings should appear
What did you see instead?
Are you interested in contributing a fix to OpenRewrite?
I might probably work on that.
I believe https://github.com/openrewrite/rewrite-gradle-plugin/blob/0daa455128fe26ab97e1754adc23e1b55b931445/plugin/src/main/java/org/openrewrite/gradle/isolated/DefaultProjectParser.java#L694-L699 should be adjusted.
implementation
is not meant to "resolve" dependencies, and it is supposed to declare dependencies only. If one needs a "classpath", they should inherit fromcompileClasspath
or something like that. In any case, the generated configuration should be marked withisCanBeConsumed = false; isCanBeResolved = true
as the configuration is not meant for consumption by other modules.The same goes for detached configurations in https://github.com/openrewrite/rewrite-gradle-plugin/blob/0daa455128fe26ab97e1754adc23e1b55b931445/plugin/src/main/java/org/openrewrite/gradle/ResolveRewriteDependenciesTask.java#L94