stdlib-gen: simpify copyright notice reading
This commit is contained in:
@@ -16,7 +16,7 @@ fun autoGeneratedWarning(generator: String): String = """//
|
||||
// See: https://github.com/JetBrains/kotlin/tree/master/libraries/stdlib
|
||||
//"""
|
||||
|
||||
lateinit var COPYRIGHT_NOTICE: String
|
||||
val COPYRIGHT_NOTICE: String by lazy { readCopyrightNoticeFromResource() }
|
||||
|
||||
fun readCopyrightNoticeFromProfile(copyrightProfile: File): String = readCopyrightNoticeFromProfile { copyrightProfile.reader() }
|
||||
|
||||
@@ -31,6 +31,9 @@ fun readCopyrightNoticeFromProfile(getCopyrightReader: () -> Reader): String {
|
||||
return template.replace(yearTemplate, year).lines().joinToString("", prefix = "/*\n", postfix = " */\n") { " * $it\n" }
|
||||
}
|
||||
|
||||
fun readCopyrightNoticeFromResource() = readCopyrightNoticeFromProfile { Thread.currentThread().contextClassLoader.getResourceAsStream("apache.xml")!!.reader() }
|
||||
|
||||
|
||||
|
||||
data class TargetedSourceFile(
|
||||
val target: KotlinTarget,
|
||||
|
||||
Reference in New Issue
Block a user