Skip to content

Commit 586128d

Browse files
committed
chore: graalvm community update and refactorings
1 parent bf29ea2 commit 586128d

27 files changed

+482
-428
lines changed

.github/workflows/graalvm.yml

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,14 @@ jobs:
4040
fail-fast: false
4141
max-parallel: 3
4242
matrix:
43-
version: [ dev ]
4443
java-version: [ 'dev' ]
44+
distribution: [ 'graalvm-community' ]
4545
os: [ macos-latest, windows-latest, ubuntu-latest ]
4646

4747
outputs:
4848
version: ${{ steps.native-build.outputs.version }}
4949
native_image_name: ${{ steps.native-build.outputs.native_image_name }}
50+
native_image_dashboard: ${{ steps.native-build.outputs.native_image_dashboard }}
5051

5152
steps:
5253
- name: 🛎️ Check out repository
@@ -57,8 +58,8 @@ jobs:
5758
- name: ☕ Setup GraalVM CE Dev Build
5859
uses: graalvm/setup-graalvm@v1
5960
with:
60-
version: ${{ matrix.version }}
6161
java-version: ${{ matrix.java-version }}
62+
distribution: ${{ matrix.distribution }}
6263
github-token: ${{ secrets.GITHUB_TOKEN }}
6364
cache: 'gradle'
6465
set-java-home: 'true'
@@ -67,7 +68,7 @@ jobs:
6768
- name: 🏗️ Native Image Build & Test
6869
id: native-build
6970
run: |
70-
./gradlew nativeCompile
71+
./gradlew nativeCompile -Pquick -Preports
7172
ls -ltrh build/${{ github.event.repository.name }}*.tar.gz
7273
7374
- name: 📤 Upload ${{ matrix.os }} native image
@@ -78,13 +79,24 @@ jobs:
7879
build/${{ steps.native-build.outputs.native_image_name }}
7980
if-no-files-found: error
8081

82+
- name: 📈 Upload ${{ matrix.os }} native image dashboard
83+
if: runner.os == 'Linux'
84+
uses: actions/upload-artifact@v3
85+
with:
86+
name: ${{ steps.native-build.outputs.native_image_dashboard }}
87+
path: |
88+
build/${{ steps.native-build.outputs.native_image_dashboard }}.bgv
89+
if-no-files-found: error
90+
8191

8292
native-build-musl:
8393
name: GraalVM CE Dev + musl static image
8494
runs-on: ubuntu-latest
8595

8696
outputs:
97+
version: ${{ steps.native-build.outputs.version }}
8798
native_image_name: ${{ steps.native-build.outputs.native_image_name }}
99+
native_image_dashboard: ${{ steps.native-build.outputs.native_image_dashboard }}
88100

89101
steps:
90102
- name: 🛎️ Check out repository
@@ -95,8 +107,8 @@ jobs:
95107
- name: ☕ Setup GraalVM CE Dev Build
96108
uses: graalvm/setup-graalvm@v1
97109
with:
98-
version: 'dev'
99110
java-version: 'dev'
111+
distribution: 'graalvm-community'
100112
github-token: ${{ secrets.GITHUB_TOKEN }}
101113
cache: 'gradle'
102114
native-image-musl: 'true'
@@ -106,7 +118,7 @@ jobs:
106118
- name: 🏗️ Build static image with musl libc
107119
id: native-build
108120
run: |
109-
./gradlew nativeCompile -Pmusl
121+
./gradlew nativeCompile -Pquick -Pmusl -Preports
110122
ls -ltrh build/${{ github.event.repository.name }}*.tar.gz
111123
112124
- name: 📤 Upload static binary

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ $ build/native-image-playground.output/default/native-image-playground
4949
$ ./gradlew clean nativeCompile --rerun-tasks --no-build-cache
5050

5151
# GraalVM JIT Mode
52-
# ----------------
5352
$ ./gradlew build
5453
$ java --enable-preview \
5554
--add-modules=ALL-SYSTEM \

build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
plugins { id("plugins.graalvm") }
1+
plugins { plugins.graalvm }
22

33
dependencies {
44
implementation(platform(libs.ktor.bom))

gradle/build-logic/common-plugins/build.gradle.kts

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,10 @@ val dslJavaVersion = libs.versions.kotlin.dsl.jvmtarget
1717

1818
tasks {
1919
withType<KotlinCompile>().configureEach {
20-
compilerOptions { jvmTarget = dslJavaVersion.map(JvmTarget::fromTarget) }
20+
compilerOptions {
21+
jvmTarget = dslJavaVersion.map(JvmTarget::fromTarget)
22+
freeCompilerArgs.addAll("-Xcontext-receivers")
23+
}
2124
}
2225
}
2326

@@ -28,6 +31,12 @@ kotlin {
2831
optIn("kotlin.ExperimentalStdlibApi")
2932
optIn("kotlin.io.path.ExperimentalPathApi")
3033
optIn("kotlin.time.ExperimentalTime")
34+
optIn("org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi")
35+
optIn("org.jetbrains.kotlin.gradle.targets.js.dsl.ExperimentalKotlinJsDsl")
36+
optIn("org.jetbrains.kotlin.gradle.targets.js.dsl.ExperimentalWasmDsl")
37+
optIn("org.jetbrains.kotlin.gradle.targets.js.dsl.ExperimentalDistributionDsl")
38+
optIn("org.jetbrains.kotlin.gradle.targets.js.dsl.ExperimentalDceDsl")
39+
optIn("org.jetbrains.compose.ExperimentalComposeLibrary")
3140
}
3241
}
3342
}
@@ -46,9 +55,9 @@ gradlePlugin {
4655
// Uncomment the id to change plugin id for this pre-compiled plugin
4756
named("plugins.common") {
4857
// id = "dev.suresh.gradle.plugins.common"
49-
displayName = "Common plugin"
58+
displayName = "Common build-logic plugin"
5059
description = "Common pre-compiled script plugin"
51-
tags = listOf("Common Plugin")
60+
tags = listOf("Common Plugin", "build-logic")
5261
}
5362

5463
// val settingsPlugin by creating {}
@@ -60,6 +69,9 @@ jte {
6069
contentType = gg.jte.ContentType.Plain
6170
sourceDirectory = sourceSets.main.get().resources.srcDirs.firstOrNull()?.toPath()
6271
generate()
72+
// jteExtension("gg.jte.models.generator.ModelExtension")
73+
// jteExtension("gg.jte.nativeimage.NativeResourcesExtension")
74+
// binaryStaticContent = true
6375
}
6476

6577
dependencies {
@@ -69,6 +81,7 @@ dependencies {
6981
implementation(libs.ajalt.mordant)
7082
implementation(libs.jte.runtime)
7183
implementation(libs.build.zip.prefixer)
84+
// jteGenerate(libs.jte.models)
7285
// compileOnly(libs.jte.kotlin)
7386

7487
implementation(libs.build.kotlin)

gradle/build-logic/common-plugins/src/main/kotlin/dev/suresh/gradle/CommonExtns.kt renamed to gradle/build-logic/common-plugins/src/main/kotlin/common/CommonExtns.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package dev.suresh.gradle
1+
package common
22

33
import java.io.File
44
import java.text.DecimalFormat

gradle/build-logic/common-plugins/src/main/kotlin/GithubAction.kt renamed to gradle/build-logic/common-plugins/src/main/kotlin/common/GithubAction.kt

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import GithubAction.MsgType.*
1+
package common
2+
23
import java.nio.file.StandardOpenOption.*
34
import java.util.*
45
import kotlin.io.path.*
@@ -27,7 +28,7 @@ object GithubAction {
2728
* Prints a debug message to the log. You must create a secret named **ACTIONS_STEP_DEBUG** with
2829
* the value `true` to see the debug messages set by this command in the log.
2930
*/
30-
fun debug(message: String) = echo(message(message, DEBUG))
31+
fun debug(message: String) = echo(message(message, MsgType.DEBUG))
3132

3233
/**
3334
* Creates a notice message and prints the message to the log. This message will create an
@@ -46,7 +47,7 @@ object GithubAction {
4647
echo(
4748
message(
4849
message = message,
49-
type = NOTICE,
50+
type = MsgType.NOTICE,
5051
title = title,
5152
file = file,
5253
line = line,
@@ -71,7 +72,7 @@ object GithubAction {
7172
echo(
7273
message(
7374
message = message,
74-
type = WARNING,
75+
type = MsgType.WARNING,
7576
title = title,
7677
file = file,
7778
line = line,
@@ -96,7 +97,7 @@ object GithubAction {
9697
echo(
9798
message(
9899
message = message,
99-
type = ERROR,
100+
type = MsgType.ERROR,
100101
title = title,
101102
file = file,
102103
line = line,
@@ -256,7 +257,7 @@ object GithubAction {
256257
append("::")
257258
append(type.name.lowercase())
258259
when {
259-
type != DEBUG -> {
260+
type != MsgType.DEBUG -> {
260261
val params = mutableListOf<String>()
261262
if (title.isNotBlank()) {
262263
params.add("title=$title")

0 commit comments

Comments
 (0)