From 8e548b389660b6ee4f1ed362f14485182b5c7775 Mon Sep 17 00:00:00 2001 From: xjboss Date: Sat, 22 Jul 2017 19:54:55 +0800 Subject: [PATCH 1/8] Change KBootstrap to KBootstrapX --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 2e83be5..c8965aa 100644 --- a/build.gradle +++ b/build.gradle @@ -114,7 +114,7 @@ configurations { } dependencies { - bootstrap 'pw.prok:KBootstrap:0.2.+' + bootstrap 'pw.prok:KBootstrapX:0.2.+' libraries 'net.minecraft:launchwrapper:1.12@jar' libraries 'org.ow2.asm:asm-all:5.0.3' From 96fc873f32dac6441c5e2f0c2baf26fb00a3c040 Mon Sep 17 00:00:00 2001 From: xjboss Date: Sat, 22 Jul 2017 19:55:46 +0800 Subject: [PATCH 2/8] Temporary remove KCauldron auto update --- src/main/java/kcauldron/KCauldronCommand.java | 8 ++++++-- .../java/kcauldron/updater/DefaultUpdateCallback.java | 2 ++ src/main/java/kcauldron/updater/KVersionRetriever.java | 3 +-- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/main/java/kcauldron/KCauldronCommand.java b/src/main/java/kcauldron/KCauldronCommand.java index 72d292a..534431e 100644 --- a/src/main/java/kcauldron/KCauldronCommand.java +++ b/src/main/java/kcauldron/KCauldronCommand.java @@ -38,8 +38,8 @@ public class KCauldronCommand extends Command { super(NAME); StringBuilder builder = new StringBuilder(); - builder.append(String.format("/%s check - Check to update\n", NAME)); - builder.append(String.format("/%s update [version] - Update to specified or latest version\n", NAME)); + //builder.append(String.format("/%s check - Check to update\n", NAME)); + //builder.append(String.format("/%s update [version] - Update to specified or latest version\n", NAME)); builder.append(String.format("/%s tps - Show tps statistics\n", NAME)); builder.append(String.format("/%s restart - Restart server\n", NAME)); builder.append(String.format("/%s dump - Dump statistics into kcauldron.dump file\n", NAME)); @@ -80,10 +80,14 @@ public class KCauldronCommand extends Command { if ("check".equals(action)) { if (!testPermission(sender, CHECK)) return true; + /* sender.sendMessage(ChatColor.GREEN + "Initiated version check..."); KVersionRetriever.startServer(new CommandSenderUpdateCallback(sender), false); + */ } else if ("update".equals(action)) { + /* KCauldronUpdater.initUpdate(sender, args.length > 1 ? args[1] : null); + */ } else if ("tps".equals(action)) { if (!testPermission(sender, TPS)) return true; diff --git a/src/main/java/kcauldron/updater/DefaultUpdateCallback.java b/src/main/java/kcauldron/updater/DefaultUpdateCallback.java index 2980c31..ad00986 100644 --- a/src/main/java/kcauldron/updater/DefaultUpdateCallback.java +++ b/src/main/java/kcauldron/updater/DefaultUpdateCallback.java @@ -21,6 +21,7 @@ public class DefaultUpdateCallback implements IVersionCheckCallback { public void onPlayerJoin(PlayerJoinEvent event) { Player player = event.getPlayer(); if (hasPermission(player)) { + /* if (KCauldron.isLegacy()) { player.sendMessage(ChatColor.YELLOW + "We're running on legacy version on KCauldron, please update your version"); } @@ -30,6 +31,7 @@ public class DefaultUpdateCallback implements IVersionCheckCallback { if (mHasUpdate) { sendUpdate(player); } + */ } } diff --git a/src/main/java/kcauldron/updater/KVersionRetriever.java b/src/main/java/kcauldron/updater/KVersionRetriever.java index a351958..92ba75b 100644 --- a/src/main/java/kcauldron/updater/KVersionRetriever.java +++ b/src/main/java/kcauldron/updater/KVersionRetriever.java @@ -14,7 +14,6 @@ import org.apache.http.impl.client.HttpClientBuilder; import org.apache.http.impl.client.LaxRedirectStrategy; import org.json.simple.JSONObject; import org.json.simple.parser.JSONParser; - public class KVersionRetriever implements Runnable, UncaughtExceptionHandler { private static final boolean DEBUG; private static final KLog sLogger; @@ -76,7 +75,7 @@ public class KVersionRetriever implements Runnable, UncaughtExceptionHandler { } } } - + @Deprecated private void check() { try { HttpUriRequest request = RequestBuilder From 80dff50b15bf713a73906c1a9a7bf41059aeaaf5 Mon Sep 17 00:00:00 2001 From: xjboss Date: Sat, 22 Jul 2017 22:09:51 +0800 Subject: [PATCH 3/8] . --- build.gradle | 3 +++ 1 file changed, 3 insertions(+) diff --git a/build.gradle b/build.gradle index c8965aa..c5b3243 100644 --- a/build.gradle +++ b/build.gradle @@ -334,3 +334,6 @@ task resolveAllDependencies { configurations.each { it.resolve() } } } +tasks.withType(JavaCompile) { + options.encoding = "UTF-8" +} \ No newline at end of file From 72408957a9e2351063db0f0d4622cf8e50c8cc36 Mon Sep 17 00:00:00 2001 From: xjboss Date: Sat, 22 Jul 2017 22:37:33 +0800 Subject: [PATCH 4/8] Update snakeyaml version to 1.15 --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index c5b3243..a937355 100644 --- a/build.gradle +++ b/build.gradle @@ -131,7 +131,7 @@ dependencies { libraries 'org.scala-lang:scala-xml_2.11:1.0.2' libraries 'net.sf.jopt-simple:jopt-simple:4.7' libraries 'lzma:lzma:0.0.1' - libraries 'org.yaml:snakeyaml:1.9' + libraries 'org.yaml:snakeyaml:1.15' libraries 'commons-lang:commons-lang:2.6' libraries 'org.avaje:ebean:2.7.3' libraries 'jline:jline:2.6' From f15e1456f3acdd5efae6901805a262323f096e9a Mon Sep 17 00:00:00 2001 From: xjboss Date: Sat, 22 Jul 2017 22:52:11 +0800 Subject: [PATCH 5/8] change build.gradle --- build.gradle | 1 - 1 file changed, 1 deletion(-) diff --git a/build.gradle b/build.gradle index a937355..c069b7d 100644 --- a/build.gradle +++ b/build.gradle @@ -115,7 +115,6 @@ configurations { dependencies { bootstrap 'pw.prok:KBootstrapX:0.2.+' - libraries 'net.minecraft:launchwrapper:1.12@jar' libraries 'org.ow2.asm:asm-all:5.0.3' libraries 'com.typesafe.akka:akka-actor_2.11:2.3.3' From 1a8c4700aa9c6e88b5b2357b4c8ff0cfe65e9cc6 Mon Sep 17 00:00:00 2001 From: xjboss Date: Sat, 22 Jul 2017 23:49:54 +0800 Subject: [PATCH 6/8] Change version start at 1 and change mainfast KCauldron to KCauldronX and using the jenkins's build ID --- build.gradle | 29 ++++++++++++++------------ src/main/java/kcauldron/KCauldron.java | 12 +++++------ 2 files changed, 22 insertions(+), 19 deletions(-) diff --git a/build.gradle b/build.gradle index c069b7d..1dc548b 100644 --- a/build.gradle +++ b/build.gradle @@ -57,7 +57,7 @@ minecraft { srgExtra "PK: org/bukkit/craftbukkit org/bukkit/craftbukkit/v1_7_R4" } -group = 'pw.prok' +group = 'pw.yumc' ext.buildInfoCached = null; def buildInfo(String key) { @@ -96,11 +96,12 @@ def gitInfo(String key) { } return key ? gitInfoCached[key] : gitInfoCached; } - +ext.sys= System.properties ext.mcVersion = "1.7.10" ext.forgeVersion = VersionParser.parseForgeRevision(file('src/main/resources/fmlversion.properties')) -ext.revision = project.hasProperty('revision') ? project.getProperty('revision') : buildInfo('nextBuildNumber') -version = "${mcVersion}-${forgeVersion}.${revision}" +ext.build = sys.hasProperty('BUILD_NUMBER') ? sys.getProperty('BUILD_NUMBER') : "Unkonwn" +ext.kcx_version = 1 +version = "${mcVersion}-${forgeVersion}-${kcx_version}.${build}" if (project.hasProperty('officialBuild')) println "Updated KCauldron version: ${version}" launch4j { @@ -169,13 +170,13 @@ def generateClasspath(boolean legacy = false) { def generateManifest(boolean legacy = false) { [ - 'KCauldron-Git-Branch' : gitInfo('branch'), - 'KCauldron-Git-Hash' : gitInfo('fullHash'), - 'KCauldron-Group' : project.group, - 'KCauldron-Channel' : project.name, - 'KCauldron-Version' : project.version, - 'KCauldron-Legacy' : legacy, - 'KCauldron-Official' : project.hasProperty('officialBuild'), + 'KCauldronX-Git-Branch' : gitInfo('branch'), + 'KCauldronX-Git-Hash' : gitInfo('fullHash'), + 'KCauldronX-Group' : project.group, + 'KCauldronX-Channel' : project.name, + 'KCauldronX-Version' : project.version, + 'KCauldronX-Legacy' : legacy, + 'KCauldronX-Official' : sys.hasProperty('officialBuild'), 'Implementation-Vendor' : 'Prototik', 'Implementation-Title' : project.name, 'Implementation-Version': '1.7.10-R0.1-SNAPSHOT', @@ -206,12 +207,14 @@ tasks.packageInstaller.onlyIf { false } task packageChangelog(type: CreateChangelog) { onlyIf { project.hasProperty('officialBuild') } + /* classifier = 'changelog' extension = 'txt' oldChangelogUrl = "https://repo.prok.pw/${project.group.replace('.', '/')}/${project.name}/${buildInfo('version')}/${project.name}-${buildInfo('version')}-changelog.txt" hash = gitInfo('hash') message = gitInfo('message') version = project.version + */ } task bundleStub(type: Jar) { @@ -263,7 +266,7 @@ def getSignatureFiles = { [archive: signedJar, classifier: null, extension: 'jar.asc'] ] } - +/* publishing { repositories { maven { @@ -294,7 +297,7 @@ publishing { } } } - +*/ tasks.generateProjectCauldron { doLast { def file = new File('eclipse/cauldron/build.gradle') diff --git a/src/main/java/kcauldron/KCauldron.java b/src/main/java/kcauldron/KCauldron.java index 9430ead..6561386 100644 --- a/src/main/java/kcauldron/KCauldron.java +++ b/src/main/java/kcauldron/KCauldron.java @@ -29,7 +29,7 @@ public class KCauldron { while (resources.hasMoreElements()) { URL url = resources.nextElement(); manifest.load(url.openStream()); - String version = manifest.getProperty("KCauldron-Version"); + String version = manifest.getProperty("KCauldronX-Version"); if (version != null) { String path = url.getPath(); String jarFilePath = path.substring(path.indexOf(":") + 1, @@ -38,11 +38,11 @@ public class KCauldron { sServerLocation = new File(jarFilePath); sCurrentVersion = version; - sGroup = manifest.getProperty("KCauldron-Group"); - sBranch = manifest.getProperty("KCauldron-Branch"); - sChannel = manifest.getProperty("KCauldron-Channel"); - sLegacy = Boolean.parseBoolean(manifest.getProperty("KCauldron-Legacy")); - sOfficial = Boolean.parseBoolean(manifest.getProperty("KCauldron-Official")); + sGroup = manifest.getProperty("KCauldronX-Group"); + sBranch = manifest.getProperty("KCauldronX-Branch"); + sChannel = manifest.getProperty("KCauldronX-Channel"); + sLegacy = Boolean.parseBoolean(manifest.getProperty("KCauldronX-Legacy")); + sOfficial = Boolean.parseBoolean(manifest.getProperty("KCauldronX-Official")); break; } manifest.clear(); From a53bb6dce72eed93ecb45c2a5312324bc7f43170 Mon Sep 17 00:00:00 2001 From: xjboss Date: Sat, 22 Jul 2017 23:59:46 +0800 Subject: [PATCH 7/8] update build.gradle --- build.gradle | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/build.gradle b/build.gradle index 1dc548b..9b8a62f 100644 --- a/build.gradle +++ b/build.gradle @@ -54,8 +54,10 @@ minecraft { mainClass = 'cpw.mods.fml.relauncher.ServerLaunchWrapper' tweakClass = 'cpw.mods.fml.common.launcher.FMLTweaker' installerVersion = "1.4" - srgExtra "PK: org/bukkit/craftbukkit org/bukkit/craftbukkit/v1_7_R4" + tasks.withType(JavaCompile) { + options.encoding = "UTF-8" + } } group = 'pw.yumc' ext.buildInfoCached = null; @@ -96,13 +98,12 @@ def gitInfo(String key) { } return key ? gitInfoCached[key] : gitInfoCached; } -ext.sys= System.properties ext.mcVersion = "1.7.10" ext.forgeVersion = VersionParser.parseForgeRevision(file('src/main/resources/fmlversion.properties')) -ext.build = sys.hasProperty('BUILD_NUMBER') ? sys.getProperty('BUILD_NUMBER') : "Unkonwn" +ext.build = System.getenv('BUILD_NUMBER') ? System.getenv('BUILD_NUMBER') : "Unkonwn" ext.kcx_version = 1 version = "${mcVersion}-${forgeVersion}-${kcx_version}.${build}" -if (project.hasProperty('officialBuild')) println "Updated KCauldron version: ${version}" +if (System.getenv('officialBuild')!=null) println "Updated KCauldron version: ${version}" launch4j { jreMinVersion = '1.7.0' @@ -176,7 +177,7 @@ def generateManifest(boolean legacy = false) { 'KCauldronX-Channel' : project.name, 'KCauldronX-Version' : project.version, 'KCauldronX-Legacy' : legacy, - 'KCauldronX-Official' : sys.hasProperty('officialBuild'), + 'KCauldronX-Official' : System.getenv('officialBuild')!=null, 'Implementation-Vendor' : 'Prototik', 'Implementation-Title' : project.name, 'Implementation-Version': '1.7.10-R0.1-SNAPSHOT', @@ -336,6 +337,3 @@ task resolveAllDependencies { configurations.each { it.resolve() } } } -tasks.withType(JavaCompile) { - options.encoding = "UTF-8" -} \ No newline at end of file From 291a3a762b26aa1ae5ad320a7d539970d7712aa7 Mon Sep 17 00:00:00 2001 From: xjboss Date: Sun, 23 Jul 2017 00:21:03 +0800 Subject: [PATCH 8/8] fix offical build --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 9b8a62f..980a483 100644 --- a/build.gradle +++ b/build.gradle @@ -177,7 +177,7 @@ def generateManifest(boolean legacy = false) { 'KCauldronX-Channel' : project.name, 'KCauldronX-Version' : project.version, 'KCauldronX-Legacy' : legacy, - 'KCauldronX-Official' : System.getenv('officialBuild')!=null, + 'KCauldronX-Official' : System.getProperty('officialBuild')!=null, 'Implementation-Vendor' : 'Prototik', 'Implementation-Title' : project.name, 'Implementation-Version': '1.7.10-R0.1-SNAPSHOT',