Skip to content

Commit 91e3520

Browse files
committed
replace correct
1 parent 0749d11 commit 91e3520

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

gradle/templates/velocity/build.gradle.kts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,12 @@ tasks {
4747
?.let { pluginFile ->
4848

4949
val fileContent = pluginFile.readLines().joinToString("\n")
50-
val pluginAnnotationRegex = Regex("@Plugin\\((.|\\s)*\\)", RegexOption.MULTILINE)
50+
val pluginAnnotationRegex = Regex("@Plugin\\((.|\\s)*\\)\\s*class", RegexOption.MULTILINE)
5151

5252
pluginFile.writeText(
53-
fileContent.replace(
53+
fileContent.replaceFirst(
5454
pluginAnnotationRegex,
55-
"@Plugin(\n${pluginAnnotationContent()}\n)".trimMargin()
55+
"@Plugin(\n${pluginAnnotationContent()}\n)\nclass".trimMargin()
5656
)
5757
)
5858
}

0 commit comments

Comments
 (0)