apply plugin: 'java-library' dependencies { implementation "com.badlogicgames.gdx:gdx:$gdxVersion" implementation "com.badlogicgames.gdx:gdx-platform:$gdxVersion" implementation "com.github.xpenatan.gdx-teavm:backend-teavm:$gdxTeaVMVersion" implementation "com.badlogicgames.gdx:gdx-freetype:$gdxVersion" implementation "com.github.xpenatan.gdx-teavm:gdx-freetype-teavm:$gdxTeaVMVersion" implementation project(':core') implementation "org.teavm:teavm-jso:$teaVMVersion" implementation "org.teavm:teavm-core:$teaVMVersion" } repositories { google() mavenCentral() maven { url 'https://teavm.org/maven/repository' } } tasks.register('compileClient', JavaExec) { classpath(sourceSets.main.runtimeClasspath) mainClass.set('com.shatteredpixel.shatteredpixeldungeon.html.Compile') outputs.dir '../release/webapp' doFirst { println "Running compileClient..." } doLast { println "compileClient completed!" } } task modifyHtml { doLast { def htmlFile = file("../release/webapp/index.html") def destinationDir = file("../release/webapp/assets") def sourceFavicon = file("../desktop/src/main/assets/icons/windows.ico") def sourceGif = file("../html/src/main/assets/logo.gif") def destinationStartupLogo = file("../release/webapp/startup-logo.png") // copy windows.ico if (sourceFavicon.exists()) { def destinationFile = new File(destinationDir, "windows.ico") sourceFavicon.withInputStream { input -> destinationFile.withOutputStream { output -> output << input } } println "Copied windows.ico to assets folder." } else { println "windows.ico does not exist. Skipping copy step." } if (sourceGif.exists()) { destinationStartupLogo.parentFile.mkdirs() sourceGif.withInputStream { input -> destinationStartupLogo.withOutputStream { output -> output << input } } println "Replaced startup-logo.png with a gif." } else { println "Gif does not exist. Skipping replacement step." } if (htmlFile.exists()) { def faviconLink = '' def content = htmlFile.text // add a link for the favicon if (content.contains("")) { content = content.replace("", faviconLink + "\n") println "Favicon link added to index.html." } // Change page title if (content.contains("