Dogacel / kotlinx-protobuf-gen

Generate kotlinx serializable data classes from protobuf
Apache License 2.0
12 stars 3 forks source link

kotlinx-protobuf-gen

Maven Central Version GitHub Release Date

Build codecov License Contributors Commits

Generate kotlin data classes from protobuf files that supports Kotlin Native that can be serialized and deserialized to protobuf using kotlinx.serialization.

[!NOTE]
Setup instructions and detailed documentation can be found at Setup and Documentation.

Demonstrate Code

Features

Roadmap

The goal is to eventually support all features of Protobuf in Kotlin without depending on the Java library. Here is a list of features we are working on that are required to release first stable version:

And here is a list of features that we are planning to work on after the first stable release.

Known Issues

An issue to track kotlinx.serialization: https://github.com/Kotlin/kotlinx.serialization/issues/2401

Focusing on core functionality, here is a list of known major issues:

Releasing

[!NOTE] This section is applicable to official maintainers only.

  1. Update version under root build.gradle.kts.
  2. Make sure you set SONATYPE_USERNAME, SONATYPE_PASSWORD, GPG_SIGNING_KEY and GPG_SIGNING_PASSPHRASE.
  3. ./gradlew publishToSonatype
  4. ./gradlew findSonatypeStagingRepository closeSonatypeStagingRepository
  5. ./gradlew findSonatypeStagingRepository releaseSonatypeStagingRepository

For any errors, visit https://s01.oss.sonatype.org/#stagingRepositories.

Snapshots

After you release a -SNAPSHOT version, you need the following block to import it.

repositories {
    maven {
        this.url = uri("https://s01.oss.sonatype.org/content/repositories/snapshots/")
    }
}

Contribution

For starters, start by checking issues.

There are two main components to this project. One is the code generator and the other is the generated code tests.

Linting can be done via

./gradlew ktlintFormat

Building the whole project,

./gradlew build

Check coverage of the code,

./gradlew koverHtmlReport

Please feel free to open issues and PRs.