Updated dep versions and added simple mvn run cmd

This commit is contained in:
Willem Cazander 2025-07-14 20:24:57 +02:00
parent 980e40af65
commit ba99c5bdb6
27 changed files with 354 additions and 141 deletions

View file

@ -40,8 +40,8 @@ import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.Screen;
import com.badlogic.gdx.utils.ScreenUtils;
import games.spooky.gdx.nativefilechooser.NativeFileChooser;
import love.distributedrebirth.gdxapp4d.tos4.service.SystemGdxTerminal;
import net.spookygames.gdx.nativefilechooser.NativeFileChooser;
import ᒢᐩᐩ.ᒃᣔᔆᔆᒃᐤᐤᣕ.ᒄᓫᣔᐪᑋ.ᔆᣖᑊᒄᓫᣗ.BãßBȍőnSpiderWireFly注;
import ᒢᐩᐩ.ᒃᣔᔆᔆᒃᐤᐤᣕ.ᒄᓫᣔᐪᑋ.ᔆᣖᑊᒄᓫᣗ.BãßBȍőnSpiderWire注;
import ᒢᐩᐩ.ᒃᣔᔆᔆᒃᐤᐤᣕ.ᔿᓑᔿᔿᔋᐝᣚ.BãßᛗᚢᛗᛗᛉVū́ǘrChaliceEnumShot𓄯;

View file

@ -40,6 +40,7 @@ import java.util.List;
import java.util.Properties;
import java.util.function.Consumer;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;
import org.osgi.framework.BundleException;
@ -57,6 +58,7 @@ import com.badlogic.gdx.graphics.g2d.BitmapFont;
import com.badlogic.gdx.graphics.g2d.freetype.FreeTypeFontGenerator;
import com.badlogic.gdx.graphics.g2d.freetype.FreeTypeFontGenerator.FreeTypeFontParameter;
import games.spooky.gdx.nativefilechooser.NativeFileChooser;
import love.distributedrebirth.gdxapp4d.tos4.service.SystemWarpBase;
import love.distributedrebirth.gdxapp4d.tos4.service.SystemGdxBootArgs;
import love.distributedrebirth.gdxapp4d.tos4.service.SystemGdxBootReadyListener;
@ -73,7 +75,6 @@ import love.distributedrebirth.warpme.sea.WaterSeaChain;
import love.distributedrebirth.warpme.sea.WaterSeaMagic;
import love.distributedrebirth.warpme.ship.WaterDevice;
import love.distributedrebirth.warpme.ship.WaterDeviceDriver;
import net.spookygames.gdx.nativefilechooser.NativeFileChooser;
import ᒢᐩᐩ.ᒃᣔᔆᔆᒃᐤᐤᣕ.Bãß;
import ᒢᐩᐩ.ᒃᣔᔆᔆᒃᐤᐤᣕ.ᒃᐤᣔᐪ.BãßBȍőnBőatWind;
import ᒢᐩᐩ.ᒃᣔᔆᔆᒃᐤᐤᣕ.ᒃᐤᣔᐪ.BãßBȍőnBőatWindKnots;
@ -144,6 +145,9 @@ public class GDXAppTos4Activator implements BundleActivator {
boolean useLocal = args.contains("use-local");
warpshipHome = new File(".", WARPSHIP_HOME);
if (!warpshipHome.exists()) {
warpshipHome = new File("gdxapp4d-boot-desktop", WARPSHIP_HOME); // tmp for: mvn verify -P test-none,run
}
if (!warpshipHome.exists()) {
bootScreen.bootLineError("ERROR: No Warpship home.");
startError = true;
@ -176,14 +180,19 @@ public class GDXAppTos4Activator implements BundleActivator {
localOverrides = new Properties();
if (useLocal) {
File localOverride = new File("local-override.xml");
File localOverride = new File(warpshipHome, "local-override.xml");
if (localOverride.exists()) {
try {
localOverrides.loadFromXML(new FileInputStream(localOverride));
} catch (Exception e) {
throw new RuntimeException(e);
}
bootScreen.bootLine("use-local: local-override.xml loaded.");
for (Object keyObj : localOverrides.keySet()) {
String key = String.class.cast(keyObj);
String value = localOverrides.getProperty(key);
localOverrides.setProperty(key, warpshipHome.getAbsolutePath() + "/" + value);
}
bootScreen.bootLine("use-local: local-override.xml loaded: " + localOverrides.size());
} else {
bootScreen.bootLine("use-local: local-override.xml not found.");
}
@ -430,20 +439,24 @@ public class GDXAppTos4Activator implements BundleActivator {
for (SystemWarpSea service : registratedSeas) {
String key = service.getWarpKey();
File waterHome = service.getWarpHome();
List<Bundle> loaded = new ArrayList<>();
for (WaterSeaMagic magic:service.getWarpSea().theWater().getSeaMagics()) {
if ("application/vnd.osgi.bundle".equals(magic.getMime())) {
magic.setMime("application/vnd.osgi.bundle.loaded"); // TODO: HACK for now to not load again
String overrideBundleKey = key + "." + magic.getFile();
String overrideBundle = localOverrides.getProperty(overrideBundleKey);
if (overrideBundle == null) {
LOG.debug("loadBundles: "+waterHome.getAbsolutePath()+"/"+magic.getFile());
GDXAppTos4BootFactory.installAndStartBundles(context, "reference:file:"+waterHome.getAbsolutePath()+"/"+magic.getFile());
LOG.debug("loadBundle: "+waterHome.getAbsolutePath()+"/"+magic.getFile());
loaded.add(context.installBundle("reference:file:"+waterHome.getAbsolutePath()+"/"+magic.getFile()));
} else {
LOG.debug("loadBundles: "+overrideBundle);
GDXAppTos4BootFactory.installAndStartBundles(context, "reference:file:"+overrideBundle);
LOG.debug("loadBundle-local: "+overrideBundle);
loaded.add(context.installBundle("reference:file:"+overrideBundle));
}
}
}
for (Bundle b : loaded) {
b.start();
}
}
}

View file

@ -33,9 +33,6 @@ import java.util.HashMap;
import java.util.Map;
import java.util.ServiceLoader;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;
import org.osgi.framework.BundleException;
import org.osgi.framework.Constants;
import org.osgi.framework.launch.Framework;
import org.osgi.framework.launch.FrameworkFactory;
@ -44,13 +41,6 @@ import ᒢᐩᐩ.ᔆʸᔆᐪᓫᔿ.ᒃᣔᒃᓫᒻ.ᑊᐣᓑᖮᐪᔆ.DuytsDocAu
@DuytsDocAuthor注(name = "للَّٰهِilLצسُو", copyright = "©Δ∞ 仙上主天")
public class GDXAppTos4BootFactory {
public static void installAndStartBundles(BundleContext bundleContext, String... bundleLocations) throws BundleException {
for (String location : bundleLocations) {
Bundle addition = bundleContext.installBundle(location);
addition.start();
}
}
public static Framework createFramework() {
return createFramework(buildConfig());
@ -123,7 +113,7 @@ public class GDXAppTos4BootFactory {
"imgui.glfw,"+
"imgui.gl3,"+
"imgui.type,"+
"net.spookygames.gdx.nativefilechooser,"+
"games.spooky.gdx.nativefilechooser,"+
"org.x4o.fc18,"+
"org.x4o.fc18.cake2,"+
"org.x4o.fc18.cake2.clk1k,"+

View file

@ -27,7 +27,7 @@
package love.distributedrebirth.gdxapp4d.tos4.service;
import net.spookygames.gdx.nativefilechooser.NativeFileChooser;
import games.spooky.gdx.nativefilechooser.NativeFileChooser;
import ᒢᐩᐩ.ᔆʸᔆᐪᓫᔿ.ᒃᣔᒃᓫᒻ.ᑊᐣᓑᖮᐪᔆ.DuytsDocAuthor注;
@DuytsDocAuthor注(name = "للَّٰهِilLצسُو", copyright = "©Δ∞ 仙上主天")