2024-09-18 20:30:43 +02:00
|
|
|
plugins {
|
|
|
|
id 'java'
|
|
|
|
id 'org.gretty' version '3.1.0'
|
|
|
|
}
|
|
|
|
|
|
|
|
gretty {
|
|
|
|
contextPath = '/'
|
|
|
|
extraResourceBase 'build/dist/webapp'
|
|
|
|
}
|
|
|
|
|
|
|
|
sourceSets.main.resources.srcDirs += [ rootProject.file('assets').path ]
|
|
|
|
project.ext.mainClassName = 'com.openeggbert.teavm.TeaVMBuilder'
|
|
|
|
eclipse.project.name = appName + '-teavm'
|
|
|
|
|
|
|
|
// This must be at least 11, and no higher than the JDK version this project is built with.
|
|
|
|
java.targetCompatibility = "11"
|
|
|
|
// This should probably be equal to targetCompatibility, above. This only affects the TeaVM module.
|
|
|
|
java.sourceCompatibility = "11"
|
|
|
|
|
|
|
|
|
|
|
|
dependencies {
|
|
|
|
implementation "com.github.xpenatan.gdx-teavm:backend-teavm:$gdxTeaVMVersion"
|
|
|
|
implementation "org.teavm:teavm-classlib:$teaVMVersion"
|
|
|
|
implementation "org.teavm:teavm-core:$teaVMVersion"
|
|
|
|
implementation "org.teavm:teavm-jso-apis:$teaVMVersion"
|
|
|
|
implementation "org.teavm:teavm-jso-impl:$teaVMVersion"
|
|
|
|
implementation "org.teavm:teavm-jso:$teaVMVersion"
|
|
|
|
implementation "org.teavm:teavm-tooling:$teaVMVersion"
|
|
|
|
implementation project(':core')
|
|
|
|
implementation "com.pixelgamelibrary:pixel:$pixelVersion:sources"
|
|
|
|
api "com.pixelgamelibrary:pixel-backend-libgdx:$pixelVersion"
|
|
|
|
implementation "com.pixelgamelibrary:pixel-backend-libgdx:$pixelVersion:sources"
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
tasks.register('buildJavaScript', JavaExec) {
|
|
|
|
dependsOn classes
|
|
|
|
setDescription("Transpile bytecode to JavaScript via TeaVM")
|
|
|
|
mainClass.set(project.mainClassName)
|
|
|
|
setClasspath(sourceSets.main.runtimeClasspath)
|
|
|
|
}
|
|
|
|
build.dependsOn buildJavaScript
|
|
|
|
|
|
|
|
tasks.register("run") {
|
|
|
|
description = "Run the JavaScript application hosted via a local Jetty server at http://localhost:8080/"
|
2024-09-18 22:15:01 +02:00
|
|
|
dependsOn(buildJavaScript/*, tasks.named("jettyRun")*/)//todo
|
2024-09-18 20:30:43 +02:00
|
|
|
}
|