Skip to content

Commit

Permalink
Try resolving an error that occurs when syncing the project in Intell…
Browse files Browse the repository at this point in the history
…iJ IDEA without success, by removing the module-wide opt-in and bumping the Gradle wrapper

The Gradle error message when syncing in IntelliJ IDEA:

```text
Execution failed for task ':kotlin-common-gradle-plugins:configurePrecompiledScriptDependenciesResolver'.
> The value for property 'freeCompilerArgs' is final and cannot be changed any further.
```

This error doesn't occur when I run `publishToMavenLocal` or `check` from the command line. The commands work in the command line.

See gradle/gradle#22091 which could be related.
  • Loading branch information
ShreckYe committed Nov 26, 2024
1 parent de1baa3 commit b2993a0
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 7 deletions.
4 changes: 2 additions & 2 deletions buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ dependencies {
*/
// for `KotlinCompilationTask` and the version is compatible with Compose 1.6.11
// With Kotlin 2.0.20, a "Could not parse POM" build error occurs in the JVM projects of some dependent projects.
implementation(kotlin("gradle-plugin", "2.0.10"))
implementation("org.gradle.kotlin:gradle-kotlin-dsl-plugins:4.5.0") // This version has to be used for Gradle 8.10.
implementation(kotlin("gradle-plugin", "2.0.20"))
implementation("org.gradle.kotlin:gradle-kotlin-dsl-plugins:5.1.1") // This version has to be used for Gradle 8.11.2.

implementation("com.gradle.publish:plugin-publish-plugin:1.3.0")

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import org.jetbrains.kotlin.gradle.tasks.KotlinCompilationTask

plugins {
id("conventions")
id("aligned-version-plugin-version")
Expand All @@ -10,6 +8,8 @@ dependencies {
implementation("com.huanshankeji:common-gradle-dependencies:$pluginProjectSourceDependentStableCommonGradleDependenciesVersion")
}

/*
tasks.named<KotlinCompilationTask<*>>("compileKotlin").configure {
compilerOptions.freeCompilerArgs.add("-opt-in=com.huanshankeji.InternalApi")
}
*/
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-all.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package com.huanshankeji

@RequiresOptIn
@RequiresOptIn("This API is internal in this project.", RequiresOptIn.Level.WARNING) // TODO consider removing `WARNING`
@Retention(AnnotationRetention.BINARY)
@Target(AnnotationTarget.PROPERTY)
annotation class InternalApi

0 comments on commit b2993a0

Please sign in to comment.