mirror of
https://github.com/fankes/moshi.git
synced 2025-10-19 16:09:21 +08:00
Update formatters to latest
Ensure renovate can bump them by specifying full coordinates in toml.
This commit is contained in:
@@ -21,9 +21,10 @@ val java16: SourceSet by sourceSets.creating {
|
||||
|
||||
// We use JDK 17 for latest but target 16 for maximum compatibility
|
||||
val service = project.extensions.getByType<JavaToolchainService>()
|
||||
val customLauncher = service.launcherFor {
|
||||
languageVersion.set(JavaLanguageVersion.of(17))
|
||||
}
|
||||
val customLauncher =
|
||||
service.launcherFor {
|
||||
languageVersion.set(JavaLanguageVersion.of(17))
|
||||
}
|
||||
|
||||
tasks.named<JavaCompile>("compileJava16Java") {
|
||||
options.release.set(16)
|
||||
|
@@ -18,42 +18,49 @@ dependencies {
|
||||
latest(project(":moshi"))
|
||||
}
|
||||
|
||||
val japicmp = tasks.register<JapicmpTask>("japicmp") {
|
||||
dependsOn("jar")
|
||||
oldClasspath.from(baseline)
|
||||
newClasspath.from(latest)
|
||||
onlyBinaryIncompatibleModified.set(true)
|
||||
failOnModification.set(true)
|
||||
txtOutputFile.set(layout.buildDirectory.file("reports/japi.txt"))
|
||||
ignoreMissingClasses.set(true)
|
||||
includeSynthetic.set(true)
|
||||
classExcludes.addAll(
|
||||
"com.squareup.moshi.AdapterMethodsFactory", // Internal.
|
||||
"com.squareup.moshi.ClassJsonAdapter", // Internal.
|
||||
"com.squareup.moshi.RecordJsonAdapter\$ComponentBinding", // Package-private
|
||||
"com.squareup.moshi.StandardJsonAdapters", // Package-private
|
||||
"com.squareup.moshi.internal.NonNullJsonAdapter", // Internal.
|
||||
"com.squareup.moshi.internal.NullSafeJsonAdapter", // Internal.
|
||||
"com.squareup.moshi.internal.Util\$GenericArrayTypeImpl", // Internal.
|
||||
"com.squareup.moshi.internal.Util\$ParameterizedTypeImpl", // Internal.
|
||||
"com.squareup.moshi.internal.Util\$WildcardTypeImpl", // Internal.
|
||||
)
|
||||
methodExcludes.addAll(
|
||||
"com.squareup.moshi.JsonAdapter#indent(java.lang.String)", // Was unintentionally open before
|
||||
"com.squareup.moshi.internal.Util#hasNullable(java.lang.annotation.Annotation[])",
|
||||
"com.squareup.moshi.internal.Util#jsonAnnotations(java.lang.annotation.Annotation[])",
|
||||
"com.squareup.moshi.internal.Util#jsonAnnotations(java.lang.reflect.AnnotatedElement)",
|
||||
"com.squareup.moshi.internal.Util#jsonName(java.lang.String, com.squareup.moshi.Json)",
|
||||
"com.squareup.moshi.internal.Util#jsonName(java.lang.String, java.lang.reflect.AnnotatedElement)",
|
||||
"com.squareup.moshi.internal.Util#resolve(java.lang.reflect.Type, java.lang.Class, java.lang.reflect.Type)",
|
||||
"com.squareup.moshi.internal.Util#typeAnnotatedWithAnnotations(java.lang.reflect.Type, java.util.Set)",
|
||||
)
|
||||
fieldExcludes.addAll(
|
||||
"com.squareup.moshi.CollectionJsonAdapter#FACTORY", // False-positive, class is not public anyway
|
||||
"com.squareup.moshi.MapJsonAdapter#FACTORY", // Class is not public
|
||||
"com.squareup.moshi.ArrayJsonAdapter#FACTORY", // Class is not public
|
||||
)
|
||||
}
|
||||
val japicmp =
|
||||
tasks.register<JapicmpTask>("japicmp") {
|
||||
dependsOn("jar")
|
||||
oldClasspath.from(baseline)
|
||||
newClasspath.from(latest)
|
||||
onlyBinaryIncompatibleModified.set(true)
|
||||
failOnModification.set(true)
|
||||
txtOutputFile.set(layout.buildDirectory.file("reports/japi.txt"))
|
||||
ignoreMissingClasses.set(true)
|
||||
includeSynthetic.set(true)
|
||||
classExcludes.addAll(
|
||||
// Internal.
|
||||
"com.squareup.moshi.AdapterMethodsFactory",
|
||||
"com.squareup.moshi.ClassJsonAdapter",
|
||||
"com.squareup.moshi.internal.NonNullJsonAdapter",
|
||||
"com.squareup.moshi.internal.NullSafeJsonAdapter",
|
||||
"com.squareup.moshi.internal.Util\$GenericArrayTypeImpl",
|
||||
"com.squareup.moshi.internal.Util\$ParameterizedTypeImpl",
|
||||
"com.squareup.moshi.internal.Util\$WildcardTypeImpl",
|
||||
// Package-private
|
||||
"com.squareup.moshi.RecordJsonAdapter\$ComponentBinding",
|
||||
"com.squareup.moshi.StandardJsonAdapters",
|
||||
)
|
||||
methodExcludes.addAll(
|
||||
// Was unintentionally open before
|
||||
"com.squareup.moshi.JsonAdapter#indent(java.lang.String)",
|
||||
"com.squareup.moshi.internal.Util#hasNullable(java.lang.annotation.Annotation[])",
|
||||
"com.squareup.moshi.internal.Util#jsonAnnotations(java.lang.annotation.Annotation[])",
|
||||
"com.squareup.moshi.internal.Util#jsonAnnotations(java.lang.reflect.AnnotatedElement)",
|
||||
"com.squareup.moshi.internal.Util#jsonName(java.lang.String, com.squareup.moshi.Json)",
|
||||
"com.squareup.moshi.internal.Util#jsonName(java.lang.String, java.lang.reflect.AnnotatedElement)",
|
||||
"com.squareup.moshi.internal.Util#resolve(java.lang.reflect.Type, java.lang.Class, java.lang.reflect.Type)",
|
||||
"com.squareup.moshi.internal.Util#typeAnnotatedWithAnnotations(java.lang.reflect.Type, java.util.Set)",
|
||||
)
|
||||
fieldExcludes.addAll(
|
||||
// False-positive, class is not public anyway
|
||||
"com.squareup.moshi.CollectionJsonAdapter#FACTORY",
|
||||
// Class is not public
|
||||
"com.squareup.moshi.MapJsonAdapter#FACTORY",
|
||||
// Class is not public
|
||||
"com.squareup.moshi.ArrayJsonAdapter#FACTORY",
|
||||
)
|
||||
}
|
||||
|
||||
tasks.named("check").configure {
|
||||
dependsOn(japicmp)
|
||||
|
@@ -448,7 +448,8 @@ internal class JsonUtf8Reader : JsonReader {
|
||||
checkLenient() // fall-through
|
||||
false
|
||||
}
|
||||
'{', '}', '[', ']', ':', ',', ' ', '\t', '\u000C'/*\f*/, '\r', '\n' -> false
|
||||
// 0x000C = \f
|
||||
'{', '}', '[', ']', ':', ',', ' ', '\t', '\u000C', '\r', '\n' -> false
|
||||
else -> true
|
||||
}
|
||||
}
|
||||
|
@@ -151,6 +151,7 @@ public sealed class JsonWriter : Closeable, Flushable {
|
||||
* pretty printing.
|
||||
*/
|
||||
@JvmField
|
||||
@Suppress("ktlint:standard:property-naming") // Exposed to sealed subtypes.
|
||||
protected var _indent: String? = null
|
||||
public open var indent: String
|
||||
/**
|
||||
|
Reference in New Issue
Block a user