Skip to content

Commit 1dcbe0d

Browse files
committed
add teavm, java min is 11
1 parent 90825e6 commit 1dcbe0d

1 file changed

Lines changed: 29 additions & 1 deletion

File tree

app/build.gradle

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,14 @@
99
plugins {
1010
// Apply the application plugin to add support for building a CLI application in Java.
1111
id 'application'
12+
13+
//Spotless
1214
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"
1320
}
1421

1522
repositories {
@@ -20,6 +27,9 @@ repositories {
2027
dependencies {
2128
// This dependency is used by the application.
2229
implementation libs.guava
30+
31+
// TeaVM
32+
implementation teavm.libs.jsoApis
2333
}
2434

2535
testing {
@@ -40,7 +50,7 @@ java {
4050
}
4151

4252
tasks.withType(JavaCompile) {
43-
options.release.set(8)
53+
options.release.set(11)
4454
}
4555

4656
application {
@@ -56,4 +66,22 @@ spotless {
5666
target 'src/**/*.java'
5767
removeUnusedImports()
5868
}
69+
}
70+
71+
teavm {
72+
all {
73+
mainClass = "io.github.project516.NumberGuessingGame.Main"
74+
}
75+
js {
76+
addedToWebApp = true
77+
78+
// this is also optional, default value is <project name>.js
79+
targetFileName = "NumberGuessingGame.js"
80+
}
81+
wasmGC {
82+
addedToWebApp = true
83+
84+
// this is also optional, default value is <project name>.wasm
85+
targetFileName = "NumberGuessingGame.wasm"
86+
}
5987
}

0 commit comments

Comments
 (0)