Skip to content

Commit

Permalink
test 13
Browse files Browse the repository at this point in the history
  • Loading branch information
Itzbenz committed Jul 2, 2021
1 parent 2efd437 commit 38ab696
Show file tree
Hide file tree
Showing 8 changed files with 45 additions and 18 deletions.
29 changes: 23 additions & 6 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -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'

}
Expand All @@ -163,6 +165,7 @@ subprojects {

dependencies{
testImplementation(files(mindustryExecutable))
testImplementation(files(mindustryServerExecutable))
testImplementation(rootProject)
//compileOnly(files(mindustryExecutable))
compileOnly(rootProject)
Expand Down Expand Up @@ -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) {
Expand All @@ -345,6 +361,7 @@ static File getMindustryFile(){
//how lazy to download this
task download(){
doLast{
downloadMindustry(getMindustryServerURL(), getMindustryServerFile());
downloadMindustry(getMindustryURL(), getMindustryFile());
}
}
Expand Down
10 changes: 5 additions & 5 deletions desktop/src/main/java/org/o7/Fire/Glopion/Premain/Run.java
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package org.o7.Fire.Glopion.Premain;

public class ServerLauncher {
public static void main(String[] args) {

}
}
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 5 additions & 3 deletions release.properties
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 38ab696

Please sign in to comment.