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:
@@ -4,7 +4,7 @@ This library provides an API to read and modify metadata of binary files generat
|
|||||||
|
|
||||||
## Usage
|
## 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:
|
Example usage in Maven:
|
||||||
|
|
||||||
@@ -17,13 +17,6 @@ Example usage in Maven:
|
|||||||
<version>${kotlinx_metadata_version}</version>
|
<version>${kotlinx_metadata_version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
<repositories>
|
|
||||||
<repository>
|
|
||||||
<id>bintray-kotlin-kotlinx</id>
|
|
||||||
<name>bintray</name>
|
|
||||||
<url>https://kotlin.bintray.com/kotlinx</url>
|
|
||||||
</repository>
|
|
||||||
</repositories>
|
|
||||||
...
|
...
|
||||||
</project>
|
</project>
|
||||||
```
|
```
|
||||||
@@ -33,7 +26,6 @@ Example usage in Gradle:
|
|||||||
```
|
```
|
||||||
repositories {
|
repositories {
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
maven { url "https://kotlin.bintray.com/kotlinx/" }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
@@ -43,7 +35,7 @@ dependencies {
|
|||||||
|
|
||||||
## Overview
|
## 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
|
```kotlin
|
||||||
val header = KotlinClassHeader(
|
val header = KotlinClassHeader(
|
||||||
|
|||||||
Reference in New Issue
Block a user