Skip to content
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

2.0.0-beta-1 forces consumers to target JDK 17+ #164

Open
SimonMarquis opened this issue Mar 21, 2024 · 3 comments
Open

2.0.0-beta-1 forces consumers to target JDK 17+ #164

SimonMarquis opened this issue Mar 21, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@SimonMarquis
Copy link

Current behavior

Using this plugin while targetting Java 11 will lead to this error:

Execution failed for task ':plugins:compileKotlin'.
> Could not resolve all files for configuration ':plugins:compileClasspath'.
   > Could not resolve com.spotify.ruler:ruler-gradle-plugin:2.0.0-beta-1.
     Required by:
         project :plugins
      > No matching variant of com.spotify.ruler:ruler-gradle-plugin:2.0.0-beta-1 was found. The consumer was configured to find a library for use during compile-time, compatible with Java 11, preferably in the form of class files, preferably optimized for standard JVMs, and its dependencies declared externally, as well as attribute 'org.gradle.plugin.api-version' with value '8.6', attribute 'org.jetbrains.kotlin.platform.type' with value 'jvm' but:
          - Variant 'apiElements' capability com.spotify.ruler:ruler-gradle-plugin:2.0.0-beta-1 declares a library for use during compile-time, packaged as a jar, preferably optimized for standard JVMs, and its dependencies declared externally, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'jvm':
              - Incompatible because this component declares a component, compatible with Java 17 and the consumer needed a component, compatible with Java 11
              - Other compatible attribute:
                  - Doesn't say anything about org.gradle.plugin.api-version (required '8.6')
          - Variant 'runtimeElements' capability com.spotify.ruler:ruler-gradle-plugin:2.0.0-beta-1 declares a library for use during runtime, packaged as a jar, preferably optimized for standard JVMs, and its dependencies declared externally, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'jvm':
              - Incompatible because this component declares a component, compatible with Java 17 and the consumer needed a component, compatible with Java 11
              - Other compatible attribute:
                  - Doesn't say anything about org.gradle.plugin.api-version (required '8.6')
          - Variant 'sourcesElements' capability com.spotify.ruler:ruler-gradle-plugin:2.0.0-beta-1 declares a component for use during runtime, and its dependencies declared externally:
              - Incompatible because this component declares documentation and the consumer needed a library
              - Other compatible attributes:
                  - Doesn't say anything about its target Java environment (preferred optimized for standard JVMs)
                  - Doesn't say anything about its target Java version (required compatibility with Java 11)
                  - Doesn't say anything about its elements (required them preferably in the form of class files)
                  - Doesn't say anything about org.gradle.plugin.api-version (required '8.6')
                  - Doesn't say anything about org.jetbrains.kotlin.platform.type (required 'jvm')

Version 2.0.0-alpha-16 was not enforcing this.

Expected behavior

The minimum version requirement should be imposed on consumers. Do you think this is something that can be reverted? Or is it using specific features that requires Java 17?

Steps to reproduce

java {
    sourceCompatibility = JavaVersion.VERSION_11
    targetCompatibility = JavaVersion.VERSION_11
}

tasks.withType<KotlinCompile>().configureEach {
    kotlinOptions {
        jvmTarget = JavaVersion.VERSION_11.toString()
    }
}

Versions

No response

Anything else?

No response

@SimonMarquis SimonMarquis added the bug Something isn't working label Mar 21, 2024
@nathan3d
Copy link
Collaborator

nathan3d commented Mar 21, 2024

Android Gradle Plugin 8 requires Java 17, so we expect most Android projects to update and don't really have the resources to test across a wide range of versions.

The older versions should continue to work fine on older versions of Gradle/AGP.

@SimonMarquis
Copy link
Author

We are running our builds without any issue while still targeting version 11. Even since AGP 8.X required to use Java 17.
I'm pretty sure JDK version and compatibility target versions can still be not identical.
I'll try bumping our convention plugin project to this target 🤞

@nathan3d
Copy link
Collaborator

I'm not opposed to changing it. Can try and take a look next week, or you can open a PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants