Revert "Kotlin metadata update to 0.8.0"
This reverts commit 04652a2b119241a04587feefee757b9eceb57526.
Reason for revert: broke dump but with assertion error, broke old kotlin bot (more than it was)
Change-Id: Ibd1aa374e0fa84619501a39cf4a326bc6ce4ea3b
diff --git a/d8_r8/commonBuildSrc/src/main/kotlin/DependenciesPlugin.kt b/d8_r8/commonBuildSrc/src/main/kotlin/DependenciesPlugin.kt
index ba9eeeb..56562ac 100644
--- a/d8_r8/commonBuildSrc/src/main/kotlin/DependenciesPlugin.kt
+++ b/d8_r8/commonBuildSrc/src/main/kotlin/DependenciesPlugin.kt
@@ -356,7 +356,7 @@
const val javassist = "3.29.2-GA"
const val junitVersion = "4.13-beta-2"
const val kotlinVersion = "1.9.0"
- const val kotlinMetadataVersion = "0.8.0"
+ const val kotlinMetadataVersion = "0.7.0"
const val mockito = "2.10.0"
const val smaliVersion = "3.0.3"
}
diff --git a/src/main/java/com/android/tools/r8/kotlin/KotlinClassMetadataReader.java b/src/main/java/com/android/tools/r8/kotlin/KotlinClassMetadataReader.java
index fa9b232..91d36c7 100644
--- a/src/main/java/com/android/tools/r8/kotlin/KotlinClassMetadataReader.java
+++ b/src/main/java/com/android/tools/r8/kotlin/KotlinClassMetadataReader.java
@@ -202,7 +202,7 @@
KotlinClassMetadata kMetadata,
AppView<?> appView,
Consumer<DexEncodedMethod> keepByteCode) {
- Metadata metadata = kMetadata.write();
+ Metadata metadata = kMetadata.getAnnotationData$kotlinx_metadata_jvm();
String packageName = metadata.pn();
int[] metadataVersion = metadata.mv();
if (kMetadata instanceof KotlinClassMetadata.Class) {
diff --git a/src/main/java/com/android/tools/r8/kotlin/KotlinMetadataAnnotationWrapper.java b/src/main/java/com/android/tools/r8/kotlin/KotlinMetadataAnnotationWrapper.java
index c4c6749..d34a84f 100644
--- a/src/main/java/com/android/tools/r8/kotlin/KotlinMetadataAnnotationWrapper.java
+++ b/src/main/java/com/android/tools/r8/kotlin/KotlinMetadataAnnotationWrapper.java
@@ -56,7 +56,7 @@
}
public static KotlinMetadataAnnotationWrapper wrap(KotlinClassMetadata classMetadata) {
- Metadata annotationData = classMetadata.write();
+ Metadata annotationData = classMetadata.getAnnotationData$kotlinx_metadata_jvm();
return new KotlinMetadataAnnotationWrapper(
annotationData.k(),
annotationData.mv(),
diff --git a/src/main/java/com/android/tools/r8/naming/KotlinModuleSynthesizer.java b/src/main/java/com/android/tools/r8/naming/KotlinModuleSynthesizer.java
index 76c2314..9504a38 100644
--- a/src/main/java/com/android/tools/r8/naming/KotlinModuleSynthesizer.java
+++ b/src/main/java/com/android/tools/r8/naming/KotlinModuleSynthesizer.java
@@ -24,9 +24,7 @@
import java.util.List;
import java.util.Map;
import java.util.Optional;
-import kotlinx.metadata.jvm.JvmMetadataVersion;
-import kotlinx.metadata.jvm.KmModule;
-import kotlinx.metadata.jvm.KotlinModuleMetadata;
+import kotlinx.metadata.jvm.KotlinModuleMetadata.Writer;
/**
* The kotlin module synthesizer will scan through all file facades and multiclass files to figure
@@ -157,7 +155,7 @@
}
}
Collections.sort(packagesSorted);
- KmModule kmModule = new KmModule();
+ Writer writer = new Writer();
for (String newPackage : packagesSorted) {
// Calling other visitors than visitPackageParts are currently not supported.
// https://github.com/JetBrains/kotlin/blob/master/libraries/kotlinx-metadata/
@@ -176,15 +174,14 @@
newMultiFiles.put(classPart, rewrittenName);
});
});
- kmModule.visitPackageParts(
+ writer.visitPackageParts(
newPackage,
newFacades.getOrDefault(newPackage, Collections.emptyList()),
newMultiFiles);
}
return Optional.of(
DataEntryResource.fromBytes(
- new KotlinModuleMetadata(kmModule, new JvmMetadataVersion(metadataVersion.get()))
- .write(),
+ writer.write(metadataVersion.get()),
"META-INF/" + moduleName + ".kotlin_module",
Origin.unknown()));
}
diff --git a/third_party/dependencies.tar.gz.sha1 b/third_party/dependencies.tar.gz.sha1
index 065b617..c41f552 100644
--- a/third_party/dependencies.tar.gz.sha1
+++ b/third_party/dependencies.tar.gz.sha1
@@ -1 +1 @@
-63b28256fbfb11bd32c0d65ccf948ab82832efb6
\ No newline at end of file
+0276892a18f142c7399e09f5dada5e5f98857114
\ No newline at end of file
diff --git a/tools/create_local_maven_with_dependencies.py b/tools/create_local_maven_with_dependencies.py
index ebe009b..e2f0366 100755
--- a/tools/create_local_maven_with_dependencies.py
+++ b/tools/create_local_maven_with_dependencies.py
@@ -24,7 +24,7 @@
ASM_VERSION = '9.6' # When updating update tools/asmifier.py and Toolhelper as well.
ESPRESSO_VERSION = '3.0.0'
FASTUTIL_VERSION = '7.2.1'
-KOTLIN_METADATA_VERSION = '0.8.0'
+KOTLIN_METADATA_VERSION = '0.7.0'
KOTLIN_VERSION = '1.9.0'
GUAVA_VERSION = '32.1.2-jre'
GSON_VERSION = '2.10.1'