Skip to content

Commit 031c145

Browse files
Re-add license headers
1 parent a0523e2 commit 031c145

13 files changed

Lines changed: 189 additions & 1 deletion

build.gradle.kts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import java.util.Calendar
2+
13
plugins {
24
id("org.openrewrite.build.root") version "latest.release"
35
id("org.openrewrite.build.java-base") version "latest.release"
@@ -30,8 +32,14 @@ subprojects {
3032
val idx = args?.indexOf("-o") ?: return@doLast
3133
if (idx < 0 || idx + 1 >= args!!.size) return@doLast
3234
val rootPrefix = rootProject.projectDir.absolutePath + "/"
35+
val year = Calendar.getInstance().get(Calendar.YEAR)
36+
val licenseHeader = "/*\n" + rootProject.file("gradle/licenseHeader.txt")
37+
.readText().trim()
38+
.replace("\${year}", year.toString())
39+
.lines()
40+
.joinToString("\n") { " * $it".trimEnd() } + "\n */\n"
3341
project.file(args!![idx + 1]).walk().filter { it.extension == "java" }.forEach { file ->
34-
file.writeText(file.readLines().joinToString("\n") { line ->
42+
file.writeText(licenseHeader + file.readLines().joinToString("\n") { line ->
3543
line.trimEnd().replace("// Generated from $rootPrefix", "// Generated from ")
3644
} + "\n")
3745
}

rewrite-hcl/src/main/java/org/openrewrite/hcl/internal/grammar/HCLLexer.java

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
/*
2+
* Copyright 2026 the original author or authors.
3+
* <p>
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
* <p>
8+
* https://www.apache.org/licenses/LICENSE-2.0
9+
* <p>
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
116
// Generated from rewrite-hcl/src/main/antlr/HCLLexer.g4 by ANTLR 4.13.2
217
package org.openrewrite.hcl.internal.grammar;
318
import java.util.Stack;

rewrite-hcl/src/main/java/org/openrewrite/hcl/internal/grammar/HCLParser.java

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
/*
2+
* Copyright 2026 the original author or authors.
3+
* <p>
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
* <p>
8+
* https://www.apache.org/licenses/LICENSE-2.0
9+
* <p>
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
116
// Generated from rewrite-hcl/src/main/antlr/HCLParser.g4 by ANTLR 4.13.2
217
package org.openrewrite.hcl.internal.grammar;
318
import org.antlr.v4.runtime.atn.*;

rewrite-hcl/src/main/java/org/openrewrite/hcl/internal/grammar/HCLParserBaseListener.java

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
/*
2+
* Copyright 2026 the original author or authors.
3+
* <p>
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
* <p>
8+
* https://www.apache.org/licenses/LICENSE-2.0
9+
* <p>
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
116
// Generated from rewrite-hcl/src/main/antlr/HCLParser.g4 by ANTLR 4.13.2
217
package org.openrewrite.hcl.internal.grammar;
318

rewrite-hcl/src/main/java/org/openrewrite/hcl/internal/grammar/HCLParserBaseVisitor.java

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
/*
2+
* Copyright 2026 the original author or authors.
3+
* <p>
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
* <p>
8+
* https://www.apache.org/licenses/LICENSE-2.0
9+
* <p>
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
116
// Generated from rewrite-hcl/src/main/antlr/HCLParser.g4 by ANTLR 4.13.2
217
package org.openrewrite.hcl.internal.grammar;
318
import org.antlr.v4.runtime.tree.AbstractParseTreeVisitor;

rewrite-hcl/src/main/java/org/openrewrite/hcl/internal/grammar/HCLParserListener.java

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
/*
2+
* Copyright 2026 the original author or authors.
3+
* <p>
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
* <p>
8+
* https://www.apache.org/licenses/LICENSE-2.0
9+
* <p>
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
116
// Generated from rewrite-hcl/src/main/antlr/HCLParser.g4 by ANTLR 4.13.2
217
package org.openrewrite.hcl.internal.grammar;
318
import org.antlr.v4.runtime.tree.ParseTreeListener;

rewrite-hcl/src/main/java/org/openrewrite/hcl/internal/grammar/HCLParserVisitor.java

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
/*
2+
* Copyright 2026 the original author or authors.
3+
* <p>
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
* <p>
8+
* https://www.apache.org/licenses/LICENSE-2.0
9+
* <p>
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
116
// Generated from rewrite-hcl/src/main/antlr/HCLParser.g4 by ANTLR 4.13.2
217
package org.openrewrite.hcl.internal.grammar;
318
import org.antlr.v4.runtime.tree.ParseTreeVisitor;

rewrite-hcl/src/main/java/org/openrewrite/hcl/internal/grammar/JsonPathLexer.java

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
/*
2+
* Copyright 2026 the original author or authors.
3+
* <p>
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
* <p>
8+
* https://www.apache.org/licenses/LICENSE-2.0
9+
* <p>
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
116
// Generated from rewrite-hcl/src/main/antlr/JsonPathLexer.g4 by ANTLR 4.13.2
217
package org.openrewrite.hcl.internal.grammar;
318
import org.antlr.v4.runtime.Lexer;

rewrite-hcl/src/main/java/org/openrewrite/hcl/internal/grammar/JsonPathParser.java

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
/*
2+
* Copyright 2026 the original author or authors.
3+
* <p>
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
* <p>
8+
* https://www.apache.org/licenses/LICENSE-2.0
9+
* <p>
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
116
// Generated from rewrite-hcl/src/main/antlr/JsonPathParser.g4 by ANTLR 4.13.2
217
package org.openrewrite.hcl.internal.grammar;
318
import org.antlr.v4.runtime.atn.*;

rewrite-hcl/src/main/java/org/openrewrite/hcl/internal/grammar/JsonPathParserBaseListener.java

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
/*
2+
* Copyright 2026 the original author or authors.
3+
* <p>
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
* <p>
8+
* https://www.apache.org/licenses/LICENSE-2.0
9+
* <p>
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
116
// Generated from rewrite-hcl/src/main/antlr/JsonPathParser.g4 by ANTLR 4.13.2
217
package org.openrewrite.hcl.internal.grammar;
318

0 commit comments

Comments
 (0)