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

Add square/wire #84

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
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
19 changes: 14 additions & 5 deletions kotlin-jvm/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,29 +1,38 @@
import Square.wire
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

plugins {
kotlin("jvm")
kotlin("kapt")
kotlin("plugin.serialization")
id("com.squareup.sqldelight")
id("com.squareup.wire")
id ("application")
}

group = "playground"

repositories {
mavenLocal()
mavenCentral()
Comment on lines 15 to -14
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did you remove mavenCentral()?

google()
jcenter()
maven(url = "https://dl.bintray.com/kotlin/kotlin-eap/")
}


Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why a random added line?

sqldelight {
database("AppDatabase") {
packageName = "util"
}
linkSqlite = false
}

wire {
kotlin {

}
}
Comment on lines +29 to +33
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why this empty config?



// File build.gradle.kts
dependencies {

Expand All @@ -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")
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you read the contributing guide? If so, please read it again, otherwise, please read it, there's some important considerations regarding adding dependencies.

implementation(JakeWharton.retrofit2.converter.kotlinxSerialization)
implementation(Kotlin.stdlib.jdk8)
implementation(KotlinX.collections.immutable)
Expand Down Expand Up @@ -91,9 +101,7 @@ tasks.withType<Test> {
useJUnitPlatform()
}

tasks.register("run", JavaExec::class.java) {
this.main = "playground._mainKt"
}
Comment on lines -94 to -96
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did you remove this?


Comment on lines -94 to +104
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why this random line break?


/**
* How do I setup GitHub Actions for my Gradle or Android project?
Expand Down Expand Up @@ -121,3 +129,4 @@ tasks.register<DefaultTask>("hello") {
group = "Custom"
description = "Minimal task that do nothing. Useful to debug a failing build"
}

11 changes: 10 additions & 1 deletion kotlin-jvm/settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
import de.fayard.refreshVersions.bootstrapRefreshVersions

pluginManagement {
repositories {
gradlePluginPortal()
mavenCentral()
}
}

buildscript {
repositories { mavenLocal() ; gradlePluginPortal() }
repositories { mavenLocal() }
Comment on lines -4 to +11
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did you remove the gradlePluginPortal() repo?

val useSnapshot = false
dependencies.classpath(
if (useSnapshot) "de.fayard.refreshVersions:refreshVersions:0.9.6-SNAPSHOT" else "de.fayard.refreshVersions:refreshVersions:0.9.5"
Expand All @@ -12,6 +19,7 @@ plugins {
id("com.gradle.enterprise") version "3.4.1"
}


Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why this line break?

// https://dev.to/jmfayard/the-one-gradle-trick-that-supersedes-all-the-others-5bpg
gradleEnterprise {
buildScan {
Expand All @@ -21,6 +29,7 @@ gradleEnterprise {
}
}


Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why this line break?

rootProject.name = "kotlin-libraries-playground"

bootstrapRefreshVersions()
4 changes: 4 additions & 0 deletions kotlin-jvm/src/main/kotlin/playground/wire/Wire.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
package playground.wire

fun main() {
}
Comment on lines +3 to +4
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why this empty main function?

15 changes: 15 additions & 0 deletions kotlin-jvm/src/main/kotlin/playground/wire/proto/ProtoFile.proto
Original file line number Diff line number Diff line change
@@ -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;
}
4 changes: 4 additions & 0 deletions kotlin-jvm/versions.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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