-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
773 changed files
with
2,991 additions
and
2,742 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,38 @@ | ||
// swift-tools-version: 5.10 | ||
// The swift-tools-version declares the minimum version of Swift required to build this package. | ||
|
||
import PackageDescription | ||
|
||
let package = Package( | ||
name: "PackageDSL", | ||
platforms: [.macOS(.v12)], | ||
products: [ | ||
// Products define the executables and libraries a package produces, making them visible to other packages. | ||
.library( | ||
name: "PackageDSL", | ||
targets: ["PackageDSL"]) | ||
], | ||
dependencies: [ | ||
.package(url: "https://github.com/apple/swift-package-manager.git", branch: "swift-5.10-RELEASE"), | ||
.package(url: "https://github.com/apple/swift-format.git", from: "510.1.0"), | ||
.package(url: "https://github.com/swiftlang/swift-docc-plugin", from: "1.4.0") | ||
], | ||
targets: [ | ||
// Targets are the basic building blocks of a package, defining a module or a test suite. | ||
// Targets can depend on other targets in this package and products from dependencies. | ||
.target( | ||
name: "PackageDSL", | ||
dependencies: [.product(name: "PackageDescription", package: "swift-package-manager")], | ||
swiftSettings: [ | ||
.define("USE_IMPL_ONLY_IMPORTS"), | ||
.unsafeFlags(["-package-description-version", "999.0"]), | ||
.unsafeFlags(["-enable-library-evolution"]) | ||
] | ||
), | ||
.testTarget( | ||
name: "PackageDSLTests", | ||
dependencies: ["PackageDSL"]) | ||
] | ||
name: "PackageDSL", | ||
platforms: [.macOS(.v12)], | ||
products: [ | ||
.library( | ||
name: "PackageDSL", | ||
targets: ["PackageDSL"] | ||
) | ||
], | ||
dependencies: [ | ||
.package( | ||
url: "https://github.com/apple/swift-package-manager.git", | ||
branch: "swift-5.10-RELEASE" | ||
), | ||
.package(url: "https://github.com/apple/swift-format.git", from: "510.1.0"), | ||
.package(url: "https://github.com/swiftlang/swift-docc-plugin", from: "1.4.0") | ||
], | ||
targets: [ | ||
.target( | ||
name: "PackageDSL", | ||
dependencies: [ | ||
.product(name: "PackageDescription", package: "swift-package-manager") | ||
], | ||
swiftSettings: [ | ||
.define("USE_IMPL_ONLY_IMPORTS"), | ||
.unsafeFlags(["-package-description-version", "999.0"]), | ||
.unsafeFlags(["-enable-library-evolution"]) | ||
] | ||
), | ||
.testTarget( | ||
name: "PackageDSLTests", | ||
dependencies: ["PackageDSL"] | ||
) | ||
] | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,12 @@ | ||
/// A protocol that represents a collection of `Dependency` elements. | ||
public protocol Dependencies: Sequence where Element == Dependency { | ||
/// Initializes a `Dependencies` instance from a sequence of `Dependency` elements. | ||
/// - Parameter s: A sequence of `Dependency` elements. | ||
init<S>(_ s: S) where S.Element == Dependency, S: Sequence | ||
/// - Parameter sequence: A sequence of `Dependency` elements. | ||
init<S>(_ sequence: S) where S.Element == Dependency, S: Sequence | ||
|
||
/// Creates a new `Dependencies` instance by appending the provided `Dependencies` to the existing `Dependencies`. | ||
/// - Parameter dependencies: The `Dependencies` to append. | ||
/// - Returns: A new `Dependencies` instance that includes the existing `Dependencies` and the provided `Dependencies`. | ||
/// Appends the provided `Dependencies` to the current `Array` of `Dependency` elements. | ||
/// | ||
/// - Parameter dependencies: The `Dependencies` to be appended. | ||
/// - Returns: A new array containing the original elements and the appended items. | ||
func appending(_ dependencies: any Dependencies) -> Self | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// | ||
// FrontendFlag.swift | ||
// PackageDSL | ||
// | ||
// Created by Leo Dion on 2/3/25. | ||
// | ||
|
||
public protocol FrontendFlag: UnsafeFlag, _Named { | ||
var flagArguments: [String] { get } | ||
} | ||
|
||
extension FrontendFlag { | ||
public var flagArguments: [String] { | ||
[name.camelToSnakeCaseFlag()] | ||
} | ||
|
||
public var unsafeFlagArguments: [String] { | ||
["-Xfrontend", flagArguments.joined(separator: "=")] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,28 @@ | ||
/// A builder for creating groups of elements. | ||
@resultBuilder | ||
public enum GroupBuilder<U> { | ||
/// Builds a partial block of the group by combining the accumulated elements with the output of the next `GroupBuildable` element. | ||
/// Builds a partial block of the group | ||
/// by combining the accumulated elements | ||
/// with the output of the next `GroupBuildable` element. | ||
/// - Parameters: | ||
/// - accumulated: The accumulated elements in the group. | ||
/// - next: The next `GroupBuildable` element to add to the group. | ||
/// - Returns: The updated group of elements. | ||
public static func buildPartialBlock<T: GroupBuildable>(accumulated: [U], next: T) -> [U] | ||
public static func buildPartialBlock<T: GroupBuildable>( | ||
accumulated: [U], | ||
next: T | ||
) -> [U] | ||
where T.Output == U { | ||
accumulated + T.output(from: [next]) | ||
} | ||
|
||
/// Builds a partial block of the group with the output of the first `GroupBuildable` element. | ||
/// Builds a partial block of the group | ||
/// with the output of the first `GroupBuildable` element. | ||
/// - Parameter first: The first `GroupBuildable` element to add to the group. | ||
/// - Returns: The group of elements. | ||
public static func buildPartialBlock<T: GroupBuildable>(first: T) -> [U] where T.Output == U { | ||
public static func buildPartialBlock<T: GroupBuildable>( | ||
first: T | ||
) -> [U] where T.Output == U { | ||
T.output(from: [first]) | ||
} | ||
} |
Oops, something went wrong.