diff --git a/build.gradle b/build.gradle index d26e3b315f..f34bc39cab 100644 --- a/build.gradle +++ b/build.gradle @@ -28,11 +28,12 @@ allprojects { apply plugin: 'checkstyle' group = 'net.runelite' - version = '1.5.30-SNAPSHOT' + version = '1.5.31-SNAPSHOT' ext { rsversion = 181 cacheversion = 165 + plusVersion = '2.1.2.0' gitCommit = localGitCommit gitCommitShort = localGitCommitShort diff --git a/runelite-client/build.gradle b/runelite-client/build.gradle index 9d2d067d91..cbb3710f75 100644 --- a/runelite-client/build.gradle +++ b/runelite-client/build.gradle @@ -1,3 +1,6 @@ +import org.apache.tools.ant.filters.ReplaceTokens +import java.text.SimpleDateFormat + plugins { id 'com.github.johnrengelman.shadow' version '5.1.0' id 'java' @@ -60,6 +63,23 @@ dependencies { compileOnly group: 'net.runelite', name: 'orange-extensions', version: '1.0' } +static def getDate() { + return new SimpleDateFormat("MM-dd-yyyy", Locale.forLanguageTag("en-US")).format(new Date()) +} + +def buildDate = getDate() + +processResources { + from file("src/main/resources/runelite.plus.properties"), { + filter(ReplaceTokens, tokens: [ + "project.version": project.version, + "rs.version": rsversion.toString(), + "runelite.plus.version": plusVersion.toString(), + "runelite.plus.builddate": buildDate.toString() + ]) + } +} + tasks.withType(AbstractArchiveTask) { preserveFileTimestamps = false reproducibleFileOrder = true diff --git a/runelite-client/src/main/java/net/runelite/client/RuneLiteProperties.java b/runelite-client/src/main/java/net/runelite/client/RuneLiteProperties.java index 8a1f4d1839..99e3bd50d5 100644 --- a/runelite-client/src/main/java/net/runelite/client/RuneLiteProperties.java +++ b/runelite-client/src/main/java/net/runelite/client/RuneLiteProperties.java @@ -24,18 +24,29 @@ */ package net.runelite.client; +import java.io.IOException; +import java.io.InputStream; import java.util.Properties; import javax.inject.Inject; import javax.inject.Singleton; import lombok.extern.slf4j.Slf4j; import net.runelite.client.config.RuneLitePlusConfig; -import net.runelite.http.api.RuneLiteAPI; @Singleton @Slf4j public class RuneLiteProperties { - private static final String DISCORD_APP_ID_PLUS = "560644885250572289"; + private static final String RUNELITE_TITLE = "runelite.plus.title"; + private static final String RUNELITE_VERSION = "runelite.version"; + private static final String RUNELITE_PLUS_VERSION = "runelite.plus.version"; + private static final String RUNELITE_PLUS_DATE = "runelite.plus.builddate"; + private static final String RUNESCAPE_VERSION = "runescape.version"; + private static final String DISCORD_APP_ID = "runelite.plus.discord.appid"; + private static final String DISCORD_INVITE = "runelite.discord.invite"; + private static final String GITHUB_LINK = "runelite.github.link"; + private static final String WIKI_LINK = "runelite.wiki.link"; + private static final String PATREON_LINK = "runelite.patreon.link"; + private static final String LAUNCHER_VERSION_PROPERTY = "runelite.launcher.version"; private final Properties properties = new Properties(); @@ -45,6 +56,15 @@ public class RuneLiteProperties public RuneLiteProperties(final RuneLitePlusConfig runeLiteConfig) { this.runeLitePlusConfig = runeLiteConfig; + + try (InputStream in = getClass().getResourceAsStream("/runelite.plus.properties")) + { + properties.load(in); + } + catch (IOException ex) + { + log.warn("unable to load propertries", ex); + } } public RuneLiteProperties() @@ -54,7 +74,7 @@ public class RuneLiteProperties public String getTitle() { - final StringBuilder sb = new StringBuilder("RuneLitePlus"); + final StringBuilder sb = new StringBuilder(properties.getProperty(RUNELITE_TITLE)); String proxy; if ((proxy = System.getProperty("socksProxyHost")) != null) { @@ -65,41 +85,46 @@ public class RuneLiteProperties public String getVersion() { - return RuneLiteAPI.getVersion(); + return properties.getProperty(RUNELITE_VERSION); } public String getPlusVersion() { - return RuneLite.PLUS_VERSION; + return properties.getProperty(RUNELITE_PLUS_VERSION); + } + + public String getPlusDate() + { + return properties.getProperty(RUNELITE_PLUS_DATE); } public String getRunescapeVersion() { - return "" + RuneLiteAPI.getRsVersion(); + return properties.getProperty(RUNESCAPE_VERSION); } public String getDiscordAppId() { - return DISCORD_APP_ID_PLUS; + return properties.getProperty(DISCORD_APP_ID); } public String getDiscordInvite() { - return "https://discord.gg/HN5gf3m"; + return properties.getProperty(DISCORD_INVITE); } public String getGithubLink() { - return "https://github.com/runelite-extended/runelite"; + return properties.getProperty(GITHUB_LINK); } public String getWikiLink() { - return "https://github.com/runelite-extended/runelite/wiki"; + return properties.getProperty(WIKI_LINK); } public String getPatreonLink() { - return "https://www.patreon.com/RuneLitePlus"; + return properties.getProperty(PATREON_LINK); } } diff --git a/runelite-client/src/main/java/net/runelite/client/ui/RuneLiteSplashScreen.java b/runelite-client/src/main/java/net/runelite/client/ui/RuneLiteSplashScreen.java index 66a388e9bf..67f52ded62 100644 --- a/runelite-client/src/main/java/net/runelite/client/ui/RuneLiteSplashScreen.java +++ b/runelite-client/src/main/java/net/runelite/client/ui/RuneLiteSplashScreen.java @@ -30,6 +30,8 @@ import java.awt.GridBagLayout; import java.awt.Image; import java.awt.image.BufferedImage; import java.io.IOException; +import java.io.InputStream; +import java.util.Properties; import javax.imageio.ImageIO; import javax.inject.Singleton; import javax.swing.ImageIcon; @@ -40,8 +42,6 @@ import javax.swing.JProgressBar; import javax.swing.SwingUtilities; import javax.swing.plaf.basic.BasicProgressBarUI; import lombok.extern.slf4j.Slf4j; -import net.runelite.client.RuneLite; -import net.runelite.client.RuneLiteProperties; import net.runelite.client.util.SwingUtil; import org.pushingpixels.substance.internal.SubstanceSynapse; @@ -53,7 +53,9 @@ import org.pushingpixels.substance.internal.SubstanceSynapse; @Singleton public class RuneLiteSplashScreen { - private final RuneLiteProperties runeLiteProperties = new RuneLiteProperties(); + private static final String RUNELITE_VERSION = "runelite.version"; + private static final String RUNELITE_PLUS_VERSION = "runelite.plus.version"; + private static final String RUNELITE_PLUS_DATE = "runelite.plus.builddate"; private JFrame frame; private final JPanel panel = new JPanel(); @@ -61,6 +63,20 @@ public class RuneLiteSplashScreen private JLabel subMessageLabel; private final JProgressBar progressBar = new JProgressBar(); + private final Properties properties = new Properties(); + + public RuneLiteSplashScreen() + { + try (InputStream in = getClass().getResourceAsStream("/runelite.plus.properties")) + { + properties.load(in); + } + catch (IOException ex) + { + log.warn("unable to load propertries", ex); + } + } + /** * This is not done in the constructor in order to avoid processing in case the user chooses to not load * the splash screen. @@ -90,7 +106,7 @@ public class RuneLiteSplashScreen panel.setBackground(ColorScheme.DARKER_GRAY_COLOR); final GridBagLayout layout = new GridBagLayout(); layout.columnWeights = new double[]{1}; - layout.rowWeights = new double[]{1, 0, 0, 1, 0, 1}; + layout.rowWeights = new double[]{1, 0, 0, 1, 0, 0, 1}; panel.setLayout(layout); // logo @@ -119,7 +135,7 @@ public class RuneLiteSplashScreen panel.add(title, titleConstraints); // version - final JLabel version = new JLabel("RuneLite Version : " + runeLiteProperties.getVersion()); + final JLabel version = new JLabel("RuneLite Version : " + properties.getProperty(RUNELITE_VERSION)); version.setForeground(Color.GREEN); version.setFont(FontManager.getRunescapeSmallFont()); version.setForeground(version.getForeground().darker()); @@ -128,34 +144,42 @@ public class RuneLiteSplashScreen panel.add(version, versionConstraints); // version - final JLabel litVersion = new JLabel("Plus Version : " + RuneLite.PLUS_VERSION); + final JLabel litVersion = new JLabel("Plus Version : " + properties.getProperty(RUNELITE_PLUS_VERSION)); litVersion.setForeground(Color.GREEN); litVersion.setFont(FontManager.getRunescapeSmallFont()); litVersion.setForeground(litVersion.getForeground().darker()); final GridBagConstraints litVersionConstraints = new GridBagConstraints(); litVersionConstraints.gridy = 3; - litVersionConstraints.weightx = 4; panel.add(litVersion, litVersionConstraints); + // build date + final JLabel litBuildDate = new JLabel("Build date : " + properties.getProperty(RUNELITE_PLUS_DATE)); + litBuildDate.setForeground(Color.GREEN); + litBuildDate.setFont(FontManager.getRunescapeSmallFont()); + litBuildDate.setForeground(litBuildDate.getForeground().darker()); + final GridBagConstraints litBuildDateConstraints = new GridBagConstraints(); + litBuildDateConstraints.gridy = 4; + panel.add(litBuildDate, litBuildDateConstraints); + // progressbar final GridBagConstraints progressConstraints = new GridBagConstraints(); progressConstraints.fill = GridBagConstraints.HORIZONTAL; progressConstraints.anchor = GridBagConstraints.SOUTH; - progressConstraints.gridy = 4; + progressConstraints.gridy = 5; panel.add(progressBar, progressConstraints); // main message messageLabel.setFont(FontManager.getRunescapeSmallFont()); final GridBagConstraints messageConstraints = new GridBagConstraints(); - messageConstraints.gridy = 5; + messageConstraints.gridy = 6; panel.add(messageLabel, messageConstraints); // alternate message final GridBagConstraints subMessageConstraints = new GridBagConstraints(); subMessageLabel.setForeground(subMessageLabel.getForeground().darker()); subMessageLabel.setFont(FontManager.getRunescapeSmallFont()); - subMessageConstraints.gridy = 6; + subMessageConstraints.gridy = 7; panel.add(subMessageLabel, subMessageConstraints); frame.setContentPane(panel); @@ -235,7 +259,7 @@ public class RuneLiteSplashScreen final GridBagConstraints progressConstraints = new GridBagConstraints(); progressConstraints.fill = GridBagConstraints.HORIZONTAL; progressConstraints.anchor = GridBagConstraints.SOUTH; - progressConstraints.gridy = 4; + progressConstraints.gridy = 5; panel.add(progressBar, progressConstraints); panel.validate(); } diff --git a/runelite-client/src/main/resources/net/runelite/client/runelite.properties b/runelite-client/src/main/resources/runelite.plus.properties similarity index 60% rename from runelite-client/src/main/resources/net/runelite/client/runelite.properties rename to runelite-client/src/main/resources/runelite.plus.properties index 95807daaf6..d9a0701f7e 100644 --- a/runelite-client/src/main/resources/net/runelite/client/runelite.properties +++ b/runelite-client/src/main/resources/runelite.plus.properties @@ -1,10 +1,10 @@ -runelite.title=RuneLite -runelite.version=${project.version} -runescape.version=${rs.version} -runelite.discord.appid=409416265891971072 +runelite.version=@project.version@ +runescape.version=@rs.version@ runelite.plus.discord.appid=560644885250572289 runelite.discord.invite=https://discord.gg/HN5gf3m runelite.github.link=https://github.com/runelite-extended/runelite runelite.wiki.link=https://github.com/runelite-extended/runelite/wiki runelite.patreon.link=https://www.patreon.com/RuneLitePlus -runelit.version =2.0.1-1 \ No newline at end of file +runelite.plus.title=RuneLitePlus +runelite.plus.version=@runelite.plus.version@ +runelite.plus.builddate=@runelite.plus.builddate@ \ No newline at end of file diff --git a/scripts/pom.xml b/scripts/pom.xml deleted file mode 100644 index 7898c2e8fb..0000000000 --- a/scripts/pom.xml +++ /dev/null @@ -1,43 +0,0 @@ - - - - 4.0.0 - - net.runelite - scripts - 1.0.0 - Scripts - - - - - org.apache.maven.wagon - wagon-webdav-jackrabbit - 2.12 - - - -