diff --git a/build.gradle b/build.gradle index 1ac71aa..992ffea 100644 --- a/build.gradle +++ b/build.gradle @@ -102,6 +102,7 @@ allprojects { if(!new File(sdkD8).exists()) sdkD8 = new File(sdkRoot, "nope").getAbsolutePath() mindustryExecutable = getMindustryFile() + mindustryServerExecutable = getMindustryServerFile() //imagine writing json modhjson = "" modhjson += 'name: "' + modsNname + '"\n' @@ -125,20 +126,21 @@ allprojects { //From Root to every project dependencies{ // - if(System.getProperty("modsNBE") != null && !System.getProperty("modsNBE").isEmpty()) { + def be = System.getProperty("modsNBE") != null && !System.getProperty("modsNBE").isEmpty() + if(be) { downloadMindustry(getMindustryURL(), getMindustryFile()); } File mindustry = file(mindustryExecutable) - //if(mindustry.exists()) { - // compileOnly(files(mindustry)) + if(be && mindustry.exists()) { + compileOnly(files(mindustry)) //testCompileOnly(files(mindustry)) - // testImplementation(files(mindustry)) - //}else {//if you feel fancy remove this else + testImplementation(files(mindustry)) + }else {//if you feel fancy remove this else compileOnly("com.github.Anuken.Mindustry:desktop:$mindustryHash") compileOnly("com.github.Anuken.Arc:arc-core:$arcHash") compileOnly("com.github.Anuken.Arc:backend-sdl:$arcHash") compileOnly("com.github.Anuken.Mindustry:core:$mindustryHash") - // } + } compileOnly group: 'org.jetbrains', name: 'annotations', version: '21.0.1' } @@ -163,6 +165,7 @@ subprojects { dependencies{ testImplementation(files(mindustryExecutable)) + testImplementation(files(mindustryServerExecutable)) testImplementation(rootProject) //compileOnly(files(mindustryExecutable)) compileOnly(rootProject) @@ -327,6 +330,19 @@ static void copyToMindustry(File f){ System.out.println("Copying: " + f.getAbsolutePath() + " to "+ target.getAbsolutePath()); Files.copy(f.toPath(), target.toPath(), StandardCopyOption.REPLACE_EXISTING); } +static URL getMindustryServerURL(){ + if(System.getProperty("modsNBE", null) != null) { + String h = System.getProperty("modsNBE"); + return new URL("https://github.com/Anuken/MindustryBuilds/releases/download/"+h+"/Mindustry-BE-Server-"+h+".jar") + } + return new URL("https://github.com/Anuken/Mindustry/releases/download/" + System.getProperty("mindustryHash") + "/server-release.jar"); +} + +static File getMindustryServerFile(){ + URL u = getMindustryServerURL() + File mindustry = new File(new File(new File(OS.getAppDataDirectoryString("Mindustry")), "build/cache/"), u.getFile()); + return mindustry.getAbsoluteFile(); +} static URL getMindustryURL(){ if(System.getProperty("modsNBE", null) != null) { @@ -345,6 +361,7 @@ static File getMindustryFile(){ //how lazy to download this task download(){ doLast{ + downloadMindustry(getMindustryServerURL(), getMindustryServerFile()); downloadMindustry(getMindustryURL(), getMindustryFile()); } } diff --git a/desktop/src/main/java/org/o7/Fire/Glopion/Premain/Run.java b/desktop/src/main/java/org/o7/Fire/Glopion/Premain/Run.java index c70755b..b40d739 100644 --- a/desktop/src/main/java/org/o7/Fire/Glopion/Premain/Run.java +++ b/desktop/src/main/java/org/o7/Fire/Glopion/Premain/Run.java @@ -18,12 +18,12 @@ public static void main(String[] args) throws Throwable { } public static class Server { + //run configuration + //Classpath: Mindustry-Glopion.desktop.test + //Class org.o7.Fire.Glopion.Premain.Server.Run + //JVM: 16 public static void main(String[] args) throws Throwable { - AtomicBootstrap bootstrap = new AtomicBootstrap(); - bootstrap.loadCurrentClasspath(); - bootstrap.loadClasspath(); - bootstrap.getLoader().addURL(Cache.tryCache("https://github.com/Anuken/Mindustry/releases/download/v126.2/server-release.jar")); - bootstrap.loadMain("mindustry.server.ServerLauncher", args); + ServerLauncher.main(args); } } } diff --git a/desktop/src/main/java/org/o7/Fire/Glopion/Premain/ServerLauncher.java b/desktop/src/main/java/org/o7/Fire/Glopion/Premain/ServerLauncher.java new file mode 100644 index 0000000..5a427f1 --- /dev/null +++ b/desktop/src/main/java/org/o7/Fire/Glopion/Premain/ServerLauncher.java @@ -0,0 +1,7 @@ +package org.o7.Fire.Glopion.Premain; + +public class ServerLauncher { + public static void main(String[] args) { + + } +} diff --git a/gradle.properties b/gradle.properties index 0f55e5a..2356b3e 100644 --- a/gradle.properties +++ b/gradle.properties @@ -10,7 +10,7 @@ modsNdescription=Bottom Text modsNminMindustryVersion=127 atomHash=61f3bc10b580b8c26db25363aac4a2213e3b65f5 modsNJavaMain=org.o7.Fire.Glopion.Bootstrapper.Java -modsNversion=0.4.5 +modsNversion=0.5.5 modsNname=Mindustry-Glopion modsNdisplayName=Mindustry-Glopion arcHash=v127.1 diff --git a/release.properties b/release.properties index b546f43..64e4ca2 100644 --- a/release.properties +++ b/release.properties @@ -1,7 +1,9 @@ Note-Provider=Github Note=Deep Patch is desktop only.. Note-Schema=MainClass - Flavor - MindustryVersion - MindustryModifierVersion - Bootstrap - BootstrapperVersion - Revision/Version who cares -Note-Latest-Bootstrapper = 0.5.0 - 20 +Note-Latest-Bootstrapper=25 #pre-alpha -Desktop-Beta-127.1-pre.alpha-Bootstrap-19-9=https://github.com/o7-Fire/Mindustry-Glopion/releases/download/v5.5/Mindustry-Glopion-DeepPatch.jar -Beta-127.1-pre.alpha-Bootstrap-19-9=https://github.com/o7-Fire/Mindustry-Glopion/releases/download/v5.5/Mindustry-Glopion-Core.jar +Desktop-Beta-127.1-pre.alpha-Bootstrap-19-10=https://github.com/o7-Fire/Mindustry-Glopion/releases/download/v5.5/Mindustry-Glopion-DeepPatch.jar +Beta-127.1-pre.alpha-Bootstrap-19-10=https://github.com/o7-Fire/Mindustry-Glopion/releases/download/v5.5/Mindustry-Glopion-Core.jar +Desktop-Beta-127-pre.alpha-Bootstrap-19-10=https://github.com/o7-Fire/Mindustry-Glopion/releases/download/v5.5/Mindustry-Glopion-DeepPatch.jar +Beta-127-pre.alpha-Bootstrap-19-10=https://github.com/o7-Fire/Mindustry-Glopion/releases/download/v5.5/Mindustry-Glopion-Core.jar diff --git a/src/main/java/org/o7/Fire/Glopion/Bootstrapper/BootstrapperUI.java b/src/main/java/org/o7/Fire/Glopion/Bootstrapper/BootstrapperUI.java index 2fec1b2..a4e3fb7 100644 --- a/src/main/java/org/o7/Fire/Glopion/Bootstrapper/BootstrapperUI.java +++ b/src/main/java/org/o7/Fire/Glopion/Bootstrapper/BootstrapperUI.java @@ -209,7 +209,8 @@ public void init() { public void buildUI() { t.reset(); - t.add("Glopion Bootstrapper Settings [accent] ["+SharedBootstrapper.version+"]").growX().center().row(); + t.add("Glopion Bootstrapper Settings ").growX().center().row(); + t.add("Bootstrapper Version: [accent]" + "["+SharedBootstrapper.version+"]").growX().center().row(); t.check("Force Update", Core.settings.getBool("glopion-auto-update", false), b -> Core.settings.put("glopion-auto-update", b)).row(); t.button("Glopion Flavor [accent]" + Core.settings.getString("glopion-flavor", flavor), flavorDialog::show).disabled(s -> release.isEmpty()).growX().row(); t.button("Provider URL", providerURLDialog::show).growX().row(); diff --git a/src/main/java/org/o7/Fire/Glopion/Bootstrapper/SharedBootstrapper.java b/src/main/java/org/o7/Fire/Glopion/Bootstrapper/SharedBootstrapper.java index 9ec07e6..5eb05b1 100644 --- a/src/main/java/org/o7/Fire/Glopion/Bootstrapper/SharedBootstrapper.java +++ b/src/main/java/org/o7/Fire/Glopion/Bootstrapper/SharedBootstrapper.java @@ -12,7 +12,7 @@ //Java 8 only public class SharedBootstrapper { - public static final long version = 22; + public static final long version = 25; public static String platform; public static String getPlatform() { if(platform != null)return platform; diff --git a/src/main/java/org/o7/Fire/Glopion/Bootstrapper/UI/FlavorDialog.java b/src/main/java/org/o7/Fire/Glopion/Bootstrapper/UI/FlavorDialog.java index e4abc62..b56424d 100644 --- a/src/main/java/org/o7/Fire/Glopion/Bootstrapper/UI/FlavorDialog.java +++ b/src/main/java/org/o7/Fire/Glopion/Bootstrapper/UI/FlavorDialog.java @@ -74,7 +74,7 @@ void build() { Log.err(e); } } - boolean mindustryVersionCompatible = key.contains(Version.build+""); + boolean mindustryVersionCompatible = key.contains(Version.buildString()); boolean mindustryModifierCompatible = key.contains(Version.modifier.replace('-','.')); boolean bootstrapperCompatible = bootstrapMin < SharedBootstrapper.version; if (!bootstrapperCompatible && compatibleBootstrapperVersion) continue;