From eab6363c2b262fa04e442e7590caa917e5d2d346 Mon Sep 17 00:00:00 2001 From: sijanr Date: Fri, 30 Oct 2020 08:58:57 -0700 Subject: [PATCH] For #8: Initial commit --- kotlin-jvm/build.gradle.kts | 19 ++++++++++++++----- kotlin-jvm/settings.gradle.kts | 11 ++++++++++- .../src/main/kotlin/playground/wire/Wire.kt | 4 ++++ .../playground/wire/proto/ProtoFile.proto | 15 +++++++++++++++ kotlin-jvm/versions.properties | 4 ++++ 5 files changed, 47 insertions(+), 6 deletions(-) create mode 100644 kotlin-jvm/src/main/kotlin/playground/wire/Wire.kt create mode 100644 kotlin-jvm/src/main/kotlin/playground/wire/proto/ProtoFile.proto diff --git a/kotlin-jvm/build.gradle.kts b/kotlin-jvm/build.gradle.kts index b9dd137..2794d78 100644 --- a/kotlin-jvm/build.gradle.kts +++ b/kotlin-jvm/build.gradle.kts @@ -1,3 +1,4 @@ +import Square.wire import org.jetbrains.kotlin.gradle.tasks.KotlinCompile plugins { @@ -5,18 +6,19 @@ plugins { kotlin("kapt") kotlin("plugin.serialization") id("com.squareup.sqldelight") + id("com.squareup.wire") + id ("application") } group = "playground" repositories { - mavenLocal() - mavenCentral() google() jcenter() maven(url = "https://dl.bintray.com/kotlin/kotlin-eap/") } + sqldelight { database("AppDatabase") { packageName = "util" @@ -24,6 +26,13 @@ sqldelight { linkSqlite = false } +wire { + kotlin { + + } +} + + // File build.gradle.kts dependencies { @@ -49,6 +58,7 @@ dependencies { implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:_") implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:_") implementation("org.kodein.di:kodein-di:_") + implementation ("com.squareup.wire:wire-runtime:3.4.0") implementation(JakeWharton.retrofit2.converter.kotlinxSerialization) implementation(Kotlin.stdlib.jdk8) implementation(KotlinX.collections.immutable) @@ -91,9 +101,7 @@ tasks.withType { useJUnitPlatform() } -tasks.register("run", JavaExec::class.java) { - this.main = "playground._mainKt" -} + /** * How do I setup GitHub Actions for my Gradle or Android project? @@ -121,3 +129,4 @@ tasks.register("hello") { group = "Custom" description = "Minimal task that do nothing. Useful to debug a failing build" } + diff --git a/kotlin-jvm/settings.gradle.kts b/kotlin-jvm/settings.gradle.kts index e35b979..6754d93 100644 --- a/kotlin-jvm/settings.gradle.kts +++ b/kotlin-jvm/settings.gradle.kts @@ -1,7 +1,14 @@ import de.fayard.refreshVersions.bootstrapRefreshVersions +pluginManagement { + repositories { + gradlePluginPortal() + mavenCentral() + } +} + buildscript { - repositories { mavenLocal() ; gradlePluginPortal() } + repositories { mavenLocal() } val useSnapshot = false dependencies.classpath( if (useSnapshot) "de.fayard.refreshVersions:refreshVersions:0.9.6-SNAPSHOT" else "de.fayard.refreshVersions:refreshVersions:0.9.5" @@ -12,6 +19,7 @@ plugins { id("com.gradle.enterprise") version "3.4.1" } + // https://dev.to/jmfayard/the-one-gradle-trick-that-supersedes-all-the-others-5bpg gradleEnterprise { buildScan { @@ -21,6 +29,7 @@ gradleEnterprise { } } + rootProject.name = "kotlin-libraries-playground" bootstrapRefreshVersions() \ No newline at end of file diff --git a/kotlin-jvm/src/main/kotlin/playground/wire/Wire.kt b/kotlin-jvm/src/main/kotlin/playground/wire/Wire.kt new file mode 100644 index 0000000..0e328aa --- /dev/null +++ b/kotlin-jvm/src/main/kotlin/playground/wire/Wire.kt @@ -0,0 +1,4 @@ +package playground.wire + +fun main() { +} \ No newline at end of file diff --git a/kotlin-jvm/src/main/kotlin/playground/wire/proto/ProtoFile.proto b/kotlin-jvm/src/main/kotlin/playground/wire/proto/ProtoFile.proto new file mode 100644 index 0000000..1802f74 --- /dev/null +++ b/kotlin-jvm/src/main/kotlin/playground/wire/proto/ProtoFile.proto @@ -0,0 +1,15 @@ + +//Using proto3 version of the proto buffer language +syntax = "proto3"; + +// message type +message HacktoberFest { + string library_name = 1; + repeated int32 hacktoberfest_participation_years = 2; + User user = 3; +} + +message User { + string user_name = 1; + bool user_participation_this_year = 2; +} \ No newline at end of file diff --git a/kotlin-jvm/versions.properties b/kotlin-jvm/versions.properties index 9d6d425..0fc46ba 100644 --- a/kotlin-jvm/versions.properties +++ b/kotlin-jvm/versions.properties @@ -7,6 +7,8 @@ plugin.com.squareup.sqldelight=1.4.3 +plugin.com.squareup.wire=3.4.0 + version.com.github.ajalt.clikt..clikt=3.0.1 version.com.github.ajalt.mordant=1.2.1 @@ -74,3 +76,5 @@ version.retrofit2=2.9.0 version.sqldelight=1.4.3 version.com.github.ajalt..mordant=1.2.1 + +version.wire=3.4.0