Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

0.7.0 #12

Draft
wants to merge 48 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
b9b167d
refactor: new package `org.timemates.rsp`, rewritten generator (still…
y9vad9 Jun 19, 2024
ad9cad0
fix: arrays are now treated as packed by default
y9vad9 Jul 28, 2024
214610f
fix: `oneof` fields have `@ProtoOneOf` annotation
y9vad9 Jul 28, 2024
d0a1eb9
feat&refactor: support for custom options, new interceptors API, code…
y9vad9 Aug 9, 2024
35b38cf
docs: link for documentation instead of everything in README.md
y9vad9 Aug 9, 2024
8dd8257
docs: added notation that this is for Kotlin
y9vad9 Aug 10, 2024
7910551
chore: small changes
y9vad9 Aug 17, 2024
ec40ae1
fix: imports
y9vad9 Aug 17, 2024
dd59aff
fix: deploy
y9vad9 Aug 17, 2024
15a7153
feat: added out-of-box Timestamp type with extensions to convert to p…
y9vad9 Aug 19, 2024
7152548
feat: `google.protobuf` types are added to classpath of `:common:core`
y9vad9 Aug 19, 2024
039b9b2
fix: small improvements and fixes in code-generation
y9vad9 Aug 19, 2024
b4abd58
feat: Interceptors have `suspend` modifier
y9vad9 Aug 19, 2024
ac26924
feat: Enums have `Default` variable with value of tag `0` in companion
y9vad9 Aug 19, 2024
313412a
feat: add ability to ignore package cycles in `.proto` files for code…
y9vad9 Aug 19, 2024
fca540a
fix: option generation
y9vad9 Aug 19, 2024
d4df1af
fix: permitPackageCycles are applied to the schemaLoader configuration
y9vad9 Aug 19, 2024
298dfc5
refactor: `ProcedureDescriptor` is moved to a separate file
y9vad9 Aug 19, 2024
c456bbd
feat: add extension `val` to retrieve `ServiceDescriptor` for `Interc…
y9vad9 Aug 19, 2024
22069cd
feat: changes to ClientRequestHandler to support suspend interceptors
y9vad9 Aug 19, 2024
e3680f5
chore: InternalRSProtoAPI annotation definition for code-generation
y9vad9 Aug 19, 2024
f738417
chore&feat: add method for `ExtraMetadata` to retrieve metadata direc…
y9vad9 Aug 19, 2024
115ba08
chore&feat: add EMPTY instance in a companion object, constructor wit…
y9vad9 Aug 19, 2024
3a4e24d
chore&fix: cleanup & small fixes
y9vad9 Aug 19, 2024
fa7824d
feat: support for the `google.protobuf.Any` type
y9vad9 Aug 19, 2024
f6caeb8
feat: add support for all `google.protobuf` types
y9vad9 Aug 19, 2024
d0ae5e1
chore&fix: add support for exception-handling through interceptors in…
y9vad9 Aug 21, 2024
b512d4d
fix: take into account previous interceptor context in exception-hand…
y9vad9 Aug 21, 2024
03ec3d0
refactor: better exception handling code
y9vad9 Aug 21, 2024
0ef3b78
refactor: better exception handling code
y9vad9 Aug 21, 2024
c30cfc9
feat: add support for `bytes` type for proto options
y9vad9 Aug 23, 2024
3706aa7
feat: customizable and extendable code generation, metadata service, …
y9vad9 Oct 13, 2024
54a24bd
refactor: package name to `rrpc`
y9vad9 Oct 13, 2024
91ed7ed
docs: fix links, add warning about unavailability
y9vad9 Oct 13, 2024
3bf9b10
docs: fix name
y9vad9 Oct 13, 2024
1e68503
fix&refactor&chore: fix build errors, server metadata service is rena…
y9vad9 Oct 16, 2024
e349daf
fix: coroutines dependency is missing
y9vad9 Oct 16, 2024
602106b
feat: dynamic serialization
y9vad9 Nov 4, 2024
c2296f4
refactor&feat: restructuring of the modules, rrgcli utility is added
y9vad9 Nov 12, 2024
cffb8b6
fix: proto builtin wrappers support
y9vad9 Nov 12, 2024
de7dcd7
fix: schema metadata generation & small refactor of modules (:tooling…
y9vad9 Nov 13, 2024
555ae6a
feat: graalvm native image for CLI app
y9vad9 Nov 13, 2024
1114c2c
fix: option's resolving
y9vad9 Nov 13, 2024
3d12870
feat: plugins system, CLI support of plugins
y9vad9 Nov 19, 2024
f628631
fix: added missing signal about success
y9vad9 Nov 20, 2024
4ba9161
fix link
y9vad9 Nov 20, 2024
02a6019
chore: clean up after moving generator to separate repository & small…
y9vad9 Nov 30, 2024
dfa62bc
refactor: `SchemaLookup` -> `SchemaMetadata`
y9vad9 Nov 30, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/publish-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,4 @@ jobs:
REPOSILITE_SECRET: ${{ secrets.REPOSILITE_SECRET }}
GRADLE_PUBLISH_KEY: ${{ secrets.GRADLE_PUBLISH_KEY }}
GRADLE_PUBLISH_SECRET: ${{ secrets.GRADLE_PUBLISH_SECRET }}
run: ./gradlew publishAllPublicationsToTimeMatesReleasesRepository publishPlugins --no-daemon -Pversion=${{ env.LIB_VERSION }} -Pgradle.publish.key=${{ env.GRADLE_PUBLISH_KEY }} -Pgradle.publish.secret=${{ env.GRADLE_PUBLISH_SECRET }}
run: ./gradlew publishAllPublicationsToTimeMatesReleasesRepository --no-daemon -Pversion=${{ env.LIB_VERSION }} -Pgradle.publish.key=${{ env.GRADLE_PUBLISH_KEY }} -Pgradle.publish.secret=${{ env.GRADLE_PUBLISH_SECRET }}
86 changes: 13 additions & 73 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,89 +1,29 @@
![Maven metadata URL](https://img.shields.io/maven-metadata/v?metadataUrl=https%3A%2F%2Fmaven.timemates.org%2Freleases%2Forg%2Ftimemates%2Frsproto%2Fclient-core%2Fmaven-metadata.xml)
![GitHub issues](https://img.shields.io/github/issues/timemates/rsproto)
![GitHub closed pull requests](https://img.shields.io/github/issues-pr-closed/timemates/rsproto)
![GitHub License](https://img.shields.io/github/license/timemates/rsproto)
# RSProto
RSProto is a framework that designed to provide ability to expose your API as RPC Services. It facilitates the creation of gRPC-like services from .proto files through code generation. The framework also provides essential core components for both server and client.
![Maven metadata URL](https://img.shields.io/maven-metadata/v?metadataUrl=https%3A%2F%2Fmaven.timemates.org%2Freleases%2Forg%2Ftimemates%2Frrpc-kotlin%2Fclient-core%2Fmaven-metadata.xml)
![GitHub issues](https://img.shields.io/github/issues/timemates/rrpc-kotlin)
![GitHub closed pull requests](https://img.shields.io/github/issues-pr-closed/timemates/rrpc-kotlin)
![GitHub License](https://img.shields.io/github/license/timemates/rrpc-kotlin)
# rRPC Kotlin

rRPC is a framework designed to provide an ability to expose your API as RPC Services.
It facilitates the creation of gRPC-like services from .proto files through code generation.
The framework also provides essential core components for both server and client.

> **Warning** <br>
> This project is experimental, be ready for bugs and possible changes.
Under prototyping, currently unavailable to use.

## Features
- **Gradle Plugin**: `.proto` to RSocket code generator (both client and server).
- **Server Core** (JVM only): Interceptors, Instances API and bridge between Ktor and library.
- **Client Core** (JVM, Web, iOS): Metadata and basic interface-markers.

> **Known issues** <br>
> As RSocket does not natively support client-only streaming – it's not supported by the
> code-generator.

## Getting Started
First of all, you should have the following repository:
```kotlin
repositories {
maven("https://maven.timemates.org/releases")
}
```

### Core components
Before using builtin generation from `.proto` to RSocket services, you should add the following dependencies:
```kotlin
dependencies {
// for server
implementation("org.timemates.rsproto:server-core:$version")
// for client
commonMainImplementation("org.timemates.rsproto:client-core:$version")

// for server & client
commonMainImplementation("org.timemates.rsproto:common-core:$version")
}
```
#### Server initialization
To configure your server, you can use ready-to-use build-bridges between Ktor and RSProto:
```kotlin
fun Application.configureServer() {
routing {
rSocketServer("/rsocket") {
interceptor(MyInterceptor())
service(MyService())

instances {
protobuf {
encodeDefaults = true
}
}
}
}
}
```
#### Client initialization
Clients are generated by the code-generation Gradle plugin. To use them you need instance of `rsocket` and `protobuf`:
```kotlin
val apiService = TestServiceApi(rsocket, protobuf)
apiService.sayHello()
```
## Documentation

### Code-generation plugin
To implement code-generation plugin in your buildscript, add the following:
```kotlin
plugins {
id("org.timemates.rsproto") version "$version"
}
```
And use it inside your buildscript:
```kotlin
rsproto {
protoSourcePath.set("src/main/proto")
generationOutputPath.set("generated/proto-generator/src/commonMain")
clientGeneration.set(true)
serverGeneration.set(true)
}
```
You can learn more about the library in official documentation – [https://rrpc.timemates.org](https://rrpc.timemates.org/section-starting-page.html).

## Feedback

For bugs, questions and discussions please use
the [GitHub Issues](https://github.com/timemates/rsproto/issues).
the [GitHub Issues](https://github.com/timemates/rrpc-kotlin/issues).

## License

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
plugins {
id("jvm-convention")
id("library-convention")
}

kotlin {
explicitApi()
}
30 changes: 19 additions & 11 deletions build-conventions/src/main/kotlin/library-convention.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ plugins {

mavenPublishing {
pom {
url.set("https://github.com/timemates/rsproto")
url.set("https://github.com/RRpc/rrpc-kotlin")
inceptionYear.set("2023")

licenses {
Expand All @@ -24,29 +24,37 @@ mavenPublishing {
}

scm {
url.set("https://github.com/timemates/rsproto")
connection.set("scm:git:git://github.com/timemates/rsproto.git")
developerConnection.set("scm:git:ssh://[email protected]/timemates/rsproto.git")
url.set("https://github.com/RRpc/rrpc-kotlin")
connection.set("scm:git:git://github.com/RRpc/rrpc-kotlin.git")
developerConnection.set("scm:git:ssh://[email protected]/RRpc/rrpc-kotlin.git")
}

issueManagement {
system.set("GitHub Issues")
url.set("https://github.com/timemates/rsproto/issues")
url.set("https://github.com/RRpc/rrpc-kotlin/issues")
}
}
}

publishing {
repositories {
maven {
name = "timeMatesReleases"
if (project.hasProperty("publish-reposilite")) {
maven {
val isDev = version.toString().contains("dev")

url = uri("https://maven.timemates.org/releases")
name = if (isDev) "timeMatesDev" else "timeMatesReleases"
url = if (isDev) uri("https://maven.timemates.org/dev") else uri("https://maven.timemates.org/releases")

credentials {
username = System.getenv("REPOSILITE_USER")
password = System.getenv("REPOSILITE_SECRET")
credentials {
username = System.getenv("REPOSILITE_USER")
password = System.getenv("REPOSILITE_SECRET")
}
}
} else {
logger.log(
LogLevel.INFO,
"Publishing is disabled: publish-locally or publish-reposilite parameter should be used to specify publication destination."
)
}
}
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi

plugins {
kotlin("multiplatform")
}

kotlin {
jvm()
jvmToolchain(11)

@OptIn(ExperimentalKotlinGradlePluginApi::class)
compilerOptions {
optIn.add("kotlinx.serialization.ExperimentalSerializationApi")
}
}
3 changes: 2 additions & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
plugins {
id(libs.plugins.conventions.multiplatform.library.get().pluginId) apply false
}
alias(libs.plugins.kotlinx.serialization) apply false
}
36 changes: 0 additions & 36 deletions client-core/build.gradle.kts

This file was deleted.

This file was deleted.

46 changes: 46 additions & 0 deletions client/core/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
plugins {
id(libs.plugins.conventions.multiplatform.library.get().pluginId)
alias(libs.plugins.kotlinx.serialization)
}

group = "org.timemates.rrpc"
version = System.getenv("LIB_VERSION") ?: "SNAPSHOT"

dependencies {
dependencies {
// -- Project --
commonMainImplementation(projects.common.core)

// -- RSocket --
commonMainApi(libs.rsocket.client)

// -- Test --
jvmTestImplementation(libs.kotlin.test)
jvmTestImplementation(libs.mockk)
}

}

kotlin {
jvm()
// js(IR) {
// browser()
// nodejs()
// }
// iosArm64()
// iosX64()
// iosSimulatorArm64()
}

mavenPublishing {
coordinates(
groupId = "org.timemates.rrpc",
artifactId = "client-core",
version = System.getenv("LIB_VERSION") ?: return@mavenPublishing,
)

pom {
name.set("RRpc Client Core")
description.set("Multiplatform Kotlin core library for RRpc clients.")
}
}
Loading
Loading