gradle: Refactor and update to gradle 6
This commit is contained in:
@@ -27,12 +27,6 @@ import org.apache.tools.ant.filters.ReplaceTokens
|
||||
import java.util.Date
|
||||
import java.text.SimpleDateFormat
|
||||
|
||||
buildscript {
|
||||
dependencies {
|
||||
classpath(gradleApi())
|
||||
}
|
||||
}
|
||||
|
||||
plugins {
|
||||
id(Plugins.shadow.first) version Plugins.shadow.second
|
||||
java
|
||||
@@ -119,8 +113,10 @@ tasks {
|
||||
}
|
||||
|
||||
processResources {
|
||||
finalizedBy("filterResources")
|
||||
}
|
||||
|
||||
|
||||
register<Copy>("filterResources") {
|
||||
val tokens = mapOf(
|
||||
"project.version" to ProjectVersions.rlVersion,
|
||||
"rs.version" to ProjectVersions.rsversion.toString(),
|
||||
@@ -133,13 +129,14 @@ tasks {
|
||||
|
||||
from("src/main/resources") {
|
||||
include("open.osrs.properties")
|
||||
|
||||
filter<ReplaceTokens>("tokens" to tokens)
|
||||
}
|
||||
into("${buildDir}/resources/main")
|
||||
|
||||
filter(ReplaceTokens::class, "tokens" to tokens)
|
||||
filteringCharset = "UTF-8"
|
||||
}
|
||||
|
||||
jar {
|
||||
|
||||
manifest {
|
||||
attributes(mutableMapOf("Main-Class" to "net.runelite.client.RuneLite"))
|
||||
}
|
||||
@@ -148,4 +145,8 @@ tasks {
|
||||
shadowJar {
|
||||
archiveClassifier.set("shaded")
|
||||
}
|
||||
|
||||
withType<BootstrapTask> {
|
||||
group = "openosrs"
|
||||
}
|
||||
}
|
||||
@@ -216,7 +216,8 @@ public class GauntletPlugin extends Plugin
|
||||
if (client.getGameState() != GameState.STARTING && client.getGameState() != GameState.UNKNOWN)
|
||||
{
|
||||
completeStartup = false;
|
||||
clientThread.invoke(() -> {
|
||||
clientThread.invoke(() ->
|
||||
{
|
||||
timer.initStates();
|
||||
completeStartup = true;
|
||||
});
|
||||
|
||||
@@ -1194,7 +1194,9 @@ public class GpuPlugin extends Plugin implements DrawCallbacks
|
||||
glDrawable.swapBuffers();
|
||||
}
|
||||
catch (GLException ignored)
|
||||
{ }
|
||||
{
|
||||
// Ignore
|
||||
}
|
||||
|
||||
drawManager.processDrawComplete(this::screenshot);
|
||||
}
|
||||
|
||||
@@ -99,7 +99,8 @@ class NotesPanel extends PluginPanel
|
||||
private void buildAddTab()
|
||||
{
|
||||
addTab = new MaterialTab(addIcon, tabGroup, new JPanel());
|
||||
addTab.setOnSelectEvent(() -> {
|
||||
addTab.setOnSelectEvent(() ->
|
||||
{
|
||||
notesManager.addPage();
|
||||
return false;
|
||||
});
|
||||
@@ -178,7 +179,8 @@ class NotesPanel extends PluginPanel
|
||||
final JMenuItem deleteMenuItem = new JMenuItem();
|
||||
deleteMenuItem.setText(String.format("Delete note %s", name));
|
||||
|
||||
deleteMenuItem.addActionListener(e -> {
|
||||
deleteMenuItem.addActionListener(e ->
|
||||
{
|
||||
if (JOptionPane.showConfirmDialog(getRootFrame(), String.format("Delete note page %s?", name), "Notes", YES_NO_OPTION) != YES_OPTION)
|
||||
{
|
||||
return;
|
||||
|
||||
@@ -331,7 +331,8 @@ public class SwingUtil
|
||||
button.setOpaque(true);
|
||||
|
||||
// Selecting the button option requires us to determine which parent element is the JOptionPane
|
||||
button.addActionListener(e -> {
|
||||
button.addActionListener(e ->
|
||||
{
|
||||
JComponent component = (JComponent) e.getSource();
|
||||
while (component != null)
|
||||
{
|
||||
@@ -401,7 +402,8 @@ public class SwingUtil
|
||||
dialog.setIconImage(ImageUtil.getResourceStreamFromClass(SwingUtil.class, "/openosrs.png"));
|
||||
|
||||
// Listen for value changes and close dialog when necessary
|
||||
pane.addPropertyChangeListener(e -> {
|
||||
pane.addPropertyChangeListener(e ->
|
||||
{
|
||||
String prop = e.getPropertyName();
|
||||
|
||||
if (dialog.isVisible()
|
||||
|
||||
@@ -35,7 +35,6 @@ import net.runelite.api.MessageNode;
|
||||
import net.runelite.api.events.ChatMessage;
|
||||
import net.runelite.client.config.ChatColorConfig;
|
||||
import net.runelite.client.config.OpenOSRSConfig;
|
||||
import net.runelite.client.eventbus.EventBus;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
@@ -33,7 +33,6 @@ import net.runelite.api.ChatMessageType;
|
||||
import net.runelite.api.Client;
|
||||
import net.runelite.api.ItemID;
|
||||
import net.runelite.api.MenuOpcode;
|
||||
import net.runelite.api.MenuEntry;
|
||||
import net.runelite.api.events.ChatMessage;
|
||||
import net.runelite.api.events.MenuOptionClicked;
|
||||
import net.runelite.api.widgets.Widget;
|
||||
|
||||
Reference in New Issue
Block a user