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 index cccdd3d517..7ebc6048bc 100755 --- 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-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/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 - -