mirror of
https://github.com/Instadapp/chains.git
synced 2024-07-29 22:37:19 +00:00
Move to moshi ksp codegen instead of reflection
and DRY up gradle files
This commit is contained in:
parent
dfba60a7b8
commit
70f175e5e1
|
@ -14,4 +14,13 @@ buildscript {
|
|||
}
|
||||
}
|
||||
|
||||
subprojects {
|
||||
apply plugin: "kotlin"
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
maven { url 'https://jitpack.io' }
|
||||
}
|
||||
}
|
||||
|
||||
apply plugin: "com.github.ben-manes.versions"
|
|
@ -1,15 +1,12 @@
|
|||
apply plugin: "kotlin"
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
maven { url 'https://jitpack.io' }
|
||||
plugins {
|
||||
id("com.google.devtools.ksp").version("1.6.10-1.0.2")
|
||||
}
|
||||
|
||||
dependencies {
|
||||
ksp("com.squareup.moshi:moshi-kotlin-codegen:1.13.0")
|
||||
implementation "org.jetbrains.kotlin:kotlin-stdlib:${KOTLIN_VERSION}"
|
||||
|
||||
implementation 'com.squareup.moshi:moshi-kotlin:1.13.0'
|
||||
implementation 'com.squareup.moshi:moshi:1.13.0'
|
||||
implementation 'com.squareup.okhttp3:okhttp:4.9.3'
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
package org.ethereum.lists.chains.model
|
||||
|
||||
import com.squareup.moshi.JsonClass
|
||||
|
||||
@JsonClass(generateAdapter = true)
|
||||
data class Chain(
|
||||
val name: String,
|
||||
val shortName: String,
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
package org.ethereum.lists.chains.model
|
||||
|
||||
import com.squareup.moshi.JsonClass
|
||||
|
||||
@JsonClass(generateAdapter = true)
|
||||
data class Explorer(
|
||||
val name: String,
|
||||
val url: String,
|
||||
|
|
|
@ -1,13 +1,7 @@
|
|||
apply plugin: "kotlin"
|
||||
apply plugin: "application"
|
||||
|
||||
mainClassName = "org.ethereum.lists.chains.MainKt"
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
maven { url 'https://jitpack.io' }
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation "org.jetbrains.kotlin:kotlin-stdlib:${KOTLIN_VERSION}"
|
||||
|
||||
|
@ -17,7 +11,7 @@ dependencies {
|
|||
implementation "com.github.komputing.kethereum:crypto_impl_bouncycastle:${KETHEREUM_VERSION}"
|
||||
|
||||
implementation 'com.beust:klaxon:5.5'
|
||||
implementation 'com.squareup.moshi:moshi-kotlin:1.13.0'
|
||||
implementation 'com.squareup.moshi:moshi:1.13.0'
|
||||
implementation 'com.squareup.okhttp3:okhttp:4.9.3'
|
||||
|
||||
implementation project(":model")
|
||||
|
|
|
@ -2,7 +2,6 @@ package org.ethereum.lists.chains
|
|||
|
||||
import com.squareup.moshi.JsonAdapter
|
||||
import com.squareup.moshi.Moshi
|
||||
import com.squareup.moshi.kotlin.reflect.KotlinJsonAdapterFactory
|
||||
import org.ethereum.lists.chains.model.Chain
|
||||
|
||||
val mandatory_fields = listOf(
|
||||
|
@ -25,5 +24,5 @@ val optionalFields = listOf(
|
|||
"parent"
|
||||
)
|
||||
|
||||
val moshi: Moshi = Moshi.Builder().add(KotlinJsonAdapterFactory()).build()
|
||||
val moshi: Moshi = Moshi.Builder().build()
|
||||
val chainAdapter: JsonAdapter<Chain> = moshi.adapter(Chain::class.java)
|
||||
|
|
Loading…
Reference in New Issue
Block a user