Compare commits
No commits in common. "master" and "1.16" have entirely different histories.
18
build.gradle
18
build.gradle
|
|
@ -9,7 +9,7 @@ plugins {
|
|||
apply plugin: 'kotlin'
|
||||
|
||||
group 'io.izzel.taboolib'
|
||||
version '1.27'
|
||||
version '1.16'
|
||||
|
||||
configurations {
|
||||
embed
|
||||
|
|
@ -24,8 +24,8 @@ dependencies {
|
|||
compile 'org.codehaus.groovy:groovy:2.5.13'
|
||||
compile gradleApi()
|
||||
compile localGroovy()
|
||||
embed 'org.ow2.asm:asm:9.2'
|
||||
embed 'org.ow2.asm:asm-commons:9.2'
|
||||
embed 'org.ow2.asm:asm:8.0.1'
|
||||
embed 'org.ow2.asm:asm-commons:8.0.1'
|
||||
embed 'com.google.code.gson:gson:2.8.7'
|
||||
embed 'org.jetbrains.kotlin:kotlin-stdlib'
|
||||
}
|
||||
|
|
@ -58,15 +58,3 @@ publishing {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
compileKotlin {
|
||||
kotlinOptions {
|
||||
jvmTarget = "1.8"
|
||||
}
|
||||
}
|
||||
|
||||
compileTestKotlin {
|
||||
kotlinOptions {
|
||||
jvmTarget = "1.8"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -50,6 +50,6 @@ class KotlinAnnotationVisitor extends AnnotationVisitor {
|
|||
}
|
||||
|
||||
String getKotlinVersionEscape() {
|
||||
return getKotlinVersion().replaceAll("[._-]", "")
|
||||
return getKotlinVersion().replaceAll("[.-]", "_")
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,29 +0,0 @@
|
|||
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,9 +29,6 @@ class RelocateRemapper extends Remapper {
|
|||
if (remapper != null) {
|
||||
use.computeIfAbsent(remapper.className) { new HashSet() }.add(internalName)
|
||||
}
|
||||
if (internalName.startsWith('kotlin/Metadata')) {
|
||||
return internalName
|
||||
}
|
||||
def match = slash.find { internalName.startsWith(it.key) }
|
||||
if (match) {
|
||||
return match.value + internalName.substring(match.key.length())
|
||||
|
|
|
|||
|
|
@ -40,9 +40,7 @@ class TabooLibClassVisitor extends ClassVisitor {
|
|||
|
||||
@Override
|
||||
AnnotationVisitor visitAnnotation(String descriptor, boolean visible) {
|
||||
if (descriptor == "Lkotlin/Metadata;") {
|
||||
return new KotlinMetaAnnotationVisitor(super.visitAnnotation(descriptor, visible), project)
|
||||
} else if (descriptor == "L${project.group.replace('.', '/')}/taboolib/common/Isolated;") {
|
||||
if (descriptor == "L${project.group.replace('.', '/')}/taboolib/common/Isolated;") {
|
||||
return new IsolatedAnnotationVisitor(super.visitAnnotation(descriptor, visible), project, name, this)
|
||||
} else if (descriptor == "L${project.group.replace('.', '/')}/taboolib/common/env/RuntimeDependency;") {
|
||||
return new KotlinAnnotationVisitor(super.visitAnnotation(descriptor, visible), project)
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ class TabooLibPlugin implements Plugin<Project> {
|
|||
project.tasks.jar.configure { Jar task ->
|
||||
task.from(taboo.collect { it.isDirectory() ? it : project.zipTree(it) })
|
||||
}
|
||||
def kv = project.plugins.findPlugin("org.jetbrains.kotlin.jvm").kotlinPluginVersion.replaceAll("[._-]", "")
|
||||
def kv = project.plugins.findPlugin("org.jetbrains.kotlin.jvm").kotlinPluginVersion.replaceAll("[.-]", "_")
|
||||
def jarTask = project.tasks.jar as Jar
|
||||
tabooTask.configure { RelocateJar task ->
|
||||
task.tabooExt = tabooExt
|
||||
|
|
@ -31,8 +31,8 @@ class TabooLibPlugin implements Plugin<Project> {
|
|||
task.relocations = tabooExt.relocation
|
||||
task.classifier = tabooExt.classifier
|
||||
task.relocations['taboolib'] = project.group.toString() + '.taboolib'
|
||||
if (!tabooExt.options.contains("skip-kotlin") && !tabooExt.options.contains("skip-kotlin-relocate")) {
|
||||
task.relocations['kotlin.'] = 'kotlin' + kv + '.'
|
||||
if (!tabooExt.options.contains("skip-kotlin")) {
|
||||
task.relocations['kotlin'] = 'taboolib.library.kotlin_' + kv
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,8 +13,8 @@ class BuilderBungee extends Builder {
|
|||
write(body, description.lin.links['homepage'], 'website')
|
||||
writeLine(body)
|
||||
// authors
|
||||
def con = description.con.contributors.collect { it.name }.join(', ')
|
||||
write(body, con, 'author')
|
||||
def con = description.con.contributors.collect { it.name }
|
||||
writeList(body, con, 'authors')
|
||||
writeLine(body)
|
||||
// dependency
|
||||
writeList(body, description.dep.dependencies
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ class BuilderVelocity extends Builder {
|
|||
|
||||
@Override
|
||||
byte[] build(Description description, Project project) {
|
||||
def json = new JsonArray()
|
||||
def info = new JsonObject()
|
||||
info.addProperty('id', project.name.toLowerCase())
|
||||
info.addProperty('name', project.name)
|
||||
|
|
@ -20,6 +21,7 @@ class BuilderVelocity extends Builder {
|
|||
writeList(info, description.dep.dependencies
|
||||
.findAll { it.with == null || it.with.equalsIgnoreCase('velocity') }
|
||||
.collect { it.name }, 'dependencies')
|
||||
return bytes(info)
|
||||
json.add(info)
|
||||
return bytes(json)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,10 +23,5 @@ class Links {
|
|||
this.url = url
|
||||
return this
|
||||
}
|
||||
|
||||
@Override
|
||||
String toString() {
|
||||
return url
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -106,7 +106,7 @@ class OptimizeFileReader(project: Project, input: InputStream) {
|
|||
if (member.any { name.startsWith(it) }) {
|
||||
if (depend != null) {
|
||||
val fail = depend.name.any { n ->
|
||||
val set = use[n]?.toMutableList() ?: ArrayList()
|
||||
val set = use[n]!!.toMutableList()
|
||||
set.remove(n)
|
||||
set.removeAll(depend.exclude)
|
||||
set.isNotEmpty()
|
||||
|
|
@ -116,7 +116,7 @@ class OptimizeFileReader(project: Project, input: InputStream) {
|
|||
}
|
||||
}
|
||||
for (s in check) {
|
||||
val set = use[s]?.toMutableList() ?: ArrayList()
|
||||
val set = use[s]!!.toMutableList()
|
||||
set.remove(s)
|
||||
set.removeAll(check)
|
||||
set.removeAll(member)
|
||||
|
|
|
|||
Loading…
Reference in New Issue