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
Gradle API dependency should allow a version argument #1835
Comments
This could be somewhat addressed with the epic #1156. It will likely require splitting up Gradle core into modules and publishing them. |
+1 for this. I also agree with not understanding why This would be useful for a project I'm working on (https://github.com/mkobit/assertj-gradle). I would like to make sure it can be built and used against multiple Gradle versions and getting feedback during compilation time without having to write a bunch of Test Kit tests. It is even more a problem if I am using a |
I’d like to see this too. My use case is building Spring Boot’s Gradle Plugin which supports Gradle 4.0+ and JDK 8, 9, and soon 10. We currently build the plugin using Gradle 4.0.x (to avoid accidental use of APIs that only exist in newer versions) but Gradle 4.0.x doesn’t work with JDK 10. Being able to build with and up-to-date version of Gradle but compile against the 4.0.x API would be a nice solution to the problem. The two alternatives I’ve thought of thus far are less than ideal:
|
Agreed. Being able to get access to the gradle API by version would be awesome. |
Also, it looks like
I assume using a regular dependency would get rid of these warning by resolving the Kotlin stdlib to |
@lacasseio pointed out to me that Nokee redistributes artifacts for each version of the Gradle API: https://docs.nokee.dev/manual/gradle-plugin-development.html#sec:gradle-dev-redistributed-gradle-api The following works for me: dependencies {
compileOnly("dev.gradleplugins:gradle-api:$gradleVersion")
} |
This issue has been automatically marked as stale because it has not had recent activity. Given the limited bandwidth of the team, it will be automatically closed if no further activity occurs. If you're interested in how we try to keep the backlog in a healthy state, please read our blog post on how we refine our backlog. If you feel this is something you could contribute, please have a look at our Contributor Guide. Thank you for your contribution. |
I believe this is still an issue |
Dependencies on Gradle's API should not be limited to the current Gradle version used by the build.
Expected Behavior
Provide options like:
dependencies { compile 'org.gradle:gradle-api:3.0' }
Or if the JARs won't be published that way:
dependencies { compile gradleApi('3.0') }
Current Behavior
dependencies { compile gradleApi() // always uses the API of the Gradle version used to run the build }
Context
If I need to compile against Gradle 3.0 (since it's the minimum supported by a plugin) I shouldn't also be limited to building the plugin itself with Gradle 3.0. I can use TestKit to verify compatibility with older versions, but it would be nice to get compile errors if I was using an API that was too new.
Ultimately, I don't understand the case for
gradleApi()
being a special case dependency. Seems like it would be more straightforward to publish the Gradle API to a Maven repo like any other dependency in the Java community.The text was updated successfully, but these errors were encountered: