From 9461d7a3608567839699b1e62943f10da6dd98be Mon Sep 17 00:00:00 2001 From: Anuken Date: Tue, 19 Nov 2019 19:08:41 -0500 Subject: [PATCH] Hjson unit tests --- android/build.gradle | 2 +- build.gradle | 29 +++++++++++++++++++++++++-- core/src/io/anuke/mindustry/Vars.java | 2 +- gradle.properties | 2 +- 4 files changed, 30 insertions(+), 5 deletions(-) diff --git a/android/build.gradle b/android/build.gradle index 8dfa8665c5..5486155564 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -69,7 +69,7 @@ android{ } defaultConfig{ - Properties props = new Properties().with{p -> p.load(file('../core/assets/version.properties').newReader()); return p } + Properties props = loadVersionProps() Integer vcode = props['androidBuildCode']?.toInteger() ?: 1 def versionNameResult = "$versionNumber-$versionType-${getBuildVersion().replace(" ", "-")}" diff --git a/build.gradle b/build.gradle index 2f542f1a8e..0f6dcfe5bf 100644 --- a/build.gradle +++ b/build.gradle @@ -9,7 +9,7 @@ buildscript{ } dependencies{ - classpath 'com.mobidevelop.robovm:robovm-gradle-plugin:2.3.8-SNAPSHOT' + classpath 'com.mobidevelop.robovm:robovm-gradle-plugin:2.3.8' classpath "com.badlogicgames.gdx:gdx-tools:1.9.10" classpath "com.github.anuken:packr:-SNAPSHOT" } @@ -26,10 +26,14 @@ allprojects{ if(!project.hasProperty("versionType")) versionType = 'official' appName = 'Mindustry' gdxVersion = '1.9.10' - roboVMVersion = '2.3.8-SNAPSHOT' + roboVMVersion = '2.3.8' steamworksVersion = '891ed912791e01fe9ee6237a6497e5212b85c256' arcHash = null + loadVersionProps = { + return new Properties().with{p -> p.load(file('../core/assets/version.properties').newReader()); return p } + } + debugged = { return new File(projectDir.parent, '../Mindustry-Debug').exists() && !project.hasProperty("release") && project.hasProperty("args") } @@ -200,6 +204,27 @@ project(":core"){ writeVersion() } + task copyChangelog{ + doLast{ + def props = loadVersionProps() + def androidVersion = props['androidBuildCode'].toInteger() - 2 + def buildVersion = props["build"] + def loglines = file("../changelog").text.split("\n") + def maxLength = 460 + + def androidLogList = loglines.findAll{ line -> !line.endsWith("]") || line.endsWith("[Mobile]") || line.endsWith("[Android]")} + def result = "" + androidLogList.forEach({line -> + if(result.length() + line.length() + 1 < maxLength){ + result += line + "\n" + } + }) + def changelogs = file("../fastlane/metadata/android/en-US/changelogs/") + new File(changelogs, buildVersion + ".txt").text = (result) + new File(changelogs, androidVersion + ".txt").text = (result) + } + } + dependencies{ if(System.properties["user.name"] == "anuke"){ task cleanGen{ diff --git a/core/src/io/anuke/mindustry/Vars.java b/core/src/io/anuke/mindustry/Vars.java index efae707bf8..a722095c71 100644 --- a/core/src/io/anuke/mindustry/Vars.java +++ b/core/src/io/anuke/mindustry/Vars.java @@ -48,7 +48,7 @@ public class Vars implements Loadable{ /** URL for discord invite. */ public static final String discordURL = "https://discord.gg/mindustry"; /** URL for sending crash reports to */ - public static final String crashReportURL = "http://mins.us.to/report"; + public static final String crashReportURL = "http://192.99.169.18/report"; /** URL the links to the wiki's modding guide.*/ public static final String modGuideURL = "https://mindustrygame.github.io/wiki/modding/"; /** URL the links to the wiki's modding guide.*/ diff --git a/gradle.properties b/gradle.properties index 6b36115f05..94fcb680b7 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,3 +1,3 @@ org.gradle.daemon=true org.gradle.jvmargs=-Xms256m -Xmx1024m -archash=d2bb4a004b8653a8d878abda0b1e1c62b2df2aab +archash=685a3d94c8dce72292765fcb492d8e9a7f1fac2a