Skip to content

Commit dd2af4d

Browse files
committed
Update all sample project to use moshi-kotlin-codegen and remove not needed kotlin-android-moshi-codegen
1 parent 3cf4f93 commit dd2af4d

File tree

11 files changed

+6
-143
lines changed

11 files changed

+6
-143
lines changed

README.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,11 +76,9 @@ We're looking forward to more platforms to support in the future. Contributions
7676

7777
You can find some **examples** in this repository to help you set up your generator environment.
7878

79-
* [samples/groovy-android](/samples/groovy-android)<sup>*</sup> Contains an example of an Android Library configured with a `build.gradle` file, using the classical Gradle/Groovy as scripting language.
79+
* [samples/groovy-android](/samples/groovy-android) Contains an example of an Android Library configured with a `build.gradle` file, using the classical Gradle/Groovy as scripting language.
8080

81-
* [samples/kotlin-android](/samples/kotlin-android)<sup>*</sup> Contains an example of an Android Library configured with a `build.gradle.kts` file, using Kotlin as scripting language.
82-
83-
* [samples/kotlin-android-moshi-codegen](/samples/kotlin-android-moshi-codegen) Based on samples/kotlin-android but the configuration is using [`moshi-codegen`](https://github.com/square/moshi#codegen) for improved parsing performances and it defines proguard rules.
81+
* [samples/kotlin-android](/samples/kotlin-android) Contains an example of an Android Library configured with a `build.gradle.kts` file, using Kotlin as scripting language.
8482

8583
* [samples/kotlin-coroutines](/samples/kotlin-coroutines)<sup>*</sup> Contains an example of an Android Library configured to output Kotlin Coroutines capable code.
8684

samples/groovy-android/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ plugins {
22
id("com.android.library")
33
id("kotlin-android")
44
id("com.yelp.codegen.plugin")
5+
id("kotlin-kapt")
56
}
67

78
android {
@@ -17,16 +18,15 @@ android {
1718
dependencies {
1819
// Kotlin
1920
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.3.70"
20-
implementation "org.jetbrains.kotlin:kotlin-reflect:1.3.70"
2121

2222
// Moshi + OkHttp + Retrofit
2323
implementation "com.squareup.moshi:moshi:1.9.2"
2424
implementation "com.squareup.moshi:moshi-adapters:1.9.2"
25-
implementation "com.squareup.moshi:moshi-kotlin:1.9.2"
2625
implementation "com.squareup.okhttp3:okhttp:3.12.3"
2726
implementation "com.squareup.retrofit2:retrofit:2.7.1"
2827
implementation "com.squareup.retrofit2:converter-moshi:2.7.1"
2928
implementation "com.squareup.retrofit2:adapter-rxjava2:2.7.1"
29+
kapt "com.squareup.moshi:moshi-kotlin-codegen:1.9.2"
3030

3131
// Date Support
3232
implementation "com.jakewharton.threetenabp:threetenabp:1.2.2"

samples/junit-tests/build.gradle

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,10 @@ android {
1919
dependencies {
2020
// Kotlin
2121
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.3.70"
22-
implementation "org.jetbrains.kotlin:kotlin-reflect:1.3.70"
2322

2423
// Moshi + OkHttp + Retrofit
2524
implementation "com.squareup.moshi:moshi:1.9.2"
2625
implementation "com.squareup.moshi:moshi-adapters:1.9.2"
27-
implementation "com.squareup.moshi:moshi-kotlin:1.9.2"
2826
implementation "com.squareup.okhttp3:okhttp:3.12.3"
2927
implementation "com.squareup.retrofit2:retrofit:2.7.1"
3028
implementation "com.squareup.retrofit2:converter-moshi:2.7.1"

samples/junit-tests/src/main/java/com/yelp/codegen/generatecodesamples/tools/GeneratedCodeConverters.kt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
11
package com.yelp.codegen.generatecodesamples.tools
22

33
import com.squareup.moshi.Moshi
4-
import com.squareup.moshi.kotlin.reflect.KotlinJsonAdapterFactory
54
import retrofit2.Converter
65
import retrofit2.converter.moshi.MoshiConverterFactory
76

87
object GeneratedCodeConverters {
98
private val moshi = Moshi.Builder()
109
.add(XNullableAdapterFactory())
11-
.add(KotlinJsonAdapterFactory())
1210
.add(TypesAdapterFactory())
1311
.build()
1412

samples/kotlin-android-moshi-codegen/.gitignore

Lines changed: 0 additions & 1 deletion
This file was deleted.

samples/kotlin-android-moshi-codegen/build.gradle.kts

Lines changed: 0 additions & 60 deletions
This file was deleted.

samples/kotlin-android-moshi-codegen/moshi.pro

Lines changed: 0 additions & 65 deletions
This file was deleted.

samples/kotlin-android-moshi-codegen/src/main/AndroidManifest.xml

Lines changed: 0 additions & 2 deletions
This file was deleted.

samples/kotlin-android/build.gradle.kts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,10 @@ android {
1717
dependencies {
1818
// Kotlin
1919
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.3.70")
20-
implementation("org.jetbrains.kotlin:kotlin-reflect:1.3.70")
2120

2221
// Moshi + OkHttp + Retrofit
2322
implementation("com.squareup.moshi:moshi:1.9.2")
2423
implementation("com.squareup.moshi:moshi-adapters:1.9.2")
25-
implementation("com.squareup.moshi:moshi-kotlin:1.9.2")
2624
implementation("com.squareup.okhttp3:okhttp:3.12.3")
2725
implementation("com.squareup.retrofit2:retrofit:2.7.1")
2826
implementation("com.squareup.retrofit2:converter-moshi:2.7.1")

samples/kotlin-coroutines/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ plugins {
22
id("com.android.library")
33
id("kotlin-android")
44
id("com.yelp.codegen.plugin")
5+
id("kotlin-kapt")
56
}
67

78
android {
@@ -17,15 +18,14 @@ android {
1718
dependencies {
1819
// Kotlin
1920
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.3.70"
20-
implementation "org.jetbrains.kotlin:kotlin-reflect:1.3.70"
2121

2222
// Moshi + OkHttp + Retrofit
2323
implementation "com.squareup.moshi:moshi:1.9.2"
2424
implementation "com.squareup.moshi:moshi-adapters:1.9.2"
25-
implementation "com.squareup.moshi:moshi-kotlin:1.9.2"
2625
implementation "com.squareup.okhttp3:okhttp:3.12.3"
2726
implementation "com.squareup.retrofit2:retrofit:2.7.1"
2827
implementation "com.squareup.retrofit2:converter-moshi:2.7.1"
28+
kapt "com.squareup.moshi:moshi-kotlin-codegen:1.9.2"
2929

3030
// Date Support
3131
implementation "com.jakewharton.threetenabp:threetenabp:1.2.2"

0 commit comments

Comments
 (0)