diff --git a/.travis.yml b/.travis.yml index b723f6b1dd..12d8006390 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,13 +1,17 @@ -install: gradle wrapper --gradle-version 4.2 -language: java sudo: false dist: trusty + +language: java +jdk: oraclejdk8 + +before_cache: + - rm -f $HOME/.gradle/caches/modules-2/modules-2.lock + - rm -fr $HOME/.gradle/caches/*/plugin-resolution/ cache: directories: - $HOME/.m2 -jdk: -- oraclejdk8 -script: ./travis/build.sh -before_install: -- chmod +x ./travis/build.sh + - $HOME/.gradle/caches/ + - $HOME/.gradle/wrapper/ + +script: ./gradlew clean build -x test diff --git a/build.gradle b/build.gradle index 75acf95849..3b00fb21cb 100644 --- a/build.gradle +++ b/build.gradle @@ -1,34 +1,55 @@ -allprojects { - apply plugin: 'maven' - apply plugin: 'checkstyle' +plugins { + id "com.github.ben-manes.versions" version "0.21.0" + id "com.gradle.build-scan" version "2.3" +} - group = 'net.runelite' -version = '1.5.30-SNAPSHOT' +allprojects { + apply plugin: 'maven' + apply plugin: 'checkstyle' + + group = 'net.runelite' + version = '1.5.30-SNAPSHOT' + + gradle.projectsEvaluated { + tasks.withType(JavaCompile) { + options.compilerArgs << "-Xlint:deprecation" + } + } } subprojects { - apply plugin: 'java' - sourceCompatibility = 1.8 - targetCompatibility = 1.8 - tasks.withType(JavaCompile) { - options.encoding = 'UTF-8' - } + apply plugin: 'java' + sourceCompatibility = 1.8 + targetCompatibility = 1.8 + tasks.withType(JavaCompile) { + options.encoding = 'UTF-8' + } - - repositories { - mavenLocal() - - maven { url "http://repo1.maven.org/maven2" } - maven { url "http://repo.runelite.net" } - maven { url "http://repo.maven.apache.org/maven2" } - maven { url "https://raw.githubusercontent.com/runelite-extended/maven-repo/master" } - } - checkstyle { - toolVersion = '6.4.1' - sourceSets = [sourceSets.main] - configFile = rootProject.file("./checkstyle/checkstyle.xml"); - showViolations = true - ignoreFailures = false - } + repositories { + mavenLocal() + + maven { url "http://repo1.maven.org/maven2" } + maven { url "http://repo.runelite.net" } + maven { url "http://repo.maven.apache.org/maven2" } + maven { url "https://raw.githubusercontent.com/runelite-extended/maven-repo/master" } + } + + checkstyle { + toolVersion = '6.4.1' + sourceSets = [sourceSets.main] + configFile = rootProject.file("./checkstyle/checkstyle.xml") + showViolations = true + ignoreFailures = false + } +} + +wrapper { + gradleVersion = '5.5.1' + + doLast { + def optsEnvVar = "DEFAULT_JVM_OPTS" + scriptFile.write scriptFile.text.replace("$optsEnvVar='\"-Xmx64m\" \"-Xms64m\"'", "$optsEnvVar='\"-Xmx4g\" \"-Xms2g\" \"-Dfile.encoding=UTF-8\"'") + batchScript.write batchScript.text.replace("set $optsEnvVar=\"-Xmx64m\" \"-Xms64m\"", "set $optsEnvVar=\"-Xmx4g\" \"-Xms2g\" \"-Dfile.encoding=UTF-8\"") + } } diff --git a/cache-client/build.gradle b/cache-client/build.gradle index a0a33cd5e9..42cd4e4836 100644 --- a/cache-client/build.gradle +++ b/cache-client/build.gradle @@ -1,9 +1,8 @@ - description = 'Cache Client' dependencies { - compile project(':cache') - compile project(':protocol') - testCompile group: 'junit', name: 'junit', version:'4.12' - testCompile group: 'org.slf4j', name: 'slf4j-simple', version:'1.7.26' - testCompile project(':cache') + compile project(':cache') + compile project(':protocol') + testCompile group: 'junit', name: 'junit', version: '4.12' + testCompile group: 'org.slf4j', name: 'slf4j-simple', version: '1.7.26' + testCompile project(':cache') } diff --git a/cache-updater/build.gradle b/cache-updater/build.gradle index c437e8062e..12db934c98 100644 --- a/cache-updater/build.gradle +++ b/cache-updater/build.gradle @@ -1,12 +1,12 @@ - description = 'Cache Updater' dependencies { - compile group: 'org.springframework.boot', name: 'spring-boot-starter', version:'1.5.6.RELEASE' - compile group: 'org.springframework.boot', name: 'spring-boot-starter-jdbc', version:'1.5.6.RELEASE' - compile group: 'org.springframework.boot', name: 'spring-boot-devtools', version:'1.5.6.RELEASE' - compile group: 'mysql', name: 'mysql-connector-java', version:'8.0.16' - compile project(':cache-client') - compile group: 'org.sql2o', name: 'sql2o', version:'1.6.0' - compile group: 'io.minio', name: 'minio', version:'3.0.6' - compileOnly group: 'org.projectlombok', name: 'lombok', version:'1.18.8' + compile group: 'org.springframework.boot', name: 'spring-boot-starter', version: '2.1.6.RELEASE' + compile group: 'org.springframework.boot', name: 'spring-boot-starter-jdbc', version: '2.1.6.RELEASE' + compile group: 'org.springframework.boot', name: 'spring-boot-devtools', version: '2.1.6.RELEASE' + compile group: 'mysql', name: 'mysql-connector-java', version: '8.0.17' + compile project(':cache-client') + compile group: 'org.sql2o', name: 'sql2o', version: '1.6.0' + compile group: 'io.minio', name: 'minio', version: '6.0.8' + compileOnly group: 'org.projectlombok', name: 'lombok', version: '1.18.8' + annotationProcessor group: 'org.projectlombok', name: 'lombok', version: '1.18.8' } diff --git a/cache-updater/src/main/java/net/runelite/cache/updater/CacheConfiguration.java b/cache-updater/src/main/java/net/runelite/cache/updater/CacheConfiguration.java index 229ea1d268..69c405aeb4 100644 --- a/cache-updater/src/main/java/net/runelite/cache/updater/CacheConfiguration.java +++ b/cache-updater/src/main/java/net/runelite/cache/updater/CacheConfiguration.java @@ -33,8 +33,8 @@ import java.util.Map; import javax.sql.DataSource; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.beans.factory.annotation.Value; -import org.springframework.boot.autoconfigure.jdbc.DataSourceBuilder; import org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.boot.jdbc.DataSourceBuilder; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.sql2o.Sql2o; diff --git a/cache/build.gradle b/cache/build.gradle index 01e6abc89c..e801a85fd8 100644 --- a/cache/build.gradle +++ b/cache/build.gradle @@ -1,22 +1,22 @@ - description = 'Cache' dependencies { - compile project(':http-api') - compile group: 'com.google.guava', name: 'guava', version:'28.0-jre' - compile group: 'org.slf4j', name: 'slf4j-api', version:'1.7.25' - compile group: 'org.apache.commons', name: 'commons-compress', version:'1.18' - compile group: 'com.google.code.gson', name: 'gson', version:'2.8.5' - compile group: 'io.netty', name: 'netty-buffer', version:'4.1.37.Final' - compile group: 'org.antlr', name: 'antlr4-runtime', version:'4.6' - compile group: 'commons-cli', name: 'commons-cli', version:'1.4' - testCompile group: 'junit', name: 'junit', version:'4.12' - testCompile group: 'org.slf4j', name: 'slf4j-simple', version:'1.7.26' - testCompile group: 'net.runelite.rs', name: 'cache', version:'165' - compileOnly group: 'org.projectlombok', name: 'lombok', version:'1.18.8' + compile project(':http-api') + compile group: 'com.google.guava', name: 'guava', version: '28.0-jre' + compile group: 'org.slf4j', name: 'slf4j-api', version: '1.7.26' + compile group: 'org.apache.commons', name: 'commons-compress', version: '1.18' + compile group: 'com.google.code.gson', name: 'gson', version: '2.8.5' + compile group: 'io.netty', name: 'netty-buffer', version: '4.1.37.Final' + compile group: 'org.antlr', name: 'antlr4-runtime', version: '4.7.2' + compile group: 'commons-cli', name: 'commons-cli', version: '1.4' + testCompile group: 'junit', name: 'junit', version: '4.12' + testCompile group: 'org.slf4j', name: 'slf4j-simple', version: '1.7.26' + testCompile group: 'net.runelite.rs', name: 'cache', version: '165' + compileOnly group: 'org.projectlombok', name: 'lombok', version: '1.18.8' + annotationProcessor group: 'org.projectlombok', name: 'lombok', version: '1.18.8' } task packageTests(type: Jar) { - from sourceSets.test.output - classifier = 'tests' + from sourceSets.test.output + classifier = 'tests' } artifacts.archives packageTests diff --git a/deobfuscator/build.gradle b/deobfuscator/build.gradle index 7ee533ad4a..610aaa448f 100644 --- a/deobfuscator/build.gradle +++ b/deobfuscator/build.gradle @@ -1,22 +1,21 @@ - description = 'Deobfuscator' dependencies { - compile project(':runelite-api') - compile project(':runescape-api') - compile group: 'net.runelite', name: 'fernflower', version:'20171017' - compile group: 'com.google.guava', name: 'guava', version:'28.0-jre' - compile group: 'org.slf4j', name: 'slf4j-api', version:'1.7.25' - compile group: 'com.google.code.gson', name: 'gson', version:'2.8.5' - compile group: 'org.ow2.asm', name: 'asm-debug-all', version:'5.2' - runtime group: 'org.slf4j', name: 'slf4j-simple', version:'1.7.26' - testCompile project(':rs-client') - testCompile group: 'net.runelite.rs', name: 'vanilla', version:'181' - testCompile group: 'junit', name: 'junit', version:'4.12' - testCompile group: 'org.mockito', name: 'mockito-all', version:'1.10.19' + compile project(':runelite-api') + compile project(':runescape-api') + compile group: 'net.runelite', name: 'fernflower', version: '20171017' + compile group: 'com.google.guava', name: 'guava', version: '28.0-jre' + compile group: 'org.slf4j', name: 'slf4j-api', version: '1.7.26' + compile group: 'com.google.code.gson', name: 'gson', version: '2.8.5' + compile group: 'org.ow2.asm', name: 'asm-debug-all', version: '5.2' + runtime group: 'org.slf4j', name: 'slf4j-simple', version: '1.7.26' + testCompile project(':rs-client') + testCompile group: 'net.runelite.rs', name: 'vanilla', version: '181' + testCompile group: 'junit', name: 'junit', version: '4.12' + testCompile group: 'org.mockito', name: 'mockito-all', version: '1.10.19' } task packageTests(type: Jar) { - from sourceSets.test.output - classifier = 'tests' + from sourceSets.test.output + classifier = 'tests' } artifacts.archives packageTests diff --git a/gradle.properties b/gradle.properties new file mode 100644 index 0000000000..3f7769ea7e --- /dev/null +++ b/gradle.properties @@ -0,0 +1,6 @@ +org.gradle.caching=true +org.gradle.warning.mode=all +org.gradle.parallel=true +org.gradle.console=rich +org.gradle.configureondemand=true +org.gradle.jvmargs=-Xmx4096m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 94336fcae9..5c2d1cf016 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 290541c738..4b7e1f3d38 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.3-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-5.5.1-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/gradlew b/gradlew old mode 100644 new mode 100755 index cccdd3d517..7ebc6048bc --- a/gradlew +++ b/gradlew @@ -1,5 +1,21 @@ #!/usr/bin/env sh +# +# Copyright 2015 the original author or authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + ############################################################################## ## ## Gradle start up script for UN*X @@ -28,7 +44,7 @@ APP_NAME="Gradle" APP_BASE_NAME=`basename "$0"` # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS="" +DEFAULT_JVM_OPTS='"-Xmx4g" "-Xms2g" "-Dfile.encoding=UTF-8"' # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD="maximum" diff --git a/gradlew.bat b/gradlew.bat index f9553162f1..51aa92b0cb 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -1,3 +1,19 @@ +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem + @if "%DEBUG%" == "" @echo off @rem ########################################################################## @rem @@ -14,7 +30,7 @@ set APP_BASE_NAME=%~n0 set APP_HOME=%DIRNAME% @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS= +set DEFAULT_JVM_OPTS="-Xmx4g" "-Xms2g" "-Dfile.encoding=UTF-8" @rem Find java.exe if defined JAVA_HOME goto findJavaFromJavaHome diff --git a/http-api/build.gradle b/http-api/build.gradle index c97703b8fc..25fcead874 100644 --- a/http-api/build.gradle +++ b/http-api/build.gradle @@ -1,13 +1,13 @@ - description = 'Web API' dependencies { - compile group: 'com.squareup.okhttp3', name: 'okhttp', version:'3.14.0' - compile group: 'com.google.code.gson', name: 'gson', version:'2.8.5' - compile group: 'org.slf4j', name: 'slf4j-api', version:'1.7.25' - compile group: 'org.apache.commons', name: 'commons-csv', version:'1.4' - compile group: 'io.reactivex.rxjava2', name: 'rxjava', version:'2.2.10' - testCompile group: 'junit', name: 'junit', version:'4.12' - testCompile group: 'org.slf4j', name: 'slf4j-simple', version:'1.7.26' - testCompile group: 'com.squareup.okhttp3', name: 'mockwebserver', version:'3.14.0' - compileOnly group: 'org.projectlombok', name: 'lombok', version:'1.18.8' + compile group: 'com.squareup.okhttp3', name: 'okhttp', version: '4.0.1' + compile group: 'com.google.code.gson', name: 'gson', version: '2.8.5' + compile group: 'org.slf4j', name: 'slf4j-api', version: '1.7.26' + compile group: 'org.apache.commons', name: 'commons-csv', version: '1.7' + compile group: 'io.reactivex.rxjava2', name: 'rxjava', version: '2.2.10' + testCompile group: 'junit', name: 'junit', version: '4.12' + testCompile group: 'org.slf4j', name: 'slf4j-simple', version: '1.7.26' + testCompile group: 'com.squareup.okhttp3', name: 'mockwebserver', version: '4.0.1' + compileOnly group: 'org.projectlombok', name: 'lombok', version: '1.18.8' + annotationProcessor group: 'org.projectlombok', name: 'lombok', version: '1.18.8' } diff --git a/http-api/src/main/java/net/runelite/http/api/discord/DiscordEmbed.java b/http-api/src/main/java/net/runelite/http/api/discord/DiscordEmbed.java index 4c04ecc69d..9de5f42331 100644 --- a/http-api/src/main/java/net/runelite/http/api/discord/DiscordEmbed.java +++ b/http-api/src/main/java/net/runelite/http/api/discord/DiscordEmbed.java @@ -61,6 +61,7 @@ public class DiscordEmbed VideoEmbed video; ProviderEmbed provider; AuthorEmbed author; + @Builder.Default List fields = new ArrayList<>(); public DiscordEmbed() diff --git a/http-api/src/main/java/net/runelite/http/api/discord/DiscordMessage.java b/http-api/src/main/java/net/runelite/http/api/discord/DiscordMessage.java index 061568da9d..48cc3c3665 100644 --- a/http-api/src/main/java/net/runelite/http/api/discord/DiscordMessage.java +++ b/http-api/src/main/java/net/runelite/http/api/discord/DiscordMessage.java @@ -48,6 +48,7 @@ public class DiscordMessage String avatarUrl; @SerializedName("tts") boolean textToSpeech; + @Builder.Default List embeds = new ArrayList<>(); public DiscordMessage() diff --git a/http-service/build.gradle b/http-service/build.gradle index 44405d58fa..39da851f05 100644 --- a/http-service/build.gradle +++ b/http-service/build.gradle @@ -1,28 +1,28 @@ - apply plugin: 'war' description = 'Web Service' dependencies { - compile group: 'org.springframework.boot', name: 'spring-boot-starter-web', version:'1.5.6.RELEASE' - compile group: 'org.springframework.boot', name: 'spring-boot-devtools', version:'1.5.6.RELEASE' - compile group: 'org.springframework', name: 'spring-jdbc', version:'4.3.10.RELEASE' - compile group: 'org.mapstruct', name: 'mapstruct-jdk8', version:'1.2.0.Final' - compile project(':http-api') - compile project(':cache') - compile group: 'org.sql2o', name: 'sql2o', version:'1.6.0' - compile group: 'com.google.guava', name: 'guava', version:'28.0-jre' - compile group: 'org.slf4j', name: 'slf4j-api', version:'1.7.25' - compile group: 'com.github.scribejava', name: 'scribejava-apis', version:'6.6.3' - compile group: 'io.minio', name: 'minio', version:'3.0.6' - compile(group: 'redis.clients', name: 'jedis', version:'3.0.1') { -exclude(module: 'commons-pool2') + compile group: 'org.springframework.boot', name: 'spring-boot-starter-web', version: '2.1.6.RELEASE' + compile group: 'org.springframework.boot', name: 'spring-boot-devtools', version: '2.1.6.RELEASE' + compile group: 'org.springframework', name: 'spring-jdbc', version: '5.1.8.RELEASE' + compile group: 'org.mapstruct', name: 'mapstruct-jdk8', version: '1.3.0.Final' + compile project(':http-api') + compile project(':cache') + compile group: 'org.sql2o', name: 'sql2o', version: '1.6.0' + compile group: 'com.google.guava', name: 'guava', version: '28.0-jre' + compile group: 'org.slf4j', name: 'slf4j-api', version: '1.7.26' + compile group: 'com.github.scribejava', name: 'scribejava-apis', version: '6.7.0' + compile group: 'io.minio', name: 'minio', version: '6.0.8' + compile(group: 'redis.clients', name: 'jedis', version: '3.1.0') { + exclude(module: 'commons-pool2') } - testCompile(group: 'org.springframework.boot', name: 'spring-boot-starter-test', version:'1.5.6.RELEASE') { -exclude(module: 'commons-logging') + testCompile(group: 'org.springframework.boot', name: 'spring-boot-starter-test', version: '2.1.6.RELEASE') { + exclude(module: 'commons-logging') } - testCompile group: 'com.squareup.okhttp3', name: 'mockwebserver', version:'3.14.0' - testCompile group: 'com.h2database', name: 'h2', version:'1.4.196' - providedCompile group: 'org.springframework.boot', name: 'spring-boot-starter-tomcat', version:'1.5.6.RELEASE' - providedCompile group: 'org.projectlombok', name: 'lombok', version:'1.18.8' - providedCompile group: 'org.mariadb.jdbc', name: 'mariadb-java-client', version:'2.4.2' + testCompile group: 'com.squareup.okhttp3', name: 'mockwebserver', version: '4.0.1' + testCompile group: 'com.h2database', name: 'h2', version: '1.4.199' + providedCompile group: 'org.springframework.boot', name: 'spring-boot-starter-tomcat', version: '2.1.6.RELEASE' + providedCompile group: 'org.projectlombok', name: 'lombok', version: '1.18.8' + annotationProcessor group: 'org.projectlombok', name: 'lombok', version: '1.18.8' + providedCompile group: 'org.mariadb.jdbc', name: 'mariadb-java-client', version: '2.4.2' } diff --git a/http-service/src/main/java/net/runelite/http/service/SpringBootWebApplication.java b/http-service/src/main/java/net/runelite/http/service/SpringBootWebApplication.java index 344e2ec916..c24ebd8d49 100644 --- a/http-service/src/main/java/net/runelite/http/service/SpringBootWebApplication.java +++ b/http-service/src/main/java/net/runelite/http/service/SpringBootWebApplication.java @@ -49,7 +49,7 @@ import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration; import org.springframework.boot.autoconfigure.jdbc.DataSourceProperties; import org.springframework.boot.builder.SpringApplicationBuilder; import org.springframework.boot.context.properties.ConfigurationProperties; -import org.springframework.boot.web.support.SpringBootServletInitializer; +import org.springframework.boot.web.servlet.support.SpringBootServletInitializer; import org.springframework.context.annotation.Bean; import org.springframework.jdbc.datasource.lookup.JndiDataSourceLookup; import org.springframework.scheduling.annotation.EnableScheduling; diff --git a/injected-client/build.gradle b/injected-client/build.gradle index eb9ca810ae..0534874e3f 100644 --- a/injected-client/build.gradle +++ b/injected-client/build.gradle @@ -1,6 +1,5 @@ - description = 'Injected Client' dependencies { - compile project(':rs-client') - compile group: 'net.runelite.rs', name: 'vanilla', version:'181' + compile project(':rs-client') + compile group: 'net.runelite.rs', name: 'vanilla', version: '181' } diff --git a/injector-plugin/build.gradle b/injector-plugin/build.gradle index 1bf97aaff1..09eb50356c 100644 --- a/injector-plugin/build.gradle +++ b/injector-plugin/build.gradle @@ -1,24 +1,45 @@ group = 'net.runelite.rs' description = 'Injector' + +def osrsRevision = 181 +def deobfuscatedJar = "${project.rootDir}/runescape-client/build/libs/rs-client-"+project.version+".jar" +def vanillaJar = "$buildDir/vanilla-"+osrsRevision+".jar" +def injectedJar = "${project.rootDir}/injected-client/build/libs/injected-client-"+project.version+".jar" + +configurations { + vanilla +} + dependencies { - compile project(':deobfuscator') - compile project(':mixins') - compile project(':runelite-api') - compile project(':runescape-api') - compile group: 'org.apache.maven', name: 'maven-plugin-api', version:'3.6.1' - testCompile project(':deobfuscator') - testCompile group: 'junit', name: 'junit', version:'4.12' - testCompile group: 'org.mockito', name: 'mockito-all', version:'1.10.19' - compileOnly group: 'org.apache.maven.plugin-tools', name: 'maven-plugin-annotations', version:'3.6.0' + compile project(':deobfuscator') + compile project(':mixins') + compile project(':runelite-api') + compile project(':runescape-api') + compile project(':rs-client') + compile project(':injected-client') + compile group: 'org.apache.maven', name: 'maven-plugin-api', version: '3.6.1' + testCompile project(':deobfuscator') + testCompile group: 'junit', name: 'junit', version: '4.12' + testCompile group: 'org.mockito', name: 'mockito-all', version: '1.10.19' + compileOnly group: 'org.apache.maven.plugin-tools', name: 'maven-plugin-annotations', version: '3.6.0' + annotationProcessor group: 'org.eclipse.sisu', name: 'org.eclipse.sisu.inject', version: '0.3.3' + vanilla "net.runelite.rs:vanilla:"+osrsRevision } -task inject(type:JavaExec) { - classpath = sourceSets.main.runtimeClasspath +compileJava.outputs.upToDateWhen {false} - main = "net.runelite.injector.Injector" - args('../runescape-client/build/libs/rs-client-1.5.30-SNAPSHOT.jar,./vanilla-181.jar,../injected-client/build/libs/injected-client-1.5.30-SNAPSHOT.jar'.split(',')) -} - -compileJava.doLast { - tasks.inject.execute() +compileJava.doLast() { + copy { + from configurations.vanilla + into "$buildDir" + } + def path = sourceSets.main.runtimeClasspath + def loader = new URLClassLoader(path.collect { f -> f.toURL() } as URL[]) + def inject = loader.loadClass('net.runelite.injector.Injector') + String[] jarPaths = [ + deobfuscatedJar, + vanillaJar, + injectedJar + ] + inject.main(jarPaths) } \ No newline at end of file diff --git a/protocol-api/build.gradle b/protocol-api/build.gradle index 1bf7ca2cd2..480099a817 100644 --- a/protocol-api/build.gradle +++ b/protocol-api/build.gradle @@ -1,9 +1,9 @@ - description = 'Protocol API' dependencies { - compile project(':runelite-api') - compile group: 'org.slf4j', name: 'slf4j-api', version:'1.7.25' - compile group: 'com.google.guava', name: 'guava', version:'28.0-jre' - testCompile group: 'junit', name: 'junit', version:'4.12' - compileOnly group: 'org.projectlombok', name: 'lombok', version:'1.18.8' + compile project(':runelite-api') + compile group: 'org.slf4j', name: 'slf4j-api', version: '1.7.26' + compile group: 'com.google.guava', name: 'guava', version: '28.0-jre' + testCompile group: 'junit', name: 'junit', version: '4.12' + compileOnly group: 'org.projectlombok', name: 'lombok', version: '1.18.8' + annotationProcessor group: 'org.projectlombok', name: 'lombok', version: '1.18.8' } diff --git a/protocol/build.gradle b/protocol/build.gradle index 067154033f..faacf85e28 100644 --- a/protocol/build.gradle +++ b/protocol/build.gradle @@ -1,10 +1,10 @@ - description = 'Protocol' dependencies { - compile project(':protocol-api') - compile project(':cache') - compile group: 'com.google.guava', name: 'guava', version:'28.0-jre' - compile group: 'io.netty', name: 'netty-all', version:'4.1.37.Final' - testCompile group: 'junit', name: 'junit', version:'4.12' - compileOnly group: 'org.projectlombok', name: 'lombok', version:'1.18.8' + compile project(':protocol-api') + compile project(':cache') + compile group: 'com.google.guava', name: 'guava', version: '28.0-jre' + compile group: 'io.netty', name: 'netty-all', version: '4.1.37.Final' + testCompile group: 'junit', name: 'junit', version: '4.12' + compileOnly group: 'org.projectlombok', name: 'lombok', version: '1.18.8' + annotationProcessor group: 'org.projectlombok', name: 'lombok', version: '1.18.8' } diff --git a/runelite-api/build.gradle b/runelite-api/build.gradle index 04881187cd..a84f44de3b 100644 --- a/runelite-api/build.gradle +++ b/runelite-api/build.gradle @@ -1,8 +1,8 @@ - description = 'RuneLite API' dependencies { - compile group: 'org.slf4j', name: 'slf4j-api', version:'1.7.25' - compile group: 'com.google.code.findbugs', name: 'jsr305', version:'3.0.2' - testCompile group: 'junit', name: 'junit', version:'4.12' - compileOnly group: 'org.projectlombok', name: 'lombok', version:'1.18.8' + compile group: 'org.slf4j', name: 'slf4j-api', version: '1.7.26' + compile group: 'com.google.code.findbugs', name: 'jsr305', version: '3.0.2' + testCompile group: 'junit', name: 'junit', version: '4.12' + compileOnly group: 'org.projectlombok', name: 'lombok', version: '1.18.8' + annotationProcessor group: 'org.projectlombok', name: 'lombok', version: '1.18.8' } diff --git a/runelite-client/build.gradle b/runelite-client/build.gradle index e4adb69553..c100e4007f 100644 --- a/runelite-client/build.gradle +++ b/runelite-client/build.gradle @@ -1,49 +1,72 @@ +plugins { + id 'com.github.johnrengelman.shadow' version '5.1.0' + id 'java' +} 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: 'org.slf4j', name: 'slf4j-api', version: '1.7.26' + compile group: 'ch.qos.logback', name: 'logback-classic', version: '1.2.3' + compile group: 'net.sf.jopt-simple', name: 'jopt-simple', version: '5.0.4' + compile group: 'com.google.guava', name: 'guava', version: '28.0-jre' + compile group: 'com.google.inject', name: 'guice', version: '4.2.2', 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.7' + 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' + compile group: 'net.java.dev.jna', name: 'jna', version: '5.4.0' + compile group: 'net.java.dev.jna', name: 'jna-platform', version: '5.4.0' + 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.1' + 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: '2.1' + testCompile group: 'org.mockito', name: 'mockito-all', version: '1.10.19' + testCompile group: 'com.google.inject.extensions', name: 'guice-testlib', version: '4.2.2' + testCompile group: 'com.google.inject.extensions', name: 'guice-grapher', version: '4.2.2' + compileOnly group: 'org.projectlombok', name: 'lombok', version: '1.18.8' + annotationProcessor group: 'org.projectlombok', name: 'lombok', version: '1.18.8' + compileOnly group: 'net.runelite', name: 'orange-extensions', version: '1.0' } + +tasks.withType(AbstractArchiveTask) { + preserveFileTimestamps = false + reproducibleFileOrder = true +} + +jar { + manifest { + attributes 'Main-Class': 'net.runelite.client.RuneLite' + } +} + +shadowJar { + classifier = "shaded" +} + +tasks.build.dependsOn tasks.shadowJar \ No newline at end of file diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/tmorph/TMorph.java b/runelite-client/src/main/java/net/runelite/client/plugins/tmorph/TMorph.java index 1a432301ae..9de63d76ec 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/tmorph/TMorph.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/tmorph/TMorph.java @@ -26,12 +26,14 @@ package net.runelite.client.plugins.tmorph; import com.google.inject.Provides; import javax.inject.Inject; import javax.inject.Singleton; +import net.runelite.api.Actor; import net.runelite.api.Client; import net.runelite.api.GameState; import net.runelite.api.Player; import net.runelite.api.events.AnimationChanged; import net.runelite.api.events.ConfigChanged; import net.runelite.api.events.GameTick; +import net.runelite.api.events.SpotAnimationChanged; import net.runelite.api.kit.KitType; import net.runelite.api.widgets.WidgetInfo; import net.runelite.client.config.ConfigManager; @@ -61,65 +63,68 @@ public class TMorph extends Plugin private EventBus eventBus; private boolean mageSwap; - private boolean rangeSwap; private boolean meleeSwap; + private boolean rangeSwap; + private int animation; + private int bodyMage; + private int bodyMelee; + private int bodyRange; + private int bootsMage; + private int bootsMelee; + private int bootsRange; + private int capeMage; + private int capeMelee; + private int capeRange; private int globalAnimSwap; - private int animationSwap; - private int animationTarget; - private int MainhandMage; - private int targetMainhandMage; - private int OffhandMage; - private int targetOffhandMage; - private int HelmetMage; - private int targetHelmetMage; - private int CapeMage; - private int targetCapeMage; - private int NeckMage; - private int targetNeckMage; - private int BodyMage; + private int globalGraphicSwap; + private int glovesMage; + private int glovesMelee; + private int glovesRange; + private int graphic; + private int helmetMage; + private int helmetMelee; + private int helmetRange; + private int legsMage; + private int legsMelee; + private int legsRange; + private int mainhandMage; + private int mainhandMelee; + private int mainhandRange; + private int neckMage; + private int neckMelee; + private int neckRange; + private int offhandMage; + private int offhandMelee; + private int offhandRange; + private int targetAnimation; private int targetBodyMage; - private int LegsMage; - private int targetLegsMage; - private int BootsMage; - private int targetBootsMage; - private int GlovesMage; - private int targetGlovesMage; - private int MainhandRange; - private int targetMainhandRange; - private int OffhandRange; - private int targetOffhandRange; - private int HelmetRange; - private int targetHelmetRange; - private int CapeRange; - private int targetCapeRange; - private int NeckRange; - private int targetNeckRange; - private int BodyRange; - private int targetBodyRange; - private int LegsRange; - private int targetLegsRange; - private int BootsRange; - private int targetBootsRange; - private int GlovesRange; - private int targetGlovesRange; - private int MainhandMelee; - private int targetMainhandMelee; - private int OffhandMelee; - private int targetOffhandMelee; - private int HelmetMelee; - private int targetHelmetMelee; - private int CapeMelee; - private int targetCapeMelee; - private int NeckMelee; - private int targetNeckMelee; - private int BodyMelee; private int targetBodyMelee; - private int LegsMelee; - private int targetLegsMelee; - private int BootsMelee; + private int targetBodyRange; + private int targetBootsMage; private int targetBootsMelee; - private int GlovesMelee; + private int targetBootsRange; + private int targetCapeMage; + private int targetCapeMelee; + private int targetCapeRange; + private int targetGlovesMage; private int targetGlovesMelee; + private int targetGlovesRange; + private int targetGraphic; + private int targetHelmetMage; + private int targetHelmetMelee; + private int targetHelmetRange; + private int targetLegsMage; + private int targetLegsMelee; + private int targetLegsRange; + private int targetMainhandMage; + private int targetMainhandMelee; + private int targetMainhandRange; + private int targetNeckMage; + private int targetNeckMelee; + private int targetNeckRange; + private int targetOffhandMage; + private int targetOffhandMelee; + private int targetOffhandRange; @Provides TMorphConfig provideConfig(ConfigManager configManager) @@ -145,6 +150,7 @@ public class TMorph extends Plugin eventBus.subscribe(ConfigChanged.class, this, this::onConfigChanged); eventBus.subscribe(AnimationChanged.class, this, this::onAnimationChanged); eventBus.subscribe(GameTick.class, this, this::onGameTick); + eventBus.subscribe(SpotAnimationChanged.class, this, this::onSpotAnimationChanged); } private void onConfigChanged(ConfigChanged event) @@ -155,20 +161,46 @@ public class TMorph extends Plugin } } - private void onAnimationChanged(AnimationChanged event) + private void onSpotAnimationChanged(SpotAnimationChanged event) { - if (this.animationTarget <= 0 && this.animationSwap <= 0 && this.globalAnimSwap > 0) + final Actor actor = event.getActor(); + + if (actor.getSpotAnimation() == -1) { - if (event.getActor().getAnimation() != -1) + return; + } + + if (this.graphic <= 0 && this.targetGraphic <= 0 && this.globalGraphicSwap > 0) + { + actor.setSpotAnimation(this.globalGraphicSwap); + } + if (this.graphic > 0 && this.targetGraphic > 0) + { + if (actor.getSpotAnimation() == this.targetGraphic) { - event.getActor().setAnimation(this.globalAnimSwap); + actor.setSpotAnimation(this.graphic); } } - if (this.animationTarget > 0 && this.animationSwap > 0) + } + + private void onAnimationChanged(AnimationChanged event) + { + final Actor actor = event.getActor(); + + if (actor.getAnimation() != -1) { - if (event.getActor().getAnimation() == this.animationTarget) + return; + } + + if (this.targetAnimation <= 0 && this.animation <= 0 && this.globalAnimSwap > 0) + { + actor.setAnimation(this.globalAnimSwap); + } + if (this.targetAnimation > 0 && this.animation > 0) + { + if (actor.getAnimation() == this.targetAnimation) { - event.getActor().setAnimation(this.animationSwap); + actor.setAnimation(this.animation); } } } @@ -179,6 +211,7 @@ public class TMorph extends Plugin { return; } + updateEquip(); } @@ -215,279 +248,279 @@ public class TMorph extends Plugin if (this.mageSwap) { - if (this.MainhandMage > 0) + if (this.mainhandMage > 0) { if (this.targetMainhandMage > 0) { if (mainhandID == this.targetMainhandMage) { - player.getPlayerAppearance().getEquipmentIds()[KitType.WEAPON.getIndex()] = this.MainhandMage + 512; + player.getPlayerAppearance().getEquipmentIds()[KitType.WEAPON.getIndex()] = this.mainhandMage + 512; } } } - if (this.OffhandMage > 0) + if (this.offhandMage > 0) { if (this.targetOffhandMage > 0) { if (offhandID == this.targetOffhandMage) { - player.getPlayerAppearance().getEquipmentIds()[KitType.SHIELD.getIndex()] = this.OffhandMage + 512; + player.getPlayerAppearance().getEquipmentIds()[KitType.SHIELD.getIndex()] = this.offhandMage + 512; } } } - if (this.HelmetMage > 0) + if (this.helmetMage > 0) { if (this.targetHelmetMage > 0) { if (helmetID == this.targetHelmetMage) { - player.getPlayerAppearance().getEquipmentIds()[KitType.HELMET.getIndex()] = this.HelmetMage + 512; + player.getPlayerAppearance().getEquipmentIds()[KitType.HELMET.getIndex()] = this.helmetMage + 512; } } } - if (this.CapeMage > 0) + if (this.capeMage > 0) { if (this.targetCapeMage > 0) { if (capeID == this.targetCapeMage) { - player.getPlayerAppearance().getEquipmentIds()[KitType.CAPE.getIndex()] = this.CapeMage + 512; + player.getPlayerAppearance().getEquipmentIds()[KitType.CAPE.getIndex()] = this.capeMage + 512; } } } - if (this.NeckMage > 0) + if (this.neckMage > 0) { if (this.targetNeckMage > 0) { if (neckID == this.targetNeckMage) { - player.getPlayerAppearance().getEquipmentIds()[KitType.AMULET.getIndex()] = this.NeckMage + 512; + player.getPlayerAppearance().getEquipmentIds()[KitType.AMULET.getIndex()] = this.neckMage + 512; } } } - if (this.BodyMage > 0) + if (this.bodyMage > 0) { if (this.targetBodyMage > 0) { if (bodyID == this.targetBodyMage) { - player.getPlayerAppearance().getEquipmentIds()[KitType.TORSO.getIndex()] = this.BodyMage + 512; + player.getPlayerAppearance().getEquipmentIds()[KitType.TORSO.getIndex()] = this.bodyMage + 512; } } } - if (this.LegsMage > 0) + if (this.legsMage > 0) { if (this.targetLegsMage > 0) { if (legsID == this.targetLegsMage) { - player.getPlayerAppearance().getEquipmentIds()[KitType.LEGS.getIndex()] = this.LegsMage + 512; + player.getPlayerAppearance().getEquipmentIds()[KitType.LEGS.getIndex()] = this.legsMage + 512; } } } - if (this.BootsMage > 0) + if (this.bootsMage > 0) { if (this.targetBootsMage > 0) { if (bootsID == this.targetBootsMage) { - player.getPlayerAppearance().getEquipmentIds()[KitType.BOOTS.getIndex()] = this.BootsMage + 512; + player.getPlayerAppearance().getEquipmentIds()[KitType.BOOTS.getIndex()] = this.bootsMage + 512; } } } - if (this.GlovesMage > 0) + if (this.glovesMage > 0) { if (this.targetGlovesMage > 0) { if (glovesID == this.targetGlovesMage) { - player.getPlayerAppearance().getEquipmentIds()[KitType.HANDS.getIndex()] = this.GlovesMage + 512; + player.getPlayerAppearance().getEquipmentIds()[KitType.HANDS.getIndex()] = this.glovesMage + 512; } } } } if (this.rangeSwap) { - if (this.MainhandRange > 0) + if (this.mainhandRange > 0) { if (this.targetMainhandRange > 0) { if (mainhandID == this.targetMainhandRange) { - player.getPlayerAppearance().getEquipmentIds()[KitType.WEAPON.getIndex()] = this.MainhandRange + 512; + player.getPlayerAppearance().getEquipmentIds()[KitType.WEAPON.getIndex()] = this.mainhandRange + 512; } } } - if (this.OffhandRange > 0) + if (this.offhandRange > 0) { if (this.targetOffhandRange > 0) { if (offhandID == this.targetOffhandRange) { - player.getPlayerAppearance().getEquipmentIds()[KitType.SHIELD.getIndex()] = this.OffhandRange + 512; + player.getPlayerAppearance().getEquipmentIds()[KitType.SHIELD.getIndex()] = this.offhandRange + 512; } } } - if (this.HelmetRange > 0) + if (this.helmetRange > 0) { if (this.targetHelmetRange > 0) { if (helmetID == this.targetHelmetRange) { - player.getPlayerAppearance().getEquipmentIds()[KitType.HELMET.getIndex()] = this.HelmetRange + 512; + player.getPlayerAppearance().getEquipmentIds()[KitType.HELMET.getIndex()] = this.helmetRange + 512; } } } - if (this.CapeRange > 0) + if (this.capeRange > 0) { if (this.targetCapeRange > 0) { if (capeID == this.targetCapeRange) { - player.getPlayerAppearance().getEquipmentIds()[KitType.CAPE.getIndex()] = this.CapeRange + 512; + player.getPlayerAppearance().getEquipmentIds()[KitType.CAPE.getIndex()] = this.capeRange + 512; } } } - if (this.NeckRange > 0) + if (this.neckRange > 0) { if (this.targetNeckRange > 0) { if (neckID == this.targetNeckRange) { - player.getPlayerAppearance().getEquipmentIds()[KitType.AMULET.getIndex()] = this.NeckRange + 512; + player.getPlayerAppearance().getEquipmentIds()[KitType.AMULET.getIndex()] = this.neckRange + 512; } } } - if (this.BodyRange > 0) + if (this.bodyRange > 0) { if (this.targetBodyRange > 0) { if (bodyID == this.targetBodyRange) { - player.getPlayerAppearance().getEquipmentIds()[KitType.TORSO.getIndex()] = this.BodyRange + 512; + player.getPlayerAppearance().getEquipmentIds()[KitType.TORSO.getIndex()] = this.bodyRange + 512; } } } - if (this.LegsRange > 0) + if (this.legsRange > 0) { if (this.targetLegsRange > 0) { if (legsID == this.targetLegsRange) { - player.getPlayerAppearance().getEquipmentIds()[KitType.LEGS.getIndex()] = this.LegsRange + 512; + player.getPlayerAppearance().getEquipmentIds()[KitType.LEGS.getIndex()] = this.legsRange + 512; } } } - if (this.BootsRange > 0) + if (this.bootsRange > 0) { if (this.targetBootsRange > 0) { if (bootsID == this.targetBootsRange) { - player.getPlayerAppearance().getEquipmentIds()[KitType.BOOTS.getIndex()] = this.BootsRange + 512; + player.getPlayerAppearance().getEquipmentIds()[KitType.BOOTS.getIndex()] = this.bootsRange + 512; } } } - if (this.GlovesRange > 0) + if (this.glovesRange > 0) { if (this.targetGlovesRange > 0) { if (glovesID == this.targetGlovesRange) { - player.getPlayerAppearance().getEquipmentIds()[KitType.HANDS.getIndex()] = this.GlovesRange + 512; + player.getPlayerAppearance().getEquipmentIds()[KitType.HANDS.getIndex()] = this.glovesRange + 512; } } } } if (this.meleeSwap) { - if (this.MainhandMelee > 0) + if (this.mainhandMelee > 0) { if (this.targetMainhandMelee > 0) { if (mainhandID == this.targetMainhandMelee) { - player.getPlayerAppearance().getEquipmentIds()[KitType.WEAPON.getIndex()] = this.MainhandMelee + 512; + player.getPlayerAppearance().getEquipmentIds()[KitType.WEAPON.getIndex()] = this.mainhandMelee + 512; } } } - if (this.OffhandMelee > 0) + if (this.offhandMelee > 0) { if (this.targetOffhandMelee > 0) { if (offhandID == this.targetOffhandMelee) { - player.getPlayerAppearance().getEquipmentIds()[KitType.SHIELD.getIndex()] = this.OffhandMelee + 512; + player.getPlayerAppearance().getEquipmentIds()[KitType.SHIELD.getIndex()] = this.offhandMelee + 512; } } } - if (this.HelmetMelee > 0) + if (this.helmetMelee > 0) { if (this.targetHelmetMelee > 0) { if (helmetID == this.targetHelmetMelee) { - player.getPlayerAppearance().getEquipmentIds()[KitType.HELMET.getIndex()] = this.HelmetMelee + 512; + player.getPlayerAppearance().getEquipmentIds()[KitType.HELMET.getIndex()] = this.helmetMelee + 512; } } } - if (this.CapeMelee > 0) + if (this.capeMelee > 0) { if (this.targetCapeMelee > 0) { if (capeID == this.targetCapeMelee) { - player.getPlayerAppearance().getEquipmentIds()[KitType.CAPE.getIndex()] = this.CapeMelee + 512; + player.getPlayerAppearance().getEquipmentIds()[KitType.CAPE.getIndex()] = this.capeMelee + 512; } } } - if (this.NeckMelee > 0) + if (this.neckMelee > 0) { if (this.targetNeckMelee > 0) { if (neckID == this.targetNeckMelee) { - player.getPlayerAppearance().getEquipmentIds()[KitType.AMULET.getIndex()] = this.NeckMelee + 512; + player.getPlayerAppearance().getEquipmentIds()[KitType.AMULET.getIndex()] = this.neckMelee + 512; } } } - if (this.BodyMelee > 0) + if (this.bodyMelee > 0) { if (this.targetBodyMelee > 0) { if (bodyID == this.targetBodyMelee) { - player.getPlayerAppearance().getEquipmentIds()[KitType.TORSO.getIndex()] = this.BodyMelee + 512; + player.getPlayerAppearance().getEquipmentIds()[KitType.TORSO.getIndex()] = this.bodyMelee + 512; } } } - if (this.LegsMelee > 0) + if (this.legsMelee > 0) { if (this.targetLegsMelee > 0) { if (legsID == this.targetLegsMelee) { - player.getPlayerAppearance().getEquipmentIds()[KitType.LEGS.getIndex()] = this.LegsMelee + 512; + player.getPlayerAppearance().getEquipmentIds()[KitType.LEGS.getIndex()] = this.legsMelee + 512; } } } - if (this.BootsMelee > 0) + if (this.bootsMelee > 0) { if (this.targetBootsMelee > 0) { if (bootsID == this.targetBootsMelee) { - player.getPlayerAppearance().getEquipmentIds()[KitType.BOOTS.getIndex()] = this.BootsMelee + 512; + player.getPlayerAppearance().getEquipmentIds()[KitType.BOOTS.getIndex()] = this.bootsMelee + 512; } } } - if (this.GlovesMelee > 0) + if (this.glovesMelee > 0) { if (this.targetGlovesMelee > 0) { if (glovesID == this.targetGlovesMelee) { - player.getPlayerAppearance().getEquipmentIds()[KitType.HANDS.getIndex()] = this.GlovesMelee + 512; + player.getPlayerAppearance().getEquipmentIds()[KitType.HANDS.getIndex()] = this.glovesMelee + 512; } } } @@ -497,65 +530,68 @@ public class TMorph extends Plugin private void updateConfig() { - this.mageSwap = config.mageSwap(); - this.rangeSwap = config.rangeSwap(); - this.meleeSwap = config.meleeSwap(); + this.animation = config.animationSwap(); + this.bodyMage = config.BodyMage(); + this.bodyMelee = config.BodyMelee(); + this.bodyRange = config.BodyRange(); + this.bootsMage = config.BootsMage(); + this.bootsMelee = config.BootsMelee(); + this.bootsRange = config.BootsRange(); + this.capeMage = config.CapeMage(); + this.capeMelee = config.CapeMelee(); + this.capeRange = config.CapeRange(); this.globalAnimSwap = config.globalAnimSwap(); - this.animationSwap = config.animationSwap(); - this.animationTarget = config.animationTarget(); - this.MainhandMage = config.MainhandMage(); - this.targetMainhandMage = config.targetMainhandMage(); - this.OffhandMage = config.OffhandMage(); - this.targetOffhandMage = config.targetOffhandMage(); - this.HelmetMage = config.HelmetMage(); - this.targetHelmetMage = config.targetHelmetMage(); - this.CapeMage = config.CapeMage(); - this.targetCapeMage = config.targetCapeMage(); - this.NeckMage = config.NeckMage(); - this.targetNeckMage = config.targetNeckMage(); - this.BodyMage = config.BodyMage(); + this.globalGraphicSwap = config.globalGraphicSwap(); + this.glovesMage = config.GlovesMage(); + this.glovesMelee = config.GlovesMelee(); + this.glovesRange = config.GlovesRange(); + this.graphic = config.graphicSwap(); + this.helmetMage = config.HelmetMage(); + this.helmetMelee = config.HelmetMelee(); + this.helmetRange = config.HelmetRange(); + this.legsMage = config.LegsMage(); + this.legsMelee = config.LegsMelee(); + this.legsRange = config.LegsRange(); + this.mageSwap = config.mageSwap(); + this.mainhandMage = config.MainhandMage(); + this.mainhandMelee = config.MainhandMelee(); + this.mainhandRange = config.MainhandRange(); + this.meleeSwap = config.meleeSwap(); + this.neckMage = config.NeckMage(); + this.neckMelee = config.NeckMelee(); + this.neckRange = config.NeckRange(); + this.offhandMage = config.OffhandMage(); + this.offhandMelee = config.OffhandMelee(); + this.offhandRange = config.OffhandRange(); + this.rangeSwap = config.rangeSwap(); + this.targetAnimation = config.animationTarget(); this.targetBodyMage = config.targetBodyMage(); - this.LegsMage = config.LegsMage(); - this.targetLegsMage = config.targetLegsMage(); - this.BootsMage = config.BootsMage(); - this.targetBootsMage = config.targetBootsMage(); - this.GlovesMage = config.GlovesMage(); - this.targetGlovesMage = config.targetGlovesMage(); - this.MainhandRange = config.MainhandRange(); - this.targetMainhandRange = config.targetMainhandRange(); - this.OffhandRange = config.OffhandRange(); - this.targetOffhandRange = config.targetOffhandRange(); - this.HelmetRange = config.HelmetRange(); - this.targetHelmetRange = config.targetHelmetRange(); - this.CapeRange = config.CapeRange(); - this.targetCapeRange = config.targetCapeRange(); - this.NeckRange = config.NeckRange(); - this.targetNeckRange = config.targetNeckRange(); - this.BodyRange = config.BodyRange(); - this.targetBodyRange = config.targetBodyRange(); - this.LegsRange = config.LegsRange(); - this.targetLegsRange = config.targetLegsRange(); - this.BootsRange = config.BootsRange(); - this.targetBootsRange = config.targetBootsRange(); - this.GlovesRange = config.GlovesRange(); - this.targetGlovesRange = config.targetGlovesRange(); - this.MainhandMelee = config.MainhandMelee(); - this.targetMainhandMelee = config.targetMainhandMelee(); - this.OffhandMelee = config.OffhandMelee(); - this.targetOffhandMelee = config.targetOffhandMelee(); - this.HelmetMelee = config.HelmetMelee(); - this.targetHelmetMelee = config.targetHelmetMelee(); - this.CapeMelee = config.CapeMelee(); - this.targetCapeMelee = config.targetCapeMelee(); - this.NeckMelee = config.NeckMelee(); - this.targetNeckMelee = config.targetNeckMelee(); - this.BodyMelee = config.BodyMelee(); this.targetBodyMelee = config.targetBodyMelee(); - this.LegsMelee = config.LegsMelee(); - this.targetLegsMelee = config.targetLegsMelee(); - this.BootsMelee = config.BootsMelee(); + this.targetBodyRange = config.targetBodyRange(); + this.targetBootsMage = config.targetBootsMage(); this.targetBootsMelee = config.targetBootsMelee(); - this.GlovesMelee = config.GlovesMelee(); + this.targetBootsRange = config.targetBootsRange(); + this.targetCapeMage = config.targetCapeMage(); + this.targetCapeMelee = config.targetCapeMelee(); + this.targetCapeRange = config.targetCapeRange(); + this.targetGlovesMage = config.targetGlovesMage(); this.targetGlovesMelee = config.targetGlovesMelee(); + this.targetGlovesRange = config.targetGlovesRange(); + this.targetGraphic = config.graphicTarget(); + this.targetHelmetMage = config.targetHelmetMage(); + this.targetHelmetMelee = config.targetHelmetMelee(); + this.targetHelmetRange = config.targetHelmetRange(); + this.targetLegsMage = config.targetLegsMage(); + this.targetLegsMelee = config.targetLegsMelee(); + this.targetLegsRange = config.targetLegsRange(); + this.targetMainhandMage = config.targetMainhandMage(); + this.targetMainhandMelee = config.targetMainhandMelee(); + this.targetMainhandRange = config.targetMainhandRange(); + this.targetNeckMage = config.targetNeckMage(); + this.targetNeckMelee = config.targetNeckMelee(); + this.targetNeckRange = config.targetNeckRange(); + this.targetOffhandMage = config.targetOffhandMage(); + this.targetOffhandMelee = config.targetOffhandMelee(); + this.targetOffhandRange = config.targetOffhandRange(); } } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/tmorph/TMorphConfig.java b/runelite-client/src/main/java/net/runelite/client/plugins/tmorph/TMorphConfig.java index 0a98083407..a06b6da96b 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/tmorph/TMorphConfig.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/tmorph/TMorphConfig.java @@ -96,7 +96,6 @@ public interface TMorphConfig extends Config keyName = "globalAnimSwap", name = "Global Animation Swap", description = "DO NOT USE WITH ANIMATION SWAP BELOW", - group = "Experimental Functions", hidden = true, unhide = "experimentalFunctions" @@ -132,6 +131,45 @@ public interface TMorphConfig extends Config return 0; } + @ConfigItem( + keyName = "globalGraphicSwap", + name = "Global Graphic Swap", + description = "DO NOT USE WITH GRAPHIC SWAP BELOW", + group = "Experimental Functions", + hidden = true, + unhide = "experimentalFunctions" + ) + default int globalGraphicSwap() + { + return 0; + } + + @ConfigItem( + keyName = "graphicSwap", + name = "Graphic Swap", + description = "ID", + group = "Experimental Functions", + hidden = true, + unhide = "experimentalFunctions" + ) + default int graphicSwap() + { + return 0; + } + + @ConfigItem( + keyName = "graphicTarget", + name = "Graphic Target", + description = "ID", + group = "Experimental Functions", + hidden = true, + unhide = "experimentalFunctions" + ) + default int graphicTarget() + { + return 0; + } + //////////////////Mage diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/worldhopper/ping/IcmpEchoReply.java b/runelite-client/src/main/java/net/runelite/client/plugins/worldhopper/ping/IcmpEchoReply.java index 75a7e4226c..235ae136d8 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/worldhopper/ping/IcmpEchoReply.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/worldhopper/ping/IcmpEchoReply.java @@ -24,6 +24,7 @@ */ package net.runelite.client.plugins.worldhopper.ping; +import com.sun.jna.Native; import com.sun.jna.Pointer; import com.sun.jna.Structure; import com.sun.jna.platform.win32.WinDef; @@ -32,8 +33,8 @@ import java.util.List; public class IcmpEchoReply extends Structure { - private static final int IP_OPTION_INFO_SIZE = 1 + 1 + 1 + 1 + (Pointer.SIZE == 8 ? 12 : 4); // on 64bit vms add 4 byte padding - public static final int SIZE = 4 + 4 + 4 + 2 + 2 + Pointer.SIZE + IP_OPTION_INFO_SIZE; + private static final int IP_OPTION_INFO_SIZE = 1 + 1 + 1 + 1 + (Native.POINTER_SIZE == 8 ? 12 : 4); // on 64bit vms add 4 byte padding + public static final int SIZE = 4 + 4 + 4 + 2 + 2 + Native.POINTER_SIZE + IP_OPTION_INFO_SIZE; public WinDef.ULONG address; public WinDef.ULONG status; diff --git a/runelite-client/src/main/java/net/runelite/client/util/ping/IcmpEchoReply.java b/runelite-client/src/main/java/net/runelite/client/util/ping/IcmpEchoReply.java index 2756320990..bf5616144b 100644 --- a/runelite-client/src/main/java/net/runelite/client/util/ping/IcmpEchoReply.java +++ b/runelite-client/src/main/java/net/runelite/client/util/ping/IcmpEchoReply.java @@ -24,6 +24,7 @@ */ package net.runelite.client.util.ping; +import com.sun.jna.Native; import com.sun.jna.Pointer; import com.sun.jna.Structure; import com.sun.jna.platform.win32.WinDef; @@ -32,8 +33,8 @@ import java.util.List; public class IcmpEchoReply extends Structure { - private static final int IP_OPTION_INFO_SIZE = 1 + 1 + 1 + 1 + (Pointer.SIZE == 8 ? 12 : 4); // on 64bit vms add 4 byte padding - public static final int SIZE = 4 + 4 + 4 + 2 + 2 + Pointer.SIZE + IP_OPTION_INFO_SIZE; + private static final int IP_OPTION_INFO_SIZE = 1 + 1 + 1 + 1 + (Native.POINTER_SIZE == 8 ? 12 : 4); // on 64bit vms add 4 byte padding + public static final int SIZE = 4 + 4 + 4 + 2 + 2 + Native.POINTER_SIZE + IP_OPTION_INFO_SIZE; public WinDef.ULONG address; public WinDef.ULONG status; diff --git a/runelite-mixins/build.gradle b/runelite-mixins/build.gradle index 198b761f2a..60c4996bdf 100644 --- a/runelite-mixins/build.gradle +++ b/runelite-mixins/build.gradle @@ -1,10 +1,9 @@ - description = 'RuneLite Mixins' dependencies { - testCompile group: 'junit', name: 'junit', version:'4.12' - testCompile group: 'org.mockito', name: 'mockito-all', version:'1.10.19' - compileOnly group: 'org.slf4j', name: 'slf4j-api', version:'1.7.25' + testCompile group: 'junit', name: 'junit', version: '4.12' + testCompile group: 'org.mockito', name: 'mockito-all', version: '1.10.19' + compileOnly group: 'org.slf4j', name: 'slf4j-api', version: '1.7.26' compile project(':runescape-api') - compileOnly group: 'com.google.guava', name: 'guava', version:'28.0-jre' - compileOnly group: 'javax.inject', name: 'javax.inject', version:'1' + compileOnly group: 'com.google.guava', name: 'guava', version: '28.0-jre' + compileOnly group: 'javax.inject', name: 'javax.inject', version: '1' } diff --git a/runelite-plugin-archetype/build.gradle b/runelite-plugin-archetype/build.gradle index 9b3a33612e..9d0ad72536 100644 --- a/runelite-plugin-archetype/build.gradle +++ b/runelite-plugin-archetype/build.gradle @@ -1,2 +1 @@ - description = 'RuneLite Plugin Archetype' diff --git a/runelite-script-assembler-plugin/build.gradle b/runelite-script-assembler-plugin/build.gradle index bf29879080..74c08b358a 100644 --- a/runelite-script-assembler-plugin/build.gradle +++ b/runelite-script-assembler-plugin/build.gradle @@ -1,27 +1,29 @@ - description = 'Script Assembler Plugin' dependencies { - compile project(':cache') - compile project(':runelite-api') - compile group: 'org.apache.maven', name: 'maven-plugin-api', version:'3.6.1' - compileOnly group: 'org.apache.maven.plugin-tools', name: 'maven-plugin-annotations', version:'3.6.0' + compile project(':cache') + compile project(':runelite-api') + compile group: 'org.apache.maven', name: 'maven-plugin-api', version: '3.6.1' + compile group: 'org.slf4j', name: 'slf4j-nop', version: '1.7.26' + compileOnly group: 'org.apache.maven.plugin-tools', name: 'maven-plugin-annotations', version: '3.6.0' + annotationProcessor group: 'org.eclipse.sisu', name: 'org.eclipse.sisu.inject', version: '0.3.3' } -task assembleMojo(type:JavaExec) { - classpath = sourceSets.main.runtimeClasspath - - main = "net.runelite.script.AssembleMojo" - args('../runelite-client/src/main/scripts,../runelite-client/src/main/resources/runelite'.split(',')) -} - -task indexMojo(type:JavaExec) { - classpath = sourceSets.main.runtimeClasspath - - main = "net.runelite.script.IndexMojo" - args('../runelite-client/src/main/resources/runelite,../runelite-client/src/main/resources/runelite/index'.split(',')) -} +compileJava.outputs.upToDateWhen {false} compileJava.doLast { - tasks.assembleMojo.execute() - tasks.indexMojo.execute() + def path = sourceSets.main.runtimeClasspath + def loader = new URLClassLoader(path.collect { f -> f.toURL() } as URL[]) + def assemble = loader.loadClass('net.runelite.script.AssembleMojo') + String[] assembleArgs = [ + "${project.rootDir}/runelite-client/src/main/scripts", + "${project.rootDir}/runelite-client/src/main/resources/runelite" + ] + assemble.main(assembleArgs) + + def index = loader.loadClass('net.runelite.script.IndexMojo') + String[] indexArgs = [ + "${project.rootDir}/runelite-client/src/main/resources/runelite", + "${project.rootDir}/runelite-client/src/main/resources/runelite/index" + ] + index.main(indexArgs) } diff --git a/runescape-api/build.gradle b/runescape-api/build.gradle index bd24d9fee3..4295d3b740 100644 --- a/runescape-api/build.gradle +++ b/runescape-api/build.gradle @@ -1,5 +1,5 @@ group = 'net.runelite.rs' description = 'RuneScape API' dependencies { - compile project(':runelite-api') + compile project(':runelite-api') } diff --git a/runescape-client/build.gradle b/runescape-client/build.gradle index db6950afa5..ea985ed5be 100644 --- a/runescape-client/build.gradle +++ b/runescape-client/build.gradle @@ -1,8 +1,8 @@ group = 'net.runelite.rs' description = 'RuneScape Client' dependencies { - compile project(':runescape-api') - testCompile group: 'junit', name: 'junit', version:'4.12' - testCompile group: 'org.slf4j', name: 'slf4j-api', version:'1.7.26' - testCompile group: 'org.slf4j', name: 'slf4j-simple', version:'1.7.26' + compile project(':runescape-api') + testCompile group: 'junit', name: 'junit', version: '4.12' + testCompile group: 'org.slf4j', name: 'slf4j-api', version: '1.7.26' + testCompile group: 'org.slf4j', name: 'slf4j-simple', version: '1.7.26' } diff --git a/travis/build.sh b/travis/build.sh deleted file mode 100644 index 0a565ec31d..0000000000 --- a/travis/build.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash - -./gradlew clean build -x test diff --git a/travis/settings.xml b/travis/settings.xml deleted file mode 100644 index 53689ebbce..0000000000 --- a/travis/settings.xml +++ /dev/null @@ -1,279 +0,0 @@ - - - - - - - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - runelite - - - true - false - true - false - - - - - - - runelite - -