64 lines
2.2 KiB
Groovy
64 lines
2.2 KiB
Groovy
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()
|
|
}
|
|
}
|
|
}
|