-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add project sample with moshi-kotlin-codegen enabled
- Loading branch information
1 parent
a6c4427
commit 1a80090
Showing
3 changed files
with
59 additions
and
0 deletions.
There are no files selected for viewing
56 changes: 56 additions & 0 deletions
56
samples/kotlin-android-with-moshi-kotlin-codegen/build.gradle.kts
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,56 @@ | ||
plugins { | ||
id("com.android.library") version "3.5.3" | ||
kotlin("android") version "1.3.61" | ||
id("com.yelp.codegen.plugin") version "1.3.0" | ||
kotlin("kapt") version "1.3.61" | ||
} | ||
|
||
android { | ||
compileSdkVersion(28) | ||
defaultConfig { | ||
minSdkVersion(21) | ||
targetSdkVersion(28) | ||
versionCode = 1 | ||
versionName = "1.0" | ||
} | ||
} | ||
|
||
dependencies { | ||
// Kotlin | ||
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.3.61") | ||
|
||
// Moshi + OkHttp + Retrofit | ||
implementation("com.squareup.moshi:moshi:1.9.2") | ||
implementation("com.squareup.moshi:moshi-adapters:1.9.2") | ||
implementation("com.squareup.moshi:moshi-kotlin:1.9.2") | ||
implementation("com.squareup.okhttp3:okhttp:3.12.3") | ||
implementation("com.squareup.retrofit2:retrofit:2.7.1") | ||
implementation("com.squareup.retrofit2:converter-moshi:2.7.1") | ||
implementation("com.squareup.retrofit2:adapter-rxjava2:2.7.1") | ||
|
||
// moshi-kapt support (codegen generation of moshi json adapters) | ||
kapt("com.squareup.moshi:moshi-kotlin-codegen:1.9.2") | ||
|
||
// Date Support | ||
implementation("com.jakewharton.threetenabp:threetenabp:1.2.2") | ||
|
||
// RxJava | ||
implementation("io.reactivex.rxjava2:rxjava:2.2.17") | ||
implementation("io.reactivex.rxjava2:rxandroid:2.1.1") | ||
} | ||
|
||
generateSwagger { | ||
platform = "kotlin" | ||
packageName = "com.yelp.codegen.samples" | ||
specName = "sample_specs" | ||
specVersion = "1.0.0" | ||
inputFile = file("../sample_specs.json") | ||
outputDir = file("./src/main/java/") | ||
features { | ||
headersToRemove = arrayOf("Accept-Language") | ||
} | ||
} | ||
|
||
repositories { | ||
mavenCentral() | ||
} |
2 changes: 2 additions & 0 deletions
2
samples/kotlin-android-with-moshi-kotlin-codegen/src/main/AndroidManifest.xml
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,2 @@ | ||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | ||
package="com.yelp.samplelibrary"/> |
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