Move version numbers, urls and certificate hash to build.gradle
This commit is contained in:
25
build.gradle
25
build.gradle
@@ -10,9 +10,15 @@ buildscript {
|
|||||||
apply plugin: 'net.minecraftforge.gradle.forge'
|
apply plugin: 'net.minecraftforge.gradle.forge'
|
||||||
//Only edit below this line, the above code adds and enables the necessary things for Forge to be setup.
|
//Only edit below this line, the above code adds and enables the necessary things for Forge to be setup.
|
||||||
|
|
||||||
|
def mcversion = "1.12.2"
|
||||||
|
def modversion = "2.1.2"
|
||||||
|
def mccompatible = "1.12"
|
||||||
|
def url = "https://minecraft.curseforge.com/projects/world-handler-command-gui"
|
||||||
|
def update_url = "https://raw.githubusercontent.com/Exopandora/worldhandler/master/version.json"
|
||||||
|
def certificate = "d6261bb645f41db84c74f98e512c2bb43f188af2"
|
||||||
|
|
||||||
version = "1.12.2-2.1.1"
|
version = mcversion + "-" + modversion
|
||||||
group = "src.worldhandler.main.WorldHandler" // http://maven.apache.org/guides/mini/guide-naming-conventions.html
|
group = "exopandora.worldhandler.WorldHandler" // http://maven.apache.org/guides/mini/guide-naming-conventions.html
|
||||||
archivesBaseName = "WorldHandler"
|
archivesBaseName = "WorldHandler"
|
||||||
|
|
||||||
sourceCompatibility = targetCompatibility = '1.8' // Need this here so eclipse task generates correctly.
|
sourceCompatibility = targetCompatibility = '1.8' // Need this here so eclipse task generates correctly.
|
||||||
@@ -22,7 +28,7 @@ compileJava {
|
|||||||
|
|
||||||
jar {
|
jar {
|
||||||
manifest {
|
manifest {
|
||||||
attributes 'Main-Class': 'exopandora.worldhandler.main.Main'
|
attributes 'Main-Class': 'exopandora.worldhandler.Main'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -39,7 +45,14 @@ build.dependsOn signJar
|
|||||||
minecraft {
|
minecraft {
|
||||||
version = "1.12.2-14.23.2.2611"
|
version = "1.12.2-14.23.2.2611"
|
||||||
runDir = "run"
|
runDir = "run"
|
||||||
|
|
||||||
|
replace '$version', modversion
|
||||||
|
replace '$mcversion', mcversion
|
||||||
|
replace '$compatible', mccompatible
|
||||||
|
replace '$url', url
|
||||||
|
replace '$update_url', update_url
|
||||||
|
replace '$certificate', certificate
|
||||||
|
|
||||||
// the mappings can be changed at any time, and must be in the following format.
|
// the mappings can be changed at any time, and must be in the following format.
|
||||||
// snapshot_YYYYMMDD snapshot are built nightly.
|
// snapshot_YYYYMMDD snapshot are built nightly.
|
||||||
// stable_# stables are built at the discretion of the MCP team.
|
// stable_# stables are built at the discretion of the MCP team.
|
||||||
@@ -81,11 +94,11 @@ processResources {
|
|||||||
// replace stuff in mcmod.info, nothing else
|
// replace stuff in mcmod.info, nothing else
|
||||||
from(sourceSets.main.resources.srcDirs) {
|
from(sourceSets.main.resources.srcDirs) {
|
||||||
include 'mcmod.info'
|
include 'mcmod.info'
|
||||||
|
|
||||||
// replace version and mcversion
|
// replace version and mcversion
|
||||||
expand 'version':project.version, 'mcversion':project.minecraft.version
|
expand 'version':project.version, 'mcversion':project.minecraft.version
|
||||||
}
|
}
|
||||||
|
|
||||||
// copy everything else except the mcmod.info
|
// copy everything else except the mcmod.info
|
||||||
from(sourceSets.main.resources.srcDirs) {
|
from(sourceSets.main.resources.srcDirs) {
|
||||||
exclude 'mcmod.info'
|
exclude 'mcmod.info'
|
||||||
|
|||||||
@@ -15,14 +15,6 @@ public class Main
|
|||||||
{
|
{
|
||||||
public static final String NAME = "World Handler";
|
public static final String NAME = "World Handler";
|
||||||
public static final String MODID = "worldhandler";
|
public static final String MODID = "worldhandler";
|
||||||
public static final String MC_VERSION = "1.12.2";
|
|
||||||
public static final String MC_COMPATIBLE = "1.12";
|
|
||||||
public static final String VERSION = "2.1.1";
|
|
||||||
public static final String FULL_VERSION = MC_VERSION + "-" + VERSION;
|
|
||||||
public static final String NAME_AND_VERSION = NAME + " " + FULL_VERSION;
|
|
||||||
public static final String URL = "https://minecraft.curseforge.com/projects/world-handler-command-gui";
|
|
||||||
public static final String UPDATE_URL = "https://raw.githubusercontent.com/Exopandora/worldhandler/master/version.json";
|
|
||||||
public static final String CERTIFICATE = "d6261bb645f41db84c74f98e512c2bb43f188af2";
|
|
||||||
|
|
||||||
public static void main(String[] args)
|
public static void main(String[] args)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ import net.minecraftforge.fml.relauncher.Side;
|
|||||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||||
|
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
@Mod(modid = Main.MODID, name = Main.NAME, acceptedMinecraftVersions = "[" + Main.MC_COMPATIBLE + ",)", version = Main.VERSION, canBeDeactivated = false, guiFactory = "exopandora.worldhandler.gui.config.GuiFactoryWorldHandler", updateJSON = Main.UPDATE_URL, clientSideOnly = true, certificateFingerprint = Main.CERTIFICATE)
|
@Mod(modid = Main.MODID, name = Main.NAME, acceptedMinecraftVersions = "[$compatible,)", version = "$version", canBeDeactivated = false, guiFactory = "exopandora.worldhandler.gui.config.GuiFactoryWorldHandler", updateJSON = "$update_url", clientSideOnly = true, certificateFingerprint = "$certificate")
|
||||||
public class WorldHandler
|
public class WorldHandler
|
||||||
{
|
{
|
||||||
@Instance(Main.MODID)
|
@Instance(Main.MODID)
|
||||||
@@ -65,7 +65,7 @@ public class WorldHandler
|
|||||||
LOGGER = event.getModLog();
|
LOGGER = event.getModLog();
|
||||||
LOGGER.info("Pre-Initialisation");
|
LOGGER.info("Pre-Initialisation");
|
||||||
LOGGER.info("First Release on March 28 2013 - 02:29 PM CET by Exopandora");
|
LOGGER.info("First Release on March 28 2013 - 02:29 PM CET by Exopandora");
|
||||||
LOGGER.info("Latest Version: " + Main.URL);
|
LOGGER.info("Latest Version: $url");
|
||||||
CONFIG = new Configuration(event.getSuggestedConfigurationFile());
|
CONFIG = new Configuration(event.getSuggestedConfigurationFile());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -53,9 +53,9 @@ public class CommandWorldHandler extends CommandBase
|
|||||||
}
|
}
|
||||||
else if(args[0].equalsIgnoreCase("version"))
|
else if(args[0].equalsIgnoreCase("version"))
|
||||||
{
|
{
|
||||||
sender.sendMessage(new TextComponentString("Installed: " + Main.MC_VERSION + "-" + Main.VERSION));
|
sender.sendMessage(new TextComponentString("Installed: $mcversion-$version"));
|
||||||
ComparableVersion target = ForgeVersion.getResult(Loader.instance().getIndexedModList().get(Main.MODID)).target;
|
ComparableVersion target = ForgeVersion.getResult(Loader.instance().getIndexedModList().get(Main.MODID)).target;
|
||||||
sender.sendMessage(new TextComponentString("Latest: " + Main.MC_VERSION + "-" + (target != null ? target : Main.VERSION)));
|
sender.sendMessage(new TextComponentString("Latest: $mcversion-" + (target != null ? target : "$version")));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -541,7 +541,7 @@ public class GuiWorldHandlerContainer extends Container
|
|||||||
final int hexAlpha = (int) (0xFF * 0.2) << 24;
|
final int hexAlpha = (int) (0xFF * 0.2) << 24;
|
||||||
final int color = ConfigSkin.getLabelColor() + hexAlpha;
|
final int color = ConfigSkin.getLabelColor() + hexAlpha;
|
||||||
|
|
||||||
this.fontRenderer.drawString(Main.MC_VERSION + "-" + Main.VERSION, this.width - this.fontRenderer.getStringWidth(Main.MC_VERSION + "-" + Main.VERSION) - 2, this.height - 10, color);
|
this.fontRenderer.drawString("$mcversion-$version", this.width - this.fontRenderer.getStringWidth("$mcversion-$version") - 2, this.height - 10, color);
|
||||||
|
|
||||||
//TITLE
|
//TITLE
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ import java.awt.event.ActionEvent;
|
|||||||
import java.awt.event.ActionListener;
|
import java.awt.event.ActionListener;
|
||||||
import java.net.URI;
|
import java.net.URI;
|
||||||
|
|
||||||
import exopandora.worldhandler.Main;
|
|
||||||
import net.minecraftforge.fml.relauncher.Side;
|
import net.minecraftforge.fml.relauncher.Side;
|
||||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||||
|
|
||||||
@@ -19,7 +18,7 @@ public class ForumListener implements ActionListener
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
Desktop.getDesktop().browse(new URI(Main.URL));
|
Desktop.getDesktop().browse(new URI("$url"));
|
||||||
}
|
}
|
||||||
catch(Exception e)
|
catch(Exception e)
|
||||||
{
|
{
|
||||||
@@ -27,5 +26,4 @@ public class ForumListener implements ActionListener
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -37,7 +37,7 @@ public class InstallListener implements ActionListener
|
|||||||
File mods = new File(directory, "mods");
|
File mods = new File(directory, "mods");
|
||||||
File versions = new File(directory, "versions");
|
File versions = new File(directory, "versions");
|
||||||
|
|
||||||
if(!this.isPartialFileNameInFolder(versions, Main.MC_VERSION, "Forge"))
|
if(!this.isPartialFileNameInFolder(versions, "$mcversion", "Forge"))
|
||||||
{
|
{
|
||||||
JOptionPane.showMessageDialog(null, "Please install Mineceaft Forge", null, JOptionPane.ERROR_MESSAGE);
|
JOptionPane.showMessageDialog(null, "Please install Mineceaft Forge", null, JOptionPane.ERROR_MESSAGE);
|
||||||
}
|
}
|
||||||
@@ -54,8 +54,8 @@ public class InstallListener implements ActionListener
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
Path path = new File(InstallListener.class.getProtectionDomain().getCodeSource().getLocation().toURI().getPath()).toPath();
|
Path path = new File(InstallListener.class.getProtectionDomain().getCodeSource().getLocation().toURI().getPath()).toPath();
|
||||||
Files.copy(path, new File(mods, "WorldHandler-" + Main.FULL_VERSION + "-Universal.jar").toPath(), StandardCopyOption.REPLACE_EXISTING);
|
Files.copy(path, new File(mods, "WorldHandler-$mcversion-$version-Universal.jar").toPath(), StandardCopyOption.REPLACE_EXISTING);
|
||||||
JOptionPane.showMessageDialog(null, Main.NAME_AND_VERSION + " has been successfully installed", null, JOptionPane.INFORMATION_MESSAGE);
|
JOptionPane.showMessageDialog(null, Main.NAME + " $mcversion-$version has been successfully installed", null, JOptionPane.INFORMATION_MESSAGE);
|
||||||
}
|
}
|
||||||
catch(Exception e)
|
catch(Exception e)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ import net.minecraftforge.fml.relauncher.SideOnly;
|
|||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public class Window implements Runnable
|
public class Window implements Runnable
|
||||||
{
|
{
|
||||||
private final String title = Main.NAME_AND_VERSION + " Installer";
|
private final String title = Main.NAME + " $mcversion-$version Installer";
|
||||||
private final JFrame frame = new JFrame();
|
private final JFrame frame = new JFrame();
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
Reference in New Issue
Block a user