Skip to content

Commit

Permalink
Enable project isolation, mark GraalVM tasks as non-compatible with c…
Browse files Browse the repository at this point in the history
…onfiguration cache.
  • Loading branch information
ychescale9 committed Aug 28, 2024
1 parent 78662da commit 4300f4c
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 11 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down Expand Up @@ -41,6 +43,14 @@ graalvmNative {
}
}

tasks.withType<BuildNativeImageTask>().configureEach {
notCompatibleWithConfigurationCache("GraalVM plugin is not compatible with configuration cache.")
}

tasks.withType<GenerateResourcesConfigFile>().configureEach {
notCompatibleWithConfigurationCache("GraalVM plugin is not compatible with configuration cache.")
}

tasks.bootRun {
environment(
envVar("KS_REDIS_REST_URL"),
Expand Down Expand Up @@ -77,6 +87,7 @@ tasks.withType<Test>().configureEach {
configurations.matching { it.name == "detekt" }.configureEach {
resolutionStrategy.eachDependency {
if (requested.group == "org.jetbrains.kotlin") {
@Suppress("UnstableApiUsage")
useVersion(getSupportedKotlinVersion())
}
}
Expand Down
1 change: 1 addition & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 4300f4c

Please sign in to comment.