|
| 1 | +//===----------------------------------------------------------------------===// |
| 2 | +// |
| 3 | +// This source file is part of the Swift.org open source project |
| 4 | +// |
| 5 | +// Copyright (c) 2014 - 2025 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 | +import Foundation |
| 14 | + |
| 15 | +/// A namespace that provides paths for files generated by the `generate-swift-format` tool. |
| 16 | +enum GenerateSwiftFormatPaths { |
| 17 | + private static let sourcesDirectory = |
| 18 | + URL(fileURLWithPath: #file) |
| 19 | + .deletingLastPathComponent() |
| 20 | + .deletingLastPathComponent() |
| 21 | + static let rulesDirectory = |
| 22 | + sourcesDirectory |
| 23 | + .appendingPathComponent("SwiftFormat") |
| 24 | + .appendingPathComponent("Rules") |
| 25 | + static let pipelineFile = |
| 26 | + sourcesDirectory |
| 27 | + .appendingPathComponent("SwiftFormat") |
| 28 | + .appendingPathComponent("Core") |
| 29 | + .appendingPathComponent("Pipelines+Generated.swift") |
| 30 | + static let ruleRegistryFile = |
| 31 | + sourcesDirectory |
| 32 | + .appendingPathComponent("SwiftFormat") |
| 33 | + .appendingPathComponent("Core") |
| 34 | + .appendingPathComponent("RuleRegistry+Generated.swift") |
| 35 | + static let ruleNameCacheFile = |
| 36 | + sourcesDirectory |
| 37 | + .appendingPathComponent("SwiftFormat") |
| 38 | + .appendingPathComponent("Core") |
| 39 | + .appendingPathComponent("RuleNameCache+Generated.swift") |
| 40 | + static let ruleDocumentationFile = |
| 41 | + sourcesDirectory |
| 42 | + .appendingPathComponent("..") |
| 43 | + .appendingPathComponent("Documentation") |
| 44 | + .appendingPathComponent("RuleDocumentation.md") |
| 45 | +} |
0 commit comments