gcp-gradle-build-cache icon indicating copy to clipboard operation
gcp-gradle-build-cache copied to clipboard

Exclude kotlin-stdlib from plugin dependencies

Open Goooler opened this issue 10 months ago • 1 comments

  • Closes #51.
  • Closes #59.

https://kotlinlang.org/docs/gradle.html#dependency-on-the-standard-library

Run diff gcpbuildcache-1.0.0.module.before gcpbuildcache-1.0.0.module.after:

28,36d27
<       "dependencies": [
<         {
<           "group": "org.jetbrains.kotlin",
<           "module": "kotlin-stdlib",
<           "version": {
<             "requires": "2.0.21"
<           }
<         }
<       ],
109,115d99
<         },
<         {
<           "group": "org.jetbrains.kotlin",
<           "module": "kotlin-stdlib",
<           "version": {
<             "requires": "2.0.21"
<           }

Goooler avatar Jan 31 '25 02:01 Goooler

kotlin.compilerOptions.apiVersion should also be constrainted, like https://github.com/GradleUp/shadow/blob/d64ef3787ca0298addd7cb4dbd4beb49814b2bee/build.gradle.kts#L23-L24

Goooler avatar Jan 31 '25 02:01 Goooler

Is there any blocker to merge this PR?

trietbui85 avatar Apr 07 '25 14:04 trietbui85

CC @liutikas

Goooler avatar Sep 26 '25 09:09 Goooler

This is not a safe change. We do require kotlin-stdlib to run, so we should be declaring that we use it and we tested it at a specific version.

https://kotlinlang.org/docs/gradle.html#dependency-on-the-standard-library seems to be a dead link

it kind of sounds like the request in the linked issues to go to a lower version to support older versions of Gradle. Is that the goal?

liutikas avatar Sep 26 '25 15:09 liutikas

https://kotlinlang.org/docs/gradle-configure-project.html#dependency-on-the-standard-library

This plugin relies on Kotlin and Gradle integrates Kotlin stdlibs, so what we can do is pin the kotlin.languageVersion and omit the plugin's transitive Kotlin version.

it kind of sounds like the request in the linked issues to go to a lower version to support older versions of Gradle. Is that the goal?

Yeah, it is.

Goooler avatar Sep 27 '25 02:09 Goooler

https://github.com/androidx/gcp-gradle-build-cache/pull/72 we'll do the following to bring to down to Gradle 8.4

liutikas avatar Sep 28 '25 17:09 liutikas