提交 cf228beb 编写于 作者: S Svyatoslav Kuzmich

Use static year range in copyright of generated FIR and tests

Dynamically calculating a year is problematic, especially in cases like
FIR where generation happens in every build. When you are working on a
last year's commit, each build creates a bunch of uncommited
 changes of updating the year in copyrights.
上级 ba822321
......@@ -47,6 +47,7 @@ val generateCheckersComponents by tasks.registering(NoDebugJavaExec::class) {
outputs.dirs(generationRoot)
args(generationRoot)
workingDir = rootDir
classpath = generatorClasspath
main = "org.jetbrains.kotlin.fir.checkers.generator.MainKt"
systemProperties["line.separator"] = "\n"
......
......@@ -40,6 +40,7 @@ val generateTree by tasks.registering(NoDebugJavaExec::class) {
outputs.dirs(generationRoot)
args(generationRoot)
workingDir = rootDir
classpath = generatorClasspath
main = "org.jetbrains.kotlin.fir.tree.generator.MainKt"
systemProperties["line.separator"] = "\n"
......
......@@ -6,16 +6,9 @@
package org.jetbrains.kotlin.fir.tree.generator.printer
import org.jetbrains.kotlin.fir.tree.generator.context.AbstractFirTreeBuilder
import java.io.File
import java.util.*
private val COPYRIGHT = """
/*
* Copyright 2010-${GregorianCalendar()[Calendar.YEAR]} JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
""".trimIndent()
private val COPYRIGHT = File("license/COPYRIGHT_HEADER.txt").readText()
const val VISITOR_PACKAGE = "org.jetbrains.kotlin.fir.visitors"
const val BASE_PACKAGE = "org.jetbrains.kotlin.fir"
......
......@@ -115,14 +115,9 @@ object NewTestGeneratorImpl : TestGenerator(METHOD_GENERATORS) {
val out = StringBuilder()
val p = Printer(out)
val year = GregorianCalendar()[Calendar.YEAR]
p.println(
"""/*
| * Copyright 2010-$year JetBrains s.r.o. and Kotlin Programming Language contributors.
| * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
| */
|""".trimMargin()
)
val copyright = File("license/COPYRIGHT_HEADER.txt").readText()
p.println(copyright)
p.println()
p.println("package $suiteClassPackage;")
p.println()
p.println("import com.intellij.testFramework.TestDataPath;")
......
......@@ -111,14 +111,9 @@ private class TestGeneratorImplInstance(
val out = StringBuilder()
val p = Printer(out)
val year = GregorianCalendar()[Calendar.YEAR]
p.println(
"""/*
| * Copyright 2010-$year JetBrains s.r.o. and Kotlin Programming Language contributors.
| * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
| */
|""".trimMargin()
)
val copyright = File("license/COPYRIGHT_HEADER.txt").readText()
p.println(copyright)
p.println()
p.println("package ", suiteClassPackage, ";")
p.println()
p.println("import com.intellij.testFramework.TestDataPath;")
......
/*
* Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册