mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
build scripts: read Kotlin bytecode version from new annotation
This commit is contained in:
@@ -192,14 +192,27 @@ private String readKotlinClassVersionOfCompiledClasses() {
|
||||
|
||||
private String readKotlinClassFileVersion(InputStream classFileStream) {
|
||||
def reader = new ClassReader(classFileStream)
|
||||
String kotlinClassVersion = null
|
||||
String kotlinBytecodeVersion = null
|
||||
String kotlinMetaDataVersion = null
|
||||
reader.accept(new ClassVisitor(Opcodes.ASM5) {
|
||||
AnnotationVisitor visitAnnotation(String annotationName, boolean b) {
|
||||
if (annotationName == "Lkotlin/jvm/internal/KotlinClass;") {
|
||||
return new AnnotationVisitor(Opcodes.ASM5) {
|
||||
void visit(String name, Object value) {
|
||||
if (name == "version") {
|
||||
kotlinClassVersion = (value as Integer[]).join(".")
|
||||
kotlinBytecodeVersion = (value as Integer[]).join(".")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (annotationName == "Lkotlin/Metadata;") {
|
||||
return new AnnotationVisitor(Opcodes.ASM5) {
|
||||
void visit(String name, Object value) {
|
||||
if (name == "mv") {
|
||||
kotlinMetaDataVersion = (value as Integer[]).join(".")
|
||||
}
|
||||
else if (name == "bv") {
|
||||
kotlinBytecodeVersion = (value as Integer[]).join(".")
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -207,7 +220,10 @@ private String readKotlinClassFileVersion(InputStream classFileStream) {
|
||||
return null
|
||||
}
|
||||
}, 0)
|
||||
return kotlinClassVersion
|
||||
if (kotlinBytecodeVersion != null && kotlinMetaDataVersion != null) {
|
||||
kotlinBytecodeVersion = kotlinBytecodeVersion + "." + kotlinMetaDataVersion
|
||||
}
|
||||
return kotlinBytecodeVersion
|
||||
}
|
||||
|
||||
private boolean downloadAndExtract(TeamCityBuildLocator buildLocator, String communityHome, String classVersionOfCompiledClasses) {
|
||||
|
||||
Reference in New Issue
Block a user