Update CollectScreenShots.kt

Make top comment finding less strict.
Currently some comments start with /* instead of /**, which leads to import and package lines being included in README.md files.
This commit is contained in:
Abe Pazos
2025-11-23 13:27:20 +00:00
committed by GitHub
parent 6024e62af0
commit 10888b0e83

View File

@@ -132,7 +132,7 @@ abstract class CollectScreenshotsTask @Inject constructor() : DefaultTask() {
val codeLines = ktFile.readLines()
val main = codeLines.indexOfFirst { it.startsWith("fun main") }
val head = codeLines.take(main)
val start = head.indexOfLast { it.startsWith("/**") }
val start = head.indexOfLast { it.startsWith("/*") }
val end = head.indexOfLast { it.endsWith("*/") }
if ((start < end) && (end < main)) {