Gradle modifications
This commit is contained in:
@@ -29,10 +29,12 @@ import org.ajoberstar.grgit.Grgit
|
|||||||
buildscript {
|
buildscript {
|
||||||
repositories {
|
repositories {
|
||||||
maven(url = "https://plugins.gradle.org/m2/")
|
maven(url = "https://plugins.gradle.org/m2/")
|
||||||
|
mavenLocal()
|
||||||
}
|
}
|
||||||
dependencies {
|
dependencies {
|
||||||
classpath(Plugins.grgitPlugin)
|
classpath(Plugins.grgitPlugin)
|
||||||
classpath(Plugins.versionsPlugin)
|
classpath(Plugins.versionsPlugin)
|
||||||
|
classpath(Plugins.injectorPlugin)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -57,7 +59,9 @@ fun isNonStable(version: String): Boolean {
|
|||||||
}
|
}
|
||||||
|
|
||||||
allprojects {
|
allprojects {
|
||||||
|
apply<JavaLibraryPlugin>()
|
||||||
apply<MavenPlugin>()
|
apply<MavenPlugin>()
|
||||||
|
apply<MavenPublishPlugin>()
|
||||||
|
|
||||||
group = "com.openosrs"
|
group = "com.openosrs"
|
||||||
version = ProjectVersions.rlVersion
|
version = ProjectVersions.rlVersion
|
||||||
@@ -66,16 +70,23 @@ allprojects {
|
|||||||
project.extra["gitCommitShort"] = localGitCommitShort
|
project.extra["gitCommitShort"] = localGitCommitShort
|
||||||
|
|
||||||
project.extra["rootPath"] = rootDir.toString().replace("\\", "/")
|
project.extra["rootPath"] = rootDir.toString().replace("\\", "/")
|
||||||
project.extra["injectedClassesPath"] = "${rootDir}/injector-plugin/out/injected-client/"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
subprojects {
|
subprojects {
|
||||||
apply<JavaLibraryPlugin>()
|
|
||||||
apply<MavenPlugin>()
|
|
||||||
apply<MavenPublishPlugin>()
|
|
||||||
apply(plugin = Plugins.testLogger.first)
|
apply(plugin = Plugins.testLogger.first)
|
||||||
|
|
||||||
if (this.name != "rs-client") apply(plugin = "checkstyle")
|
if (this.name != "runescape-client") {
|
||||||
|
apply(plugin = "checkstyle")
|
||||||
|
configure<CheckstyleExtension> {
|
||||||
|
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 {
|
repositories {
|
||||||
mavenLocal()
|
mavenLocal()
|
||||||
@@ -90,16 +101,6 @@ subprojects {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
configure<CheckstyleExtension> {
|
|
||||||
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<PublishingExtension> {
|
configure<PublishingExtension> {
|
||||||
repositories {
|
repositories {
|
||||||
maven {
|
maven {
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ object ProjectVersions {
|
|||||||
object Plugins {
|
object Plugins {
|
||||||
val grgitPlugin = "org.ajoberstar:grgit:2.3.0"
|
val grgitPlugin = "org.ajoberstar:grgit:2.3.0"
|
||||||
val versionsPlugin = "com.github.ben-manes:gradle-versions-plugin:0.27.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 testLogger = Pair("com.adarshr.test-logger", "2.0.0")
|
||||||
val versions = Pair("com.github.ben-manes.versions", "0.27.0")
|
val versions = Pair("com.github.ben-manes.versions", "0.27.0")
|
||||||
val buildScan = Pair("com.gradle.build-scan", "3.0")
|
val buildScan = Pair("com.gradle.build-scan", "3.0")
|
||||||
|
|||||||
@@ -28,31 +28,44 @@ apply<FernflowerPlugin>()
|
|||||||
|
|
||||||
description = "Injected Client"
|
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 {
|
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 {
|
classes {
|
||||||
val f = file("build/classes/java/main/Placeholder.class")
|
enabled = false
|
||||||
f.delete()
|
}
|
||||||
|
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"))
|
|
||||||
//}
|
|
||||||
}
|
}
|
||||||
@@ -38,7 +38,6 @@ include(":deobfuscator")
|
|||||||
include(":runelite-script-assembler-plugin")
|
include(":runelite-script-assembler-plugin")
|
||||||
include(":runelite-client")
|
include(":runelite-client")
|
||||||
include(":runelite-mixins")
|
include(":runelite-mixins")
|
||||||
include(":injector-plugin")
|
|
||||||
include(":injected-client")
|
include(":injected-client")
|
||||||
include(":runelite-plugin-archetype")
|
include(":runelite-plugin-archetype")
|
||||||
include(":http-service")
|
include(":http-service")
|
||||||
@@ -47,7 +46,7 @@ include(":wiki-scraper")
|
|||||||
|
|
||||||
for (project in rootProject.children) {
|
for (project in rootProject.children) {
|
||||||
project.apply {
|
project.apply {
|
||||||
projectDir = file("$name")
|
projectDir = file(name)
|
||||||
buildFileName = "$name.gradle.kts"
|
buildFileName = "$name.gradle.kts"
|
||||||
|
|
||||||
require(projectDir.isDirectory) { "Project '${project.path} must have a $projectDir directory" }
|
require(projectDir.isDirectory) { "Project '${project.path} must have a $projectDir directory" }
|
||||||
|
|||||||
Reference in New Issue
Block a user