Skip to content

Commit 66f2b9b

Browse files
committed
Update template to generate pretty output
1 parent 16ed8a3 commit 66f2b9b

File tree

6 files changed

+21
-21
lines changed

6 files changed

+21
-21
lines changed

gradle-plugin/plugin/src/main/resources/kotlin/tools/CollectionFormatConverterFactory.kt.mustache

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
package {{packageName}}.tools
22

3-
import java.lang.reflect.Type
43
import retrofit2.Converter
54
import retrofit2.Retrofit
5+
import java.lang.reflect.Type
66

77
internal class CollectionFormatConverterFactory : Converter.Factory() {
88

gradle-plugin/plugin/src/main/resources/kotlin/tools/EnumToValueConverterFactory.kt.mustache

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
package {{packageName}}.tools
22

33
import com.squareup.moshi.Json
4-
import java.lang.reflect.Type
54
import retrofit2.Converter
65
import retrofit2.Retrofit
6+
import java.lang.reflect.Type
77

88
internal class EnumToValueConverterFactory : Converter.Factory() {
99

gradle-plugin/plugin/src/main/resources/kotlin/tools/GeneratedCodeConverters.kt.mustache

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ import retrofit2.converter.moshi.MoshiConverterFactory
66

77
object GeneratedCodeConverters {
88
private val moshi = Moshi.Builder()
9-
.add(XNullableAdapterFactory())
10-
.add(TypesAdapterFactory())
11-
.build()
9+
.add(XNullableAdapterFactory())
10+
.add(TypesAdapterFactory())
11+
.build()
1212
1313
/**
1414
* Creates everything needed for retrofit to make it work with the client lib, including a
@@ -19,18 +19,18 @@ object GeneratedCodeConverters {
1919
@JvmStatic
2020
fun converterFactory(): Converter.Factory {
2121
return WrapperConverterFactory(
22-
CollectionFormatConverterFactory(),
23-
EnumToValueConverterFactory(),
24-
MoshiConverterFactory.create(moshi)
22+
CollectionFormatConverterFactory(),
23+
EnumToValueConverterFactory(),
24+
MoshiConverterFactory.create(moshi)
2525
)
2626
}
2727

2828
@JvmStatic
2929
fun converterFactory(moshi: Moshi): Converter.Factory {
3030
return WrapperConverterFactory(
31-
CollectionFormatConverterFactory(),
32-
EnumToValueConverterFactory(),
33-
MoshiConverterFactory.create(moshi)
31+
CollectionFormatConverterFactory(),
32+
EnumToValueConverterFactory(),
33+
MoshiConverterFactory.create(moshi)
3434
)
3535
}
3636
}

gradle-plugin/plugin/src/main/resources/kotlin/tools/TypesAdapters.kt.mustache

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ import java.time.format.DateTimeFormatter
2020
*/
2121
class TypesAdapterFactory : JsonAdapter.Factory {
2222
private val types = mapOf<Type, JsonAdapter<*>>(
23-
LocalDate::class.java to LocalDateAdapter(),
24-
ZonedDateTime::class.java to ZonedDateTimeAdapter(),
25-
BigDecimal::class.java to BigDecimalJsonAdapter()
23+
LocalDate::class.java to LocalDateAdapter(),
24+
ZonedDateTime::class.java to ZonedDateTimeAdapter(),
25+
BigDecimal::class.java to BigDecimalJsonAdapter()
2626
)
2727
2828
override fun create(type: Type, annotations: MutableSet<out Annotation>, moshi: Moshi): JsonAdapter<*>? {

gradle-plugin/plugin/src/main/resources/kotlin/tools/WrapperConverterFactory.kt.mustache

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
package {{packageName}}.tools
22

3-
import java.lang.reflect.Type
43
import okhttp3.RequestBody
54
import okhttp3.ResponseBody
65
import retrofit2.Converter
76
import retrofit2.Retrofit
7+
import java.lang.reflect.Type
88

99
internal class WrapperConverterFactory(private vararg val factories: Converter.Factory) : Converter.Factory() {
1010

gradle-plugin/plugin/src/main/resources/kotlin/tools/XNullableAdapterFactory.kt.mustache

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ class XNullableAdapterFactory : JsonAdapter.Factory {
1313
override fun fromJson(reader: JsonReader): Any? {
1414
return if (reader.peek() != JsonReader.Token.NULL) {
1515
val nextAdapter = moshi.nextAdapter<Any>(
16-
this@XNullableAdapterFactory,
17-
type,
18-
annotations.removeXNullableAnnotation()
16+
this@XNullableAdapterFactory,
17+
type,
18+
annotations.removeXNullableAnnotation()
1919
)
2020
nextAdapter?.fromJson(reader)
2121
} else {
@@ -31,9 +31,9 @@ class XNullableAdapterFactory : JsonAdapter.Factory {
3131
writer.serializeNulls = serializeNulls
3232
} else {
3333
val nextAdapter = moshi.nextAdapter<Any>(
34-
this@XNullableAdapterFactory,
35-
type,
36-
annotations.removeXNullableAnnotation()
34+
this@XNullableAdapterFactory,
35+
type,
36+
annotations.removeXNullableAnnotation()
3737
)
3838
nextAdapter?.toJson(writer, value)
3939
}

0 commit comments

Comments
 (0)