Files
moshi/moshi/japicmp/build.gradle.kts
Zac Sweers 323d97c787 Convert JsonAdapter to Kotlin (#1475)
* Rename .java to .kt

* Convert JsonAdapter to Kotlin

Note that there's more to be done here I think, namely exploring removing the NonNull adapter and making the nullSafe() adapter public so that nullability is directly in the API. Saving that for another day though

* Update a couple usages

* Fix override

* Add exclusion for open

* Add `@Language` annotation for json strings

Allows the IDE to automatically make this pretty

* Spotless

* Nullable

Co-authored-by: Egor Andreevich <egor@squareup.com>

* When

Co-authored-by: Parth Padgaonkar <1294660+JvmName@users.noreply.github.com>

* Another when

* Spotless

Co-authored-by: Egor Andreevich <egor@squareup.com>
Co-authored-by: Parth Padgaonkar <1294660+JvmName@users.noreply.github.com>
2022-01-10 11:29:37 -05:00

44 lines
1.2 KiB
Plaintext

import me.champeau.gradle.japicmp.JapicmpTask
plugins {
`java-library`
id("me.champeau.gradle.japicmp")
}
val baseline = configurations.create("baseline")
val latest = configurations.create("latest")
dependencies {
baseline("com.squareup.moshi:moshi:1.13.0") {
isTransitive = false
isForce = true
}
latest(project(":moshi"))
}
val japicmp = tasks.register<JapicmpTask>("japicmp") {
dependsOn("jar")
oldClasspath = baseline
newClasspath = latest
isOnlyBinaryIncompatibleModified = true
isFailOnModification = true
txtOutputFile = file("$buildDir/reports/japi.txt")
isIgnoreMissingClasses = true
isIncludeSynthetic = true
classExcludes = listOf(
"com.squareup.moshi.internal.NonNullJsonAdapter", // Internal.
"com.squareup.moshi.internal.NullSafeJsonAdapter", // Internal.
"com.squareup.moshi.internal.Util" // Internal.
)
methodExcludes = listOf(
"com.squareup.moshi.JsonAdapter#indent(java.lang.String)" // Was unintentionally open before
)
fieldExcludes = listOf(
"com.squareup.moshi.CollectionJsonAdapter#FACTORY" // False-positive, class is not public anyway
)
}
tasks.named("check").configure {
dependsOn(japicmp)
}