File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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
1722repositories {
@@ -22,6 +27,9 @@ repositories {
2227dependencies {
2328 // This dependency is used by the application.
2429 implementation libs. guava
30+
31+ // TeaVM
32+ implementation teavm. libs. jsoApis
2533}
2634
2735testing {
@@ -42,11 +50,15 @@ java {
4250 }
4351}
4452
53+ /*
54+
4555tasks.withType(JavaCompile) {
4656 // Target Java 8
4757 options.release.set(8)
4858}
4959
60+ */
61+
5062application {
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+ }
You can’t perform that action at this time.
0 commit comments