Skip to content

Commit 6e3dfb3

Browse files
authored
Merge pull request #1107 from kimdv/kimdv/share-copyright-header
2 parents d883e80 + 47ae130 commit 6e3dfb3

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
@@ -17,7 +17,7 @@ import Utils
1717

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

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
@@ -32,7 +32,7 @@ var node_child_classifications: [ChildClassification] {
3232
let syntaxClassificationFile = SourceFile {
3333
ImportDecl(
3434
"""
35-
\(copyrightHeader)
35+
\(generateCopyrightHeader(for: "generate-ideutils"))
3636
@_spi(RawSyntax) import SwiftSyntax
3737
"""
3838
)

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
@@ -18,7 +18,7 @@ import SwiftBasicFormat
1818

1919
let buildableCollectionNodesFile = 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/BuildableNodesFile.swift

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

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

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
@@ -17,7 +17,7 @@ import Utils
1717

1818
let resultBuildersFile = SourceFile {
1919
ImportDecl(
20-
leadingTrivia: .docLineComment(copyrightHeader),
20+
leadingTrivia: .docLineComment(generateCopyrightHeader(for: "generate-swiftsyntaxbuilder")),
2121
path: [AccessPathComponent(name: "SwiftSyntax")]
2222
)
2323
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
@@ -17,7 +17,7 @@ import Utils
1717

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

CodeGeneration/Sources/generate-swiftsyntaxbuilder/TypealiasesFile.swift

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

1919
let typealiasesFile = 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)