Merge pull request #3208 from open-osrs/woohoo-3-second-builds

This commit is contained in:
Owain van Brakel
2022-05-30 15:50:23 +02:00
committed by GitHub
10 changed files with 46 additions and 68 deletions

View File

@@ -188,7 +188,7 @@ subprojects {
}
}
configurations["compileOnly"].extendsFrom(configurations["annotationProcessor"])
configurations.compileOnly.get().extendsFrom(configurations["annotationProcessor"])
}
application {

View File

@@ -57,10 +57,6 @@ dependencies {
tasks {
processTestResources {
finalizedBy("filterTestResources")
}
register<Copy>("filterTestResources") {
val tokens = mapOf(
"rs.version" to ProjectVersions.rsversion.toString(),
"cache.version" to ProjectVersions.cacheversion.toString()
@@ -68,12 +64,9 @@ tasks {
inputs.properties(tokens)
from("src/test/resources") {
include("cache.properties")
}
into("${buildDir}/resources/test")
filesMatching("cache.properties") {
filter(ReplaceTokens::class, "tokens" to tokens)
filteringCharset = "UTF-8"
}
}
}

View File

@@ -29,7 +29,11 @@ plugins {
id("com.github.hauner.jarTest") version "1.0.1"
}
val deobjars = configurations.create("deobjars")
val deobjars: Configuration = configurations.create("deobjars")
configurations {
testImplementation.get().extendsFrom(deobjars)
}
dependencies {
deobjars(group = "net.runelite.rs", name = "vanilla", version = ProjectVersions.rsversion.toString())
@@ -50,7 +54,6 @@ dependencies {
runtimeOnly(group = "org.slf4j", name = "slf4j-simple", version = "1.7.32")
testImplementation(deobjars)
testImplementation(group = "junit", name = "junit", version = "4.12")
testImplementation(group = "org.mockito", name = "mockito-core", version = "3.1.0")
}
@@ -63,49 +66,36 @@ tasks {
)
processResources {
finalizedBy("filterResources")
}
register<Copy>("filterResources") {
inputs.properties(tokens)
from("src/main/resources") {
include("deob.properties")
}
into("${buildDir}/resources/main")
filesMatching("deob.properties") {
filter(ReplaceTokens::class, "tokens" to tokens)
filteringCharset = "UTF-8"
}
}
processTestResources {
finalizedBy("filterTestResources")
}
register<Copy>("filterTestResources") {
inputs.properties(tokens)
from("src/test/resources") {
include("deob-test.properties")
}
into("${buildDir}/resources/test")
filesMatching("deob-test.properties") {
filter(ReplaceTokens::class, "tokens" to tokens)
filteringCharset = "UTF-8"
}
}
// TODO: Enable assertions on all 3
register<JavaExec>("Downloader\$main()") {
group = "gamepack"
classpath = project.sourceSets.main.get().runtimeClasspath
main = "net.runelite.gamepack.Downloader"
mainClass.set("net.runelite.gamepack.Downloader")
}
register<JavaExec>("Deob\$main()") {
group = "gamepack"
classpath = project.sourceSets.main.get().runtimeClasspath
main = "net.runelite.deob.Deob"
mainClass.set("net.runelite.deob.Deob")
args = listOf(tokens["vanilla.jar"], "$buildDir/libs/deobfuscated-$version.jar")
}
@@ -113,7 +103,7 @@ tasks {
group = "gamepack"
classpath = project.sourceSets.main.get().runtimeClasspath
main = "net.runelite.deob.updater.UpdateMappings"
mainClass.set("net.runelite.deob.updater.UpdateMappings")
}
}

View File

@@ -1,4 +1,4 @@
org.gradle.caching=false
org.gradle.caching=true
org.gradle.warning.mode=all
org.gradle.parallel=true
org.gradle.console=rich

View File

@@ -46,10 +46,6 @@ dependencies {
tasks {
processResources {
finalizedBy("filterResources")
}
register<Copy>("filterResources") {
val tokens = mapOf(
"projectver" to ProjectVersions.rlVersion,
"rsver" to ProjectVersions.rsversion.toString(),
@@ -58,12 +54,9 @@ tasks {
inputs.properties(tokens)
from("src/main/resources") {
include("runelite.properties")
}
into("${buildDir}/resources/main")
filesMatching("runelite.properties") {
filter(ReplaceTokens::class, "tokens" to tokens)
filteringCharset = "UTF-8"
}
}
}

View File

@@ -42,13 +42,20 @@ tasks.register<JavaExec>("inject") {
enableAssertions = true
main = "com.openosrs.injector.Injector"
classpath = project.sourceSets.main.get().runtimeClasspath
mainClass.set("com.openosrs.injector.Injector")
inputs.dir("${project.extra["rootPath"]}/runelite-mixins/src/main/java")
inputs.dir("${project.extra["rootPath"]}/runelite-api/src/main/java")
inputs.dir("${project.extra["rootPath"]}/runescape-api/src/main/java")
inputs.dir("${project.extra["rootPath"]}/runescape-client/src/main/java")
val out = "${project.extra["rootPath"]}/runelite-client/build/injected/injected-client.oprs"
outputs.file(out)
classpath = sourceSets["main"].runtimeClasspath
outputs.file("${project.extra["rootPath"]}/runelite-client/build/injected/client.hash")
outputs.cacheIf { true }
args("--outmode", "jar", "--vanilla", vanillaDep.singleFile, "--version", openosrsVersion, "--output", out)
outputs.upToDateWhen {
false
}
}

View File

@@ -28,7 +28,7 @@ import java.text.SimpleDateFormat
import java.util.Date
plugins {
id("com.github.johnrengelman.shadow") version "6.1.0"
id("com.github.johnrengelman.shadow") version "7.1.2"
java
}
@@ -137,10 +137,6 @@ tasks {
}
processResources {
finalizedBy("filterResources")
}
register<Copy>("filterResources") {
val tokens = mapOf(
"project.version" to ProjectVersions.rlVersion,
"rs.version" to ProjectVersions.rsversion.toString(),
@@ -151,13 +147,11 @@ tasks {
inputs.properties(tokens)
from("src/main/resources/")
include("**/*.properties")
into("${buildDir}/resources/main")
filesMatching("**/*.properties") {
filter(ReplaceTokens::class, "tokens" to tokens)
filteringCharset = "UTF-8"
}
}
register<Copy>("packInjectedClient") {
dependsOn(":injector:inject")
@@ -196,7 +190,7 @@ tasks {
register<JavaExec>("RuneLite.main()") {
group = "openosrs"
classpath = sourceSets["main"].runtimeClasspath
classpath = project.sourceSets.main.get().runtimeClasspath
enableAssertions = true
mainClass.set("net.runelite.client.RuneLite")
}

View File

@@ -40,6 +40,7 @@ tasks {
targetCompatibility = JavaVersion.VERSION_1_8
disableAutoTargetJvm()
}
withType<JavaCompile> {
options.compilerArgs.addAll(arrayOf("-Xlint:-unchecked"))
}

View File

@@ -48,7 +48,7 @@ tasks {
outputs.dir(out)
classpath = project.sourceSets.main.get().runtimeClasspath
main = "net.runelite.script.AssembleMojo"
mainClass.set("net.runelite.script.AssembleMojo")
args(listOf(inp, out))
doLast {

View File

@@ -49,7 +49,7 @@ tasks {
group = "openosrs"
classpath = project.sourceSets.main.get().runtimeClasspath
main = "net.runelite.data.App"
mainClass.set("net.runelite.data.App")
args(listOf("npcStats", rootProject.file("./runelite-client/src/main/resources/").absolutePath))
}
@@ -57,7 +57,7 @@ tasks {
group = "openosrs"
classpath = project.sourceSets.main.get().runtimeClasspath
main = "net.runelite.data.App"
mainClass.set("net.runelite.data.App")
args(listOf("itemStats", rootProject.file("./runelite-client/src/main/resources/").absolutePath))
}
@@ -65,7 +65,7 @@ tasks {
group = "openosrs"
classpath = project.sourceSets.main.get().runtimeClasspath
main = "net.runelite.data.App"
mainClass.set("net.runelite.data.App")
args(listOf("itemLimits", rootProject.file("./runelite-client/src/main/resources/").absolutePath))
}
}