Skip to content

Gradle API dependency should allow a version argument #1835

Description

@ajoberstar

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions