Skip to content

Commit 47ae130

Browse files
committed
Share copyright header
1 parent d65d1bd commit 47ae130

File tree

11 files changed

+38
-98
lines changed

11 files changed

+38
-98
lines changed
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
//===----------------------------------------------------------------------===//
2+
//
3+
// This source file is part of the Swift.org open source project
4+
//
5+
// Copyright (c) 2014 - 2022 Apple Inc. and the Swift project authors
6+
// Licensed under Apache License v2.0 with Runtime Library Exception
7+
//
8+
// See https://swift.org/LICENSE.txt for license information
9+
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
10+
//
11+
//===----------------------------------------------------------------------===//
12+
13+
public func generateCopyrightHeader(for generator: String) -> String {
14+
return """
15+
//// Automatically Generated by \(generator)
16+
//// Do Not Edit Directly!
17+
//===----------------------------------------------------------------------===//
18+
//
19+
// This source file is part of the Swift.org open source project
20+
//
21+
// Copyright (c) 2014 - 2022 Apple Inc. and the Swift project authors
22+
// Licensed under Apache License v2.0 with Runtime Library Exception
23+
//
24+
// See https://swift.org/LICENSE.txt for license information
25+
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
26+
//
27+
//===----------------------------------------------------------------------===//
28+
29+
30+
"""
31+
}

CodeGeneration/Sources/generate-swiftbasicformat/BasicFormatFile.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import Utils
1818

1919
let basicFormatFile = SourceFile {
2020
ImportDecl(
21-
leadingTrivia: .docLineComment(copyrightHeader),
21+
leadingTrivia: .docLineComment(generateCopyrightHeader(for: "generate-swiftbasicformat")),
2222
path: [AccessPathComponent(name: "SwiftSyntax")]
2323
)
2424

CodeGeneration/Sources/generate-swiftbasicformat/SyntaxUtilities.swift

Lines changed: 0 additions & 29 deletions
This file was deleted.

CodeGeneration/Sources/generate-swiftideutils/SyntaxClassificationFile.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ var node_child_classifications: [ChildClassification] {
3333
let syntaxClassificationFile = SourceFile {
3434
ImportDecl(
3535
"""
36-
\(copyrightHeader)
36+
\(generateCopyrightHeader(for: "generate-ideutils"))
3737
@_spi(RawSyntax) import SwiftSyntax
3838
"""
3939
)

CodeGeneration/Sources/generate-swiftideutils/SyntaxUtilities.swift

Lines changed: 0 additions & 29 deletions
This file was deleted.

CodeGeneration/Sources/generate-swiftsyntaxbuilder/BuildableCollectionNodesFile.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import SwiftBasicFormat
1919

2020
let buildableCollectionNodesFile = SourceFile {
2121
ImportDecl(
22-
leadingTrivia: .docLineComment(copyrightHeader),
22+
leadingTrivia: .docLineComment(generateCopyrightHeader(for: "generate-swiftsyntaxbuilder")),
2323
path: [AccessPathComponent(name: "SwiftSyntax")]
2424
)
2525

CodeGeneration/Sources/generate-swiftsyntaxbuilder/BuildableNodesFile.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import Utils
1818

1919
let buildableNodesFile = SourceFile {
2020
ImportDecl(
21-
leadingTrivia: .docLineComment(copyrightHeader),
21+
leadingTrivia: .docLineComment(generateCopyrightHeader(for: "generate-swiftsyntaxbuilder")),
2222
path: [AccessPathComponent(name: "SwiftSyntax")]
2323
)
2424

CodeGeneration/Sources/generate-swiftsyntaxbuilder/CopyrightHeader.swift

Lines changed: 0 additions & 33 deletions
This file was deleted.

CodeGeneration/Sources/generate-swiftsyntaxbuilder/ResultBuildersFile.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import Utils
1818

1919
let resultBuildersFile = SourceFile {
2020
ImportDecl(
21-
leadingTrivia: .docLineComment(copyrightHeader),
21+
leadingTrivia: .docLineComment(generateCopyrightHeader(for: "generate-swiftsyntaxbuilder")),
2222
path: [AccessPathComponent(name: "SwiftSyntax")]
2323
)
2424
for node in SYNTAX_NODES where node.isSyntaxCollection {

CodeGeneration/Sources/generate-swiftsyntaxbuilder/TokenFile.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import Utils
1818

1919
let tokenFile = SourceFile {
2020
ImportDecl(
21-
leadingTrivia: .docLineComment(copyrightHeader),
21+
leadingTrivia: .docLineComment(generateCopyrightHeader(for: "generate-swiftsyntaxbuilder")),
2222
path: [AccessPathComponent(name: "SwiftSyntax")]
2323
)
2424

0 commit comments

Comments
 (0)