Switch buildSrc to ASM7 Jetbrains ASM

This commit is contained in:
Mikhael Bogdanov
2018-12-19 10:49:13 +01:00
parent 2072d7806f
commit c2837cf7d9
3 changed files with 7 additions and 5 deletions
+3 -1
View File
@@ -78,6 +78,7 @@ extra["customDepsOrg"] = "kotlin.build.custom.deps"
repositories {
if (cacheRedirectorEnabled) {
maven("https://cache-redirector.jetbrains.com/jcenter.bintray.com")
maven("https://cache-redirector.jetbrains.com/jetbrains.bintray.com/intellij-third-party-dependencies/")
}
extra["buildSrcKotlinRepo"]?.let {
@@ -85,6 +86,7 @@ repositories {
}
jcenter()
maven("https://jetbrains.bintray.com/intellij-third-party-dependencies/")
}
dependencies {
@@ -94,7 +96,7 @@ dependencies {
compile("com.jakewharton.dex:dex-method-list:3.0.0")
compile("com.github.jengelman.gradle.plugins:shadow:${property("versions.shadow")}")
compile("org.ow2.asm:asm-all:6.0_BETA")
compile("org.jetbrains.intellij.deps:asm-all:7.0")
}
samWithReceiver {
+2 -2
View File
@@ -1,7 +1,7 @@
@file:Suppress("unused") // usages in build scripts are not tracked properly
import org.gradle.api.logging.Logger
import org.objectweb.asm.*
import org.jetbrains.org.objectweb.asm.*
import java.io.BufferedOutputStream
import java.io.File
import java.io.FileOutputStream
@@ -23,7 +23,7 @@ fun stripMetadata(logger: Logger, classNamePattern: String, inFile: File, outFil
var changed = false
val classWriter = ClassWriter(0)
val classVisitor = object : ClassVisitor(Opcodes.ASM5, classWriter) {
val classVisitor = object : ClassVisitor(Opcodes.API_VERSION, classWriter) {
override fun visitAnnotation(desc: String, visible: Boolean): AnnotationVisitor? {
if (Type.getType(desc).internalName == "kotlin/Metadata") {
changed = true
@@ -28,7 +28,7 @@ internal fun File.readKotlinClassHeader(): KotlinClassHeader? {
}
private fun readMetadataVisitor(output: (KotlinClassHeader) -> Unit): AnnotationVisitor =
object : AnnotationVisitor(Opcodes.ASM7) {
object : AnnotationVisitor(Opcodes.API_VERSION) {
var kind: Int? = null
var metadataVersion: IntArray? = null
var bytecodeVersion: IntArray? = null
@@ -57,7 +57,7 @@ private fun readMetadataVisitor(output: (KotlinClassHeader) -> Unit): Annotation
}
private fun stringArrayVisitor(output: (Array<String>) -> Unit): AnnotationVisitor {
return object : AnnotationVisitor(Opcodes.ASM7) {
return object : AnnotationVisitor(Opcodes.API_VERSION) {
val strings = mutableListOf<String>()
override fun visit(name: String?, value: Any?) {