-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
41 changed files
with
151 additions
and
94 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,32 @@ | ||
package example.app | ||
|
||
import com.squareup.wire.schema.Location | ||
import com.squareup.wire.schema.MessageType | ||
import com.squareup.wire.schema.Schema | ||
import com.squareup.wire.schema.SchemaLoader | ||
import java.io.File | ||
import java.nio.file.FileSystems | ||
|
||
fun main() { | ||
println("Yay!") | ||
val schema = schema() | ||
schema.protoFiles[0].types.forEach { type -> | ||
val message = type as MessageType | ||
println("message ${message.name} {") | ||
message.declaredFields.forEach { field -> | ||
var labels = "" | ||
if (!field.isRequired && !field.isRepeated) labels += "optional " | ||
if (field.isRepeated) labels += "repeated " | ||
|
||
println(" ${labels}${field.type} ${field.name} = ${field.tag};") | ||
} | ||
println("}") | ||
} | ||
} | ||
|
||
private fun schema(): Schema { | ||
val schemaLoader = SchemaLoader(FileSystems.getDefault()) | ||
val root = File("app/src/main/proto").absolutePath | ||
println(root) | ||
schemaLoader.initRoots(listOf(Location.get(root))) | ||
return schemaLoader.loadSchema() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
syntax = "proto2"; | ||
|
||
package squareup.wire.sample; | ||
|
||
message SampleMessage { | ||
repeated string array = 1; | ||
} | ||
|
||
message SampleRequest { | ||
optional string name = 1; | ||
optional SampleMessage sample_message = 2; | ||
} | ||
|
||
message SampleResponse { | ||
optional int32 age = 1; | ||
} | ||
|
||
// This is it. A really fantastic service interface. | ||
service SampleApi { | ||
// Call this RPC. You'll be glad you did! | ||
rpc FirstRpc (SampleRequest) returns (SampleResponse); | ||
rpc OtherOne (SampleRequest) returns (SampleResponse); | ||
} |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
.gradle-7.6.pkg | ||
.gradle@latest.pkg |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
.corretto-17.0.6.10.1.pkg | ||
.corretto@latest.pkg |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
.corretto-17.0.6.10.1.pkg | ||
.corretto@latest.pkg |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
.corretto-17.0.6.10.1.pkg | ||
.corretto@latest.pkg |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
.corretto-17.0.6.10.1.pkg | ||
.corretto@latest.pkg |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
.corretto-17.0.6.10.1.pkg | ||
.corretto@latest.pkg |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
.corretto-17.0.6.10.1.pkg | ||
.corretto@latest.pkg |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
.corretto-17.0.6.10.1.pkg | ||
.corretto@latest.pkg |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
.corretto-17.0.6.10.1.pkg | ||
.corretto@latest.pkg |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
.corretto-17.0.6.10.1.pkg | ||
.corretto@latest.pkg |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
.corretto-17.0.6.10.1.pkg | ||
.corretto@latest.pkg |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
.corretto-17.0.6.10.1.pkg | ||
.corretto@latest.pkg |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
.corretto-17.0.6.10.1.pkg | ||
.corretto@latest.pkg |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
.corretto-17.0.6.10.1.pkg | ||
.corretto@latest.pkg |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
.corretto-17.0.6.10.1.pkg | ||
.corretto@latest.pkg |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
.corretto-17.0.6.10.1.pkg | ||
.corretto@latest.pkg |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
.corretto-17.0.6.10.1.pkg | ||
.corretto@latest.pkg |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
.corretto-17.0.6.10.1.pkg | ||
.corretto@latest.pkg |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
.corretto-17.0.6.10.1.pkg | ||
.corretto@latest.pkg |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
.corretto-17.0.6.10.1.pkg | ||
.corretto@latest.pkg |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
.corretto-17.0.6.10.1.pkg | ||
.corretto@latest.pkg |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
.corretto-17.0.6.10.1.pkg | ||
.corretto@latest.pkg |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
.corretto-17.0.6.10.1.pkg | ||
.corretto@latest.pkg |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
.corretto-17.0.6.10.1.pkg | ||
.corretto@latest.pkg |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
.corretto-17.0.6.10.1.pkg | ||
.corretto@latest.pkg |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
.corretto-17.0.6.10.1.pkg | ||
.corretto@latest.pkg |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
.corretto-17.0.6.10.1.pkg | ||
.corretto@latest.pkg |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
.corretto-17.0.6.10.1.pkg | ||
.corretto@latest.pkg |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
.corretto-17.0.6.10.1.pkg | ||
.corretto@latest.pkg |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile | ||
|
||
repositories { | ||
mavenCentral() | ||
gradlePluginPortal() | ||
} | ||
|
||
plugins { | ||
kotlin("jvm").version(Dependencies.kotlinVersion) | ||
kotlin("plugin.serialization").version(Dependencies.kotlinVersion) | ||
} | ||
|
||
subprojects { | ||
apply(plugin = "org.jetbrains.kotlin.jvm") | ||
apply(plugin = "org.jetbrains.kotlin.plugin.serialization") | ||
apply(plugin = "application") | ||
|
||
|
||
repositories { | ||
// Use Maven Central for resolving dependencies. | ||
mavenCentral() | ||
} | ||
|
||
tasks.withType<JavaCompile> { | ||
sourceCompatibility = JavaVersion.VERSION_17.toString() | ||
targetCompatibility = JavaVersion.VERSION_17.toString() | ||
} | ||
|
||
tasks.withType<KotlinCompile> { | ||
kotlinOptions { | ||
freeCompilerArgs = listOf("-Xjsr305=strict") | ||
jvmTarget = JavaVersion.VERSION_17.toString() | ||
} | ||
} | ||
|
||
tasks.named<Test>("test") { | ||
// Use JUnit Platform for unit tests. | ||
useJUnitPlatform() | ||
environment("ENVIRONMENT", "test") | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,26 @@ | ||
/* | ||
* This file was generated by the Gradle 'init' task. | ||
*/ | ||
// | ||
//plugins { | ||
// // Support convention plugins written in Kotlin. Convention plugins are build scripts in 'src/main' that automatically become available as plugins in the main build. | ||
// `kotlin-dsl` | ||
//} | ||
// | ||
//repositories { | ||
// // Use the plugin portal to apply community plugins in convention plugins. | ||
// gradlePluginPortal() | ||
//} | ||
// | ||
//dependencies { | ||
// implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.10") | ||
//} | ||
|
||
plugins { | ||
// Support convention plugins written in Kotlin. Convention plugins are build scripts in 'src/main' that automatically become available as plugins in the main build. | ||
`kotlin-dsl` | ||
} | ||
|
||
repositories { | ||
// Use the plugin portal to apply community plugins in convention plugins. | ||
gradlePluginPortal() | ||
} | ||
|
||
dependencies { | ||
implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.10") | ||
} | ||
// Use Maven Central for resolving dependencies. | ||
mavenCentral() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
object Dependencies { | ||
const val kotlinVersion ="1.8.20" | ||
const val wireBom = "com.squareup.wire:wire-bom:4.5.5" | ||
const val wireSchema = "com.squareup.wire:wire-schema:" | ||
const val kotlinxSerializationJson = "org.jetbrains.kotlinx:kotlinx-serialization-json:1.5.0" | ||
|
||
} | ||
|
11 changes: 0 additions & 11 deletions
11
kotlin/buildSrc/src/main/kotlin/example.kotlin-application-conventions.gradle.kts
This file was deleted.
Oops, something went wrong.
28 changes: 0 additions & 28 deletions
28
kotlin/buildSrc/src/main/kotlin/example.kotlin-common-conventions.gradle.kts
This file was deleted.
Oops, something went wrong.
11 changes: 0 additions & 11 deletions
11
kotlin/buildSrc/src/main/kotlin/example.kotlin-library-conventions.gradle.kts
This file was deleted.
Oops, something went wrong.