Merge pull request #1101 from runelite-extended/gradle

Migrate to Gradle
This commit is contained in:
Tyler Bochard
2019-07-24 01:16:52 -04:00
committed by GitHub
78 changed files with 4061 additions and 2784 deletions

View File

@@ -0,0 +1,49 @@
description = 'RuneLite Client'
dependencies {
compile group: 'org.slf4j', name: 'slf4j-api', version:'1.7.25'
compile group: 'ch.qos.logback', name: 'logback-classic', version:'1.2.3'
compile group: 'net.sf.jopt-simple', name: 'jopt-simple', version:'5.0.1'
compile group: 'com.google.guava', name: 'guava', version:'28.0-jre'
compile group: 'com.google.inject', name: 'guice', version:'4.1.0', classifier:'no_aop'
compile group: 'com.google.code.gson', name: 'gson', version:'2.8.5'
compile group: 'net.runelite.pushingpixels', name: 'substance', version:'8.0.02'
compile group: 'org.apache.commons', name: 'commons-text', version:'1.2'
compile group: 'org.jogamp.jogl', name: 'jogl-all', version:'2.3.2'
compile group: 'org.jogamp.gluegen', name: 'gluegen-rt', version:'2.3.2'
compile(group: 'io.sigpipe', name: 'jbsdiff', version:'1.0') {
exclude(module: 'xz')
}
compile group: 'net.java.dev.jna', name: 'jna', version:'4.5.1'
compile group: 'net.java.dev.jna', name: 'jna-platform', version:'4.5.1'
compile project(':runelite-api')
compile project(':http-api')
compile group: 'net.runelite', name: 'discord', version:'1.1'
compile group: 'org.javassist', name: 'javassist', version:'3.25.0-GA'
compile group: 'org.xeustechnologies', name: 'jcl-core', version:'2.8'
compile group: 'org.jetbrains', name: 'annotations', version:'17.0.0'
compile group: 'com.github.joonasvali.naturalmouse', name: 'naturalmouse', version:'[1.0.0,)'
compile group: 'org.ow2.asm', name: 'asm-all', version:'6.0_BETA'
compile group: 'org.codehaus.plexus', name: 'plexus-utils', version:'3.2.0'
compile group: 'org.apache.httpcomponents', name: 'httpcore', version:'4.4.11'
compile group: 'org.apache.httpcomponents', name: 'httpmime', version:'4.5.9'
compile group: 'io.reactivex.rxjava2', name: 'rxjava', version:'2.2.10'
compile group: 'com.jakewharton.rxrelay2', name: 'rxrelay', version:'2.1.0'
runtime group: 'net.runelite.pushingpixels', name: 'trident', version:'1.5.00'
runtime group: 'org.jogamp.jogl', name: 'jogl-all', version:'2.3.2', classifier:'natives-windows-amd64'
runtime group: 'org.jogamp.jogl', name: 'jogl-all', version:'2.3.2', classifier:'natives-windows-i586'
runtime group: 'org.jogamp.jogl', name: 'jogl-all', version:'2.3.2', classifier:'natives-linux-amd64'
runtime group: 'org.jogamp.jogl', name: 'jogl-all', version:'2.3.2', classifier:'natives-linux-i586'
runtime group: 'org.jogamp.gluegen', name: 'gluegen-rt', version:'2.3.2', classifier:'natives-windows-amd64'
runtime group: 'org.jogamp.gluegen', name: 'gluegen-rt', version:'2.3.2', classifier:'natives-windows-i586'
runtime group: 'org.jogamp.gluegen', name: 'gluegen-rt', version:'2.3.2', classifier:'natives-linux-amd64'
runtime group: 'org.jogamp.gluegen', name: 'gluegen-rt', version:'2.3.2', classifier:'natives-linux-i586'
runtime project(':runescape-api')
testCompile group: 'junit', name: 'junit', version:'4.12'
testCompile group: 'org.hamcrest', name: 'hamcrest-library', version:'1.3'
testCompile group: 'org.mockito', name: 'mockito-all', version:'1.10.19'
testCompile group: 'com.google.inject.extensions', name: 'guice-testlib', version:'4.1.0'
testCompile group: 'com.google.inject.extensions', name: 'guice-grapher', version:'4.1.0'
compileOnly group: 'org.projectlombok', name: 'lombok', version:'1.18.8'
compileOnly group: 'net.runelite', name: 'orange-extensions', version:'1.0'
}

View File

@@ -1,457 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (c) 2016-2017, Adam <Adam@sigterm.info>
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>net.runelite</groupId>
<artifactId>runelite-parent</artifactId>
<version>1.5.30-SNAPSHOT</version>
</parent>
<artifactId>client</artifactId>
<name>RuneLite Client</name>
<properties>
<guice.version>4.1.0</guice.version>
<jogl.version>2.3.2</jogl.version>
<jarsigner.skip>true</jarsigner.skip>
</properties>
<repositories>
<repository>
<id>RuneLit</id>
<name>RuneLit</name>
<url>https://raw.githubusercontent.com/runelite-extended/maven-repo/master</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
</dependency>
<dependency>
<groupId>net.sf.jopt-simple</groupId>
<artifactId>jopt-simple</artifactId>
<version>5.0.1</version>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
</dependency>
<dependency>
<groupId>com.google.inject</groupId>
<artifactId>guice</artifactId>
<version>${guice.version}</version>
<classifier>no_aop</classifier>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
</dependency>
<dependency>
<groupId>net.runelite.pushingpixels</groupId>
<artifactId>substance</artifactId>
<version>8.0.02</version>
</dependency>
<dependency>
<groupId>net.runelite.pushingpixels</groupId>
<artifactId>trident</artifactId>
<version>1.5.00</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-text</artifactId>
<version>1.2</version>
</dependency>
<dependency>
<groupId>org.jogamp.jogl</groupId>
<artifactId>jogl-all</artifactId>
<version>${jogl.version}</version>
</dependency>
<dependency>
<groupId>org.jogamp.jogl</groupId>
<artifactId>jogl-all</artifactId>
<version>${jogl.version}</version>
<classifier>natives-windows-amd64</classifier>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.jogamp.jogl</groupId>
<artifactId>jogl-all</artifactId>
<version>${jogl.version}</version>
<classifier>natives-windows-i586</classifier>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.jogamp.jogl</groupId>
<artifactId>jogl-all</artifactId>
<version>${jogl.version}</version>
<classifier>natives-linux-amd64</classifier>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.jogamp.jogl</groupId>
<artifactId>jogl-all</artifactId>
<version>${jogl.version}</version>
<classifier>natives-linux-i586</classifier>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.jogamp.gluegen</groupId>
<artifactId>gluegen-rt</artifactId>
<version>${jogl.version}</version>
</dependency>
<dependency>
<groupId>org.jogamp.gluegen</groupId>
<artifactId>gluegen-rt</artifactId>
<version>${jogl.version}</version>
<classifier>natives-windows-amd64</classifier>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.jogamp.gluegen</groupId>
<artifactId>gluegen-rt</artifactId>
<version>${jogl.version}</version>
<classifier>natives-windows-i586</classifier>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.jogamp.gluegen</groupId>
<artifactId>gluegen-rt</artifactId>
<version>${jogl.version}</version>
<classifier>natives-linux-amd64</classifier>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.jogamp.gluegen</groupId>
<artifactId>gluegen-rt</artifactId>
<version>${jogl.version}</version>
<classifier>natives-linux-i586</classifier>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>io.sigpipe</groupId>
<artifactId>jbsdiff</artifactId>
<version>1.0</version>
<exclusions>
<exclusion>
<groupId>org.tukaani</groupId>
<artifactId>xz</artifactId>
</exclusion>
</exclusions>
</dependency>
<!-- net.runelite:discord also has this -->
<dependency>
<groupId>net.java.dev.jna</groupId>
<artifactId>jna</artifactId>
<version>4.5.1</version>
</dependency>
<dependency>
<groupId>net.java.dev.jna</groupId>
<artifactId>jna-platform</artifactId>
<version>4.5.1</version>
</dependency>
<dependency>
<groupId>net.runelite</groupId>
<artifactId>runelite-api</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>net.runelite.rs</groupId>
<artifactId>runescape-api</artifactId>
<version>${project.version}</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>net.runelite</groupId>
<artifactId>http-api</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>net.runelite</groupId>
<artifactId>discord</artifactId>
<version>1.1</version>
</dependency>
<dependency>
<groupId>net.runelite</groupId>
<artifactId>orange-extensions</artifactId>
<version>1.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-library</artifactId>
<version>1.3</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-all</artifactId>
<version>1.10.19</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.google.inject.extensions</groupId>
<artifactId>guice-testlib</artifactId>
<version>${guice.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.google.inject.extensions</groupId>
<artifactId>guice-grapher</artifactId>
<version>${guice.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.javassist</groupId>
<artifactId>javassist</artifactId>
<version>3.25.0-GA</version>
</dependency>
<dependency>
<groupId>org.xeustechnologies</groupId>
<artifactId>jcl-core</artifactId>
<version>2.8</version>
</dependency>
<dependency>
<groupId>org.jetbrains</groupId>
<artifactId>annotations</artifactId>
<version>17.0.0</version>
</dependency>
<dependency>
<groupId>com.github.joonasvali.naturalmouse</groupId>
<artifactId>naturalmouse</artifactId>
<version>[1.0.0,)</version>
</dependency>
<dependency>
<groupId>org.ow2.asm</groupId>
<artifactId>asm-all</artifactId>
<version>6.0_BETA</version>
</dependency>
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-utils</artifactId>
<version>3.2.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpcore</artifactId>
<version>4.4.11</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpmime</artifactId>
<version>4.5.9</version>
</dependency>
<dependency>
<groupId>io.reactivex.rxjava2</groupId>
<artifactId>rxjava</artifactId>
<version>2.2.10</version>
</dependency>
<dependency>
<groupId>com.jakewharton.rxrelay2</groupId>
<artifactId>rxrelay</artifactId>
<version>2.1.0</version>
</dependency>
</dependencies>
<build>
<resources>
<resource>
<directory>src/main/resources</directory>
<excludes>
<exclude>logback.xml</exclude>
</excludes>
<filtering>true</filtering>
</resource>
<resource>
<directory>src/main/resources</directory>
<includes>
<include>logback.xml</include>
</includes>
<filtering>false</filtering>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>3.0.2</version>
<configuration>
<nonFilteredFileExtensions>
<nonFilteredFileExtension>ttf</nonFilteredFileExtension>
<nonFilteredFileExtension>png</nonFilteredFileExtension>
<nonFilteredFileExtension>gif</nonFilteredFileExtension>
<nonFilteredFileExtension>wav</nonFilteredFileExtension>
</nonFilteredFileExtensions>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.0.0</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<shadedArtifactAttached>true</shadedArtifactAttached>
<shadedClassifierName>shaded</shadedClassifierName>
<filters>
<!-- include runtime apis -->
<filter>
<!-- net.runelite:injected-client and net.runelite:api -->
<artifact>net.runelite:*</artifact>
<includes>
<include>**</include>
</includes>
</filter>
<filter>
<artifact>net.runelite.rs:runescape-api</artifact>
<includes>
<include>**</include>
</includes>
</filter>
<filter>
<artifact>net.runelite.pushingpixels:*</artifact>
<includes>
<include>**</include>
</includes>
</filter>
<filter>
<artifact>com.google.guava:*</artifact>
<includes>
<include>**</include>
</includes>
</filter>
<filter>
<artifact>ch.qos.logback:*</artifact>
<includes>
<include>**</include>
</includes>
</filter>
<filter>
<artifact>org.jogamp.jogl:*</artifact>
<includes>
<include>**</include>
</includes>
</filter>
<filter>
<artifact>org.jogamp.gluegen:*</artifact>
<includes>
<include>**</include>
</includes>
</filter>
</filters>
<transformers>
<transformer
implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<mainClass>net.runelite.client.RuneLite</mainClass>
</transformer>
</transformers>
</configuration>
</execution>
</executions>
</plugin>
<!-- Strip jar before signing -->
<plugin>
<groupId>io.github.zlika</groupId>
<artifactId>reproducible-build-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jarsigner-plugin</artifactId>
<version>1.4</version>
<executions>
<execution>
<id>sign</id>
<goals>
<goal>sign</goal>
</goals>
</execution>
</executions>
<configuration>
<skip>${jarsigner.skip}</skip>
<keystore>${jarsigner.keystore}</keystore>
<alias>${jarsigner.alias}</alias>
<storepass>${jarsigner.storepass}</storepass>
<keypass>${jarsigner.keypass}</keypass>
</configuration>
</plugin>
<plugin>
<groupId>net.runelite</groupId>
<artifactId>script-assembler-plugin</artifactId>
<version>${project.version}</version>
<executions>
<execution>
<id>assemble</id>
<goals>
<goal>assemble</goal>
</goals>
<configuration>
<scriptDirectory>src/main/scripts</scriptDirectory>
<outputDirectory>${project.build.outputDirectory}/runelite</outputDirectory>
</configuration>
</execution>
<execution>
<id>build-index</id>
<goals>
<goal>build-index</goal>
</goals>
<configuration>
<archiveOverlayDirectory>${project.build.outputDirectory}/runelite</archiveOverlayDirectory>
<indexFile>${project.build.outputDirectory}/runelite/index</indexFile>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

View File

@@ -24,7 +24,6 @@
*/
package net.runelite.client;
import com.google.common.base.Strings;
import com.google.common.escape.Escaper;
import com.google.common.escape.Escapers;
import com.google.inject.Inject;
@@ -102,9 +101,7 @@ public class Notifier
this.notifyIconPath = RuneLite.RUNELITE_DIR.toPath().resolve("icon.png");
// First check if we are running in launcher
this.terminalNotifierAvailable =
!Strings.isNullOrEmpty(RuneLiteProperties.getLauncherVersion())
&& isTerminalNotifierAvailable();
this.terminalNotifierAvailable = true;
storeIcon();
}

View File

@@ -80,7 +80,7 @@ import org.slf4j.LoggerFactory;
@Slf4j
public class RuneLite
{
public static final String RUNELIT_VERSION = "2.0.5-2";
public static final String PLUS_VERSION = "2.1.0.0";
public static final File RUNELITE_DIR = new File(System.getProperty("user.home"), ".runelite");
public static final File PROFILES_DIR = new File(RUNELITE_DIR, "profiles");
public static final File PLUGIN_DIR = new File(RUNELITE_DIR, "plugins");

View File

@@ -24,31 +24,17 @@
*/
package net.runelite.client;
import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;
import javax.annotation.Nullable;
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 RUNELITE_TITLE = "runelite.title";
private static final String RUNELITE_VERSION = "runelite.version";
private static final String RUNELIT_VERSION = "runelit.version";
private static final String RUNESCAPE_VERSION = "runescape.version";
private static final String DISCORD_APP_ID = "runelite.discord.appid";
private static final String DISCORD_APP_ID_PLUS = "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();
private final RuneLitePlusConfig runeLitePlusConfig;
@@ -57,33 +43,16 @@ public class RuneLiteProperties
public RuneLiteProperties(final RuneLitePlusConfig runeLiteConfig)
{
this.runeLitePlusConfig = runeLiteConfig;
try (InputStream in = getClass().getResourceAsStream("runelite.properties"))
{
properties.load(in);
}
catch (IOException ex)
{
log.warn("unable to load propertries", ex);
}
}
public RuneLiteProperties()
{
runeLitePlusConfig = null;
try (InputStream in = getClass().getResourceAsStream("runelite.properties"))
{
properties.load(in);
}
catch (IOException ex)
{
log.warn("unable to load propertries", ex);
}
}
public String getTitle()
{
final StringBuilder sb = new StringBuilder(properties.getProperty(RUNELITE_TITLE));
final StringBuilder sb = new StringBuilder("RuneLitePlus");
String proxy;
if ((proxy = System.getProperty("socksProxyHost")) != null)
{
@@ -94,59 +63,41 @@ public class RuneLiteProperties
public String getVersion()
{
return properties.getProperty(RUNELITE_VERSION);
return RuneLiteAPI.getVersion();
}
public String getRunelitVersion()
public String getPlusVersion()
{
return properties.getProperty(RUNELIT_VERSION);
return RuneLite.PLUS_VERSION;
}
public String getRunescapeVersion()
{
return properties.getProperty(RUNESCAPE_VERSION);
return "" + RuneLiteAPI.getRsVersion();
}
public String getDiscordAppId()
{
if (this.runeLitePlusConfig == null)
{
return properties.getProperty(DISCORD_APP_ID);
}
if (this.runeLitePlusConfig.customPresence())
{
return properties.getProperty(DISCORD_APP_ID_PLUS);
}
else
{
return properties.getProperty(DISCORD_APP_ID);
}
return "560644885250572289";
}
public String getDiscordInvite()
{
return properties.getProperty(DISCORD_INVITE);
return "https://discord.gg/HN5gf3m";
}
public String getGithubLink()
{
return properties.getProperty(GITHUB_LINK);
return "https://github.com/runelite-extended/runelite";
}
public String getWikiLink()
{
return properties.getProperty(WIKI_LINK);
return "https://github.com/runelite-extended/runelite/wiki";
}
public String getPatreonLink()
{
return properties.getProperty(PATREON_LINK);
}
@Nullable
public static String getLauncherVersion()
{
return System.getProperty(LAUNCHER_VERSION_PROPERTY);
return "https://www.patreon.com/RuneLitePlus";
}
}

View File

@@ -24,14 +24,10 @@
*/
package net.runelite.client.game;
import net.runelite.api.SpriteID;
public interface SpriteOverride
{
/**
* An ID for a sprite. Negative numbers are used by RuneLite specific sprites
*
* @see SpriteID
*/
int getSpriteId();

View File

@@ -25,7 +25,6 @@
*/
package net.runelite.client.plugins.info;
import com.google.common.base.MoreObjects;
import com.google.inject.Inject;
import java.awt.BorderLayout;
import java.awt.Color;
@@ -123,6 +122,9 @@ public class InfoPanel extends PluginPanel
JLabel version = new JLabel(htmlLabel("RuneLite version: ", runeLiteProperties.getVersion()));
version.setFont(smallFont);
JLabel plusVersion = new JLabel(htmlLabel("RuneLitePlus version: ", runeLiteProperties.getPlusVersion()));
version.setFont(smallFont);
JLabel revision = new JLabel();
revision.setFont(smallFont);
@@ -134,10 +136,6 @@ public class InfoPanel extends PluginPanel
revision.setText(htmlLabel("Oldschool revision: ", engineVer));
JLabel launcher = new JLabel(htmlLabel("Launcher version: ", MoreObjects
.firstNonNull(RuneLiteProperties.getLauncherVersion(), "Unknown")));
launcher.setFont(smallFont);
loggedLabel.setForeground(ColorScheme.LIGHT_GRAY_COLOR);
loggedLabel.setFont(smallFont);
@@ -153,8 +151,8 @@ public class InfoPanel extends PluginPanel
});
versionPanel.add(version);
versionPanel.add(plusVersion);
versionPanel.add(revision);
versionPanel.add(launcher);
versionPanel.add(Box.createGlue());
versionPanel.add(loggedLabel);
versionPanel.add(emailLabel);

View File

@@ -25,13 +25,9 @@
package net.runelite.client.plugins.itemstats.stats;
import net.runelite.api.Client;
import net.runelite.api.Skill;
/**
* Abstract stat of a player.
* This includes {@link Skill}s and other player variables, such as <code>RUN_ENERGY</code>.
*
* @see Stats
*/
public abstract class Stat
{

View File

@@ -9,7 +9,6 @@
package net.runelite.client.plugins.pvptools;
import com.google.common.base.MoreObjects;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Font;
@@ -21,7 +20,6 @@ import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import lombok.extern.slf4j.Slf4j;
import net.runelite.client.RuneLiteProperties;
import net.runelite.client.plugins.info.JRichTextPane;
import net.runelite.client.ui.ColorScheme;
import net.runelite.client.ui.FontManager;
@@ -94,10 +92,6 @@ class PvpToolsPanel extends PluginPanel
revision.setText("Oldschool revision: ");
JLabel launcher = new JLabel(htmlLabel("Launcher version: ", MoreObjects
.firstNonNull(RuneLiteProperties.getLauncherVersion(), "Unknown")));
launcher.setFont(smallFont);
loggedLabel.setForeground(ColorScheme.LIGHT_GRAY_COLOR);
loggedLabel.setFont(smallFont);

View File

@@ -34,7 +34,6 @@ import java.io.Reader;
import java.util.Arrays;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import net.runelite.api.Client;
class Skybox
{
@@ -43,8 +42,6 @@ class Skybox
{
/**
* Gets the instance template chunk data for the specified point
*
* @see Client#getInstanceTemplateChunks
*/
int getTemplateChunk(int cx, int cy, int plane);
}

View File

@@ -57,11 +57,11 @@ import net.runelite.client.eventbus.EventBus;
import net.runelite.client.input.MouseManager;
import net.runelite.client.menus.MenuManager;
import net.runelite.client.menus.WidgetMenuOption;
import static net.runelite.client.util.MiscUtils.clamp;
import net.runelite.client.plugins.Plugin;
import net.runelite.client.plugins.PluginDescriptor;
import net.runelite.client.plugins.PluginType;
import net.runelite.client.ui.overlay.OverlayManager;
import static net.runelite.client.util.MiscUtils.clamp;
import net.runelite.client.util.Text;
@PluginDescriptor(
@@ -87,15 +87,7 @@ public class SpellbookPlugin extends Plugin
private static final WidgetMenuOption RESIZABLE_MAGIC_TAB_UNLOCK = new WidgetMenuOption(UNLOCK, MENU_TARGET, WidgetInfo.RESIZABLE_VIEWPORT_MAGIC_TAB);
private static final WidgetMenuOption RESIZABLE_BOTTOM_LINE_MAGIC_TAB_LOCK = new WidgetMenuOption(LOCK, MENU_TARGET, WidgetInfo.RESIZABLE_VIEWPORT_BOTTOM_LINE_MAGIC_TAB);
private static final WidgetMenuOption RESIZABLE_BOTTOM_LINE_MAGIC_TAB_UNLOCK = new WidgetMenuOption(UNLOCK, MENU_TARGET, WidgetInfo.RESIZABLE_VIEWPORT_BOTTOM_LINE_MAGIC_TAB);
private enum WordFilterMode
{
CONTAINS,
EQUALS,
STARTSWITH,
ENDSWITH
}
private final Map<Integer, Spell> spells = new HashMap<>();
@Inject
private Client client;
@@ -131,19 +123,79 @@ public class SpellbookPlugin extends Plugin
@Getter
private Point draggingLocation;
private final Map<Integer, Spell> spells = new HashMap<>();
private Map<Integer, Spell> tmp = null;
private ImmutableSet<String> notFilteredSpells;
private Spellbook spellbook;
private SpellbookMouseListener mouseListener;
private boolean enableMobile;
private boolean dragSpells;
private boolean scroll;
private int size;
private String filter;
private static boolean isUnfiltered(String spell, Set<String> unfiltereds)
{
for (String str : unfiltereds)
{
WordFilterMode mode = getFilterMode(str);
str = removeFlyingComma(str).toLowerCase();
spell = spell.toLowerCase();
switch (mode)
{
case CONTAINS:
if (spell.contains(str))
{
return true;
}
break;
case STARTSWITH:
if (spell.startsWith(str))
{
return true;
}
break;
case ENDSWITH:
if (spell.endsWith(str))
{
return true;
}
break;
case EQUALS:
if (spell.equals(str))
{
return true;
}
break;
}
}
return false;
}
private static WordFilterMode getFilterMode(String s)
{
if (!s.contains("\""))
{
return WordFilterMode.CONTAINS;
}
if (s.startsWith("\""))
{
return s.endsWith("\"") ? WordFilterMode.EQUALS : WordFilterMode.STARTSWITH;
}
else if (s.endsWith("\""))
{
return WordFilterMode.ENDSWITH;
}
return WordFilterMode.CONTAINS; // but probably null soz
}
private static String removeFlyingComma(String s)
{
return s.replaceAll("\"", "");
}
@Provides
SpellbookConfig getConfig(ConfigManager configManager)
{
@@ -223,46 +275,6 @@ public class SpellbookPlugin extends Plugin
}
}
private static boolean isUnfiltered(String spell, Set<String> unfiltereds)
{
for (String str : unfiltereds)
{
WordFilterMode mode = getFilterMode(str);
str = removeFlyingComma(str).toLowerCase();
spell = spell.toLowerCase();
switch (mode)
{
case CONTAINS:
if (spell.contains(str))
{
return true;
}
break;
case STARTSWITH:
if (spell.startsWith(str))
{
return true;
}
break;
case ENDSWITH:
if (spell.endsWith(str))
{
return true;
}
break;
case EQUALS:
if (spell.equals(str))
{
return true;
}
break;
}
}
return false;
}
private void onWidgetMenuOptionClicked(WidgetMenuOptionClicked event)
{
if (event.getWidget() != WidgetInfo.FIXED_VIEWPORT_MAGIC_TAB
@@ -466,7 +478,9 @@ public class SpellbookPlugin extends Plugin
}
// CHECKSTYLE:OFF
Collection<Spell> gson = GSON.fromJson(cfg, new TypeToken<List<Spell>>() {}.getType());
Collection<Spell> gson = GSON.fromJson(cfg, new TypeToken<List<Spell>>()
{
}.getType());
// CHECKSTYLE:ON
gson.stream().filter(Objects::nonNull).forEach(s -> spells.put(s.getWidget(), s));
@@ -509,24 +523,6 @@ public class SpellbookPlugin extends Plugin
);
}
private static WordFilterMode getFilterMode(String s)
{
if (!s.contains("\""))
{
return WordFilterMode.CONTAINS;
}
if (s.startsWith("\""))
{
return s.endsWith("\"") ? WordFilterMode.EQUALS : WordFilterMode.STARTSWITH;
}
else if (s.endsWith("\""))
{
return WordFilterMode.ENDSWITH;
}
return WordFilterMode.CONTAINS; // but probably null soz
}
boolean isNotOnSpellWidget(java.awt.Point point)
{
Widget boundsWidget = client.getWidget(WidgetInfo.SPELLBOOK_FILTERED_BOUNDS);
@@ -712,11 +708,6 @@ public class SpellbookPlugin extends Plugin
runRebuild();
}
private static String removeFlyingComma(String s)
{
return s.replaceAll("\"", "");
}
private int trueSize(Spell s)
{
return s.getSize() * 2 + this.size;
@@ -730,4 +721,12 @@ public class SpellbookPlugin extends Plugin
this.size = config.size();
this.filter = config.filter();
}
private enum WordFilterMode
{
CONTAINS,
EQUALS,
STARTSWITH,
ENDSWITH
}
}

View File

@@ -128,7 +128,7 @@ public class RuneLiteSplashScreen
panel.add(version, versionConstraints);
// version
final JLabel litVersion = new JLabel("Plus Version : " + RuneLite.RUNELIT_VERSION);
final JLabel litVersion = new JLabel("Plus Version : " + RuneLite.PLUS_VERSION);
litVersion.setForeground(Color.GREEN);
litVersion.setFont(FontManager.getRunescapeSmallFont());
litVersion.setForeground(litVersion.getForeground().darker());

View File

@@ -318,29 +318,29 @@ public class Bootstrap
//Dynamic artifacts
artifacts[3] = new Artifact();
artifacts[3].name = "client-" + RuneLiteAPI.getVersion() + ".jar";
artifacts[3].hash = getChecksumFile("./runelite-client/target/" + artifacts[3].name);
artifacts[3].path = "https://raw.githubusercontent.com/runelite-extended/maven-repo/master/live/" + artifacts[3].name;
artifacts[3].hash = getChecksumFile("./runelite-client/build/libs/" + artifacts[3].name);
artifacts[3].path = "https://raw.githubusercontent.com/runelite-extended/maven-repo/master" + Bootstrapper.remoteLocation + artifacts[3].name;
artifacts[3].size = Long.toString(getFileSize("./runelite-client/target/" + artifacts[3].name));
copyTodir("./runelite-client/target/" + artifacts[3].name, "./live/");
copyTodir("./runelite-client/build/libs/" + artifacts[3].name, Bootstrapper.localLocation);
artifacts[35] = new Artifact();
artifacts[35].name = "runelite-api-" + RuneLiteAPI.getVersion() + ".jar";
artifacts[35].hash = getChecksumFile("./runelite-api/target/" + artifacts[35].name);
artifacts[35].path = "https://raw.githubusercontent.com/runelite-extended/maven-repo/master/live/" + artifacts[35].name;
artifacts[35].hash = getChecksumFile("./runelite-api/build/libs/" + artifacts[35].name);
artifacts[35].path = "https://raw.githubusercontent.com/runelite-extended/maven-repo/master/" + Bootstrapper.remoteLocation + artifacts[35].name;
artifacts[35].size = Long.toString(getFileSize("./runelite-api/target/" + artifacts[35].name));
copyTodir("./runelite-api/target/" + artifacts[35].name, "./live/");
copyTodir("./runelite-api/build/libs/" + artifacts[35].name, Bootstrapper.localLocation);
artifacts[36] = new Artifact();
artifacts[36].name = "runescape-api-" + RuneLiteAPI.getVersion() + ".jar";
artifacts[36].hash = getChecksumFile("./runescape-api/target/" + artifacts[36].name);
artifacts[36].path = "https://raw.githubusercontent.com/runelite-extended/maven-repo/master/live/" + artifacts[36].name;
artifacts[36].hash = getChecksumFile("./runescape-api/build/libs/" + artifacts[36].name);
artifacts[36].path = "https://raw.githubusercontent.com/runelite-extended/maven-repo/master/" + Bootstrapper.remoteLocation + artifacts[36].name;
artifacts[36].size = Long.toString(getFileSize("./runescape-api/target/" + artifacts[36].name));
copyTodir("./runescape-api/target/" + artifacts[36].name, "./live/");
copyTodir("./runescape-api/build/libs/" + artifacts[36].name, Bootstrapper.localLocation);
artifacts[37] = new Artifact();
artifacts[37].name = "http-api-" + RuneLiteAPI.getVersion() + ".jar";
artifacts[37].hash = getChecksumFile("./http-api/target/" + artifacts[37].name);
artifacts[37].path = "https://raw.githubusercontent.com/runelite-extended/maven-repo/master/live/" + artifacts[37].name;
artifacts[37].hash = getChecksumFile("./http-api/build/libs/" + artifacts[37].name);
artifacts[37].path = "https://raw.githubusercontent.com/runelite-extended/maven-repo/master/" + Bootstrapper.remoteLocation + artifacts[37].name;
artifacts[37].size = Long.toString(getFileSize("./http-api/target/" + artifacts[37].name));
copyTodir("./http-api/target/" + artifacts[37].name, "./live/");
copyTodir("./injected-client/target/injected-client-" + RuneLiteAPI.getVersion() + ".jar", "./live/");
copyTodir("./http-api/build/libs/" + artifacts[37].name, Bootstrapper.localLocation);
copyTodir("./injected-client/build/libs/injected-client-" + RuneLiteAPI.getVersion() + ".jar", Bootstrapper.localLocation);
}
catch (IOException | NoSuchAlgorithmException e)
{

View File

@@ -2,26 +2,49 @@ package net.runelite.client.util.bootstrap;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import java.io.File;
import java.io.FileWriter;
public class Bootstrapper
{
public static String remoteLocation;
public static String localLocation;
public static void main(String[] args)
{
Gson gson = new GsonBuilder().disableHtmlEscaping().setPrettyPrinting().create();
File dir = new File("./live/");
dir.mkdir();
try (FileWriter fw = new FileWriter("./live/bootstrap.json"))
{
gson.toJson(new Bootstrap(), fw);
}
catch (Exception e)
{
e.printStackTrace();
}
if (args.length > 0)
{
remoteLocation = "/staging/";
localLocation = "./staging/";
Gson gson = new GsonBuilder().disableHtmlEscaping().setPrettyPrinting().create();
File dir = new File("./staging/");
dir.mkdir();
try (FileWriter fw = new FileWriter("./staging/bootstrap-staging.json"))
{
gson.toJson(new Bootstrap(), fw);
}
catch (Exception e)
{
e.printStackTrace();
}
}
else
{
remoteLocation = "/live/";
localLocation = "./live/";
Gson gson = new GsonBuilder().disableHtmlEscaping().setPrettyPrinting().create();
File dir = new File("./live/");
dir.mkdir();
try (FileWriter fw = new FileWriter("./live/bootstrap.json"))
{
gson.toJson(new Bootstrap(), fw);
}
catch (Exception e)
{
e.printStackTrace();
}
}
}
}