Cleaner merging of Gradle blocks for functionalTests - #5830
Conversation
Codecov Report
@@ Coverage Diff @@
## main #5830 +/- ##
=========================================
Coverage 84.59% 84.59%
Complexity 3790 3790
=========================================
Files 546 546
Lines 12918 12918
Branches 2268 2268
=========================================
Hits 10928 10928
Misses 861 861
Partials 1129 1129 Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
| private val rootDir: File = Files.createTempDirectory("applyPlugin").toFile().apply { deleteOnExit() } | ||
| private val randomString = UUID.randomUUID().toString() | ||
|
|
||
| @Language("gradle.kts") |
There was a problem hiding this comment.
TIL you can do this with "gradle.kts" 👀
There was a problem hiding this comment.
Funny thing: I only learned this 2 days ago while writing this PR too :)
Before that I knew kotlin and gradle were languages, but recently I was having chats about .gradle.kts files as convention plugins (which are way awesome btw), so while I was writing these annotations I just naturally wrote it, and it worked! 😅
BraisGabin
left a comment
There was a problem hiding this comment.
👏👏👏 Good one! And the diff of those two files looks WAY WAY better.
Follow-up on #5819 (comment)
Related #5827
Closes #5828
Changes:
@Languageannotations, the build code in functionalTests will be highlighted properly (requires trimMargin removal).|being present in the input string,@Suppress("TrimMultilineRawString")reIndentandmergeGradleBlocks.Their usages are pretty localized and make the fragment re-use be at a higher level of abstraction (like
"""$a $b"""->merge(a, b)).You can look at the resulting changes by diffing these two files (note: console output trims empty lines so the effect of
\n\nis not clearly visible here, but it is in the JUnit test report):main.txt
pr.txt