build scripts: ignore patch number of metadata version when checking Kotlin class-files compatibility (Kotlin 1.0.2 builds produce 1.1.1 version which is compatible with 1.1.0 version produced by Kotlin 1.0.1)

This commit is contained in:
nik
2016-04-12 17:06:58 +03:00
parent d58fd8d232
commit ffcd868039
+3 -2
View File
@@ -190,7 +190,7 @@ private String readKotlinClassVersionOfCompiledClasses() {
}
}
private String readKotlinClassFileVersion(InputStream classFileStream) {
private static String readKotlinClassFileVersion(InputStream classFileStream) {
def reader = new ClassReader(classFileStream)
String kotlinBytecodeVersion = null
String kotlinMetaDataVersion = null
@@ -209,7 +209,8 @@ private String readKotlinClassFileVersion(InputStream classFileStream) {
return new AnnotationVisitor(Opcodes.ASM5) {
void visit(String name, Object value) {
if (name == "mv") {
kotlinMetaDataVersion = (value as Integer[]).join(".")
//strip patch number of metadata version because changes in patch updates are forward and backward compatible
kotlinMetaDataVersion = (value as Integer[]).toList().dropRight(1).join(".")
}
else if (name == "bv") {
kotlinBytecodeVersion = (value as Integer[]).join(".")