diff --git a/build.gradle.kts b/build.gradle.kts index 0ecb568649..b971f0dde8 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -29,10 +29,12 @@ import org.ajoberstar.grgit.Grgit buildscript { repositories { maven(url = "https://plugins.gradle.org/m2/") + mavenLocal() } dependencies { classpath(Plugins.grgitPlugin) classpath(Plugins.versionsPlugin) + classpath(Plugins.injectorPlugin) } } @@ -57,7 +59,9 @@ fun isNonStable(version: String): Boolean { } allprojects { + apply() apply() + apply() group = "com.openosrs" version = ProjectVersions.rlVersion @@ -66,16 +70,23 @@ allprojects { 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) - if (this.name != "rs-client") apply(plugin = "checkstyle") + if (this.name != "runescape-client") { + apply(plugin = "checkstyle") + 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 + } + } repositories { mavenLocal() @@ -90,16 +101,6 @@ subprojects { } } - 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 { diff --git a/buildSrc/src/main/kotlin/Dependencies.kt b/buildSrc/src/main/kotlin/Dependencies.kt index f3bc0f0c3d..c4afcf99b4 100644 --- a/buildSrc/src/main/kotlin/Dependencies.kt +++ b/buildSrc/src/main/kotlin/Dependencies.kt @@ -38,7 +38,7 @@ object ProjectVersions { object Plugins { val grgitPlugin = "org.ajoberstar:grgit:2.3.0" val versionsPlugin = "com.github.ben-manes:gradle-versions-plugin:0.27.0" - + val injectorPlugin = "com.openosrs:injector-plugin:1.0.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") diff --git a/injected-client/injected-client.gradle.kts b/injected-client/injected-client.gradle.kts index 41b48b47f1..3d15bb3cbb 100644 --- a/injected-client/injected-client.gradle.kts +++ b/injected-client/injected-client.gradle.kts @@ -28,31 +28,44 @@ apply() description = "Injected Client" +plugins { + id("com.openosrs.injector") +} +configurations { + create("vanilla") + create("injected-client") +} + +dependencies { + "vanilla"(Libraries.vanilla) +} + +injector { + mixins.set(tasks.getByPath(":runelite-mixins:jar").outputs.files.singleFile) + rsapi.set(tasks.getByPath(":runescape-api:jar").outputs.files.singleFile) + rsclient.set(tasks.getByPath(":runescape-client:jar").outputs.files.singleFile) + vanilla.set(project.file(configurations["vanilla"].asPath)) +} + +artifacts { + add("runtime", tasks.inject.get().output) { + builtBy(tasks.inject) + } +} + +// keep the sourcesets etc but remove useless tasks 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() + enabled = false + } + compileJava { + enabled = false + } + jar { + enabled = false + } + processResources { + enabled = false } - - // 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/settings.gradle.kts b/settings.gradle.kts index d9f072a2ef..1c9a7e70f3 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -38,7 +38,6 @@ 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") @@ -47,7 +46,7 @@ include(":wiki-scraper") for (project in rootProject.children) { project.apply { - projectDir = file("$name") + projectDir = file(name) buildFileName = "$name.gradle.kts" require(projectDir.isDirectory) { "Project '${project.path} must have a $projectDir directory" }