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

Kotlinx Serialization - Code gen Prototype #13

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## Version 0.2.2
_2018-12-3_

## Version 0.2.1
_2018-11-02_
* Fix: Address regression in file filter matching
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ subprojects{ subproject ->
apply plugin: 'kotlin'

group = 'com.github.marcoferrer.krotoplus'
version = '0.2.1'
version = '0.2.2-SNAPSHOT'

compileKotlin {
kotlinOptions.jvmTarget = "1.8"
Expand Down
2 changes: 1 addition & 1 deletion community-scripts/extendable-messages/build.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
def krotoPlusVersion = '0.2.1'
def krotoPlusVersion = '0.2.2-SNAPSHOT'

plugins {
id "org.jetbrains.kotlin.jvm" version "1.3.0"
Expand Down
2 changes: 1 addition & 1 deletion community-scripts/var-arg-extensions/build.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
def krotoPlusVersion = '0.2.1'
def krotoPlusVersion = '0.2.2.-SNAPSHOT'

plugins {
id "org.jetbrains.kotlin.jvm" version "1.3.0"
Expand Down
6 changes: 5 additions & 1 deletion example-project/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ buildscript {
"grpc": '1.15.1',
"kotlin": '1.3.0',
"coroutines": '1.0.0',
"krotoplus": '0.2.1'
"krotoplus": '0.2.2-SNAPSHOT'
]
}

Expand All @@ -19,6 +19,7 @@ buildscript {
plugins{
id 'idea'
id 'com.google.protobuf' version '0.8.6'
id 'kotlinx-serialization' version '1.3.0'
id "org.jetbrains.kotlin.jvm" version "1.3.0"
}

Expand All @@ -44,6 +45,7 @@ allprojects {
repositories {
jcenter()
maven { url 'http://dl.bintray.com/kotlin/kotlin-eap' }
maven { url "https://kotlin.bintray.com/kotlinx" }
if(versions.krotoplus.endsWith("SNAPSHOT")) {
flatDir dirs: "${rootDir}/../kroto-plus-message/build/libs/"
flatDir dirs: "${rootDir}/../kroto-plus-coroutines/build/libs/"
Expand All @@ -56,6 +58,8 @@ allprojects {
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8"
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:${versions.coroutines}"
implementation "org.jetbrains.kotlinx:kotlinx-serialization-runtime:0.9.0"

implementation "com.google.protobuf:protobuf-java:${versions.protobuf}"
implementation "com.github.marcoferrer.krotoplus:kroto-plus-coroutines:${versions.krotoplus}"
implementation "com.github.marcoferrer.krotoplus:kroto-plus-test:${versions.krotoplus}"
Expand Down
8 changes: 8 additions & 0 deletions example-project/settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,13 @@ pluginManagement{
maven { url 'http://dl.bintray.com/kotlin/kotlin-eap' }
maven { url 'https://plugins.gradle.org/m2/' }
}

resolutionStrategy {
eachPlugin {
if (requested.id.id == "kotlinx-serialization") {
useModule("org.jetbrains.kotlin:kotlin-serialization:${requested.version}")
}
}
}
}
include 'kp-scripts'
23 changes: 23 additions & 0 deletions example-project/src/main/proto/test/message/nested_messages.proto
Original file line number Diff line number Diff line change
Expand Up @@ -78,4 +78,27 @@ message TestRepeated {
repeated string string_field = 15;
repeated bytes bytes_field = 16;
repeated L1Message1 message_field = 17;
}

message SimpleTest {
string a = 1;
string b = 2;
}

message OneOfMessage{

oneof value1 {
string value1_string = 1;
SimpleTest value1_message = 2;
int32 value1_int32 = 3;
TestEnum value1_enum = 4;
}

oneof value2 {
string value2_string = 5;
SimpleTest value2_message = 6;
int32 value2_int32 = 7;
TestEnum value2_enum = 8;
}

}
7 changes: 7 additions & 0 deletions example-project/testing.asciipb
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
proto_builders {
filter {
include_path: "test"
include_path: "asdasd"
}
unwrap_builders: true
}
Loading