Fetched repo updates and use a newer gdx-teavm version
This commit is contained in:
@@ -16,27 +16,18 @@
|
||||
|
||||
package com.shatteredpixel.shatteredpixeldungeon.html;
|
||||
|
||||
import com.github.xpenatan.gdx.backends.teavm.config.AssetFileHandle;
|
||||
import com.github.xpenatan.gdx.backends.teavm.config.TeaBuildConfiguration;
|
||||
import com.github.xpenatan.gdx.backends.teavm.config.TeaBuilder;
|
||||
import com.github.xpenatan.gdx.backends.teavm.gen.SkipClass;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import org.teavm.tooling.TeaVMTool;
|
||||
import org.teavm.vm.TeaVMOptimizationLevel;
|
||||
|
||||
@SkipClass
|
||||
public class Compile {
|
||||
|
||||
public static void main(String[] args) throws IOException {
|
||||
deleteDir(new File("../release/webapp"));
|
||||
Configure.configure();
|
||||
|
||||
TeaBuildConfiguration conf = new TeaBuildConfiguration();
|
||||
|
||||
conf.webappPath = new File("../release").getAbsolutePath();
|
||||
conf.assetsPath.add(new AssetFileHandle("../core/src/main/assets"));
|
||||
|
||||
TeaVMTool tool = TeaBuilder.config(conf);
|
||||
TeaVMTool tool = new TeaVMTool();
|
||||
tool.setMainClass(TeaVMLauncher.class.getName());
|
||||
tool.setOptimizationLevel(TeaVMOptimizationLevel.ADVANCED);
|
||||
tool.setObfuscated(true);
|
||||
@@ -50,13 +41,4 @@ public class Compile {
|
||||
TeaBuilder.build(tool);
|
||||
}
|
||||
|
||||
private static void deleteDir(File dir) {
|
||||
File[] files = dir.listFiles();
|
||||
if (files != null) {
|
||||
for (File file : files) {
|
||||
deleteDir(file);
|
||||
}
|
||||
}
|
||||
dir.delete();
|
||||
}
|
||||
}
|
||||
|
||||
55
html/src/main/java/Configure.java
Normal file
55
html/src/main/java/Configure.java
Normal file
@@ -0,0 +1,55 @@
|
||||
/*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at:
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* This file is derived from micronaut-libgdx-teavm (https://github.com/hollingsworthd/micronaut-libgdx-teavm),
|
||||
* originally licensed under the Apache License, Version 2.0.
|
||||
*
|
||||
* Modifications made by Konsthol on 13/4/25:
|
||||
* - Adjusted to compile Shattered Pixel Dungeon
|
||||
*
|
||||
* Copyright 2022 Daniel Hollingsworth
|
||||
*/
|
||||
|
||||
package com.shatteredpixel.shatteredpixeldungeon.html;
|
||||
|
||||
import com.github.xpenatan.gdx.backends.teavm.config.AssetFileHandle;
|
||||
import com.github.xpenatan.gdx.backends.teavm.config.TeaBuildConfiguration;
|
||||
import com.github.xpenatan.gdx.backends.teavm.config.TeaBuilder;
|
||||
import com.github.xpenatan.gdx.backends.teavm.config.TeaTargetType;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import org.teavm.tooling.TeaVMTool;
|
||||
import org.teavm.vm.TeaVMOptimizationLevel;
|
||||
|
||||
public class Configure {
|
||||
|
||||
public static void main(String[] args) throws IOException {
|
||||
deleteDir(new File("../release/webapp"));
|
||||
configure();
|
||||
}
|
||||
|
||||
private static void deleteDir(File dir) {
|
||||
File[] files = dir.listFiles();
|
||||
if (files != null) {
|
||||
for (File file : files) {
|
||||
deleteDir(file);
|
||||
}
|
||||
}
|
||||
dir.delete();
|
||||
}
|
||||
|
||||
public static void configure() throws IOException {
|
||||
TeaBuildConfiguration conf = new TeaBuildConfiguration();
|
||||
conf.assetsPath.add(new AssetFileHandle("../core/src/main/assets"));
|
||||
conf.shouldGenerateAssetFile = true;
|
||||
conf.webappPath = new File("../release").getAbsolutePath();
|
||||
conf.targetType = TeaTargetType.JAVASCRIPT;
|
||||
TeaBuilder.config(conf);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -40,7 +40,7 @@ public class TeaVMLauncher {
|
||||
}
|
||||
|
||||
private static void initializeServices() {
|
||||
Game.version = "3.1.0";
|
||||
Game.versionCode = 833;
|
||||
Game.version = "3.2.3";
|
||||
Game.versionCode = 868;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user