File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 99plugins {
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
1522repositories {
@@ -20,6 +27,9 @@ repositories {
2027dependencies {
2128 // This dependency is used by the application.
2229 implementation libs. guava
30+
31+ // TeaVM
32+ implementation teavm. libs. jsoApis
2333}
2434
2535testing {
4050}
4151
4252tasks. withType(JavaCompile ) {
43- options. release. set(8 )
53+ options. release. set(11 )
4454}
4555
4656application {
@@ -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}
You can’t perform that action at this time.
0 commit comments