Rework KotlinModuleMetadata to align it with KotlinClassMetadata:
- Public constructor with KmModule and JvmMetadataVersion - make write() member function
This commit is contained in:
committed by
Space Team
parent
6e9a62c317
commit
048802e143
@@ -202,11 +202,11 @@ The only difference is that the source for the reader (and the result of the wri
|
||||
```kotlin
|
||||
// Read the module metadata
|
||||
val bytes = File("META-INF/main.kotlin_module").readBytes()
|
||||
val metadata = KotlinModuleMetadata.read(bytes)
|
||||
val module = metadata.kmModule
|
||||
val moduleMetadata = KotlinModuleMetadata.read(bytes)
|
||||
val module = moduleMetadata.kmModule
|
||||
...
|
||||
|
||||
// Write the module metadata
|
||||
val bytes = KotlinModuleMetadata.write(module)
|
||||
val bytes = moduleMetadata.write()
|
||||
File("META-INF/main.kotlin_module").writeBytes(bytes)
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user