From 4300f4c11e9079c0cd134c8dd4c63b60edfea038 Mon Sep 17 00:00:00 2001 From: Yang Date: Wed, 28 Aug 2024 23:34:03 +1000 Subject: [PATCH] Enable project isolation, mark GraalVM tasks as non-compatible with configuration cache. --- .github/workflows/ci.yml | 2 +- README.md | 4 ++-- build.gradle.kts | 11 +++++++++++ gradle.properties | 1 + 4 files changed, 15 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 339d09b..520e328 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -52,7 +52,7 @@ jobs: - uses: gradle/actions/setup-gradle@v4 - name: Build GraalVM native executable - run: ./gradlew nativeCompile --no-configuration-cache + run: ./gradlew nativeCompile - uses: docker/login-action@v3 with: diff --git a/README.md b/README.md index 892ce9a..94fd0f7 100644 --- a/README.md +++ b/README.md @@ -57,13 +57,13 @@ Make sure the required version of GraalVM JDK is installed. To compile a native executable: ``` -./gradlew nativeCompile --no-configuration-cache +./gradlew nativeCompile ``` To run the native executable: ``` -./gradlew nativeRun --no-configuration-cache +./gradlew nativeRun ``` ## License diff --git a/build.gradle.kts b/build.gradle.kts index 5e93cf2..d3a06fc 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,6 +1,8 @@ import com.netflix.graphql.dgs.codegen.gradle.GenerateJavaTask import io.gitlab.arturbosch.detekt.Detekt import io.gitlab.arturbosch.detekt.getSupportedKotlinVersion +import org.graalvm.buildtools.gradle.tasks.BuildNativeImageTask +import org.graalvm.buildtools.gradle.tasks.GenerateResourcesConfigFile import org.jetbrains.kotlin.gradle.dsl.JvmTarget plugins { @@ -41,6 +43,14 @@ graalvmNative { } } +tasks.withType().configureEach { + notCompatibleWithConfigurationCache("GraalVM plugin is not compatible with configuration cache.") +} + +tasks.withType().configureEach { + notCompatibleWithConfigurationCache("GraalVM plugin is not compatible with configuration cache.") +} + tasks.bootRun { environment( envVar("KS_REDIS_REST_URL"), @@ -77,6 +87,7 @@ tasks.withType().configureEach { configurations.matching { it.name == "detekt" }.configureEach { resolutionStrategy.eachDependency { if (requested.group == "org.jetbrains.kotlin") { + @Suppress("UnstableApiUsage") useVersion(getSupportedKotlinVersion()) } } diff --git a/gradle.properties b/gradle.properties index 8b41c03..ebf80f1 100644 --- a/gradle.properties +++ b/gradle.properties @@ -4,6 +4,7 @@ org.gradle.configureondemand=true org.gradle.caching=true org.gradle.configuration-cache=true org.gradle.configuration-cache-problems=warn +org.gradle.unsafe.isolated-projects=true # Kotlin code style kotlin.code.style=official