diff --git a/compiler/fir/checkers/build.gradle.kts b/compiler/fir/checkers/build.gradle.kts index ff40e2064a1..1129017f095 100644 --- a/compiler/fir/checkers/build.gradle.kts +++ b/compiler/fir/checkers/build.gradle.kts @@ -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" diff --git a/compiler/fir/tree/build.gradle.kts b/compiler/fir/tree/build.gradle.kts index 56f2560052a..8a6b4d3d1e1 100644 --- a/compiler/fir/tree/build.gradle.kts +++ b/compiler/fir/tree/build.gradle.kts @@ -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" diff --git a/compiler/fir/tree/tree-generator/src/org/jetbrains/kotlin/fir/tree/generator/printer/main.kt b/compiler/fir/tree/tree-generator/src/org/jetbrains/kotlin/fir/tree/generator/printer/main.kt index 1a25aae8f56..d2881db706a 100644 --- a/compiler/fir/tree/tree-generator/src/org/jetbrains/kotlin/fir/tree/generator/printer/main.kt +++ b/compiler/fir/tree/tree-generator/src/org/jetbrains/kotlin/fir/tree/generator/printer/main.kt @@ -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" diff --git a/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/generators/NewTestGeneratorImpl.kt b/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/generators/NewTestGeneratorImpl.kt index 492f658534f..83feaf37b59 100644 --- a/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/generators/NewTestGeneratorImpl.kt +++ b/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/generators/NewTestGeneratorImpl.kt @@ -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;") diff --git a/compiler/tests-common/tests/org/jetbrains/kotlin/generators/impl/TestGeneratorImpl.kt b/compiler/tests-common/tests/org/jetbrains/kotlin/generators/impl/TestGeneratorImpl.kt index 168d6ba83d9..a3cde41411a 100644 --- a/compiler/tests-common/tests/org/jetbrains/kotlin/generators/impl/TestGeneratorImpl.kt +++ b/compiler/tests-common/tests/org/jetbrains/kotlin/generators/impl/TestGeneratorImpl.kt @@ -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;") diff --git a/license/COPYRIGHT_HEADER.txt b/license/COPYRIGHT_HEADER.txt new file mode 100644 index 00000000000..41296a422d3 --- /dev/null +++ b/license/COPYRIGHT_HEADER.txt @@ -0,0 +1,4 @@ +/* + * 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