Skip to content

Commit d54e69c

Browse files
committed
just use java 21
1 parent 2f1cb0a commit d54e69c

1 file changed

Lines changed: 30 additions & 0 deletions

File tree

app/build.gradle

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@ plugins {
1212

1313
//Spotless
1414
id 'com.diffplug.spotless' version '8.0.0'
15+
16+
// TeaVM
17+
id 'java'
18+
id 'war'
19+
id "org.teavm" version "0.12.3"
1520
}
1621

1722
repositories {
@@ -22,6 +27,9 @@ repositories {
2227
dependencies {
2328
// This dependency is used by the application.
2429
implementation libs.guava
30+
31+
// TeaVM
32+
implementation teavm.libs.jsoApis
2533
}
2634

2735
testing {
@@ -42,11 +50,15 @@ java {
4250
}
4351
}
4452

53+
/*
54+
4555
tasks.withType(JavaCompile) {
4656
// Target Java 8
4757
options.release.set(8)
4858
}
4959
60+
*/
61+
5062
application {
5163
// Define the main class for the application.
5264
mainClass = 'io.github.project516.NumberGuessingGame.Main'
@@ -61,3 +73,21 @@ spotless {
6173
removeUnusedImports()
6274
}
6375
}
76+
77+
teavm {
78+
all {
79+
mainClass = "io.github.project516.NumberGuessingGame.Main"
80+
}
81+
js {
82+
addedToWebApp = true
83+
84+
// this is also optional, default value is <project name>.js
85+
targetFileName = "NumberGuessingGame.js"
86+
}
87+
wasmGC {
88+
addedToWebApp = true
89+
90+
// this is also optional, default value is <project name>.wasm
91+
targetFileName = "NumberGuessingGame.wasm"
92+
}
93+
}

0 commit comments

Comments
 (0)