gradle: Close URLClassLoader to prevent leaking file locks
This commit is contained in:
@@ -39,7 +39,7 @@ compileJava.doLast() {
|
|||||||
into "$buildDir"
|
into "$buildDir"
|
||||||
}
|
}
|
||||||
def path = sourceSets.main.runtimeClasspath
|
def path = sourceSets.main.runtimeClasspath
|
||||||
def loader = new URLClassLoader(path.collect { f -> f.toURL() } as URL[])
|
def loader = new URLClassLoader(path.collect { f -> f.toURI().toURL() } as URL[])
|
||||||
def inject = loader.loadClass('net.runelite.injector.Injector')
|
def inject = loader.loadClass('net.runelite.injector.Injector')
|
||||||
String[] jarPaths = [
|
String[] jarPaths = [
|
||||||
deobfuscatedJar.toString(),
|
deobfuscatedJar.toString(),
|
||||||
@@ -47,6 +47,7 @@ compileJava.doLast() {
|
|||||||
injectedClassesPath.toString()
|
injectedClassesPath.toString()
|
||||||
]
|
]
|
||||||
inject.main(jarPaths)
|
inject.main(jarPaths)
|
||||||
|
loader.close()
|
||||||
}
|
}
|
||||||
|
|
||||||
test {
|
test {
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ compileJava.outputs.upToDateWhen {false}
|
|||||||
|
|
||||||
compileJava.doLast {
|
compileJava.doLast {
|
||||||
def path = sourceSets.main.runtimeClasspath
|
def path = sourceSets.main.runtimeClasspath
|
||||||
def loader = new URLClassLoader(path.collect { f -> f.toURL() } as URL[])
|
def loader = new URLClassLoader(path.collect { f -> f.toURI().toURL() } as URL[])
|
||||||
def assemble = loader.loadClass('net.runelite.script.AssembleMojo')
|
def assemble = loader.loadClass('net.runelite.script.AssembleMojo')
|
||||||
String[] assembleArgs = [
|
String[] assembleArgs = [
|
||||||
"${project.rootDir}/runelite-client/src/main/scripts",
|
"${project.rootDir}/runelite-client/src/main/scripts",
|
||||||
@@ -27,4 +27,6 @@ compileJava.doLast {
|
|||||||
"${project.rootDir}/runelite-client/src/main/resources/runelite/index"
|
"${project.rootDir}/runelite-client/src/main/resources/runelite/index"
|
||||||
]
|
]
|
||||||
index.main(indexArgs)
|
index.main(indexArgs)
|
||||||
|
|
||||||
|
loader.close()
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user