Update ReadMe of kotilnx-metadata-jvm

- remove the requirement to use Bintray repo; kotlinx-metadata-jvm is
  published to Maven Central now
- remove the note about kotlin.Metadata being internal; it's public
  since 1.3
This commit is contained in:
Alexander Udalov
2019-05-08 13:21:20 +02:00
parent 15bfbf59a7
commit 5812d28b80
+2 -10
View File
@@ -4,7 +4,7 @@ This library provides an API to read and modify metadata of binary files generat
## Usage
To use this library in your project, add the kotlinx repository at https://kotlin.bintray.com/kotlinx, and a dependency on `org.jetbrains.kotlinx:kotlinx-metadata-jvm:$kotlinx_metadata_version` (where `kotlinx_metadata_version` is the version of the library).
To use this library in your project, add a dependency on `org.jetbrains.kotlinx:kotlinx-metadata-jvm:$kotlinx_metadata_version` (where `kotlinx_metadata_version` is the version of the library).
Example usage in Maven:
@@ -17,13 +17,6 @@ Example usage in Maven:
<version>${kotlinx_metadata_version}</version>
</dependency>
</dependencies>
<repositories>
<repository>
<id>bintray-kotlin-kotlinx</id>
<name>bintray</name>
<url>https://kotlin.bintray.com/kotlinx</url>
</repository>
</repositories>
...
</project>
```
@@ -33,7 +26,6 @@ Example usage in Gradle:
```
repositories {
mavenCentral()
maven { url "https://kotlin.bintray.com/kotlinx/" }
}
dependencies {
@@ -43,7 +35,7 @@ dependencies {
## Overview
The entry point for reading the Kotlin metadata of a `.class` file is [`KotlinClassMetadata.read`](src/kotlinx/metadata/jvm/KotlinClassMetadata.kt). The data it takes is encapsulated in [`KotlinClassHeader`](src/kotlinx/metadata/jvm/KotlinClassHeader.kt) which is basically what is written in the [`kotlin.Metadata`](../../stdlib/jvm/runtime/kotlin/Metadata.kt) annotation on the class file generated by the Kotlin compiler. Construct `KotlinClassHeader` by reading the values from `kotlin.Metadata` reflectively or from some other resource, and then use `KotlinClassMetadata.read` to obtain the correct instance of the class metadata. (Note that loading values of `kotlin.Metadata` reflectively is only possible *from Java sources* until Kotlin 1.3, because this annotation is internal in the standard library, see [KT-23602](https://youtrack.jetbrains.com/issue/KT-23602).)
The entry point for reading the Kotlin metadata of a `.class` file is [`KotlinClassMetadata.read`](src/kotlinx/metadata/jvm/KotlinClassMetadata.kt). The data it takes is encapsulated in [`KotlinClassHeader`](src/kotlinx/metadata/jvm/KotlinClassHeader.kt) which is basically what is written in the [`kotlin.Metadata`](../../stdlib/jvm/runtime/kotlin/Metadata.kt) annotation on the class file generated by the Kotlin compiler. Construct `KotlinClassHeader` by reading the values from `kotlin.Metadata` reflectively or from some other resource, and then use `KotlinClassMetadata.read` to obtain the correct instance of the class metadata.
```kotlin
val header = KotlinClassHeader(