Initial Commit

This commit is contained in:
Reproog committed 2026-11-17 08:47:34 +01:00
commit fca197514e
67 files changed
+3347

No files matched your search

+66
View File
@@ -0,0 +1,66 @@
import org.teavm.gradle.api.OptimizationLevel
plugins {
id 'java'
id("com.github.xpenatan.gdx-teavm") version "$gdxTeaVMVersion"
}
eclipse.project.name = appName + "-teavm"
// This must be at least 17, and no lower than the JDK version this project is built with.
java.targetCompatibility = "17"
// This should probably be equal to targetCompatibility, above. This only affects the TeaVM module.
java.sourceCompatibility = "17"
dependencies {
implementation "com.github.xpenatan.gdx-teavm:backend-web:$gdxTeaVMVersion"
implementation project(':core')
}
/// The tasks set up for debugging are gdx_teavm_web_js_build and gdx_teavm_web_js_run .
/// These auto-build and reload changed sources; they don't obfuscate their output.
/// The tasks for releases are gdx_teavm_web_js_release_build, gdx_teavm_web_js_release_run,
/// gdx_teavm_web_wasm_release_build, and gdx_teavm_web_wasm_release_run .
/// The build tasks will place a build in build/dist/js/release/webapp or build/dist/wasm/release/webapp .
/// The run tasks (including debug) will provide a link to click in the build output.
/// The run tasks won't end on their own; you can open the link multiple times until you stop the build.
gdxTeaVM {
assets.from(rootProject.files('assets'))
/// You can add additional classes or packages that need reflection here.
//reflection.add("io.doppelspalt.reflect")
webDefaults {
mainClass.set("io.doppelspalt.teavm.TeaVMLauncher")
htmlTitle.set(appName)
}
js {
devServer {
enabled.set(true)
autoBuild.set(true)
autoReload.set(true)
optimization.set(OptimizationLevel.NONE)
}
}
js("release") {
obfuscated.set(true)
serverPort.set(8180)
optimization.set(OptimizationLevel.BALANCED)
}
wasm("release") {
obfuscated.set(true)
serverPort.set(8181)
optimization.set(OptimizationLevel.BALANCED)
}
}
// For backwards compatibility with the earlier run and build tasks.
tasks.register("run"){
dependsOn("gdx_teavm_web_wasm_release_run")
}
build.dependsOn("gdx_teavm_web_wasm_release_build")
@@ -0,0 +1,21 @@
package io.doppelspalt.teavm;
import com.github.xpenatan.gdx.teavm.backends.web.WebApplicationConfiguration;
import com.github.xpenatan.gdx.teavm.backends.web.WebApplication;
import io.doppelspalt.Main;
/**
* Launches the TeaVM/HTML application.
*/
public class TeaVMLauncher {
public static void main(String[] args) {
WebApplicationConfiguration config = new WebApplicationConfiguration("canvas");
//// If width and height are each greater than 0, then the app will use a fixed size.
//config.width = 640;
//config.height = 480;
//// If width and height are both 0, then the app will use all available space.
config.width = 0;
config.height = 0;
new WebApplication(new Main(), config);
}
}