1.13
This commit is contained in:
parent
aefa846d3c
commit
943f2679f9
|
|
@ -6,7 +6,7 @@ plugins {
|
||||||
}
|
}
|
||||||
|
|
||||||
group 'io.izzel.taboolib'
|
group 'io.izzel.taboolib'
|
||||||
version '1.12'
|
version '1.13'
|
||||||
|
|
||||||
configurations {
|
configurations {
|
||||||
embed
|
embed
|
||||||
|
|
|
||||||
|
|
@ -53,6 +53,7 @@ class RelocateJar extends DefaultTask {
|
||||||
def buf = new byte[32768]
|
def buf = new byte[32768]
|
||||||
new JarFile(inJar).withCloseable { jarFile ->
|
new JarFile(inJar).withCloseable { jarFile ->
|
||||||
jarFile.entries().each { def jarEntry ->
|
jarFile.entries().each { def jarEntry ->
|
||||||
|
if (tabooExt.exclude.none { String e -> jarEntry.name.matches(e) }) {
|
||||||
jarFile.getInputStream(jarEntry).withCloseable {
|
jarFile.getInputStream(jarEntry).withCloseable {
|
||||||
if (jarEntry.name.endsWith(".class")) {
|
if (jarEntry.name.endsWith(".class")) {
|
||||||
def reader = new ClassReader(it)
|
def reader = new ClassReader(it)
|
||||||
|
|
@ -72,14 +73,16 @@ class RelocateJar extends DefaultTask {
|
||||||
} else {
|
} else {
|
||||||
try {
|
try {
|
||||||
out.putNextEntry(new JarEntry(remapper.map(jarEntry.name)))
|
out.putNextEntry(new JarEntry(remapper.map(jarEntry.name)))
|
||||||
} catch(ZipException zipException) {
|
} catch(ZipException ex) {
|
||||||
println(zipException)
|
println(ex)
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
while ((n = it.read(buf)) != -1) {
|
while ((n = it.read(buf)) != -1) {
|
||||||
out.write(buf, 0, n)
|
out.write(buf, 0, n)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
null
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,8 @@ class TabooLibExtension {
|
||||||
|
|
||||||
List<String> modules = []
|
List<String> modules = []
|
||||||
|
|
||||||
|
List<String> exclude = []
|
||||||
|
|
||||||
Description des = new Description()
|
Description des = new Description()
|
||||||
|
|
||||||
Map<String, String> relocation = new LinkedHashMap<>()
|
Map<String, String> relocation = new LinkedHashMap<>()
|
||||||
|
|
@ -21,6 +23,10 @@ class TabooLibExtension {
|
||||||
name.each { modules += it }
|
name.each { modules += it }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
def exclude(String match) {
|
||||||
|
exclude += match
|
||||||
|
}
|
||||||
|
|
||||||
def relocate(String pre, String post) {
|
def relocate(String pre, String post) {
|
||||||
relocation[pre] = post
|
relocation[pre] = post
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue