gradle: Refactor and update to gradle 6

This commit is contained in:
Owain van Brakel
2019-11-10 01:42:11 +01:00
parent 7085ad14f3
commit 18021f6bed
22 changed files with 172 additions and 121 deletions

View File

@@ -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"
}
}

View File

@@ -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;
});

View File

@@ -1194,7 +1194,9 @@ public class GpuPlugin extends Plugin implements DrawCallbacks
glDrawable.swapBuffers();
}
catch (GLException ignored)
{ }
{
// Ignore
}
drawManager.processDrawComplete(this::screenshot);
}

View File

@@ -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;

View File

@@ -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()

View File

@@ -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;

View File

@@ -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;