diff --git a/build.gradle b/build.gradle deleted file mode 100644 index 94aa44e5d5..0000000000 --- a/build.gradle +++ /dev/null @@ -1,207 +0,0 @@ -import org.ajoberstar.grgit.Grgit - -buildscript { - repositories { - maven { - url "https://plugins.gradle.org/m2/" - } - } - dependencies { - classpath "org.ajoberstar.grgit:grgit-gradle:3.1.1" - } -} - -plugins { - id 'com.adarshr.test-logger' version '1.7.0' apply false - id "com.github.ben-manes.versions" version "0.22.0" - id "com.gradle.build-scan" version "2.4" - id 'se.patrikerdes.use-latest-versions' version '0.2.8' -} - -apply plugin: 'application' - -ext { - grgit = Grgit.open(dir: "${rootProject.projectDir}") - localGitCommit = grgit.head().id - localGitCommitShort = grgit.head().getAbbreviatedId(7) - localGitDirty = !grgit.status().clean - - // sets the minimum launcher version that is output for the bootstrapper - launcherVersion = '2.0.3' - - // Dependencies versions - annotations = '17.0.0' - antlr = '4.7.2' - apacheCommonsCompress = '1.19' - apacheCommonsCsv = '1.7' - apacheCommonsText = '1.8' - asm = '7.2' - commonsCli = '1.4' - discord = '1.1' - fernflower = '07082019' - findbugs = '3.0.2' - gson = '2.8.6' - guava = '28.1-jre' - guice = '4.2.2' - h2 = '1.4.200' - hamcrest = '2.2' - httpcore = '4.4.12' - httpmime = '4.5.10' - javassist = '3.26.0-GA' - javax = '1.3.2' - javaxInject = '1' - jbsdiff = '1.0' - jclCore = '2.8' - jedis = '3.1.0' - jfoenix = '9.0.9' - jna = '5.4.0' - jogamp = '2.3.2' - jopt = '5.0.4' - jooq = '3.12.2' - junit = '4.12' - jupiter = '5.6.0-M1' - logback = '1.2.3' - lombok = '1.18.10' - mapstruct = '1.3.1.Final' - mariadbJdbc = '2.5.1' - mavenPluginAnnotations = '3.6.0' - mavenPluginApi = '3.6.2' - minio = '6.0.11' - mockito = '3.1.0' - mongodbDriverSync = '3.11.1' - mysqlConnectorJava = '8.0.18' - netty = '4.1.42.Final' - okhttp3 = '4.2.2' - orangeExtensions = '1.0' - petitparser = '2.2.0' - plexus = '3.3.0' - rxjava = '2.2.13' - rxrelay = '2.1.1' - scribejava = '6.9.0' - sisu = '0.3.3' - slf4j = '1.7.28' - springJdbc = '5.2.0.RELEASE' - springboot = '2.2.0.RELEASE' - sql2o = '1.6.0' - substance = '8.0.02' - trident = '1.5.00' -} - -allprojects { - apply plugin: 'maven' - if (this.name != 'rs-client') apply plugin: 'checkstyle' - - group = 'com.openosrs' - version = '1.5.37-SNAPSHOT' - - ext { - rsversion = 184 - cacheversion = 165 - plusVersion = '2.1.8.0' - - gitCommit = localGitCommit - gitCommitShort = localGitCommitShort - gitDirty = localGitDirty - - - rootPath = rootDir.toString().replace('\\', '/') - injectedClassesPath = rootPath + "/injector-plugin/out/injected-client/" - } -} - -subprojects { - apply plugin: 'com.adarshr.test-logger' - apply plugin: 'java-library' - apply plugin: 'maven' - apply plugin: 'fernflower' - apply plugin: 'maven-publish' - - sourceCompatibility = 1.8 - targetCompatibility = 1.8 - - tasks.withType(JavaCompile) { - options.encoding = 'UTF-8' - } - - tasks.withType(GroovyCompile).configureEach { - options.incremental = true - } - - publishing { - repositories { - maven { - name = "runelite" - url = uri("https://maven.pkg.github.com/open-osrs/runelite") - credentials { - username = System.getProperty("gpr_user") - password = System.getProperty("gpr_key") - } - } - } - publications { - gpr(MavenPublication) { - from(components.java) - } - } - } - - 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/open-osrs/hosting/master" } - - if (System.getenv("NEXUS-URL") != null) { - maven { url System.getenv("NEXUS-URL") } - } - } - - checkstyle { - toolVersion = '6.4.1' - sourceSets = [sourceSets.main] - configFile = file("${rootDir}/checkstyle/checkstyle.xml") - configProperties = [ "suppressionFile" : file("${rootDir}/checkstyle/suppressions.xml")] - showViolations = true - ignoreFailures = false - maxWarnings = 0 - } - -} - - -wrapper { - gradleVersion = '5.6.2' - - 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\"") - } -} - -run { - classpath = childProjects.client.sourceSets.main.runtimeClasspath - mainClassName = "net.runelite.client.RuneLite" -} - -def isNonStable = { String version -> - def unstableKeyword = ['ALPHA', 'BETA', 'RC'].any { it -> version.toUpperCase().contains(it) } - - return unstableKeyword -} - -dependencyUpdates { - checkForGradleUpdate = false - - resolutionStrategy { - componentSelection { - all { - if (isNonStable(candidate.version)) { - reject() - } - } - } - } -} diff --git a/build.gradle.kts b/build.gradle.kts new file mode 100644 index 0000000000..4469cd42e7 --- /dev/null +++ b/build.gradle.kts @@ -0,0 +1,156 @@ +/* + * Copyright (c) 2019 Owain van Brakel + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +import com.github.benmanes.gradle.versions.updates.DependencyUpdatesTask +import org.ajoberstar.grgit.Grgit + +buildscript { + repositories { + maven(url = "https://plugins.gradle.org/m2/") + } + dependencies { + classpath(Plugins.grgitPlugin) + classpath(Plugins.versionsPlugin) + } +} + +plugins { + id(Plugins.testLogger.first) version Plugins.testLogger.second apply false + id(Plugins.versions.first) version Plugins.versions.second + id(Plugins.buildScan.first) version Plugins.buildScan.second + id(Plugins.latestVersion.first) version Plugins.latestVersion.second + id(Plugins.grgit.first) version Plugins.grgit.second + + application +} + +val grgit = Grgit.open(mapOf("dir" to rootProject.projectDir.absolutePath)) +val localGitCommit = grgit.head().id +val localGitCommitShort = grgit.head().getAbbreviatedId(7) + +fun isNonStable(version: String): Boolean { + return listOf("ALPHA", "BETA", "RC").any { + version.toUpperCase().contains(it) + } +} + +allprojects { + apply() + + group = "com.openosrs" + version = ProjectVersions.rlVersion + + project.extra["gitCommit"] = localGitCommit + project.extra["gitCommitShort"] = localGitCommitShort + + project.extra["rootPath"] = rootDir.toString().replace("\\", "/") + project.extra["injectedClassesPath"] = "${rootDir}/injector-plugin/out/injected-client/" +} + +subprojects { + apply() + apply() + apply() + apply(plugin = Plugins.testLogger.first) + apply() + + if (this.name != "rs-client") apply(plugin = "checkstyle") + + 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/open-osrs/hosting/master") + + if (System.getenv("NEXUS-URL") != null) { + maven(url = System.getenv("NEXUS-URL")) + } + } + + configure { + sourceSets = setOf(project.sourceSets.main.get()) + configFile = file("${rootDir}/checkstyle/checkstyle.xml") + configProperties = mapOf("suppressionFile" to file("${rootDir}/checkstyle/suppressions.xml")) + maxWarnings = 0 + toolVersion = "6.4.1" + isShowViolations = true + isIgnoreFailures = false + } + + configure { + repositories { + maven { + name = "runelite" + url = uri("https://maven.pkg.github.com/open-osrs/runelite") + credentials { + username = System.getProperty("gpr_user") + password = System.getProperty("gpr_key") + } + } + } + publications { + register("gpr", MavenPublication::class) { + from(components["java"]) + } + } + } + + tasks { + java { + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 + } + + withType { + options.encoding = "UTF-8" + } + } +} + +application { + mainClassName = "net.runelite.client.RuneLite" +} + +tasks { + named("run") { + classpath = project(":runelite-client").sourceSets.main.get().runtimeClasspath + } + + named("dependencyUpdates") { + checkForGradleUpdate = false + + resolutionStrategy { + componentSelection { + all { + if (candidate.displayName.contains("fernflower") || isNonStable(candidate.version)) { + reject("Non stable") + } + } + } + } + } +} \ No newline at end of file diff --git a/buildSrc/build.gradle b/buildSrc/build.gradle deleted file mode 100644 index 313b14ce5c..0000000000 --- a/buildSrc/build.gradle +++ /dev/null @@ -1,7 +0,0 @@ -repositories { - maven { url "https://raw.githubusercontent.com/open-osrs/hosting/master" } -} -dependencies { - compile localGroovy() - implementation group: 'net.runelite', name: 'fernflower', version: '07082019' -} diff --git a/buildSrc/build.gradle.kts b/buildSrc/build.gradle.kts new file mode 100644 index 0000000000..e07fbc3103 --- /dev/null +++ b/buildSrc/build.gradle.kts @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2019 Owain van Brakel + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +plugins { + `kotlin-dsl` + groovy +} + +repositories { + mavenCentral() + maven(url = "https://raw.githubusercontent.com/open-osrs/hosting/master") +} + +dependencies { + implementation(gradleApi()) + implementation(localGroovy()) + implementation(group = "net.runelite", name = "fernflower", version = "07082019") +} + +kotlinDslPluginOptions { + experimentalWarning.set(false) +} \ No newline at end of file diff --git a/buildSrc/src/main/groovy/FernflowerPlugin.groovy b/buildSrc/src/main/groovy/FernflowerPlugin.groovy deleted file mode 100644 index 062adced78..0000000000 --- a/buildSrc/src/main/groovy/FernflowerPlugin.groovy +++ /dev/null @@ -1,16 +0,0 @@ -import org.gradle.api.Plugin -import org.gradle.api.Project -import org.gradle.api.tasks.StopExecutionException - -class FernflowerPlugin implements Plugin { - void apply(Project project) { - project.task('decompile', type: FernflowerTask) { - it.dependsOn(project.tasks.jar) - it.doFirst { - if (!project.tasks.jar.didWork) { - throw new StopExecutionException() - } - } - } - } -} diff --git a/buildSrc/src/main/groovy/FernflowerTask.groovy b/buildSrc/src/main/groovy/FernflowerTask.groovy deleted file mode 100644 index 49e46b5639..0000000000 --- a/buildSrc/src/main/groovy/FernflowerTask.groovy +++ /dev/null @@ -1,32 +0,0 @@ -import org.gradle.api.DefaultTask -import org.gradle.api.tasks.InputFile -import org.gradle.api.tasks.OutputDirectory -import org.gradle.api.tasks.TaskAction -import org.jetbrains.java.decompiler.main.decompiler.ConsoleDecompiler - -class FernflowerTask extends DefaultTask { - List extraArgs - String inputJar - String outputDir - - @InputFile - File getInputJar() { - project.file(inputJar ?: project.buildDir.toString() + '/libs/' + project.getName() + '-' + project.version + '.jar') - } - - @OutputDirectory - File getOutputDir() { - project.file(outputDir ?: project.buildDir.toString() + '/decompiled-sources') - } - - @TaskAction - void decompile() { - getOutputDir().mkdirs() - def args = [getInputJar().toString(), getOutputDir().toString()] - if (extraArgs) { - args.addAll(extraArgs) - } - - ConsoleDecompiler.main(args as String[]) - } -} \ No newline at end of file diff --git a/buildSrc/src/main/kotlin/Dependencies.kt b/buildSrc/src/main/kotlin/Dependencies.kt new file mode 100644 index 0000000000..fac83295bf --- /dev/null +++ b/buildSrc/src/main/kotlin/Dependencies.kt @@ -0,0 +1,193 @@ +/* + * Copyright (c) 2019 Owain van Brakel + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +const val kotlinVersion = "1.3.50" + +object ProjectVersions { + const val launcherVersion = "2.0.3" + const val rlVersion = "1.5.37-SNAPSHOT" + + const val openosrsVersion = "2.1.8.0" + + const val rsversion = 184 + const val cacheversion = 165 +} + +object Plugins { + val grgitPlugin = "org.ajoberstar:grgit:2.3.0" + val versionsPlugin = "com.github.ben-manes:gradle-versions-plugin:0.27.0" + + val testLogger = Pair("com.adarshr.test-logger", "2.0.0") + val versions = Pair("com.github.ben-manes.versions", "0.27.0") + val buildScan = Pair("com.gradle.build-scan", "3.0") + val latestVersion = Pair("se.patrikerdes.use-latest-versions", "0.2.12") + val grgit = Pair("org.ajoberstar.grgit", "4.0.0-rc.1") + val jarTest = Pair("com.github.hauner.jarTest", "1.0.1") + val shadow = Pair("com.github.johnrengelman.shadow", "5.1.0") +} + +object Libraries { + private object Versions { + const val annotations = "17.0.0" + const val antlr = "4.7.2" + const val apacheCommonsCompress = "1.19" + const val apacheCommonsCsv = "1.7" + const val apacheCommonsText = "1.8" + const val asm = "7.2" + const val commonsCli = "1.4" + const val discord = "1.1" + const val fernflower = "07082019" + const val findbugs = "3.0.2" + const val gson = "2.8.6" + const val guava = "28.1-jre" + const val guice = "4.2.2" + const val h2 = "1.4.200" + const val hamcrest = "2.2" + const val httpcore = "4.4.12" + const val httpmime = "4.5.10" + const val javassist = "3.26.0-GA" + const val javax = "1.3.2" + const val javaxInject = "1" + const val jbsdiff = "1.0" + const val jclCore = "2.8" + const val jedis = "3.1.0" + const val jna = "5.4.0" + const val jogamp = "2.3.2" + const val jopt = "5.0.4" + const val jooq = "3.12.2" + const val junit = "4.12" + const val jupiter = "5.6.0-M1" + const val logback = "1.2.3" + const val lombok = "1.18.10" + const val mapstruct = "1.3.1.Final" + const val mariadbJdbc = "2.5.1" + const val mavenPluginAnnotations = "3.6.0" + const val mavenPluginApi = "3.6.2" + const val minio = "6.0.11" + const val mockito = "3.1.0" + const val mongodbDriverSync = "3.11.1" + const val mysqlConnectorJava = "8.0.18" + const val naturalMouse = "2.0.2" + const val netty = "4.1.42.Final" + const val okhttp3 = "4.2.2" + const val orangeExtensions = "1.0" + const val petitparser = "2.2.0" + const val plexus = "3.3.0" + const val rxjava = "2.2.13" + const val rxrelay = "2.1.1" + const val scribejava = "6.9.0" + const val sisu = "0.3.3" + const val slf4j = "1.7.28" + const val springJdbc = "5.2.0.RELEASE" + const val springboot = "2.2.0.RELEASE" + const val sql2o = "1.6.0" + const val substance = "8.0.02" + const val trident = "1.5.00" + } + + const val annotations = "org.jetbrains:annotations:${Versions.annotations}" + const val antlr = "org.antlr:antlr4-runtime:${Versions.antlr}" + const val apacheCommonsCompress = "org.apache.commons:commons-compress:${Versions.apacheCommonsCompress}" + const val apacheCommonsCsv = "org.apache.commons:commons-csv:${Versions.apacheCommonsCsv}" + const val apacheCommonsText = "org.apache.commons:commons-text:${Versions.apacheCommonsText}" + const val asmAll = "org.ow2.asm:asm:${Versions.asm}" + const val asmUtil = "org.ow2.asm:asm-util:${Versions.asm}" + const val asmTree = "org.ow2.asm:asm-tree:${Versions.asm}" + const val commonsCli = "commons-cli:commons-cli:${Versions.commonsCli}" + const val discord = "net.runelite:discord:${Versions.discord}" + const val fernflower = "net.runelite:fernflower:${Versions.fernflower}" + const val findbugs = "com.google.code.findbugs:jsr305:${Versions.findbugs}" + const val gson = "com.google.code.gson:gson:${Versions.gson}" + const val guava = "com.google.guava:guava:${Versions.guava}" + const val guice = "com.google.inject:guice:${Versions.guice}:no_aop" + const val guiceGrapher = "com.google.inject.extensions:guice-grapher:${Versions.guice}" + const val guiceTestlib = "com.google.inject.extensions:guice-testlib:${Versions.guice}" + const val h2 = "com.h2database:h2:${Versions.h2}" + const val hamcrest = "org.hamcrest:hamcrest-library:${Versions.hamcrest}" + const val httpcore = "org.apache.httpcomponents:httpcore:${Versions.httpcore}" + const val httpmime = "org.apache.httpcomponents:httpmime:${Versions.httpmime}" + const val javassist = "org.javassist:javassist:${Versions.javassist}" + const val javax = "javax.annotation:javax.annotation-api:${Versions.javax}" + const val javaxInject = "javax.inject:javax.inject:${Versions.javaxInject}" + const val jbsdiff = "io.sigpipe:jbsdiff:${Versions.jbsdiff}" + const val jclCore = "org.xeustechnologies:jcl-core:${Versions.jclCore}" + const val jedis = "redis.clients:jedis:${Versions.jedis}" + const val jna = "net.java.dev.jna:jna:${Versions.jna}" + const val jnaPlatform = "net.java.dev.jna:jna-platform:${Versions.jna}" + const val jogampJogl = "org.jogamp.jogl:jogl-all:${Versions.jogamp}" + const val jogampGluegen = "org.jogamp.gluegen:gluegen-rt:${Versions.jogamp}" + const val jogampGluegenLinuxAmd64 = "org.jogamp.gluegen:gluegen-rt:${Versions.jogamp}:natives-linux-amd64" + const val jogampGluegenLinuxI586 = "org.jogamp.gluegen:gluegen-rt:${Versions.jogamp}:natives-linux-i586" + const val jogampGluegenWindowsAmd64 = "org.jogamp.gluegen:gluegen-rt:${Versions.jogamp}:natives-windows-amd64" + const val jogampGluegenWindowsI586 = "org.jogamp.gluegen:gluegen-rt:${Versions.jogamp}:natives-windows-i586" + const val jogampJoglLinuxAmd64 = "org.jogamp.jogl:jogl-all:${Versions.jogamp}:natives-linux-amd64" + const val jogampJoglLinuxI586 = "org.jogamp.jogl:jogl-all:${Versions.jogamp}:natives-linux-i586" + const val jogampJoglWindowsAmd64 = "org.jogamp.jogl:jogl-all:${Versions.jogamp}:natives-windows-amd64" + const val jogampJoglWindowsI586 = "org.jogamp.jogl:jogl-all:${Versions.jogamp}:natives-windows-i586" + const val jopt = "net.sf.jopt-simple:jopt-simple:${Versions.jopt}" + const val jooq = "org.jooq:jooq:${Versions.jooq}" + const val jooqCodegen = "org.jooq:jooq-codegen:${Versions.jooq}" + const val jooqMeta = "org.jooq:jooq-meta:${Versions.jooq}" + const val junit = "junit:junit:${Versions.junit}" + const val jupiter = "org.junit.jupiter:junit-jupiter-api:${Versions.jupiter}" + const val logback = "ch.qos.logback:logback-classic:${Versions.logback}" + const val lombok = "org.projectlombok:lombok:${Versions.lombok}" + const val mapstruct = "org.mapstruct:mapstruct-jdk8:${Versions.mapstruct}" + const val mapstructProcessor = "org.mapstruct:mapstruct-processor:${Versions.mapstruct}" + const val mariadbJdbc = "org.mariadb.jdbc:mariadb-java-client:${Versions.mariadbJdbc}" + const val mavenPluginAnnotations = "org.apache.maven.plugin-tools:maven-plugin-annotations:${Versions.mavenPluginAnnotations}" + const val mavenPluginApi = "org.apache.maven:maven-plugin-api:${Versions.mavenPluginApi}" + const val minio = "io.minio:minio:${Versions.minio}" + const val mockitoCore = "org.mockito:mockito-core:${Versions.mockito}" + const val mockitoInline = "org.mockito:mockito-inline:${Versions.mockito}" + const val mongodbDriverSync = "org.mongodb:mongodb-driver-sync:${Versions.mongodbDriverSync}" + const val mysqlConnectorJava = "mysql:mysql-connector-java:${Versions.mysqlConnectorJava}" + const val naturalMouse = "com.github.joonasvali.naturalmouse:naturalmouse:${Versions.naturalMouse}" + const val nettyAll = "io.netty:netty-all:${Versions.netty}" + const val nettyBuffer = "io.netty:netty-buffer:${Versions.netty}" + const val okhttp3 = "com.squareup.okhttp3:okhttp:${Versions.okhttp3}" + const val okhttp3Webserver = "com.squareup.okhttp3:mockwebserver:${Versions.okhttp3}" + const val orangeExtensions = "net.runelite:orange-extensions:${Versions.orangeExtensions}" + const val petitparser = "com.github.petitparser:java-petitparser:${Versions.petitparser}" + const val plexus = "org.codehaus.plexus:plexus-utils:${Versions.plexus}" + const val rxjava = "io.reactivex.rxjava2:rxjava:${Versions.rxjava}" + const val rxrelay = "com.jakewharton.rxrelay2:rxrelay:${Versions.rxrelay}" + const val scribejava = "com.github.scribejava:scribejava-apis:${Versions.scribejava}" + const val sisu = "org.eclipse.sisu:org.eclipse.sisu.inject:${Versions.sisu}" + const val slf4jApi = "org.slf4j:slf4j-api:${Versions.slf4j}" + const val slf4jNop = "org.slf4j:slf4j-nop:${Versions.slf4j}" + const val slf4jSimple = "org.slf4j:slf4j-simple:${Versions.slf4j}" + const val springbootDevtools = "org.springframework.boot:spring-boot-devtools:${Versions.springboot}" + const val springbootStarter = "org.springframework.boot:spring-boot-starter:${Versions.springboot}" + const val springbootStarterWeb = "org.springframework.boot:spring-boot-starter-web:${Versions.springboot}" + const val springbootStarterJdbc = "org.springframework.boot:spring-boot-starter-jdbc:${Versions.springboot}" + const val springbootStarterTest = "org.springframework.boot:spring-boot-starter-test:${Versions.springboot}" + const val springbootStarterTomcat = "org.springframework.boot:spring-boot-starter-tomcat:${Versions.springboot}" + const val springbootJdbc = "org.springframework:spring-jdbc:${Versions.springJdbc}" + const val sql2o = "org.sql2o:sql2o:${Versions.sql2o}" + const val substance = "net.runelite.pushingpixels:substance:${Versions.substance}" + const val trident = "net.runelite.pushingpixels:trident:${Versions.trident}" + const val vanilla = "net.runelite.rs:vanilla:${ProjectVersions.rsversion}" +} \ No newline at end of file diff --git a/buildSrc/src/main/kotlin/FernflowerPlugin.kt b/buildSrc/src/main/kotlin/FernflowerPlugin.kt new file mode 100644 index 0000000000..36c5778d04 --- /dev/null +++ b/buildSrc/src/main/kotlin/FernflowerPlugin.kt @@ -0,0 +1,17 @@ +import org.gradle.api.Plugin +import org.gradle.api.Project +import org.gradle.api.tasks.StopExecutionException + +class FernflowerPlugin : Plugin { + override fun apply(project: Project) { + project.tasks.create("decompile", FernflowerTask::class.java).run { + dependsOn(project.tasks.getByName("jar")) + + doFirst { + if (!project.tasks.getByName("jar").didWork) { + throw StopExecutionException() + } + } + } + } +} \ No newline at end of file diff --git a/buildSrc/src/main/kotlin/FernflowerTask.kt b/buildSrc/src/main/kotlin/FernflowerTask.kt new file mode 100644 index 0000000000..3dbb2ba995 --- /dev/null +++ b/buildSrc/src/main/kotlin/FernflowerTask.kt @@ -0,0 +1,30 @@ +import org.gradle.api.DefaultTask +import org.gradle.api.tasks.TaskAction +import org.jetbrains.java.decompiler.main.decompiler.ConsoleDecompiler +import java.io.File + +open class FernflowerTask: DefaultTask() { + + var extraArgs: List? = null + var inputJar: String? = null + var outputDir: String? = null + + fun getInputJar(): File { + return project.file(inputJar ?: project.buildDir.toString() + "/libs/" + project.name + '-' + project.version + ".jar") + } + + fun getOutputDir(): File { + return project.file(outputDir ?: project.buildDir.toString() + "/decompiled-sources") + } + + @TaskAction + fun decompile() { + getOutputDir().mkdirs() + val args = mutableListOf(getInputJar().toString(), getOutputDir().toString()) + if (extraArgs != null) { + args.addAll(extraArgs!!) + } + + ConsoleDecompiler.main(args.toTypedArray()) + } +} \ No newline at end of file diff --git a/buildSrc/src/main/resources/META-INF/gradle-plugins/fernflower.properties b/buildSrc/src/main/resources/META-INF/gradle-plugins/fernflower.properties index 3d922df9d7..6b2628a4c7 100644 --- a/buildSrc/src/main/resources/META-INF/gradle-plugins/fernflower.properties +++ b/buildSrc/src/main/resources/META-INF/gradle-plugins/fernflower.properties @@ -1 +1 @@ -implementation-class=FernflowerPlugin \ No newline at end of file +implementation-class=kt \ No newline at end of file diff --git a/cache-client/build.gradle b/cache-client/build.gradle deleted file mode 100644 index feed79e98e..0000000000 --- a/cache-client/build.gradle +++ /dev/null @@ -1,28 +0,0 @@ -description = 'Cache Client' - -dependencies { - api project(':cache') - api project(':protocol') - - implementation group: 'com.google.guava', name: 'guava', version: guava - implementation group: 'io.netty', name: 'netty-all', version: netty - implementation group: 'org.slf4j', name: 'slf4j-api', version: slf4j - - testImplementation group: 'junit', name: 'junit', version: junit - testImplementation group: 'org.slf4j', name: 'slf4j-simple', version: slf4j - testImplementation project(path: ':cache', configuration: 'testArchives') -} - -task update { - dependsOn ":cache-client:build" - - doLast { - def path = sourceSets.main.runtimeClasspath - def loader = new URLClassLoader(path.collect { f -> f.toURI().toURL() } as URL[]) - def cacheClient = loader.loadClass('net.runelite.cache.client.CacheClient') - - cacheClient.getCache(rsversion); - - loader.close() - } -} diff --git a/cache-client/cache-client.gradle.kts b/cache-client/cache-client.gradle.kts new file mode 100644 index 0000000000..8b96c87357 --- /dev/null +++ b/cache-client/cache-client.gradle.kts @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2019 Owain van Brakel + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +description = "Cache Client" + +dependencies { + api(project(":cache")) + api(project(":protocol")) + + implementation(Libraries.guava) + implementation(Libraries.nettyAll) + implementation(Libraries.slf4jApi) + + testImplementation(Libraries.junit) + testImplementation(Libraries.slf4jSimple) + testImplementation(project(path = ":cache", configuration = "testArchives")) +} + +tasks { + register("download") { + dependsOn("copyVanilla") + + classpath = project.sourceSets.main.get().runtimeClasspath + main = "net.runelite.cache.client.CacheClient" + args(listOf(ProjectVersions.rsversion)) + } +} diff --git a/cache-client/src/main/java/net/runelite/cache/client/CacheClient.java b/cache-client/src/main/java/net/runelite/cache/client/CacheClient.java index a8afe8b82d..956905f539 100644 --- a/cache-client/src/main/java/net/runelite/cache/client/CacheClient.java +++ b/cache-client/src/main/java/net/runelite/cache/client/CacheClient.java @@ -85,7 +85,7 @@ public class CacheClient implements AutoCloseable private CompletableFuture handshakeFuture; private final Queue requests = new ArrayDeque<>(); - public static void getCache(int clientRevision) + public static void main(String[] args) { Path path = Paths.get(System.getProperty("user.home"), "jagexcache" + File.separator + "oldschool" + File.separator + "LIVE"); final File jagexcache = new File(String.valueOf(path)); @@ -95,7 +95,7 @@ public class CacheClient implements AutoCloseable try (Store store = new Store(jagexcache)) { store.load(); - CacheClient c = new CacheClient(store, clientRevision); + CacheClient c = new CacheClient(store, Integer.parseInt(args[0])); c.connect(); CompletableFuture handshake = c.handshake(); handshake.get(); diff --git a/cache-updater/build.gradle b/cache-updater/build.gradle deleted file mode 100644 index ec821898e7..0000000000 --- a/cache-updater/build.gradle +++ /dev/null @@ -1,15 +0,0 @@ -description = 'Cache Updater' - -dependencies { - annotationProcessor group: 'org.projectlombok', name: 'lombok', version: lombok - - compileOnly group: 'org.projectlombok', name: 'lombok', version: lombok - - implementation group: 'io.minio', name: 'minio', version: minio - implementation group: 'mysql', name: 'mysql-connector-java', version: mysqlConnectorJava - implementation group: 'org.springframework.boot', name: 'spring-boot-devtools', version: springboot - implementation group: 'org.springframework.boot', name: 'spring-boot-starter', version: springboot - implementation group: 'org.springframework.boot', name: 'spring-boot-starter-jdbc', version: springboot - implementation group: 'org.sql2o', name: 'sql2o', version: sql2o - implementation project(':cache-client') -} diff --git a/cache-updater/cache-updater.gradle.kts b/cache-updater/cache-updater.gradle.kts new file mode 100644 index 0000000000..2007258401 --- /dev/null +++ b/cache-updater/cache-updater.gradle.kts @@ -0,0 +1,40 @@ +/* + * Copyright (c) 2019 Owain van Brakel + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +description = "Cache Updater" + +dependencies { + annotationProcessor(Libraries.lombok) + + compileOnly(Libraries.lombok) + + implementation(Libraries.minio) + implementation(Libraries.mysqlConnectorJava) + implementation(Libraries.springbootDevtools) + implementation(Libraries.springbootStarter) + implementation(Libraries.springbootStarterJdbc) + implementation(Libraries.sql2o) + implementation(project(":cache-client")) +} diff --git a/cache/build.gradle b/cache/build.gradle deleted file mode 100644 index 3221972040..0000000000 --- a/cache/build.gradle +++ /dev/null @@ -1,36 +0,0 @@ -import org.apache.tools.ant.filters.ReplaceTokens - -plugins { - id "com.github.hauner.jarTest" version "1.0.1" -} - -description = 'Cache' - -dependencies { - annotationProcessor group: 'org.projectlombok', name: 'lombok', version: lombok - - api project(':http-api') - - compileOnly group: 'org.projectlombok', name: 'lombok', version: lombok - - implementation group: 'com.google.code.gson', name: 'gson', version: gson - implementation group: 'com.google.guava', name: 'guava', version: guava - implementation group: 'commons-cli', name: 'commons-cli', version: commonsCli - implementation group: 'io.netty', name: 'netty-buffer', version: netty - implementation group: 'org.antlr', name: 'antlr4-runtime', version: antlr - implementation group: 'org.apache.commons', name: 'commons-compress', version: apacheCommonsCompress - implementation group: 'org.slf4j', name: 'slf4j-api', version: slf4j - - testImplementation group: 'junit', name: 'junit', version: junit - testImplementation group: 'net.runelite.rs', name: 'cache', version: cacheversion - testImplementation group: 'org.slf4j', name: 'slf4j-simple', version: slf4j -} - -processTestResources { - from file("src/test/resources/cache.properties"), { - filter(ReplaceTokens, tokens: [ - "rs.version": rsversion.toString(), - "cache.version": cacheversion.toString() - ]) - } -} diff --git a/cache/cache.gradle.kts b/cache/cache.gradle.kts new file mode 100644 index 0000000000..e85a59a7d8 --- /dev/null +++ b/cache/cache.gradle.kts @@ -0,0 +1,69 @@ +/* + * Copyright (c) 2019 Owain van Brakel + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +import org.apache.tools.ant.filters.ReplaceTokens + +plugins { + id(Plugins.jarTest.first) version Plugins.jarTest.second +} + +description = "Cache" + +dependencies { + annotationProcessor(Libraries.lombok) + + api(project(":http-api")) + + compileOnly(Libraries.lombok) + + implementation(Libraries.gson) + implementation(Libraries.guava) + implementation(Libraries.commonsCli) + implementation(Libraries.nettyBuffer) + implementation(Libraries.antlr) + implementation(Libraries.apacheCommonsCompress) + implementation(Libraries.slf4jApi) + + testImplementation(Libraries.junit) + testImplementation(group = "net.runelite.rs", name = "cache", version = "${ProjectVersions.cacheversion}") + testImplementation(Libraries.slf4jSimple) +} + +tasks { + "processTestResources"(ProcessResources::class) { + val tokens = mapOf( + "rs.version" to ProjectVersions.rsversion.toString(), + "cache.version" to ProjectVersions.cacheversion.toString() + ) + + inputs.properties(tokens) + + from("src/test/resources") { + include("cache.properties") + + filter("tokens" to tokens) + } + } +} diff --git a/deobfuscator/build.gradle b/deobfuscator/build.gradle deleted file mode 100644 index 0d61c904d6..0000000000 --- a/deobfuscator/build.gradle +++ /dev/null @@ -1,117 +0,0 @@ -import org.apache.tools.ant.filters.ReplaceTokens -import org.jetbrains.java.decompiler.main.decompiler.ConsoleDecompiler -import java.nio.file.Files -import java.nio.file.Paths -import java.util.zip.ZipFile - -plugins { - id "com.github.hauner.jarTest" version "1.0.1" -} - -description = 'Deobfuscator' - -def deobfuscatedJar = "${rootPath}/runescape-client/build/libs/rs-client-${project.version}.jar" - -def unzipFile(String file, String dest) -{ - def zipFile = new ZipFile(file) - - zipFile.entries().each { it -> - def path = Paths.get(dest + File.separator + it.name) - if (it.directory) - { - Files.createDirectories(path) - } - else - { - def parentDir = path.getParent() - if (!Files.exists(parentDir)) - { - Files.createDirectories(parentDir) - } - Files.copy(zipFile.getInputStream(it), path) - } - } -} - -configurations { - deobjars -} - -dependencies { - deobjars group: 'net.runelite.rs', name: 'vanilla', version: rsversion - deobjars project(':rs-client') - - implementation group: 'com.google.code.gson', name: 'gson', version: gson - implementation group: 'com.google.guava', name: 'guava', version: guava - implementation group: 'net.runelite', name: 'fernflower', version: fernflower - implementation group: 'org.ow2.asm', name: 'asm', version: asm - implementation group: 'org.ow2.asm', name: 'asm-util', version: asm - implementation group: 'org.slf4j', name: 'slf4j-api', version: slf4j - implementation project(':runelite-api') - implementation project(':runescape-api') - - runtime group: 'org.slf4j', name: 'slf4j-simple', version: slf4j - - testImplementation configurations.deobjars.dependencies - testImplementation group: 'junit', name: 'junit', version: junit - testImplementation group: 'org.mockito', name: 'mockito-core', version: mockito -} - -processResources { - from file("src/main/resources/deob.properties"), { - filter(ReplaceTokens, tokens: [ - "rs.version": rsversion.toString(), - "vanilla.jar": configurations.deobjars.find {it.name.startsWith("vanilla")}.toString().replace('\\', "/"), - "rs.client": configurations.deobjars.find {it.name.startsWith("rs-client")}.toString().replace('\\', "/") - ]) - } -} -processTestResources { - from file("src/test/resources/deob-test.properties"), { - filter(ReplaceTokens, tokens: [ - "rs.client": configurations.deobjars.find {it.name.startsWith("rs-client")}.toString().replace('\\', "/"), - "rs.version": rsversion.toString(), - "vanilla.jar": configurations.deobjars.find {it.name.startsWith("vanilla")}.toString().replace('\\', "/") - ]) - } -} - -task gamepackUpdate { - dependsOn ":deobfuscator:build" - dependsOn ":rs-client:build" - - doLast { - def path = sourceSets.main.runtimeClasspath - def loader = new URLClassLoader(path.collect { f -> f.toURI().toURL() } as URL[]) - def downloader = loader.loadClass('net.runelite.gamepack.Downloader') - def clientVersion = loader.loadClass('net.runelite.deob.clientver.ClientVersionMain') - def deob = loader.loadClass('net.runelite.deob.Deob') - def mappings = loader.loadClass('net.runelite.deob.updater.UpdateMappings') - - String gamepack = downloader.gamepack() - int version = clientVersion.version(gamepack) - - String gamepackVersion = gamepack.replace("gamepack.jar", "gamepack-" + version + ".jar") - String gamepackDeob = gamepack.replace("gamepack.jar", "gamepack-" + version + "-deob.jar") - String gamepackMappings = gamepack.replace("gamepack.jar", "gamepack-" + version + "-updated-mappings.jar") - String gamepackMappingsDecomp = gamepackMappings.replace(".jar", "-decomp") - String gamepackMappingsFern = gamepackMappingsDecomp + File.separator + gamepackMappings.split("/gamepack/")[1] - - if (version == -1 || version == rsversion) - { - return - } - - deob.main(gamepackVersion, gamepackDeob) - mappings.main(deobfuscatedJar, gamepackDeob, gamepackMappings) - - new File(gamepackMappingsDecomp).mkdirs() - ConsoleDecompiler.main(gamepackMappings, gamepackMappingsDecomp) - - unzipFile(gamepackMappingsFern, gamepackMappingsDecomp) - new File(gamepackMappingsFern).delete() - - loader.close() - } -} diff --git a/deobfuscator/deobfuscator.gradle.kts b/deobfuscator/deobfuscator.gradle.kts new file mode 100644 index 0000000000..c818fa5808 --- /dev/null +++ b/deobfuscator/deobfuscator.gradle.kts @@ -0,0 +1,80 @@ +/* + * Copyright (c) 2019 Owain van Brakel + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +import org.apache.tools.ant.filters.ReplaceTokens + +plugins { + id(Plugins.jarTest.first) version Plugins.jarTest.second +} + +val deobjars = configurations.create("deobjars") + +dependencies { + deobjars(group = "net.runelite.rs", name = "vanilla", version = ProjectVersions.rsversion.toString()) + deobjars(project(":runescape-client")) + + implementation(Libraries.gson) + implementation(Libraries.guava) + implementation(Libraries.fernflower) + implementation(Libraries.asmAll) + implementation(Libraries.asmUtil) + implementation(Libraries.slf4jApi) + implementation(project(":runelite-api")) + implementation(project(":runescape-api")) + + runtime(Libraries.slf4jSimple) + + testImplementation(deobjars) + testImplementation(Libraries.junit) + testImplementation(Libraries.mockitoCore) +} + +tasks { + val tokens = mapOf( + "rs.version" to ProjectVersions.rsversion.toString(), + "vanilla.jar" to deobjars.find { it.name.startsWith("vanilla") }.toString().replace("\\", "/"), + "rs.client" to deobjars.find { it.name.startsWith("runescape-client") }.toString().replace("\\", "/") + ) + + "processResources"(ProcessResources::class) { + inputs.properties(tokens) + + from("src/main/resources") { + include("deob.properties") + + filter("tokens" to tokens) + } + } + + "processTestResources"(ProcessResources::class) { + inputs.properties(tokens) + + from("src/test/resources") { + include("deob-test.properties") + + filter("tokens" to tokens) + } + } +} diff --git a/http-api/build.gradle b/http-api/build.gradle deleted file mode 100644 index a191f21f61..0000000000 --- a/http-api/build.gradle +++ /dev/null @@ -1,33 +0,0 @@ -import org.apache.tools.ant.filters.ReplaceTokens - -description = 'Web API' - -dependencies { - annotationProcessor group: 'org.projectlombok', name: 'lombok', version: lombok - - compileOnly group: 'javax.inject', name: 'javax.inject', version: javaxInject - compileOnly group: 'org.projectlombok', name: 'lombok', version: lombok - - implementation group: 'com.google.code.gson', name: 'gson', version: gson - implementation group: 'com.google.guava', name: 'guava', version: guava - implementation group: 'com.squareup.okhttp3', name: 'okhttp', version: okhttp3 - implementation group: 'io.reactivex.rxjava2', name: 'rxjava', version: rxjava - implementation group: 'org.apache.commons', name: 'commons-csv', version: apacheCommonsCsv - implementation group: 'org.slf4j', name: 'slf4j-api', version: slf4j - implementation project(':runelite-api') - - testImplementation group: 'com.squareup.okhttp3', name: 'mockwebserver', version: okhttp3 - testImplementation group: 'junit', name: 'junit', version: junit - testImplementation group: 'org.slf4j', name: 'slf4j-simple', version: slf4j -} - -processResources { - from file("src/main/resources/runelite.properties"), { - filter(ReplaceTokens, tokens: [ - "projectver": project.version, - "rsver": rsversion.toString(), - "gitcommit": gitCommitShort, - "gitdirty": gitDirty.toString() - ]) - } -} diff --git a/http-api/http-api.gradle.kts b/http-api/http-api.gradle.kts new file mode 100644 index 0000000000..9f5dfac4af --- /dev/null +++ b/http-api/http-api.gradle.kts @@ -0,0 +1,65 @@ +/* + * Copyright (c) 2019 Owain van Brakel + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +import org.apache.tools.ant.filters.ReplaceTokens + +description = "Web API" + +dependencies { + annotationProcessor(Libraries.lombok) + + compileOnly(Libraries.javaxInject) + compileOnly(Libraries.lombok) + + implementation(Libraries.gson) + implementation(Libraries.guava) + implementation(Libraries.okhttp3) + implementation(Libraries.rxjava) + implementation(Libraries.apacheCommonsCsv) + implementation(Libraries.slf4jApi) + implementation(project(":runelite-api")) + + testImplementation(Libraries.okhttp3Webserver) + testImplementation(Libraries.junit) + testImplementation(Libraries.slf4jSimple) +} + +tasks { + "processResources"(ProcessResources::class) { + val tokens = mapOf( + "projectver" to ProjectVersions.rlVersion, + "rsver" to ProjectVersions.rsversion.toString(), + "gitcommit" to project.extra["gitCommit"] + ) + + inputs.properties(tokens) + + from("src/main/resources") { + include("runelite.properties") + + filter("tokens" to tokens) + } + } +} diff --git a/http-api/src/main/resources/runelite.properties b/http-api/src/main/resources/runelite.properties index 7eb618db7a..9464b52906 100644 --- a/http-api/src/main/resources/runelite.properties +++ b/http-api/src/main/resources/runelite.properties @@ -1,4 +1,3 @@ runelite.version=@projectver@ rs.version=@rsver@ -runelite.commit=@gitcommit@ -runelite.dirty=@gitdirty@ \ No newline at end of file +runelite.commit=@gitcommit@ \ No newline at end of file diff --git a/http-service-openosrs/build.gradle b/http-service-openosrs/build.gradle deleted file mode 100644 index 1aee171338..0000000000 --- a/http-service-openosrs/build.gradle +++ /dev/null @@ -1,26 +0,0 @@ -apply plugin: 'war' - -description = 'Web Service OpenOSRS' - -dependencies { - annotationProcessor group: 'org.projectlombok', name: 'lombok', version: lombok - - api project(':cache') - api project(':http-api') - api project(':http-service') - - implementation group: 'com.google.code.gson', name: 'gson', version: gson - implementation group: 'com.google.guava', name: 'guava', version: guava - implementation group: 'com.squareup.okhttp3', name: 'okhttp', version: okhttp3 - implementation group: 'org.springframework', name: 'spring-jdbc', version: springJdbc - implementation group: 'org.springframework.boot', name: 'spring-boot-devtools', version: springboot - implementation group: 'org.springframework.boot', name: 'spring-boot-starter-web', version: springboot - implementation group: 'org.sql2o', name: 'sql2o', version: sql2o - implementation(group: 'redis.clients', name: 'jedis', version: jedis) { - exclude(module: 'commons-pool2') - } - - providedCompile group: 'org.mariadb.jdbc', name: 'mariadb-java-client', version: mariadbJdbc - providedCompile group: 'org.projectlombok', name: 'lombok', version: lombok - providedCompile group: 'org.springframework.boot', name: 'spring-boot-starter-tomcat', version: springboot -} diff --git a/http-service-openosrs/http-service-openosrs.gradle.kts b/http-service-openosrs/http-service-openosrs.gradle.kts new file mode 100644 index 0000000000..6bf4f040ac --- /dev/null +++ b/http-service-openosrs/http-service-openosrs.gradle.kts @@ -0,0 +1,53 @@ +/* + * Copyright (c) 2019 Owain van Brakel + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +plugins { + war +} + +description = "Web Service OpenOSRS" + +dependencies { + annotationProcessor(Libraries.lombok) + + api(project(":cache")) + api(project(":http-api")) + api(project(":http-service")) + + implementation(Libraries.gson) + implementation(Libraries.guava) + implementation(Libraries.okhttp3) + implementation(Libraries.springbootJdbc) + implementation(Libraries.springbootDevtools) + implementation(Libraries.springbootStarterWeb) + implementation(Libraries.sql2o) + implementation(Libraries.jedis) { + exclude(module = "commons-pool2") + } + + providedCompile(Libraries.mariadbJdbc) + providedCompile(Libraries.lombok) + providedCompile(Libraries.springbootStarterTomcat) +} diff --git a/http-service/build.gradle b/http-service/build.gradle deleted file mode 100644 index 831fb94d45..0000000000 --- a/http-service/build.gradle +++ /dev/null @@ -1,37 +0,0 @@ -apply plugin: 'war' - -description = 'Web Service' - -dependencies { - annotationProcessor group: 'org.mapstruct', name: 'mapstruct-processor', version: mapstruct - annotationProcessor group: 'org.projectlombok', name: 'lombok', version: lombok - - api project(':cache') - api project(':http-api') - api project(':runelite-api') - - implementation group: 'com.github.scribejava', name: 'scribejava-apis', version: scribejava - implementation group: 'com.google.code.gson', name: 'gson', version: gson - implementation group: 'com.google.guava', name: 'guava', version: guava - implementation group: 'io.minio', name: 'minio', version: minio - implementation group: 'org.mapstruct', name: 'mapstruct-jdk8', version: mapstruct - implementation group: 'org.mongodb', name: 'mongodb-driver-sync', version: mongodbDriverSync - implementation group: 'org.slf4j', name: 'slf4j-api', version: slf4j - implementation group: 'org.springframework', name: 'spring-jdbc', version: springJdbc - implementation group: 'org.springframework.boot', name: 'spring-boot-devtools', version: springboot - implementation group: 'org.springframework.boot', name: 'spring-boot-starter-web', version: springboot - implementation group: 'org.sql2o', name: 'sql2o', version: sql2o - implementation(group: 'redis.clients', name: 'jedis', version: jedis) { - exclude(module: 'commons-pool2') - } - - providedCompile group: 'org.mariadb.jdbc', name: 'mariadb-java-client', version: mariadbJdbc - providedCompile group: 'org.projectlombok', name: 'lombok', version: lombok - providedCompile group: 'org.springframework.boot', name: 'spring-boot-starter-tomcat', version: springboot - - testImplementation group: 'com.h2database', name: 'h2', version: '1.4.200' - testImplementation group: 'com.squareup.okhttp3', name: 'mockwebserver', version: okhttp3 - testImplementation(group: 'org.springframework.boot', name: 'spring-boot-starter-test', version: springboot) { - exclude(module: 'commons-logging') - } -} diff --git a/http-service/http-service.gradle.kts b/http-service/http-service.gradle.kts new file mode 100644 index 0000000000..6eaf8c53a3 --- /dev/null +++ b/http-service/http-service.gradle.kts @@ -0,0 +1,64 @@ +/* + * Copyright (c) 2019 Owain van Brakel + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +plugins { + war +} + +description = "Web Service" + +dependencies { + annotationProcessor(Libraries.mapstructProcessor) + annotationProcessor(Libraries.lombok) + + api(project(":cache")) + api(project(":http-api")) + api(project(":runelite-api")) + + implementation(Libraries.scribejava) + implementation(Libraries.gson) + implementation(Libraries.guava) + implementation(Libraries.minio) + implementation(Libraries.mapstruct) + implementation(Libraries.mongodbDriverSync) + implementation(Libraries.slf4jApi) + implementation(Libraries.springbootJdbc) + implementation(Libraries.springbootDevtools) + implementation(Libraries.springbootStarterWeb) + implementation(Libraries.sql2o) + implementation(Libraries.jedis) { + exclude(module = "commons-pool2") + } + + providedCompile(Libraries.mariadbJdbc) + providedCompile(Libraries.lombok) + providedCompile(Libraries.springbootStarterTomcat) + + testImplementation(Libraries.h2) + testImplementation(Libraries.okhttp3Webserver) + testImplementation(Libraries.springbootStarterTest) { + exclude(module = "commons-logging") + } +} diff --git a/injected-client/injected-client.gradle.kts b/injected-client/injected-client.gradle.kts new file mode 100644 index 0000000000..a736dab534 --- /dev/null +++ b/injected-client/injected-client.gradle.kts @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2019 ThatGamerBlue + * Copyright (c) 2019 Owain van Brakel + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +description = "Injected Client" + +tasks { + compileJava { + dependsOn(":injector-plugin:assemble") + + outputs.upToDateWhen { false } + + doLast { + copy { + val f = file ("build/classes/java/main") + f.deleteRecursively() + f.mkdirs() + from(project.extra["injectedClassesPath"]) + into("build/classes/java/main") + } + } + } + + classes { + val f = file("build/classes/java/main/Placeholder.class") + f.delete() + } + + // this is just here to show how the fernflower plugin could be used + //build { + // dependsOn(project.tasks.getByName("decompile")) + //} +} \ No newline at end of file diff --git a/injector-plugin/build.gradle b/injector-plugin/build.gradle deleted file mode 100644 index 13e3f2555e..0000000000 --- a/injector-plugin/build.gradle +++ /dev/null @@ -1,63 +0,0 @@ -group = 'us.runelitepl.rs' -description = 'Injector' - -def buildPath = buildDir.toString().replace('\\', '/') // this doesnt work in an ext block for some reason -def deobfuscatedJar = "${rootPath}/runescape-client/build/libs/rs-client-${project.version}.jar" -def vanillaJar = "${buildPath}/vanilla-${rsversion}.jar" - -configurations { - vanilla -} - -dependencies { - annotationProcessor group: 'org.eclipse.sisu', name: 'org.eclipse.sisu.inject', version: sisu - - compileOnly group: 'org.apache.maven.plugin-tools', name: 'maven-plugin-annotations', version: mavenPluginAnnotations - - implementation group: 'com.google.guava', name: 'guava', version: guava - implementation group: 'org.apache.maven', name: 'maven-plugin-api', version: mavenPluginApi - implementation group: 'org.ow2.asm', name: 'asm', version: asm - implementation group: 'org.ow2.asm', name: 'asm-util', version: asm - implementation project(':deobfuscator') - implementation project(':mixins') - implementation project(':runelite-api') - implementation project(':runescape-api') - - testImplementation group: 'junit', name: 'junit', version: junit - testImplementation group: 'org.mockito', name: 'mockito-core', version: mockito - testImplementation project(':deobfuscator') - testImplementation project(path: ':deobfuscator', configuration: 'testArchives') - - vanilla "net.runelite.rs:vanilla:${rsversion}" -} - -compileJava { - dependsOn ":rs-client:build" - - inputs.dir("${project.rootDir}/runescape-client/") - inputs.dir("${project.rootDir}/runescape-api/") - inputs.dir("${project.rootDir}/runelite-mixins/") -} - -compileJava.doLast() { - copy { - from configurations.vanilla - into "$buildDir" - } - def path = sourceSets.main.runtimeClasspath - def loader - try { - loader = new URLClassLoader(path.collect { f -> f.toURI().toURL() } as URL[]) - def inject = loader.loadClass('net.runelite.injector.Injector') - String[] jarPaths = [ - deobfuscatedJar.toString(), - vanillaJar.toString(), - injectedClassesPath.toString() - ] - inject.main(jarPaths) - } finally { - if (loader) { - loader.close() - } - } -} diff --git a/injector-plugin/injector-plugin.gradle.kts b/injector-plugin/injector-plugin.gradle.kts new file mode 100644 index 0000000000..97d3974575 --- /dev/null +++ b/injector-plugin/injector-plugin.gradle.kts @@ -0,0 +1,83 @@ +/* + * Copyright (c) 2019 Owain van Brakel + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +group = "com.openosrs.rs" +description = "Injector" + +val deobfuscatedJar = "${project.extra["rootPath"]}/runescape-client/build/libs/runescape-client-${ProjectVersions.rlVersion}.jar" +val vanillaJar = "${buildDir}/vanilla-${ProjectVersions.rsversion}.jar" + +val vanilla = configurations.create("vanilla") + +dependencies { + annotationProcessor(Libraries.sisu) + + compileOnly(Libraries.mavenPluginAnnotations) + + implementation(Libraries.guava) + implementation(Libraries.mavenPluginApi) + implementation(Libraries.asmAll) + implementation(Libraries.asmUtil) + implementation(project(":deobfuscator")) + implementation(project(":runelite-mixins")) + implementation(project(":runelite-api")) + implementation(project(":runescape-api")) + + testImplementation(Libraries.junit) + testImplementation(Libraries.mockitoCore) + testImplementation(project(":deobfuscator")) + testImplementation(project(path = ":deobfuscator", configuration = "testArchives")) + + vanilla(Libraries.vanilla) +} + +tasks { + register("copyVanilla") { + copy { + from(configurations.get("vanilla")) + into("$buildDir") + } + } + + register("inject") { + dependsOn("copyVanilla") + + classpath = project.sourceSets.main.get().runtimeClasspath + main = "net.runelite.injector.Injector" + args(listOf(deobfuscatedJar, vanillaJar, project.extra["injectedClassesPath"])) + } + + compileJava { + dependsOn(":runescape-client:build") + + inputs.dir(project(":runescape-client").projectDir.absolutePath) + inputs.dir(project(":runescape-api").projectDir.absolutePath) + inputs.dir(project(":runelite-mixins").projectDir.absolutePath) + } + + jar { + dependsOn("inject") + } +} diff --git a/protocol-api/build.gradle b/protocol-api/build.gradle deleted file mode 100644 index 8169e3e904..0000000000 --- a/protocol-api/build.gradle +++ /dev/null @@ -1,13 +0,0 @@ -description = 'Protocol API' - -dependencies { - annotationProcessor group: 'org.projectlombok', name: 'lombok', version: lombok - - compileOnly group: 'org.projectlombok', name: 'lombok', version: lombok - - implementation group: 'com.google.guava', name: 'guava', version: guava - implementation group: 'org.slf4j', name: 'slf4j-api', version: slf4j - implementation project(':runelite-api') - - testImplementation group: 'junit', name: 'junit', version: junit -} diff --git a/protocol-api/protocol-api.gradle.kts b/protocol-api/protocol-api.gradle.kts new file mode 100644 index 0000000000..194b518656 --- /dev/null +++ b/protocol-api/protocol-api.gradle.kts @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2019 Owain van Brakel + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +description = "Protocol API" + +dependencies { + annotationProcessor(Libraries.lombok) + + compileOnly(Libraries.lombok) + + implementation(Libraries.guava) + implementation(Libraries.slf4jApi) + implementation(project(":runelite-api")) + + testImplementation(Libraries.junit) +} diff --git a/protocol/build.gradle b/protocol/build.gradle deleted file mode 100644 index 508ad243e1..0000000000 --- a/protocol/build.gradle +++ /dev/null @@ -1,16 +0,0 @@ -description = 'Protocol' - -dependencies { - annotationProcessor group: 'org.projectlombok', name: 'lombok', version: lombok - - api project(':protocol-api') - - compileOnly group: 'org.projectlombok', name: 'lombok', version: lombok - - implementation group: 'com.google.guava', name: 'guava', version: guava - implementation group: 'io.netty', name: 'netty-all', version: netty - implementation group: 'org.slf4j', name: 'slf4j-api', version: slf4j - implementation project(':cache') - - testImplementation group: 'junit', name: 'junit', version: junit -} diff --git a/protocol/protocol.gradle.kts b/protocol/protocol.gradle.kts new file mode 100644 index 0000000000..f8f830a7c3 --- /dev/null +++ b/protocol/protocol.gradle.kts @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2019 Owain van Brakel + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +description = "Protocol" + +dependencies { + annotationProcessor(Libraries.lombok) + + api(project(":protocol-api")) + + compileOnly(Libraries.lombok) + + implementation(Libraries.guava) + implementation(Libraries.nettyAll) + implementation(Libraries.slf4jApi) + implementation(project(":cache")) + + testImplementation(Libraries.junit) +} diff --git a/runelite-api/build.gradle b/runelite-api/build.gradle deleted file mode 100644 index e715877cac..0000000000 --- a/runelite-api/build.gradle +++ /dev/null @@ -1,14 +0,0 @@ -description = 'RuneLite API' - -dependencies { - annotationProcessor group: 'org.projectlombok', name: 'lombok', version: lombok - - compileOnly group: 'org.projectlombok', name: 'lombok', version: lombok - - implementation group: 'com.google.code.findbugs', name: 'jsr305', version: findbugs - implementation group: 'com.google.guava', name: 'guava', version: guava - implementation group: 'org.apache.commons', name: 'commons-text', version: apacheCommonsText - implementation group: 'org.slf4j', name: 'slf4j-api', version: slf4j - - testImplementation group: 'junit', name: 'junit', version: junit -} diff --git a/runelite-api/runelite-api.gradle.kts b/runelite-api/runelite-api.gradle.kts new file mode 100644 index 0000000000..fc7e9ade31 --- /dev/null +++ b/runelite-api/runelite-api.gradle.kts @@ -0,0 +1,39 @@ +/* + * Copyright (c) 2019 Owain van Brakel + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +description = "RuneLite API" + +dependencies { + annotationProcessor(Libraries.lombok) + + compileOnly(Libraries.lombok) + + implementation(Libraries.findbugs) + implementation(Libraries.guava) + implementation(Libraries.apacheCommonsText) + implementation(Libraries.slf4jApi) + + testImplementation(Libraries.junit) +} diff --git a/runelite-client/build.gradle b/runelite-client/build.gradle deleted file mode 100644 index b8a692b33a..0000000000 --- a/runelite-client/build.gradle +++ /dev/null @@ -1,118 +0,0 @@ -import org.apache.tools.ant.filters.ReplaceTokens -import java.text.SimpleDateFormat - -plugins { - id 'com.github.johnrengelman.shadow' version '5.1.0' - id 'java' -} - -description = 'RuneLite Client' - -dependencies { - annotationProcessor group: 'org.projectlombok', name: 'lombok', version: lombok - - compileOnly group: 'javax.annotation', name: 'javax.annotation-api', version: javax - compileOnly group: 'net.runelite', name: 'orange-extensions', version: orangeExtensions - compileOnly group: 'org.projectlombok', name: 'lombok', version: lombok - - implementation group: 'ch.qos.logback', name: 'logback-classic', version: logback - implementation group: 'com.google.code.gson', name: 'gson', version: gson - implementation group: 'com.google.guava', name: 'guava', version: guava - implementation group: 'com.google.inject', name: 'guice', version: guice, classifier: 'no_aop' - implementation group: 'com.h2database', name: 'h2', version: h2 - implementation group: 'com.jakewharton.rxrelay2', name: 'rxrelay', version: rxrelay - implementation group: 'com.squareup.okhttp3', name: 'okhttp', version: okhttp3 - implementation group: 'io.reactivex.rxjava2', name: 'rxjava', version: rxjava - implementation group: 'net.java.dev.jna', name: 'jna', version: jna - implementation group: 'net.java.dev.jna', name: 'jna-platform', version: jna - implementation group: 'net.runelite', name: 'discord', version: discord - implementation group: 'net.runelite.pushingpixels', name: 'substance', version: substance - implementation group: 'net.sf.jopt-simple', name: 'jopt-simple', version: jopt - implementation group: 'org.apache.commons', name: 'commons-text', version: apacheCommonsText - implementation group: 'org.apache.httpcomponents', name: 'httpcore', version: httpcore - implementation group: 'org.apache.httpcomponents', name: 'httpmime', version: httpmime - implementation group: 'org.codehaus.plexus', name: 'plexus-utils', version: plexus - implementation group: 'org.javassist', name: 'javassist', version: javassist - implementation group: 'org.jetbrains', name: 'annotations', version: annotations - implementation group: 'org.jogamp.gluegen', name: 'gluegen-rt', version: jogamp - implementation group: 'org.jogamp.jogl', name: 'jogl-all', version: jogamp - implementation group: 'org.jooq', name: 'jooq', version: jooq - implementation group: 'org.jooq', name: 'jooq-codegen', version: jooq - implementation group: 'org.jooq', name: 'jooq-meta', version: jooq - implementation group: 'org.ow2.asm', name: 'asm-tree', version: asm - implementation group: 'org.slf4j', name: 'slf4j-api', version: slf4j - implementation group: 'org.xeustechnologies', name: 'jcl-core', version: jclCore - implementation project(':http-api') - implementation project(':runelite-api') - implementation(group: 'io.sigpipe', name: 'jbsdiff', version: jbsdiff) { - exclude(module: 'xz') - } - implementation group: 'com.github.joonasvali.naturalmouse', name: 'naturalmouse', version: '2.0.2' - runtime group: 'net.runelite.pushingpixels', name: 'trident', version: trident - runtime group: 'org.jogamp.gluegen', name: 'gluegen-rt', version: jogamp, classifier: 'natives-linux-amd64' - runtime group: 'org.jogamp.gluegen', name: 'gluegen-rt', version: jogamp, classifier: 'natives-linux-i586' - runtime group: 'org.jogamp.gluegen', name: 'gluegen-rt', version: jogamp, classifier: 'natives-windows-amd64' - runtime group: 'org.jogamp.gluegen', name: 'gluegen-rt', version: jogamp, classifier: 'natives-windows-i586' - runtime group: 'org.jogamp.jogl', name: 'jogl-all', version: jogamp, classifier: 'natives-linux-amd64' - runtime group: 'org.jogamp.jogl', name: 'jogl-all', version: jogamp, classifier: 'natives-linux-i586' - runtime group: 'org.jogamp.jogl', name: 'jogl-all', version: jogamp, classifier: 'natives-windows-amd64' - runtime group: 'org.jogamp.jogl', name: 'jogl-all', version: jogamp, classifier: 'natives-windows-i586' - runtime project(':injected-client') - runtime project(':runescape-api') - - testAnnotationProcessor group: 'org.projectlombok', name: 'lombok', version: lombok - - testCompileOnly group: 'org.projectlombok', name: 'lombok', version: lombok - - testImplementation group: 'com.google.inject.extensions', name: 'guice-grapher', version: guice - testImplementation group: 'com.google.inject.extensions', name: 'guice-testlib', version: guice - testImplementation group: 'junit', name: 'junit', version: junit - testImplementation group: 'org.hamcrest', name: 'hamcrest-library', version: hamcrest - testImplementation group: 'org.mockito', name: 'mockito-core', version: mockito - testImplementation group: 'org.mockito', name: 'mockito-inline', version: mockito - testImplementation group: 'org.slf4j', name: 'slf4j-api', version: slf4j -} - -static def getDate() { - return new SimpleDateFormat("MM-dd-yyyy", Locale.forLanguageTag("en-US")).format(new Date()) -} - -def buildDate = getDate() - -processResources { - from file("src/main/resources/open.osrs.properties"), { - filter(ReplaceTokens, tokens: [ - "project.version": project.version, - "rs.version": rsversion.toString(), - "open.osrs.version": plusVersion.toString(), - "open.osrs.builddate": buildDate.toString(), - "launcher.version": launcherVersion.toString() - ]) - } -} - -tasks.withType(AbstractArchiveTask) { - preserveFileTimestamps = false - reproducibleFileOrder = true -} - -jar { - manifest { - attributes 'Main-Class': 'net.runelite.client.RuneLite' - } -} - -shadowJar { - archiveClassifier.set("shaded") - - exclude("net/runelite/injector/**") -} - -task dependencyReportFile(type: DependencyReportTask) { - outputFile = file('dependencies.txt') - Set configs = [project.configurations.runtimeClasspath] - setConfigurations(configs) -} - -tasks.build.dependsOn tasks.shadowJar -tasks.shadowJar.dependsOn tasks.dependencyReportFile diff --git a/runelite-client/runelite-client.gradle.kts b/runelite-client/runelite-client.gradle.kts new file mode 100644 index 0000000000..27f6e1cefa --- /dev/null +++ b/runelite-client/runelite-client.gradle.kts @@ -0,0 +1,153 @@ +/* + * Copyright (c) 2019 Owain van Brakel + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +import org.apache.tools.ant.filters.ReplaceTokens +import java.util.Date +import java.text.SimpleDateFormat + +buildscript { + dependencies { + classpath(gradleApi()) + } +} + +plugins { + id(Plugins.shadow.first) version Plugins.shadow.second + java +} + +description = "RuneLite Client" + +dependencies { + annotationProcessor(Libraries.lombok) + + compileOnly(Libraries.javax) + compileOnly(Libraries.orangeExtensions) + compileOnly(Libraries.lombok) + + implementation(Libraries.logback) + implementation(Libraries.gson) + implementation(Libraries.guava) + implementation(Libraries.guice) + implementation(Libraries.h2) + implementation(Libraries.rxrelay) + implementation(Libraries.okhttp3) + implementation(Libraries.rxjava) + implementation(Libraries.jna) + implementation(Libraries.jnaPlatform) + implementation(Libraries.discord) + implementation(Libraries.substance) + implementation(Libraries.jopt) + implementation(Libraries.apacheCommonsText) + implementation(Libraries.httpcore) + implementation(Libraries.httpmime) + implementation(Libraries.plexus) + implementation(Libraries.javassist) + implementation(Libraries.annotations) + implementation(Libraries.jogampGluegen) + implementation(Libraries.jogampJogl) + implementation(Libraries.jooq) + implementation(Libraries.jooqCodegen) + implementation(Libraries.jooqMeta) + implementation(Libraries.asmTree) + implementation(Libraries.slf4jApi) + implementation(Libraries.jclCore) + implementation(project(":http-api")) + implementation(project(":runelite-api")) + implementation(Libraries.jbsdiff) { + exclude(module = "xz") + } + implementation(Libraries.naturalMouse) + runtime(Libraries.trident) + runtime(Libraries.jogampGluegenLinuxAmd64) + runtime(Libraries.jogampGluegenLinuxI586) + runtime(Libraries.jogampGluegenWindowsAmd64) + runtime(Libraries.jogampGluegenWindowsI586) + runtime(Libraries.jogampJoglLinuxAmd64) + runtime(Libraries.jogampJoglLinuxI586) + runtime(Libraries.jogampJoglWindowsAmd64) + runtime(Libraries.jogampJoglWindowsI586) + runtime(project(":injected-client")) + runtime(project(":runescape-api")) + + testAnnotationProcessor(Libraries.lombok) + + testCompileOnly(Libraries.lombok) + + testImplementation(Libraries.guiceGrapher) + testImplementation(Libraries.guiceTestlib) + testImplementation(Libraries.junit) + testImplementation(Libraries.hamcrest) + testImplementation(Libraries.mockitoCore) + testImplementation(Libraries.mockitoInline) + testImplementation(Libraries.slf4jApi) +} + +fun formatDate(date: Date?) = with(date ?: Date()) { + SimpleDateFormat("MM-dd-yyyy").format(this) +} + +tasks { + register("dependencyReportFile") { + outputFile = file("dependencies.txt") + setConfiguration("runtimeClasspath") + } + + build { + finalizedBy("shadowJar") + } + + "processResources"(ProcessResources::class) { + val tokens = mapOf( + "project.version" to ProjectVersions.rlVersion, + "rs.version" to ProjectVersions.rsversion.toString(), + "open.osrs.version" to ProjectVersions.openosrsVersion, + "open.osrs.builddate" to formatDate(Date()), + "launcher.version" to ProjectVersions.launcherVersion + ) + + inputs.properties(tokens) + + from("src/main/resources") { + include("open.osrs.properties") + + filter("tokens" to tokens) + } + } + + jar { + manifest { + attributes(mutableMapOf("Main-Class" to "net.runelite.client.RuneLite")) + } + } + + shadowJar { + dependsOn("dependencyReportFile") + + archiveClassifier.set("shaded") + + exclude("net/runelite/injector/**") + } +} \ No newline at end of file diff --git a/runelite-mixins/build.gradle b/runelite-mixins/build.gradle deleted file mode 100644 index b58bca5cb6..0000000000 --- a/runelite-mixins/build.gradle +++ /dev/null @@ -1,13 +0,0 @@ -description = 'RuneLite Mixins' - -dependencies { - compileOnly group: 'com.google.guava', name: 'guava', version: guava - compileOnly group: 'javax.inject', name: 'javax.inject', version: javaxInject - compileOnly group: 'org.slf4j', name: 'slf4j-api', version: slf4j - - implementation project(':runescape-api') -} - -tasks.withType(JavaCompile){ - options.compilerArgs.addAll('-source', '7', '-Xlint:-unchecked') -} diff --git a/runelite-mixins/runelite-mixins.gradle.kts b/runelite-mixins/runelite-mixins.gradle.kts new file mode 100644 index 0000000000..1fba54af2c --- /dev/null +++ b/runelite-mixins/runelite-mixins.gradle.kts @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2019 Owain van Brakel + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +description = "RuneLite Mixins" + +dependencies { + compileOnly(Libraries.guava) + compileOnly(Libraries.javaxInject) + compileOnly(Libraries.slf4jApi) + + implementation(project(":runescape-api")) +} + +tasks.withType { + options.compilerArgs.addAll(arrayOf("-source", "7", "-Xlint:-unchecked")) +} diff --git a/runelite-plugin-archetype/build.gradle b/runelite-plugin-archetype/build.gradle deleted file mode 100644 index 9d0ad72536..0000000000 --- a/runelite-plugin-archetype/build.gradle +++ /dev/null @@ -1 +0,0 @@ -description = 'RuneLite Plugin Archetype' diff --git a/runelite-plugin-archetype/runelite-plugin-archetype.gradle.kts b/runelite-plugin-archetype/runelite-plugin-archetype.gradle.kts new file mode 100644 index 0000000000..21b29f0405 --- /dev/null +++ b/runelite-plugin-archetype/runelite-plugin-archetype.gradle.kts @@ -0,0 +1,26 @@ +/* + * Copyright (c) 2019 Owain van Brakel + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +description = "RuneLite Plugin Archetype" diff --git a/runelite-script-assembler-plugin/build.gradle b/runelite-script-assembler-plugin/build.gradle deleted file mode 100644 index 82786107b0..0000000000 --- a/runelite-script-assembler-plugin/build.gradle +++ /dev/null @@ -1,35 +0,0 @@ -description = 'Script Assembler Plugin' - -dependencies { - annotationProcessor group: 'org.eclipse.sisu', name: 'org.eclipse.sisu.inject', version: sisu - - compileOnly group: 'org.apache.maven.plugin-tools', name: 'maven-plugin-annotations', version: mavenPluginAnnotations - - implementation group: 'com.google.guava', name: 'guava', version: guava - implementation group: 'org.apache.maven', name: 'maven-plugin-api', version: mavenPluginApi - implementation group: 'org.slf4j', name: 'slf4j-nop', version: slf4j - implementation project(':cache') - implementation project(':runelite-api') -} - -compileJava.outputs.upToDateWhen {false} - -compileJava.doLast { - def path = sourceSets.main.runtimeClasspath - def loader = new URLClassLoader(path.collect { f -> f.toURI().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) - - loader.close() -} diff --git a/runelite-script-assembler-plugin/runelite-script-assembler-plugin.gradle.kts b/runelite-script-assembler-plugin/runelite-script-assembler-plugin.gradle.kts new file mode 100644 index 0000000000..b1402a58c5 --- /dev/null +++ b/runelite-script-assembler-plugin/runelite-script-assembler-plugin.gradle.kts @@ -0,0 +1,66 @@ +/* + * Copyright (c) 2019 Owain van Brakel + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +description = "Script Assembler Plugin" + +dependencies { + annotationProcessor(Libraries.sisu) + + compileOnly(Libraries.mavenPluginAnnotations) + + implementation(Libraries.guava) + implementation(Libraries.mavenPluginApi) + implementation(Libraries.slf4jNop) + implementation(project(":cache")) + implementation(project(":runelite-api")) +} + +tasks { + register("assembleMojo") { + classpath = project.sourceSets.main.get().runtimeClasspath + main = "net.runelite.script.AssembleMojo" + args(listOf( + "${project.extra["rootPath"]}/runelite-client/src/main/scripts", + "${project.extra["rootPath"]}/runelite-client/src/main/resources/runelite" + )) + } + + register("indexMojo") { + dependsOn("assembleMojo") + + classpath = project.sourceSets.main.get().runtimeClasspath + main = "net.runelite.script.IndexMojo" + args(listOf( + "${project.extra["rootPath"]}/runelite-client/src/main/resources/runelite", + "${project.extra["rootPath"]}/runelite-client/src/main/resources/runelite/index" + )) + } + + compileJava { + outputs.upToDateWhen {false} + + finalizedBy("indexMojo") + } +} \ No newline at end of file diff --git a/runescape-api/build.gradle b/runescape-api/build.gradle deleted file mode 100644 index 77abba4353..0000000000 --- a/runescape-api/build.gradle +++ /dev/null @@ -1,6 +0,0 @@ -group = 'us.runelitepl.rs' -description = 'RuneScape API' - -dependencies { - api project(':runelite-api') -} diff --git a/runescape-api/runescape-api.gradle.kts b/runescape-api/runescape-api.gradle.kts new file mode 100644 index 0000000000..5746b30ae4 --- /dev/null +++ b/runescape-api/runescape-api.gradle.kts @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2019 Owain van Brakel + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +group = "us.runelitepl.rs" +description = "RuneScape API" + +dependencies { + api(project(":runelite-api")) +} diff --git a/runescape-client/build.gradle b/runescape-client/build.gradle deleted file mode 100644 index a26ab5f36e..0000000000 --- a/runescape-client/build.gradle +++ /dev/null @@ -1,14 +0,0 @@ -group = 'us.runelitepl.rs' -description = 'RuneScape Client' - -dependencies { - implementation project(':runescape-api') - - testImplementation group: 'junit', name: 'junit', version: junit - testImplementation group: 'org.slf4j', name: 'slf4j-api', version: slf4j - testImplementation group: 'org.slf4j', name: 'slf4j-simple', version: slf4j -} - -tasks.withType(JavaCompile) { - options.compilerArgs.addAll('-g:source,vars,lines', '-Xlint:-unchecked') -} diff --git a/injected-client/build.gradle b/runescape-client/runescape-client.gradle.kts similarity index 70% rename from injected-client/build.gradle rename to runescape-client/runescape-client.gradle.kts index e0810e7bad..43aede0b59 100644 --- a/injected-client/build.gradle +++ b/runescape-client/runescape-client.gradle.kts @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 ThatGamerBlue + * Copyright (c) 2019 Owain van Brakel * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -22,28 +22,20 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -description = 'Injected Client' -compileJava { - dependsOn ':injector-plugin:assemble' +group = "com.openosrs.rs" +description = "RuneScape Client" + +dependencies { + implementation(project(":runescape-api")) + + testImplementation(Libraries.junit) + testImplementation(Libraries.slf4jApi) + testImplementation(Libraries.slf4jSimple) } -compileJava.outputs.upToDateWhen { false } - -compileJava.doLast() { - copy { - File f = file("build/classes/java/main") - f.deleteDir() - f.mkdirs() - from ("${injectedClassesPath}") - into ("build/classes/java/main") +tasks { + withType { + options.compilerArgs.addAll(arrayOf("-g:source,vars,lines", "-Xlint:-unchecked")) } } - -classes.doLast() { - File f = file("build/classes/java/main/Placeholder.class") - f.delete() -} - -// tasks.build.dependsOn(tasks.decompile) -// this is just here to show how this could be used \ No newline at end of file diff --git a/settings.gradle b/settings.gradle deleted file mode 100644 index 2d3e25eaaf..0000000000 --- a/settings.gradle +++ /dev/null @@ -1,41 +0,0 @@ -rootProject.name = 'runelite-parent' -include ':http-api' -include ':cache' -include ':runelite-api' -include ':protocol-api' -include ':protocol' -include ':cache-client' -include ':cache-updater' -include ':runescape-api' -include ':rs-client' -include ':deobfuscator' -include ':script-assembler-plugin' -include ':client' -include ':mixins' -include ':injector-plugin' -include ':injected-client' -include ':runelite-plugin-archetype' -include ':http-service' -include ':http-service-openosrs' -include ':wiki-scraper' - -project(':http-api').projectDir = "$rootDir/http-api" as File -project(':cache').projectDir = "$rootDir/cache" as File -project(':runelite-api').projectDir = "$rootDir/runelite-api" as File -project(':protocol-api').projectDir = "$rootDir/protocol-api" as File -project(':protocol').projectDir = "$rootDir/protocol" as File -project(':cache-client').projectDir = "$rootDir/cache-client" as File -project(':cache-updater').projectDir = "$rootDir/cache-updater" as File -project(':runescape-api').projectDir = "$rootDir/runescape-api" as File -project(':rs-client').projectDir = "$rootDir/runescape-client" as File -project(':deobfuscator').projectDir = "$rootDir/deobfuscator" as File -project(':script-assembler-plugin').projectDir = "$rootDir/runelite-script-assembler-plugin" as File -project(':client').projectDir = "$rootDir/runelite-client" as File -project(':mixins').projectDir = "$rootDir/runelite-mixins" as File -project(':injector-plugin').projectDir = "$rootDir/injector-plugin" as File -project(':injected-client').projectDir = "$rootDir/injected-client" as File -project(':runelite-plugin-archetype').projectDir = "$rootDir/runelite-plugin-archetype" as File -project(':http-service').projectDir = "$rootDir/http-service" as File -project(':http-service-openosrs').projectDir = "$rootDir/http-service-openosrs" as File -project(':wiki-scraper').projectDir = "$rootDir/wiki-scraper" as File - diff --git a/settings.gradle.kts b/settings.gradle.kts new file mode 100644 index 0000000000..d9f072a2ef --- /dev/null +++ b/settings.gradle.kts @@ -0,0 +1,57 @@ +/* + * Copyright (c) 2019 Owain van Brakel + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +rootProject.name = "OpenOSRS" + +include(":http-api") +include(":cache") +include(":runelite-api") +include(":protocol-api") +include(":protocol") +include(":cache-client") +include(":cache-updater") +include(":runescape-api") +include(":runescape-client") +include(":deobfuscator") +include(":runelite-script-assembler-plugin") +include(":runelite-client") +include(":runelite-mixins") +include(":injector-plugin") +include(":injected-client") +include(":runelite-plugin-archetype") +include(":http-service") +include(":http-service-openosrs") +include(":wiki-scraper") + +for (project in rootProject.children) { + project.apply { + projectDir = file("$name") + buildFileName = "$name.gradle.kts" + + require(projectDir.isDirectory) { "Project '${project.path} must have a $projectDir directory" } + require(buildFile.isFile) { "Project '${project.path} must have a $buildFile build script" } + } +} + diff --git a/wiki-scraper/build.gradle b/wiki-scraper/build.gradle deleted file mode 100644 index e34e73e741..0000000000 --- a/wiki-scraper/build.gradle +++ /dev/null @@ -1,57 +0,0 @@ -repositories { - mavenCentral() - maven { url 'https://jitpack.io' } -} - -description = 'RuneLite Wiki scraper' - -dependencies { - api project(':cache') - api project(':runelite-api') - - annotationProcessor group: 'org.projectlombok', name: 'lombok', version: lombok - - compileOnly group: 'org.projectlombok', name: 'lombok', version: lombok - - implementation group: 'com.google.code.gson', name: 'gson', version: gson - implementation group: 'com.google.guava', name: 'guava', version: guava - implementation group: 'com.github.petitparser', name: 'java-petitparser', version: '2.2.0' - implementation group: 'com.squareup.okhttp3', name: 'okhttp', version: okhttp3 - implementation group: 'org.slf4j', name: 'slf4j-api', version: slf4j - implementation group: 'org.slf4j', name: 'slf4j-simple', version: slf4j - - testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter-api', version: jupiter -} - -task npcStatsScrape { - doLast { - def path = sourceSets.main.runtimeClasspath - def loader = new URLClassLoader(path.collect { f -> f.toURI().toURL() } as URL[]) - def scrape = loader.loadClass('net.runelite.data.App') - scrape.npcStats(rootProject.file("./runelite-client/src/main/resources/")); - - loader.close() - } -} - -task itemStatsScrape { - doLast { - def path = sourceSets.main.runtimeClasspath - def loader = new URLClassLoader(path.collect { f -> f.toURI().toURL() } as URL[]) - def scrape = loader.loadClass('net.runelite.data.App') - scrape.itemStats(rootProject.file("./runelite-client/src/main/resources/")); - - loader.close() - } -} - -task itemLimitsScrape { - doLast { - def path = sourceSets.main.runtimeClasspath - def loader = new URLClassLoader(path.collect { f -> f.toURI().toURL() } as URL[]) - def scrape = loader.loadClass('net.runelite.data.App') - scrape.itemLimits(rootProject.file("./runelite-client/src/main/resources/net/runelite/client/plugins/grandexchange/")); - - loader.close() - } -} diff --git a/wiki-scraper/src/main/java/net/runelite/data/App.java b/wiki-scraper/src/main/java/net/runelite/data/App.java index ca8b73a9c6..3f4bd9a8ac 100644 --- a/wiki-scraper/src/main/java/net/runelite/data/App.java +++ b/wiki-scraper/src/main/java/net/runelite/data/App.java @@ -45,7 +45,28 @@ public class App private final static MediaWiki wiki = new MediaWiki("https://oldschool.runescape.wiki"); - public static Store cacheStore() throws IOException + public static void main(String[] args) throws IOException + { + if (args.length < 2) + { + System.exit(-1); + } + + switch (args[0]) + { + case "npcStats": + npcStats(new File(args[1])); + break; + case "itemStats": + itemStats(new File(args[1])); + break; + case "itemLimits": + itemLimits(new File(args[1])); + break; + } + } + + private static Store cacheStore() throws IOException { Path path = Paths.get(System.getProperty("user.home"), "jagexcache" + File.separator + "oldschool" + File.separator + "LIVE"); final File jagexcache = new File(String.valueOf(path)); @@ -65,17 +86,17 @@ public class App return cacheStore; } - public static void npcStats(File path) throws IOException + private static void npcStats(File path) throws IOException { NpcStatsDumper.dump(cacheStore(), wiki, path); } - public static void itemStats(File path) throws IOException + private static void itemStats(File path) throws IOException { ItemStatsDumper.dump(cacheStore(), wiki, path); } - public static void itemLimits(File path) throws IOException + private static void itemLimits(File path) throws IOException { ItemLimitsDumper.dump(cacheStore(), wiki, path); } diff --git a/wiki-scraper/wiki-scraper.gradle.kts b/wiki-scraper/wiki-scraper.gradle.kts new file mode 100644 index 0000000000..124411046a --- /dev/null +++ b/wiki-scraper/wiki-scraper.gradle.kts @@ -0,0 +1,69 @@ +/* + * Copyright (c) 2019 Owain van Brakel + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +repositories { + mavenCentral() + maven(url = "https://jitpack.io") +} + +description = "RuneLite Wiki scraper" + +dependencies { + api(project(":cache")) + api(project(":runelite-api")) + + annotationProcessor(Libraries.lombok) + + compileOnly(Libraries.lombok) + + implementation(Libraries.gson) + implementation(Libraries.guava) + implementation(Libraries.petitparser) + implementation(Libraries.okhttp3) + implementation(Libraries.slf4jApi) + implementation(Libraries.slf4jSimple) + + testImplementation(Libraries.jupiter) +} + +tasks { + register("npcStatsScrape") { + classpath = project.sourceSets.main.get().runtimeClasspath + main = "net.runelite.data.App" + args(listOf("npcStats", rootProject.file("./runelite-client/src/main/resources/").absolutePath)) + } + + register("itemStatsScrape") { + classpath = project.sourceSets.main.get().runtimeClasspath + main = "net.runelite.data.App" + args(listOf("itemStats", rootProject.file("./runelite-client/src/main/resources/").absolutePath)) + } + + register("itemLimitsScrape") { + classpath = project.sourceSets.main.get().runtimeClasspath + main = "net.runelite.data.App" + args(listOf("itemLimits", rootProject.file("./runelite-client/src/main/resources/").absolutePath)) + } +}