@@ -39,47 +39,26 @@ abstract class PostProcessGeneratedApi @Inject constructor(
39
39
40
40
private fun postProcess (srcDir : File , modelsPackage : String ) {
41
41
// Replace Response<X> with X in every method return type of DevelocityApi.kt
42
- ant.withGroovyBuilder {
43
- " replaceregexp" (
44
- " match" to " : Response<(.*?)>$" ,
45
- " replace" to """ : \1""" ,
46
- " flags" to " gm" ,
47
- ) {
48
- " fileset" (
49
- " dir" to srcDir,
50
- " includes" to " com/gabrielfeo/develocity/api/*Api.kt" ,
51
- )
52
- }
53
- }
42
+ replaceAll(
43
+ match = " : Response<(.*?)>$" ,
44
+ replace = """ : \1""" ,
45
+ dir = srcDir,
46
+ includes = " com/gabrielfeo/develocity/api/*Api.kt" ,
47
+ )
54
48
// Add @JvmSuppressWildcards to avoid square/retrofit#3275
55
- ant.withGroovyBuilder {
56
- " replaceregexp" (
57
- " match" to " interface" ,
58
- " replace" to """
59
- @JvmSuppressWildcards
60
- interface
61
- """ .trimIndent(),
62
- " flags" to " m" ,
63
- ) {
64
- " fileset" (
65
- " dir" to srcDir,
66
- " includes" to " com/gabrielfeo/develocity/api/*Api.kt" ,
67
- )
68
- }
69
- }
49
+ replaceAll(
50
+ match = " interface" ,
51
+ replace = " @JvmSuppressWildcards\n interface" ,
52
+ dir = srcDir,
53
+ includes = " com/gabrielfeo/develocity/api/*Api.kt" ,
54
+ )
70
55
// Fix mapping of BuildModelName: gradle-attributes -> gradleAttributes
71
- ant.withGroovyBuilder {
72
- " replaceregexp" (
73
- " match" to " Minus" ,
74
- " replace" to " " ,
75
- " flags" to " mg" ,
76
- ) {
77
- " fileset" (
78
- " dir" to srcDir,
79
- " includes" to " com/gabrielfeo/develocity/api/model/BuildModelName.kt" ,
80
- )
81
- }
82
- }
56
+ replaceAll(
57
+ match = " Minus" ,
58
+ replace = " " ,
59
+ dir = srcDir,
60
+ includes = " com/gabrielfeo/develocity/api/model/BuildModelName.kt" ,
61
+ )
83
62
// Fix mapping of GradleConfigurationCacheResult.Outcome: hIT -> hit
84
63
val file = " com/gabrielfeo/develocity/api/model/GradleConfigurationCacheResult.kt"
85
64
replaceAll(" hIT" , " hit" , dir = srcDir, includes = file)
0 commit comments