Merge pull request #2058 from tuist/ignore-other-directories

Add Package.swift to subdirectories
This commit is contained in:
Pedro Piñera Buendía 2020-11-22 13:25:07 +01:00 committed by GitHub
commit 4207aeb2fe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
72 changed files with 529 additions and 191 deletions

View File

@ -21,9 +21,9 @@ jobs:
name: 'Cache SPM dependencies'
with:
path: .build
key: ${{ runner.os }}-spm-${{ hashFiles('**/Package.resolved') }}
key: ${{ runner.os }}-${{ matrix.xcode }}-spm-${{ hashFiles('**/Package.resolved') }}
restore-keys: |
${{ runner.os }}-spm-
${{ runner.os }}-${{ matrix.xcode }}-spm-
- name: Run tests
run: |
rm -rf .coverage
@ -42,9 +42,9 @@ jobs:
- uses: actions/cache@v2
with:
path: .build
key: ${{ runner.os }}-spm-${{ hashFiles('**/Package.resolved') }}
key: ${{ runner.os }}-${{ matrix.xcode }}-spm-${{ hashFiles('**/Package.resolved') }}
restore-keys: |
${{ runner.os }}-spm-
${{ runner.os }}-${{ matrix.xcode }}-spm-
- name: Build Tuist for release
run: swift build -c release --product tuist
- name: Build Tuistenv for release

View File

@ -1 +1 @@
5.1.2
5.2.5

View File

@ -7,6 +7,7 @@ Please, check out guidelines: https://keepachangelog.com/en/1.0.0/
### Changed
- Change `launchArguments` of `Target` and `RunAction` to ordered array so order can be preserved [#2052](https://github.com/tuist/tuist/pull/2052) by [@olejnjak](https://github.com/olejnjak).
- Added `Package.swift` to some subdirectories to prevent Xcode from including them in the generated Xcode project [#2058](https://github.com/tuist/tuist/pull/2058) by [@pepibumur](https://github.com/pepibumur).
### Fixed

View File

@ -6,17 +6,17 @@
"repositoryURL": "https://github.com/tadija/AEXML",
"state": {
"branch": null,
"revision": "e4d517844dd03dac557e35d77a8e9ab438de91a6",
"version": "4.4.0"
"revision": "8623e73b193386909566a9ca20203e33a09af142",
"version": "4.5.0"
}
},
{
"package": "Signals",
"repositoryURL": "https://github.com/IBM-Swift/BlueSignals",
"repositoryURL": "https://github.com/tuist/BlueSignals.git",
"state": {
"branch": null,
"revision": "b7331c8bef913f5f8b3cffa6ecfcce679f7c2531",
"version": "1.0.21"
"revision": "1f6c49e186c8a4eeef87ba14f2f97b8646559d13",
"version": "1.0.200"
}
},
{
@ -48,11 +48,11 @@
},
{
"package": "CryptoSwift",
"repositoryURL": "https://github.com/krzyzanowskim/CryptoSwift",
"repositoryURL": "https://github.com/krzyzanowskim/CryptoSwift.git",
"state": {
"branch": null,
"revision": "39f08ac5269361a50c08ce1e2f41989bfc4b1ec8",
"version": "1.3.1"
"revision": "e2bc81be54d71d566a52ca17c3983d141c30aa70",
"version": "1.3.3"
}
},
{
@ -78,8 +78,8 @@
"repositoryURL": "https://github.com/tid-kijyun/Kanna.git",
"state": {
"branch": null,
"revision": "609367a2cd84827a33383cf7923cb4fe8f69ee0a",
"version": "5.2.2"
"revision": "4a80ebe93b6966d5083394fcaaaff57a2fcec935",
"version": "5.2.3"
}
},
{
@ -156,7 +156,7 @@
},
{
"package": "swift-argument-parser",
"repositoryURL": "https://github.com/apple/swift-argument-parser",
"repositoryURL": "https://github.com/apple/swift-argument-parser.git",
"state": {
"branch": null,
"revision": "92646c0cdbaca076c8d3d0207891785b3379cbff",
@ -174,7 +174,7 @@
},
{
"package": "swift-tools-support-core",
"repositoryURL": "https://github.com/apple/swift-tools-support-core",
"repositoryURL": "https://github.com/apple/swift-tools-support-core.git",
"state": {
"branch": null,
"revision": "243beea77d20db46647a3de4765c96e2c801c7c7",
@ -210,20 +210,11 @@
},
{
"package": "XcodeProj",
"repositoryURL": "https://github.com/tuist/XcodeProj",
"repositoryURL": "https://github.com/tuist/XcodeProj.git",
"state": {
"branch": null,
"revision": "2ae8e322ddbed99655802533441bc52f9ae76f24",
"version": "7.17.0"
}
},
{
"package": "XcodeProjCExt",
"repositoryURL": "https://github.com/tuist/XcodeProjCExt",
"state": {
"branch": null,
"revision": "21a510c225ff2bc83d5920a21d902af4b1e7e218",
"version": "0.1.0"
"revision": "82bf5efcaa27e94ed8c761c1eb3e397b6dea82b9",
"version": "7.18.0"
}
},
{
@ -231,8 +222,8 @@
"repositoryURL": "https://github.com/jpsim/Yams.git",
"state": {
"branch": null,
"revision": "88caa2e6fffdbef2e91c2022d038576062042907",
"version": "4.0.0"
"revision": "138cf1b701cf825233b92ceac919152d5aba8a3f",
"version": "4.0.1"
}
},
{

View File

@ -1,7 +1,19 @@
// swift-tools-version:5.1
// swift-tools-version:5.2.0
import PackageDescription
let signalsDependency: Target.Dependency = .byName(name: "Signals")
let rxSwiftDependency: Target.Dependency = .product(name: "RxSwift", package: "RxSwift")
let rxBlockingDependency: Target.Dependency = .product(name: "RxBlocking", package: "RxSwift")
let rxRelayDependency: Target.Dependency = .product(name: "RxRelay", package: "RxSwift")
let rxTestDependency: Target.Dependency = .product(name: "RxTest", package: "RxSwift")
let swiftToolsSupportDependency: Target.Dependency = .product(name: "SwiftToolsSupport-auto", package: "swift-tools-support-core")
let loggingDependency: Target.Dependency = .product(name: "Logging", package: "swift-log")
let argumentParserDependency: Target.Dependency = .product(name: "ArgumentParser", package: "swift-argument-parser")
let beautifyDependency: Target.Dependency = .product(name: "XcbeautifyLib", package: "xcbeautify")
let swiftGenKitDependency: Target.Dependency = .product(name: "SwiftGenKit", package: "SwiftGen")
let swifterDependency: Target.Dependency = .byName(name: "Swifter")
let package = Package(
name: "tuist",
platforms: [.macOS(.v10_12)],
@ -27,18 +39,18 @@ let package = Package(
targets: ["TuistGenerator"]),
],
dependencies: [
.package(url: "https://github.com/tuist/XcodeProj", .upToNextMajor(from: "7.17.0")),
.package(url: "https://github.com/IBM-Swift/BlueSignals", .upToNextMajor(from: "1.0.21")),
.package(url: "https://github.com/tuist/XcodeProj.git", .upToNextMajor(from: "7.17.0")),
.package(name: "Signals", url: "https://github.com/tuist/BlueSignals.git", .upToNextMajor(from: "1.0.21")),
.package(url: "https://github.com/ReactiveX/RxSwift.git", .upToNextMajor(from: "5.1.1")),
.package(url: "https://github.com/rnine/Checksum.git", .upToNextMajor(from: "1.0.2")),
.package(url: "https://github.com/apple/swift-log.git", .upToNextMajor(from: "1.4.0")),
.package(url: "https://github.com/thii/xcbeautify.git", .upToNextMajor(from: "0.8.1")),
.package(url: "https://github.com/krzyzanowskim/CryptoSwift", .upToNextMajor(from: "1.3.0")),
.package(url: "https://github.com/krzyzanowskim/CryptoSwift.git", .upToNextMajor(from: "1.3.3")),
.package(url: "https://github.com/stencilproject/Stencil.git", .upToNextMajor(from: "0.14.0")),
.package(url: "https://github.com/kishikawakatsumi/KeychainAccess.git", .upToNextMajor(from: "4.1.0")),
.package(url: "https://github.com/httpswift/swifter.git", .upToNextMajor(from: "1.5.0")),
.package(url: "https://github.com/apple/swift-tools-support-core", .upToNextMinor(from: "0.1.12")),
.package(url: "https://github.com/apple/swift-argument-parser", .upToNextMajor(from: "0.3.1")),
.package(name: "Swifter", url: "https://github.com/httpswift/swifter.git", .upToNextMajor(from: "1.5.0")),
.package(url: "https://github.com/apple/swift-tools-support-core.git", .upToNextMinor(from: "0.1.12")),
.package(url: "https://github.com/apple/swift-argument-parser.git", .upToNextMajor(from: "0.3.1")),
.package(url: "https://github.com/marmelroy/Zip.git", .upToNextMinor(from: "2.1.1")),
.package(url: "https://github.com/tuist/GraphViz.git", .branch("tuist")),
.package(url: "https://github.com/fortmarek/SwiftGen", .revision("ef8d6b186a03622cec8d228b18f0e2b3bb20b81c")),
@ -48,7 +60,7 @@ let package = Package(
targets: [
.target(
name: "TuistCore",
dependencies: ["SwiftToolsSupport-auto", "TuistSupport", "XcodeProj", "Checksum"]
dependencies: [swiftToolsSupportDependency, "TuistSupport", "XcodeProj", "Checksum"]
),
.target(
name: "TuistCoreTesting",
@ -64,43 +76,125 @@ let package = Package(
),
.target(
name: "TuistDoc",
dependencies: ["SwiftToolsSupport-auto", "TuistCore", "TuistSupport", "Signals", "RxBlocking"]
dependencies: [
swiftToolsSupportDependency,
"TuistCore",
"TuistSupport",
signalsDependency,
rxBlockingDependency,
]
),
.target(
name: "TuistDocTesting",
dependencies: ["TuistDoc", "SwiftToolsSupport-auto", "TuistCore", "TuistCoreTesting", "TuistSupportTesting"]
dependencies: [
"TuistDoc",
swiftToolsSupportDependency,
"TuistCore",
"TuistCoreTesting",
"TuistSupportTesting",
]
),
.testTarget(
name: "TuistDocTests",
dependencies: ["TuistDoc", "TuistDocTesting", "SwiftToolsSupport-auto", "TuistSupportTesting", "TuistCore", "TuistCoreTesting", "TuistSupport"]
dependencies: [
"TuistDoc",
"TuistDocTesting",
swiftToolsSupportDependency,
"TuistSupportTesting",
"TuistCore",
"TuistCoreTesting",
"TuistSupport",
]
),
.target(
name: "TuistKit",
dependencies: ["XcodeProj", "SwiftToolsSupport-auto", "ArgumentParser", "TuistSupport", "TuistGenerator", "TuistCache", "TuistAutomation", "ProjectDescription", "Signals", "RxSwift", "RxBlocking", "TuistLoader", "TuistInsights", "TuistScaffold", "TuistSigning", "TuistDependencies", "TuistCloud", "TuistDoc", "GraphViz", "TuistMigration", "TuistAsyncQueue"]
dependencies: [
"XcodeProj",
swiftToolsSupportDependency,
argumentParserDependency,
"TuistSupport",
"TuistGenerator",
"TuistCache",
"TuistAutomation",
"ProjectDescription",
signalsDependency,
rxSwiftDependency,
rxBlockingDependency,
"TuistLoader",
"TuistInsights",
"TuistScaffold",
"TuistSigning",
"TuistDependencies",
"TuistCloud",
"TuistDoc",
"GraphViz",
"TuistMigration",
"TuistAsyncQueue",
]
),
.testTarget(
name: "TuistKitTests",
dependencies: ["TuistKit", "TuistAutomation", "TuistSupportTesting", "TuistCoreTesting", "ProjectDescription", "RxBlocking", "TuistLoaderTesting", "TuistCacheTesting", "TuistGeneratorTesting", "TuistScaffoldTesting", "TuistCloudTesting", "TuistAutomationTesting", "TuistSigningTesting", "TuistDependenciesTesting", "TuistMigrationTesting", "TuistDocTesting", "TuistAsyncQueueTesting"]
dependencies: [
"TuistKit",
"TuistAutomation",
"TuistSupportTesting",
"TuistCoreTesting",
"ProjectDescription",
rxBlockingDependency,
"TuistLoaderTesting",
"TuistCacheTesting",
"TuistGeneratorTesting",
"TuistScaffoldTesting",
"TuistCloudTesting",
"TuistAutomationTesting",
"TuistSigningTesting",
"TuistDependenciesTesting",
"TuistMigrationTesting",
"TuistDocTesting",
"TuistAsyncQueueTesting",
]
),
.testTarget(
name: "TuistKitIntegrationTests",
dependencies: ["TuistKit", "TuistCoreTesting", "TuistSupportTesting", "ProjectDescription", "RxBlocking", "TuistLoaderTesting", "TuistCloudTesting"]
dependencies: [
"TuistKit",
"TuistCoreTesting",
"TuistSupportTesting",
"ProjectDescription",
rxBlockingDependency,
"TuistLoaderTesting",
"TuistCloudTesting",
]
),
.target(
name: "tuist",
dependencies: ["TuistKit", "ProjectDescription"]
dependencies: [
"TuistKit",
"ProjectDescription",
]
),
.target(
name: "TuistEnvKit",
dependencies: ["ArgumentParser", "SwiftToolsSupport-auto", "TuistSupport", "RxSwift", "RxBlocking"]
dependencies: [
argumentParserDependency,
swiftToolsSupportDependency,
"TuistSupport",
rxSwiftDependency,
rxBlockingDependency,
]
),
.testTarget(
name: "TuistEnvKitTests",
dependencies: ["TuistEnvKit", "TuistSupportTesting"]
dependencies: [
"TuistEnvKit",
"TuistSupportTesting",
]
),
.target(
name: "tuistenv",
dependencies: ["TuistEnvKit"]
dependencies: [
"TuistEnvKit",
]
),
.target(
name: "ProjectDescription",
@ -108,71 +202,165 @@ let package = Package(
),
.testTarget(
name: "ProjectDescriptionTests",
dependencies: ["ProjectDescription", "TuistSupportTesting"]
dependencies: [
"ProjectDescription",
"TuistSupportTesting",
]
),
.target(
name: "TuistSupport",
dependencies: ["SwiftToolsSupport-auto", "RxSwift", "RxRelay", "Logging", "KeychainAccess", "Swifter", "Signals", "Zip"]
dependencies: [
swiftToolsSupportDependency,
rxSwiftDependency,
rxRelayDependency,
loggingDependency,
"KeychainAccess",
swifterDependency,
signalsDependency,
"Zip",
]
),
.target(
name: "TuistSupportTesting",
dependencies: ["TuistSupport", "SwiftToolsSupport-auto"]
dependencies: [
"TuistSupport",
swiftToolsSupportDependency,
]
),
.testTarget(
name: "TuistSupportTests",
dependencies: ["TuistSupport", "TuistSupportTesting", "RxBlocking"]
dependencies: [
"TuistSupport",
"TuistSupportTesting",
rxBlockingDependency,
]
),
.testTarget(
name: "TuistSupportIntegrationTests",
dependencies: ["TuistSupport", "TuistSupportTesting", "RxBlocking"]
dependencies: [
"TuistSupport",
"TuistSupportTesting",
rxBlockingDependency,
]
),
.target(
name: "TuistGenerator",
dependencies: ["XcodeProj", "SwiftToolsSupport-auto", "TuistCore", "TuistSupport", "RxBlocking", "GraphViz", "SwiftGenKit", "StencilSwiftKit"]
dependencies: [
"XcodeProj",
swiftToolsSupportDependency,
"TuistCore",
"TuistSupport",
rxBlockingDependency,
"GraphViz",
swiftGenKitDependency,
"StencilSwiftKit",
]
),
.target(
name: "TuistGeneratorTesting",
dependencies: ["TuistGenerator", "TuistCoreTesting", "TuistSupportTesting"]
dependencies: [
"TuistGenerator",
"TuistCoreTesting",
"TuistSupportTesting",
]
),
.testTarget(
name: "TuistGeneratorTests",
dependencies: ["TuistGenerator", "TuistSupportTesting", "TuistCoreTesting", "TuistGeneratorTesting", "TuistSigningTesting"]
dependencies: [
"TuistGenerator",
"TuistSupportTesting",
"TuistCoreTesting",
"TuistGeneratorTesting",
"TuistSigningTesting",
]
),
.testTarget(
name: "TuistGeneratorIntegrationTests",
dependencies: ["TuistGenerator", "TuistSupportTesting", "TuistCoreTesting", "TuistGeneratorTesting"]
dependencies: [
"TuistGenerator",
"TuistSupportTesting",
"TuistCoreTesting",
"TuistGeneratorTesting",
]
),
.target(
name: "TuistCache",
dependencies: ["XcodeProj", "SwiftToolsSupport-auto", "TuistCore", "TuistSupport", "RxSwift"]
dependencies: [
"XcodeProj",
swiftToolsSupportDependency,
"TuistCore",
"TuistSupport",
rxSwiftDependency,
]
),
.testTarget(
name: "TuistCacheTests",
dependencies: ["TuistCache", "TuistSupportTesting", "TuistCoreTesting", "RxBlocking", "TuistCacheTesting"]
dependencies: [
"TuistCache",
"TuistSupportTesting",
"TuistCoreTesting",
rxBlockingDependency,
"TuistCacheTesting",
]
),
.target(
name: "TuistCacheTesting",
dependencies: ["TuistCache", "SwiftToolsSupport-auto", "TuistCore", "RxTest", "RxSwift", "TuistSupportTesting"]
dependencies: [
"TuistCache",
swiftToolsSupportDependency,
"TuistCore",
rxTestDependency,
rxSwiftDependency,
"TuistSupportTesting",
]
),
.target(
name: "TuistCloud",
dependencies: ["XcodeProj", "SwiftToolsSupport-auto", "TuistCore", "TuistSupport", "RxSwift"]
dependencies: [
"XcodeProj",
swiftToolsSupportDependency,
"TuistCore",
"TuistSupport",
rxSwiftDependency,
]
),
.testTarget(
name: "TuistCloudTests",
dependencies: ["TuistCloud", "TuistSupportTesting", "TuistCoreTesting", "RxBlocking"]
dependencies: [
"TuistCloud",
"TuistSupportTesting",
"TuistCoreTesting",
rxBlockingDependency,
]
),
.target(
name: "TuistCloudTesting",
dependencies: ["TuistCloud", "SwiftToolsSupport-auto", "TuistCore", "RxTest", "RxSwift"]
dependencies: [
"TuistCloud",
swiftToolsSupportDependency,
"TuistCore",
rxTestDependency,
rxSwiftDependency,
]
),
.testTarget(
name: "TuistCacheIntegrationTests",
dependencies: ["TuistCache", "TuistSupportTesting", "RxBlocking", "TuistCoreTesting"]
dependencies: [
"TuistCache",
"TuistSupportTesting",
rxBlockingDependency,
"TuistCoreTesting",
]
),
.target(
name: "TuistScaffold",
dependencies: ["SwiftToolsSupport-auto", "TuistCore", "TuistSupport", "StencilSwiftKit", "Stencil"]
dependencies: [
swiftToolsSupportDependency,
"TuistCore",
"TuistSupport",
"StencilSwiftKit",
"Stencil",
]
),
.target(
name: "TuistScaffoldTesting",
@ -180,43 +368,88 @@ let package = Package(
),
.testTarget(
name: "TuistScaffoldTests",
dependencies: ["TuistScaffold", "TuistSupportTesting", "TuistCoreTesting"]
dependencies: [
"TuistScaffold",
"TuistSupportTesting",
"TuistCoreTesting",
]
),
.testTarget(
name: "TuistScaffoldIntegrationTests",
dependencies: ["TuistScaffold", "TuistSupportTesting"]
dependencies: [
"TuistScaffold",
"TuistSupportTesting",
]
),
.target(
name: "TuistAutomation",
dependencies: ["XcodeProj", "SwiftToolsSupport-auto", "TuistCore", "TuistSupport", "XcbeautifyLib"]
dependencies: [
"XcodeProj",
swiftToolsSupportDependency,
"TuistCore",
"TuistSupport",
beautifyDependency,
]
),
.testTarget(
name: "TuistAutomationTests",
dependencies: ["TuistAutomation", "TuistSupportTesting", "TuistCoreTesting", "RxBlocking"]
dependencies: [
"TuistAutomation",
"TuistSupportTesting",
"TuistCoreTesting",
rxBlockingDependency,
]
),
.target(
name: "TuistAutomationTesting",
dependencies: ["TuistAutomation", "SwiftToolsSupport-auto", "TuistCore", "TuistCoreTesting", "ProjectDescription", "TuistSupportTesting"]
dependencies: [
"TuistAutomation",
swiftToolsSupportDependency,
"TuistCore",
"TuistCoreTesting",
"ProjectDescription",
"TuistSupportTesting",
]
),
.testTarget(
name: "TuistAutomationIntegrationTests",
dependencies: ["TuistAutomation", "TuistSupportTesting", "RxBlocking"]
dependencies: [
"TuistAutomation",
"TuistSupportTesting",
rxBlockingDependency,
]
),
.target(
name: "TuistInsights",
dependencies: ["XcodeProj", "SwiftToolsSupport-auto", "TuistCore", "TuistSupport", "XcbeautifyLib"]
dependencies: [
"XcodeProj",
swiftToolsSupportDependency,
"TuistCore",
"TuistSupport",
beautifyDependency,
]
),
.testTarget(
name: "TuistInsightsTests",
dependencies: ["TuistInsights", "TuistSupportTesting"]
dependencies: [
"TuistInsights",
"TuistSupportTesting",
]
),
.testTarget(
name: "TuistInsightsIntegrationTests",
dependencies: ["TuistInsights", "TuistSupportTesting"]
dependencies: [
"TuistInsights",
"TuistSupportTesting",
]
),
.target(
name: "TuistSigning",
dependencies: ["TuistCore", "TuistSupport", "CryptoSwift"]
dependencies: [
"TuistCore",
"TuistSupport",
"CryptoSwift",
]
),
.target(
name: "TuistSigningTesting",
@ -224,15 +457,26 @@ let package = Package(
),
.testTarget(
name: "TuistSigningTests",
dependencies: ["TuistSigning", "TuistSupportTesting", "TuistCoreTesting", "TuistSigningTesting"]
dependencies: [
"TuistSigning",
"TuistSupportTesting",
"TuistCoreTesting",
"TuistSigningTesting",
]
),
.testTarget(
name: "TuistSigningIntegrationTests",
dependencies: ["TuistSigning", "TuistSupportTesting", "TuistCoreTesting", "TuistSigningTesting"]
dependencies: [
"TuistSigning",
"TuistSupportTesting",
"TuistCoreTesting",
"TuistSigningTesting",
]
),
.target(
name: "TuistDependencies",
dependencies: ["TuistCore", "TuistSupport"]
dependencies: ["TuistCore",
"TuistSupport"]
),
.target(
name: "TuistDependenciesTesting",
@ -240,15 +484,30 @@ let package = Package(
),
.testTarget(
name: "TuistDependenciesTests",
dependencies: ["TuistDependencies", "TuistDependenciesTesting", "TuistCoreTesting", "TuistSupportTesting"]
dependencies: [
"TuistDependencies",
"TuistDependenciesTesting",
"TuistCoreTesting",
"TuistSupportTesting",
]
),
.testTarget(
name: "TuistDependenciesIntegrationTests",
dependencies: ["TuistDependencies", "TuistDependenciesTesting", "TuistCoreTesting", "TuistSupportTesting"]
dependencies: [
"TuistDependencies",
"TuistDependenciesTesting",
"TuistCoreTesting",
"TuistSupportTesting",
]
),
.target(
name: "TuistMigration",
dependencies: ["TuistCore", "TuistSupport", "XcodeProj", "SwiftToolsSupport-auto"]
dependencies: [
"TuistCore",
"TuistSupport",
"XcodeProj",
swiftToolsSupportDependency,
]
),
.target(
name: "TuistMigrationTesting",
@ -256,15 +515,31 @@ let package = Package(
),
.testTarget(
name: "TuistMigrationTests",
dependencies: ["TuistMigration", "TuistSupportTesting", "TuistCoreTesting", "TuistMigrationTesting"]
dependencies: [
"TuistMigration",
"TuistSupportTesting",
"TuistCoreTesting",
"TuistMigrationTesting",
]
),
.testTarget(
name: "TuistMigrationIntegrationTests",
dependencies: ["TuistMigration", "TuistSupportTesting", "TuistCoreTesting", "TuistMigrationTesting"]
dependencies: [
"TuistMigration",
"TuistSupportTesting",
"TuistCoreTesting",
"TuistMigrationTesting",
]
),
.target(
name: "TuistAsyncQueue",
dependencies: ["TuistCore", "TuistSupport", "XcodeProj", "SwiftToolsSupport-auto", "Queuer"]
dependencies: [
"TuistCore",
"TuistSupport",
"XcodeProj",
swiftToolsSupportDependency,
"Queuer",
]
),
.target(
name: "TuistAsyncQueueTesting",
@ -272,27 +547,62 @@ let package = Package(
),
.testTarget(
name: "TuistAsyncQueueTests",
dependencies: ["TuistAsyncQueue", "TuistSupportTesting", "TuistCoreTesting", "TuistAsyncQueueTesting", "RxBlocking"]
dependencies: [
"TuistAsyncQueue",
"TuistSupportTesting",
"TuistCoreTesting",
"TuistAsyncQueueTesting",
rxBlockingDependency,
]
),
.target(
name: "TuistLoader",
dependencies: ["XcodeProj", "SwiftToolsSupport-auto", "TuistCore", "TuistSupport", "ProjectDescription"]
dependencies: [
"XcodeProj",
swiftToolsSupportDependency,
"TuistCore",
"TuistSupport",
"ProjectDescription",
]
),
.target(
name: "TuistLoaderTesting",
dependencies: ["TuistLoader", "SwiftToolsSupport-auto", "TuistCore", "ProjectDescription", "TuistSupportTesting"]
dependencies: [
"TuistLoader",
swiftToolsSupportDependency,
"TuistCore",
"ProjectDescription",
"TuistSupportTesting",
]
),
.testTarget(
name: "TuistLoaderTests",
dependencies: ["TuistLoader", "TuistSupportTesting", "TuistLoaderTesting", "TuistCoreTesting", "RxBlocking"]
dependencies: [
"TuistLoader",
"TuistSupportTesting",
"TuistLoaderTesting",
"TuistCoreTesting",
rxBlockingDependency,
]
),
.testTarget(
name: "TuistLoaderIntegrationTests",
dependencies: ["TuistLoader", "TuistSupportTesting", "ProjectDescription", "RxBlocking"]
dependencies: [
"TuistLoader",
"TuistSupportTesting",
"ProjectDescription",
rxBlockingDependency,
]
),
.testTarget(
name: "TuistIntegrationTests",
dependencies: ["TuistGenerator", "TuistSupportTesting", "TuistSupport", "TuistCoreTesting", "TuistLoaderTesting"]
dependencies: [
"TuistGenerator",
"TuistSupportTesting",
"TuistSupport",
"TuistCoreTesting",
"TuistLoaderTesting",
]
),
]
)

View File

@ -105,7 +105,7 @@ public class BuildGraphInspector: BuildGraphInspecting {
public func buildableEntrySchemes(graph: Graph) -> [Scheme] {
let projects = Set(graph.entryNodes.compactMap { ($0 as? TargetNode)?.project })
return projects
.flatMap { $0.schemes }
.flatMap(\.schemes)
.filter { $0.buildAction?.targets.isEmpty == false }
.sorted(by: { $0.name < $1.name })
}

View File

@ -48,7 +48,7 @@ public final class XcodeBuildController: XcodeBuildControlling {
command.append(contentsOf: target.xcodebuildArguments)
// Arguments
command.append(contentsOf: arguments.flatMap { $0.arguments })
command.append(contentsOf: arguments.flatMap(\.arguments))
return run(command: command)
}
@ -75,7 +75,7 @@ public final class XcodeBuildController: XcodeBuildControlling {
command.append(contentsOf: target.xcodebuildArguments)
// Arguments
command.append(contentsOf: arguments.flatMap { $0.arguments })
command.append(contentsOf: arguments.flatMap(\.arguments))
switch destination {
case let .device(udid):
@ -111,7 +111,7 @@ public final class XcodeBuildController: XcodeBuildControlling {
command.append(contentsOf: ["-archivePath", archivePath.pathString])
// Arguments
command.append(contentsOf: arguments.flatMap { $0.arguments })
command.append(contentsOf: arguments.flatMap(\.arguments))
return run(command: command)
}

View File

@ -77,7 +77,7 @@ public final class CacheRemoteStorage: CacheStoring {
let resource = try CloudCacheResponse.fetchResource(hash: hash, cloud: cloudConfig)
return cloudClient
.request(resource)
.map { $0.object.data.url }
.map(\.object.data.url)
.flatMap { (url: URL) in
self.fileClient.download(url: url)
.do(onSubscribed: { logger.info("Downloading cache artifact with hash \(hash).") })

View File

@ -24,7 +24,7 @@ public final class CoreDataModelsContentHasher: CoreDataModelsContentHashing {
let contentHash = try contentHasher.hash(path: cdModel.path)
let currentVersionHash = try contentHasher.hash([cdModel.currentVersion])
let cdModelHash = try contentHasher.hash([contentHash, currentVersionHash])
let versionsHash = try contentHasher.hash(cdModel.versions.map { $0.pathString })
let versionsHash = try contentHasher.hash(cdModel.versions.map(\.pathString))
stringsToHash.append(cdModelHash)
stringsToHash.append(versionsHash)
}

View File

@ -42,7 +42,7 @@ class CacheGraphMutator: CacheGraphMutating {
public func map(graph: Graph, precompiledFrameworks: [TargetNode: AbsolutePath], sources: Set<String>) throws -> Graph {
var visitedPrecompiledFrameworkPaths: [TargetNode: VisitedPrecompiledFramework?] = [:]
var loadedPrecompiledNodes: [AbsolutePath: PrecompiledNode] = [:]
let userSpecifiedSourceTargets = graph.targets.flatMap { $0.value }.filter { sources.contains($0.target.name) }
let userSpecifiedSourceTargets = graph.targets.flatMap(\.value).filter { sources.contains($0.target.name) }
let userSpecifiedSourceTestTargets = userSpecifiedSourceTargets.flatMap { graph.testTargetsDependingOn(path: $0.path, name: $0.name) }
var sourceTargets: Set<TargetNode> = Set(userSpecifiedSourceTargets)

View File

@ -78,7 +78,7 @@ public class Graph: Encodable, Equatable {
workspace: workspace,
projects: Array(cache.projects.values),
cocoapods: Array(cache.cocoapodsNodes.values),
packages: Array(cache.packages.flatMap { $0.value }),
packages: Array(cache.packages.flatMap(\.value)),
precompiled: Array(cache.precompiledNodes.values),
targets: cache.targetNodes.mapValues { Array($0.values) }
)

View File

@ -62,7 +62,7 @@ public final class GraphCircularDetector: GraphCircularDetecting {
if currentPath.contains(node) {
let cyclePath = currentPath + [node]
throw GraphLoadingError.circularDependency(cyclePath.map { $0.element })
throw GraphLoadingError.circularDependency(cyclePath.map(\.element))
}
var currentPath = currentPath

View File

@ -16,15 +16,15 @@ public final class GraphTraverser: GraphTraversing {
}
public func directTargetDependencies(path: AbsolutePath, name: String) -> [Target] {
graph.targetDependencies(path: path, name: name).map { $0.target }
graph.targetDependencies(path: path, name: name).map(\.target)
}
public func appExtensionDependencies(path: AbsolutePath, name: String) -> [Target] {
graph.appExtensionDependencies(path: path, name: name).map { $0.target }
graph.appExtensionDependencies(path: path, name: name).map(\.target)
}
public func resourceBundleDependencies(path: AbsolutePath, name: String) -> [Target] {
graph.resourceBundleDependencies(path: path, name: name).map { $0.target }
graph.resourceBundleDependencies(path: path, name: name).map(\.target)
}
public func testTargetsDependingOn(path: AbsolutePath, name: String) -> [Target] {
@ -36,6 +36,6 @@ public final class GraphTraverser: GraphTraversing {
}
public func appClipsDependency(path: AbsolutePath, name: String) -> Target? {
graph.appClipsDependency(path: path, name: name).map { $0.target }
graph.appClipsDependency(path: path, name: name).map(\.target)
}
}

View File

@ -13,7 +13,7 @@ public enum InfoPlist: Equatable {
public var value: Any {
switch self {
case let .array(array):
return array.map { $0.value }
return array.map(\.value)
case let .boolean(boolean):
return boolean
case let .dictionary(dictionary):

View File

@ -117,10 +117,10 @@ public struct Project: Hashable, Equatable, CustomStringConvertible, CustomDebug
// Second criteria: Most dependent targets first.
let secondDependencies = graph.targetDependencies(path: self.path, name: second.name)
.filter { $0.path == self.path }
.map { $0.target.name }
.map(\.target.name)
let firstDependencies = graph.targetDependencies(path: self.path, name: first.name)
.filter { $0.path == self.path }
.map { $0.target.name }
.map(\.target.name)
if secondDependencies.contains(first.name) {
return true

View File

@ -127,7 +127,7 @@ extension Dictionary where Key == BuildConfiguration, Value == Configuration? {
public func xcconfigs() -> [AbsolutePath] {
sortedByBuildConfigurationName()
.map { $0.value }
.map(\.value)
.compactMap { $0?.xcconfig }
}
}

View File

@ -47,7 +47,7 @@ public struct SwiftDocController: SwiftDocControlling {
"--module-name", moduleName,
"--base-url", baseURL,
"--output", outputDirectory]
arguments.append(contentsOf: Set(paths.map { $0.dirname }))
arguments.append(contentsOf: Set(paths.map(\.dirname)))
logger.pretty("Generating documentation for \(.bold(.raw(moduleName))).")
_ = try System.shared.observable(arguments)

View File

@ -50,7 +50,9 @@ public struct TuistCommand: ParsableCommand {
private static func parse() throws -> [String]? {
let arguments = Array(processArguments().dropFirst())
guard let firstArgument = arguments.first else { return nil }
// swiftformat:disable preferKeyPath
let containsCommand = configuration.subcommands.map { $0.configuration.commandName }.contains(firstArgument)
// swiftformat:enable preferKeyPath
if containsCommand {
return arguments
}

View File

@ -141,7 +141,7 @@ final class Installer: Installing {
.materialize()
if case let .failed(elements, error) = gitCheckoutResult {
if elements.map({ $0.value }).first(where: { $0.contains("did not match any file(s) known to git") }) != nil {
if elements.map(\.value).first(where: { $0.contains("did not match any file(s) known to git") }) != nil {
throw InstallerError.versionNotFound(version)
} else {
throw error

View File

@ -16,7 +16,7 @@ final class InstallService {
}
func run(version: String, force: Bool) throws {
let versions = versionsController.versions().map { $0.description }
let versions = versionsController.versions().map(\.description)
if versions.contains(version) {
logger.warning("Version \(version) already installed, skipping")
return

View File

@ -16,7 +16,7 @@ final class UninstallService {
}
func run(version: String) throws {
let versions = versionsController.versions().map { $0.description }
let versions = versionsController.versions().map(\.description)
if versions.contains(version) {
try versionsController.uninstall(version: version)
logger.notice("Version \(version) uninstalled", metadata: .success)

View File

@ -237,7 +237,7 @@ final class LinkGenerator: LinkGenerating {
pbxTarget: PBXTarget,
sourceRootPath: AbsolutePath) throws
{
let precompiledPaths = dependencies.compactMap { $0.precompiledPath }
let precompiledPaths = dependencies.compactMap(\.precompiledPath)
.map { LinkGeneratorPath.absolutePath($0.removingLastComponent()) }
let sdkPaths = dependencies.compactMap { (dependency: GraphDependencyReference) -> LinkGeneratorPath? in
if case let GraphDependencyReference.sdk(_, _, source) = dependency {

View File

@ -110,9 +110,9 @@ class ProjectFileElements {
func targetFiles(target: Target) throws -> Set<GroupFileElement> {
var files = Set<AbsolutePath>()
files.formUnion(target.sources.map { $0.path })
files.formUnion(target.coreDataModels.map { $0.path })
files.formUnion(target.coreDataModels.flatMap { $0.versions })
files.formUnion(target.sources.map(\.path))
files.formUnion(target.coreDataModels.map(\.path))
files.formUnion(target.coreDataModels.flatMap(\.versions))
if let headers = target.headers {
files.formUnion(headers.public)

View File

@ -114,7 +114,7 @@ class ProjectGroups {
}
private static func extractProjectGroupNames(from project: Project) -> [String] {
let groups = [project.filesGroup] + project.targets.map { $0.filesGroup }
let groups = [project.filesGroup] + project.targets.map(\.filesGroup)
let groupNames: [String] = groups.compactMap {
switch $0 {
case let .group(name: groupName):

View File

@ -111,7 +111,7 @@ public class GraphLinter: GraphLinting {
}
private func lintMismatchingConfigurations(graph: Graph) -> [LintingIssue] {
let entryNodeProjects = graph.entryNodes.compactMap { $0 as? TargetNode }.map { $0.project }
let entryNodeProjects = graph.entryNodes.compactMap { $0 as? TargetNode }.map(\.project)
let knownConfigurations = entryNodeProjects.reduce(into: Set()) {
$0.formUnion(Set($1.settings.configurations.keys))

View File

@ -46,7 +46,7 @@ class ProjectLinter: ProjectLinting {
private func lintNotDuplicatedTargets(project: Project) -> [LintingIssue] {
var issues: [LintingIssue] = []
let duplicatedTargets = project.targets.map { $0.name }
let duplicatedTargets = project.targets.map(\.name)
.reduce(into: [String: Int]()) { $0[$1] = ($0[$1] ?? 0) + 1 }
.filter { $0.value > 1 }
.keys

View File

@ -61,7 +61,7 @@ private extension SchemeLinter {
}
func lintCodeCoverageTargets(schemes: [Scheme], targets: [Target]) -> [LintingIssue] {
let targetNames = targets.map { $0.name }
let targetNames = targets.map(\.name)
var issues: [LintingIssue] = []
for scheme in schemes {

View File

@ -15,7 +15,7 @@ public final class AutogeneratedSchemesProjectMapper: ProjectMapping {
// MARK: - ProjectMapping
public func map(project: Project) throws -> (Project, [SideEffectDescriptor]) {
let schemeNames = Set(project.schemes.map { $0.name })
let schemeNames = Set(project.schemes.map(\.name))
let schemes = project.schemes
let autogeneratedSchemes = project.targets.compactMap { (target: Target) -> Scheme? in

View File

@ -58,7 +58,7 @@ public final class XcodeProjWriter: XcodeProjWriting {
let xcodeProj = descriptor.xcodeProj
let sharedData = xcodeProj.sharedData ?? XCSharedData(schemes: [])
sharedData.schemes.append(contentsOf: sharedSchemes.map { $0.xcScheme })
sharedData.schemes.append(contentsOf: sharedSchemes.map(\.xcScheme))
xcodeProj.sharedData = sharedData
return ProjectDescriptor(path: descriptor.path,

View File

@ -111,7 +111,7 @@ class Generator: Generating {
let projectMapper = projectMapperProvider.mapper(config: config)
let updatedModels = try models.map(projectMapper.map)
let updatedProjects = updatedModels.map(\.0)
let modelMapperSideEffects = updatedModels.flatMap { $0.1 }
let modelMapperSideEffects = updatedModels.flatMap(\.1)
// Load Graph
let cachedModelLoader = CachedModelLoader(projects: updatedProjects)
@ -238,7 +238,7 @@ class Generator: Generating {
let (updatedGraph, graphMapperSideEffects) = try graphMapperProvider.mapper(config: config).map(graph: graph)
let updatedWorkspace = updatedModels
.workspace
.merging(projects: updatedGraph.projects.map { $0.path })
.merging(projects: updatedGraph.projects.map(\.path))
return (
project,

View File

@ -119,7 +119,7 @@ final class ProjectEditor: ProjectEditing {
setupPath: setupPath,
configPath: configPath,
dependenciesPath: dependenciesPath,
manifests: manifests.map { $0.1 },
manifests: manifests.map(\.1),
helpers: helpers,
templates: templates,
projectDescriptionPath: projectDesciptionPath)

View File

@ -81,7 +81,7 @@ final class DocService {
let targets = graph.targets
.flatMap(\.value)
.filter { !$0.dependsOnXCTest }
.map { $0.target }
.map(\.target)
guard let target = targets.first(where: { $0.name == targetName }) else {
throw DocServiceError.targetNotFound(name: targetName)

View File

@ -102,21 +102,21 @@ final class LintCodeService {
return try getTargetSources(targetName: targetName, graph: graph)
} else {
return graph.targets
.flatMap { $0.value }
.flatMap { $0.target.sources }
.map { $0.path }
.flatMap(\.value)
.flatMap(\.target.sources)
.map(\.path)
}
}
private func getTargetSources(targetName: String, graph: Graph) throws -> [AbsolutePath] {
guard let target = graph.targets.flatMap({ $0.value })
guard let target = graph.targets.flatMap(\.value)
.map(\.target)
.first(where: { $0.name == targetName })
else {
throw LintCodeServiceError.targetNotFound(targetName)
}
let sources = target.sources.map { $0.path }
let sources = target.sources.map(\.path)
if sources.isEmpty {
throw LintCodeServiceError.lintableFilesForTargetNotFound(targetName)

View File

@ -121,7 +121,7 @@ public class ManifestLoader: ManifestLoading {
}
public func manifests(at path: AbsolutePath) -> Set<Manifest> {
Set(manifestFilesLocator.locateProjectManifests(at: path).map { $0.0 })
Set(manifestFilesLocator.locateProjectManifests(at: path).map(\.0))
}
public func loadConfig(at path: AbsolutePath) throws -> ProjectDescription.Config {
@ -226,7 +226,7 @@ public class ManifestLoader: ManifestLoading {
switch result {
case let .completed(elements):
return elements.filter { $0.isStandardOutput }.map { $0.value }.reduce(into: Data()) { $0.append($1) }
return elements.filter { $0.isStandardOutput }.map(\.value).reduce(into: Data()) { $0.append($1) }
case let .failed(_, error):
throw error
}

View File

@ -101,7 +101,7 @@ final class ProjectDescriptionHelpersBuilder: ProjectDescriptionHelpersBuilding
command.append(contentsOf: ["-framework", "ProjectDescription"])
}
command.append(contentsOf: files.map { $0.pathString })
command.append(contentsOf: files.map(\.pathString))
return command
}
}

View File

@ -50,7 +50,7 @@ final class Carthage: Carthaging {
if !platforms.isEmpty {
command.append("--platform")
command.append(platforms.map { $0.caseValue }.joined(separator: ","))
command.append(platforms.map(\.caseValue).joined(separator: ","))
}
command.append(contentsOf: dependencies)

View File

@ -35,7 +35,7 @@ final class Rome: Romeaging {
if !platforms.isEmpty {
command.append("--platform")
command.append(platforms.map { $0.caseValue }.joined(separator: ","))
command.append(platforms.map(\.caseValue).joined(separator: ","))
}
try System.shared.run(command)

View File

@ -93,7 +93,7 @@ public struct TextTable<T> {
}
private func render(cells: [Cell], in table: inout String) {
table += cells.map { $0.value }.joined(separator: " ")
table += cells.map(\.value).joined(separator: " ")
}
private func calculateWidths<C: Collection>(for data: C) -> [Int] where C.Iterator.Element == T {
@ -101,7 +101,7 @@ public struct TextTable<T> {
// Headers
let headers = mapper(first)
var widths = headers.map { $0.title.count }
var widths = headers.map(\.title.count)
// Data Rows
for element in data {

1
Templates/Package.swift Normal file
View File

@ -0,0 +1 @@
import PackageDescription

View File

@ -67,7 +67,7 @@ final class GraphTests: TuistUnitTestCase {
let testDependencies = graph.testTargetsDependingOn(path: project.path, name: target.name)
// then
let testDependenciesNames = try XCTUnwrap(testDependencies).map { $0.name }
let testDependenciesNames = try XCTUnwrap(testDependencies).map(\.name)
XCTAssertEqual(testDependenciesNames.count, 3)
XCTAssertEqual(testDependenciesNames, ["MainTests1", "MainTests2", "MainTests3"])
}

View File

@ -80,7 +80,7 @@ class TargetNodeGraphMapperTests: XCTestCase {
let (results, _) = subject.map(graph: graph)
// Then
XCTAssertEqual(results.targets.flatMap { $0.value }.count, 1)
XCTAssertEqual(results.targets.flatMap(\.value).count, 1)
XCTAssertEqual(results.projects.count, 1)
}
@ -107,7 +107,7 @@ class TargetNodeGraphMapperTests: XCTestCase {
_ = subject.map(graph: graph)
// Then
XCTAssertEqual(graph.targets.flatMap { $0.value }.count, 3)
XCTAssertEqual(graph.targets.flatMap(\.value).count, 3)
XCTAssertEqual(graph.projects.count, 2)
}
}

View File

@ -18,7 +18,7 @@ final class SettingsTests: XCTestCase {
let got = configurations.xcconfigs()
// Then
XCTAssertEqual(got.map { $0.pathString }, ["/A", "/B", "/D"])
XCTAssertEqual(got.map(\.pathString), ["/A", "/B", "/D"])
}
func testSortedByBuildConfigurationName() {
@ -34,7 +34,7 @@ final class SettingsTests: XCTestCase {
let got = configurations.sortedByBuildConfigurationName()
// Then
XCTAssertEqual(got.map { $0.0.name }, ["A", "B", "C", "D"])
XCTAssertEqual(got.map(\.0.name), ["A", "B", "C", "D"])
}
func testDefaultDebugConfigurationWhenDefaultExists() {

View File

@ -120,7 +120,7 @@ final class XcodeProjWriterTests: TuistTestCase {
// Then
let fileHandler = FileHandler.shared
let schemes = fileHandler.glob(xcodeProjPath, glob: "**/*.xcscheme").map { $0.basename }
let schemes = fileHandler.glob(xcodeProjPath, glob: "**/*.xcscheme").map(\.basename)
XCTAssertEqual(schemes, [
"SchemeA.xcscheme",
"UserScheme.xcscheme",
@ -141,7 +141,7 @@ final class XcodeProjWriterTests: TuistTestCase {
let fileHandler = FileHandler.shared
let username = NSUserName()
let schemesPath = xcodeProjPath.appending(components: "xcuserdata", "\(username).xcuserdatad", "xcschemes")
let schemes = fileHandler.glob(schemesPath, glob: "*.xcscheme").map { $0.basename }
let schemes = fileHandler.glob(schemesPath, glob: "*.xcscheme").map(\.basename)
XCTAssertEqual(schemes, [
"UserScheme.xcscheme",
])

View File

@ -18,7 +18,7 @@ class XcodeprojExtrasTests: XCTestCase {
let sorted = elements.sorted(by: PBXFileElement.filesBeforeGroupsSort)
// Then
XCTAssertEqual(sorted.map { $0.nameOrPath }, [
XCTAssertEqual(sorted.map(\.nameOrPath), [
// Files
"c",
"d",

View File

@ -51,7 +51,7 @@ final class BuildPhaseGeneratorTests: TuistUnitTestCase {
SourceFile(path: "/test/file2.swift"),
]
let fileElements = createFileElements(for: sources.map { $0.path })
let fileElements = createFileElements(for: sources.map(\.path))
// When
try subject.generateSourcesBuildPhase(files: sources,
@ -146,7 +146,7 @@ final class BuildPhaseGeneratorTests: TuistUnitTestCase {
let buildPhase = try target.sourcesBuildPhase()
let buildFiles = buildPhase?.files ?? []
XCTAssertEqual(buildFiles.map { $0.file }, [
XCTAssertEqual(buildFiles.map(\.file), [
fileElements.elements["/path/sources/OTTSiriExtension.intentdefinition"],
])
}
@ -312,7 +312,7 @@ final class BuildPhaseGeneratorTests: TuistUnitTestCase {
// Then
let buildPhase = nativeTarget.buildPhases.first
XCTAssertEqual(buildPhase?.files?.map { $0.file }, [
XCTAssertEqual(buildPhase?.files?.map(\.file), [
fileElements.elements["/path/resources/Main.storyboard"],
fileElements.elements["/path/resources/App.strings"],
])

View File

@ -494,7 +494,7 @@ final class LinkGeneratorErrorTests: XCTestCase {
let buildPhase = try pbxTarget.frameworksBuildPhase()
XCTAssertNotNil(buildPhase)
XCTAssertEqual(buildPhase?.files?.map { $0.file }, [
XCTAssertEqual(buildPhase?.files?.map(\.file), [
requiredFile,
optionalFile,
])

View File

@ -260,7 +260,7 @@ final class ProjectDescriptorGeneratorTests: TuistUnitTestCase {
// Then
let pbxproj = got.xcodeProj.pbxproj
let rootGroup = try XCTUnwrap(pbxproj.rootGroup())
let paths = rootGroup.children.compactMap { $0.path }
let paths = rootGroup.children.compactMap(\.path)
XCTAssertEqual(paths, [
"../Packages/LocalPackageA",
])

View File

@ -488,8 +488,8 @@ final class ProjectFileElementsTests: TuistUnitTestCase {
let variantGroup = group.children.first as? PBXVariantGroup
XCTAssertEqual(variantGroup?.name, "App.strings")
XCTAssertNil(variantGroup?.path)
XCTAssertEqual(variantGroup?.children.map { $0.name }, ["en"])
XCTAssertEqual(variantGroup?.children.map { $0.path }, ["en.lproj/App.strings"])
XCTAssertEqual(variantGroup?.children.map(\.name), ["en"])
XCTAssertEqual(variantGroup?.children.map(\.path), ["en.lproj/App.strings"])
XCTAssertEqual(variantGroup?.children.map { ($0 as? PBXFileReference)?.lastKnownFileType }, [
Xcode.filetype(extension: "strings"),
])

View File

@ -121,7 +121,9 @@ final class ProjectGroupsTests: XCTestCase {
playgrounds: playgrounds)
// Then
// swiftformat:disable preferKeyPath
let paths = subject.sortedMain.children.compactMap { $0.nameOrPath }
// swiftformat:enable preferKeyPath
XCTAssertEqual(paths, [
"P",
"B",

View File

@ -40,8 +40,8 @@ final class GraphToGraphVizMapperTests: XCTestCase {
// When
let got = subject.map(graph: graph, skipTestTargets: false, skipExternalDependencies: false)
let expected = makeExpectedGraphViz()
let gotNodeIds = got.nodes.map { $0.id }.sorted()
let expectedNodeIds = expected.nodes.map { $0.id }.sorted()
let gotNodeIds = got.nodes.map(\.id).sorted()
let expectedNodeIds = expected.nodes.map(\.id).sorted()
let gotEdgeIds = got.edges.map { $0.from + " -> " + $0.to }.sorted()
let expectedEdgeIds = expected.edges.map { $0.from + " -> " + $0.to }.sorted()
XCTAssertEqual(gotNodeIds, expectedNodeIds)
@ -69,8 +69,8 @@ final class GraphToGraphVizMapperTests: XCTestCase {
// When
let got = subject.map(graph: graph, skipTestTargets: false, skipExternalDependencies: true)
let expected = makeExpectedGraphViz(includeExternalDependencies: false)
let gotNodeIds = got.nodes.map { $0.id }.sorted()
let expectedNodeIds = expected.nodes.map { $0.id }.sorted()
let gotNodeIds = got.nodes.map(\.id).sorted()
let expectedNodeIds = expected.nodes.map(\.id).sorted()
let gotEdgeIds = got.edges.map { $0.from + " -> " + $0.to }.sorted()
let expectedEdgeIds = expected.edges.map { $0.from + " -> " + $0.to }.sorted()

View File

@ -406,7 +406,7 @@ final class MultipleConfigurationsIntegrationTests: TuistUnitTestCase {
return
}
let configurationNames = Set(nativeTarget.buildConfigurationList?.buildConfigurations.map { $0.name } ?? [])
let configurationNames = Set(nativeTarget.buildConfigurationList?.buildConfigurations.map(\.name) ?? [])
XCTAssertEqual(configurationNames, expectedConfigurations, file: file, line: line)
}
@ -424,7 +424,7 @@ final class MultipleConfigurationsIntegrationTests: TuistUnitTestCase {
return
}
let configurationNames = Set(rootProject?.buildConfigurationList?.buildConfigurations.map { $0.name } ?? [])
let configurationNames = Set(rootProject?.buildConfigurationList?.buildConfigurations.map(\.name) ?? [])
XCTAssertEqual(configurationNames, expectedConfigurations, file: file, line: line)
}
}

View File

@ -91,7 +91,7 @@ final class StableXcodeProjIntegrationTests: TuistTestCase {
extension XCWorkspace {
var projectPaths: [String] {
data.children.flatMap { $0.projectPaths }
data.children.flatMap(\.projectPaths)
}
}
@ -102,7 +102,7 @@ extension XCWorkspaceDataElement {
let path = file.location.path
return path.hasSuffix(".xcodeproj") ? [path] : []
case let .group(elements):
return elements.children.flatMap { $0.projectPaths }
return elements.children.flatMap(\.projectPaths)
}
}
}

View File

@ -45,7 +45,7 @@ final class TestModelGenerator {
let modelLoader = MockGeneratorModelLoader(basePath: rootPath)
let projects = try (0 ..< config.projects).map { try createProjectWithDependencies(name: "App\($0)") }
let workspace = try createWorkspace(path: rootPath, projects: projects.map { $0.name })
let workspace = try createWorkspace(path: rootPath, projects: projects.map(\.name))
projects.forEach { project in
modelLoader.mockProject(project.name) { _ in project }
}

View File

@ -59,7 +59,7 @@ final class ProjectEditorMapperTests: TuistUnitTestCase {
XCTAssertEqual(manifestsTarget.platform, .macOS)
XCTAssertEqual(manifestsTarget.product, .staticFramework)
XCTAssertEqual(manifestsTarget.settings, expectedSettings(sourceRootPath: sourceRootPath))
XCTAssertEqual(manifestsTarget.sources.map { $0.path }, manifestPaths)
XCTAssertEqual(manifestsTarget.sources.map(\.path), manifestPaths)
XCTAssertEqual(manifestsTarget.filesGroup, .group(name: "Manifests"))
XCTAssertEqual(manifestsTarget.dependencies, [.target(name: "ProjectDescriptionHelpers")])
@ -71,7 +71,7 @@ final class ProjectEditorMapperTests: TuistUnitTestCase {
XCTAssertEqual(helpersTarget.platform, .macOS)
XCTAssertEqual(helpersTarget.product, .staticFramework)
XCTAssertEqual(helpersTarget.settings, expectedSettings(sourceRootPath: sourceRootPath))
XCTAssertEqual(helpersTarget.sources.map { $0.path }, helperPaths)
XCTAssertEqual(helpersTarget.sources.map(\.path), helperPaths)
XCTAssertEqual(helpersTarget.filesGroup, .group(name: "Manifests"))
XCTAssertEmpty(helpersTarget.dependencies)
@ -83,7 +83,7 @@ final class ProjectEditorMapperTests: TuistUnitTestCase {
XCTAssertEqual(templatesTarget.platform, .macOS)
XCTAssertEqual(templatesTarget.product, .staticFramework)
XCTAssertEqual(templatesTarget.settings, expectedSettings(sourceRootPath: sourceRootPath))
XCTAssertEqual(templatesTarget.sources.map { $0.path }, templates)
XCTAssertEqual(templatesTarget.sources.map(\.path), templates)
XCTAssertEqual(templatesTarget.filesGroup, .group(name: "Manifests"))
XCTAssertEmpty(templatesTarget.dependencies)
@ -95,7 +95,7 @@ final class ProjectEditorMapperTests: TuistUnitTestCase {
XCTAssertEqual(setupTarget.platform, .macOS)
XCTAssertEqual(setupTarget.product, .staticFramework)
XCTAssertEqual(setupTarget.settings, expectedSettings(sourceRootPath: sourceRootPath))
XCTAssertEqual(setupTarget.sources.map { $0.path }, [setupPath])
XCTAssertEqual(setupTarget.sources.map(\.path), [setupPath])
XCTAssertEqual(setupTarget.filesGroup, .group(name: "Manifests"))
XCTAssertEmpty(setupTarget.dependencies)
@ -107,7 +107,7 @@ final class ProjectEditorMapperTests: TuistUnitTestCase {
XCTAssertEqual(configTarget.platform, .macOS)
XCTAssertEqual(configTarget.product, .staticFramework)
XCTAssertEqual(configTarget.settings, expectedSettings(sourceRootPath: sourceRootPath))
XCTAssertEqual(configTarget.sources.map { $0.path }, [configPath])
XCTAssertEqual(configTarget.sources.map(\.path), [configPath])
XCTAssertEqual(configTarget.filesGroup, .group(name: "Manifests"))
XCTAssertEmpty(configTarget.dependencies)
@ -119,7 +119,7 @@ final class ProjectEditorMapperTests: TuistUnitTestCase {
XCTAssertEqual(dependenciesTarget.platform, .macOS)
XCTAssertEqual(dependenciesTarget.product, .staticFramework)
XCTAssertEqual(dependenciesTarget.settings, expectedSettings(sourceRootPath: sourceRootPath))
XCTAssertEqual(dependenciesTarget.sources.map { $0.path }, [dependenciesPath])
XCTAssertEqual(dependenciesTarget.sources.map(\.path), [dependenciesPath])
XCTAssertEqual(dependenciesTarget.filesGroup, .group(name: "Manifests"))
XCTAssertEmpty(dependenciesTarget.dependencies)
@ -130,7 +130,7 @@ final class ProjectEditorMapperTests: TuistUnitTestCase {
configurations: Settings.default.configurations,
defaultSettings: .recommended))
XCTAssertEqual(project.filesGroup, .group(name: "Manifests"))
XCTAssertEqual(project.targets.sorted { $0.name < $1.name }, targetNodes.map { $0.target })
XCTAssertEqual(project.targets.sorted { $0.name < $1.name }, targetNodes.map(\.target))
// Generated Scheme
XCTAssertEqual(project.schemes.count, 1)
@ -138,7 +138,7 @@ final class ProjectEditorMapperTests: TuistUnitTestCase {
XCTAssertEqual(scheme.name, "Manifests")
let buildAction = try XCTUnwrap(scheme.buildAction)
XCTAssertEqual(buildAction.targets.lazy.map { $0.name }.sorted(), targetNodes.map { $0.name })
XCTAssertEqual(buildAction.targets.lazy.map(\.name).sorted(), targetNodes.map(\.name))
let runAction = try XCTUnwrap(scheme.runAction)
XCTAssertEqual(runAction.filePath, tuistPath)
@ -181,7 +181,7 @@ final class ProjectEditorMapperTests: TuistUnitTestCase {
XCTAssertEqual(manifestsTarget.platform, .macOS)
XCTAssertEqual(manifestsTarget.product, .staticFramework)
XCTAssertEqual(manifestsTarget.settings, expectedSettings(sourceRootPath: sourceRootPath))
XCTAssertEqual(manifestsTarget.sources.map { $0.path }, manifestPaths)
XCTAssertEqual(manifestsTarget.sources.map(\.path), manifestPaths)
XCTAssertEqual(manifestsTarget.filesGroup, .group(name: "Manifests"))
XCTAssertEmpty(manifestsTarget.dependencies)
@ -192,7 +192,7 @@ final class ProjectEditorMapperTests: TuistUnitTestCase {
configurations: Settings.default.configurations,
defaultSettings: .recommended))
XCTAssertEqual(project.filesGroup, .group(name: "Manifests"))
XCTAssertEqual(project.targets, targetNodes.map { $0.target })
XCTAssertEqual(project.targets, targetNodes.map(\.target))
// Generated Scheme
XCTAssertEqual(project.schemes.count, 1)
@ -200,7 +200,7 @@ final class ProjectEditorMapperTests: TuistUnitTestCase {
XCTAssertEqual(scheme.name, "Manifests")
let buildAction = try XCTUnwrap(scheme.buildAction)
XCTAssertEqual(buildAction.targets.map { $0.name }, targetNodes.map { $0.name })
XCTAssertEqual(buildAction.targets.map(\.name), targetNodes.map(\.name))
let runAction = try XCTUnwrap(scheme.runAction)
XCTAssertEqual(runAction.filePath, tuistPath)
@ -252,7 +252,7 @@ final class ProjectEditorMapperTests: TuistUnitTestCase {
XCTAssertEqual(manifestOneTarget.platform, .macOS)
XCTAssertEqual(manifestOneTarget.product, .staticFramework)
XCTAssertEqual(manifestOneTarget.settings, expectedSettings(sourceRootPath: sourceRootPath))
XCTAssertEqual(manifestOneTarget.sources.map { $0.path }, [manifestPaths.last])
XCTAssertEqual(manifestOneTarget.sources.map(\.path), [manifestPaths.last])
XCTAssertEqual(manifestOneTarget.filesGroup, .group(name: "Manifests"))
XCTAssertEmpty(manifestOneTarget.dependencies)
@ -263,7 +263,7 @@ final class ProjectEditorMapperTests: TuistUnitTestCase {
XCTAssertEqual(manifestTwoTarget.platform, .macOS)
XCTAssertEqual(manifestTwoTarget.product, .staticFramework)
XCTAssertEqual(manifestTwoTarget.settings, expectedSettings(sourceRootPath: sourceRootPath))
XCTAssertEqual(manifestTwoTarget.sources.map { $0.path }, [manifestPaths.first])
XCTAssertEqual(manifestTwoTarget.sources.map(\.path), [manifestPaths.first])
XCTAssertEqual(manifestTwoTarget.filesGroup, .group(name: "Manifests"))
XCTAssertEmpty(manifestTwoTarget.dependencies)
@ -275,7 +275,7 @@ final class ProjectEditorMapperTests: TuistUnitTestCase {
XCTAssertEqual(setupTarget.platform, .macOS)
XCTAssertEqual(setupTarget.product, .staticFramework)
XCTAssertEqual(setupTarget.settings, expectedSettings(sourceRootPath: sourceRootPath))
XCTAssertEqual(setupTarget.sources.map { $0.path }, [setupPath])
XCTAssertEqual(setupTarget.sources.map(\.path), [setupPath])
XCTAssertEqual(setupTarget.filesGroup, .group(name: "Manifests"))
XCTAssertEmpty(setupTarget.dependencies)
@ -287,7 +287,7 @@ final class ProjectEditorMapperTests: TuistUnitTestCase {
XCTAssertEqual(configTarget.platform, .macOS)
XCTAssertEqual(configTarget.product, .staticFramework)
XCTAssertEqual(configTarget.settings, expectedSettings(sourceRootPath: sourceRootPath))
XCTAssertEqual(configTarget.sources.map { $0.path }, [configPath])
XCTAssertEqual(configTarget.sources.map(\.path), [configPath])
XCTAssertEqual(configTarget.filesGroup, .group(name: "Manifests"))
XCTAssertEmpty(configTarget.dependencies)
@ -298,7 +298,7 @@ final class ProjectEditorMapperTests: TuistUnitTestCase {
configurations: Settings.default.configurations,
defaultSettings: .recommended))
XCTAssertEqual(project.filesGroup, .group(name: "Manifests"))
XCTAssertEqual(project.targets.sorted(by: { $0.name > $1.name }), targetNodes.map { $0.target }.sorted(by: { $0.name > $1.name }))
XCTAssertEqual(project.targets.sorted(by: { $0.name > $1.name }), targetNodes.map(\.target).sorted(by: { $0.name > $1.name }))
// Generated Scheme
XCTAssertEqual(project.schemes.count, 1)
@ -306,7 +306,7 @@ final class ProjectEditorMapperTests: TuistUnitTestCase {
XCTAssertEqual(scheme.name, "Manifests")
let buildAction = try XCTUnwrap(scheme.buildAction)
XCTAssertEqual(buildAction.targets.map { $0.name }.sorted(), targetNodes.map { $0.name }.sorted())
XCTAssertEqual(buildAction.targets.map(\.name).sorted(), targetNodes.map(\.name).sorted())
let runAction = try XCTUnwrap(scheme.runAction)
XCTAssertEqual(runAction.filePath, tuistPath)

View File

@ -104,7 +104,7 @@ final class SigningMapperTests: TuistUnitTestCase {
// Then
XCTAssertEmpty(sideEffects)
let configurations = mappedProject.targets
.map { $0.settings }
.map(\.settings)
.map { $0?.configurations }
XCTAssertEqual(configurations.first, expectedConfigurations)

1
assets/Package.swift Normal file
View File

@ -0,0 +1 @@
import PackageDescription

1
bin/Package.swift Normal file
View File

@ -0,0 +1 @@
import PackageDescription

1
design/Package.swift Normal file
View File

@ -0,0 +1 @@
import PackageDescription

1
features/Package.swift Normal file
View File

@ -0,0 +1 @@
import PackageDescription

1
fixtures/Package.swift Normal file
View File

@ -0,0 +1 @@
import PackageDescription

View File

@ -1,4 +1,4 @@
// swift-tools-version:5.0
// swift-tools-version:5.2.0
// The swift-tools-version declares the minimum version of Swift required to build this package.
import PackageDescription

View File

@ -1,4 +1,4 @@
// swift-tools-version:5.0
// swift-tools-version:5.2.0
// The swift-tools-version declares the minimum version of Swift required to build this package.
import PackageDescription

4
netlify.toml Normal file
View File

@ -0,0 +1,4 @@
[build]
base = "website/"
publish = "public/"
command = "yarn build"

1
tools/Package.swift Normal file
View File

@ -0,0 +1 @@
import PackageDescription

View File

@ -6,8 +6,8 @@
"repositoryURL": "https://github.com/apple/swift-tools-support-core",
"state": {
"branch": null,
"revision": "693aba4c4c9dcc4767cc853a0dd38bf90ad8c258",
"version": "0.0.1"
"revision": "243beea77d20db46647a3de4765c96e2c801c7c7",
"version": "0.1.12"
}
}
]

View File

@ -1,4 +1,4 @@
// swift-tools-version:5.1
// swift-tools-version:5.2.0
// The swift-tools-version declares the minimum version of Swift required to build this package.
import PackageDescription
@ -13,7 +13,7 @@ let package = Package(
],
dependencies: [
// Dependencies declare other packages that this package depends on.
.package(url: "https://github.com/apple/swift-tools-support-core", from: "0.0.1"),
.package(url: "https://github.com/apple/swift-tools-support-core", .upToNextMinor(from: "0.1.12")),
],
targets: [
// Targets are the basic building blocks of a package. A target can define a module or a test suite.
@ -21,7 +21,7 @@ let package = Package(
.target(
name: "FixtureGenerator",
dependencies: [
"SwiftToolsSupport",
.product(name: "SwiftToolsSupport-auto", package: "swift-tools-support-core"),
]
),
]

View File

@ -1,4 +1,4 @@
// swift-tools-version:5.1
// swift-tools-version:5.2.0
// The swift-tools-version declares the minimum version of Swift required to build this package.
import PackageDescription
@ -13,7 +13,7 @@ let package = Package(
],
dependencies: [
// Dependencies declare other packages that this package depends on.
.package(url: "https://github.com/apple/swift-tools-support-core", from: "0.0.1"),
.package(url: "https://github.com/apple/swift-tools-support-core", .upToNextMinor(from: "0.1.12")),
],
targets: [
// Targets are the basic building blocks of a package. A target can define a module or a test suite.
@ -21,7 +21,7 @@ let package = Package(
.target(
name: "TuistBenchmark",
dependencies: [
"SwiftToolsSupport",
.product(name: "SwiftToolsSupport-auto", package: "swift-tools-support-core"),
]
),
]

1
vendor/Package.swift vendored Normal file
View File

@ -0,0 +1 @@
import PackageDescription

3
website/.gitignore vendored
View File

@ -2,4 +2,5 @@ node_modules
.cache
public/
yarn-error.log
TODO
TODO
.build/

1
website/.swift-version Normal file
View File

@ -0,0 +1 @@
5.2.5

18
website/Package.swift Normal file
View File

@ -0,0 +1,18 @@
// swift-tools-version:5.2.0
import PackageDescription
// This is necessary for 2 reasons:
// 1. It tricks SPM to not include the website/ directory in the generated Xcode project.
// Because there's a node_modules in it, Xcode is very slow indexing things.
// https://forums.swift.org/t/hiding-ignoring-directories-from-xcode-when-opening-swift-packages/35431/6
// 2. Netlify detects that there's a Package.swift and tries to build the package. There's
// no way to configure that on Netlify and therefore we need an empty target here.
let package = Package(
name: "website",
platforms: [.macOS(.v10_12)],
products: [],
dependencies: [],
targets: [
.target(name: "website"),
]
)

View File