mirror of
https://github.com/HMCL-dev/HMCL.git
synced 2025-02-23 17:19:44 +08:00
47 lines
945 B
Groovy
47 lines
945 B
Groovy
version '1.0'
|
|
|
|
dependencies {
|
|
compileOnly group: 'org.apache.logging.log4j', name: 'log4j-core', version: '2.0-beta9'
|
|
}
|
|
|
|
tasks.compileJava {
|
|
sourceCompatibility = 8
|
|
targetCompatibility = 8
|
|
|
|
doLast {
|
|
FileTree tree = fileTree('build/classes/java/main')
|
|
tree.include '**/*.class'
|
|
tree.each {
|
|
RandomAccessFile rf = new RandomAccessFile(it, "rw")
|
|
rf.seek(7) // major version
|
|
rf.write(50) // java 6
|
|
rf.close()
|
|
}
|
|
}
|
|
}
|
|
|
|
task patchJar(type: Jar) {
|
|
dependsOn(tasks.compileJava)
|
|
|
|
baseName = 'log4j-patch'
|
|
|
|
from(sourceSets.main.output) {
|
|
include('**/JndiLookup.class')
|
|
}
|
|
}
|
|
|
|
task patchBeta9Jar(type: Jar) {
|
|
dependsOn(tasks.compileJava)
|
|
|
|
baseName = 'log4j-patch-beta9'
|
|
|
|
from(sourceSets.main.output) {
|
|
include '**/Interpolator.class'
|
|
}
|
|
}
|
|
|
|
tasks.jar {
|
|
enabled = false
|
|
dependsOn patchJar, patchBeta9Jar
|
|
}
|