Compare commits
12 Commits
| Author | SHA1 | Date |
|---|---|---|
|
|
be620a1247 | |
|
|
b7d5a97452 | |
|
|
ce8fe9c4bf | |
|
|
8596bcae2c | |
|
|
9dfb9d1876 | |
|
|
9c88efae69 | |
|
|
43fc609549 | |
|
|
07512c45d9 | |
|
|
2a93a9e3d5 | |
|
|
3360b596d5 | |
|
|
8633b8e40d | |
|
|
329f659f41 |
|
|
@ -9,7 +9,7 @@ plugins {
|
||||||
apply plugin: 'kotlin'
|
apply plugin: 'kotlin'
|
||||||
|
|
||||||
group 'io.izzel.taboolib'
|
group 'io.izzel.taboolib'
|
||||||
version '1.19'
|
version '1.27'
|
||||||
|
|
||||||
configurations {
|
configurations {
|
||||||
embed
|
embed
|
||||||
|
|
@ -24,8 +24,8 @@ dependencies {
|
||||||
compile 'org.codehaus.groovy:groovy:2.5.13'
|
compile 'org.codehaus.groovy:groovy:2.5.13'
|
||||||
compile gradleApi()
|
compile gradleApi()
|
||||||
compile localGroovy()
|
compile localGroovy()
|
||||||
embed 'org.ow2.asm:asm:8.0.1'
|
embed 'org.ow2.asm:asm:9.2'
|
||||||
embed 'org.ow2.asm:asm-commons:8.0.1'
|
embed 'org.ow2.asm:asm-commons:9.2'
|
||||||
embed 'com.google.code.gson:gson:2.8.7'
|
embed 'com.google.code.gson:gson:2.8.7'
|
||||||
embed 'org.jetbrains.kotlin:kotlin-stdlib'
|
embed 'org.jetbrains.kotlin:kotlin-stdlib'
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,29 @@
|
||||||
|
package io.izzel.taboolib.gradle
|
||||||
|
|
||||||
|
import org.gradle.api.Project
|
||||||
|
import org.objectweb.asm.AnnotationVisitor
|
||||||
|
import org.objectweb.asm.Opcodes
|
||||||
|
|
||||||
|
class KotlinMetaAnnotationVisitor extends AnnotationVisitor {
|
||||||
|
|
||||||
|
Project project
|
||||||
|
|
||||||
|
KotlinMetaAnnotationVisitor(AnnotationVisitor annotationVisitor, project) {
|
||||||
|
super(Opcodes.ASM7, annotationVisitor)
|
||||||
|
this.project = project
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
void visit(String name, Object value) {
|
||||||
|
if (value instanceof String) {
|
||||||
|
super.visit(name, value.replace("taboolib", "${project.group.replace('.', '/')}/taboolib"))
|
||||||
|
} else {
|
||||||
|
super.visit(name, value)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
AnnotationVisitor visitArray(String name) {
|
||||||
|
return new KotlinMetaAnnotationVisitor(super.visitArray(name), project)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -29,6 +29,9 @@ class RelocateRemapper extends Remapper {
|
||||||
if (remapper != null) {
|
if (remapper != null) {
|
||||||
use.computeIfAbsent(remapper.className) { new HashSet() }.add(internalName)
|
use.computeIfAbsent(remapper.className) { new HashSet() }.add(internalName)
|
||||||
}
|
}
|
||||||
|
if (internalName.startsWith('kotlin/Metadata')) {
|
||||||
|
return internalName
|
||||||
|
}
|
||||||
def match = slash.find { internalName.startsWith(it.key) }
|
def match = slash.find { internalName.startsWith(it.key) }
|
||||||
if (match) {
|
if (match) {
|
||||||
return match.value + internalName.substring(match.key.length())
|
return match.value + internalName.substring(match.key.length())
|
||||||
|
|
|
||||||
|
|
@ -40,7 +40,9 @@ class TabooLibClassVisitor extends ClassVisitor {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
AnnotationVisitor visitAnnotation(String descriptor, boolean visible) {
|
AnnotationVisitor visitAnnotation(String descriptor, boolean visible) {
|
||||||
if (descriptor == "L${project.group.replace('.', '/')}/taboolib/common/Isolated;") {
|
if (descriptor == "Lkotlin/Metadata;") {
|
||||||
|
return new KotlinMetaAnnotationVisitor(super.visitAnnotation(descriptor, visible), project)
|
||||||
|
} else if (descriptor == "L${project.group.replace('.', '/')}/taboolib/common/Isolated;") {
|
||||||
return new IsolatedAnnotationVisitor(super.visitAnnotation(descriptor, visible), project, name, this)
|
return new IsolatedAnnotationVisitor(super.visitAnnotation(descriptor, visible), project, name, this)
|
||||||
} else if (descriptor == "L${project.group.replace('.', '/')}/taboolib/common/env/RuntimeDependency;") {
|
} else if (descriptor == "L${project.group.replace('.', '/')}/taboolib/common/env/RuntimeDependency;") {
|
||||||
return new KotlinAnnotationVisitor(super.visitAnnotation(descriptor, visible), project)
|
return new KotlinAnnotationVisitor(super.visitAnnotation(descriptor, visible), project)
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,7 @@ class TabooLibPlugin implements Plugin<Project> {
|
||||||
task.classifier = tabooExt.classifier
|
task.classifier = tabooExt.classifier
|
||||||
task.relocations['taboolib'] = project.group.toString() + '.taboolib'
|
task.relocations['taboolib'] = project.group.toString() + '.taboolib'
|
||||||
if (!tabooExt.options.contains("skip-kotlin") && !tabooExt.options.contains("skip-kotlin-relocate")) {
|
if (!tabooExt.options.contains("skip-kotlin") && !tabooExt.options.contains("skip-kotlin-relocate")) {
|
||||||
task.relocations['kotlin.'] = 'kotlin.' + kv
|
task.relocations['kotlin.'] = 'kotlin' + kv + '.'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -23,5 +23,10 @@ class Links {
|
||||||
this.url = url
|
this.url = url
|
||||||
return this
|
return this
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
String toString() {
|
||||||
|
return url
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -106,7 +106,7 @@ class OptimizeFileReader(project: Project, input: InputStream) {
|
||||||
if (member.any { name.startsWith(it) }) {
|
if (member.any { name.startsWith(it) }) {
|
||||||
if (depend != null) {
|
if (depend != null) {
|
||||||
val fail = depend.name.any { n ->
|
val fail = depend.name.any { n ->
|
||||||
val set = use[n]!!.toMutableList()
|
val set = use[n]?.toMutableList() ?: ArrayList()
|
||||||
set.remove(n)
|
set.remove(n)
|
||||||
set.removeAll(depend.exclude)
|
set.removeAll(depend.exclude)
|
||||||
set.isNotEmpty()
|
set.isNotEmpty()
|
||||||
|
|
@ -116,7 +116,7 @@ class OptimizeFileReader(project: Project, input: InputStream) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (s in check) {
|
for (s in check) {
|
||||||
val set = use[s]!!.toMutableList()
|
val set = use[s]?.toMutableList() ?: ArrayList()
|
||||||
set.remove(s)
|
set.remove(s)
|
||||||
set.removeAll(check)
|
set.removeAll(check)
|
||||||
set.removeAll(member)
|
set.removeAll(member)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue