From 071c567df6de65311fbbb5e6cf2860b535fe44be Mon Sep 17 00:00:00 2001 From: Joseph Garcia Date: Tue, 22 Dec 2020 08:35:05 -0600 Subject: [PATCH] gradle changes to build dependencies for production --- META-INF/MANIFEST.MF | 3 +++ build.gradle | 21 +++++++++++-------- gradle/wrapper/gradle-wrapper.properties | 5 +++-- .../com/josyf/macrobuttons/ConfigFile.java | 7 +++++-- .../com/josyf/macrobuttons/MacroButtons.java | 4 ++++ .../com/josyf/macrobuttons/gui/ButtonGUI.java | 2 +- src/main/resources/fabric.mod.json | 2 +- 7 files changed, 29 insertions(+), 15 deletions(-) create mode 100644 META-INF/MANIFEST.MF diff --git a/META-INF/MANIFEST.MF b/META-INF/MANIFEST.MF new file mode 100644 index 0000000..da97939 --- /dev/null +++ b/META-INF/MANIFEST.MF @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +Main-Class: com.josyf.macrobuttons.MacroButtons + diff --git a/build.gradle b/build.gradle index 89a1383..6c01b52 100644 --- a/build.gradle +++ b/build.gradle @@ -15,6 +15,7 @@ repositories { name = "CottonMC" url = "https://server.bbkr.space/artifactory/libs-release" } + jcenter() } dependencies { @@ -28,16 +29,22 @@ dependencies { // Serialization compile group: 'com.alibaba', name: 'fastjson', version: '1.2.56' - compile group: 'com.googlecode.json-simple', name: 'json-simple', version: '1.1' + compile 'com.googlecode.json-simple:json-simple:1.1.1' + implementation 'com.cedarsoftware:json-io:4.10.1' + compile group: 'com.googlecode.json-simple', name: 'json-simple', version: '1.1.1' + + // includes + include 'com.alibaba:fastjson:1.2.56' + include 'com.googlecode.json-simple:json-simple:1.1.1' + include 'com.cedarsoftware:json-io:4.10.1' + // PSA: Some older mods, compiled on Loom 0.2.1, might have outdated Maven POMs. // You may need to force-disable transitiveness on them. - dependencies { - modImplementation "io.github.cottonmc:LibGui:3.2.2+1.16.3" - } + modImplementation "io.github.cottonmc:LibGui:3.2.2+1.16.3" } processResources { @@ -81,9 +88,5 @@ publishing { } } - // select the repositories you want to publish to - repositories { - // uncomment to publish to the local maven - // mavenLocal() - } + } diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 12d38de..15d48d8 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,6 @@ +#Sun Dec 20 14:49:23 CST 2020 +distributionUrl=https\://services.gradle.org/distributions/gradle-6.6.1-all.zip distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.6.1-bin.zip -zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists +zipStoreBase=GRADLE_USER_HOME diff --git a/src/main/java/com/josyf/macrobuttons/ConfigFile.java b/src/main/java/com/josyf/macrobuttons/ConfigFile.java index 00fa512..a605f03 100644 --- a/src/main/java/com/josyf/macrobuttons/ConfigFile.java +++ b/src/main/java/com/josyf/macrobuttons/ConfigFile.java @@ -4,17 +4,18 @@ import com.alibaba.fastjson.JSON; import com.cedarsoftware.util.io.JsonWriter; import org.json.simple.JSONArray; import org.json.simple.JSONObject; -import org.json.simple.parser.JSONParser; import org.json.simple.parser.ParseException; +import org.json.simple.parser.*; import java.io.*; import java.util.ArrayList; public class ConfigFile { - static JSONParser parser = new JSONParser(); + private static final JSONParser parser = new JSONParser(); private static FileWriter fileWriter; + // Read commands.json, convert it to an array, and append A JSON OBJECT public static void appendToFile(JSONObject jsonObject) { try { @@ -82,4 +83,6 @@ public class ConfigFile { } + + } diff --git a/src/main/java/com/josyf/macrobuttons/MacroButtons.java b/src/main/java/com/josyf/macrobuttons/MacroButtons.java index 12e9b6e..e3a796c 100644 --- a/src/main/java/com/josyf/macrobuttons/MacroButtons.java +++ b/src/main/java/com/josyf/macrobuttons/MacroButtons.java @@ -20,6 +20,10 @@ public class MacroButtons implements ModInitializer { public static final String MOD_ID = "mgbuttons"; private static ArrayList masterCommList; + public static void main(String[] args) { + + } + @Override public void onInitialize() { assignGuiToKey(); diff --git a/src/main/java/com/josyf/macrobuttons/gui/ButtonGUI.java b/src/main/java/com/josyf/macrobuttons/gui/ButtonGUI.java index 368c150..46d97a7 100644 --- a/src/main/java/com/josyf/macrobuttons/gui/ButtonGUI.java +++ b/src/main/java/com/josyf/macrobuttons/gui/ButtonGUI.java @@ -71,7 +71,7 @@ public class ButtonGUI extends LightweightGuiDescription { newJsonObject.put("name", name.getText()); newJsonObject.put("command", command.getText()); - // append the buttons to masterList for future loading +// // append the buttons to masterList for future loading ConfigFile.addObjectToCommList(newJsonObject); ConfigFile.appendToFile(newJsonObject); diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json index 1aa6fb9..fa67594 100644 --- a/src/main/resources/fabric.mod.json +++ b/src/main/resources/fabric.mod.json @@ -1,6 +1,6 @@ { "schemaVersion": 1, - "id": "mgbuttons", + "id": "macro-gui-buttons", "version": "${version}", "name": "Macro GUI Buttons",