From 6896773381f08e8a45dbd950b59a3fa51949a635 Mon Sep 17 00:00:00 2001 From: Ben Davis Date: Wed, 13 Nov 2019 20:34:30 +0000 Subject: [PATCH 001/678] Removed Shell dependency from Carthage xcodeproj (#507) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Resolves https://github.com/tuist/XcodeProj/issues/506 ### Short description 📝 This fixes an issue with building the framework from Carthage ### Solution 📦 The `XcodeProj_Carthage.xcodeproj` was referencing a missing framework (`Shell`) which is no longer needed. This PR simply removes that reference. ### Implementation 👩‍💻👨‍💻 - [X] Opened `XcodeProj_Carthage.xcodeproj`. - [X] Deleted `Shell.framework` from the project navigator. --- CHANGELOG.md | 3 +++ XcodeProj_Carthage.xcodeproj/project.pbxproj | 8 +++----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 96a77052e..584f7281e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,9 @@ ## Next +### Fixed +- Remove "Shell" Carthage dependency from carthage xcode project as it's no longer used https://github.com/tuist/XcodeProj/pull/507 by @imben123 + ## 7.5.0 ### Fixed diff --git a/XcodeProj_Carthage.xcodeproj/project.pbxproj b/XcodeProj_Carthage.xcodeproj/project.pbxproj index 1f93c3b08..0771dd500 100644 --- a/XcodeProj_Carthage.xcodeproj/project.pbxproj +++ b/XcodeProj_Carthage.xcodeproj/project.pbxproj @@ -3,7 +3,7 @@ archiveVersion = 1; classes = { }; - objectVersion = 52; + objectVersion = 50; objects = { /* Begin PBXBuildFile section */ @@ -21,7 +21,6 @@ 23A0E815358EB2D937F40513 /* PBXBatchUpdater.swift in Sources */ = {isa = PBXBuildFile; fileRef = 08B779835760A818E59969D1 /* PBXBatchUpdater.swift */; }; 2B2D208723F7AE79632BAEAE /* PBXFileElement.swift in Sources */ = {isa = PBXBuildFile; fileRef = D4AA26E4818BC76E4CB28CEB /* PBXFileElement.swift */; }; 2BC374D574269FB75F978D6F /* PBXProject.swift in Sources */ = {isa = PBXBuildFile; fileRef = A93C80F128CBCDFA4EA63EFB /* PBXProject.swift */; }; - 3150041D02026FB07EA43E57 /* Shell.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 398A0E3094DB5B51C1BEA1FE /* Shell.framework */; }; 33C049021FCA541192F40AD1 /* XCWorkspaceDataFileRef.swift in Sources */ = {isa = PBXBuildFile; fileRef = B92DC66EE80F3D7611319ACC /* XCWorkspaceDataFileRef.swift */; }; 364C132E6ABF980BF9E84649 /* XCScheme+ProfileAction.swift in Sources */ = {isa = PBXBuildFile; fileRef = B2E17A977543393ED7B848A9 /* XCScheme+ProfileAction.swift */; }; 3A59F800668B0D6F550B9C09 /* PBXGroup.swift in Sources */ = {isa = PBXBuildFile; fileRef = 249AAF8AE1978D1546C0ADB5 /* PBXGroup.swift */; }; @@ -141,7 +140,6 @@ 32F121F70B66AA9787F99BC3 /* PBXTarget.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PBXTarget.swift; sourceTree = ""; }; 3353E37D0FBA49BA04C82476 /* WorkspaceSettings.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WorkspaceSettings.swift; sourceTree = ""; }; 34A0180EB1FDA8CC7D553950 /* PBXSourceTree.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PBXSourceTree.swift; sourceTree = ""; }; - 398A0E3094DB5B51C1BEA1FE /* Shell.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = Shell.framework; sourceTree = ""; }; 39AC139F340CD22E72E37FF3 /* XCScheme+BuildableProductRunnable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "XCScheme+BuildableProductRunnable.swift"; sourceTree = ""; }; 39B8CB253365692579B8C8E2 /* XCScheme+LocationScenarioReference.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "XCScheme+LocationScenarioReference.swift"; sourceTree = ""; }; 39E419CA05304074ADCDACE8 /* XCVersionGroup.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = XCVersionGroup.swift; sourceTree = ""; }; @@ -223,7 +221,6 @@ files = ( 1ADDD97C53AEC0990F693CDA /* AEXML.framework in Frameworks */, 5A9C450597EC43859570B863 /* PathKit.framework in Frameworks */, - 3150041D02026FB07EA43E57 /* Shell.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -321,7 +318,6 @@ children = ( 0C950F23FEF894B133070990 /* AEXML.framework */, F89DAD13D5505D59F10D0C9F /* PathKit.framework */, - 398A0E3094DB5B51C1BEA1FE /* Shell.framework */, ); path = Mac; sourceTree = ""; @@ -879,6 +875,7 @@ D5796A15286EF9ADD0F090D4 /* Release */, ); defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; }; 477F800A701B31C60A80EACC /* Build configuration list for PBXProject "XcodeProj_Carthage" */ = { isa = XCConfigurationList; @@ -887,6 +884,7 @@ 731F89D8DD1568204C64A902 /* Release */, ); defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; }; /* End XCConfigurationList section */ }; From 14a337905248097dd4ae0d157dec9531aadc260c Mon Sep 17 00:00:00 2001 From: ldindu Date: Sun, 17 Nov 2019 00:04:04 +0000 Subject: [PATCH 002/678] Add xcFramework PBXProductType --- Sources/XcodeProj/Objects/Targets/PBXProductType.swift | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Sources/XcodeProj/Objects/Targets/PBXProductType.swift b/Sources/XcodeProj/Objects/Targets/PBXProductType.swift index 5782b6b0b..00eb3d8c5 100644 --- a/Sources/XcodeProj/Objects/Targets/PBXProductType.swift +++ b/Sources/XcodeProj/Objects/Targets/PBXProductType.swift @@ -5,6 +5,7 @@ public enum PBXProductType: String, Decodable { case application = "com.apple.product-type.application" case framework = "com.apple.product-type.framework" case staticFramework = "com.apple.product-type.framework.static" + case xcFramework = "com.apple.product-type.xcframework" case dynamicLibrary = "com.apple.product-type.library.dynamic" case staticLibrary = "com.apple.product-type.library.static" case bundle = "com.apple.product-type.bundle" @@ -34,6 +35,8 @@ public enum PBXProductType: String, Decodable { return "app" case .framework, .staticFramework: return "framework" + case .xcFramework: + return "xcframework" case .dynamicLibrary: return "dylib" case .staticLibrary: From 4012e7bdbb5ddb773cd6a55fce5dd3e45fc26a45 Mon Sep 17 00:00:00 2001 From: ldindu Date: Sun, 17 Nov 2019 00:15:55 +0000 Subject: [PATCH 003/678] Update changelog --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 584f7281e..552e40178 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,9 @@ ### Fixed - Remove "Shell" Carthage dependency from carthage xcode project as it's no longer used https://github.com/tuist/XcodeProj/pull/507 by @imben123 +### Added +- Added `com.apple.product-type.xcframework` to `PBXProductType`. https://github.com/tuist/XcodeProj/pull/508 by @lakpa + ## 7.5.0 ### Fixed From 3c03c6352d3b2c7fdb10687f22f73cf2bfed1a1d Mon Sep 17 00:00:00 2001 From: ldindu Date: Sun, 17 Nov 2019 00:25:28 +0000 Subject: [PATCH 004/678] Address swift lint alignment violation --- Sources/XcodeProj/Objects/Targets/PBXProductType.swift | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Sources/XcodeProj/Objects/Targets/PBXProductType.swift b/Sources/XcodeProj/Objects/Targets/PBXProductType.swift index 00eb3d8c5..8a326f5c0 100644 --- a/Sources/XcodeProj/Objects/Targets/PBXProductType.swift +++ b/Sources/XcodeProj/Objects/Targets/PBXProductType.swift @@ -5,7 +5,7 @@ public enum PBXProductType: String, Decodable { case application = "com.apple.product-type.application" case framework = "com.apple.product-type.framework" case staticFramework = "com.apple.product-type.framework.static" - case xcFramework = "com.apple.product-type.xcframework" + case xcFramework = "com.apple.product-type.xcframework" case dynamicLibrary = "com.apple.product-type.library.dynamic" case staticLibrary = "com.apple.product-type.library.static" case bundle = "com.apple.product-type.bundle" @@ -35,8 +35,6 @@ public enum PBXProductType: String, Decodable { return "app" case .framework, .staticFramework: return "framework" - case .xcFramework: - return "xcframework" case .dynamicLibrary: return "dylib" case .staticLibrary: @@ -55,6 +53,8 @@ public enum PBXProductType: String, Decodable { return "octest" case .instrumentsPackage: return "instrpkg" + case .xcFramework: + return "xcframework" case .none: return nil } From 49ef39ef0afdbf67f718d558b590e8cb792b28d9 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Wed, 11 Dec 2019 11:28:30 +0000 Subject: [PATCH 005/678] Bump jazzy from 0.12.0 to 0.13.0 Bumps [jazzy](https://github.com/realm/jazzy) from 0.12.0 to 0.13.0. - [Release notes](https://github.com/realm/jazzy/releases) - [Changelog](https://github.com/realm/jazzy/blob/master/CHANGELOG.md) - [Commits](https://github.com/realm/jazzy/compare/v0.12.0...v0.13.0) Signed-off-by: dependabot-preview[bot] --- Gemfile.lock | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 6141a259e..cba7d51e8 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ GEM remote: https://rubygems.org/ specs: - CFPropertyList (3.0.1) + CFPropertyList (3.0.2) activesupport (4.2.11.1) i18n (~> 0.7) minitest (~> 5.1) @@ -38,7 +38,7 @@ GEM fuzzy_match (~> 2.0.4) nap (~> 1.0) cocoapods-deintegrate (1.0.4) - cocoapods-downloader (1.2.2) + cocoapods-downloader (1.3.0) cocoapods-plugins (1.0.0) nap cocoapods-search (1.0.0) @@ -51,14 +51,14 @@ GEM colorize (0.8.1) concurrent-ruby (1.1.5) escape (0.0.4) - ffi (1.11.2) + ffi (1.11.3) fourflusher (2.3.1) fuzzy_match (2.0.4) gh_inspector (1.1.3) httpclient (2.8.3) i18n (0.9.5) concurrent-ruby (~> 1.0) - jazzy (0.12.0) + jazzy (0.13.0) cocoapods (~> 1.5) mustache (~> 1.1) open4 @@ -71,14 +71,14 @@ GEM liferaft (0.0.6) minitest (5.13.0) molinillo (0.6.6) - mustache (1.1.0) + mustache (1.1.1) nanaimo (0.2.6) nap (1.1.0) netrc (0.11.0) open4 (1.3.4) rake (13.0.1) redcarpet (3.5.0) - rouge (3.12.0) + rouge (3.14.0) ruby-macho (1.4.0) sassc (2.2.1) ffi (~> 1.9) From b61b3329a3624392f5be2a3b8f1f7d3c13343fa9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20For=CC=8Ct?= Date: Thu, 12 Dec 2019 20:18:42 +0100 Subject: [PATCH 006/678] Add Enable previews projectAll build settings --- Sources/XcodeProj/Utils/BuildSettingsProvider.swift | 1 + 1 file changed, 1 insertion(+) diff --git a/Sources/XcodeProj/Utils/BuildSettingsProvider.swift b/Sources/XcodeProj/Utils/BuildSettingsProvider.swift index 80f6e6469..0e43eae50 100644 --- a/Sources/XcodeProj/Utils/BuildSettingsProvider.swift +++ b/Sources/XcodeProj/Utils/BuildSettingsProvider.swift @@ -127,6 +127,7 @@ public class BuildSettingsProvider { "CLANG_WARN_UNREACHABLE_CODE": "YES", "COPY_PHASE_STRIP": "NO", "ENABLE_STRICT_OBJC_MSGSEND": "YES", + "ENABLE_PREVIEWS": "YES", "GCC_C_LANGUAGE_STANDARD": "gnu11", "GCC_NO_COMMON_BLOCKS": "YES", "GCC_WARN_64_TO_32_BIT_CONVERSION": "YES", From 4d52c509bfe76846b767bf82210ab4af1a140f7d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20For=CC=8Ct?= Date: Wed, 18 Dec 2019 22:24:44 +0100 Subject: [PATCH 007/678] Move enable previews settings to application target. --- Sources/XcodeProj/Utils/BuildSettingsProvider.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Sources/XcodeProj/Utils/BuildSettingsProvider.swift b/Sources/XcodeProj/Utils/BuildSettingsProvider.swift index 0e43eae50..67bfe51ff 100644 --- a/Sources/XcodeProj/Utils/BuildSettingsProvider.swift +++ b/Sources/XcodeProj/Utils/BuildSettingsProvider.swift @@ -127,7 +127,6 @@ public class BuildSettingsProvider { "CLANG_WARN_UNREACHABLE_CODE": "YES", "COPY_PHASE_STRIP": "NO", "ENABLE_STRICT_OBJC_MSGSEND": "YES", - "ENABLE_PREVIEWS": "YES", "GCC_C_LANGUAGE_STANDARD": "gnu11", "GCC_NO_COMMON_BLOCKS": "YES", "GCC_WARN_64_TO_32_BIT_CONVERSION": "YES", @@ -191,7 +190,8 @@ public class BuildSettingsProvider { switch product { case .application: return [ - "ASSETCATALOG_COMPILER_APPICON_NAME": "AppIcon" + "ASSETCATALOG_COMPILER_APPICON_NAME": "AppIcon", + "ENABLE_PREVIEWS": "YES", ] case .framework: return [ From d5125387009c81d61aeaf627f297cc94184e1f08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20For=CC=8Ct?= Date: Wed, 18 Dec 2019 22:26:17 +0100 Subject: [PATCH 008/678] Update changelog. --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 552e40178..0dbec2371 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ ### Added - Added `com.apple.product-type.xcframework` to `PBXProductType`. https://github.com/tuist/XcodeProj/pull/508 by @lakpa +- Added `"ENABLE_PREVIEWS"` to target application build settings https://github.com/tuist/XcodeProj/pull/511 by @fortmarek ## 7.5.0 From 2f8518bf3d72b38326d7cc1eca586aa0d3180444 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20For=CC=8Ct?= Date: Wed, 18 Dec 2019 22:31:11 +0100 Subject: [PATCH 009/678] Fix tests. --- Tests/XcodeProjTests/Utils/BuildSettingsProviderTests.swift | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Tests/XcodeProjTests/Utils/BuildSettingsProviderTests.swift b/Tests/XcodeProjTests/Utils/BuildSettingsProviderTests.swift index ed5e1c277..2723c49bc 100644 --- a/Tests/XcodeProjTests/Utils/BuildSettingsProviderTests.swift +++ b/Tests/XcodeProjTests/Utils/BuildSettingsProviderTests.swift @@ -14,6 +14,7 @@ class BuildSettingProviderTests: XCTestCase { // Then assertEqualSettings(results, [ "ASSETCATALOG_COMPILER_APPICON_NAME": "AppIcon", + "ENABLE_PREVIEWS": "YES", "CODE_SIGN_IDENTITY": "iPhone Developer", "LD_RUNPATH_SEARCH_PATHS": [ "$(inherited)", @@ -90,6 +91,7 @@ class BuildSettingProviderTests: XCTestCase { // Then assertEqualSettings(results, [ "ASSETCATALOG_COMPILER_APPICON_NAME": "AppIcon", + "ENABLE_PREVIEWS": "YES", "CODE_SIGN_IDENTITY": "-", "COMBINE_HIDPI_IMAGES": "YES", "LD_RUNPATH_SEARCH_PATHS": [ @@ -112,6 +114,7 @@ class BuildSettingProviderTests: XCTestCase { // Then assertEqualSettings(results, [ "ASSETCATALOG_COMPILER_APPICON_NAME": "App Icon & Top Shelf Image", + "ENABLE_PREVIEWS": "YES", "ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME": "LaunchImage", "LD_RUNPATH_SEARCH_PATHS": [ "$(inherited)", @@ -135,6 +138,7 @@ class BuildSettingProviderTests: XCTestCase { assertEqualSettings(results, [ "ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES": "YES", "ASSETCATALOG_COMPILER_APPICON_NAME": "AppIcon", + "ENABLE_PREVIEWS": "YES", "SDKROOT": "watchos", "SKIP_INSTALL": "YES", "SWIFT_COMPILATION_MODE": "wholemodule", From 377873ffb95251954d931f860cd7f2cc1d40714d Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Wed, 8 Jan 2020 11:12:58 +0000 Subject: [PATCH 010/678] Bump jazzy from 0.13.0 to 0.13.1 Bumps [jazzy](https://github.com/realm/jazzy) from 0.13.0 to 0.13.1. - [Release notes](https://github.com/realm/jazzy/releases) - [Changelog](https://github.com/realm/jazzy/blob/master/CHANGELOG.md) - [Commits](https://github.com/realm/jazzy/compare/v0.13.0...v0.13.1) Signed-off-by: dependabot-preview[bot] --- Gemfile.lock | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index cba7d51e8..885d3bfe8 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -58,7 +58,7 @@ GEM httpclient (2.8.3) i18n (0.9.5) concurrent-ruby (~> 1.0) - jazzy (0.13.0) + jazzy (0.13.1) cocoapods (~> 1.5) mustache (~> 1.1) open4 @@ -67,7 +67,7 @@ GEM sassc (~> 2.1) sqlite3 (~> 1.3) xcinvoke (~> 0.3.0) - json (2.2.0) + json (2.3.0) liferaft (0.0.6) minitest (5.13.0) molinillo (0.6.6) @@ -82,13 +82,13 @@ GEM ruby-macho (1.4.0) sassc (2.2.1) ffi (~> 1.9) - sqlite3 (1.4.1) + sqlite3 (1.4.2) thread_safe (0.3.6) - tzinfo (1.2.5) + tzinfo (1.2.6) thread_safe (~> 0.1) xcinvoke (0.3.0) liferaft (~> 0.0.6) - xcodeproj (1.13.0) + xcodeproj (1.14.0) CFPropertyList (>= 2.3.3, < 4.0) atomos (~> 0.1.3) claide (>= 1.0.2, < 2.0) From 6acfc0bc57fd86245025cfcf1f5e06d59b954ac5 Mon Sep 17 00:00:00 2001 From: YutoMizutani Date: Mon, 20 Jan 2020 23:43:22 +0900 Subject: [PATCH 011/678] Add askForAppToLaunch option --- Sources/XcodeProj/Scheme/XCScheme+LaunchAction.swift | 8 ++++++++ Sources/XcodeProj/Scheme/XCScheme+ProfileAction.swift | 4 ++++ Tests/XcodeProjTests/Scheme/XCSchemeTests.swift | 4 ++++ 3 files changed, 16 insertions(+) diff --git a/Sources/XcodeProj/Scheme/XCScheme+LaunchAction.swift b/Sources/XcodeProj/Scheme/XCScheme+LaunchAction.swift index afdcb6e76..10a5653f5 100644 --- a/Sources/XcodeProj/Scheme/XCScheme+LaunchAction.swift +++ b/Sources/XcodeProj/Scheme/XCScheme+LaunchAction.swift @@ -40,6 +40,7 @@ extension XCScheme { public var selectedLauncherIdentifier: String public var buildConfiguration: String public var launchStyle: Style + public var askForAppToLaunch: Bool public var useCustomWorkingDirectory: Bool public var ignoresPersistentStateOnLaunch: Bool public var debugDocumentVersioning: Bool @@ -75,6 +76,7 @@ extension XCScheme { selectedDebuggerIdentifier: String = XCScheme.defaultDebugger, selectedLauncherIdentifier: String = XCScheme.defaultLauncher, launchStyle: Style = .auto, + askForAppToLaunch: Bool = false, useCustomWorkingDirectory: Bool = false, ignoresPersistentStateOnLaunch: Bool = false, debugDocumentVersioning: Bool = true, @@ -104,6 +106,7 @@ extension XCScheme { self.launchStyle = launchStyle self.selectedDebuggerIdentifier = selectedDebuggerIdentifier self.selectedLauncherIdentifier = selectedLauncherIdentifier + self.askForAppToLaunch = askForAppToLaunch self.useCustomWorkingDirectory = useCustomWorkingDirectory self.ignoresPersistentStateOnLaunch = ignoresPersistentStateOnLaunch self.debugDocumentVersioning = debugDocumentVersioning @@ -136,6 +139,7 @@ extension XCScheme { selectedDebuggerIdentifier = element.attributes["selectedDebuggerIdentifier"] ?? XCScheme.defaultDebugger selectedLauncherIdentifier = element.attributes["selectedLauncherIdentifier"] ?? XCScheme.defaultLauncher launchStyle = element.attributes["launchStyle"].flatMap { Style(rawValue: $0) } ?? .auto + askForAppToLaunch = element.attributes["askForAppToLaunch"] == "YES" useCustomWorkingDirectory = element.attributes["useCustomWorkingDirectory"] == "YES" ignoresPersistentStateOnLaunch = element.attributes["ignoresPersistentStateOnLaunch"] == "YES" debugDocumentVersioning = element.attributes["debugDocumentVersioning"].map { $0 == "YES" } ?? true @@ -212,6 +216,9 @@ extension XCScheme { "allowLocationSimulation": allowLocationSimulation.xmlString, ] + if askForAppToLaunch { + attributes["askForAppToLaunch"] = askForAppToLaunch.xmlString + } if enableGPUFrameCaptureMode != LaunchAction.defaultGPUFrameCaptureMode { attributes["enableGPUFrameCaptureMode"] = enableGPUFrameCaptureMode.rawValue } @@ -305,6 +312,7 @@ extension XCScheme { selectedLauncherIdentifier == rhs.selectedLauncherIdentifier && buildConfiguration == rhs.buildConfiguration && launchStyle == rhs.launchStyle && + askForAppToLaunch == rhs.askForAppToLaunch && useCustomWorkingDirectory == rhs.useCustomWorkingDirectory && ignoresPersistentStateOnLaunch == rhs.ignoresPersistentStateOnLaunch && debugDocumentVersioning == rhs.debugDocumentVersioning && diff --git a/Sources/XcodeProj/Scheme/XCScheme+ProfileAction.swift b/Sources/XcodeProj/Scheme/XCScheme+ProfileAction.swift index 5b6ee2768..478590d12 100644 --- a/Sources/XcodeProj/Scheme/XCScheme+ProfileAction.swift +++ b/Sources/XcodeProj/Scheme/XCScheme+ProfileAction.swift @@ -17,6 +17,7 @@ extension XCScheme { public var ignoresPersistentStateOnLaunch: Bool public var useCustomWorkingDirectory: Bool public var debugDocumentVersioning: Bool + public var askForAppToLaunch: Bool public var commandlineArguments: CommandLineArguments? public var environmentVariables: [EnvironmentVariable]? public var macroExpansion: BuildableReference? @@ -34,6 +35,7 @@ extension XCScheme { ignoresPersistentStateOnLaunch: Bool = false, useCustomWorkingDirectory: Bool = false, debugDocumentVersioning: Bool = true, + askForAppToLaunch: Bool = false, commandlineArguments: CommandLineArguments? = nil, environmentVariables: [EnvironmentVariable]? = nil, enableTestabilityWhenProfilingTests: Bool = true) { @@ -44,6 +46,7 @@ extension XCScheme { self.savedToolIdentifier = savedToolIdentifier self.useCustomWorkingDirectory = useCustomWorkingDirectory self.debugDocumentVersioning = debugDocumentVersioning + self.askForAppToLaunch = askForAppToLaunch self.commandlineArguments = commandlineArguments self.environmentVariables = environmentVariables self.ignoresPersistentStateOnLaunch = ignoresPersistentStateOnLaunch @@ -57,6 +60,7 @@ extension XCScheme { savedToolIdentifier = element.attributes["savedToolIdentifier"] ?? "" useCustomWorkingDirectory = element.attributes["useCustomWorkingDirectory"] == "YES" debugDocumentVersioning = element.attributes["debugDocumentVersioning"].map { $0 == "YES" } ?? true + askForAppToLaunch = element.attributes["askForAppToLaunch"].map { $0 == "YES" } ?? false ignoresPersistentStateOnLaunch = element.attributes["ignoresPersistentStateOnLaunch"].map { $0 == "YES" } ?? false let buildableProductRunnableElement = element["BuildableProductRunnable"] diff --git a/Tests/XcodeProjTests/Scheme/XCSchemeTests.swift b/Tests/XcodeProjTests/Scheme/XCSchemeTests.swift index 5727680de..db088aac9 100644 --- a/Tests/XcodeProjTests/Scheme/XCSchemeTests.swift +++ b/Tests/XcodeProjTests/Scheme/XCSchemeTests.swift @@ -184,6 +184,7 @@ final class XCSchemeIntegrationTests: XCTestCase { XCTAssertEqual(scheme.profileAction?.savedToolIdentifier, "") XCTAssertEqual(scheme.profileAction?.useCustomWorkingDirectory, false) XCTAssertEqual(scheme.profileAction?.debugDocumentVersioning, true) + XCTAssertEqual(scheme.profileAction?.askForAppToLaunch, false) XCTAssertEqual(scheme.profileAction?.buildableProductRunnable?.runnableDebuggingMode, "0") XCTAssertEqual(scheme.profileAction?.buildableProductRunnable?.buildableReference.buildableIdentifier, "primary") XCTAssertEqual(scheme.profileAction?.buildableProductRunnable?.buildableReference.blueprintIdentifier, "23766C111EAA3484007A9026") @@ -210,6 +211,7 @@ final class XCSchemeIntegrationTests: XCTestCase { XCTAssertEqual(scheme.launchAction?.selectedDebuggerIdentifier, "Xcode.DebuggerFoundation.Debugger.LLDB") XCTAssertEqual(scheme.launchAction?.selectedLauncherIdentifier, "Xcode.DebuggerFoundation.Launcher.LLDB") XCTAssertEqual(scheme.launchAction?.launchStyle, .custom) + XCTAssertEqual(scheme.launchAction?.askForAppToLaunch, false) XCTAssertEqual(scheme.launchAction?.useCustomWorkingDirectory, false) XCTAssertEqual(scheme.launchAction?.ignoresPersistentStateOnLaunch, false) XCTAssertEqual(scheme.launchAction?.debugDocumentVersioning, true) @@ -300,6 +302,7 @@ final class XCSchemeIntegrationTests: XCTestCase { XCTAssertEqual(scheme.launchAction?.selectedLauncherIdentifier, XCScheme.defaultLauncher) XCTAssertEqual(scheme.launchAction?.buildConfiguration, "Debug") XCTAssertEqual(scheme.launchAction?.launchStyle, XCScheme.LaunchAction.Style.auto) + XCTAssertTrue(scheme.launchAction?.askForAppToLaunch == false) XCTAssertTrue(scheme.launchAction?.useCustomWorkingDirectory == false) XCTAssertTrue(scheme.launchAction?.ignoresPersistentStateOnLaunch == false) XCTAssertTrue(scheme.launchAction?.debugDocumentVersioning == true) @@ -330,6 +333,7 @@ final class XCSchemeIntegrationTests: XCTestCase { XCTAssertEqual(scheme.profileAction?.savedToolIdentifier, "") XCTAssertTrue(scheme.profileAction?.useCustomWorkingDirectory == false) XCTAssertTrue(scheme.profileAction?.debugDocumentVersioning == true) + XCTAssertTrue(scheme.profileAction?.askForAppToLaunch == false) XCTAssertNil(scheme.profileAction?.commandlineArguments) XCTAssertNil(scheme.profileAction?.environmentVariables) From 6ae584e9c79b187c56a0228de292fc66ea153d9e Mon Sep 17 00:00:00 2001 From: YutoMizutani Date: Wed, 22 Jan 2020 00:45:24 +0900 Subject: [PATCH 012/678] Add to suit Equatable --- Sources/XcodeProj/Scheme/XCScheme+ProfileAction.swift | 1 + 1 file changed, 1 insertion(+) diff --git a/Sources/XcodeProj/Scheme/XCScheme+ProfileAction.swift b/Sources/XcodeProj/Scheme/XCScheme+ProfileAction.swift index 478590d12..76e8168ae 100644 --- a/Sources/XcodeProj/Scheme/XCScheme+ProfileAction.swift +++ b/Sources/XcodeProj/Scheme/XCScheme+ProfileAction.swift @@ -132,6 +132,7 @@ extension XCScheme { ignoresPersistentStateOnLaunch == rhs.ignoresPersistentStateOnLaunch && useCustomWorkingDirectory == rhs.useCustomWorkingDirectory && debugDocumentVersioning == rhs.debugDocumentVersioning && + askForAppToLaunch == rhs.askForAppToLaunch && commandlineArguments == rhs.commandlineArguments && environmentVariables == rhs.environmentVariables && macroExpansion == rhs.macroExpansion && From acc2471c8da01c19178d596829cc388844689a6f Mon Sep 17 00:00:00 2001 From: YutoMizutani Date: Wed, 22 Jan 2020 00:46:05 +0900 Subject: [PATCH 013/678] Change to optional --- Sources/XcodeProj/Scheme/XCScheme+LaunchAction.swift | 8 ++++---- Sources/XcodeProj/Scheme/XCScheme+ProfileAction.swift | 6 +++--- Tests/XcodeProjTests/Scheme/XCSchemeTests.swift | 8 ++++---- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/Sources/XcodeProj/Scheme/XCScheme+LaunchAction.swift b/Sources/XcodeProj/Scheme/XCScheme+LaunchAction.swift index 10a5653f5..d6ce0084a 100644 --- a/Sources/XcodeProj/Scheme/XCScheme+LaunchAction.swift +++ b/Sources/XcodeProj/Scheme/XCScheme+LaunchAction.swift @@ -40,7 +40,7 @@ extension XCScheme { public var selectedLauncherIdentifier: String public var buildConfiguration: String public var launchStyle: Style - public var askForAppToLaunch: Bool + public var askForAppToLaunch: Bool? public var useCustomWorkingDirectory: Bool public var ignoresPersistentStateOnLaunch: Bool public var debugDocumentVersioning: Bool @@ -76,7 +76,7 @@ extension XCScheme { selectedDebuggerIdentifier: String = XCScheme.defaultDebugger, selectedLauncherIdentifier: String = XCScheme.defaultLauncher, launchStyle: Style = .auto, - askForAppToLaunch: Bool = false, + askForAppToLaunch: Bool? = nil, useCustomWorkingDirectory: Bool = false, ignoresPersistentStateOnLaunch: Bool = false, debugDocumentVersioning: Bool = true, @@ -139,7 +139,7 @@ extension XCScheme { selectedDebuggerIdentifier = element.attributes["selectedDebuggerIdentifier"] ?? XCScheme.defaultDebugger selectedLauncherIdentifier = element.attributes["selectedLauncherIdentifier"] ?? XCScheme.defaultLauncher launchStyle = element.attributes["launchStyle"].flatMap { Style(rawValue: $0) } ?? .auto - askForAppToLaunch = element.attributes["askForAppToLaunch"] == "YES" + askForAppToLaunch = element.attributes["askForAppToLaunch"].map { $0 == "YES" } useCustomWorkingDirectory = element.attributes["useCustomWorkingDirectory"] == "YES" ignoresPersistentStateOnLaunch = element.attributes["ignoresPersistentStateOnLaunch"] == "YES" debugDocumentVersioning = element.attributes["debugDocumentVersioning"].map { $0 == "YES" } ?? true @@ -216,7 +216,7 @@ extension XCScheme { "allowLocationSimulation": allowLocationSimulation.xmlString, ] - if askForAppToLaunch { + if let askForAppToLaunch = askForAppToLaunch { attributes["askForAppToLaunch"] = askForAppToLaunch.xmlString } if enableGPUFrameCaptureMode != LaunchAction.defaultGPUFrameCaptureMode { diff --git a/Sources/XcodeProj/Scheme/XCScheme+ProfileAction.swift b/Sources/XcodeProj/Scheme/XCScheme+ProfileAction.swift index 76e8168ae..a91acf98a 100644 --- a/Sources/XcodeProj/Scheme/XCScheme+ProfileAction.swift +++ b/Sources/XcodeProj/Scheme/XCScheme+ProfileAction.swift @@ -17,7 +17,7 @@ extension XCScheme { public var ignoresPersistentStateOnLaunch: Bool public var useCustomWorkingDirectory: Bool public var debugDocumentVersioning: Bool - public var askForAppToLaunch: Bool + public var askForAppToLaunch: Bool? public var commandlineArguments: CommandLineArguments? public var environmentVariables: [EnvironmentVariable]? public var macroExpansion: BuildableReference? @@ -35,7 +35,7 @@ extension XCScheme { ignoresPersistentStateOnLaunch: Bool = false, useCustomWorkingDirectory: Bool = false, debugDocumentVersioning: Bool = true, - askForAppToLaunch: Bool = false, + askForAppToLaunch: Bool? = nil, commandlineArguments: CommandLineArguments? = nil, environmentVariables: [EnvironmentVariable]? = nil, enableTestabilityWhenProfilingTests: Bool = true) { @@ -60,7 +60,7 @@ extension XCScheme { savedToolIdentifier = element.attributes["savedToolIdentifier"] ?? "" useCustomWorkingDirectory = element.attributes["useCustomWorkingDirectory"] == "YES" debugDocumentVersioning = element.attributes["debugDocumentVersioning"].map { $0 == "YES" } ?? true - askForAppToLaunch = element.attributes["askForAppToLaunch"].map { $0 == "YES" } ?? false + askForAppToLaunch = element.attributes["askForAppToLaunch"].map { $0 == "YES" } ignoresPersistentStateOnLaunch = element.attributes["ignoresPersistentStateOnLaunch"].map { $0 == "YES" } ?? false let buildableProductRunnableElement = element["BuildableProductRunnable"] diff --git a/Tests/XcodeProjTests/Scheme/XCSchemeTests.swift b/Tests/XcodeProjTests/Scheme/XCSchemeTests.swift index db088aac9..83427bed6 100644 --- a/Tests/XcodeProjTests/Scheme/XCSchemeTests.swift +++ b/Tests/XcodeProjTests/Scheme/XCSchemeTests.swift @@ -184,7 +184,7 @@ final class XCSchemeIntegrationTests: XCTestCase { XCTAssertEqual(scheme.profileAction?.savedToolIdentifier, "") XCTAssertEqual(scheme.profileAction?.useCustomWorkingDirectory, false) XCTAssertEqual(scheme.profileAction?.debugDocumentVersioning, true) - XCTAssertEqual(scheme.profileAction?.askForAppToLaunch, false) + XCTAssertNil(scheme.profileAction?.askForAppToLaunch) XCTAssertEqual(scheme.profileAction?.buildableProductRunnable?.runnableDebuggingMode, "0") XCTAssertEqual(scheme.profileAction?.buildableProductRunnable?.buildableReference.buildableIdentifier, "primary") XCTAssertEqual(scheme.profileAction?.buildableProductRunnable?.buildableReference.blueprintIdentifier, "23766C111EAA3484007A9026") @@ -211,7 +211,7 @@ final class XCSchemeIntegrationTests: XCTestCase { XCTAssertEqual(scheme.launchAction?.selectedDebuggerIdentifier, "Xcode.DebuggerFoundation.Debugger.LLDB") XCTAssertEqual(scheme.launchAction?.selectedLauncherIdentifier, "Xcode.DebuggerFoundation.Launcher.LLDB") XCTAssertEqual(scheme.launchAction?.launchStyle, .custom) - XCTAssertEqual(scheme.launchAction?.askForAppToLaunch, false) + XCTAssertNil(scheme.launchAction?.askForAppToLaunch) XCTAssertEqual(scheme.launchAction?.useCustomWorkingDirectory, false) XCTAssertEqual(scheme.launchAction?.ignoresPersistentStateOnLaunch, false) XCTAssertEqual(scheme.launchAction?.debugDocumentVersioning, true) @@ -302,7 +302,7 @@ final class XCSchemeIntegrationTests: XCTestCase { XCTAssertEqual(scheme.launchAction?.selectedLauncherIdentifier, XCScheme.defaultLauncher) XCTAssertEqual(scheme.launchAction?.buildConfiguration, "Debug") XCTAssertEqual(scheme.launchAction?.launchStyle, XCScheme.LaunchAction.Style.auto) - XCTAssertTrue(scheme.launchAction?.askForAppToLaunch == false) + XCTAssertNil(scheme.launchAction?.askForAppToLaunch) XCTAssertTrue(scheme.launchAction?.useCustomWorkingDirectory == false) XCTAssertTrue(scheme.launchAction?.ignoresPersistentStateOnLaunch == false) XCTAssertTrue(scheme.launchAction?.debugDocumentVersioning == true) @@ -333,7 +333,7 @@ final class XCSchemeIntegrationTests: XCTestCase { XCTAssertEqual(scheme.profileAction?.savedToolIdentifier, "") XCTAssertTrue(scheme.profileAction?.useCustomWorkingDirectory == false) XCTAssertTrue(scheme.profileAction?.debugDocumentVersioning == true) - XCTAssertTrue(scheme.profileAction?.askForAppToLaunch == false) + XCTAssertNil(scheme.profileAction?.askForAppToLaunch) XCTAssertNil(scheme.profileAction?.commandlineArguments) XCTAssertNil(scheme.profileAction?.environmentVariables) From 535a4a7b3079811ebc028eb50a80c1137eb2984d Mon Sep 17 00:00:00 2001 From: YutoMizutani Date: Wed, 22 Jan 2020 00:54:57 +0900 Subject: [PATCH 014/678] Update CHANGELOG --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 552e40178..6d4ef08f5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ ### Added - Added `com.apple.product-type.xcframework` to `PBXProductType`. https://github.com/tuist/XcodeProj/pull/508 by @lakpa +- Added `askForAppToLaunch` parameter to `LaunchAction` and `ProfileAction`. https://github.com/tuist/XcodeProj/pull/515 by @YutoMizutani ## 7.5.0 From 94c6cece55db246bd31f2a53a3a8fe91e79e8524 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20Pin=CC=83era?= Date: Thu, 23 Jan 2020 18:49:26 +0100 Subject: [PATCH 015/678] Make target attributes optional --- .../Objects/Project/PBXProject.swift | 41 ++++++++++++------- .../Objects/Sourcery/Equality.generated.swift | 4 +- 2 files changed, 29 insertions(+), 16 deletions(-) diff --git a/Sources/XcodeProj/Objects/Project/PBXProject.swift b/Sources/XcodeProj/Objects/Project/PBXProject.swift index 4e60ce427..719c746cd 100644 --- a/Sources/XcodeProj/Objects/Project/PBXProject.swift +++ b/Sources/XcodeProj/Objects/Project/PBXProject.swift @@ -105,23 +105,31 @@ public final class PBXProject: PBXObject { public var attributes: [String: Any] /// Target attribute references. - var targetAttributeReferences: [PBXObjectReference: [String: Any]] + var targetAttributeReferences: [PBXObjectReference: [String: Any]]? /// Target attributes. - public var targetAttributes: [PBXTarget: [String: Any]] { + public var targetAttributes: [PBXTarget: [String: Any]]? { set { - targetAttributeReferences = [:] - newValue.forEach { - targetAttributeReferences[$0.key.reference] = $0.value + if let newValue = newValue { + targetAttributeReferences = [:] + newValue.forEach { + targetAttributeReferences?[$0.key.reference] = $0.value + } + } else { + targetAttributeReferences = nil } } get { - var attributes: [PBXTarget: [String: Any]] = [:] - targetAttributeReferences.forEach { - if let object: PBXTarget = $0.key.getObject() { - attributes[object] = $0.value + if let targetAttributeReferences = targetAttributeReferences { + var attributes: [PBXTarget: [String: Any]] = [:] + targetAttributeReferences.forEach { + if let object: PBXTarget = $0.key.getObject() { + attributes[object] = $0.value + } } + return attributes + } else { + return nil } - return attributes } } @@ -144,19 +152,22 @@ public final class PBXProject: PBXObject { /// - attributes: attributes that will be set. /// - target: target. public func setTargetAttributes(_ attributes: [String: Any], target: PBXTarget) { - targetAttributeReferences[target.reference] = attributes + if targetAttributeReferences == nil { + targetAttributeReferences = [:] + } + targetAttributeReferences?[target.reference] = attributes } /// Removes the attributes for the given target. /// /// - Parameter target: target whose attributes will be removed. public func removeTargetAttributes(target: PBXTarget) { - targetAttributeReferences.removeValue(forKey: target.reference) + targetAttributeReferences?.removeValue(forKey: target.reference) } /// Removes the all the target attributes public func clearAllTargetAttributes() { - targetAttributeReferences.removeAll() + targetAttributeReferences?.removeAll() } /// Returns the attributes of a given target. @@ -164,7 +175,7 @@ public final class PBXProject: PBXObject { /// - Parameter for: target whose attributes will be returned. /// - Returns: target attributes. public func attributes(for target: PBXTarget) -> [String: Any]? { - return targetAttributeReferences[target.reference] + return targetAttributeReferences?[target.reference] } /// Adds a remote swift package @@ -486,7 +497,7 @@ extension PBXProject: PlistSerializable { } var plistAttributes: [String: Any] = attributes - if !targetAttributeReferences.isEmpty { + if let targetAttributeReferences = targetAttributeReferences, !targetAttributeReferences.isEmpty { // merge target attributes var plistTargetAttributes: [String: Any] = [:] for (reference, value) in targetAttributeReferences { diff --git a/Sources/XcodeProj/Objects/Sourcery/Equality.generated.swift b/Sources/XcodeProj/Objects/Sourcery/Equality.generated.swift index 7c0ec85e9..4b0762782 100644 --- a/Sources/XcodeProj/Objects/Sourcery/Equality.generated.swift +++ b/Sources/XcodeProj/Objects/Sourcery/Equality.generated.swift @@ -176,7 +176,9 @@ extension PBXProject { if projectRoots != rhs.projectRoots { return false } if targetReferences != rhs.targetReferences { return false } if !NSDictionary(dictionary: attributes).isEqual(to: rhs.attributes) { return false } - if !NSDictionary(dictionary: targetAttributeReferences).isEqual(to: rhs.targetAttributeReferences) { return false } + guard let targetAttributeReferences = targetAttributeReferences, + let rhsTargetAttributeReferences = rhs.targetAttributeReferences, + NSDictionary(dictionary: targetAttributeReferences).isEqual(to: rhsTargetAttributeReferences) else { return false } return super.isEqual(to: rhs) } } From ef5d6903e28a2c6acba36de61eaec4248cd634a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20Pin=CC=83era?= Date: Thu, 23 Jan 2020 18:52:03 +0100 Subject: [PATCH 016/678] Update the CHANGELOG --- CHANGELOG.md | 3 +++ Sources/XcodeProj/Objects/Project/PBXProject.swift | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6d4ef08f5..0f78f656e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,9 @@ ## Next +### Changed +- **Breaking** Make `PBXProject.targetAttributes` optional https://github.com/tuist/XcodeProj/pull/517 by @pepibumur + ### Fixed - Remove "Shell" Carthage dependency from carthage xcode project as it's no longer used https://github.com/tuist/XcodeProj/pull/507 by @imben123 diff --git a/Sources/XcodeProj/Objects/Project/PBXProject.swift b/Sources/XcodeProj/Objects/Project/PBXProject.swift index 719c746cd..df5bc56d1 100644 --- a/Sources/XcodeProj/Objects/Project/PBXProject.swift +++ b/Sources/XcodeProj/Objects/Project/PBXProject.swift @@ -497,7 +497,7 @@ extension PBXProject: PlistSerializable { } var plistAttributes: [String: Any] = attributes - if let targetAttributeReferences = targetAttributeReferences, !targetAttributeReferences.isEmpty { + if let targetAttributeReferences = targetAttributeReferences { // merge target attributes var plistTargetAttributes: [String: Any] = [:] for (reference, value) in targetAttributeReferences { From 02e4ee305baf0ba23af7522210250d8275200122 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20Pi=C3=B1era?= Date: Thu, 23 Jan 2020 20:01:04 +0100 Subject: [PATCH 017/678] Version 7.6.0 --- CHANGELOG.md | 2 ++ README.md | 8 ++++---- xcodeproj.podspec | 2 +- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index dfa7a5fc3..d10f9c2e9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ ## Next +## 7.6.0 + ### Changed - **Breaking** Make `PBXProject.targetAttributes` optional https://github.com/tuist/XcodeProj/pull/517 by @pepibumur diff --git a/README.md b/README.md index 1480f70a7..a3f51a704 100644 --- a/README.md +++ b/README.md @@ -37,7 +37,7 @@ Add the dependency in your `Package.swift` file: let package = Package( name: "myproject", dependencies: [ - .package(url: "https://github.com/tuist/xcodeproj.git", .upToNextMajor(from: "7.5.0")), + .package(url: "https://github.com/tuist/xcodeproj.git", .upToNextMajor(from: "7.6.0")), ], targets: [ .target( @@ -53,13 +53,13 @@ let package = Package( ```bash # Cartfile -github "tuist/xcodeproj" ~> 7.5.0 +github "tuist/xcodeproj" ~> 7.6.0 ``` ### CocoaPods ```ruby -pod 'xcodeproj', '~> 7.5.0' +pod 'xcodeproj', '~> 7.6.0' ``` ### Scripting @@ -71,7 +71,7 @@ git tag that represents the project’s version: ```swift #!/usr/bin/swift sh import Foundation -import XcodeProj // @tuist ~> 7.5.0 +import XcodeProj // @tuist ~> 7.6.0 import PathKit guard CommandLine.arguments.count == 3 else { diff --git a/xcodeproj.podspec b/xcodeproj.podspec index b0fb096d5..657fa804b 100644 --- a/xcodeproj.podspec +++ b/xcodeproj.podspec @@ -1,7 +1,7 @@ Pod::Spec.new do |s| s.name = "xcodeproj" - s.version = "7.5.0" + s.version = "7.6.0" s.summary = "Read/Modify/Write your Xcode projects" s.homepage = "https://github.com/tuist/xcodeproj" s.license = 'MIT' From 3010a6f802859a39a87bb9cb6565887c7886f39a Mon Sep 17 00:00:00 2001 From: Evan Coleman Date: Mon, 27 Jan 2020 15:10:02 -0500 Subject: [PATCH 018/678] Generate project references before targets --- Sources/XcodeProj/Utils/ReferenceGenerator.swift | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Sources/XcodeProj/Utils/ReferenceGenerator.swift b/Sources/XcodeProj/Utils/ReferenceGenerator.swift index e5e24a6a2..f450a784f 100644 --- a/Sources/XcodeProj/Utils/ReferenceGenerator.swift +++ b/Sources/XcodeProj/Utils/ReferenceGenerator.swift @@ -50,10 +50,6 @@ final class ReferenceGenerator: ReferenceGenerating { try generateGroupReferences(productsGroup, identifiers: identifiers) } - // Targets - let targets: [PBXTarget] = project.targets - try targets.forEach { try generateTargetReferences($0, identifiers: identifiers) } - // Project references try project.projectReferences.flatMap { $0.values }.forEach { objectReference in if let fileReference = objectReference.getObject() as? PBXFileReference { @@ -63,6 +59,10 @@ final class ReferenceGenerator: ReferenceGenerating { } } + // Targets + let targets: [PBXTarget] = project.targets + try targets.forEach { try generateTargetReferences($0, identifiers: identifiers) } + /// Configuration list if let configurationList: XCConfigurationList = project.buildConfigurationListReference.getObject() { try generateConfigurationListReferences(configurationList, identifiers: identifiers) From 06340bbe3f245f95ec1a53ef9dc8573eb8e462cc Mon Sep 17 00:00:00 2001 From: Evan Coleman Date: Mon, 27 Jan 2020 15:17:01 -0500 Subject: [PATCH 019/678] Update CHANGELOG --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d10f9c2e9..225619ba1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,9 @@ ## Next +### Fixed +- Ensure references to products in external projects are generated with deterministic UUIDs https://github.com/tuist/XcodeProj/pull/518 by @evandcoleman + ## 7.6.0 ### Changed From 609328bcb0826d288d55d789a054a6561923414e Mon Sep 17 00:00:00 2001 From: Evan Coleman Date: Tue, 28 Jan 2020 15:31:06 -0500 Subject: [PATCH 020/678] Add test --- .../Utils/ReferenceGeneratorTests.swift | 45 +++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/Tests/XcodeProjTests/Utils/ReferenceGeneratorTests.swift b/Tests/XcodeProjTests/Utils/ReferenceGeneratorTests.swift index 505bae864..c5662f7b3 100644 --- a/Tests/XcodeProjTests/Utils/ReferenceGeneratorTests.swift +++ b/Tests/XcodeProjTests/Utils/ReferenceGeneratorTests.swift @@ -22,6 +22,32 @@ class ReferenceGeneratorTests: XCTestCase { XCTAssert(!productReferenceProxy.reference.temporary) XCTAssert(!remoteProjectFileReference.reference.temporary) } + + func test_projectReferencingRemoteXcodeprojBundle_generatesDeterministicIdentifiers() throws { + func generateProject() throws -> [String] { + let project = PBXProj(rootObject: nil, objectVersion: 0, archiveVersion: 0, classes: [:], objects: []) + let pbxProject = project.makeProject() + let remoteProjectFileReference = project.makeFileReference() + let containerItemProxy = project.makeContainerItemProxy(fileReference: remoteProjectFileReference) + let productReferenceProxy = project.makeReferenceProxy(containerItemProxy: containerItemProxy) + let productsGroup = project.makeProductsGroup(children: [productReferenceProxy]) + let (target, buildFile) = project.makeTarget(productReferenceProxy: productReferenceProxy) + + pbxProject.projectReferences.append(["ProductGroup": productsGroup.reference]) + pbxProject.targets.append(target) + + let referenceGenerator = ReferenceGenerator(outputSettings: PBXOutputSettings()) + try referenceGenerator.generateReferences(proj: project) + + return [remoteProjectFileReference, containerItemProxy, productReferenceProxy, productsGroup, buildFile] + .map { $0.reference.value } + } + + let firstUUIDs = try generateProject() + let secondUUIDs = try generateProject() + + XCTAssertEqual(Set(firstUUIDs), Set(secondUUIDs)) + } } private extension PBXProj { @@ -73,4 +99,23 @@ private extension PBXProj { add(object: productsGroup) return productsGroup } + + func makeTarget(productReferenceProxy: PBXReferenceProxy) -> (target: PBXTarget, buildFile: PBXBuildFile) { + let buildFile = PBXBuildFile(file: productReferenceProxy) + add(object: buildFile) + + let buildPhase = PBXCopyFilesBuildPhase(dstPath: "", + dstSubfolderSpec: .frameworks, + name: "Embed Frameworks", + files: [buildFile]) + add(object: buildPhase) + + let target = PBXNativeTarget(name: "MyApp", + buildPhases: [buildPhase], + productName: "MyApp.app", + productType: .application) + add(object: target) + + return (target, buildFile) + } } From bc3e31ea714a2ced4871b583141073405f279bab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20Pin=CC=83era?= Date: Wed, 29 Jan 2020 17:05:45 +0100 Subject: [PATCH 021/678] 7.7.0 --- CHANGELOG.md | 2 ++ README.md | 8 ++++---- Tapestries/Package.resolved | 12 ++++++------ XcodeProj_Carthage.xcodeproj/project.pbxproj | 7 ++++--- xcodeproj.podspec | 2 +- 5 files changed, 17 insertions(+), 14 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 225619ba1..d443e6960 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ ## Next +## 7.7.0 + ### Fixed - Ensure references to products in external projects are generated with deterministic UUIDs https://github.com/tuist/XcodeProj/pull/518 by @evandcoleman diff --git a/README.md b/README.md index a3f51a704..476347abd 100644 --- a/README.md +++ b/README.md @@ -37,7 +37,7 @@ Add the dependency in your `Package.swift` file: let package = Package( name: "myproject", dependencies: [ - .package(url: "https://github.com/tuist/xcodeproj.git", .upToNextMajor(from: "7.6.0")), + .package(url: "https://github.com/tuist/xcodeproj.git", .upToNextMajor(from: "7.7.0")), ], targets: [ .target( @@ -53,13 +53,13 @@ let package = Package( ```bash # Cartfile -github "tuist/xcodeproj" ~> 7.6.0 +github "tuist/xcodeproj" ~> 7.7.0 ``` ### CocoaPods ```ruby -pod 'xcodeproj', '~> 7.6.0' +pod 'xcodeproj', '~> 7.7.0' ``` ### Scripting @@ -71,7 +71,7 @@ git tag that represents the project’s version: ```swift #!/usr/bin/swift sh import Foundation -import XcodeProj // @tuist ~> 7.6.0 +import XcodeProj // @tuist ~> 7.7.0 import PathKit guard CommandLine.arguments.count == 3 else { diff --git a/Tapestries/Package.resolved b/Tapestries/Package.resolved index 17b034539..33f4cafb9 100644 --- a/Tapestries/Package.resolved +++ b/Tapestries/Package.resolved @@ -6,7 +6,7 @@ "repositoryURL": "https://github.com/fortmarek/acho", "state": { "branch": "spm_bump", - "revision": "7fb6330df1a1e647e43a15f9ff0f03e02e9f46e8", + "revision": "a5d68cc0da728ccee157a0861877e474d92cd5a8", "version": null } }, @@ -51,7 +51,7 @@ "repositoryURL": "https://github.com/apple/swift-llbuild.git", "state": { "branch": "master", - "revision": "c0aafa63fb42311c3754bd50530e0f7b3c6db357", + "revision": "973a3e299d39b89e6594babcd7cfab2a333a5782", "version": null } }, @@ -69,16 +69,16 @@ "repositoryURL": "https://github.com/AckeeCZ/tapestry.git", "state": { "branch": "master", - "revision": "3e11df7e2efa03b6fb71c2e093edc035ed52066a", + "revision": "39d40860d990449c8b7ee23103a90274ebfc9674", "version": null } }, { "package": "tuist", - "repositoryURL": "https://github.com/fortmarek/tuist.git", + "repositoryURL": "https://github.com/tuist/tuist.git", "state": { "branch": "master", - "revision": "4644c388abf3545bc6fe2c3862964463f54e1fb7", + "revision": "212f61684a49a1a0c3c8247be029c059bc844e6a", "version": null } }, @@ -87,7 +87,7 @@ "repositoryURL": "https://github.com/tuist/XcodeProj", "state": { "branch": "master", - "revision": "cdc932551da8f464d1dbd9e940e162f2f7da2ab6", + "revision": "6039b39a045427b8baf04b917253de2057d8fced", "version": null } } diff --git a/XcodeProj_Carthage.xcodeproj/project.pbxproj b/XcodeProj_Carthage.xcodeproj/project.pbxproj index 0771dd500..e1e6b9b4a 100644 --- a/XcodeProj_Carthage.xcodeproj/project.pbxproj +++ b/XcodeProj_Carthage.xcodeproj/project.pbxproj @@ -196,7 +196,7 @@ CC0BF3D061052148207584A5 /* XCBreakpointList.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = XCBreakpointList.swift; sourceTree = ""; }; CC365B2E771B6E2690D751DB /* PBXSourcesBuildPhase.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PBXSourcesBuildPhase.swift; sourceTree = ""; }; D07BF1A8B705E35271076BA1 /* XCBuildConfiguration.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = XCBuildConfiguration.swift; sourceTree = ""; }; - D2D78F3ED94EB9E973644780 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + D2D78F3ED94EB9E973644780 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist; path = Info.plist; sourceTree = ""; }; D4AA26E4818BC76E4CB28CEB /* PBXFileElement.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PBXFileElement.swift; sourceTree = ""; }; DE15F98D3349F2FCED4A913A /* PBXTargetDependency.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PBXTargetDependency.swift; sourceTree = ""; }; DF277186917C67A6FF4993F6 /* XCScheme+BuildableReference.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "XCScheme+BuildableReference.swift"; sourceTree = ""; }; @@ -719,7 +719,7 @@ SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; SWIFT_COMPILATION_MODE = singlefile; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 5.0; + SWIFT_VERSION = 5.1; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; }; @@ -771,6 +771,7 @@ GCC_WARN_UNUSED_VARIABLE = YES; MTL_ENABLE_DEBUG_INFO = NO; PRODUCT_NAME = "$(TARGET_NAME)"; + VALIDATE_PRODUCT = YES; }; name = Release; }; @@ -859,7 +860,7 @@ SUPPORTED_PLATFORMS = macosx; SWIFT_COMPILATION_MODE = wholemodule; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; - SWIFT_VERSION = 5.0; + SWIFT_VERSION = 5.1; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; }; diff --git a/xcodeproj.podspec b/xcodeproj.podspec index 657fa804b..7a980b77c 100644 --- a/xcodeproj.podspec +++ b/xcodeproj.podspec @@ -1,7 +1,7 @@ Pod::Spec.new do |s| s.name = "xcodeproj" - s.version = "7.6.0" + s.version = "7.7.0" s.summary = "Read/Modify/Write your Xcode projects" s.homepage = "https://github.com/tuist/xcodeproj" s.license = 'MIT' From 3968ecaaee80445622609f571aeb6fdd03f42c87 Mon Sep 17 00:00:00 2001 From: yonaskolb Date: Sun, 2 Feb 2020 09:24:00 +1100 Subject: [PATCH 022/678] fix target attributes --- .../Objects/Project/PBXProject.swift | 55 ++++++++----------- .../Objects/Sourcery/Equality.generated.swift | 4 +- 2 files changed, 23 insertions(+), 36 deletions(-) diff --git a/Sources/XcodeProj/Objects/Project/PBXProject.swift b/Sources/XcodeProj/Objects/Project/PBXProject.swift index df5bc56d1..0b00e96cf 100644 --- a/Sources/XcodeProj/Objects/Project/PBXProject.swift +++ b/Sources/XcodeProj/Objects/Project/PBXProject.swift @@ -105,31 +105,23 @@ public final class PBXProject: PBXObject { public var attributes: [String: Any] /// Target attribute references. - var targetAttributeReferences: [PBXObjectReference: [String: Any]]? + var targetAttributeReferences: [PBXObjectReference: [String: Any]] /// Target attributes. - public var targetAttributes: [PBXTarget: [String: Any]]? { + public var targetAttributes: [PBXTarget: [String: Any]] { set { - if let newValue = newValue { - targetAttributeReferences = [:] - newValue.forEach { - targetAttributeReferences?[$0.key.reference] = $0.value - } - } else { - targetAttributeReferences = nil + targetAttributeReferences = [:] + newValue.forEach { + targetAttributeReferences[$0.key.reference] = $0.value } } get { - if let targetAttributeReferences = targetAttributeReferences { - var attributes: [PBXTarget: [String: Any]] = [:] - targetAttributeReferences.forEach { - if let object: PBXTarget = $0.key.getObject() { - attributes[object] = $0.value - } + var attributes: [PBXTarget: [String: Any]] = [:] + targetAttributeReferences.forEach { + if let object: PBXTarget = $0.key.getObject() { + attributes[object] = $0.value } - return attributes - } else { - return nil } + return attributes } } @@ -152,22 +144,19 @@ public final class PBXProject: PBXObject { /// - attributes: attributes that will be set. /// - target: target. public func setTargetAttributes(_ attributes: [String: Any], target: PBXTarget) { - if targetAttributeReferences == nil { - targetAttributeReferences = [:] - } - targetAttributeReferences?[target.reference] = attributes + targetAttributeReferences[target.reference] = attributes } /// Removes the attributes for the given target. /// /// - Parameter target: target whose attributes will be removed. public func removeTargetAttributes(target: PBXTarget) { - targetAttributeReferences?.removeValue(forKey: target.reference) + targetAttributeReferences.removeValue(forKey: target.reference) } /// Removes the all the target attributes public func clearAllTargetAttributes() { - targetAttributeReferences?.removeAll() + targetAttributeReferences.removeAll() } /// Returns the attributes of a given target. @@ -175,7 +164,7 @@ public final class PBXProject: PBXObject { /// - Parameter for: target whose attributes will be returned. /// - Returns: target attributes. public func attributes(for target: PBXTarget) -> [String: Any]? { - return targetAttributeReferences?[target.reference] + return targetAttributeReferences[target.reference] } /// Adds a remote swift package @@ -497,16 +486,16 @@ extension PBXProject: PlistSerializable { } var plistAttributes: [String: Any] = attributes - if let targetAttributeReferences = targetAttributeReferences { - // merge target attributes - var plistTargetAttributes: [String: Any] = [:] - for (reference, value) in targetAttributeReferences { - plistTargetAttributes[reference.value] = value.mapValues { value in - (value as? PBXObject)?.reference.value ?? value - } + + // merge target attributes + var plistTargetAttributes: [String: Any] = [:] + for (reference, value) in targetAttributeReferences { + plistTargetAttributes[reference.value] = value.mapValues { value in + (value as? PBXObject)?.reference.value ?? value } - plistAttributes[PBXProject.targetAttributesKey] = plistTargetAttributes } + plistAttributes[PBXProject.targetAttributesKey] = plistTargetAttributes + dictionary["attributes"] = plistAttributes.plist() return (key: CommentedString(reference, diff --git a/Sources/XcodeProj/Objects/Sourcery/Equality.generated.swift b/Sources/XcodeProj/Objects/Sourcery/Equality.generated.swift index 4b0762782..7c0ec85e9 100644 --- a/Sources/XcodeProj/Objects/Sourcery/Equality.generated.swift +++ b/Sources/XcodeProj/Objects/Sourcery/Equality.generated.swift @@ -176,9 +176,7 @@ extension PBXProject { if projectRoots != rhs.projectRoots { return false } if targetReferences != rhs.targetReferences { return false } if !NSDictionary(dictionary: attributes).isEqual(to: rhs.attributes) { return false } - guard let targetAttributeReferences = targetAttributeReferences, - let rhsTargetAttributeReferences = rhs.targetAttributeReferences, - NSDictionary(dictionary: targetAttributeReferences).isEqual(to: rhsTargetAttributeReferences) else { return false } + if !NSDictionary(dictionary: targetAttributeReferences).isEqual(to: rhs.targetAttributeReferences) { return false } return super.isEqual(to: rhs) } } From a2bd6826ebaa66cbc6f5a2958485bf04c2e69d8b Mon Sep 17 00:00:00 2001 From: yonaskolb Date: Sun, 2 Feb 2020 09:33:31 +1100 Subject: [PATCH 023/678] update changelog --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d443e6960..55f3c1b2a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ ## Next +### Fixes + +- Make `PBXProject.targetAttributes` non optional again and fix equality https://github.com/tuist/XcodeProj/pull/519 by @yonaskolb + ## 7.7.0 ### Fixed From 01465a42297f09efa39429f1c3ca613ca1b2a665 Mon Sep 17 00:00:00 2001 From: Vytis Date: Sun, 2 Feb 2020 11:49:44 +0100 Subject: [PATCH 024/678] Add PathRunnable to LaunchAction --- .../Scheme/XCScheme+LaunchAction.swift | 15 ++++++- .../Scheme/XCScheme+PathRunnable.swift | 44 +++++++++++++++++++ .../XcodeProjTests/Scheme/XCSchemeTests.swift | 14 ++++++ 3 files changed, 72 insertions(+), 1 deletion(-) create mode 100644 Sources/XcodeProj/Scheme/XCScheme+PathRunnable.swift diff --git a/Sources/XcodeProj/Scheme/XCScheme+LaunchAction.swift b/Sources/XcodeProj/Scheme/XCScheme+LaunchAction.swift index d6ce0084a..9f846f646 100644 --- a/Sources/XcodeProj/Scheme/XCScheme+LaunchAction.swift +++ b/Sources/XcodeProj/Scheme/XCScheme+LaunchAction.swift @@ -41,6 +41,7 @@ extension XCScheme { public var buildConfiguration: String public var launchStyle: Style public var askForAppToLaunch: Bool? + public var pathRunnable: PathRunnable? public var useCustomWorkingDirectory: Bool public var ignoresPersistentStateOnLaunch: Bool public var debugDocumentVersioning: Bool @@ -77,6 +78,7 @@ extension XCScheme { selectedLauncherIdentifier: String = XCScheme.defaultLauncher, launchStyle: Style = .auto, askForAppToLaunch: Bool? = nil, + pathRunnable: PathRunnable? = nil, useCustomWorkingDirectory: Bool = false, ignoresPersistentStateOnLaunch: Bool = false, debugDocumentVersioning: Bool = true, @@ -107,6 +109,7 @@ extension XCScheme { self.selectedDebuggerIdentifier = selectedDebuggerIdentifier self.selectedLauncherIdentifier = selectedLauncherIdentifier self.askForAppToLaunch = askForAppToLaunch + self.pathRunnable = pathRunnable self.useCustomWorkingDirectory = useCustomWorkingDirectory self.ignoresPersistentStateOnLaunch = ignoresPersistentStateOnLaunch self.debugDocumentVersioning = debugDocumentVersioning @@ -154,7 +157,12 @@ extension XCScheme { } else if remoteRunnableElement.error == nil { runnable = try RemoteRunnable(element: remoteRunnableElement) } - + + let pathRunnable = element["PathRunnable"] + if pathRunnable.error == nil { + self.pathRunnable = try PathRunnable(element: pathRunnable) + } + let buildableReferenceElement = element["MacroExpansion"]["BuildableReference"] if buildableReferenceElement.error == nil { macroExpansion = try BuildableReference(element: buildableReferenceElement) @@ -261,6 +269,10 @@ extension XCScheme { if let runnable = runnable { element.addChild(runnable.xmlElement()) } + + if let pathRunnable = pathRunnable { + element.addChild(pathRunnable.xmlElement()) + } if let locationScenarioReference = locationScenarioReference { element.addChild(locationScenarioReference.xmlElement()) @@ -313,6 +325,7 @@ extension XCScheme { buildConfiguration == rhs.buildConfiguration && launchStyle == rhs.launchStyle && askForAppToLaunch == rhs.askForAppToLaunch && + pathRunnable == rhs.pathRunnable && useCustomWorkingDirectory == rhs.useCustomWorkingDirectory && ignoresPersistentStateOnLaunch == rhs.ignoresPersistentStateOnLaunch && debugDocumentVersioning == rhs.debugDocumentVersioning && diff --git a/Sources/XcodeProj/Scheme/XCScheme+PathRunnable.swift b/Sources/XcodeProj/Scheme/XCScheme+PathRunnable.swift new file mode 100644 index 000000000..ef2a0deb1 --- /dev/null +++ b/Sources/XcodeProj/Scheme/XCScheme+PathRunnable.swift @@ -0,0 +1,44 @@ +import AEXML +import Foundation +import PathKit + +extension XCScheme { + public class PathRunnable: Equatable { + // MARK: - Attributes + + public var runnableDebuggingMode: String + public var filePath: String + + // MARK: - Init + + public init(filePath: String, + runnableDebuggingMode: String = "0") { + self.filePath = filePath + self.runnableDebuggingMode = runnableDebuggingMode + } + + init(element: AEXMLElement) throws { + runnableDebuggingMode = element.attributes["runnableDebuggingMode"] ?? "0" + filePath = element.attributes["FilePath"] ?? "" + } + + // MARK: - XML + + func xmlElement() -> AEXMLElement { + return AEXMLElement(name: "PathRunnable", + value: nil, + attributes: [ + "runnableDebuggingMode": runnableDebuggingMode, + "FilePath" : filePath + ] + ) + } + + // MARK: - Equatable + + public static func == (lhs: PathRunnable, rhs: PathRunnable) -> Bool { + return lhs.runnableDebuggingMode == rhs.runnableDebuggingMode && + lhs.filePath == rhs.filePath + } + } +} diff --git a/Tests/XcodeProjTests/Scheme/XCSchemeTests.swift b/Tests/XcodeProjTests/Scheme/XCSchemeTests.swift index 83427bed6..ef3d72a60 100644 --- a/Tests/XcodeProjTests/Scheme/XCSchemeTests.swift +++ b/Tests/XcodeProjTests/Scheme/XCSchemeTests.swift @@ -85,6 +85,20 @@ final class XCSchemeIntegrationTests: XCTestCase { XCTAssertEqual(subject.attributes["default"], "YES") } + func test_testAction_pathRunnable_serializingAndDeserializing() throws { + // Given + let filePath = "/usr/bin/foo" + let pathRunnable = XCScheme.PathRunnable(filePath: filePath, runnableDebuggingMode: "0") + let subject = XCScheme.LaunchAction(runnable: nil, buildConfiguration: "Debug", pathRunnable: pathRunnable) + + // When + let element = subject.xmlElement() + let reconstructedSubject = try XCScheme.LaunchAction(element: element) + + // Then + XCTAssertEqual(subject, reconstructedSubject) + } + func test_testAction_serializingAndDeserializing() throws { // Given let subject = XCScheme.TestAction(buildConfiguration: "Debug", macroExpansion: nil) From 128a6f9f18eb8dcbcd558527982afc8a0d85723c Mon Sep 17 00:00:00 2001 From: Vytis Date: Sun, 2 Feb 2020 16:51:46 +0100 Subject: [PATCH 025/678] Updated changelog --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d443e6960..21ada1cea 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,9 @@ ## Next +### Added +- Added `PathRunnable` to the `LaunchAction` to allow running any executable https://github.com/tuist/XcodeProj/pull/521 by @vytis + ## 7.7.0 ### Fixed From f32704e01d2752bdc17cde3963bee4256c1f4df4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20Pi=C3=B1era?= Date: Mon, 3 Feb 2020 08:11:06 +0900 Subject: [PATCH 026/678] Version 7.8.0 --- README.md | 8 ++++---- XcodeProj_Carthage.xcodeproj/project.pbxproj | 4 ++++ xcodeproj.podspec | 2 +- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 476347abd..c5d0d8a0d 100644 --- a/README.md +++ b/README.md @@ -37,7 +37,7 @@ Add the dependency in your `Package.swift` file: let package = Package( name: "myproject", dependencies: [ - .package(url: "https://github.com/tuist/xcodeproj.git", .upToNextMajor(from: "7.7.0")), + .package(url: "https://github.com/tuist/xcodeproj.git", .upToNextMajor(from: "7.8.0")), ], targets: [ .target( @@ -53,13 +53,13 @@ let package = Package( ```bash # Cartfile -github "tuist/xcodeproj" ~> 7.7.0 +github "tuist/xcodeproj" ~> 7.8.0 ``` ### CocoaPods ```ruby -pod 'xcodeproj', '~> 7.7.0' +pod 'xcodeproj', '~> 7.8.0' ``` ### Scripting @@ -71,7 +71,7 @@ git tag that represents the project’s version: ```swift #!/usr/bin/swift sh import Foundation -import XcodeProj // @tuist ~> 7.7.0 +import XcodeProj // @tuist ~> 7.8.0 import PathKit guard CommandLine.arguments.count == 3 else { diff --git a/XcodeProj_Carthage.xcodeproj/project.pbxproj b/XcodeProj_Carthage.xcodeproj/project.pbxproj index e1e6b9b4a..96ab89417 100644 --- a/XcodeProj_Carthage.xcodeproj/project.pbxproj +++ b/XcodeProj_Carthage.xcodeproj/project.pbxproj @@ -13,6 +13,7 @@ 0B364FCF8F7A557C252929EA /* XCConfig.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2B928006AD1C96D4D8072BD9 /* XCConfig.swift */; }; 0C6F7F2EF3EE9D97F081D9FD /* PBXAggregateTarget.swift in Sources */ = {isa = PBXBuildFile; fileRef = A11172C9DBADEDF3203564B7 /* PBXAggregateTarget.swift */; }; 1009BFBC8BD95556803FF2C9 /* Dictionary+Extras.swift in Sources */ = {isa = PBXBuildFile; fileRef = 48D03946AD764A02121872F7 /* Dictionary+Extras.swift */; }; + 1270ABC0B6133C84F57A8D3F /* XCScheme+PathRunnable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 26EF076F4983A1ABBD3CC81B /* XCScheme+PathRunnable.swift */; }; 13CBB83040E0B373CE80CB16 /* PBXBuildFile.swift in Sources */ = {isa = PBXBuildFile; fileRef = 13177CF1296C6C32BF4C5B7C /* PBXBuildFile.swift */; }; 147157016720CE9BC5943AF2 /* XCScheme+LaunchAction.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4EE77276DEE6859DE961F94D /* XCScheme+LaunchAction.swift */; }; 1ADDD97C53AEC0990F693CDA /* AEXML.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0C950F23FEF894B133070990 /* AEXML.framework */; }; @@ -133,6 +134,7 @@ 20B1225FED6E1D49EE385AA0 /* XCScheme+EnvironmentVariable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "XCScheme+EnvironmentVariable.swift"; sourceTree = ""; }; 2370B4E19828CEFC032511A1 /* PBXContainerItemProxy.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PBXContainerItemProxy.swift; sourceTree = ""; }; 249AAF8AE1978D1546C0ADB5 /* PBXGroup.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PBXGroup.swift; sourceTree = ""; }; + 26EF076F4983A1ABBD3CC81B /* XCScheme+PathRunnable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "XCScheme+PathRunnable.swift"; sourceTree = ""; }; 2B928006AD1C96D4D8072BD9 /* XCConfig.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = XCConfig.swift; sourceTree = ""; }; 2BD1A6E5AC6502EDE59541C8 /* PBXNativeTarget.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PBXNativeTarget.swift; sourceTree = ""; }; 2D9937B44A9FCDD847F79008 /* XCSwiftPackageProductDependency.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = XCSwiftPackageProductDependency.swift; sourceTree = ""; }; @@ -336,6 +338,7 @@ C3FE679A53603AE3FE43462F /* XCScheme+ExecutionAction.swift */, 4EE77276DEE6859DE961F94D /* XCScheme+LaunchAction.swift */, 39B8CB253365692579B8C8E2 /* XCScheme+LocationScenarioReference.swift */, + 26EF076F4983A1ABBD3CC81B /* XCScheme+PathRunnable.swift */, B2E17A977543393ED7B848A9 /* XCScheme+ProfileAction.swift */, 0BFCA27253AECAC6A2EF5E66 /* XCScheme+RemoteRunnable.swift */, 1D5C2732048660AC71431D9C /* XCScheme+Runnable.swift */, @@ -660,6 +663,7 @@ AC49ED6F358FFBF504A3D0AE /* XCScheme+ExecutionAction.swift in Sources */, 147157016720CE9BC5943AF2 /* XCScheme+LaunchAction.swift in Sources */, 69CBD38E1B96198049A02795 /* XCScheme+LocationScenarioReference.swift in Sources */, + 1270ABC0B6133C84F57A8D3F /* XCScheme+PathRunnable.swift in Sources */, 364C132E6ABF980BF9E84649 /* XCScheme+ProfileAction.swift in Sources */, 209B0AC5FFCE800A35624C49 /* XCScheme+RemoteRunnable.swift in Sources */, B972348A969282D604A5C325 /* XCScheme+Runnable.swift in Sources */, diff --git a/xcodeproj.podspec b/xcodeproj.podspec index 7a980b77c..76c4b29d4 100644 --- a/xcodeproj.podspec +++ b/xcodeproj.podspec @@ -1,7 +1,7 @@ Pod::Spec.new do |s| s.name = "xcodeproj" - s.version = "7.7.0" + s.version = "7.8.0" s.summary = "Read/Modify/Write your Xcode projects" s.homepage = "https://github.com/tuist/xcodeproj" s.license = 'MIT' From 051a1a6a32067324414019a7b522173183dbe994 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20Pi=C3=B1era?= Date: Mon, 3 Feb 2020 08:24:01 +0900 Subject: [PATCH 027/678] Update CHANGELOG --- CHANGELOG.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d03a26885..8076979ad 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,26 +2,34 @@ ## Next +## 7.8.0 + ### Added + - Added `PathRunnable` to the `LaunchAction` to allow running any executable https://github.com/tuist/XcodeProj/pull/521 by @vytis ### Fixed + - Make `PBXProject.targetAttributes` non optional again and fix equality https://github.com/tuist/XcodeProj/pull/519 by @yonaskolb ## 7.7.0 ### Fixed + - Ensure references to products in external projects are generated with deterministic UUIDs https://github.com/tuist/XcodeProj/pull/518 by @evandcoleman ## 7.6.0 ### Changed + - **Breaking** Make `PBXProject.targetAttributes` optional https://github.com/tuist/XcodeProj/pull/517 by @pepibumur ### Fixed + - Remove "Shell" Carthage dependency from carthage xcode project as it's no longer used https://github.com/tuist/XcodeProj/pull/507 by @imben123 ### Added + - Added `com.apple.product-type.xcframework` to `PBXProductType`. https://github.com/tuist/XcodeProj/pull/508 by @lakpa - Added `askForAppToLaunch` parameter to `LaunchAction` and `ProfileAction`. https://github.com/tuist/XcodeProj/pull/515 by @YutoMizutani - Added `"ENABLE_PREVIEWS"` to target application build settings https://github.com/tuist/XcodeProj/pull/511 by @fortmarek From f436b174d5ce575f6d216ad0492cbd2386d74ec1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20For=CC=8Ct?= Date: Sun, 9 Feb 2020 16:24:24 +0100 Subject: [PATCH 028/678] Update tapestry structure for 0.0.5 release. --- .gitignore | 3 - Tapestries/Package.resolved | 97 ------------------- Tapestries/Package.swift | 21 ---- ...pestryConfig.swift => TapestryConfig.swift | 0 4 files changed, 121 deletions(-) delete mode 100644 Tapestries/Package.resolved delete mode 100644 Tapestries/Package.swift rename Tapestries/Sources/TapestryConfig/TapestryConfig.swift => TapestryConfig.swift (100%) diff --git a/.gitignore b/.gitignore index 69946c1e9..3c11c1db0 100644 --- a/.gitignore +++ b/.gitignore @@ -185,6 +185,3 @@ XcodeProj.xcodeproj tmp/ XcodeProj.framework.zip -# Tapestry -tapestries/.build -tapestries/.swiftpm diff --git a/Tapestries/Package.resolved b/Tapestries/Package.resolved deleted file mode 100644 index 33f4cafb9..000000000 --- a/Tapestries/Package.resolved +++ /dev/null @@ -1,97 +0,0 @@ -{ - "object": { - "pins": [ - { - "package": "acho", - "repositoryURL": "https://github.com/fortmarek/acho", - "state": { - "branch": "spm_bump", - "revision": "a5d68cc0da728ccee157a0861877e474d92cd5a8", - "version": null - } - }, - { - "package": "AEXML", - "repositoryURL": "https://github.com/tadija/AEXML", - "state": { - "branch": null, - "revision": "e4d517844dd03dac557e35d77a8e9ab438de91a6", - "version": "4.4.0" - } - }, - { - "package": "ColorizeSwift", - "repositoryURL": "https://github.com/mtynior/ColorizeSwift.git", - "state": { - "branch": "master", - "revision": "7492d039d594daccc39cacea343eed6cc9d1ed5a", - "version": null - } - }, - { - "package": "PathKit", - "repositoryURL": "https://github.com/kylef/PathKit", - "state": { - "branch": null, - "revision": "73f8e9dca9b7a3078cb79128217dc8f2e585a511", - "version": "1.0.0" - } - }, - { - "package": "Spectre", - "repositoryURL": "https://github.com/kylef/Spectre.git", - "state": { - "branch": null, - "revision": "f14ff47f45642aa5703900980b014c2e9394b6e5", - "version": "0.9.0" - } - }, - { - "package": "llbuild", - "repositoryURL": "https://github.com/apple/swift-llbuild.git", - "state": { - "branch": "master", - "revision": "973a3e299d39b89e6594babcd7cfab2a333a5782", - "version": null - } - }, - { - "package": "SwiftPM", - "repositoryURL": "https://github.com/apple/swift-package-manager", - "state": { - "branch": "swift-5.0-RELEASE", - "revision": "3a57975e10be0b1a8b87992ddf3a49701036f96c", - "version": null - } - }, - { - "package": "tapestry", - "repositoryURL": "https://github.com/AckeeCZ/tapestry.git", - "state": { - "branch": "master", - "revision": "39d40860d990449c8b7ee23103a90274ebfc9674", - "version": null - } - }, - { - "package": "tuist", - "repositoryURL": "https://github.com/tuist/tuist.git", - "state": { - "branch": "master", - "revision": "212f61684a49a1a0c3c8247be029c059bc844e6a", - "version": null - } - }, - { - "package": "XcodeProj", - "repositoryURL": "https://github.com/tuist/XcodeProj", - "state": { - "branch": "master", - "revision": "6039b39a045427b8baf04b917253de2057d8fced", - "version": null - } - } - ] - }, - "version": 1 -} diff --git a/Tapestries/Package.swift b/Tapestries/Package.swift deleted file mode 100644 index a7051c7cf..000000000 --- a/Tapestries/Package.swift +++ /dev/null @@ -1,21 +0,0 @@ -// swift-tools-version:5.1 -// The swift-tools-version declares the minimum version of Swift required to build this package. - -import PackageDescription - -let package = Package( - name: "Tapestries", - products: [ - .library(name: "TapestryConfig", targets: ["TapestryConfig"]), - ], - dependencies: [ - // Tapestry - .package(url: "https://github.com/AckeeCZ/tapestry.git", .branch("master")), - ], - targets: [ - .target(name: "TapestryConfig", - dependencies: [ - "PackageDescription", - ]), - ] -) diff --git a/Tapestries/Sources/TapestryConfig/TapestryConfig.swift b/TapestryConfig.swift similarity index 100% rename from Tapestries/Sources/TapestryConfig/TapestryConfig.swift rename to TapestryConfig.swift From 4aebc0df33f67beab47cb94f5f21e5f36540276b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20For=CC=8Ct?= Date: Sun, 9 Feb 2020 16:32:08 +0100 Subject: [PATCH 029/678] Update CHANGELOG. --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8076979ad..c00325d35 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ ## Next +### Changed + +- Remove `Tapestries` folder for tapestry 0.0.5 version https://github.com/tuist/XcodeProj/pull/523 by @fortmarek + ## 7.8.0 ### Added From 907165735d39984ebc4473f9255dc1c98a6b9fad Mon Sep 17 00:00:00 2001 From: Adam Khazi Date: Mon, 3 Feb 2020 16:48:07 +0000 Subject: [PATCH 030/678] test and launch actions -- do not add parent when no elements in codecov and additional options --- .../Scheme/XCScheme+LaunchAction.swift | 9 ++++++--- .../XcodeProj/Scheme/XCScheme+TestAction.swift | 18 +++++++++++------- 2 files changed, 17 insertions(+), 10 deletions(-) diff --git a/Sources/XcodeProj/Scheme/XCScheme+LaunchAction.swift b/Sources/XcodeProj/Scheme/XCScheme+LaunchAction.swift index 9f846f646..5d8aae4ce 100644 --- a/Sources/XcodeProj/Scheme/XCScheme+LaunchAction.swift +++ b/Sources/XcodeProj/Scheme/XCScheme+LaunchAction.swift @@ -306,10 +306,13 @@ extension XCScheme { element.attributes["customLaunchCommand"] = customLaunchCommand } - let additionalOptionsElement = element.addChild(AEXMLElement(name: "AdditionalOptions")) - additionalOptions.forEach { additionalOption in - additionalOptionsElement.addChild(additionalOption.xmlElement()) + if !additionalOptions.isEmpty { + let additionalOptionsElement = element.addChild(AEXMLElement(name: "AdditionalOptions")) + additionalOptions.forEach { additionalOption in + additionalOptionsElement.addChild(additionalOption.xmlElement()) + } } + return element } diff --git a/Sources/XcodeProj/Scheme/XCScheme+TestAction.swift b/Sources/XcodeProj/Scheme/XCScheme+TestAction.swift index ffbc7aeab..9b159ae85 100644 --- a/Sources/XcodeProj/Scheme/XCScheme+TestAction.swift +++ b/Sources/XcodeProj/Scheme/XCScheme+TestAction.swift @@ -204,16 +204,20 @@ extension XCScheme { element.addChild(EnvironmentVariable.xmlElement(from: environmentVariables)) } - let additionalOptionsElement = element.addChild(AEXMLElement(name: "AdditionalOptions")) - additionalOptions.forEach { additionalOption in - additionalOptionsElement.addChild(additionalOption.xmlElement()) + if !additionalOptions.isEmpty { + let additionalOptionsElement = element.addChild(AEXMLElement(name: "AdditionalOptions")) + additionalOptions.forEach { additionalOption in + additionalOptionsElement.addChild(additionalOption.xmlElement()) + } } - let codeCoverageTargetsElement = element.addChild(AEXMLElement(name: "CodeCoverageTargets")) - codeCoverageTargets.forEach { target in - codeCoverageTargetsElement.addChild(target.xmlElement()) + if !codeCoverageTargets.isEmpty { + let codeCoverageTargetsElement = element.addChild(AEXMLElement(name: "CodeCoverageTargets")) + codeCoverageTargets.forEach { target in + codeCoverageTargetsElement.addChild(target.xmlElement()) + } } - + return element } From e076e26206d08dbf8ec6668f7266426ea95759a6 Mon Sep 17 00:00:00 2001 From: Adam Khazi Date: Tue, 4 Feb 2020 10:08:24 +0000 Subject: [PATCH 031/678] changelog --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index c00325d35..ea5a45124 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,10 @@ - Remove `Tapestries` folder for tapestry 0.0.5 version https://github.com/tuist/XcodeProj/pull/523 by @fortmarek +### Fixed + +- Code Coverage Targets and Additional Options Scheme Instability https://github.com/tuist/XcodeProj/pull/522 by @adamkhazi + ## 7.8.0 ### Added From 23df084ac575cc1e55be39aea5ef7abc517c975a Mon Sep 17 00:00:00 2001 From: Adam Khazi Date: Fri, 14 Feb 2020 10:32:32 +0000 Subject: [PATCH 032/678] workspace equatable fixes and tests --- Sources/XcodeProj/Workspace/XCWorkspace.swift | 4 +-- .../XcodeProj/Workspace/XCWorkspaceData.swift | 4 +-- .../XCWorkspaceDataElementTests.swift | 34 ++++++++++++++++++ .../Workspace/XCWorkspaceTests.swift | 35 +++++++++++++++++++ 4 files changed, 73 insertions(+), 4 deletions(-) diff --git a/Sources/XcodeProj/Workspace/XCWorkspace.swift b/Sources/XcodeProj/Workspace/XCWorkspace.swift index 6bba2c04b..1c86d6a69 100644 --- a/Sources/XcodeProj/Workspace/XCWorkspace.swift +++ b/Sources/XcodeProj/Workspace/XCWorkspace.swift @@ -61,7 +61,7 @@ public final class XCWorkspace: Writable, Equatable { // MARK: - Equatable - public static func == (_: XCWorkspace, rhs: XCWorkspace) -> Bool { - return rhs.data == rhs.data + public static func == (lhs: XCWorkspace, rhs: XCWorkspace) -> Bool { + return lhs.data == rhs.data } } diff --git a/Sources/XcodeProj/Workspace/XCWorkspaceData.swift b/Sources/XcodeProj/Workspace/XCWorkspaceData.swift index d67120ab6..67131cd94 100644 --- a/Sources/XcodeProj/Workspace/XCWorkspaceData.swift +++ b/Sources/XcodeProj/Workspace/XCWorkspaceData.swift @@ -11,8 +11,8 @@ public final class XCWorkspaceData { } extension XCWorkspaceData: Equatable { - public static func == (_: XCWorkspaceData, rhs: XCWorkspaceData) -> Bool { - return rhs.children == rhs.children + public static func == (lhs: XCWorkspaceData, rhs: XCWorkspaceData) -> Bool { + return lhs.children == rhs.children } } diff --git a/Tests/XcodeProjTests/Workspace/XCWorkspaceDataElementTests.swift b/Tests/XcodeProjTests/Workspace/XCWorkspaceDataElementTests.swift index f497aa3bc..1073098f4 100644 --- a/Tests/XcodeProjTests/Workspace/XCWorkspaceDataElementTests.swift +++ b/Tests/XcodeProjTests/Workspace/XCWorkspaceDataElementTests.swift @@ -21,4 +21,38 @@ final class XCWorkspaceDataElementTests: XCTestCase { XCTAssertEqual(element.location, location) } + + func test_equatable_when_unequal_data_elements() { + // Given + let location: XCWorkspaceDataElementLocationType = .absolute("/path/to/file.swift") + let file = XCWorkspaceDataFileRef(location: location) + let element = XCWorkspaceDataElement.file(file) + + // When + let firstWorkspace = XCWorkspace(data: .init(children: [element])) + let secondWorkspace = XCWorkspace(data: .init(children: [])) + + // Then + XCTAssertNotEqual(firstWorkspace, secondWorkspace) + } + + func test_equatable_when_equal_data_elements() { + // Given + let groupLocation: XCWorkspaceDataElementLocationType = .absolute("/path/to/group") + let group = XCWorkspaceDataGroup(location: groupLocation, + name: "group", + children: []) + let elementOne = XCWorkspaceDataElement.group(group) + + let fileLocation: XCWorkspaceDataElementLocationType = .absolute("/path/to/file.swift") + let file = XCWorkspaceDataFileRef(location: fileLocation) + let elementTwo = XCWorkspaceDataElement.file(file) + + // When + let firstWorkspace = XCWorkspace(data: .init(children: [elementOne, elementTwo])) + let secondWorkspace = XCWorkspace(data: .init(children: [elementOne, elementTwo])) + + // Then + XCTAssertEqual(firstWorkspace, secondWorkspace) + } } diff --git a/Tests/XcodeProjTests/Workspace/XCWorkspaceTests.swift b/Tests/XcodeProjTests/Workspace/XCWorkspaceTests.swift index 5827d5469..ce64b3b1d 100644 --- a/Tests/XcodeProjTests/Workspace/XCWorkspaceTests.swift +++ b/Tests/XcodeProjTests/Workspace/XCWorkspaceTests.swift @@ -21,4 +21,39 @@ final class XCWorkspaceIntegrationTests: XCTestCase { XCTAssertEqual(XCWorkspace().data.children.count, 1) XCTAssertEqual(XCWorkspace().data.children.first, .file(.init(location: .self("")))) } + + func test_equatable_emptyWorkspacesAreEqual() { + // When + let firstWorkspace = XCWorkspace(data: .init(children: [])) + let secondWorkspace = XCWorkspace(data: .init(children: [])) + + // Then + XCTAssertEqual(firstWorkspace, secondWorkspace) + } + + func test_equatable_unEqualWorkspacesAreNotEqual() { + // Given + let pathOne = fixturesPath() + "iOS/Project.xcodeproj/project.xcworkspace" + let pathTwo = fixturesPath() + "iOS/Workspace.xcworkspace" + + // When + let firstWorkspace = try? XCWorkspace(path: pathOne) + let secondWorkspace = try? XCWorkspace(path: pathTwo) + + // Then + XCTAssertNotEqual(firstWorkspace, secondWorkspace) + } + + func test_equatable_equalWorkspacesAreEqual() { + // Given + let pathOne = fixturesPath() + "iOS/Workspace.xcworkspace" + let pathTwo = fixturesPath() + "iOS/Workspace.xcworkspace" + + // When + let firstWorkspace = try? XCWorkspace(path: pathOne) + let secondWorkspace = try? XCWorkspace(path: pathTwo) + + // Then + XCTAssertEqual(firstWorkspace, secondWorkspace) + } } From 05fbaafb96e3d78006ebb81c575f163841513bb3 Mon Sep 17 00:00:00 2001 From: Adam Khazi Date: Fri, 14 Feb 2020 10:42:40 +0000 Subject: [PATCH 033/678] change log --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index c00325d35..e6a2fc117 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,10 @@ - Remove `Tapestries` folder for tapestry 0.0.5 version https://github.com/tuist/XcodeProj/pull/523 by @fortmarek +### Fixed + +- Fix `XCWorkspace` `Equatable` https://github.com/tuist/XcodeProj/pull/524 by @adamkhazi + ## 7.8.0 ### Added From edf0ec53d6d161aa865264ccd63e757428780a83 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Tue, 10 Mar 2020 11:13:07 +0000 Subject: [PATCH 034/678] Bump cocoapods from 1.8.4 to 1.9.1 Bumps [cocoapods](https://github.com/CocoaPods/CocoaPods) from 1.8.4 to 1.9.1. - [Release notes](https://github.com/CocoaPods/CocoaPods/releases) - [Changelog](https://github.com/CocoaPods/CocoaPods/blob/master/CHANGELOG.md) - [Commits](https://github.com/CocoaPods/CocoaPods/compare/1.8.4...1.9.1) Signed-off-by: dependabot-preview[bot] --- Gemfile | 2 +- Gemfile.lock | 22 ++++++++++++++-------- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/Gemfile b/Gemfile index 76ee19358..63e92e482 100644 --- a/Gemfile +++ b/Gemfile @@ -2,6 +2,6 @@ source "https://rubygems.org" gem "rake" gem "jazzy" -gem "cocoapods", "1.8.4" +gem "cocoapods", "1.9.1" gem "colorize", "~> 0.8.1" gem "redcarpet", "~> 3.5.0" diff --git a/Gemfile.lock b/Gemfile.lock index 885d3bfe8..ac92fbdd8 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -12,10 +12,10 @@ GEM json (>= 1.5.1) atomos (0.1.3) claide (1.0.3) - cocoapods (1.8.4) + cocoapods (1.9.1) activesupport (>= 4.0.2, < 5) claide (>= 1.0.2, < 2.0) - cocoapods-core (= 1.8.4) + cocoapods-core (= 1.9.1) cocoapods-deintegrate (>= 1.0.3, < 2.0) cocoapods-downloader (>= 1.2.2, < 2.0) cocoapods-plugins (>= 1.0.0, < 2.0) @@ -30,13 +30,15 @@ GEM molinillo (~> 0.6.6) nap (~> 1.0) ruby-macho (~> 1.4) - xcodeproj (>= 1.11.1, < 2.0) - cocoapods-core (1.8.4) + xcodeproj (>= 1.14.0, < 2.0) + cocoapods-core (1.9.1) activesupport (>= 4.0.2, < 6) algoliasearch (~> 1.0) concurrent-ruby (~> 1.1) fuzzy_match (~> 2.0.4) nap (~> 1.0) + netrc (~> 0.11) + typhoeus (~> 1.0) cocoapods-deintegrate (1.0.4) cocoapods-downloader (1.3.0) cocoapods-plugins (1.0.0) @@ -49,8 +51,10 @@ GEM cocoapods-try (1.1.0) colored2 (3.1.2) colorize (0.8.1) - concurrent-ruby (1.1.5) + concurrent-ruby (1.1.6) escape (0.0.4) + ethon (0.12.0) + ffi (>= 1.3.0) ffi (1.11.3) fourflusher (2.3.1) fuzzy_match (2.0.4) @@ -69,7 +73,7 @@ GEM xcinvoke (~> 0.3.0) json (2.3.0) liferaft (0.0.6) - minitest (5.13.0) + minitest (5.14.0) molinillo (0.6.6) mustache (1.1.1) nanaimo (0.2.6) @@ -84,11 +88,13 @@ GEM ffi (~> 1.9) sqlite3 (1.4.2) thread_safe (0.3.6) + typhoeus (1.3.1) + ethon (>= 0.9.0) tzinfo (1.2.6) thread_safe (~> 0.1) xcinvoke (0.3.0) liferaft (~> 0.0.6) - xcodeproj (1.14.0) + xcodeproj (1.15.0) CFPropertyList (>= 2.3.3, < 4.0) atomos (~> 0.1.3) claide (>= 1.0.2, < 2.0) @@ -99,7 +105,7 @@ PLATFORMS ruby DEPENDENCIES - cocoapods (= 1.8.4) + cocoapods (= 1.9.1) colorize (~> 0.8.1) jazzy rake From bbcfda0afd12308a2076e1f8d6db34d9db7c955d Mon Sep 17 00:00:00 2001 From: Michael Eisel Date: Wed, 11 Mar 2020 17:53:16 -0400 Subject: [PATCH 035/678] changes --- CExts.c | 59 +++++++++++++++++++ Sources/XcodeProj/Extensions/String+md5.swift | 37 ++++++------ Sources/XcodeProj/Utils/CommentedString.swift | 27 +-------- 3 files changed, 81 insertions(+), 42 deletions(-) create mode 100644 CExts.c diff --git a/CExts.c b/CExts.c new file mode 100644 index 000000000..7a0e54fb5 --- /dev/null +++ b/CExts.c @@ -0,0 +1,59 @@ +// +// CExts.cpp +// XcodeGen +// +// Created by Michael Eisel on 3/11/20. +// + +#include +#include +#include +#include +#include +#include + +const char *PATEscapedString(const char *string) { + size_t length = strlen(string); + char escapedHolder[length * 2 + 3]; + char *escaped = &(escapedHolder[1]); + size_t curr = 0; + bool needsQuoting = false; + for (int i = 0; i < length; i++) { + char c = string[i]; + if (c != '$' && c != '_' && !('.' <= c && c <= '9') && !isalnum(c)) { + needsQuoting = true; + } + switch (c) { + case '\\': + escaped[curr++] = '\\'; + escaped[curr++] = '\\'; + + break; + case '"': + escaped[curr++] = '\\'; + escaped[curr++] = '"'; + break; + case '\t': + escaped[curr++] = '\\'; + escaped[curr++] = 't'; + break; + case '\n': + escaped[curr++] = '\\'; + escaped[curr++] = 'n'; + break; + default: + escaped[curr++] = string[i]; + } + } + if (strstr(escaped, "//") || strstr(escaped, "___")) { + needsQuoting = true; + } + if (needsQuoting && !(escaped[0] == '"' && escaped[curr - 1] == '"')) { + escaped[curr++] = '"'; + escaped--; + escaped[0] = '"'; + curr++; + } + escaped[curr] = '\0'; + return strdup(escaped); +} diff --git a/Sources/XcodeProj/Extensions/String+md5.swift b/Sources/XcodeProj/Extensions/String+md5.swift index c1e7bc000..41212c74b 100644 --- a/Sources/XcodeProj/Extensions/String+md5.swift +++ b/Sources/XcodeProj/Extensions/String+md5.swift @@ -21,28 +21,29 @@ */ import Foundation +import CommonCrypto extension String { - var md5: String { - if let data = data(using: .utf8, allowLossyConversion: true) { - let message = data.withUnsafeBytes { bufferPointer in - Array(UnsafeBufferPointer( - start: bufferPointer.baseAddress?.assumingMemoryBound(to: UInt8.self), - count: data.count - )) - } - - let MD5Calculator = MD5(message) - let MD5Data = MD5Calculator.calculate() + private func toHex(_ char: UInt8) -> UInt8 { + if char < 10 { + return char + 48 + } else { + return (char - 10) + 65 + } + } - var MD5String = String() - for c in MD5Data { - MD5String += String(format: "%02x", c) + var md5: String { + guard let data = data(using: .utf8, allowLossyConversion: true) else { abort() } + return data.withUnsafeBytes { bufferPointer in + let buffer = malloc(Int(CC_MD5_DIGEST_LENGTH))!.assumingMemoryBound(to: UInt8.self) + CC_MD5(bufferPointer.baseAddress!, UInt32(data.count), buffer) + let hex = UnsafeMutableBufferPointer.allocate(capacity: Int(CC_MD5_DIGEST_LENGTH) * 2) + for i in 0.. Date: Mon, 16 Mar 2020 14:27:45 -0400 Subject: [PATCH 036/678] updates --- CExts.c | 59 ------------------- Package.swift | 3 + Sources/XcodeProj/Extensions/String+md5.swift | 18 +++--- Sources/XcodeProj/Utils/CommentedString.swift | 3 +- .../xcshareddata/IDEWorkspaceChecks.plist | 8 +++ 5 files changed, 20 insertions(+), 71 deletions(-) delete mode 100644 CExts.c create mode 100644 XcodeProj_Carthage.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist diff --git a/CExts.c b/CExts.c deleted file mode 100644 index 7a0e54fb5..000000000 --- a/CExts.c +++ /dev/null @@ -1,59 +0,0 @@ -// -// CExts.cpp -// XcodeGen -// -// Created by Michael Eisel on 3/11/20. -// - -#include -#include -#include -#include -#include -#include - -const char *PATEscapedString(const char *string) { - size_t length = strlen(string); - char escapedHolder[length * 2 + 3]; - char *escaped = &(escapedHolder[1]); - size_t curr = 0; - bool needsQuoting = false; - for (int i = 0; i < length; i++) { - char c = string[i]; - if (c != '$' && c != '_' && !('.' <= c && c <= '9') && !isalnum(c)) { - needsQuoting = true; - } - switch (c) { - case '\\': - escaped[curr++] = '\\'; - escaped[curr++] = '\\'; - - break; - case '"': - escaped[curr++] = '\\'; - escaped[curr++] = '"'; - break; - case '\t': - escaped[curr++] = '\\'; - escaped[curr++] = 't'; - break; - case '\n': - escaped[curr++] = '\\'; - escaped[curr++] = 'n'; - break; - default: - escaped[curr++] = string[i]; - } - } - if (strstr(escaped, "//") || strstr(escaped, "___")) { - needsQuoting = true; - } - if (needsQuoting && !(escaped[0] == '"' && escaped[curr - 1] == '"')) { - escaped[curr++] = '"'; - escaped--; - escaped[0] = '"'; - curr++; - } - escaped[curr] = '\0'; - return strdup(escaped); -} diff --git a/Package.swift b/Package.swift index 432e74a68..8b2e89564 100644 --- a/Package.swift +++ b/Package.swift @@ -8,12 +8,15 @@ let package = Package( .library(name: "XcodeProj", targets: ["XcodeProj"]), ], dependencies: [ + .package(path: "../XcodeProjCExt"), + //.package(url: "https://github.com/tuist/XcodeProjCExt", .branch("master")), .package(url: "https://github.com/tadija/AEXML", .upToNextMinor(from: "4.4.0")), .package(url: "https://github.com/kylef/PathKit", .upToNextMinor(from: "1.0.0")), ], targets: [ .target(name: "XcodeProj", dependencies: [ + "XcodeProjCExt", "PathKit", "AEXML", ]), diff --git a/Sources/XcodeProj/Extensions/String+md5.swift b/Sources/XcodeProj/Extensions/String+md5.swift index 41212c74b..02d25ce6d 100644 --- a/Sources/XcodeProj/Extensions/String+md5.swift +++ b/Sources/XcodeProj/Extensions/String+md5.swift @@ -21,7 +21,7 @@ */ import Foundation -import CommonCrypto +import XcodeProjCExt extension String { private func toHex(_ char: UInt8) -> UInt8 { @@ -33,17 +33,13 @@ extension String { } var md5: String { - guard let data = data(using: .utf8, allowLossyConversion: true) else { abort() } + guard let data = data(using: .utf8, allowLossyConversion: true) else { + fatalError("Unable to get UTF-8 string from data") + } return data.withUnsafeBytes { bufferPointer in - let buffer = malloc(Int(CC_MD5_DIGEST_LENGTH))!.assumingMemoryBound(to: UInt8.self) - CC_MD5(bufferPointer.baseAddress!, UInt32(data.count), buffer) - let hex = UnsafeMutableBufferPointer.allocate(capacity: Int(CC_MD5_DIGEST_LENGTH) * 2) - for i in 0.. + + + + IDEDidComputeMac32BitWarning + + + From 19694952869f32753bcc45ed44ddce039ee1a59d Mon Sep 17 00:00:00 2001 From: Michael Eisel Date: Mon, 16 Mar 2020 14:27:58 -0400 Subject: [PATCH 037/678] revert --- .../xcshareddata/IDEWorkspaceChecks.plist | 8 -------- 1 file changed, 8 deletions(-) delete mode 100644 XcodeProj_Carthage.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist diff --git a/XcodeProj_Carthage.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/XcodeProj_Carthage.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist deleted file mode 100644 index 18d981003..000000000 --- a/XcodeProj_Carthage.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +++ /dev/null @@ -1,8 +0,0 @@ - - - - - IDEDidComputeMac32BitWarning - - - From 34353a2211b57b3888ccc5d7d73f8bc28dcbeae2 Mon Sep 17 00:00:00 2001 From: Michael Eisel Date: Mon, 16 Mar 2020 14:28:27 -0400 Subject: [PATCH 038/678] clean up --- Sources/XcodeProj/Extensions/String+md5.swift | 8 -------- 1 file changed, 8 deletions(-) diff --git a/Sources/XcodeProj/Extensions/String+md5.swift b/Sources/XcodeProj/Extensions/String+md5.swift index 02d25ce6d..b45d21094 100644 --- a/Sources/XcodeProj/Extensions/String+md5.swift +++ b/Sources/XcodeProj/Extensions/String+md5.swift @@ -24,14 +24,6 @@ import Foundation import XcodeProjCExt extension String { - private func toHex(_ char: UInt8) -> UInt8 { - if char < 10 { - return char + 48 - } else { - return (char - 10) + 65 - } - } - var md5: String { guard let data = data(using: .utf8, allowLossyConversion: true) else { fatalError("Unable to get UTF-8 string from data") From 1f42506186739a8108673f57ff840f5717615d7a Mon Sep 17 00:00:00 2001 From: Michael Eisel Date: Mon, 16 Mar 2020 14:30:56 -0400 Subject: [PATCH 039/678] commit --- Package.swift | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Package.swift b/Package.swift index 8b2e89564..6e9c6bbbb 100644 --- a/Package.swift +++ b/Package.swift @@ -8,8 +8,7 @@ let package = Package( .library(name: "XcodeProj", targets: ["XcodeProj"]), ], dependencies: [ - .package(path: "../XcodeProjCExt"), - //.package(url: "https://github.com/tuist/XcodeProjCExt", .branch("master")), + .package(url: "https://github.com/tuist/XcodeProjCExt", .exact("7.8.0")), .package(url: "https://github.com/tadija/AEXML", .upToNextMinor(from: "4.4.0")), .package(url: "https://github.com/kylef/PathKit", .upToNextMinor(from: "1.0.0")), ], From 53b83a52776b3bb980954ca7c2b43f9b77ab7061 Mon Sep 17 00:00:00 2001 From: Michael Eisel Date: Mon, 16 Mar 2020 14:34:14 -0400 Subject: [PATCH 040/678] changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4338bcc69..d3b4a0e8f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ ### Changed - Remove `Tapestries` folder for tapestry 0.0.5 version https://github.com/tuist/XcodeProj/pull/523 by @fortmarek +- Sped up the generation of commented strings, especially those that include an MD5 hash ### Fixed From 71521f3cb580a5b0fe1c061208b880b6ee73d3ac Mon Sep 17 00:00:00 2001 From: Michael Eisel Date: Thu, 19 Mar 2020 13:38:27 -0400 Subject: [PATCH 041/678] update Package.resolved --- Package.resolved | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Package.resolved b/Package.resolved index 45383ed00..d64ece4ba 100644 --- a/Package.resolved +++ b/Package.resolved @@ -27,6 +27,15 @@ "revision": "f14ff47f45642aa5703900980b014c2e9394b6e5", "version": "0.9.0" } + }, + { + "package": "XcodeProjCExt", + "repositoryURL": "https://github.com/tuist/XcodeProjCExt", + "state": { + "branch": null, + "revision": "8f22e5bd0bc83df6fc833331516afee650101d82", + "version": "7.8.0" + } } ] }, From 9d53df0781a897883515372d0babff62ef7713fa Mon Sep 17 00:00:00 2001 From: Michael Eisel Date: Fri, 20 Mar 2020 11:48:34 -0400 Subject: [PATCH 042/678] update xcodegencext --- Package.resolved | 4 +- Package.swift | 2 +- .../xcshareddata/IDEWorkspaceChecks.plist | 8 ++ diff | 86 +++++++++++++++++++ 4 files changed, 97 insertions(+), 3 deletions(-) create mode 100644 XcodeProj_Carthage.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist create mode 100644 diff diff --git a/Package.resolved b/Package.resolved index d64ece4ba..cc526699b 100644 --- a/Package.resolved +++ b/Package.resolved @@ -33,8 +33,8 @@ "repositoryURL": "https://github.com/tuist/XcodeProjCExt", "state": { "branch": null, - "revision": "8f22e5bd0bc83df6fc833331516afee650101d82", - "version": "7.8.0" + "revision": "3873f83da1a2c99207af387972589c495785b93f", + "version": "7.8.0-1" } } ] diff --git a/Package.swift b/Package.swift index 6e9c6bbbb..3159d0fdd 100644 --- a/Package.swift +++ b/Package.swift @@ -8,7 +8,7 @@ let package = Package( .library(name: "XcodeProj", targets: ["XcodeProj"]), ], dependencies: [ - .package(url: "https://github.com/tuist/XcodeProjCExt", .exact("7.8.0")), + .package(url: "https://github.com/tuist/XcodeProjCExt", .exact("7.8.0-1")), .package(url: "https://github.com/tadija/AEXML", .upToNextMinor(from: "4.4.0")), .package(url: "https://github.com/kylef/PathKit", .upToNextMinor(from: "1.0.0")), ], diff --git a/XcodeProj_Carthage.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/XcodeProj_Carthage.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 000000000..18d981003 --- /dev/null +++ b/XcodeProj_Carthage.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/diff b/diff new file mode 100644 index 000000000..79d50062d --- /dev/null +++ b/diff @@ -0,0 +1,86 @@ +diff --git a/Sources/XcodeProj/Extensions/String+md5.swift b/Sources/XcodeProj/Extensions/String+md5.swift +index c1e7bc0..b45d210 100644 +--- a/Sources/XcodeProj/Extensions/String+md5.swift ++++ b/Sources/XcodeProj/Extensions/String+md5.swift +@@ -21,28 +21,17 @@ + */ + + import Foundation ++import XcodeProjCExt + + extension String { + var md5: String { +- if let data = data(using: .utf8, allowLossyConversion: true) { +- let message = data.withUnsafeBytes { bufferPointer in +- Array(UnsafeBufferPointer( +- start: bufferPointer.baseAddress?.assumingMemoryBound(to: UInt8.self), +- count: data.count +- )) +- } +- +- let MD5Calculator = MD5(message) +- let MD5Data = MD5Calculator.calculate() +- +- var MD5String = String() +- for c in MD5Data { +- MD5String += String(format: "%02x", c) +- } +- return MD5String +- +- } else { +- return self ++ guard let data = data(using: .utf8, allowLossyConversion: true) else { ++ fatalError("Unable to get UTF-8 string from data") ++ } ++ return data.withUnsafeBytes { bufferPointer in ++ let castedBuffer = bufferPointer.bindMemory(to: Int8.self) ++ let hex = XCPComputeMD5(castedBuffer.baseAddress, Int32(data.count))! ++ return String(cString: hex, encoding: .ascii)! + } + } + } +diff --git a/Sources/XcodeProj/Utils/CommentedString.swift b/Sources/XcodeProj/Utils/CommentedString.swift +index a77b7b9..6a1d4c8 100644 +--- a/Sources/XcodeProj/Utils/CommentedString.swift ++++ b/Sources/XcodeProj/Utils/CommentedString.swift +@@ -1,4 +1,5 @@ + import Foundation ++import XcodeProjCExt + + /// String that includes a comment + struct CommentedString { +@@ -43,31 +44,10 @@ struct CommentedString { + default: break + } + +- var escaped = string +- // escape escape +- if escaped.contains("\\" as Character) { +- escaped = escaped.replacingOccurrences(of: "\\", with: "\\\\") ++ return string.withCString { buffer in ++ let esc = XCPEscapedString(buffer)! ++ return String(bytesNoCopy: UnsafeMutableRawPointer(mutating: esc), length: strlen(esc), encoding: .utf8, freeWhenDone: true)! + } +- // escape quotes +- if escaped.contains("\"" as Character) { +- escaped = escaped.replacingOccurrences(of: "\"", with: "\\\"") +- } +- // escape tab +- if escaped.contains("\t" as Character) { +- escaped = escaped.replacingOccurrences(of: "\t", with: "\\t") +- } +- // escape newlines +- if escaped.contains("\n" as Character) { +- escaped = escaped.replacingOccurrences(of: "\n", with: "\\n") +- } +- +- if !escaped.isQuoted, +- escaped.rangeOfCharacter(from: CommentedString.invalidCharacters) != nil || +- invalidStrings.contains(where: { escaped.range(of: $0) != nil }) { +- escaped = escaped.quoted +- } +- +- return escaped + } + } + From 5bf56544bc412dccd95ed43cc460258524ff3484 Mon Sep 17 00:00:00 2001 From: Michael Eisel Date: Fri, 20 Mar 2020 11:48:47 -0400 Subject: [PATCH 043/678] cleanup --- diff | 86 ------------------------------------------------------------ 1 file changed, 86 deletions(-) delete mode 100644 diff diff --git a/diff b/diff deleted file mode 100644 index 79d50062d..000000000 --- a/diff +++ /dev/null @@ -1,86 +0,0 @@ -diff --git a/Sources/XcodeProj/Extensions/String+md5.swift b/Sources/XcodeProj/Extensions/String+md5.swift -index c1e7bc0..b45d210 100644 ---- a/Sources/XcodeProj/Extensions/String+md5.swift -+++ b/Sources/XcodeProj/Extensions/String+md5.swift -@@ -21,28 +21,17 @@ - */ - - import Foundation -+import XcodeProjCExt - - extension String { - var md5: String { -- if let data = data(using: .utf8, allowLossyConversion: true) { -- let message = data.withUnsafeBytes { bufferPointer in -- Array(UnsafeBufferPointer( -- start: bufferPointer.baseAddress?.assumingMemoryBound(to: UInt8.self), -- count: data.count -- )) -- } -- -- let MD5Calculator = MD5(message) -- let MD5Data = MD5Calculator.calculate() -- -- var MD5String = String() -- for c in MD5Data { -- MD5String += String(format: "%02x", c) -- } -- return MD5String -- -- } else { -- return self -+ guard let data = data(using: .utf8, allowLossyConversion: true) else { -+ fatalError("Unable to get UTF-8 string from data") -+ } -+ return data.withUnsafeBytes { bufferPointer in -+ let castedBuffer = bufferPointer.bindMemory(to: Int8.self) -+ let hex = XCPComputeMD5(castedBuffer.baseAddress, Int32(data.count))! -+ return String(cString: hex, encoding: .ascii)! - } - } - } -diff --git a/Sources/XcodeProj/Utils/CommentedString.swift b/Sources/XcodeProj/Utils/CommentedString.swift -index a77b7b9..6a1d4c8 100644 ---- a/Sources/XcodeProj/Utils/CommentedString.swift -+++ b/Sources/XcodeProj/Utils/CommentedString.swift -@@ -1,4 +1,5 @@ - import Foundation -+import XcodeProjCExt - - /// String that includes a comment - struct CommentedString { -@@ -43,31 +44,10 @@ struct CommentedString { - default: break - } - -- var escaped = string -- // escape escape -- if escaped.contains("\\" as Character) { -- escaped = escaped.replacingOccurrences(of: "\\", with: "\\\\") -+ return string.withCString { buffer in -+ let esc = XCPEscapedString(buffer)! -+ return String(bytesNoCopy: UnsafeMutableRawPointer(mutating: esc), length: strlen(esc), encoding: .utf8, freeWhenDone: true)! - } -- // escape quotes -- if escaped.contains("\"" as Character) { -- escaped = escaped.replacingOccurrences(of: "\"", with: "\\\"") -- } -- // escape tab -- if escaped.contains("\t" as Character) { -- escaped = escaped.replacingOccurrences(of: "\t", with: "\\t") -- } -- // escape newlines -- if escaped.contains("\n" as Character) { -- escaped = escaped.replacingOccurrences(of: "\n", with: "\\n") -- } -- -- if !escaped.isQuoted, -- escaped.rangeOfCharacter(from: CommentedString.invalidCharacters) != nil || -- invalidStrings.contains(where: { escaped.range(of: $0) != nil }) { -- escaped = escaped.quoted -- } -- -- return escaped - } - } - From c661ffe452d990f7257d5ce851a3296aabc11e72 Mon Sep 17 00:00:00 2001 From: Michael Eisel Date: Fri, 20 Mar 2020 11:49:15 -0400 Subject: [PATCH 044/678] cleanup --- .../xcshareddata/IDEWorkspaceChecks.plist | 8 -------- 1 file changed, 8 deletions(-) delete mode 100644 XcodeProj_Carthage.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist diff --git a/XcodeProj_Carthage.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/XcodeProj_Carthage.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist deleted file mode 100644 index 18d981003..000000000 --- a/XcodeProj_Carthage.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +++ /dev/null @@ -1,8 +0,0 @@ - - - - - IDEDidComputeMac32BitWarning - - - From e6986c8d0de7dea4c4c7c77d0377f889d9f7b64c Mon Sep 17 00:00:00 2001 From: Natan Rolnik Date: Wed, 25 Mar 2020 12:05:16 +0200 Subject: [PATCH 045/678] Remove warning when compiling with Swift 5.2 --- .../Workspace/XCWorkspaceDataElementLocationType.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Sources/XcodeProj/Workspace/XCWorkspaceDataElementLocationType.swift b/Sources/XcodeProj/Workspace/XCWorkspaceDataElementLocationType.swift index 7cd890906..d3e866d35 100644 --- a/Sources/XcodeProj/Workspace/XCWorkspaceDataElementLocationType.swift +++ b/Sources/XcodeProj/Workspace/XCWorkspaceDataElementLocationType.swift @@ -88,8 +88,8 @@ extension XCWorkspaceDataElementLocationType: Equatable { return lhs == rhs case let (.self(lhs), .self(rhs)): return lhs == rhs - case let (.other(lhs), .other(rhs)): - return lhs.0 == rhs.0 && lhs.1 == rhs.1 + case let (.other(lhs0, lhs1), .other(rhs0, rhs1)): + return lhs0 == rhs0 && lhs1 == rhs1 default: return false } } From 942b35d6a7ee94752cc726b1fbd8dd7ec468e49d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20Pi=C3=B1era?= Date: Wed, 25 Mar 2020 13:04:19 +0100 Subject: [PATCH 046/678] Version 7.9.0 --- CHANGELOG.md | 2 ++ README.md | 8 ++++---- XcodeProj_Carthage.xcodeproj/project.pbxproj | 19 +++++++++++-------- .../xcshareddata/xcschemes/XcodeProj.xcscheme | 4 ++++ xcodeproj.podspec | 2 +- 5 files changed, 22 insertions(+), 13 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4338bcc69..5077f8a41 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ ## Next +## 7.9.0 + ### Changed - Remove `Tapestries` folder for tapestry 0.0.5 version https://github.com/tuist/XcodeProj/pull/523 by @fortmarek diff --git a/README.md b/README.md index c5d0d8a0d..3dbdca9ba 100644 --- a/README.md +++ b/README.md @@ -37,7 +37,7 @@ Add the dependency in your `Package.swift` file: let package = Package( name: "myproject", dependencies: [ - .package(url: "https://github.com/tuist/xcodeproj.git", .upToNextMajor(from: "7.8.0")), + .package(url: "https://github.com/tuist/xcodeproj.git", .upToNextMajor(from: "7.9.0")), ], targets: [ .target( @@ -53,13 +53,13 @@ let package = Package( ```bash # Cartfile -github "tuist/xcodeproj" ~> 7.8.0 +github "tuist/xcodeproj" ~> 7.9.0 ``` ### CocoaPods ```ruby -pod 'xcodeproj', '~> 7.8.0' +pod 'xcodeproj', '~> 7.9.0' ``` ### Scripting @@ -71,7 +71,7 @@ git tag that represents the project’s version: ```swift #!/usr/bin/swift sh import Foundation -import XcodeProj // @tuist ~> 7.8.0 +import XcodeProj // @tuist ~> 7.9.0 import PathKit guard CommandLine.arguments.count == 3 else { diff --git a/XcodeProj_Carthage.xcodeproj/project.pbxproj b/XcodeProj_Carthage.xcodeproj/project.pbxproj index 96ab89417..29b43f591 100644 --- a/XcodeProj_Carthage.xcodeproj/project.pbxproj +++ b/XcodeProj_Carthage.xcodeproj/project.pbxproj @@ -287,8 +287,8 @@ 1ABCF05523B52C542BC48C31 /* KeyedDecodingContainer+Additions.swift */, 3C96888CEF5888DBA6D3136D /* NSRecursiveLock+Sync.swift */, EE041A9A60D18302045BA2AE /* Path+Extras.swift */, - 88DAB211D02099ECDC268AE2 /* String+Utils.swift */, 47E5583E488968962DD4B38D /* String+md5.swift */, + 88DAB211D02099ECDC268AE2 /* String+Utils.swift */, ); path = Extensions; sourceTree = ""; @@ -327,12 +327,13 @@ 3DB2726F254A120563894AF8 /* Scheme */ = { isa = PBXGroup; children = ( + 5D13E332186D46FFA83BBD50 /* XCScheme.swift */, 87054AE28F2715C09767FE77 /* XCScheme+AditionalOption.swift */, BFFE462CBB08512CB108E356 /* XCScheme+AnalyzeAction.swift */, 66F7E3085922F586144F562A /* XCScheme+ArchiveAction.swift */, - E525B9A065757F329F0E4002 /* XCScheme+BuildAction.swift */, 39AC139F340CD22E72E37FF3 /* XCScheme+BuildableProductRunnable.swift */, DF277186917C67A6FF4993F6 /* XCScheme+BuildableReference.swift */, + E525B9A065757F329F0E4002 /* XCScheme+BuildAction.swift */, B837566EDF23D002AC881D07 /* XCScheme+CommandLineArguments.swift */, 20B1225FED6E1D49EE385AA0 /* XCScheme+EnvironmentVariable.swift */, C3FE679A53603AE3FE43462F /* XCScheme+ExecutionAction.swift */, @@ -344,10 +345,9 @@ 1D5C2732048660AC71431D9C /* XCScheme+Runnable.swift */, 694034B4B7C9DF231B007A84 /* XCScheme+SerialAction.swift */, 522A9ABE50677EEB0638B056 /* XCScheme+SkippedTests.swift */, + 0AE91C6982618C1EDDAAD596 /* XCScheme+TestableReference.swift */, 161E967D0979EF34C7DF6348 /* XCScheme+TestAction.swift */, 87331972540CB510D7E0C333 /* XCScheme+TestPlanReference.swift */, - 0AE91C6982618C1EDDAAD596 /* XCScheme+TestableReference.swift */, - 5D13E332186D46FFA83BBD50 /* XCScheme.swift */, ); path = Scheme; sourceTree = ""; @@ -412,9 +412,9 @@ 80D59D67CEEE76EA108CFAAB /* Project */ = { isa = PBXGroup; children = ( - D2D78F3ED94EB9E973644780 /* Info.plist */, - BA1E76638FEE70CBAD8B9592 /* Sources */, 844A2C8AF87F23D7DE2CD3AB /* Carthage */, + BA1E76638FEE70CBAD8B9592 /* Sources */, + D2D78F3ED94EB9E973644780 /* Info.plist */, ); name = Project; sourceTree = ""; @@ -447,9 +447,9 @@ children = ( 3353E37D0FBA49BA04C82476 /* WorkspaceSettings.swift */, CC0BF3D061052148207584A5 /* XCBreakpointList.swift */, - AF73D1E4C0B20C16D61865F6 /* XCSharedData.swift */, A7DAFF5CC89FBB59D02F72B9 /* Xcode.swift */, F8B667CA83B0BB0285F470F1 /* XcodeProj.swift */, + AF73D1E4C0B20C16D61865F6 /* XCSharedData.swift */, ); path = Project; sourceTree = ""; @@ -510,8 +510,8 @@ A5CC513CEDABAA9712FB4DC6 /* PBXObjects.swift */, E1325A961D9CCFB45B639868 /* PBXOutputSettings.swift */, 6B2C739F39DD3CC1B77E1075 /* PBXProj.swift */, - 41A031713D5F31DDCC2D61EF /* PBXProjEncoder.swift */, A93C80F128CBCDFA4EA63EFB /* PBXProject.swift */, + 41A031713D5F31DDCC2D61EF /* PBXProjEncoder.swift */, ); path = Project; sourceTree = ""; @@ -544,12 +544,15 @@ 223DB5C7FA35E8FD593C4040 /* Project object */ = { isa = PBXProject; attributes = { + TargetAttributes = { + }; }; buildConfigurationList = 477F800A701B31C60A80EACC /* Build configuration list for PBXProject "XcodeProj_Carthage" */; compatibilityVersion = "Xcode 9.3"; developmentRegion = en; hasScannedForEncodings = 0; knownRegions = ( + Base, en, ); mainGroup = 791C387E48AEA6D5F75AC47F; diff --git a/XcodeProj_Carthage.xcodeproj/xcshareddata/xcschemes/XcodeProj.xcscheme b/XcodeProj_Carthage.xcodeproj/xcshareddata/xcschemes/XcodeProj.xcscheme index 47588195d..24c338546 100644 --- a/XcodeProj_Carthage.xcodeproj/xcshareddata/xcschemes/XcodeProj.xcscheme +++ b/XcodeProj_Carthage.xcodeproj/xcshareddata/xcschemes/XcodeProj.xcscheme @@ -66,6 +66,10 @@ savedToolIdentifier = "" useCustomWorkingDirectory = "NO" debugDocumentVersioning = "YES"> + + + + Date: Thu, 26 Mar 2020 08:13:06 +0100 Subject: [PATCH 047/678] Run on Xcode 11.4 --- .github/workflows/package.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/package.yml b/.github/workflows/package.yml index 65ebe2dab..5a82722eb 100644 --- a/.github/workflows/package.yml +++ b/.github/workflows/package.yml @@ -17,6 +17,8 @@ jobs: runs-on: macOS-latest steps: - uses: actions/checkout@v1 + - name: Select Xcode 11.4 + run: sudo xcode-select -switch /Applications/Xcode_11.4.app - name: Generate project run: swift package generate-xcodeproj - name: Run tests From dac0a1735dfb4b87932188952ea3c7511dac4815 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20Pi=C3=B1era?= Date: Thu, 26 Mar 2020 08:15:58 +0100 Subject: [PATCH 048/678] Run with Xcode 11.3, 11.3.1, and 11.4 --- .github/workflows/package.yml | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/.github/workflows/package.yml b/.github/workflows/package.yml index 5a82722eb..93572f8cc 100644 --- a/.github/workflows/package.yml +++ b/.github/workflows/package.yml @@ -7,18 +7,26 @@ jobs: build: name: Build runs-on: macOS-latest + strategy: + matrix: + xcode: ["11.3", "11.3.1", "11.4"] steps: - uses: actions/checkout@v1 + - name: Select Xcode ${{ matrix.xcode }} + run: sudo xcode-select -switch /Applications/Xcode_${{ matrix.xcode }}.app - name: Build run: swift build -c release test: name: Test runs-on: macOS-latest + strategy: + matrix: + xcode: ["11.3", "11.3.1", "11.4"] steps: - uses: actions/checkout@v1 - - name: Select Xcode 11.4 - run: sudo xcode-select -switch /Applications/Xcode_11.4.app + - name: Select Xcode ${{ matrix.xcode }} + run: sudo xcode-select -switch /Applications/Xcode_${{ matrix.xcode }}.app - name: Generate project run: swift package generate-xcodeproj - name: Run tests From fe446c504bb49dbb7da9d31a5ea4069d67390ad0 Mon Sep 17 00:00:00 2001 From: Michael Eisel Date: Thu, 26 Mar 2020 19:10:11 -0400 Subject: [PATCH 049/678] better string API --- Sources/XcodeProj/Utils/CommentedString.swift | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Sources/XcodeProj/Utils/CommentedString.swift b/Sources/XcodeProj/Utils/CommentedString.swift index 6a1d4c8f7..ad7358e9e 100644 --- a/Sources/XcodeProj/Utils/CommentedString.swift +++ b/Sources/XcodeProj/Utils/CommentedString.swift @@ -46,7 +46,9 @@ struct CommentedString { return string.withCString { buffer in let esc = XCPEscapedString(buffer)! - return String(bytesNoCopy: UnsafeMutableRawPointer(mutating: esc), length: strlen(esc), encoding: .utf8, freeWhenDone: true)! + let newString = String(cString: esc) + free(UnsafeMutableRawPointer(mutating: esc)) + return newString } } } From 9ea5b447c0a828e4263845d4ef27f65cba53f6d4 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Thu, 2 Apr 2020 11:13:32 +0000 Subject: [PATCH 050/678] Bump jazzy from 0.13.1 to 0.13.2 Bumps [jazzy](https://github.com/realm/jazzy) from 0.13.1 to 0.13.2. - [Release notes](https://github.com/realm/jazzy/releases) - [Changelog](https://github.com/realm/jazzy/blob/master/CHANGELOG.md) - [Commits](https://github.com/realm/jazzy/compare/v0.13.1...v0.13.2) Signed-off-by: dependabot-preview[bot] --- Gemfile.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index ac92fbdd8..19af9cc47 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -55,14 +55,14 @@ GEM escape (0.0.4) ethon (0.12.0) ffi (>= 1.3.0) - ffi (1.11.3) + ffi (1.12.2) fourflusher (2.3.1) fuzzy_match (2.0.4) gh_inspector (1.1.3) httpclient (2.8.3) i18n (0.9.5) concurrent-ruby (~> 1.0) - jazzy (0.13.1) + jazzy (0.13.2) cocoapods (~> 1.5) mustache (~> 1.1) open4 @@ -82,7 +82,7 @@ GEM open4 (1.3.4) rake (13.0.1) redcarpet (3.5.0) - rouge (3.14.0) + rouge (3.17.0) ruby-macho (1.4.0) sassc (2.2.1) ffi (~> 1.9) From 912d40cc2ea4a300eff6dd7c6a10b4f4dedbcbec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20Pi=C3=B1era?= Date: Thu, 2 Apr 2020 17:51:17 +0200 Subject: [PATCH 051/678] Version 7.10.0 --- CHANGELOG.md | 5 +++++ Cartfile | 1 + Cartfile.resolved | 1 + Package.swift | 2 +- Project.swift | 1 + README.md | 8 ++++---- XcodeProj_Carthage.xcodeproj/project.pbxproj | 8 ++++++-- xcodeproj.podspec | 3 ++- 8 files changed, 21 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c7807e24f..1bfea4406 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,11 @@ ## Next +## 7.10.0 + +### Changed +- Optimize bottlenecks https://github.com/tuist/XcodeProj/pull/529 by @michaeleisel + ## 7.9.0 ### Changed diff --git a/Cartfile b/Cartfile index 42e0a4aa7..ce4389d27 100644 --- a/Cartfile +++ b/Cartfile @@ -1,2 +1,3 @@ github "tuist/PathKit" == 1.0.0 github "tadija/AEXML" == 4.4.0 +github "tuist/XcodeProjCExt" == 0.1.0 diff --git a/Cartfile.resolved b/Cartfile.resolved index 1f8d154c6..1972b644f 100644 --- a/Cartfile.resolved +++ b/Cartfile.resolved @@ -1,2 +1,3 @@ github "tadija/AEXML" "4.4.0" github "tuist/PathKit" "1.0.0" +github "tuist/XcodeProjCExt" "0.1.0" diff --git a/Package.swift b/Package.swift index 3159d0fdd..2758eeb28 100644 --- a/Package.swift +++ b/Package.swift @@ -8,7 +8,7 @@ let package = Package( .library(name: "XcodeProj", targets: ["XcodeProj"]), ], dependencies: [ - .package(url: "https://github.com/tuist/XcodeProjCExt", .exact("7.8.0-1")), + .package(url: "https://github.com/tuist/XcodeProjCExt", .exact("0.1.0")), .package(url: "https://github.com/tadija/AEXML", .upToNextMinor(from: "4.4.0")), .package(url: "https://github.com/kylef/PathKit", .upToNextMinor(from: "1.0.0")), ], diff --git a/Project.swift b/Project.swift index d96f3f5ac..37034c361 100644 --- a/Project.swift +++ b/Project.swift @@ -11,5 +11,6 @@ let project = Project(name: "XcodeProj_Carthage", dependencies: [ .framework(path: "Carthage/Build/Mac/AEXML.framework"), .framework(path: "Carthage/Build/Mac/PathKit.framework"), + .framework(path: "Carthage/Build/Mac/XcodeProjCExt.framework") ]), ]) diff --git a/README.md b/README.md index 3dbdca9ba..5143a1845 100644 --- a/README.md +++ b/README.md @@ -37,7 +37,7 @@ Add the dependency in your `Package.swift` file: let package = Package( name: "myproject", dependencies: [ - .package(url: "https://github.com/tuist/xcodeproj.git", .upToNextMajor(from: "7.9.0")), + .package(url: "https://github.com/tuist/xcodeproj.git", .upToNextMajor(from: "7.10.0")), ], targets: [ .target( @@ -53,13 +53,13 @@ let package = Package( ```bash # Cartfile -github "tuist/xcodeproj" ~> 7.9.0 +github "tuist/xcodeproj" ~> 7.10.0 ``` ### CocoaPods ```ruby -pod 'xcodeproj', '~> 7.9.0' +pod 'xcodeproj', '~> 7.10.0' ``` ### Scripting @@ -71,7 +71,7 @@ git tag that represents the project’s version: ```swift #!/usr/bin/swift sh import Foundation -import XcodeProj // @tuist ~> 7.9.0 +import XcodeProj // @tuist ~> 7.10.0 import PathKit guard CommandLine.arguments.count == 3 else { diff --git a/XcodeProj_Carthage.xcodeproj/project.pbxproj b/XcodeProj_Carthage.xcodeproj/project.pbxproj index 29b43f591..2d2969251 100644 --- a/XcodeProj_Carthage.xcodeproj/project.pbxproj +++ b/XcodeProj_Carthage.xcodeproj/project.pbxproj @@ -56,6 +56,7 @@ 7F9ED031DE6A06055F44C2E2 /* JSONDecoding.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9144C9BC5E10BE834E6824A1 /* JSONDecoding.swift */; }; 809908EF4E6E71285D110707 /* PBXNativeTarget.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2BD1A6E5AC6502EDE59541C8 /* PBXNativeTarget.swift */; }; 8242B39EB786ADA4A8B32EF3 /* XCBuildConfiguration.swift in Sources */ = {isa = PBXBuildFile; fileRef = D07BF1A8B705E35271076BA1 /* XCBuildConfiguration.swift */; }; + 82FA5AD52A7F345C0E7CB14D /* XcodeProjCExt.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DC65006CBA60CAA1F78F6CED /* XcodeProjCExt.framework */; }; 84C672F79741BBA0937580EA /* Sourcery.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3A33AF969BDFF0250420A5E8 /* Sourcery.swift */; }; 8EE72814658F0A23A01AD1E6 /* XCBreakpointList.swift in Sources */ = {isa = PBXBuildFile; fileRef = CC0BF3D061052148207584A5 /* XCBreakpointList.swift */; }; 903A9EC1B895A4920A322898 /* XCScheme+ArchiveAction.swift in Sources */ = {isa = PBXBuildFile; fileRef = 66F7E3085922F586144F562A /* XCScheme+ArchiveAction.swift */; }; @@ -200,6 +201,7 @@ D07BF1A8B705E35271076BA1 /* XCBuildConfiguration.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = XCBuildConfiguration.swift; sourceTree = ""; }; D2D78F3ED94EB9E973644780 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist; path = Info.plist; sourceTree = ""; }; D4AA26E4818BC76E4CB28CEB /* PBXFileElement.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PBXFileElement.swift; sourceTree = ""; }; + DC65006CBA60CAA1F78F6CED /* XcodeProjCExt.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = XcodeProjCExt.framework; sourceTree = ""; }; DE15F98D3349F2FCED4A913A /* PBXTargetDependency.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PBXTargetDependency.swift; sourceTree = ""; }; DF277186917C67A6FF4993F6 /* XCScheme+BuildableReference.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "XCScheme+BuildableReference.swift"; sourceTree = ""; }; E06554AB0BF2937025BC45C6 /* PBXObjectReference.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PBXObjectReference.swift; sourceTree = ""; }; @@ -223,6 +225,7 @@ files = ( 1ADDD97C53AEC0990F693CDA /* AEXML.framework in Frameworks */, 5A9C450597EC43859570B863 /* PathKit.framework in Frameworks */, + 82FA5AD52A7F345C0E7CB14D /* XcodeProjCExt.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -320,6 +323,7 @@ children = ( 0C950F23FEF894B133070990 /* AEXML.framework */, F89DAD13D5505D59F10D0C9F /* PathKit.framework */, + DC65006CBA60CAA1F78F6CED /* XcodeProjCExt.framework */, ); path = Mac; sourceTree = ""; @@ -726,7 +730,7 @@ SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; SWIFT_COMPILATION_MODE = singlefile; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 5.1; + SWIFT_VERSION = 5.2; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; }; @@ -867,7 +871,7 @@ SUPPORTED_PLATFORMS = macosx; SWIFT_COMPILATION_MODE = wholemodule; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; - SWIFT_VERSION = 5.1; + SWIFT_VERSION = 5.2; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; }; diff --git a/xcodeproj.podspec b/xcodeproj.podspec index 0b00aba44..e7c1bc88d 100644 --- a/xcodeproj.podspec +++ b/xcodeproj.podspec @@ -1,7 +1,7 @@ Pod::Spec.new do |s| s.name = "xcodeproj" - s.version = "7.9.0" + s.version = "7.10.0" s.summary = "Read/Modify/Write your Xcode projects" s.homepage = "https://github.com/tuist/xcodeproj" s.license = 'MIT' @@ -13,6 +13,7 @@ Pod::Spec.new do |s| s.source_files = "Sources/**/*.{swift}" + s.dependency "XcodeProjCExt", "0.1.0" s.dependency "PathKit", "~> 1.0.0" s.dependency "AEXML", "~> 4.4.0" end From 01f7f8f6efeefcb321253539a8112104e90928a7 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 27 Apr 2020 12:22:21 +0200 Subject: [PATCH 052/678] Bump jazzy from 0.13.2 to 0.13.3 (#542) Bumps [jazzy](https://github.com/realm/jazzy) from 0.13.2 to 0.13.3. - [Release notes](https://github.com/realm/jazzy/releases) - [Changelog](https://github.com/realm/jazzy/blob/master/CHANGELOG.md) - [Commits](https://github.com/realm/jazzy/compare/v0.13.2...v0.13.3) Signed-off-by: dependabot-preview[bot] Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> --- Gemfile.lock | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 19af9cc47..c29d6b8d5 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -48,7 +48,7 @@ GEM cocoapods-trunk (1.4.1) nap (>= 0.8, < 2.0) netrc (~> 0.11) - cocoapods-try (1.1.0) + cocoapods-try (1.2.0) colored2 (3.1.2) colorize (0.8.1) concurrent-ruby (1.1.6) @@ -62,7 +62,7 @@ GEM httpclient (2.8.3) i18n (0.9.5) concurrent-ruby (~> 1.0) - jazzy (0.13.2) + jazzy (0.13.3) cocoapods (~> 1.5) mustache (~> 1.1) open4 @@ -82,19 +82,19 @@ GEM open4 (1.3.4) rake (13.0.1) redcarpet (3.5.0) - rouge (3.17.0) + rouge (3.18.0) ruby-macho (1.4.0) - sassc (2.2.1) + sassc (2.3.0) ffi (~> 1.9) sqlite3 (1.4.2) thread_safe (0.3.6) typhoeus (1.3.1) ethon (>= 0.9.0) - tzinfo (1.2.6) + tzinfo (1.2.7) thread_safe (~> 0.1) xcinvoke (0.3.0) liferaft (~> 0.0.6) - xcodeproj (1.15.0) + xcodeproj (1.16.0) CFPropertyList (>= 2.3.3, < 4.0) atomos (~> 0.1.3) claide (>= 1.0.2, < 2.0) From 9e4e1fcd84d31e8aa2cbd587633a34266dc1d4fd Mon Sep 17 00:00:00 2001 From: khoi <6994441+khoi@users.noreply.github.com> Date: Mon, 27 Apr 2020 17:23:10 +0700 Subject: [PATCH 053/678] XcodeProjCExt 0.1.0 (#540) * XcodeProjCExt 0.1.0 * Update changelog --- CHANGELOG.md | 4 ++++ Package.resolved | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1bfea4406..35da06c7f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ ## Next +### Changed + +- Point `XcodeProjCExt` to version 0.1.0 https://github.com/tuist/XcodeProj/pull/540 by @khoi + ## 7.10.0 ### Changed diff --git a/Package.resolved b/Package.resolved index cc526699b..62b16b46f 100644 --- a/Package.resolved +++ b/Package.resolved @@ -33,8 +33,8 @@ "repositoryURL": "https://github.com/tuist/XcodeProjCExt", "state": { "branch": null, - "revision": "3873f83da1a2c99207af387972589c495785b93f", - "version": "7.8.0-1" + "revision": "21a510c225ff2bc83d5920a21d902af4b1e7e218", + "version": "0.1.0" } } ] From 6bdea910531448a5e19bb956e1c07056f548ffb4 Mon Sep 17 00:00:00 2001 From: khoi <6994441+khoi@users.noreply.github.com> Date: Thu, 30 Apr 2020 00:38:51 +0700 Subject: [PATCH 054/678] Fix broken changelog guideline URL (#543) --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 35da06c7f..c6cb3cf59 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,4 @@ -🚀 Check out the guidelines [here](https://github.com/xcodeswift/contributors/blob/master/CHANGELOG_GUIDELINES.md) +🚀 Check out the guidelines [here](https://tuist.io/docs/contribution/changelog-guidelines/) ## Next From 11b0742d2e4fde2f9611290d7857a5584e6ac4e4 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 1 Jun 2020 11:56:53 +0000 Subject: [PATCH 055/678] Bump jazzy from 0.13.3 to 0.13.4 Bumps [jazzy](https://github.com/realm/jazzy) from 0.13.3 to 0.13.4. - [Release notes](https://github.com/realm/jazzy/releases) - [Changelog](https://github.com/realm/jazzy/blob/master/CHANGELOG.md) - [Commits](https://github.com/realm/jazzy/compare/v0.13.3...v0.13.4) Signed-off-by: dependabot-preview[bot] --- Gemfile.lock | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index c29d6b8d5..886cbc834 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -2,12 +2,12 @@ GEM remote: https://rubygems.org/ specs: CFPropertyList (3.0.2) - activesupport (4.2.11.1) + activesupport (4.2.11.3) i18n (~> 0.7) minitest (~> 5.1) thread_safe (~> 0.3, >= 0.3.4) tzinfo (~> 1.1) - algoliasearch (1.27.1) + algoliasearch (1.27.2) httpclient (~> 2.8, >= 2.8.3) json (>= 1.5.1) atomos (0.1.3) @@ -45,7 +45,7 @@ GEM nap cocoapods-search (1.0.0) cocoapods-stats (1.1.0) - cocoapods-trunk (1.4.1) + cocoapods-trunk (1.5.0) nap (>= 0.8, < 2.0) netrc (~> 0.11) cocoapods-try (1.2.0) @@ -55,14 +55,14 @@ GEM escape (0.0.4) ethon (0.12.0) ffi (>= 1.3.0) - ffi (1.12.2) + ffi (1.13.0) fourflusher (2.3.1) fuzzy_match (2.0.4) gh_inspector (1.1.3) httpclient (2.8.3) i18n (0.9.5) concurrent-ruby (~> 1.0) - jazzy (0.13.3) + jazzy (0.13.4) cocoapods (~> 1.5) mustache (~> 1.1) open4 @@ -73,7 +73,7 @@ GEM xcinvoke (~> 0.3.0) json (2.3.0) liferaft (0.0.6) - minitest (5.14.0) + minitest (5.14.1) molinillo (0.6.6) mustache (1.1.1) nanaimo (0.2.6) @@ -82,13 +82,13 @@ GEM open4 (1.3.4) rake (13.0.1) redcarpet (3.5.0) - rouge (3.18.0) + rouge (3.19.0) ruby-macho (1.4.0) sassc (2.3.0) ffi (~> 1.9) sqlite3 (1.4.2) thread_safe (0.3.6) - typhoeus (1.3.1) + typhoeus (1.4.0) ethon (>= 0.9.0) tzinfo (1.2.7) thread_safe (~> 0.1) From 39d666600dad7bf696f3aa5bf26726475bcdbbb0 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Tue, 2 Jun 2020 10:03:05 +0200 Subject: [PATCH 056/678] Bump cocoapods from 1.9.1 to 1.9.3 (#547) Bumps [cocoapods](https://github.com/CocoaPods/CocoaPods) from 1.9.1 to 1.9.3. - [Release notes](https://github.com/CocoaPods/CocoaPods/releases) - [Changelog](https://github.com/CocoaPods/CocoaPods/blob/master/CHANGELOG.md) - [Commits](https://github.com/CocoaPods/CocoaPods/compare/1.9.1...1.9.3) Signed-off-by: dependabot-preview[bot] Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> --- Gemfile | 2 +- Gemfile.lock | 20 ++++++++++---------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/Gemfile b/Gemfile index 63e92e482..60f60f700 100644 --- a/Gemfile +++ b/Gemfile @@ -2,6 +2,6 @@ source "https://rubygems.org" gem "rake" gem "jazzy" -gem "cocoapods", "1.9.1" +gem "cocoapods", "1.9.3" gem "colorize", "~> 0.8.1" gem "redcarpet", "~> 3.5.0" diff --git a/Gemfile.lock b/Gemfile.lock index c29d6b8d5..0bec34e15 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -2,20 +2,20 @@ GEM remote: https://rubygems.org/ specs: CFPropertyList (3.0.2) - activesupport (4.2.11.1) + activesupport (4.2.11.3) i18n (~> 0.7) minitest (~> 5.1) thread_safe (~> 0.3, >= 0.3.4) tzinfo (~> 1.1) - algoliasearch (1.27.1) + algoliasearch (1.27.2) httpclient (~> 2.8, >= 2.8.3) json (>= 1.5.1) atomos (0.1.3) claide (1.0.3) - cocoapods (1.9.1) + cocoapods (1.9.3) activesupport (>= 4.0.2, < 5) claide (>= 1.0.2, < 2.0) - cocoapods-core (= 1.9.1) + cocoapods-core (= 1.9.3) cocoapods-deintegrate (>= 1.0.3, < 2.0) cocoapods-downloader (>= 1.2.2, < 2.0) cocoapods-plugins (>= 1.0.0, < 2.0) @@ -31,7 +31,7 @@ GEM nap (~> 1.0) ruby-macho (~> 1.4) xcodeproj (>= 1.14.0, < 2.0) - cocoapods-core (1.9.1) + cocoapods-core (1.9.3) activesupport (>= 4.0.2, < 6) algoliasearch (~> 1.0) concurrent-ruby (~> 1.1) @@ -45,7 +45,7 @@ GEM nap cocoapods-search (1.0.0) cocoapods-stats (1.1.0) - cocoapods-trunk (1.4.1) + cocoapods-trunk (1.5.0) nap (>= 0.8, < 2.0) netrc (~> 0.11) cocoapods-try (1.2.0) @@ -55,7 +55,7 @@ GEM escape (0.0.4) ethon (0.12.0) ffi (>= 1.3.0) - ffi (1.12.2) + ffi (1.13.0) fourflusher (2.3.1) fuzzy_match (2.0.4) gh_inspector (1.1.3) @@ -73,7 +73,7 @@ GEM xcinvoke (~> 0.3.0) json (2.3.0) liferaft (0.0.6) - minitest (5.14.0) + minitest (5.14.1) molinillo (0.6.6) mustache (1.1.1) nanaimo (0.2.6) @@ -88,7 +88,7 @@ GEM ffi (~> 1.9) sqlite3 (1.4.2) thread_safe (0.3.6) - typhoeus (1.3.1) + typhoeus (1.4.0) ethon (>= 0.9.0) tzinfo (1.2.7) thread_safe (~> 0.1) @@ -105,7 +105,7 @@ PLATFORMS ruby DEPENDENCIES - cocoapods (= 1.9.1) + cocoapods (= 1.9.3) colorize (~> 0.8.1) jazzy rake From 397bcb8e619d9f5dfd632bc4cab3a46052908fdd Mon Sep 17 00:00:00 2001 From: Damir Davletov Date: Tue, 2 Jun 2020 09:03:48 +0100 Subject: [PATCH 057/678] Include project name/path into "Products" group ID generation logic (#539) * Fixed issue where 2 different remote project references added to the project in separte branches had the same product group id * Updated changelog --- CHANGELOG.md | 4 ++ .../Objects/Project/PBXProject.swift | 7 ++-- Sources/XcodeProj/Project/Xcode.swift | 6 +++ .../XcodeProj/Utils/ReferenceGenerator.swift | 11 +++--- .../Utils/ReferenceGeneratorTests.swift | 38 +++++++++++++++++-- 5 files changed, 54 insertions(+), 12 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c6cb3cf59..abf75d168 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,10 @@ - Point `XcodeProjCExt` to version 0.1.0 https://github.com/tuist/XcodeProj/pull/540 by @khoi +### Fixed + +- "Products" group has the same ID for any project https://github.com/tuist/XcodeProj/issues/538 by @damirdavletov + ## 7.10.0 ### Changed diff --git a/Sources/XcodeProj/Objects/Project/PBXProject.swift b/Sources/XcodeProj/Objects/Project/PBXProject.swift index 0b00e96cf..96b99305c 100644 --- a/Sources/XcodeProj/Objects/Project/PBXProject.swift +++ b/Sources/XcodeProj/Objects/Project/PBXProject.swift @@ -508,7 +508,8 @@ extension PBXProject: PlistSerializable { return nil } return .array(projectReferences.compactMap { reference in - guard let productGroupReference = reference["ProductGroup"], let projectRef = reference["ProjectRef"] else { + guard let productGroupReference = reference[Xcode.ProjectReference.productGroupKey], + let projectRef = reference[Xcode.ProjectReference.projectReferenceKey] else { return nil } let producGroup: PBXGroup? = productGroupReference.getObject() @@ -517,8 +518,8 @@ extension PBXProject: PlistSerializable { let fileRefName = project?.fileName() return [ - CommentedString("ProductGroup"): PlistValue.string(CommentedString(productGroupReference.value, comment: groupName)), - CommentedString("ProjectRef"): PlistValue.string(CommentedString(projectRef.value, comment: fileRefName)), + CommentedString(Xcode.ProjectReference.productGroupKey): PlistValue.string(CommentedString(productGroupReference.value, comment: groupName)), + CommentedString(Xcode.ProjectReference.projectReferenceKey): PlistValue.string(CommentedString(projectRef.value, comment: fileRefName)), ] }) } diff --git a/Sources/XcodeProj/Project/Xcode.swift b/Sources/XcodeProj/Project/Xcode.swift index 47bd98832..8f3fa860f 100644 --- a/Sources/XcodeProj/Project/Xcode.swift +++ b/Sources/XcodeProj/Project/Xcode.swift @@ -333,4 +333,10 @@ public struct Xcode { "yxx": "sourcecode.yacc", "zip": "archive.zip", ] + + /// Remote project reference dictionary keys. + public struct ProjectReference { + public static let projectReferenceKey = "ProjectRef" + public static let productGroupKey = "ProductGroup" + } } diff --git a/Sources/XcodeProj/Utils/ReferenceGenerator.swift b/Sources/XcodeProj/Utils/ReferenceGenerator.swift index f450a784f..2336d82b6 100644 --- a/Sources/XcodeProj/Utils/ReferenceGenerator.swift +++ b/Sources/XcodeProj/Utils/ReferenceGenerator.swift @@ -51,12 +51,11 @@ final class ReferenceGenerator: ReferenceGenerating { } // Project references - try project.projectReferences.flatMap { $0.values }.forEach { objectReference in - if let fileReference = objectReference.getObject() as? PBXFileReference { - try generateFileReference(fileReference, identifiers: identifiers) - } else if let group = objectReference.getObject() as? PBXGroup { - try generateGroupReferences(group, identifiers: identifiers) - } + try project.projectReferences.forEach { objectReferenceDict in + guard let projectReference = objectReferenceDict[Xcode.ProjectReference.projectReferenceKey]?.getObject() as? PBXFileReference, + let productsGroup = objectReferenceDict[Xcode.ProjectReference.productGroupKey]?.getObject() as? PBXGroup else { return } + try generateFileReference(projectReference, identifiers: identifiers) + try generateGroupReferences(productsGroup, identifiers: identifiers + [projectReference.name ?? projectReference.path ?? ""]) } // Targets diff --git a/Tests/XcodeProjTests/Utils/ReferenceGeneratorTests.swift b/Tests/XcodeProjTests/Utils/ReferenceGeneratorTests.swift index c5662f7b3..e288b1eba 100644 --- a/Tests/XcodeProjTests/Utils/ReferenceGeneratorTests.swift +++ b/Tests/XcodeProjTests/Utils/ReferenceGeneratorTests.swift @@ -12,7 +12,8 @@ class ReferenceGeneratorTests: XCTestCase { let productReferenceProxy = project.makeReferenceProxy(containerItemProxy: containerItemProxy) let productsGroup = project.makeProductsGroup(children: [productReferenceProxy]) - pbxProject.projectReferences.append(["ProductGroup": productsGroup.reference]) + pbxProject.projectReferences.append(["ProductGroup": productsGroup.reference, + "ProjectRef": remoteProjectFileReference.reference]) let referenceGenerator = ReferenceGenerator(outputSettings: PBXOutputSettings()) try referenceGenerator.generateReferences(proj: project) @@ -33,7 +34,8 @@ class ReferenceGeneratorTests: XCTestCase { let productsGroup = project.makeProductsGroup(children: [productReferenceProxy]) let (target, buildFile) = project.makeTarget(productReferenceProxy: productReferenceProxy) - pbxProject.projectReferences.append(["ProductGroup": productsGroup.reference]) + pbxProject.projectReferences.append(["ProductGroup": productsGroup.reference, + "ProjectRef": remoteProjectFileReference.reference]) pbxProject.targets.append(target) let referenceGenerator = ReferenceGenerator(outputSettings: PBXOutputSettings()) @@ -48,6 +50,32 @@ class ReferenceGeneratorTests: XCTestCase { XCTAssertEqual(Set(firstUUIDs), Set(secondUUIDs)) } + + func test_twoProjectsReferencingTwoDifferentRemoteXcodeprojBundles_generatesDifferentProductGroupIdentifiers() throws { + func generateProject(remoteProjectPath: String) throws -> String { + let project = PBXProj(rootObject: nil, objectVersion: 0, archiveVersion: 0, classes: [:], objects: []) + let pbxProject = project.makeProject() + let remoteProjectFileReference = project.makeFileReference(with: Path(remoteProjectPath)) + let containerItemProxy = project.makeContainerItemProxy(fileReference: remoteProjectFileReference) + let productReferenceProxy = project.makeReferenceProxy(containerItemProxy: containerItemProxy) + let productsGroup = project.makeProductsGroup(children: [productReferenceProxy]) + let (target, _) = project.makeTarget(productReferenceProxy: productReferenceProxy) + + pbxProject.projectReferences.append(["ProductGroup": productsGroup.reference, + "ProjectRef": remoteProjectFileReference.reference]) + pbxProject.targets.append(target) + + let referenceGenerator = ReferenceGenerator(outputSettings: PBXOutputSettings()) + try referenceGenerator.generateReferences(proj: project) + + return productsGroup.reference.value + } + + let firstProductsGroupUUID = try generateProject(remoteProjectPath: "../Remote1.xcodeproj") + let secondProductsGroupUUID = try generateProject(remoteProjectPath: "../Remote2.xcodeproj") + + XCTAssertNotEqual(firstProductsGroupUUID, secondProductsGroupUUID) + } } private extension PBXProj { @@ -69,7 +97,11 @@ private extension PBXProj { } func makeFileReference() -> PBXFileReference { - return try! rootObject!.mainGroup.addFile(at: Path("../Remote.xcodeproj"), sourceRoot: Path("/"), validatePresence: false) + self.makeFileReference(with: Path("../Remote.xcodeproj")) + } + + func makeFileReference(with path: Path) -> PBXFileReference { + return try! rootObject!.mainGroup.addFile(at: path, sourceRoot: Path("/"), validatePresence: false) } func makeContainerItemProxy(fileReference: PBXFileReference) -> PBXContainerItemProxy { From f2c86c2dea7d46e9cf2bcb2e087cac44e5f24cbf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20Pi=C3=B1era=20Buend=C3=ADa?= Date: Tue, 2 Jun 2020 10:11:21 +0200 Subject: [PATCH 058/678] Added useTestSelectionWhitelist attribute to XCScheme.TestableReference (#549) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Added useTestSelectionWhitelist attribute to XCScheme.TestableReference * Added unit-tests for useTestSelectionWhitelist scheme attribute * Make useTestSelectionWhitelist optional Co-authored-by: Bas van Kuijck Co-authored-by: Bas van Kuijck Co-authored-by: Pedro Piñera --- CHANGELOG.md | 1 + .../XcodeProj/Scheme/XCScheme+TestableReference.swift | 10 +++++++++- Tests/XcodeProjTests/Scheme/XCSchemeTests.swift | 6 +++++- 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index abf75d168..5741b52cb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -57,6 +57,7 @@ - Added `com.apple.product-type.xcframework` to `PBXProductType`. https://github.com/tuist/XcodeProj/pull/508 by @lakpa - Added `askForAppToLaunch` parameter to `LaunchAction` and `ProfileAction`. https://github.com/tuist/XcodeProj/pull/515 by @YutoMizutani +- Added `useTestSelectionWhitelist` attribute to `XCScheme.TestableReference` https://github.com/tuist/xcodeproj/pull/516 by @basvankuijck. - Added `"ENABLE_PREVIEWS"` to target application build settings https://github.com/tuist/XcodeProj/pull/511 by @fortmarek ## 7.5.0 diff --git a/Sources/XcodeProj/Scheme/XCScheme+TestableReference.swift b/Sources/XcodeProj/Scheme/XCScheme+TestableReference.swift index 9230a2433..9c644ea1b 100644 --- a/Sources/XcodeProj/Scheme/XCScheme+TestableReference.swift +++ b/Sources/XcodeProj/Scheme/XCScheme+TestableReference.swift @@ -8,6 +8,7 @@ extension XCScheme { public var skipped: Bool public var parallelizable: Bool public var randomExecutionOrdering: Bool + public var useTestSelectionWhitelist: Bool? public var buildableReference: BuildableReference public var skippedTests: [SkippedTest] @@ -17,17 +18,20 @@ extension XCScheme { parallelizable: Bool = false, randomExecutionOrdering: Bool = false, buildableReference: BuildableReference, - skippedTests: [SkippedTest] = []) { + skippedTests: [SkippedTest] = [], + useTestSelectionWhitelist: Bool? = nil) { self.skipped = skipped self.parallelizable = parallelizable self.randomExecutionOrdering = randomExecutionOrdering self.buildableReference = buildableReference self.skippedTests = skippedTests + self.useTestSelectionWhitelist = useTestSelectionWhitelist } init(element: AEXMLElement) throws { skipped = element.attributes["skipped"] == "YES" parallelizable = element.attributes["parallelizable"] == "YES" + useTestSelectionWhitelist = element.attributes["useTestSelectionWhitelist"] == "YES" randomExecutionOrdering = element.attributes["testExecutionOrdering"] == "random" buildableReference = try BuildableReference(element: element["BuildableReference"]) if let skippedTests = element["SkippedTests"]["Test"].all, !skippedTests.isEmpty { @@ -42,6 +46,9 @@ extension XCScheme { func xmlElement() -> AEXMLElement { var attributes: [String: String] = ["skipped": skipped.xmlString] attributes["parallelizable"] = parallelizable ? parallelizable.xmlString : nil + if let useTestSelectionWhitelist = useTestSelectionWhitelist { + attributes["useTestSelectionWhitelist"] = useTestSelectionWhitelist.xmlString + } attributes["testExecutionOrdering"] = randomExecutionOrdering ? "random" : nil let element = AEXMLElement(name: "TestableReference", value: nil, @@ -63,6 +70,7 @@ extension XCScheme { lhs.parallelizable == rhs.parallelizable && lhs.randomExecutionOrdering == rhs.randomExecutionOrdering && lhs.buildableReference == rhs.buildableReference && + lhs.useTestSelectionWhitelist == rhs.useTestSelectionWhitelist && lhs.skippedTests == rhs.skippedTests } } diff --git a/Tests/XcodeProjTests/Scheme/XCSchemeTests.swift b/Tests/XcodeProjTests/Scheme/XCSchemeTests.swift index ef3d72a60..e51c6c7f7 100644 --- a/Tests/XcodeProjTests/Scheme/XCSchemeTests.swift +++ b/Tests/XcodeProjTests/Scheme/XCSchemeTests.swift @@ -48,6 +48,7 @@ final class XCSchemeIntegrationTests: XCTestCase { let subject = reference.xmlElement() XCTAssertNil(subject.attributes["parallelizable"]) XCTAssertNil(subject.attributes["testExecutionOrdering"]) + XCTAssertNil(subject.attributes["useTestSelectionWhitelist"]) } func test_write_testableReferenceAttributesValues() { @@ -61,11 +62,13 @@ final class XCSchemeIntegrationTests: XCTestCase { buildableName: "", blueprintName: "" ), - skippedTests: [] + skippedTests: [], + useTestSelectionWhitelist: true ) let subject = reference.xmlElement() XCTAssertEqual(subject.attributes["skipped"], "NO") XCTAssertEqual(subject.attributes["parallelizable"], "YES") + XCTAssertEqual(subject.attributes["useTestSelectionWhitelist"], "YES") XCTAssertEqual(subject.attributes["testExecutionOrdering"], "random") } @@ -143,6 +146,7 @@ final class XCSchemeIntegrationTests: XCTestCase { XCTAssertEqual(scheme.testAction?.testables.first?.skipped, false) XCTAssertEqual(scheme.testAction?.testables.first?.parallelizable, false) XCTAssertEqual(scheme.testAction?.testables.first?.randomExecutionOrdering, false) + XCTAssertEqual(scheme.testAction?.testables.first?.useTestSelectionWhitelist, false) XCTAssertEqual(scheme.testAction?.testables.first?.buildableReference.buildableIdentifier, "primary") XCTAssertEqual(scheme.testAction?.testables.first?.buildableReference.blueprintIdentifier, "23766C251EAA3484007A9026") XCTAssertEqual(scheme.testAction?.testables.first?.buildableReference.buildableName, "iOSTests.xctest") From b8798bc3544c083dc5dc290f0f30f50971d5d8d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20Pi=C3=B1era?= Date: Tue, 2 Jun 2020 10:26:32 +0200 Subject: [PATCH 059/678] Version 7.11.0 --- CHANGELOG.md | 2 ++ README.md | 8 ++++---- XcodeProj_Carthage.xcodeproj/project.pbxproj | 4 ++-- .../xcshareddata/xcschemes/XcodeProj.xcscheme | 12 ++++-------- xcodeproj.podspec | 2 +- 5 files changed, 13 insertions(+), 15 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5741b52cb..cbb3fe681 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ ## Next +## 7.11.0 + ### Changed - Point `XcodeProjCExt` to version 0.1.0 https://github.com/tuist/XcodeProj/pull/540 by @khoi diff --git a/README.md b/README.md index 5143a1845..0c99dade9 100644 --- a/README.md +++ b/README.md @@ -37,7 +37,7 @@ Add the dependency in your `Package.swift` file: let package = Package( name: "myproject", dependencies: [ - .package(url: "https://github.com/tuist/xcodeproj.git", .upToNextMajor(from: "7.10.0")), + .package(url: "https://github.com/tuist/xcodeproj.git", .upToNextMajor(from: "7.11.0")), ], targets: [ .target( @@ -53,13 +53,13 @@ let package = Package( ```bash # Cartfile -github "tuist/xcodeproj" ~> 7.10.0 +github "tuist/xcodeproj" ~> 7.11.0 ``` ### CocoaPods ```ruby -pod 'xcodeproj', '~> 7.10.0' +pod 'xcodeproj', '~> 7.11.0' ``` ### Scripting @@ -71,7 +71,7 @@ git tag that represents the project’s version: ```swift #!/usr/bin/swift sh import Foundation -import XcodeProj // @tuist ~> 7.10.0 +import XcodeProj // @tuist ~> 7.11.0 import PathKit guard CommandLine.arguments.count == 3 else { diff --git a/XcodeProj_Carthage.xcodeproj/project.pbxproj b/XcodeProj_Carthage.xcodeproj/project.pbxproj index 2d2969251..6820fbcb9 100644 --- a/XcodeProj_Carthage.xcodeproj/project.pbxproj +++ b/XcodeProj_Carthage.xcodeproj/project.pbxproj @@ -730,7 +730,7 @@ SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; SWIFT_COMPILATION_MODE = singlefile; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 5.2; + SWIFT_VERSION = 5.2.4; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; }; @@ -871,7 +871,7 @@ SUPPORTED_PLATFORMS = macosx; SWIFT_COMPILATION_MODE = wholemodule; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; - SWIFT_VERSION = 5.2; + SWIFT_VERSION = 5.2.4; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; }; diff --git a/XcodeProj_Carthage.xcodeproj/xcshareddata/xcschemes/XcodeProj.xcscheme b/XcodeProj_Carthage.xcodeproj/xcshareddata/xcschemes/XcodeProj.xcscheme index 24c338546..ddccf1af4 100644 --- a/XcodeProj_Carthage.xcodeproj/xcshareddata/xcschemes/XcodeProj.xcscheme +++ b/XcodeProj_Carthage.xcodeproj/xcshareddata/xcschemes/XcodeProj.xcscheme @@ -26,13 +26,10 @@ buildConfiguration = "Debug" selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" - shouldUseLaunchSchemeArgsEnv = "YES"> + shouldUseLaunchSchemeArgsEnv = "YES" + disableMainThreadChecker = "YES"> - - - - + allowLocationSimulation = "YES" + disableMainThreadChecker = "YES"> - - Date: Tue, 2 Jun 2020 10:37:51 +0200 Subject: [PATCH 060/678] Fix changelog --- CHANGELOG.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cbb3fe681..5b4a174bd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,9 @@ - Point `XcodeProjCExt` to version 0.1.0 https://github.com/tuist/XcodeProj/pull/540 by @khoi +### Added +- Added `useTestSelectionWhitelist` attribute to `XCScheme.TestableReference` https://github.com/tuist/xcodeproj/pull/516 by @basvankuijck. + ### Fixed - "Products" group has the same ID for any project https://github.com/tuist/XcodeProj/issues/538 by @damirdavletov @@ -59,7 +62,6 @@ - Added `com.apple.product-type.xcframework` to `PBXProductType`. https://github.com/tuist/XcodeProj/pull/508 by @lakpa - Added `askForAppToLaunch` parameter to `LaunchAction` and `ProfileAction`. https://github.com/tuist/XcodeProj/pull/515 by @YutoMizutani -- Added `useTestSelectionWhitelist` attribute to `XCScheme.TestableReference` https://github.com/tuist/xcodeproj/pull/516 by @basvankuijck. - Added `"ENABLE_PREVIEWS"` to target application build settings https://github.com/tuist/XcodeProj/pull/511 by @fortmarek ## 7.5.0 From f05146eba40d538b5bae034779364f7a4ea4f30a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Linhart?= Date: Wed, 3 Jun 2020 19:21:06 +1000 Subject: [PATCH 061/678] Add platformFilter to PBXTargetDependency (#546) * Add platformFilter to PBXTargetDependency * Update CHANGELOG.md * Add platformFilter to PBXTargetDependency constructor --- CHANGELOG.md | 4 ++++ .../Objects/Targets/PBXTargetDependency.swift | 12 ++++++++++++ 2 files changed, 16 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5b4a174bd..237cb7ca4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ ## Next +### Added + +- Added `platformFilter` to the `PBXTargetDependency` https://github.com/tuist/XcodeProj/pull/546 by @tomaslinhart + ## 7.11.0 ### Changed diff --git a/Sources/XcodeProj/Objects/Targets/PBXTargetDependency.swift b/Sources/XcodeProj/Objects/Targets/PBXTargetDependency.swift index a21e721b7..e9b87a3d8 100644 --- a/Sources/XcodeProj/Objects/Targets/PBXTargetDependency.swift +++ b/Sources/XcodeProj/Objects/Targets/PBXTargetDependency.swift @@ -46,19 +46,26 @@ public final class PBXTargetDependency: PBXObject { } } + /// Platform filter attribute. + /// Introduced in: Xcode 11 + public var platformFilter: String? + // MARK: - Init /// Initializes the target dependency with dependencies as objects. /// /// - Parameters: /// - name: Dependency name. + /// - platformFilter: Platform filter. /// - target: Target. /// - targetProxy: Target proxy. public init(name: String? = nil, + platformFilter: String? = nil, target: PBXTarget? = nil, targetProxy: PBXContainerItemProxy? = nil, product: XCSwiftPackageProductDependency? = nil) { self.name = name + self.platformFilter = platformFilter targetReference = target?.reference targetProxyReference = targetProxy?.reference productReference = product?.reference @@ -69,6 +76,7 @@ public final class PBXTargetDependency: PBXObject { fileprivate enum CodingKeys: String, CodingKey { case name + case platformFilter case target case targetProxy case productRef @@ -79,6 +87,7 @@ public final class PBXTargetDependency: PBXObject { let referenceRepository = decoder.context.objectReferenceRepository let objects = decoder.context.objects name = try container.decodeIfPresent(.name) + platformFilter = try container.decodeIfPresent(.platformFilter) if let targetReference: String = try container.decodeIfPresent(.target) { self.targetReference = referenceRepository.getOrCreate(reference: targetReference, objects: objects) } @@ -101,6 +110,9 @@ extension PBXTargetDependency: PlistSerializable { if let name = name { dictionary["name"] = .string(CommentedString(name)) } + if let platformFilter = platformFilter { + dictionary["platformFilter"] = .string(CommentedString(platformFilter)) + } if let targetReference = targetReference { let targetObject: PBXTarget? = targetReference.getObject() dictionary["target"] = .string(CommentedString(targetReference.value, comment: targetObject?.name)) From 6eaf24df094990f74bb3459f3e5d7bce44c2163a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20Pi=C3=B1era?= Date: Wed, 3 Jun 2020 11:26:31 +0200 Subject: [PATCH 062/678] Version 7.11.1 --- CHANGELOG.md | 2 ++ README.md | 8 ++++---- xcodeproj.podspec | 2 +- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 237cb7ca4..4945f7a47 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ ## Next +## 7.11.1 + ### Added - Added `platformFilter` to the `PBXTargetDependency` https://github.com/tuist/XcodeProj/pull/546 by @tomaslinhart diff --git a/README.md b/README.md index 0c99dade9..3f4e673ca 100644 --- a/README.md +++ b/README.md @@ -37,7 +37,7 @@ Add the dependency in your `Package.swift` file: let package = Package( name: "myproject", dependencies: [ - .package(url: "https://github.com/tuist/xcodeproj.git", .upToNextMajor(from: "7.11.0")), + .package(url: "https://github.com/tuist/xcodeproj.git", .upToNextMajor(from: "7.11.1")) ], targets: [ .target( @@ -53,13 +53,13 @@ let package = Package( ```bash # Cartfile -github "tuist/xcodeproj" ~> 7.11.0 +github "tuist/xcodeproj" ~> 7.11. ``` ### CocoaPods ```ruby -pod 'xcodeproj', '~> 7.11.0' +pod 'xcodeproj', '~> 7.11.1 ``` ### Scripting @@ -71,7 +71,7 @@ git tag that represents the project’s version: ```swift #!/usr/bin/swift sh import Foundation -import XcodeProj // @tuist ~> 7.11.0 +import XcodeProj // @tuist ~> 7.11. import PathKit guard CommandLine.arguments.count == 3 else { diff --git a/xcodeproj.podspec b/xcodeproj.podspec index d118fd951..602b253d6 100644 --- a/xcodeproj.podspec +++ b/xcodeproj.podspec @@ -1,7 +1,7 @@ Pod::Spec.new do |s| s.name = "xcodeproj" - s.version = "7.11.0" + s.version = "7.11.1" s.summary = "Read/Modify/Write your Xcode projects" s.homepage = "https://github.com/tuist/xcodeproj" s.license = 'MIT' From 637af0fd59c81c00254d35c55d3d49bea9d12e3d Mon Sep 17 00:00:00 2001 From: Andrea Cipriani Date: Mon, 8 Jun 2020 05:51:53 -0400 Subject: [PATCH 063/678] Update README.md (#551) --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 3f4e673ca..d03a2ee88 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ [![Slack](http://slack.tuist.io/badge.svg)](http://slack.tuist.io/) [![License](https://img.shields.io/badge/License-MIT-yellow.svg)](https://github.com/tuist/xcodeproj/blob/master/LICENSE.md) -XcodeProj is a library written in Swift for parsing and working with Xcode projects. It's heavily inspired in [CocoaPods XcodeProj](https://github.com/CocoaPods/Xcodeproj) and [xcode](https://www.npmjs.com/package/xcode). +XcodeProj is a library written in Swift for parsing and working with Xcode projects. It's heavily inspired by [CocoaPods XcodeProj](https://github.com/CocoaPods/Xcodeproj) and [xcode](https://www.npmjs.com/package/xcode). --- From e7905a62bca05016c96c7fdc6811d526a983aa71 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Sun, 21 Jun 2020 11:31:35 +0200 Subject: [PATCH 064/678] Create Dependabot config file (#550) Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> --- .github/dependabot.yml | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 .github/dependabot.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 000000000..4017f57c9 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,8 @@ +version: 2 +updates: +- package-ecosystem: bundler + directory: "/" + schedule: + interval: daily + time: '11:00' + open-pull-requests-limit: 10 From 5900fae73ef6e5dab65249f1c602bcc5045ff49e Mon Sep 17 00:00:00 2001 From: Bartosz Polaczyk Date: Wed, 24 Jun 2020 07:27:14 +0200 Subject: [PATCH 065/678] Add customLLDBInitFile (#553) * Add customLLDBInitFile * Minor changelog change --- CHANGELOG.md | 4 +++ .../Scheme/XCScheme+LaunchAction.swift | 13 +++++++-- .../Scheme/XCScheme+TestAction.swift | 12 ++++++-- .../XcodeProjTests/Scheme/XCSchemeTests.swift | 29 +++++++++++++++++++ 4 files changed, 54 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4945f7a47..68a52cc9a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ ## Next +### Added + +- Added `LaunchAction.customLLDBInitFile` and `TestAction.customLLDBInitFile` attributes https://github.com/tuist/xcodeproj/pull/553 by @polac24 + ## 7.11.1 ### Added diff --git a/Sources/XcodeProj/Scheme/XCScheme+LaunchAction.swift b/Sources/XcodeProj/Scheme/XCScheme+LaunchAction.swift index 5d8aae4ce..ce6fc1618 100644 --- a/Sources/XcodeProj/Scheme/XCScheme+LaunchAction.swift +++ b/Sources/XcodeProj/Scheme/XCScheme+LaunchAction.swift @@ -66,6 +66,7 @@ extension XCScheme { public var launchAutomaticallySubstyle: String? // To enable the option in Xcode: defaults write com.apple.dt.Xcode IDEDebuggerFeatureSetting 12 public var customLaunchCommand: String? + public var customLLDBInitFile: String? // MARK: - Init @@ -101,7 +102,8 @@ extension XCScheme { language: String? = nil, region: String? = nil, launchAutomaticallySubstyle: String? = nil, - customLaunchCommand: String? = nil) { + customLaunchCommand: String? = nil, + customLLDBInitFile: String? = nil) { self.runnable = runnable self.macroExpansion = macroExpansion self.buildConfiguration = buildConfiguration @@ -133,6 +135,7 @@ extension XCScheme { self.region = region self.launchAutomaticallySubstyle = launchAutomaticallySubstyle self.customLaunchCommand = customLaunchCommand + self.customLLDBInitFile = customLLDBInitFile super.init(preActions, postActions) } @@ -205,6 +208,7 @@ extension XCScheme { region = element.attributes["region"] launchAutomaticallySubstyle = element.attributes["launchAutomaticallySubstyle"] customLaunchCommand = element.attributes["customLaunchCommand"] + customLLDBInitFile = element.attributes["customLLDBInitFile"] try super.init(element: element) } @@ -306,6 +310,10 @@ extension XCScheme { element.attributes["customLaunchCommand"] = customLaunchCommand } + if let customLLDBInitFile = customLLDBInitFile { + element.attributes["customLLDBInitFile"] = customLLDBInitFile + } + if !additionalOptions.isEmpty { let additionalOptionsElement = element.addChild(AEXMLElement(name: "AdditionalOptions")) additionalOptions.forEach { additionalOption in @@ -351,7 +359,8 @@ extension XCScheme { language == rhs.language && region == rhs.region && launchAutomaticallySubstyle == rhs.launchAutomaticallySubstyle && - customLaunchCommand == rhs.customLaunchCommand + customLaunchCommand == rhs.customLaunchCommand && + customLLDBInitFile == rhs.customLLDBInitFile } } } diff --git a/Sources/XcodeProj/Scheme/XCScheme+TestAction.swift b/Sources/XcodeProj/Scheme/XCScheme+TestAction.swift index 9b159ae85..d9f6cd3f4 100644 --- a/Sources/XcodeProj/Scheme/XCScheme+TestAction.swift +++ b/Sources/XcodeProj/Scheme/XCScheme+TestAction.swift @@ -36,6 +36,7 @@ extension XCScheme { public var region: String? public var systemAttachmentLifetime: AttachmentLifetime? public var userAttachmentLifetime: AttachmentLifetime? + public var customLLDBInitFile: String? // MARK: - Init @@ -62,7 +63,8 @@ extension XCScheme { language: String? = nil, region: String? = nil, systemAttachmentLifetime: AttachmentLifetime? = nil, - userAttachmentLifetime: AttachmentLifetime? = nil) { + userAttachmentLifetime: AttachmentLifetime? = nil, + customLLDBInitFile: String? = nil) { self.buildConfiguration = buildConfiguration self.macroExpansion = macroExpansion self.testables = testables @@ -85,6 +87,7 @@ extension XCScheme { self.region = region self.systemAttachmentLifetime = systemAttachmentLifetime self.userAttachmentLifetime = userAttachmentLifetime + self.customLLDBInitFile = customLLDBInitFile super.init(preActions, postActions) } @@ -136,6 +139,7 @@ extension XCScheme { .flatMap(AttachmentLifetime.init(rawValue:)) userAttachmentLifetime = element.attributes["userAttachmentLifetime"] .flatMap(AttachmentLifetime.init(rawValue:)) + customLLDBInitFile = element.attributes["customLLDBInitFile"] try super.init(element: element) } @@ -176,6 +180,9 @@ extension XCScheme { if case .keepAlways? = userAttachmentLifetime { attributes["userAttachmentLifetime"] = userAttachmentLifetime?.rawValue } + if let customLLDBInitFile = customLLDBInitFile { + attributes["customLLDBInitFile"] = customLLDBInitFile + } let element = AEXMLElement(name: "TestAction", value: nil, attributes: attributes) super.writeXML(parent: element) @@ -246,7 +253,8 @@ extension XCScheme { region == rhs.region && systemAttachmentLifetime == rhs.systemAttachmentLifetime && userAttachmentLifetime == rhs.userAttachmentLifetime && - codeCoverageTargets == rhs.codeCoverageTargets + codeCoverageTargets == rhs.codeCoverageTargets && + customLLDBInitFile == rhs.customLLDBInitFile } } } diff --git a/Tests/XcodeProjTests/Scheme/XCSchemeTests.swift b/Tests/XcodeProjTests/Scheme/XCSchemeTests.swift index e51c6c7f7..9d48fd32a 100644 --- a/Tests/XcodeProjTests/Scheme/XCSchemeTests.swift +++ b/Tests/XcodeProjTests/Scheme/XCSchemeTests.swift @@ -114,6 +114,34 @@ final class XCSchemeIntegrationTests: XCTestCase { XCTAssertEqual(subject, reconstructedSubject) } + func test_launchAction_customLLDBInitFile_serializingAndDeserializing() throws { + // Given + let lldbInitPath = "/Users/user/custom/.lldbinit" + let subject = XCScheme.LaunchAction(runnable: nil, buildConfiguration: "Debug", customLLDBInitFile: lldbInitPath) + + + // When + let element = subject.xmlElement() + let reconstructedSubject = try XCScheme.LaunchAction(element: element) + + // Then + XCTAssertEqual(subject, reconstructedSubject) + } + + func test_testAction_customLLDBInitFile_serializingAndDeserializing() throws { + // Given + let lldbInitPath = "/Users/user/custom/.lldbinit" + let subject = XCScheme.TestAction(buildConfiguration: "Debug", macroExpansion: nil, customLLDBInitFile: lldbInitPath) + + + // When + let element = subject.xmlElement() + let reconstructedSubject = try XCScheme.TestAction(element: element) + + // Then + XCTAssertEqual(subject, reconstructedSubject) + } + // MARK: - Private private func assert(scheme: XCScheme) { @@ -277,6 +305,7 @@ final class XCSchemeIntegrationTests: XCTestCase { XCTAssertTrue(!launchCLIArgs.arguments.isEmpty) XCTAssertEqual(launchCLIArgs.arguments[0].name, "MyLaunchArgument") XCTAssertTrue(launchCLIArgs.arguments[0].enabled) + XCTAssertNil(scheme.launchAction?.customLLDBInitFile) } private func assert(minimalScheme scheme: XCScheme) { From cc9f600f2c34e782eb4fec99d6106bda5bade7be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20Pi=C3=B1era?= Date: Wed, 24 Jun 2020 07:39:39 +0200 Subject: [PATCH 066/678] Version 7.12.0 --- CHANGELOG.md | 2 ++ README.md | 4 ++-- Sources/XcodeProj/Project/Xcode.swift | 2 +- xcodeproj.podspec | 2 +- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 68a52cc9a..8d749a227 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ ## Next +## 7.12.0 + ### Added - Added `LaunchAction.customLLDBInitFile` and `TestAction.customLLDBInitFile` attributes https://github.com/tuist/xcodeproj/pull/553 by @polac24 diff --git a/README.md b/README.md index d03a2ee88..2608221df 100644 --- a/README.md +++ b/README.md @@ -37,7 +37,7 @@ Add the dependency in your `Package.swift` file: let package = Package( name: "myproject", dependencies: [ - .package(url: "https://github.com/tuist/xcodeproj.git", .upToNextMajor(from: "7.11.1")) + .package(url: "https://github.com/tuist/xcodeproj.git", .upToNextMajor(from: "7.12.0")) ], targets: [ .target( @@ -59,7 +59,7 @@ github "tuist/xcodeproj" ~> 7.11. ### CocoaPods ```ruby -pod 'xcodeproj', '~> 7.11.1 +pod 'xcodeproj', '~> 7.12.0 ``` ### Scripting diff --git a/Sources/XcodeProj/Project/Xcode.swift b/Sources/XcodeProj/Project/Xcode.swift index 8f3fa860f..24c075f89 100644 --- a/Sources/XcodeProj/Project/Xcode.swift +++ b/Sources/XcodeProj/Project/Xcode.swift @@ -26,7 +26,7 @@ public struct Xcode { public static let swiftVersion = "4.2" /// Last known object version for Xcodeproj. - public static let objectVersion: UInt = 51 + public static let objectVersion: UInt = 54 /// Last known upgrade check. public static let upgradeCheck = "1000" diff --git a/xcodeproj.podspec b/xcodeproj.podspec index 602b253d6..63a1badbf 100644 --- a/xcodeproj.podspec +++ b/xcodeproj.podspec @@ -1,7 +1,7 @@ Pod::Spec.new do |s| s.name = "xcodeproj" - s.version = "7.11.1" + s.version = "7.12.0" s.summary = "Read/Modify/Write your Xcode projects" s.homepage = "https://github.com/tuist/xcodeproj" s.license = 'MIT' From e71b130cb5e4bb602adc9e761a2d3a6e9c42c060 Mon Sep 17 00:00:00 2001 From: Daiki Matsudate Date: Thu, 2 Jul 2020 14:32:30 +0900 Subject: [PATCH 067/678] Support on-demand-install-capable application (#554) ### Short description Supporting App clips application. ### Solution Added new case `onDemandInstallCapableApplication` into `PBXProductType`. When I added App Clip target in Xcode, the diff below has occured. ``` D5380B5A24A347750069887E /* CafeClip */ = { isa = PBXNativeTarget; buildConfigurationList = D5380B9924A347760069887E /* Build configuration list for PBXNativeTarget "CafeClip" */; buildPhases = ( D5380B5724A347750069887E /* Sources */, D5380B5824A347750069887E /* Frameworks */, D5380B5924A347750069887E /* Resources */, ); buildRules = ( ); dependencies = ( ); name = CafeClip; productName = CafeClip; productReference = D5380B5B24A347750069887E /* CafeClip.app */; productType = "com.apple.product-type.application.on-demand-install-capable"; }; ``` And generated app with App Clip. ``` D5380B8524A347760069887E /* CafeClip.app in Embed App Clips */ = {isa = PBXBuildFile; fileRef = D5380B5B24A347750069887E /* CafeClip.app */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; }; ``` --- CHANGELOG.md | 3 +++ Sources/XcodeProj/Objects/Targets/PBXProductType.swift | 3 ++- .../XcodeProjTests/Objects/Targets/PBXProductTypeTests.swift | 4 ++++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8d749a227..b451fc975 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,9 @@ ## Next +### Added +- Support `on-demand-install-capable` application https://github.com/tuist/XcodeProj/pull/554 by @d-date + ## 7.12.0 ### Added diff --git a/Sources/XcodeProj/Objects/Targets/PBXProductType.swift b/Sources/XcodeProj/Objects/Targets/PBXProductType.swift index 8a326f5c0..e9820d4b1 100644 --- a/Sources/XcodeProj/Objects/Targets/PBXProductType.swift +++ b/Sources/XcodeProj/Objects/Targets/PBXProductType.swift @@ -27,11 +27,12 @@ public enum PBXProductType: String, Decodable { case xcodeExtension = "com.apple.product-type.xcode-extension" case instrumentsPackage = "com.apple.product-type.instruments-package" case intentsServiceExtension = "com.apple.product-type.app-extension.intents-service" + case onDemandInstallCapableApplication = "com.apple.product-type.application.on-demand-install-capable" /// Returns the file extension for the given product type. public var fileExtension: String? { switch self { - case .application, .watchApp, .watch2App, .watch2AppContainer, .messagesApplication: + case .application, .watchApp, .watch2App, .watch2AppContainer, .messagesApplication, .onDemandInstallCapableApplication: return "app" case .framework, .staticFramework: return "framework" diff --git a/Tests/XcodeProjTests/Objects/Targets/PBXProductTypeTests.swift b/Tests/XcodeProjTests/Objects/Targets/PBXProductTypeTests.swift index bb51cfb29..f783d7649 100644 --- a/Tests/XcodeProjTests/Objects/Targets/PBXProductTypeTests.swift +++ b/Tests/XcodeProjTests/Objects/Targets/PBXProductTypeTests.swift @@ -90,4 +90,8 @@ final class PBXProductTypeTests: XCTestCase { func test_intentsServiceExtension_hasTheRightValue() { XCTAssertEqual(PBXProductType.intentsServiceExtension.rawValue, "com.apple.product-type.app-extension.intents-service") } + + func test_appClip_hasTheRightValue() { + XCTAssertEqual(PBXProductType.onDemandInstallCapableApplication.rawValue, "com.apple.product-type.application.on-demand-install-capable") + } } From ccef87cf02136e109c67738b8ccfc05be578055e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 7 Jul 2020 08:10:02 +0200 Subject: [PATCH 068/678] Bump jazzy from 0.13.4 to 0.13.5 (#556) Bumps [jazzy](https://github.com/realm/jazzy) from 0.13.4 to 0.13.5. - [Release notes](https://github.com/realm/jazzy/releases) - [Changelog](https://github.com/realm/jazzy/blob/master/CHANGELOG.md) - [Commits](https://github.com/realm/jazzy/compare/v0.13.4...v0.13.5) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Gemfile.lock | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 8231511c0..dda8028ad 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -7,7 +7,7 @@ GEM minitest (~> 5.1) thread_safe (~> 0.3, >= 0.3.4) tzinfo (~> 1.1) - algoliasearch (1.27.2) + algoliasearch (1.27.3) httpclient (~> 2.8, >= 2.8.3) json (>= 1.5.1) atomos (0.1.3) @@ -55,14 +55,14 @@ GEM escape (0.0.4) ethon (0.12.0) ffi (>= 1.3.0) - ffi (1.13.0) + ffi (1.13.1) fourflusher (2.3.1) fuzzy_match (2.0.4) gh_inspector (1.1.3) httpclient (2.8.3) i18n (0.9.5) concurrent-ruby (~> 1.0) - jazzy (0.13.4) + jazzy (0.13.5) cocoapods (~> 1.5) mustache (~> 1.1) open4 @@ -71,7 +71,7 @@ GEM sassc (~> 2.1) sqlite3 (~> 1.3) xcinvoke (~> 0.3.0) - json (2.3.0) + json (2.3.1) liferaft (0.0.6) minitest (5.14.1) molinillo (0.6.6) @@ -82,9 +82,9 @@ GEM open4 (1.3.4) rake (13.0.1) redcarpet (3.5.0) - rouge (3.19.0) + rouge (3.20.0) ruby-macho (1.4.0) - sassc (2.3.0) + sassc (2.4.0) ffi (~> 1.9) sqlite3 (1.4.2) thread_safe (0.3.6) @@ -94,7 +94,7 @@ GEM thread_safe (~> 0.1) xcinvoke (0.3.0) liferaft (~> 0.0.6) - xcodeproj (1.16.0) + xcodeproj (1.17.0) CFPropertyList (>= 2.3.3, < 4.0) atomos (~> 0.1.3) claide (>= 1.0.2, < 2.0) From 1a231054761baa503e49b7c13686090fec9add8e Mon Sep 17 00:00:00 2001 From: Kas Date: Tue, 7 Jul 2020 07:10:40 +0100 Subject: [PATCH 069/678] Add RemotePath to RemoteRunnable (#555) * Add RemotePath to RemoteRunnable - For some schemes (e.g. Watch apps) the remote runnable element within the launch action has a `RemotePath` attribute - This attribute is now added to `RemoteRunnable` as an optional one (as it isn't present in all schemes) - Updating the way `Runnable` equatable works to ensure it works when comparing subclasses and base classes - Adding a new fixture to test out the new scheme attributes Test Plan: - Verify unit tests pass * Update changelog --- CHANGELOG.md | 1 + .../project.pbxproj | 947 ++++++++++++++++++ .../contents.xcworkspacedata | 7 + .../xcshareddata/IDEWorkspaceChecks.plist | 8 + .../xcschemes/AppWithExtensions.xcscheme | 78 ++ .../xcschemes/MessagesExtension.xcscheme | 96 ++ .../xcschemes/TodayViewExtension.xcscheme | 96 ++ .../WatchApp (Notification).xcscheme | 109 ++ .../xcshareddata/xcschemes/WatchApp.xcscheme | 105 ++ .../AppWithExtensions/AppDelegate.swift | 29 + .../AppIcon.appiconset/Contents.json | 98 ++ .../Assets.xcassets/Contents.json | 6 + .../Base.lproj/LaunchScreen.storyboard | 25 + .../AppWithExtensions/ContentView.swift | 13 + .../AppWithExtensions/Info.plist | 60 ++ .../Preview Assets.xcassets/Contents.json | 6 + .../AppWithExtensions/SceneDelegate.swift | 56 ++ .../Assets.xcassets/Contents.json | 6 + .../Contents.json | 78 ++ .../Base.lproj/MainInterface.storyboard | 37 + .../MessagesExtension/Info.plist | 31 + .../MessagesViewController.swift | 59 ++ .../Base.lproj/MainInterface.storyboard | 39 + .../TodayViewExtension/Info.plist | 31 + .../TodayViewController.swift | 21 + .../Circular.imageset/Contents.json | 28 + .../Contents.json | 48 + .../Extra Large.imageset/Contents.json | 28 + .../Graphic Bezel.imageset/Contents.json | 28 + .../Graphic Circular.imageset/Contents.json | 28 + .../Graphic Corner.imageset/Contents.json | 28 + .../Contents.json | 28 + .../Modular.imageset/Contents.json | 28 + .../Utilitarian.imageset/Contents.json | 28 + .../Assets.xcassets/Contents.json | 6 + .../WatchApp Extension/ContentView.swift | 13 + .../ExtensionDelegate.swift | 48 + .../HostingController.swift | 9 + .../WatchApp Extension/Info.plist | 36 + .../NotificationController.swift | 26 + .../WatchApp Extension/NotificationView.swift | 13 + .../Preview Assets.xcassets/Contents.json | 6 + .../PushNotificationPayload.apns | 20 + .../AppIcon.appiconset/Contents.json | 81 ++ .../WatchApp/Assets.xcassets/Contents.json | 6 + .../WatchApp/Base.lproj/Interface.storyboard | 42 + .../iOS/AppWithExtensions/WatchApp/Info.plist | 33 + .../Scheme/XCScheme+RemoteRunnable.swift | 20 +- .../XcodeProj/Scheme/XCScheme+Runnable.swift | 7 +- .../XcodeProjTests/Scheme/XCSchemeTests.swift | 88 ++ 50 files changed, 2762 insertions(+), 6 deletions(-) create mode 100644 Fixtures/iOS/AppWithExtensions/AppWithExtensions.xcodeproj/project.pbxproj create mode 100644 Fixtures/iOS/AppWithExtensions/AppWithExtensions.xcodeproj/project.xcworkspace/contents.xcworkspacedata create mode 100644 Fixtures/iOS/AppWithExtensions/AppWithExtensions.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist create mode 100644 Fixtures/iOS/AppWithExtensions/AppWithExtensions.xcodeproj/xcshareddata/xcschemes/AppWithExtensions.xcscheme create mode 100644 Fixtures/iOS/AppWithExtensions/AppWithExtensions.xcodeproj/xcshareddata/xcschemes/MessagesExtension.xcscheme create mode 100644 Fixtures/iOS/AppWithExtensions/AppWithExtensions.xcodeproj/xcshareddata/xcschemes/TodayViewExtension.xcscheme create mode 100644 Fixtures/iOS/AppWithExtensions/AppWithExtensions.xcodeproj/xcshareddata/xcschemes/WatchApp (Notification).xcscheme create mode 100644 Fixtures/iOS/AppWithExtensions/AppWithExtensions.xcodeproj/xcshareddata/xcschemes/WatchApp.xcscheme create mode 100644 Fixtures/iOS/AppWithExtensions/AppWithExtensions/AppDelegate.swift create mode 100644 Fixtures/iOS/AppWithExtensions/AppWithExtensions/Assets.xcassets/AppIcon.appiconset/Contents.json create mode 100644 Fixtures/iOS/AppWithExtensions/AppWithExtensions/Assets.xcassets/Contents.json create mode 100644 Fixtures/iOS/AppWithExtensions/AppWithExtensions/Base.lproj/LaunchScreen.storyboard create mode 100644 Fixtures/iOS/AppWithExtensions/AppWithExtensions/ContentView.swift create mode 100644 Fixtures/iOS/AppWithExtensions/AppWithExtensions/Info.plist create mode 100644 Fixtures/iOS/AppWithExtensions/AppWithExtensions/Preview Content/Preview Assets.xcassets/Contents.json create mode 100644 Fixtures/iOS/AppWithExtensions/AppWithExtensions/SceneDelegate.swift create mode 100644 Fixtures/iOS/AppWithExtensions/MessagesExtension/Assets.xcassets/Contents.json create mode 100644 Fixtures/iOS/AppWithExtensions/MessagesExtension/Assets.xcassets/iMessage App Icon.stickersiconset/Contents.json create mode 100644 Fixtures/iOS/AppWithExtensions/MessagesExtension/Base.lproj/MainInterface.storyboard create mode 100644 Fixtures/iOS/AppWithExtensions/MessagesExtension/Info.plist create mode 100644 Fixtures/iOS/AppWithExtensions/MessagesExtension/MessagesViewController.swift create mode 100644 Fixtures/iOS/AppWithExtensions/TodayViewExtension/Base.lproj/MainInterface.storyboard create mode 100644 Fixtures/iOS/AppWithExtensions/TodayViewExtension/Info.plist create mode 100644 Fixtures/iOS/AppWithExtensions/TodayViewExtension/TodayViewController.swift create mode 100644 Fixtures/iOS/AppWithExtensions/WatchApp Extension/Assets.xcassets/Complication.complicationset/Circular.imageset/Contents.json create mode 100644 Fixtures/iOS/AppWithExtensions/WatchApp Extension/Assets.xcassets/Complication.complicationset/Contents.json create mode 100644 Fixtures/iOS/AppWithExtensions/WatchApp Extension/Assets.xcassets/Complication.complicationset/Extra Large.imageset/Contents.json create mode 100644 Fixtures/iOS/AppWithExtensions/WatchApp Extension/Assets.xcassets/Complication.complicationset/Graphic Bezel.imageset/Contents.json create mode 100644 Fixtures/iOS/AppWithExtensions/WatchApp Extension/Assets.xcassets/Complication.complicationset/Graphic Circular.imageset/Contents.json create mode 100644 Fixtures/iOS/AppWithExtensions/WatchApp Extension/Assets.xcassets/Complication.complicationset/Graphic Corner.imageset/Contents.json create mode 100644 Fixtures/iOS/AppWithExtensions/WatchApp Extension/Assets.xcassets/Complication.complicationset/Graphic Large Rectangular.imageset/Contents.json create mode 100644 Fixtures/iOS/AppWithExtensions/WatchApp Extension/Assets.xcassets/Complication.complicationset/Modular.imageset/Contents.json create mode 100644 Fixtures/iOS/AppWithExtensions/WatchApp Extension/Assets.xcassets/Complication.complicationset/Utilitarian.imageset/Contents.json create mode 100644 Fixtures/iOS/AppWithExtensions/WatchApp Extension/Assets.xcassets/Contents.json create mode 100644 Fixtures/iOS/AppWithExtensions/WatchApp Extension/ContentView.swift create mode 100644 Fixtures/iOS/AppWithExtensions/WatchApp Extension/ExtensionDelegate.swift create mode 100644 Fixtures/iOS/AppWithExtensions/WatchApp Extension/HostingController.swift create mode 100644 Fixtures/iOS/AppWithExtensions/WatchApp Extension/Info.plist create mode 100644 Fixtures/iOS/AppWithExtensions/WatchApp Extension/NotificationController.swift create mode 100644 Fixtures/iOS/AppWithExtensions/WatchApp Extension/NotificationView.swift create mode 100644 Fixtures/iOS/AppWithExtensions/WatchApp Extension/Preview Content/Preview Assets.xcassets/Contents.json create mode 100644 Fixtures/iOS/AppWithExtensions/WatchApp Extension/PushNotificationPayload.apns create mode 100644 Fixtures/iOS/AppWithExtensions/WatchApp/Assets.xcassets/AppIcon.appiconset/Contents.json create mode 100644 Fixtures/iOS/AppWithExtensions/WatchApp/Assets.xcassets/Contents.json create mode 100644 Fixtures/iOS/AppWithExtensions/WatchApp/Base.lproj/Interface.storyboard create mode 100644 Fixtures/iOS/AppWithExtensions/WatchApp/Info.plist diff --git a/CHANGELOG.md b/CHANGELOG.md index b451fc975..c3a9c5c03 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ ### Added - Support `on-demand-install-capable` application https://github.com/tuist/XcodeProj/pull/554 by @d-date +- Add RemotePath to RemoteRunnable https://github.com/tuist/XcodeProj/pull/555 by @kwridan ## 7.12.0 diff --git a/Fixtures/iOS/AppWithExtensions/AppWithExtensions.xcodeproj/project.pbxproj b/Fixtures/iOS/AppWithExtensions/AppWithExtensions.xcodeproj/project.pbxproj new file mode 100644 index 000000000..5a12da512 --- /dev/null +++ b/Fixtures/iOS/AppWithExtensions/AppWithExtensions.xcodeproj/project.pbxproj @@ -0,0 +1,947 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 50; + objects = { + +/* Begin PBXBuildFile section */ + 42BF873E24B0E8EE00C4B605 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 42BF873D24B0E8EE00C4B605 /* AppDelegate.swift */; }; + 42BF874024B0E8EE00C4B605 /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 42BF873F24B0E8EE00C4B605 /* SceneDelegate.swift */; }; + 42BF874224B0E8EE00C4B605 /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 42BF874124B0E8EE00C4B605 /* ContentView.swift */; }; + 42BF874424B0E8EF00C4B605 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 42BF874324B0E8EF00C4B605 /* Assets.xcassets */; }; + 42BF874724B0E8EF00C4B605 /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 42BF874624B0E8EF00C4B605 /* Preview Assets.xcassets */; }; + 42BF874A24B0E8EF00C4B605 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 42BF874824B0E8EF00C4B605 /* LaunchScreen.storyboard */; }; + 42BF875824B0E9F300C4B605 /* NotificationCenter.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 42BF875724B0E9F300C4B605 /* NotificationCenter.framework */; }; + 42BF875B24B0E9F300C4B605 /* TodayViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 42BF875A24B0E9F300C4B605 /* TodayViewController.swift */; }; + 42BF875E24B0E9F300C4B605 /* MainInterface.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 42BF875C24B0E9F300C4B605 /* MainInterface.storyboard */; }; + 42BF876224B0E9F300C4B605 /* TodayViewExtension.appex in Embed App Extensions */ = {isa = PBXBuildFile; fileRef = 42BF875524B0E9F300C4B605 /* TodayViewExtension.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; }; + 42BF876D24B0EA0700C4B605 /* Interface.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 42BF876B24B0EA0700C4B605 /* Interface.storyboard */; }; + 42BF876F24B0EA0800C4B605 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 42BF876E24B0EA0800C4B605 /* Assets.xcassets */; }; + 42BF877624B0EA0800C4B605 /* WatchApp Extension.appex in Embed App Extensions */ = {isa = PBXBuildFile; fileRef = 42BF877524B0EA0800C4B605 /* WatchApp Extension.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; }; + 42BF877B24B0EA0800C4B605 /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 42BF877A24B0EA0800C4B605 /* ContentView.swift */; }; + 42BF877D24B0EA0800C4B605 /* HostingController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 42BF877C24B0EA0800C4B605 /* HostingController.swift */; }; + 42BF877F24B0EA0800C4B605 /* ExtensionDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 42BF877E24B0EA0800C4B605 /* ExtensionDelegate.swift */; }; + 42BF878124B0EA0800C4B605 /* NotificationController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 42BF878024B0EA0800C4B605 /* NotificationController.swift */; }; + 42BF878324B0EA0800C4B605 /* NotificationView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 42BF878224B0EA0800C4B605 /* NotificationView.swift */; }; + 42BF878524B0EA0900C4B605 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 42BF878424B0EA0900C4B605 /* Assets.xcassets */; }; + 42BF878824B0EA0900C4B605 /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 42BF878724B0EA0900C4B605 /* Preview Assets.xcassets */; }; + 42BF878D24B0EA0900C4B605 /* WatchApp.app in Embed Watch Content */ = {isa = PBXBuildFile; fileRef = 42BF876924B0EA0700C4B605 /* WatchApp.app */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; }; + 42BF879C24B0EA2500C4B605 /* Messages.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 42BF879B24B0EA2500C4B605 /* Messages.framework */; }; + 42BF879F24B0EA2500C4B605 /* MessagesViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 42BF879E24B0EA2500C4B605 /* MessagesViewController.swift */; }; + 42BF87A224B0EA2500C4B605 /* MainInterface.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 42BF87A024B0EA2500C4B605 /* MainInterface.storyboard */; }; + 42BF87A424B0EA2500C4B605 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 42BF87A324B0EA2500C4B605 /* Assets.xcassets */; }; + 42BF87A824B0EA2500C4B605 /* MessagesExtension.appex in Embed App Extensions */ = {isa = PBXBuildFile; fileRef = 42BF879A24B0EA2500C4B605 /* MessagesExtension.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 42BF876024B0E9F300C4B605 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 42BF873224B0E8EE00C4B605 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 42BF875424B0E9F300C4B605; + remoteInfo = TodayViewExtension; + }; + 42BF877724B0EA0800C4B605 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 42BF873224B0E8EE00C4B605 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 42BF877424B0EA0800C4B605; + remoteInfo = "WatchApp Extension"; + }; + 42BF878B24B0EA0900C4B605 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 42BF873224B0E8EE00C4B605 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 42BF876824B0EA0700C4B605; + remoteInfo = WatchApp; + }; + 42BF87A624B0EA2500C4B605 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 42BF873224B0E8EE00C4B605 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 42BF879924B0EA2500C4B605; + remoteInfo = MessagesExtension; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXCopyFilesBuildPhase section */ + 42BF876624B0E9F300C4B605 /* Embed App Extensions */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 13; + files = ( + 42BF87A824B0EA2500C4B605 /* MessagesExtension.appex in Embed App Extensions */, + 42BF876224B0E9F300C4B605 /* TodayViewExtension.appex in Embed App Extensions */, + ); + name = "Embed App Extensions"; + runOnlyForDeploymentPostprocessing = 0; + }; + 42BF879124B0EA0900C4B605 /* Embed App Extensions */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 13; + files = ( + 42BF877624B0EA0800C4B605 /* WatchApp Extension.appex in Embed App Extensions */, + ); + name = "Embed App Extensions"; + runOnlyForDeploymentPostprocessing = 0; + }; + 42BF879524B0EA0900C4B605 /* Embed Watch Content */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(CONTENTS_FOLDER_PATH)/Watch"; + dstSubfolderSpec = 16; + files = ( + 42BF878D24B0EA0900C4B605 /* WatchApp.app in Embed Watch Content */, + ); + name = "Embed Watch Content"; + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXCopyFilesBuildPhase section */ + +/* Begin PBXFileReference section */ + 42BF873A24B0E8EE00C4B605 /* AppWithExtensions.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = AppWithExtensions.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 42BF873D24B0E8EE00C4B605 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + 42BF873F24B0E8EE00C4B605 /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = ""; }; + 42BF874124B0E8EE00C4B605 /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = ""; }; + 42BF874324B0E8EF00C4B605 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + 42BF874624B0E8EF00C4B605 /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = ""; }; + 42BF874924B0E8EF00C4B605 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + 42BF874B24B0E8EF00C4B605 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 42BF875524B0E9F300C4B605 /* TodayViewExtension.appex */ = {isa = PBXFileReference; explicitFileType = "wrapper.app-extension"; includeInIndex = 0; path = TodayViewExtension.appex; sourceTree = BUILT_PRODUCTS_DIR; }; + 42BF875724B0E9F300C4B605 /* NotificationCenter.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = NotificationCenter.framework; path = System/Library/Frameworks/NotificationCenter.framework; sourceTree = SDKROOT; }; + 42BF875A24B0E9F300C4B605 /* TodayViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TodayViewController.swift; sourceTree = ""; }; + 42BF875D24B0E9F300C4B605 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/MainInterface.storyboard; sourceTree = ""; }; + 42BF875F24B0E9F300C4B605 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 42BF876924B0EA0700C4B605 /* WatchApp.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = WatchApp.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 42BF876C24B0EA0700C4B605 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Interface.storyboard; sourceTree = ""; }; + 42BF876E24B0EA0800C4B605 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + 42BF877024B0EA0800C4B605 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 42BF877524B0EA0800C4B605 /* WatchApp Extension.appex */ = {isa = PBXFileReference; explicitFileType = "wrapper.app-extension"; includeInIndex = 0; path = "WatchApp Extension.appex"; sourceTree = BUILT_PRODUCTS_DIR; }; + 42BF877A24B0EA0800C4B605 /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = ""; }; + 42BF877C24B0EA0800C4B605 /* HostingController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HostingController.swift; sourceTree = ""; }; + 42BF877E24B0EA0800C4B605 /* ExtensionDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ExtensionDelegate.swift; sourceTree = ""; }; + 42BF878024B0EA0800C4B605 /* NotificationController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NotificationController.swift; sourceTree = ""; }; + 42BF878224B0EA0800C4B605 /* NotificationView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NotificationView.swift; sourceTree = ""; }; + 42BF878424B0EA0900C4B605 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + 42BF878724B0EA0900C4B605 /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = ""; }; + 42BF878924B0EA0900C4B605 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 42BF878A24B0EA0900C4B605 /* PushNotificationPayload.apns */ = {isa = PBXFileReference; lastKnownFileType = text; path = PushNotificationPayload.apns; sourceTree = ""; }; + 42BF879A24B0EA2500C4B605 /* MessagesExtension.appex */ = {isa = PBXFileReference; explicitFileType = "wrapper.app-extension"; includeInIndex = 0; path = MessagesExtension.appex; sourceTree = BUILT_PRODUCTS_DIR; }; + 42BF879B24B0EA2500C4B605 /* Messages.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Messages.framework; path = System/Library/Frameworks/Messages.framework; sourceTree = SDKROOT; }; + 42BF879E24B0EA2500C4B605 /* MessagesViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MessagesViewController.swift; sourceTree = ""; }; + 42BF87A124B0EA2500C4B605 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/MainInterface.storyboard; sourceTree = ""; }; + 42BF87A324B0EA2500C4B605 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + 42BF87A524B0EA2500C4B605 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 42BF873724B0E8EE00C4B605 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 42BF875224B0E9F300C4B605 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 42BF875824B0E9F300C4B605 /* NotificationCenter.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 42BF877224B0EA0800C4B605 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 42BF879724B0EA2500C4B605 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 42BF879C24B0EA2500C4B605 /* Messages.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 42BF873124B0E8EE00C4B605 = { + isa = PBXGroup; + children = ( + 42BF873C24B0E8EE00C4B605 /* AppWithExtensions */, + 42BF875924B0E9F300C4B605 /* TodayViewExtension */, + 42BF876A24B0EA0700C4B605 /* WatchApp */, + 42BF877924B0EA0800C4B605 /* WatchApp Extension */, + 42BF879D24B0EA2500C4B605 /* MessagesExtension */, + 42BF875624B0E9F300C4B605 /* Frameworks */, + 42BF873B24B0E8EE00C4B605 /* Products */, + ); + sourceTree = ""; + }; + 42BF873B24B0E8EE00C4B605 /* Products */ = { + isa = PBXGroup; + children = ( + 42BF873A24B0E8EE00C4B605 /* AppWithExtensions.app */, + 42BF875524B0E9F300C4B605 /* TodayViewExtension.appex */, + 42BF876924B0EA0700C4B605 /* WatchApp.app */, + 42BF877524B0EA0800C4B605 /* WatchApp Extension.appex */, + 42BF879A24B0EA2500C4B605 /* MessagesExtension.appex */, + ); + name = Products; + sourceTree = ""; + }; + 42BF873C24B0E8EE00C4B605 /* AppWithExtensions */ = { + isa = PBXGroup; + children = ( + 42BF873D24B0E8EE00C4B605 /* AppDelegate.swift */, + 42BF873F24B0E8EE00C4B605 /* SceneDelegate.swift */, + 42BF874124B0E8EE00C4B605 /* ContentView.swift */, + 42BF874324B0E8EF00C4B605 /* Assets.xcassets */, + 42BF874824B0E8EF00C4B605 /* LaunchScreen.storyboard */, + 42BF874B24B0E8EF00C4B605 /* Info.plist */, + 42BF874524B0E8EF00C4B605 /* Preview Content */, + ); + path = AppWithExtensions; + sourceTree = ""; + }; + 42BF874524B0E8EF00C4B605 /* Preview Content */ = { + isa = PBXGroup; + children = ( + 42BF874624B0E8EF00C4B605 /* Preview Assets.xcassets */, + ); + path = "Preview Content"; + sourceTree = ""; + }; + 42BF875624B0E9F300C4B605 /* Frameworks */ = { + isa = PBXGroup; + children = ( + 42BF875724B0E9F300C4B605 /* NotificationCenter.framework */, + 42BF879B24B0EA2500C4B605 /* Messages.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + 42BF875924B0E9F300C4B605 /* TodayViewExtension */ = { + isa = PBXGroup; + children = ( + 42BF875A24B0E9F300C4B605 /* TodayViewController.swift */, + 42BF875C24B0E9F300C4B605 /* MainInterface.storyboard */, + 42BF875F24B0E9F300C4B605 /* Info.plist */, + ); + path = TodayViewExtension; + sourceTree = ""; + }; + 42BF876A24B0EA0700C4B605 /* WatchApp */ = { + isa = PBXGroup; + children = ( + 42BF876B24B0EA0700C4B605 /* Interface.storyboard */, + 42BF876E24B0EA0800C4B605 /* Assets.xcassets */, + 42BF877024B0EA0800C4B605 /* Info.plist */, + ); + path = WatchApp; + sourceTree = ""; + }; + 42BF877924B0EA0800C4B605 /* WatchApp Extension */ = { + isa = PBXGroup; + children = ( + 42BF877A24B0EA0800C4B605 /* ContentView.swift */, + 42BF877C24B0EA0800C4B605 /* HostingController.swift */, + 42BF877E24B0EA0800C4B605 /* ExtensionDelegate.swift */, + 42BF878024B0EA0800C4B605 /* NotificationController.swift */, + 42BF878224B0EA0800C4B605 /* NotificationView.swift */, + 42BF878424B0EA0900C4B605 /* Assets.xcassets */, + 42BF878924B0EA0900C4B605 /* Info.plist */, + 42BF878A24B0EA0900C4B605 /* PushNotificationPayload.apns */, + 42BF878624B0EA0900C4B605 /* Preview Content */, + ); + path = "WatchApp Extension"; + sourceTree = ""; + }; + 42BF878624B0EA0900C4B605 /* Preview Content */ = { + isa = PBXGroup; + children = ( + 42BF878724B0EA0900C4B605 /* Preview Assets.xcassets */, + ); + path = "Preview Content"; + sourceTree = ""; + }; + 42BF879D24B0EA2500C4B605 /* MessagesExtension */ = { + isa = PBXGroup; + children = ( + 42BF879E24B0EA2500C4B605 /* MessagesViewController.swift */, + 42BF87A024B0EA2500C4B605 /* MainInterface.storyboard */, + 42BF87A324B0EA2500C4B605 /* Assets.xcassets */, + 42BF87A524B0EA2500C4B605 /* Info.plist */, + ); + path = MessagesExtension; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 42BF873924B0E8EE00C4B605 /* AppWithExtensions */ = { + isa = PBXNativeTarget; + buildConfigurationList = 42BF874E24B0E8EF00C4B605 /* Build configuration list for PBXNativeTarget "AppWithExtensions" */; + buildPhases = ( + 42BF873624B0E8EE00C4B605 /* Sources */, + 42BF873724B0E8EE00C4B605 /* Frameworks */, + 42BF873824B0E8EE00C4B605 /* Resources */, + 42BF876624B0E9F300C4B605 /* Embed App Extensions */, + 42BF879524B0EA0900C4B605 /* Embed Watch Content */, + ); + buildRules = ( + ); + dependencies = ( + 42BF876124B0E9F300C4B605 /* PBXTargetDependency */, + 42BF878C24B0EA0900C4B605 /* PBXTargetDependency */, + 42BF87A724B0EA2500C4B605 /* PBXTargetDependency */, + ); + name = AppWithExtensions; + productName = AppWithExtensions; + productReference = 42BF873A24B0E8EE00C4B605 /* AppWithExtensions.app */; + productType = "com.apple.product-type.application"; + }; + 42BF875424B0E9F300C4B605 /* TodayViewExtension */ = { + isa = PBXNativeTarget; + buildConfigurationList = 42BF876324B0E9F300C4B605 /* Build configuration list for PBXNativeTarget "TodayViewExtension" */; + buildPhases = ( + 42BF875124B0E9F300C4B605 /* Sources */, + 42BF875224B0E9F300C4B605 /* Frameworks */, + 42BF875324B0E9F300C4B605 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = TodayViewExtension; + productName = TodayViewExtension; + productReference = 42BF875524B0E9F300C4B605 /* TodayViewExtension.appex */; + productType = "com.apple.product-type.app-extension"; + }; + 42BF876824B0EA0700C4B605 /* WatchApp */ = { + isa = PBXNativeTarget; + buildConfigurationList = 42BF879224B0EA0900C4B605 /* Build configuration list for PBXNativeTarget "WatchApp" */; + buildPhases = ( + 42BF876724B0EA0700C4B605 /* Resources */, + 42BF879124B0EA0900C4B605 /* Embed App Extensions */, + ); + buildRules = ( + ); + dependencies = ( + 42BF877824B0EA0800C4B605 /* PBXTargetDependency */, + ); + name = WatchApp; + productName = WatchApp; + productReference = 42BF876924B0EA0700C4B605 /* WatchApp.app */; + productType = "com.apple.product-type.application.watchapp2"; + }; + 42BF877424B0EA0800C4B605 /* WatchApp Extension */ = { + isa = PBXNativeTarget; + buildConfigurationList = 42BF878E24B0EA0900C4B605 /* Build configuration list for PBXNativeTarget "WatchApp Extension" */; + buildPhases = ( + 42BF877124B0EA0800C4B605 /* Sources */, + 42BF877224B0EA0800C4B605 /* Frameworks */, + 42BF877324B0EA0800C4B605 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "WatchApp Extension"; + productName = "WatchApp Extension"; + productReference = 42BF877524B0EA0800C4B605 /* WatchApp Extension.appex */; + productType = "com.apple.product-type.watchkit2-extension"; + }; + 42BF879924B0EA2500C4B605 /* MessagesExtension */ = { + isa = PBXNativeTarget; + buildConfigurationList = 42BF87A924B0EA2500C4B605 /* Build configuration list for PBXNativeTarget "MessagesExtension" */; + buildPhases = ( + 42BF879624B0EA2500C4B605 /* Sources */, + 42BF879724B0EA2500C4B605 /* Frameworks */, + 42BF879824B0EA2500C4B605 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = MessagesExtension; + productName = MessagesExtension; + productReference = 42BF879A24B0EA2500C4B605 /* MessagesExtension.appex */; + productType = "com.apple.product-type.app-extension.messages"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 42BF873224B0E8EE00C4B605 /* Project object */ = { + isa = PBXProject; + attributes = { + LastSwiftUpdateCheck = 1140; + LastUpgradeCheck = 1140; + ORGANIZATIONNAME = Tuist; + TargetAttributes = { + 42BF873924B0E8EE00C4B605 = { + CreatedOnToolsVersion = 11.4; + }; + 42BF875424B0E9F300C4B605 = { + CreatedOnToolsVersion = 11.4; + }; + 42BF876824B0EA0700C4B605 = { + CreatedOnToolsVersion = 11.4; + }; + 42BF877424B0EA0800C4B605 = { + CreatedOnToolsVersion = 11.4; + }; + 42BF879924B0EA2500C4B605 = { + CreatedOnToolsVersion = 11.4; + }; + }; + }; + buildConfigurationList = 42BF873524B0E8EE00C4B605 /* Build configuration list for PBXProject "AppWithExtensions" */; + compatibilityVersion = "Xcode 9.3"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 42BF873124B0E8EE00C4B605; + productRefGroup = 42BF873B24B0E8EE00C4B605 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 42BF873924B0E8EE00C4B605 /* AppWithExtensions */, + 42BF875424B0E9F300C4B605 /* TodayViewExtension */, + 42BF876824B0EA0700C4B605 /* WatchApp */, + 42BF877424B0EA0800C4B605 /* WatchApp Extension */, + 42BF879924B0EA2500C4B605 /* MessagesExtension */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 42BF873824B0E8EE00C4B605 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 42BF874A24B0E8EF00C4B605 /* LaunchScreen.storyboard in Resources */, + 42BF874724B0E8EF00C4B605 /* Preview Assets.xcassets in Resources */, + 42BF874424B0E8EF00C4B605 /* Assets.xcassets in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 42BF875324B0E9F300C4B605 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 42BF875E24B0E9F300C4B605 /* MainInterface.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 42BF876724B0EA0700C4B605 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 42BF876F24B0EA0800C4B605 /* Assets.xcassets in Resources */, + 42BF876D24B0EA0700C4B605 /* Interface.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 42BF877324B0EA0800C4B605 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 42BF878824B0EA0900C4B605 /* Preview Assets.xcassets in Resources */, + 42BF878524B0EA0900C4B605 /* Assets.xcassets in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 42BF879824B0EA2500C4B605 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 42BF87A424B0EA2500C4B605 /* Assets.xcassets in Resources */, + 42BF87A224B0EA2500C4B605 /* MainInterface.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 42BF873624B0E8EE00C4B605 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 42BF873E24B0E8EE00C4B605 /* AppDelegate.swift in Sources */, + 42BF874024B0E8EE00C4B605 /* SceneDelegate.swift in Sources */, + 42BF874224B0E8EE00C4B605 /* ContentView.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 42BF875124B0E9F300C4B605 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 42BF875B24B0E9F300C4B605 /* TodayViewController.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 42BF877124B0EA0800C4B605 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 42BF877D24B0EA0800C4B605 /* HostingController.swift in Sources */, + 42BF877B24B0EA0800C4B605 /* ContentView.swift in Sources */, + 42BF878124B0EA0800C4B605 /* NotificationController.swift in Sources */, + 42BF877F24B0EA0800C4B605 /* ExtensionDelegate.swift in Sources */, + 42BF878324B0EA0800C4B605 /* NotificationView.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 42BF879624B0EA2500C4B605 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 42BF879F24B0EA2500C4B605 /* MessagesViewController.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 42BF876124B0E9F300C4B605 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 42BF875424B0E9F300C4B605 /* TodayViewExtension */; + targetProxy = 42BF876024B0E9F300C4B605 /* PBXContainerItemProxy */; + }; + 42BF877824B0EA0800C4B605 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 42BF877424B0EA0800C4B605 /* WatchApp Extension */; + targetProxy = 42BF877724B0EA0800C4B605 /* PBXContainerItemProxy */; + }; + 42BF878C24B0EA0900C4B605 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 42BF876824B0EA0700C4B605 /* WatchApp */; + targetProxy = 42BF878B24B0EA0900C4B605 /* PBXContainerItemProxy */; + }; + 42BF87A724B0EA2500C4B605 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 42BF879924B0EA2500C4B605 /* MessagesExtension */; + targetProxy = 42BF87A624B0EA2500C4B605 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + 42BF874824B0E8EF00C4B605 /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 42BF874924B0E8EF00C4B605 /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; + 42BF875C24B0E9F300C4B605 /* MainInterface.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 42BF875D24B0E9F300C4B605 /* Base */, + ); + name = MainInterface.storyboard; + sourceTree = ""; + }; + 42BF876B24B0EA0700C4B605 /* Interface.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 42BF876C24B0EA0700C4B605 /* Base */, + ); + name = Interface.storyboard; + sourceTree = ""; + }; + 42BF87A024B0EA2500C4B605 /* MainInterface.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 42BF87A124B0EA2500C4B605 /* Base */, + ); + name = MainInterface.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 42BF874C24B0E8EF00C4B605 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 13.4; + MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; + MTL_FAST_MATH = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + }; + name = Debug; + }; + 42BF874D24B0E8EF00C4B605 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 13.4; + MTL_ENABLE_DEBUG_INFO = NO; + MTL_FAST_MATH = YES; + SDKROOT = iphoneos; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 42BF874F24B0E8EF00C4B605 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_ASSET_PATHS = "\"AppWithExtensions/Preview Content\""; + ENABLE_PREVIEWS = YES; + INFOPLIST_FILE = AppWithExtensions/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = io.tuist.xcodeproj.fixtures.AppWithExtensions; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + 42BF875024B0E8EF00C4B605 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_ASSET_PATHS = "\"AppWithExtensions/Preview Content\""; + ENABLE_PREVIEWS = YES; + INFOPLIST_FILE = AppWithExtensions/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = io.tuist.xcodeproj.fixtures.AppWithExtensions; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Release; + }; + 42BF876424B0E9F300C4B605 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + CODE_SIGN_STYLE = Automatic; + INFOPLIST_FILE = TodayViewExtension/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@executable_path/../../Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = io.tuist.xcodeproj.fixtures.AppWithExtensions.TodayViewExtension; + PRODUCT_NAME = "$(TARGET_NAME)"; + SKIP_INSTALL = YES; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + 42BF876524B0E9F300C4B605 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + CODE_SIGN_STYLE = Automatic; + INFOPLIST_FILE = TodayViewExtension/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@executable_path/../../Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = io.tuist.xcodeproj.fixtures.AppWithExtensions.TodayViewExtension; + PRODUCT_NAME = "$(TARGET_NAME)"; + SKIP_INSTALL = YES; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Release; + }; + 42BF878F24B0EA0900C4B605 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_COMPLICATION_NAME = Complication; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_ASSET_PATHS = "\"WatchApp Extension/Preview Content\""; + ENABLE_PREVIEWS = YES; + INFOPLIST_FILE = "WatchApp Extension/Info.plist"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@executable_path/../../Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = io.tuist.xcodeproj.fixtures.AppWithExtensions.watchkitapp.watchkitextension; + PRODUCT_NAME = "${TARGET_NAME}"; + SDKROOT = watchos; + SKIP_INSTALL = YES; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = 4; + WATCHOS_DEPLOYMENT_TARGET = 6.2; + }; + name = Debug; + }; + 42BF879024B0EA0900C4B605 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_COMPLICATION_NAME = Complication; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_ASSET_PATHS = "\"WatchApp Extension/Preview Content\""; + ENABLE_PREVIEWS = YES; + INFOPLIST_FILE = "WatchApp Extension/Info.plist"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@executable_path/../../Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = io.tuist.xcodeproj.fixtures.AppWithExtensions.watchkitapp.watchkitextension; + PRODUCT_NAME = "${TARGET_NAME}"; + SDKROOT = watchos; + SKIP_INSTALL = YES; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = 4; + WATCHOS_DEPLOYMENT_TARGET = 6.2; + }; + name = Release; + }; + 42BF879324B0EA0900C4B605 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_STYLE = Automatic; + IBSC_MODULE = WatchApp_Extension; + INFOPLIST_FILE = WatchApp/Info.plist; + PRODUCT_BUNDLE_IDENTIFIER = io.tuist.xcodeproj.fixtures.AppWithExtensions.watchkitapp; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = watchos; + SKIP_INSTALL = YES; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = 4; + WATCHOS_DEPLOYMENT_TARGET = 6.2; + }; + name = Debug; + }; + 42BF879424B0EA0900C4B605 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_STYLE = Automatic; + IBSC_MODULE = WatchApp_Extension; + INFOPLIST_FILE = WatchApp/Info.plist; + PRODUCT_BUNDLE_IDENTIFIER = io.tuist.xcodeproj.fixtures.AppWithExtensions.watchkitapp; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = watchos; + SKIP_INSTALL = YES; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = 4; + WATCHOS_DEPLOYMENT_TARGET = 6.2; + }; + name = Release; + }; + 42BF87AA24B0EA2500C4B605 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = "iMessage App Icon"; + CODE_SIGN_STYLE = Automatic; + INFOPLIST_FILE = MessagesExtension/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@executable_path/../../Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = io.tuist.xcodeproj.fixtures.AppWithExtensions.MessagesExtension; + PRODUCT_NAME = "$(TARGET_NAME)"; + SKIP_INSTALL = YES; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + 42BF87AB24B0EA2500C4B605 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = "iMessage App Icon"; + CODE_SIGN_STYLE = Automatic; + INFOPLIST_FILE = MessagesExtension/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@executable_path/../../Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = io.tuist.xcodeproj.fixtures.AppWithExtensions.MessagesExtension; + PRODUCT_NAME = "$(TARGET_NAME)"; + SKIP_INSTALL = YES; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 42BF873524B0E8EE00C4B605 /* Build configuration list for PBXProject "AppWithExtensions" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 42BF874C24B0E8EF00C4B605 /* Debug */, + 42BF874D24B0E8EF00C4B605 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 42BF874E24B0E8EF00C4B605 /* Build configuration list for PBXNativeTarget "AppWithExtensions" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 42BF874F24B0E8EF00C4B605 /* Debug */, + 42BF875024B0E8EF00C4B605 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 42BF876324B0E9F300C4B605 /* Build configuration list for PBXNativeTarget "TodayViewExtension" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 42BF876424B0E9F300C4B605 /* Debug */, + 42BF876524B0E9F300C4B605 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 42BF878E24B0EA0900C4B605 /* Build configuration list for PBXNativeTarget "WatchApp Extension" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 42BF878F24B0EA0900C4B605 /* Debug */, + 42BF879024B0EA0900C4B605 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 42BF879224B0EA0900C4B605 /* Build configuration list for PBXNativeTarget "WatchApp" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 42BF879324B0EA0900C4B605 /* Debug */, + 42BF879424B0EA0900C4B605 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 42BF87A924B0EA2500C4B605 /* Build configuration list for PBXNativeTarget "MessagesExtension" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 42BF87AA24B0EA2500C4B605 /* Debug */, + 42BF87AB24B0EA2500C4B605 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 42BF873224B0E8EE00C4B605 /* Project object */; +} diff --git a/Fixtures/iOS/AppWithExtensions/AppWithExtensions.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/Fixtures/iOS/AppWithExtensions/AppWithExtensions.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 000000000..45e757e3e --- /dev/null +++ b/Fixtures/iOS/AppWithExtensions/AppWithExtensions.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/Fixtures/iOS/AppWithExtensions/AppWithExtensions.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/Fixtures/iOS/AppWithExtensions/AppWithExtensions.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 000000000..18d981003 --- /dev/null +++ b/Fixtures/iOS/AppWithExtensions/AppWithExtensions.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/Fixtures/iOS/AppWithExtensions/AppWithExtensions.xcodeproj/xcshareddata/xcschemes/AppWithExtensions.xcscheme b/Fixtures/iOS/AppWithExtensions/AppWithExtensions.xcodeproj/xcshareddata/xcschemes/AppWithExtensions.xcscheme new file mode 100644 index 000000000..5d686fcd9 --- /dev/null +++ b/Fixtures/iOS/AppWithExtensions/AppWithExtensions.xcodeproj/xcshareddata/xcschemes/AppWithExtensions.xcscheme @@ -0,0 +1,78 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Fixtures/iOS/AppWithExtensions/AppWithExtensions.xcodeproj/xcshareddata/xcschemes/MessagesExtension.xcscheme b/Fixtures/iOS/AppWithExtensions/AppWithExtensions.xcodeproj/xcshareddata/xcschemes/MessagesExtension.xcscheme new file mode 100644 index 000000000..94affadc2 --- /dev/null +++ b/Fixtures/iOS/AppWithExtensions/AppWithExtensions.xcodeproj/xcshareddata/xcschemes/MessagesExtension.xcscheme @@ -0,0 +1,96 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Fixtures/iOS/AppWithExtensions/AppWithExtensions.xcodeproj/xcshareddata/xcschemes/TodayViewExtension.xcscheme b/Fixtures/iOS/AppWithExtensions/AppWithExtensions.xcodeproj/xcshareddata/xcschemes/TodayViewExtension.xcscheme new file mode 100644 index 000000000..131af9f86 --- /dev/null +++ b/Fixtures/iOS/AppWithExtensions/AppWithExtensions.xcodeproj/xcshareddata/xcschemes/TodayViewExtension.xcscheme @@ -0,0 +1,96 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Fixtures/iOS/AppWithExtensions/AppWithExtensions.xcodeproj/xcshareddata/xcschemes/WatchApp (Notification).xcscheme b/Fixtures/iOS/AppWithExtensions/AppWithExtensions.xcodeproj/xcshareddata/xcschemes/WatchApp (Notification).xcscheme new file mode 100644 index 000000000..bfc623111 --- /dev/null +++ b/Fixtures/iOS/AppWithExtensions/AppWithExtensions.xcodeproj/xcshareddata/xcschemes/WatchApp (Notification).xcscheme @@ -0,0 +1,109 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Fixtures/iOS/AppWithExtensions/AppWithExtensions.xcodeproj/xcshareddata/xcschemes/WatchApp.xcscheme b/Fixtures/iOS/AppWithExtensions/AppWithExtensions.xcodeproj/xcshareddata/xcschemes/WatchApp.xcscheme new file mode 100644 index 000000000..8be6e209f --- /dev/null +++ b/Fixtures/iOS/AppWithExtensions/AppWithExtensions.xcodeproj/xcshareddata/xcschemes/WatchApp.xcscheme @@ -0,0 +1,105 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Fixtures/iOS/AppWithExtensions/AppWithExtensions/AppDelegate.swift b/Fixtures/iOS/AppWithExtensions/AppWithExtensions/AppDelegate.swift new file mode 100644 index 000000000..34ca27d89 --- /dev/null +++ b/Fixtures/iOS/AppWithExtensions/AppWithExtensions/AppDelegate.swift @@ -0,0 +1,29 @@ +import UIKit + +@UIApplicationMain +class AppDelegate: UIResponder, UIApplicationDelegate { + + + + func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { + // Override point for customization after application launch. + return true + } + + // MARK: UISceneSession Lifecycle + + func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration { + // Called when a new scene session is being created. + // Use this method to select a configuration to create the new scene with. + return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role) + } + + func application(_ application: UIApplication, didDiscardSceneSessions sceneSessions: Set) { + // Called when the user discards a scene session. + // If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions. + // Use this method to release any resources that were specific to the discarded scenes, as they will not return. + } + + +} + diff --git a/Fixtures/iOS/AppWithExtensions/AppWithExtensions/Assets.xcassets/AppIcon.appiconset/Contents.json b/Fixtures/iOS/AppWithExtensions/AppWithExtensions/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 000000000..9221b9bb1 --- /dev/null +++ b/Fixtures/iOS/AppWithExtensions/AppWithExtensions/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,98 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "scale" : "2x", + "size" : "20x20" + }, + { + "idiom" : "iphone", + "scale" : "3x", + "size" : "20x20" + }, + { + "idiom" : "iphone", + "scale" : "2x", + "size" : "29x29" + }, + { + "idiom" : "iphone", + "scale" : "3x", + "size" : "29x29" + }, + { + "idiom" : "iphone", + "scale" : "2x", + "size" : "40x40" + }, + { + "idiom" : "iphone", + "scale" : "3x", + "size" : "40x40" + }, + { + "idiom" : "iphone", + "scale" : "2x", + "size" : "60x60" + }, + { + "idiom" : "iphone", + "scale" : "3x", + "size" : "60x60" + }, + { + "idiom" : "ipad", + "scale" : "1x", + "size" : "20x20" + }, + { + "idiom" : "ipad", + "scale" : "2x", + "size" : "20x20" + }, + { + "idiom" : "ipad", + "scale" : "1x", + "size" : "29x29" + }, + { + "idiom" : "ipad", + "scale" : "2x", + "size" : "29x29" + }, + { + "idiom" : "ipad", + "scale" : "1x", + "size" : "40x40" + }, + { + "idiom" : "ipad", + "scale" : "2x", + "size" : "40x40" + }, + { + "idiom" : "ipad", + "scale" : "1x", + "size" : "76x76" + }, + { + "idiom" : "ipad", + "scale" : "2x", + "size" : "76x76" + }, + { + "idiom" : "ipad", + "scale" : "2x", + "size" : "83.5x83.5" + }, + { + "idiom" : "ios-marketing", + "scale" : "1x", + "size" : "1024x1024" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Fixtures/iOS/AppWithExtensions/AppWithExtensions/Assets.xcassets/Contents.json b/Fixtures/iOS/AppWithExtensions/AppWithExtensions/Assets.xcassets/Contents.json new file mode 100644 index 000000000..73c00596a --- /dev/null +++ b/Fixtures/iOS/AppWithExtensions/AppWithExtensions/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Fixtures/iOS/AppWithExtensions/AppWithExtensions/Base.lproj/LaunchScreen.storyboard b/Fixtures/iOS/AppWithExtensions/AppWithExtensions/Base.lproj/LaunchScreen.storyboard new file mode 100644 index 000000000..865e9329f --- /dev/null +++ b/Fixtures/iOS/AppWithExtensions/AppWithExtensions/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Fixtures/iOS/AppWithExtensions/AppWithExtensions/ContentView.swift b/Fixtures/iOS/AppWithExtensions/AppWithExtensions/ContentView.swift new file mode 100644 index 000000000..dfe33f922 --- /dev/null +++ b/Fixtures/iOS/AppWithExtensions/AppWithExtensions/ContentView.swift @@ -0,0 +1,13 @@ +import SwiftUI + +struct ContentView: View { + var body: some View { + Text("Hello, World!") + } +} + +struct ContentView_Previews: PreviewProvider { + static var previews: some View { + ContentView() + } +} diff --git a/Fixtures/iOS/AppWithExtensions/AppWithExtensions/Info.plist b/Fixtures/iOS/AppWithExtensions/AppWithExtensions/Info.plist new file mode 100644 index 000000000..9742bf0f4 --- /dev/null +++ b/Fixtures/iOS/AppWithExtensions/AppWithExtensions/Info.plist @@ -0,0 +1,60 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + $(PRODUCT_BUNDLE_PACKAGE_TYPE) + CFBundleShortVersionString + 1.0 + CFBundleVersion + 1 + LSRequiresIPhoneOS + + UIApplicationSceneManifest + + UIApplicationSupportsMultipleScenes + + UISceneConfigurations + + UIWindowSceneSessionRoleApplication + + + UISceneConfigurationName + Default Configuration + UISceneDelegateClassName + $(PRODUCT_MODULE_NAME).SceneDelegate + + + + + UILaunchStoryboardName + LaunchScreen + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/Fixtures/iOS/AppWithExtensions/AppWithExtensions/Preview Content/Preview Assets.xcassets/Contents.json b/Fixtures/iOS/AppWithExtensions/AppWithExtensions/Preview Content/Preview Assets.xcassets/Contents.json new file mode 100644 index 000000000..73c00596a --- /dev/null +++ b/Fixtures/iOS/AppWithExtensions/AppWithExtensions/Preview Content/Preview Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Fixtures/iOS/AppWithExtensions/AppWithExtensions/SceneDelegate.swift b/Fixtures/iOS/AppWithExtensions/AppWithExtensions/SceneDelegate.swift new file mode 100644 index 000000000..dcee5d055 --- /dev/null +++ b/Fixtures/iOS/AppWithExtensions/AppWithExtensions/SceneDelegate.swift @@ -0,0 +1,56 @@ +import UIKit +import SwiftUI + +class SceneDelegate: UIResponder, UIWindowSceneDelegate { + + var window: UIWindow? + + + func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) { + // Use this method to optionally configure and attach the UIWindow `window` to the provided UIWindowScene `scene`. + // If using a storyboard, the `window` property will automatically be initialized and attached to the scene. + // This delegate does not imply the connecting scene or session are new (see `application:configurationForConnectingSceneSession` instead). + + // Create the SwiftUI view that provides the window contents. + let contentView = ContentView() + + // Use a UIHostingController as window root view controller. + if let windowScene = scene as? UIWindowScene { + let window = UIWindow(windowScene: windowScene) + window.rootViewController = UIHostingController(rootView: contentView) + self.window = window + window.makeKeyAndVisible() + } + } + + func sceneDidDisconnect(_ scene: UIScene) { + // Called as the scene is being released by the system. + // This occurs shortly after the scene enters the background, or when its session is discarded. + // Release any resources associated with this scene that can be re-created the next time the scene connects. + // The scene may re-connect later, as its session was not neccessarily discarded (see `application:didDiscardSceneSessions` instead). + } + + func sceneDidBecomeActive(_ scene: UIScene) { + // Called when the scene has moved from an inactive state to an active state. + // Use this method to restart any tasks that were paused (or not yet started) when the scene was inactive. + } + + func sceneWillResignActive(_ scene: UIScene) { + // Called when the scene will move from an active state to an inactive state. + // This may occur due to temporary interruptions (ex. an incoming phone call). + } + + func sceneWillEnterForeground(_ scene: UIScene) { + // Called as the scene transitions from the background to the foreground. + // Use this method to undo the changes made on entering the background. + } + + func sceneDidEnterBackground(_ scene: UIScene) { + // Called as the scene transitions from the foreground to the background. + // Use this method to save data, release shared resources, and store enough scene-specific state information + // to restore the scene back to its current state. + } + + +} + diff --git a/Fixtures/iOS/AppWithExtensions/MessagesExtension/Assets.xcassets/Contents.json b/Fixtures/iOS/AppWithExtensions/MessagesExtension/Assets.xcassets/Contents.json new file mode 100644 index 000000000..73c00596a --- /dev/null +++ b/Fixtures/iOS/AppWithExtensions/MessagesExtension/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Fixtures/iOS/AppWithExtensions/MessagesExtension/Assets.xcassets/iMessage App Icon.stickersiconset/Contents.json b/Fixtures/iOS/AppWithExtensions/MessagesExtension/Assets.xcassets/iMessage App Icon.stickersiconset/Contents.json new file mode 100644 index 000000000..bc3c4eea7 --- /dev/null +++ b/Fixtures/iOS/AppWithExtensions/MessagesExtension/Assets.xcassets/iMessage App Icon.stickersiconset/Contents.json @@ -0,0 +1,78 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "scale" : "2x", + "size" : "29x29" + }, + { + "idiom" : "iphone", + "scale" : "3x", + "size" : "29x29" + }, + { + "idiom" : "iphone", + "scale" : "2x", + "size" : "60x45" + }, + { + "idiom" : "iphone", + "scale" : "3x", + "size" : "60x45" + }, + { + "idiom" : "ipad", + "scale" : "2x", + "size" : "29x29" + }, + { + "idiom" : "ipad", + "scale" : "2x", + "size" : "67x50" + }, + { + "idiom" : "ipad", + "scale" : "2x", + "size" : "74x55" + }, + { + "idiom" : "ios-marketing", + "scale" : "1x", + "size" : "1024x1024" + }, + { + "idiom" : "universal", + "platform" : "ios", + "scale" : "2x", + "size" : "27x20" + }, + { + "idiom" : "universal", + "platform" : "ios", + "scale" : "3x", + "size" : "27x20" + }, + { + "idiom" : "universal", + "platform" : "ios", + "scale" : "2x", + "size" : "32x24" + }, + { + "idiom" : "universal", + "platform" : "ios", + "scale" : "3x", + "size" : "32x24" + }, + { + "idiom" : "ios-marketing", + "platform" : "ios", + "scale" : "1x", + "size" : "1024x768" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Fixtures/iOS/AppWithExtensions/MessagesExtension/Base.lproj/MainInterface.storyboard b/Fixtures/iOS/AppWithExtensions/MessagesExtension/Base.lproj/MainInterface.storyboard new file mode 100644 index 000000000..36e2d4917 --- /dev/null +++ b/Fixtures/iOS/AppWithExtensions/MessagesExtension/Base.lproj/MainInterface.storyboard @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Fixtures/iOS/AppWithExtensions/MessagesExtension/Info.plist b/Fixtures/iOS/AppWithExtensions/MessagesExtension/Info.plist new file mode 100644 index 000000000..be315f88e --- /dev/null +++ b/Fixtures/iOS/AppWithExtensions/MessagesExtension/Info.plist @@ -0,0 +1,31 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleDisplayName + MessagesExtension + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + $(PRODUCT_BUNDLE_PACKAGE_TYPE) + CFBundleShortVersionString + 1.0 + CFBundleVersion + 1 + NSExtension + + NSExtensionMainStoryboard + MainInterface + NSExtensionPointIdentifier + com.apple.message-payload-provider + + + diff --git a/Fixtures/iOS/AppWithExtensions/MessagesExtension/MessagesViewController.swift b/Fixtures/iOS/AppWithExtensions/MessagesExtension/MessagesViewController.swift new file mode 100644 index 000000000..774e3b9a0 --- /dev/null +++ b/Fixtures/iOS/AppWithExtensions/MessagesExtension/MessagesViewController.swift @@ -0,0 +1,59 @@ +import UIKit +import Messages + +class MessagesViewController: MSMessagesAppViewController { + + override func viewDidLoad() { + super.viewDidLoad() + // Do any additional setup after loading the view. + } + + // MARK: - Conversation Handling + + override func willBecomeActive(with conversation: MSConversation) { + // Called when the extension is about to move from the inactive to active state. + // This will happen when the extension is about to present UI. + + // Use this method to configure the extension and restore previously stored state. + } + + override func didResignActive(with conversation: MSConversation) { + // Called when the extension is about to move from the active to inactive state. + // This will happen when the user dissmises the extension, changes to a different + // conversation or quits Messages. + + // Use this method to release shared resources, save user data, invalidate timers, + // and store enough state information to restore your extension to its current state + // in case it is terminated later. + } + + override func didReceive(_ message: MSMessage, conversation: MSConversation) { + // Called when a message arrives that was generated by another instance of this + // extension on a remote device. + + // Use this method to trigger UI updates in response to the message. + } + + override func didStartSending(_ message: MSMessage, conversation: MSConversation) { + // Called when the user taps the send button. + } + + override func didCancelSending(_ message: MSMessage, conversation: MSConversation) { + // Called when the user deletes the message without sending it. + + // Use this to clean up state related to the deleted message. + } + + override func willTransition(to presentationStyle: MSMessagesAppPresentationStyle) { + // Called before the extension transitions to a new presentation style. + + // Use this method to prepare for the change in presentation style. + } + + override func didTransition(to presentationStyle: MSMessagesAppPresentationStyle) { + // Called after the extension transitions to a new presentation style. + + // Use this method to finalize any behaviors associated with the change in presentation style. + } + +} diff --git a/Fixtures/iOS/AppWithExtensions/TodayViewExtension/Base.lproj/MainInterface.storyboard b/Fixtures/iOS/AppWithExtensions/TodayViewExtension/Base.lproj/MainInterface.storyboard new file mode 100644 index 000000000..6ed74344e --- /dev/null +++ b/Fixtures/iOS/AppWithExtensions/TodayViewExtension/Base.lproj/MainInterface.storyboard @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Fixtures/iOS/AppWithExtensions/TodayViewExtension/Info.plist b/Fixtures/iOS/AppWithExtensions/TodayViewExtension/Info.plist new file mode 100644 index 000000000..2d0c77cc0 --- /dev/null +++ b/Fixtures/iOS/AppWithExtensions/TodayViewExtension/Info.plist @@ -0,0 +1,31 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleDisplayName + TodayViewExtension + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + $(PRODUCT_BUNDLE_PACKAGE_TYPE) + CFBundleShortVersionString + 1.0 + CFBundleVersion + 1 + NSExtension + + NSExtensionMainStoryboard + MainInterface + NSExtensionPointIdentifier + com.apple.widget-extension + + + diff --git a/Fixtures/iOS/AppWithExtensions/TodayViewExtension/TodayViewController.swift b/Fixtures/iOS/AppWithExtensions/TodayViewExtension/TodayViewController.swift new file mode 100644 index 000000000..a204fa228 --- /dev/null +++ b/Fixtures/iOS/AppWithExtensions/TodayViewExtension/TodayViewController.swift @@ -0,0 +1,21 @@ +import UIKit +import NotificationCenter + +class TodayViewController: UIViewController, NCWidgetProviding { + + override func viewDidLoad() { + super.viewDidLoad() + // Do any additional setup after loading the view. + } + + func widgetPerformUpdate(completionHandler: (@escaping (NCUpdateResult) -> Void)) { + // Perform any setup necessary in order to update the view. + + // If an error is encountered, use NCUpdateResult.Failed + // If there's no update required, use NCUpdateResult.NoData + // If there's an update, use NCUpdateResult.NewData + + completionHandler(NCUpdateResult.newData) + } + +} diff --git a/Fixtures/iOS/AppWithExtensions/WatchApp Extension/Assets.xcassets/Complication.complicationset/Circular.imageset/Contents.json b/Fixtures/iOS/AppWithExtensions/WatchApp Extension/Assets.xcassets/Complication.complicationset/Circular.imageset/Contents.json new file mode 100644 index 000000000..ed7de25e5 --- /dev/null +++ b/Fixtures/iOS/AppWithExtensions/WatchApp Extension/Assets.xcassets/Complication.complicationset/Circular.imageset/Contents.json @@ -0,0 +1,28 @@ +{ + "images" : [ + { + "idiom" : "watch", + "scale" : "2x", + "screen-width" : "<=145" + }, + { + "idiom" : "watch", + "scale" : "2x", + "screen-width" : ">161" + }, + { + "idiom" : "watch", + "scale" : "2x", + "screen-width" : ">145" + }, + { + "idiom" : "watch", + "scale" : "2x", + "screen-width" : ">183" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Fixtures/iOS/AppWithExtensions/WatchApp Extension/Assets.xcassets/Complication.complicationset/Contents.json b/Fixtures/iOS/AppWithExtensions/WatchApp Extension/Assets.xcassets/Complication.complicationset/Contents.json new file mode 100644 index 000000000..df73a6bba --- /dev/null +++ b/Fixtures/iOS/AppWithExtensions/WatchApp Extension/Assets.xcassets/Complication.complicationset/Contents.json @@ -0,0 +1,48 @@ +{ + "assets" : [ + { + "filename" : "Circular.imageset", + "idiom" : "watch", + "role" : "circular" + }, + { + "filename" : "Extra Large.imageset", + "idiom" : "watch", + "role" : "extra-large" + }, + { + "filename" : "Graphic Bezel.imageset", + "idiom" : "watch", + "role" : "graphic-bezel" + }, + { + "filename" : "Graphic Circular.imageset", + "idiom" : "watch", + "role" : "graphic-circular" + }, + { + "filename" : "Graphic Corner.imageset", + "idiom" : "watch", + "role" : "graphic-corner" + }, + { + "filename" : "Graphic Large Rectangular.imageset", + "idiom" : "watch", + "role" : "graphic-large-rectangular" + }, + { + "filename" : "Modular.imageset", + "idiom" : "watch", + "role" : "modular" + }, + { + "filename" : "Utilitarian.imageset", + "idiom" : "watch", + "role" : "utilitarian" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Fixtures/iOS/AppWithExtensions/WatchApp Extension/Assets.xcassets/Complication.complicationset/Extra Large.imageset/Contents.json b/Fixtures/iOS/AppWithExtensions/WatchApp Extension/Assets.xcassets/Complication.complicationset/Extra Large.imageset/Contents.json new file mode 100644 index 000000000..ed7de25e5 --- /dev/null +++ b/Fixtures/iOS/AppWithExtensions/WatchApp Extension/Assets.xcassets/Complication.complicationset/Extra Large.imageset/Contents.json @@ -0,0 +1,28 @@ +{ + "images" : [ + { + "idiom" : "watch", + "scale" : "2x", + "screen-width" : "<=145" + }, + { + "idiom" : "watch", + "scale" : "2x", + "screen-width" : ">161" + }, + { + "idiom" : "watch", + "scale" : "2x", + "screen-width" : ">145" + }, + { + "idiom" : "watch", + "scale" : "2x", + "screen-width" : ">183" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Fixtures/iOS/AppWithExtensions/WatchApp Extension/Assets.xcassets/Complication.complicationset/Graphic Bezel.imageset/Contents.json b/Fixtures/iOS/AppWithExtensions/WatchApp Extension/Assets.xcassets/Complication.complicationset/Graphic Bezel.imageset/Contents.json new file mode 100644 index 000000000..ed7de25e5 --- /dev/null +++ b/Fixtures/iOS/AppWithExtensions/WatchApp Extension/Assets.xcassets/Complication.complicationset/Graphic Bezel.imageset/Contents.json @@ -0,0 +1,28 @@ +{ + "images" : [ + { + "idiom" : "watch", + "scale" : "2x", + "screen-width" : "<=145" + }, + { + "idiom" : "watch", + "scale" : "2x", + "screen-width" : ">161" + }, + { + "idiom" : "watch", + "scale" : "2x", + "screen-width" : ">145" + }, + { + "idiom" : "watch", + "scale" : "2x", + "screen-width" : ">183" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Fixtures/iOS/AppWithExtensions/WatchApp Extension/Assets.xcassets/Complication.complicationset/Graphic Circular.imageset/Contents.json b/Fixtures/iOS/AppWithExtensions/WatchApp Extension/Assets.xcassets/Complication.complicationset/Graphic Circular.imageset/Contents.json new file mode 100644 index 000000000..ed7de25e5 --- /dev/null +++ b/Fixtures/iOS/AppWithExtensions/WatchApp Extension/Assets.xcassets/Complication.complicationset/Graphic Circular.imageset/Contents.json @@ -0,0 +1,28 @@ +{ + "images" : [ + { + "idiom" : "watch", + "scale" : "2x", + "screen-width" : "<=145" + }, + { + "idiom" : "watch", + "scale" : "2x", + "screen-width" : ">161" + }, + { + "idiom" : "watch", + "scale" : "2x", + "screen-width" : ">145" + }, + { + "idiom" : "watch", + "scale" : "2x", + "screen-width" : ">183" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Fixtures/iOS/AppWithExtensions/WatchApp Extension/Assets.xcassets/Complication.complicationset/Graphic Corner.imageset/Contents.json b/Fixtures/iOS/AppWithExtensions/WatchApp Extension/Assets.xcassets/Complication.complicationset/Graphic Corner.imageset/Contents.json new file mode 100644 index 000000000..ed7de25e5 --- /dev/null +++ b/Fixtures/iOS/AppWithExtensions/WatchApp Extension/Assets.xcassets/Complication.complicationset/Graphic Corner.imageset/Contents.json @@ -0,0 +1,28 @@ +{ + "images" : [ + { + "idiom" : "watch", + "scale" : "2x", + "screen-width" : "<=145" + }, + { + "idiom" : "watch", + "scale" : "2x", + "screen-width" : ">161" + }, + { + "idiom" : "watch", + "scale" : "2x", + "screen-width" : ">145" + }, + { + "idiom" : "watch", + "scale" : "2x", + "screen-width" : ">183" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Fixtures/iOS/AppWithExtensions/WatchApp Extension/Assets.xcassets/Complication.complicationset/Graphic Large Rectangular.imageset/Contents.json b/Fixtures/iOS/AppWithExtensions/WatchApp Extension/Assets.xcassets/Complication.complicationset/Graphic Large Rectangular.imageset/Contents.json new file mode 100644 index 000000000..ed7de25e5 --- /dev/null +++ b/Fixtures/iOS/AppWithExtensions/WatchApp Extension/Assets.xcassets/Complication.complicationset/Graphic Large Rectangular.imageset/Contents.json @@ -0,0 +1,28 @@ +{ + "images" : [ + { + "idiom" : "watch", + "scale" : "2x", + "screen-width" : "<=145" + }, + { + "idiom" : "watch", + "scale" : "2x", + "screen-width" : ">161" + }, + { + "idiom" : "watch", + "scale" : "2x", + "screen-width" : ">145" + }, + { + "idiom" : "watch", + "scale" : "2x", + "screen-width" : ">183" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Fixtures/iOS/AppWithExtensions/WatchApp Extension/Assets.xcassets/Complication.complicationset/Modular.imageset/Contents.json b/Fixtures/iOS/AppWithExtensions/WatchApp Extension/Assets.xcassets/Complication.complicationset/Modular.imageset/Contents.json new file mode 100644 index 000000000..ed7de25e5 --- /dev/null +++ b/Fixtures/iOS/AppWithExtensions/WatchApp Extension/Assets.xcassets/Complication.complicationset/Modular.imageset/Contents.json @@ -0,0 +1,28 @@ +{ + "images" : [ + { + "idiom" : "watch", + "scale" : "2x", + "screen-width" : "<=145" + }, + { + "idiom" : "watch", + "scale" : "2x", + "screen-width" : ">161" + }, + { + "idiom" : "watch", + "scale" : "2x", + "screen-width" : ">145" + }, + { + "idiom" : "watch", + "scale" : "2x", + "screen-width" : ">183" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Fixtures/iOS/AppWithExtensions/WatchApp Extension/Assets.xcassets/Complication.complicationset/Utilitarian.imageset/Contents.json b/Fixtures/iOS/AppWithExtensions/WatchApp Extension/Assets.xcassets/Complication.complicationset/Utilitarian.imageset/Contents.json new file mode 100644 index 000000000..ed7de25e5 --- /dev/null +++ b/Fixtures/iOS/AppWithExtensions/WatchApp Extension/Assets.xcassets/Complication.complicationset/Utilitarian.imageset/Contents.json @@ -0,0 +1,28 @@ +{ + "images" : [ + { + "idiom" : "watch", + "scale" : "2x", + "screen-width" : "<=145" + }, + { + "idiom" : "watch", + "scale" : "2x", + "screen-width" : ">161" + }, + { + "idiom" : "watch", + "scale" : "2x", + "screen-width" : ">145" + }, + { + "idiom" : "watch", + "scale" : "2x", + "screen-width" : ">183" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Fixtures/iOS/AppWithExtensions/WatchApp Extension/Assets.xcassets/Contents.json b/Fixtures/iOS/AppWithExtensions/WatchApp Extension/Assets.xcassets/Contents.json new file mode 100644 index 000000000..73c00596a --- /dev/null +++ b/Fixtures/iOS/AppWithExtensions/WatchApp Extension/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Fixtures/iOS/AppWithExtensions/WatchApp Extension/ContentView.swift b/Fixtures/iOS/AppWithExtensions/WatchApp Extension/ContentView.swift new file mode 100644 index 000000000..dfe33f922 --- /dev/null +++ b/Fixtures/iOS/AppWithExtensions/WatchApp Extension/ContentView.swift @@ -0,0 +1,13 @@ +import SwiftUI + +struct ContentView: View { + var body: some View { + Text("Hello, World!") + } +} + +struct ContentView_Previews: PreviewProvider { + static var previews: some View { + ContentView() + } +} diff --git a/Fixtures/iOS/AppWithExtensions/WatchApp Extension/ExtensionDelegate.swift b/Fixtures/iOS/AppWithExtensions/WatchApp Extension/ExtensionDelegate.swift new file mode 100644 index 000000000..320f84a6b --- /dev/null +++ b/Fixtures/iOS/AppWithExtensions/WatchApp Extension/ExtensionDelegate.swift @@ -0,0 +1,48 @@ +import WatchKit + +class ExtensionDelegate: NSObject, WKExtensionDelegate { + + func applicationDidFinishLaunching() { + // Perform any final initialization of your application. + } + + func applicationDidBecomeActive() { + // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. + } + + func applicationWillResignActive() { + // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. + // Use this method to pause ongoing tasks, disable timers, etc. + } + + func handle(_ backgroundTasks: Set) { + // Sent when the system needs to launch the application in the background to process tasks. Tasks arrive in a set, so loop through and process each one. + for task in backgroundTasks { + // Use a switch statement to check the task type + switch task { + case let backgroundTask as WKApplicationRefreshBackgroundTask: + // Be sure to complete the background task once you’re done. + backgroundTask.setTaskCompletedWithSnapshot(false) + case let snapshotTask as WKSnapshotRefreshBackgroundTask: + // Snapshot tasks have a unique completion call, make sure to set your expiration date + snapshotTask.setTaskCompleted(restoredDefaultState: true, estimatedSnapshotExpiration: Date.distantFuture, userInfo: nil) + case let connectivityTask as WKWatchConnectivityRefreshBackgroundTask: + // Be sure to complete the connectivity task once you’re done. + connectivityTask.setTaskCompletedWithSnapshot(false) + case let urlSessionTask as WKURLSessionRefreshBackgroundTask: + // Be sure to complete the URL session task once you’re done. + urlSessionTask.setTaskCompletedWithSnapshot(false) + case let relevantShortcutTask as WKRelevantShortcutRefreshBackgroundTask: + // Be sure to complete the relevant-shortcut task once you're done. + relevantShortcutTask.setTaskCompletedWithSnapshot(false) + case let intentDidRunTask as WKIntentDidRunRefreshBackgroundTask: + // Be sure to complete the intent-did-run task once you're done. + intentDidRunTask.setTaskCompletedWithSnapshot(false) + default: + // make sure to complete unhandled task types + task.setTaskCompletedWithSnapshot(false) + } + } + } + +} diff --git a/Fixtures/iOS/AppWithExtensions/WatchApp Extension/HostingController.swift b/Fixtures/iOS/AppWithExtensions/WatchApp Extension/HostingController.swift new file mode 100644 index 000000000..76bc329da --- /dev/null +++ b/Fixtures/iOS/AppWithExtensions/WatchApp Extension/HostingController.swift @@ -0,0 +1,9 @@ +import WatchKit +import Foundation +import SwiftUI + +class HostingController: WKHostingController { + override var body: ContentView { + return ContentView() + } +} diff --git a/Fixtures/iOS/AppWithExtensions/WatchApp Extension/Info.plist b/Fixtures/iOS/AppWithExtensions/WatchApp Extension/Info.plist new file mode 100644 index 000000000..1a922d13c --- /dev/null +++ b/Fixtures/iOS/AppWithExtensions/WatchApp Extension/Info.plist @@ -0,0 +1,36 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleDisplayName + WatchApp Extension + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + $(PRODUCT_BUNDLE_PACKAGE_TYPE) + CFBundleShortVersionString + 1.0 + CFBundleVersion + 1 + NSExtension + + NSExtensionAttributes + + WKAppBundleIdentifier + io.tuist.xcodeproj.fixtures.AppWithExtensions.watchkitapp + + NSExtensionPointIdentifier + com.apple.watchkit + + WKExtensionDelegateClassName + $(PRODUCT_MODULE_NAME).ExtensionDelegate + + diff --git a/Fixtures/iOS/AppWithExtensions/WatchApp Extension/NotificationController.swift b/Fixtures/iOS/AppWithExtensions/WatchApp Extension/NotificationController.swift new file mode 100644 index 000000000..73fceb36b --- /dev/null +++ b/Fixtures/iOS/AppWithExtensions/WatchApp Extension/NotificationController.swift @@ -0,0 +1,26 @@ +import WatchKit +import SwiftUI +import UserNotifications + +class NotificationController: WKUserNotificationHostingController { + + override var body: NotificationView { + return NotificationView() + } + + override func willActivate() { + // This method is called when watch view controller is about to be visible to user + super.willActivate() + } + + override func didDeactivate() { + // This method is called when watch view controller is no longer visible + super.didDeactivate() + } + + override func didReceive(_ notification: UNNotification) { + // This method is called when a notification needs to be presented. + // Implement it if you use a dynamic notification interface. + // Populate your dynamic notification interface as quickly as possible. + } +} diff --git a/Fixtures/iOS/AppWithExtensions/WatchApp Extension/NotificationView.swift b/Fixtures/iOS/AppWithExtensions/WatchApp Extension/NotificationView.swift new file mode 100644 index 000000000..63211dd15 --- /dev/null +++ b/Fixtures/iOS/AppWithExtensions/WatchApp Extension/NotificationView.swift @@ -0,0 +1,13 @@ +import SwiftUI + +struct NotificationView: View { + var body: some View { + Text("Hello, World!") + } +} + +struct NotificationView_Previews: PreviewProvider { + static var previews: some View { + NotificationView() + } +} diff --git a/Fixtures/iOS/AppWithExtensions/WatchApp Extension/Preview Content/Preview Assets.xcassets/Contents.json b/Fixtures/iOS/AppWithExtensions/WatchApp Extension/Preview Content/Preview Assets.xcassets/Contents.json new file mode 100644 index 000000000..73c00596a --- /dev/null +++ b/Fixtures/iOS/AppWithExtensions/WatchApp Extension/Preview Content/Preview Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Fixtures/iOS/AppWithExtensions/WatchApp Extension/PushNotificationPayload.apns b/Fixtures/iOS/AppWithExtensions/WatchApp Extension/PushNotificationPayload.apns new file mode 100644 index 000000000..c18b00ad9 --- /dev/null +++ b/Fixtures/iOS/AppWithExtensions/WatchApp Extension/PushNotificationPayload.apns @@ -0,0 +1,20 @@ +{ + "aps": { + "alert": { + "body": "Test message", + "title": "Optional title", + "subtitle": "Optional subtitle" + }, + "category": "myCategory", + "thread-id": "5280" + }, + + "WatchKit Simulator Actions": [ + { + "title": "First Button", + "identifier": "firstButtonAction" + } + ], + + "customKey": "Use this file to define a testing payload for your notifications. The aps dictionary specifies the category, alert text and title. The WatchKit Simulator Actions array can provide info for one or more action buttons in addition to the standard Dismiss button. Any other top level keys are custom payload. If you have multiple such JSON files in your project, you'll be able to select them when choosing to debug the notification interface of your Watch App." +} diff --git a/Fixtures/iOS/AppWithExtensions/WatchApp/Assets.xcassets/AppIcon.appiconset/Contents.json b/Fixtures/iOS/AppWithExtensions/WatchApp/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 000000000..d06b66af9 --- /dev/null +++ b/Fixtures/iOS/AppWithExtensions/WatchApp/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,81 @@ +{ + "images" : [ + { + "idiom" : "watch", + "role" : "notificationCenter", + "scale" : "2x", + "size" : "24x24", + "subtype" : "38mm" + }, + { + "idiom" : "watch", + "role" : "notificationCenter", + "scale" : "2x", + "size" : "27.5x27.5", + "subtype" : "42mm" + }, + { + "idiom" : "watch", + "role" : "companionSettings", + "scale" : "2x", + "size" : "29x29" + }, + { + "idiom" : "watch", + "role" : "companionSettings", + "scale" : "3x", + "size" : "29x29" + }, + { + "idiom" : "watch", + "role" : "appLauncher", + "scale" : "2x", + "size" : "40x40", + "subtype" : "38mm" + }, + { + "idiom" : "watch", + "role" : "appLauncher", + "scale" : "2x", + "size" : "44x44", + "subtype" : "40mm" + }, + { + "idiom" : "watch", + "role" : "appLauncher", + "scale" : "2x", + "size" : "50x50", + "subtype" : "44mm" + }, + { + "idiom" : "watch", + "role" : "quickLook", + "scale" : "2x", + "size" : "86x86", + "subtype" : "38mm" + }, + { + "idiom" : "watch", + "role" : "quickLook", + "scale" : "2x", + "size" : "98x98", + "subtype" : "42mm" + }, + { + "idiom" : "watch", + "role" : "quickLook", + "scale" : "2x", + "size" : "108x108", + "subtype" : "44mm" + }, + { + "idiom" : "watch-marketing", + "scale" : "1x", + "size" : "1024x1024" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Fixtures/iOS/AppWithExtensions/WatchApp/Assets.xcassets/Contents.json b/Fixtures/iOS/AppWithExtensions/WatchApp/Assets.xcassets/Contents.json new file mode 100644 index 000000000..73c00596a --- /dev/null +++ b/Fixtures/iOS/AppWithExtensions/WatchApp/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Fixtures/iOS/AppWithExtensions/WatchApp/Base.lproj/Interface.storyboard b/Fixtures/iOS/AppWithExtensions/WatchApp/Base.lproj/Interface.storyboard new file mode 100644 index 000000000..aa3bd9c21 --- /dev/null +++ b/Fixtures/iOS/AppWithExtensions/WatchApp/Base.lproj/Interface.storyboard @@ -0,0 +1,42 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Fixtures/iOS/AppWithExtensions/WatchApp/Info.plist b/Fixtures/iOS/AppWithExtensions/WatchApp/Info.plist new file mode 100644 index 000000000..f67806d50 --- /dev/null +++ b/Fixtures/iOS/AppWithExtensions/WatchApp/Info.plist @@ -0,0 +1,33 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleDisplayName + AppWithExtensions + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + $(PRODUCT_BUNDLE_PACKAGE_TYPE) + CFBundleShortVersionString + 1.0 + CFBundleVersion + 1 + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + + WKCompanionAppBundleIdentifier + io.tuist.xcodeproj.fixtures.AppWithExtensions + WKWatchKitApp + + + diff --git a/Sources/XcodeProj/Scheme/XCScheme+RemoteRunnable.swift b/Sources/XcodeProj/Scheme/XCScheme+RemoteRunnable.swift index 6818c3215..a02fea6f7 100644 --- a/Sources/XcodeProj/Scheme/XCScheme+RemoteRunnable.swift +++ b/Sources/XcodeProj/Scheme/XCScheme+RemoteRunnable.swift @@ -6,19 +6,23 @@ extension XCScheme { // MARK: - Attributes public var bundleIdentifier: String + public var remotePath: String? // MARK: - Init public init(buildableReference: BuildableReference, bundleIdentifier: String, - runnableDebuggingMode: String = "0") { + runnableDebuggingMode: String = "0", + remotePath: String? = nil) { self.bundleIdentifier = bundleIdentifier + self.remotePath = remotePath super.init(buildableReference: buildableReference, runnableDebuggingMode: runnableDebuggingMode) } override init(element: AEXMLElement) throws { bundleIdentifier = element.attributes["BundleIdentifier"] ?? "" + remotePath = element.attributes["RemotePath"] try super.init(element: element) } @@ -28,15 +32,23 @@ extension XCScheme { let element = super.xmlElement() element.name = "RemoteRunnable" element.attributes["BundleIdentifier"] = bundleIdentifier + element.attributes["RemotePath"] = remotePath return element } // MARK: - Equatable + override func isEqual(other: XCScheme.Runnable) -> Bool { + guard let other = other as? RemoteRunnable else { + return false + } + + return super.isEqual(other: other) && + bundleIdentifier == other.bundleIdentifier && + remotePath == other.remotePath + } public static func == (lhs: RemoteRunnable, rhs: RemoteRunnable) -> Bool { - return lhs.runnableDebuggingMode == rhs.runnableDebuggingMode && - lhs.bundleIdentifier == rhs.bundleIdentifier && - lhs.buildableReference == rhs.buildableReference + return lhs.isEqual(other: rhs) && rhs.isEqual(other: lhs) } } } diff --git a/Sources/XcodeProj/Scheme/XCScheme+Runnable.swift b/Sources/XcodeProj/Scheme/XCScheme+Runnable.swift index eaa96894b..8b004b109 100644 --- a/Sources/XcodeProj/Scheme/XCScheme+Runnable.swift +++ b/Sources/XcodeProj/Scheme/XCScheme+Runnable.swift @@ -32,10 +32,13 @@ extension XCScheme { } // MARK: - Equatable + func isEqual(other: Runnable) -> Bool { + return runnableDebuggingMode == other.runnableDebuggingMode && + buildableReference == other.buildableReference + } public static func == (lhs: Runnable, rhs: Runnable) -> Bool { - return lhs.runnableDebuggingMode == rhs.runnableDebuggingMode && - lhs.buildableReference == rhs.buildableReference + return lhs.isEqual(other: rhs) && rhs.isEqual(other: lhs) } } } diff --git a/Tests/XcodeProjTests/Scheme/XCSchemeTests.swift b/Tests/XcodeProjTests/Scheme/XCSchemeTests.swift index 9d48fd32a..b56b3d206 100644 --- a/Tests/XcodeProjTests/Scheme/XCSchemeTests.swift +++ b/Tests/XcodeProjTests/Scheme/XCSchemeTests.swift @@ -142,6 +142,77 @@ final class XCSchemeIntegrationTests: XCTestCase { XCTAssertEqual(subject, reconstructedSubject) } + func test_scheme_remoteRunnable() throws { + // Given / When + let subject = try XCScheme(path: watchAppSchemePath) + + // Then + let launchAction = try XCTUnwrap(subject.launchAction) + let remoteRunnable = try XCTUnwrap(launchAction.runnable as? XCScheme.RemoteRunnable) + XCTAssertEqual(remoteRunnable.bundleIdentifier, "com.apple.Carousel") + XCTAssertEqual(remoteRunnable.runnableDebuggingMode, "2") + XCTAssertEqual(remoteRunnable.remotePath, "/AppWithExtensions") + } + + func test_launchAction_remoteRunnable_serializingAndDeserializing() throws { + // Given + let buildableReference = try buildableReferenceWithStringBluePrint() + let remoteRunnable = XCScheme.RemoteRunnable(buildableReference: buildableReference, + bundleIdentifier: "io.tuist", + remotePath: "/Some/Path") + let subject = XCScheme.LaunchAction(runnable: remoteRunnable, + buildConfiguration: "Debug") + + // When + let element = subject.xmlElement() + let reconstructedSubject = try XCScheme.LaunchAction(element: element) + + // Then + XCTAssertEqual(reconstructedSubject, subject) + } + + func test_runnable_equtable() throws { + // Given + let buildableReferenceA = try buildableReferenceWithStringBluePrint(name: "A") + let buildableReferenceB = try buildableReferenceWithStringBluePrint(name: "B") + let remoteRunnableA1 = XCScheme.RemoteRunnable(buildableReference: buildableReferenceA, + bundleIdentifier: "io.tuist", + runnableDebuggingMode: "0", + remotePath: "/Some/Path") + let remoteRunnableA2 = XCScheme.RemoteRunnable(buildableReference: buildableReferenceA, + bundleIdentifier: "io.tuist", + runnableDebuggingMode: "0", + remotePath: "/Some/Path") + let remoteRunnableA3 = XCScheme.RemoteRunnable(buildableReference: buildableReferenceA, + bundleIdentifier: "io.another.tuist", + runnableDebuggingMode: "2", + remotePath: "/Some/Other/Path") + let remoteRunnableB = XCScheme.RemoteRunnable(buildableReference: buildableReferenceB, + bundleIdentifier: "io.tuist", + runnableDebuggingMode: "0", + remotePath: "/Some/Path") + + let runnableA1 = XCScheme.Runnable(buildableReference: buildableReferenceA, + runnableDebuggingMode: "0") + let runnableA2 = XCScheme.Runnable(buildableReference: buildableReferenceA, + runnableDebuggingMode: "0") + let runnableA3 = XCScheme.Runnable(buildableReference: buildableReferenceA, + runnableDebuggingMode: "2") + let runnableB = XCScheme.Runnable(buildableReference: buildableReferenceB, + runnableDebuggingMode: "0") + + // When / Then + XCTAssertEqual(remoteRunnableA1, remoteRunnableA2) + XCTAssertNotEqual(remoteRunnableA1, remoteRunnableA3) + XCTAssertNotEqual(remoteRunnableA1, remoteRunnableB) + XCTAssertNotEqual(remoteRunnableA1, runnableA1) + + XCTAssertEqual(runnableA1, runnableA2) + XCTAssertNotEqual(runnableA1, runnableA3) + XCTAssertNotEqual(runnableA1, runnableB) + XCTAssertNotEqual(runnableA1, remoteRunnableA1) + } + // MARK: - Private private func assert(scheme: XCScheme) { @@ -393,6 +464,19 @@ final class XCSchemeIntegrationTests: XCTestCase { XCTAssertNil(scheme.archiveAction?.customArchiveName) } + private func buildableReferenceWithStringBluePrint(name: String = "App") throws -> XCScheme.BuildableReference { + // To allow performing comparisons when serializing / deserializing we need a + // buildable reference that contains a `.string` blue print + let buildableReference = XCScheme.BuildableReference( + referencedContainer: "\(name).xcodeproj", + blueprint: PBXObject(), + buildableName: name, + blueprintName: name + ) + let xmlElement = buildableReference.xmlElement() + return try XCScheme.BuildableReference(element: xmlElement) + } + private var iosSchemePath: Path { return fixturesPath() + "iOS/Project.xcodeproj/xcshareddata/xcschemes/iOS.xcscheme" } @@ -402,4 +486,8 @@ final class XCSchemeIntegrationTests: XCTestCase { // but minimal in the sense it doesn't have most of the standard elements and attributes. return fixturesPath() + "Schemes/MinimalInformation.xcscheme" } + + private var watchAppSchemePath: Path { + return fixturesPath() + "iOS/AppWithExtensions/AppWithExtensions.xcodeproj/xcshareddata/xcschemes/WatchApp.xcscheme" + } } From 545bfa746b6eb4ea0ad8d3a12c6590445392bb50 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20Pi=C3=B1era?= Date: Tue, 14 Jul 2020 06:48:59 +0200 Subject: [PATCH 070/678] Version 7.13.0 --- CHANGELOG.md | 2 ++ README.md | 4 ++-- XcodeProj_Carthage.xcworkspace/.tuist-generated | 0 xcodeproj.podspec | 2 +- 4 files changed, 5 insertions(+), 3 deletions(-) create mode 100644 XcodeProj_Carthage.xcworkspace/.tuist-generated diff --git a/CHANGELOG.md b/CHANGELOG.md index c3a9c5c03..22a706880 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ ## Next +## 7.13.0 + ### Added - Support `on-demand-install-capable` application https://github.com/tuist/XcodeProj/pull/554 by @d-date - Add RemotePath to RemoteRunnable https://github.com/tuist/XcodeProj/pull/555 by @kwridan diff --git a/README.md b/README.md index 2608221df..199f0d49a 100644 --- a/README.md +++ b/README.md @@ -37,7 +37,7 @@ Add the dependency in your `Package.swift` file: let package = Package( name: "myproject", dependencies: [ - .package(url: "https://github.com/tuist/xcodeproj.git", .upToNextMajor(from: "7.12.0")) + .package(url: "https://github.com/tuist/xcodeproj.git", .upToNextMajor(from: "7.13.0")) ], targets: [ .target( @@ -59,7 +59,7 @@ github "tuist/xcodeproj" ~> 7.11. ### CocoaPods ```ruby -pod 'xcodeproj', '~> 7.12.0 +pod 'xcodeproj', '~> 7.13.0 ``` ### Scripting diff --git a/XcodeProj_Carthage.xcworkspace/.tuist-generated b/XcodeProj_Carthage.xcworkspace/.tuist-generated new file mode 100644 index 000000000..e69de29bb diff --git a/xcodeproj.podspec b/xcodeproj.podspec index 63a1badbf..6cc2675b0 100644 --- a/xcodeproj.podspec +++ b/xcodeproj.podspec @@ -1,7 +1,7 @@ Pod::Spec.new do |s| s.name = "xcodeproj" - s.version = "7.12.0" + s.version = "7.13.0" s.summary = "Read/Modify/Write your Xcode projects" s.homepage = "https://github.com/tuist/xcodeproj" s.license = 'MIT' From 8e7f64669b418bf1ac23d0ee40158da665937af8 Mon Sep 17 00:00:00 2001 From: Adam Khazi Date: Tue, 21 Jul 2020 07:07:44 +0100 Subject: [PATCH 071/678] Add `sqlite` and `ttf` file types (#557) * add sqlite and ttf file types * changelog * changelog entry moved to next section --- CHANGELOG.md | 3 +++ Sources/XcodeProj/Project/Xcode.swift | 2 ++ 2 files changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 22a706880..da4f61836 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,9 @@ ## Next +### Fixed +- lastKnownFileType for .ttf and .sqlite files https://github.com/tuist/XcodeProj/pull/557 by @adamkhazi + ## 7.13.0 ### Added diff --git a/Sources/XcodeProj/Project/Xcode.swift b/Sources/XcodeProj/Project/Xcode.swift index 24c075f89..53c8445c4 100644 --- a/Sources/XcodeProj/Project/Xcode.swift +++ b/Sources/XcodeProj/Project/Xcode.swift @@ -271,6 +271,7 @@ public struct Xcode { "sit": "archive.stuffit", "sks": "file.sks", "skybox": "file.skybox", + "sqlite": "file", "storyboard": "file.storyboard", "storyboardc": "wrapper.storyboardc", "strings": "text.plist.strings", @@ -283,6 +284,7 @@ public struct Xcode { "text": "net.daringfireball.markdown", "tif": "image.tiff", "tiff": "image.tiff", + "ttf": "file", "txt": "text", "uicatalog": "file.uicatalog", "usdz": "file.usdz", From e928ecfda522b16a79739fa9ad43b0cba3f4244e Mon Sep 17 00:00:00 2001 From: Semavin Artem Date: Tue, 21 Jul 2020 09:09:09 +0300 Subject: [PATCH 072/678] Added selectedTests attribute to XCScheme.TestableReference (#559) * Created selectedTests option for TestableReference * TestableReference logic refactoring * renamed SelectedTests test for TestableReference Co-authored-by: Artem Semavin --- ...pedTests.swift => XCScheme+TestItem.swift} | 4 +- .../Scheme/XCScheme+TestableReference.swift | 40 ++++++++++++++----- .../XcodeProjTests/Scheme/XCSchemeTests.swift | 36 ++++++++++++++++- 3 files changed, 67 insertions(+), 13 deletions(-) rename Sources/XcodeProj/Scheme/{XCScheme+SkippedTests.swift => XCScheme+TestItem.swift} (84%) diff --git a/Sources/XcodeProj/Scheme/XCScheme+SkippedTests.swift b/Sources/XcodeProj/Scheme/XCScheme+TestItem.swift similarity index 84% rename from Sources/XcodeProj/Scheme/XCScheme+SkippedTests.swift rename to Sources/XcodeProj/Scheme/XCScheme+TestItem.swift index 5e5e77e0b..cf295cca1 100644 --- a/Sources/XcodeProj/Scheme/XCScheme+SkippedTests.swift +++ b/Sources/XcodeProj/Scheme/XCScheme+TestItem.swift @@ -2,7 +2,7 @@ import AEXML import Foundation extension XCScheme { - public final class SkippedTest: Equatable { + public final class TestItem: Equatable { // MARK: - Attributes public var identifier: String @@ -27,7 +27,7 @@ extension XCScheme { // MARK: - Equatable - public static func == (lhs: SkippedTest, rhs: SkippedTest) -> Bool { + public static func == (lhs: TestItem, rhs: TestItem) -> Bool { return lhs.identifier == rhs.identifier } } diff --git a/Sources/XcodeProj/Scheme/XCScheme+TestableReference.swift b/Sources/XcodeProj/Scheme/XCScheme+TestableReference.swift index 9c644ea1b..ff9755435 100644 --- a/Sources/XcodeProj/Scheme/XCScheme+TestableReference.swift +++ b/Sources/XcodeProj/Scheme/XCScheme+TestableReference.swift @@ -10,7 +10,8 @@ extension XCScheme { public var randomExecutionOrdering: Bool public var useTestSelectionWhitelist: Bool? public var buildableReference: BuildableReference - public var skippedTests: [SkippedTest] + public var skippedTests: [TestItem] + public var selectedTests: [TestItem] // MARK: - Init @@ -18,14 +19,16 @@ extension XCScheme { parallelizable: Bool = false, randomExecutionOrdering: Bool = false, buildableReference: BuildableReference, - skippedTests: [SkippedTest] = [], + skippedTests: [TestItem] = [], + selectedTests: [TestItem] = [], useTestSelectionWhitelist: Bool? = nil) { self.skipped = skipped self.parallelizable = parallelizable self.randomExecutionOrdering = randomExecutionOrdering self.buildableReference = buildableReference - self.skippedTests = skippedTests self.useTestSelectionWhitelist = useTestSelectionWhitelist + self.selectedTests = selectedTests + self.skippedTests = skippedTests } init(element: AEXMLElement) throws { @@ -34,8 +37,14 @@ extension XCScheme { useTestSelectionWhitelist = element.attributes["useTestSelectionWhitelist"] == "YES" randomExecutionOrdering = element.attributes["testExecutionOrdering"] == "random" buildableReference = try BuildableReference(element: element["BuildableReference"]) - if let skippedTests = element["SkippedTests"]["Test"].all, !skippedTests.isEmpty { - self.skippedTests = try skippedTests.map(SkippedTest.init) + + if let selectedTests = element["SelectedTests"]["Test"].all { + self.selectedTests = try selectedTests.map(TestItem.init) + } else { + selectedTests = [] + } + if let skippedTests = element["SkippedTests"]["Test"].all { + self.skippedTests = try skippedTests.map(TestItem.init) } else { skippedTests = [] } @@ -54,10 +63,20 @@ extension XCScheme { value: nil, attributes: attributes) element.addChild(buildableReference.xmlElement()) - if !skippedTests.isEmpty { - let skippedTestsElement = element.addChild(name: "SkippedTests") - skippedTests.forEach { skippedTest in - skippedTestsElement.addChild(skippedTest.xmlElement()) + + if useTestSelectionWhitelist == true { + if !selectedTests.isEmpty { + let selectedTestsElement = element.addChild(name: "SelectedTests") + selectedTests.forEach { selectedTest in + selectedTestsElement.addChild(selectedTest.xmlElement()) + } + } + } else { + if !skippedTests.isEmpty { + let skippedTestsElement = element.addChild(name: "SkippedTests") + skippedTests.forEach { skippedTest in + skippedTestsElement.addChild(skippedTest.xmlElement()) + } } } return element @@ -71,7 +90,8 @@ extension XCScheme { lhs.randomExecutionOrdering == rhs.randomExecutionOrdering && lhs.buildableReference == rhs.buildableReference && lhs.useTestSelectionWhitelist == rhs.useTestSelectionWhitelist && - lhs.skippedTests == rhs.skippedTests + lhs.skippedTests == rhs.skippedTests && + lhs.selectedTests == rhs.selectedTests } } } diff --git a/Tests/XcodeProjTests/Scheme/XCSchemeTests.swift b/Tests/XcodeProjTests/Scheme/XCSchemeTests.swift index b56b3d206..2e1e721d2 100644 --- a/Tests/XcodeProjTests/Scheme/XCSchemeTests.swift +++ b/Tests/XcodeProjTests/Scheme/XCSchemeTests.swift @@ -43,7 +43,8 @@ final class XCSchemeIntegrationTests: XCTestCase { buildableName: "", blueprintName: "" ), - skippedTests: [] + skippedTests: [], + selectedTests: [] ) let subject = reference.xmlElement() XCTAssertNil(subject.attributes["parallelizable"]) @@ -63,6 +64,7 @@ final class XCSchemeIntegrationTests: XCTestCase { blueprintName: "" ), skippedTests: [], + selectedTests: [], useTestSelectionWhitelist: true ) let subject = reference.xmlElement() @@ -72,6 +74,38 @@ final class XCSchemeIntegrationTests: XCTestCase { XCTAssertEqual(subject.attributes["testExecutionOrdering"], "random") } + func test_write_testableReferenceSelectedTests() { + // Given + let reference = XCScheme.TestableReference( + skipped: false, + parallelizable: true, + randomExecutionOrdering: true, + buildableReference: XCScheme.BuildableReference( + referencedContainer: "", + blueprint: PBXObject(), + buildableName: "", + blueprintName: "" + ), + skippedTests: [], + selectedTests: [ + .init(identifier: "foo"), + ], + useTestSelectionWhitelist: true + ) + let subject = reference.xmlElement() + + // When + let selectedTests = subject.children.first { $0.name == "SelectedTests"} + let skippedTests = subject.children.first { $0.name == "SkippedTests"} + let firstSelectedTest = selectedTests?.children.first { $0.name == "Test"} + + // Then + XCTAssertNil(skippedTests) + XCTAssertNotNil(selectedTests) + XCTAssertNotNil(firstSelectedTest) + XCTAssertEqual(firstSelectedTest?.attributes["Identifier"], "foo") + } + func test_write_testPlanReferenceDefaultAttributesValuesAreOmitted() { let reference = XCScheme.TestPlanReference(reference: "to_some_path") let subject = reference.xmlElement() From 81bb2bb333eafa68f8ecd8187a4bb56d51e78e97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20Pi=C3=B1era?= Date: Tue, 21 Jul 2020 08:16:00 +0200 Subject: [PATCH 073/678] Version 7.14.0 --- CHANGELOG.md | 4 ++++ README.md | 4 ++-- XcodeProj_Carthage.xcodeproj/project.pbxproj | 8 ++++---- xcodeproj.podspec | 2 +- 4 files changed, 11 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index da4f61836..af96e02c2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,8 +2,12 @@ ## Next +## 7.14.0 + ### Fixed - lastKnownFileType for .ttf and .sqlite files https://github.com/tuist/XcodeProj/pull/557 by @adamkhazi +### Added +- Added selectedTests attribute to XCScheme.TestableReference https://github.com/tuist/XcodeProj/pull/559 by @ooodin ## 7.13.0 diff --git a/README.md b/README.md index 199f0d49a..22981b73e 100644 --- a/README.md +++ b/README.md @@ -37,7 +37,7 @@ Add the dependency in your `Package.swift` file: let package = Package( name: "myproject", dependencies: [ - .package(url: "https://github.com/tuist/xcodeproj.git", .upToNextMajor(from: "7.13.0")) + .package(url: "https://github.com/tuist/xcodeproj.git", .upToNextMajor(from: "7.14.0")) ], targets: [ .target( @@ -59,7 +59,7 @@ github "tuist/xcodeproj" ~> 7.11. ### CocoaPods ```ruby -pod 'xcodeproj', '~> 7.13.0 +pod 'xcodeproj', '~> 7.14.0 ``` ### Scripting diff --git a/XcodeProj_Carthage.xcodeproj/project.pbxproj b/XcodeProj_Carthage.xcodeproj/project.pbxproj index 6820fbcb9..72968ca6f 100644 --- a/XcodeProj_Carthage.xcodeproj/project.pbxproj +++ b/XcodeProj_Carthage.xcodeproj/project.pbxproj @@ -89,7 +89,6 @@ D4CDCEFF10BE6E80B9057132 /* PBXOutputSettings.swift in Sources */ = {isa = PBXBuildFile; fileRef = E1325A961D9CCFB45B639868 /* PBXOutputSettings.swift */; }; D5D82B59980521FBA427EED8 /* XCScheme+TestPlanReference.swift in Sources */ = {isa = PBXBuildFile; fileRef = 87331972540CB510D7E0C333 /* XCScheme+TestPlanReference.swift */; }; D5DB78ED46F818640BC41A9D /* PBXTargetDependency.swift in Sources */ = {isa = PBXBuildFile; fileRef = DE15F98D3349F2FCED4A913A /* PBXTargetDependency.swift */; }; - D783F0B2AC4CA6F10A0FC5B9 /* XCScheme+SkippedTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 522A9ABE50677EEB0638B056 /* XCScheme+SkippedTests.swift */; }; DA0ACE91B9EEA6D3BD7170F3 /* PBXVariantGroup.swift in Sources */ = {isa = PBXBuildFile; fileRef = C6F7AC32AFFBEA9741906F2B /* PBXVariantGroup.swift */; }; DE1F130B4C81A1ABE9DB6DC0 /* ReferenceGenerator.swift in Sources */ = {isa = PBXBuildFile; fileRef = FF9EA2BB676DB8C978248670 /* ReferenceGenerator.swift */; }; DF37E12A489F0FBFDCF4C7A1 /* XCWorkspaceDataElement.swift in Sources */ = {isa = PBXBuildFile; fileRef = 747281C8826015AE5CE869D8 /* XCWorkspaceDataElement.swift */; }; @@ -100,6 +99,7 @@ E863D2A025082CB472079D90 /* PBXFileReference.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7A72367B782B23A3759F3A1D /* PBXFileReference.swift */; }; EC0897B21DBC4594857BAD07 /* XCWorkspaceData.swift in Sources */ = {isa = PBXBuildFile; fileRef = 59F2F50C66ADD5D0C12F3B70 /* XCWorkspaceData.swift */; }; ED4BFA372B68053D67F0E379 /* WorkspaceSettings.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3353E37D0FBA49BA04C82476 /* WorkspaceSettings.swift */; }; + EE4B80C64D6B7911947345E4 /* XCScheme+TestItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7DFDD2E86D3F0ADE3502A29A /* XCScheme+TestItem.swift */; }; F48082472D45B18B36F00F09 /* AEXML+XcodeFormat.swift in Sources */ = {isa = PBXBuildFile; fileRef = AB3D1A6857702BDE0C036055 /* AEXML+XcodeFormat.swift */; }; F6AF8B5725B94DC6136239DF /* PlistValue.swift in Sources */ = {isa = PBXBuildFile; fileRef = CB0549EED6A8FF85CA7FEBC5 /* PlistValue.swift */; }; FEBD1114F05F3A9667F26CCC /* XCScheme+AnalyzeAction.swift in Sources */ = {isa = PBXBuildFile; fileRef = BFFE462CBB08512CB108E356 /* XCScheme+AnalyzeAction.swift */; }; @@ -157,7 +157,6 @@ 4E93E589F09F66B673712EAE /* PBXObject.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PBXObject.swift; sourceTree = ""; }; 4EE77276DEE6859DE961F94D /* XCScheme+LaunchAction.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "XCScheme+LaunchAction.swift"; sourceTree = ""; }; 51CBC0FF736F69D538FFEC78 /* XCRemoteSwiftPackageReference.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = XCRemoteSwiftPackageReference.swift; sourceTree = ""; }; - 522A9ABE50677EEB0638B056 /* XCScheme+SkippedTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "XCScheme+SkippedTests.swift"; sourceTree = ""; }; 568D1BA84A39807930EA26CF /* Dictionary+Enumerate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Dictionary+Enumerate.swift"; sourceTree = ""; }; 577B27811EEAD46794E8DE90 /* PBXRezBuildPhase.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PBXRezBuildPhase.swift; sourceTree = ""; }; 59F2F50C66ADD5D0C12F3B70 /* XCWorkspaceData.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = XCWorkspaceData.swift; sourceTree = ""; }; @@ -174,6 +173,7 @@ 747281C8826015AE5CE869D8 /* XCWorkspaceDataElement.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = XCWorkspaceDataElement.swift; sourceTree = ""; }; 76F663AC6487521F684ED182 /* Decoders.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Decoders.swift; sourceTree = ""; }; 7A72367B782B23A3759F3A1D /* PBXFileReference.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PBXFileReference.swift; sourceTree = ""; }; + 7DFDD2E86D3F0ADE3502A29A /* XCScheme+TestItem.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "XCScheme+TestItem.swift"; sourceTree = ""; }; 8485AE4255BB935C7B7FE93C /* PBXResourcesBuildPhase.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PBXResourcesBuildPhase.swift; sourceTree = ""; }; 87054AE28F2715C09767FE77 /* XCScheme+AditionalOption.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "XCScheme+AditionalOption.swift"; sourceTree = ""; }; 87331972540CB510D7E0C333 /* XCScheme+TestPlanReference.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "XCScheme+TestPlanReference.swift"; sourceTree = ""; }; @@ -348,9 +348,9 @@ 0BFCA27253AECAC6A2EF5E66 /* XCScheme+RemoteRunnable.swift */, 1D5C2732048660AC71431D9C /* XCScheme+Runnable.swift */, 694034B4B7C9DF231B007A84 /* XCScheme+SerialAction.swift */, - 522A9ABE50677EEB0638B056 /* XCScheme+SkippedTests.swift */, 0AE91C6982618C1EDDAAD596 /* XCScheme+TestableReference.swift */, 161E967D0979EF34C7DF6348 /* XCScheme+TestAction.swift */, + 7DFDD2E86D3F0ADE3502A29A /* XCScheme+TestItem.swift */, 87331972540CB510D7E0C333 /* XCScheme+TestPlanReference.swift */, ); path = Scheme; @@ -675,8 +675,8 @@ 209B0AC5FFCE800A35624C49 /* XCScheme+RemoteRunnable.swift in Sources */, B972348A969282D604A5C325 /* XCScheme+Runnable.swift in Sources */, 53CE6B2F74AB5FAA69D58923 /* XCScheme+SerialAction.swift in Sources */, - D783F0B2AC4CA6F10A0FC5B9 /* XCScheme+SkippedTests.swift in Sources */, AB74DA38A17EE261024A711C /* XCScheme+TestAction.swift in Sources */, + EE4B80C64D6B7911947345E4 /* XCScheme+TestItem.swift in Sources */, D5D82B59980521FBA427EED8 /* XCScheme+TestPlanReference.swift in Sources */, 0390AF375B465D1DC7AB6194 /* XCScheme+TestableReference.swift in Sources */, E113D0F651A2213459C65387 /* XCScheme.swift in Sources */, diff --git a/xcodeproj.podspec b/xcodeproj.podspec index 6cc2675b0..b4709ba62 100644 --- a/xcodeproj.podspec +++ b/xcodeproj.podspec @@ -1,7 +1,7 @@ Pod::Spec.new do |s| s.name = "xcodeproj" - s.version = "7.13.0" + s.version = "7.14.0" s.summary = "Read/Modify/Write your Xcode projects" s.homepage = "https://github.com/tuist/xcodeproj" s.license = 'MIT' From 5964bb97b793bc0bd9d7fdf4cf66e59bcda4e19b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20Pi=C3=B1era?= Date: Tue, 28 Jul 2020 11:21:52 +0200 Subject: [PATCH 074/678] Apply swiftformat fixes --- .../AppWithExtensions/AppDelegate.swift | 16 +-- .../AppWithExtensions/SceneDelegate.swift | 19 ++- .../MessagesViewController.swift | 46 ++++--- .../TodayViewController.swift | 12 +- .../ExtensionDelegate.swift | 2 - .../HostingController.swift | 4 +- .../NotificationController.swift | 7 +- .../MyLocalPackageTests/XCTestManifests.swift | 2 +- Fixtures/iOS/iOS/AppDelegate.swift | 2 +- Project.swift | 2 +- .../Extensions/AEXML+XcodeFormat.swift | 2 +- .../XcodeProj/Extensions/Bool+Extras.swift | 4 +- .../Extensions/Dictionary+Extras.swift | 2 +- .../KeyedDecodingContainer+Additions.swift | 4 +- .../XcodeProj/Extensions/String+Utils.swift | 6 +- Sources/XcodeProj/Extensions/String+md5.swift | 6 +- .../Objects/BuildPhase/PBXBuildFile.swift | 8 +- .../Objects/BuildPhase/PBXBuildPhase.swift | 4 +- .../Objects/BuildPhase/PBXBuildRule.swift | 2 +- .../BuildPhase/PBXCopyFilesBuildPhase.swift | 4 +- .../BuildPhase/PBXFrameworksBuildPhase.swift | 4 +- .../BuildPhase/PBXHeadersBuildPhase.swift | 4 +- .../BuildPhase/PBXResourcesBuildPhase.swift | 4 +- .../Objects/BuildPhase/PBXRezBuildPhase.swift | 4 +- .../BuildPhase/PBXShellScriptBuildPhase.swift | 4 +- .../BuildPhase/PBXSourcesBuildPhase.swift | 4 +- .../Configuration/XCBuildConfiguration.swift | 2 +- .../Configuration/XCConfigurationList.swift | 6 +- .../Objects/Files/PBXContainerItemProxy.swift | 4 +- .../Objects/Files/PBXFileElement.swift | 6 +- .../Objects/Files/PBXFileReference.swift | 2 +- .../XcodeProj/Objects/Files/PBXGroup.swift | 6 +- .../Objects/Files/PBXSourceTree.swift | 2 +- .../Objects/Files/XCVersionGroup.swift | 2 +- .../XcodeProj/Objects/Project/PBXObject.swift | 10 +- .../Objects/Project/PBXObjectReference.swift | 14 +-- .../Objects/Project/PBXObjects.swift | 50 ++++---- .../Objects/Project/PBXOutputSettings.swift | 2 +- .../XcodeProj/Objects/Project/PBXProj.swift | 52 ++++---- .../Objects/Project/PBXProjEncoder.swift | 4 +- .../Objects/Project/PBXProject.swift | 16 +-- .../Objects/Sourcery/Equality.generated.swift | 52 ++++---- .../XCRemoteSwiftPackageReference.swift | 4 +- .../XCSwiftPackageProductDependency.swift | 4 +- .../Objects/Targets/PBXReferenceProxy.swift | 2 +- .../XcodeProj/Objects/Targets/PBXTarget.swift | 26 ++-- .../Objects/Targets/PBXTargetDependency.swift | 6 +- .../XcodeProj/Project/WorkspaceSettings.swift | 2 +- .../XcodeProj/Project/XCBreakpointList.swift | 12 +- Sources/XcodeProj/Project/XCSharedData.swift | 2 +- Sources/XcodeProj/Project/Xcode.swift | 2 +- Sources/XcodeProj/Project/XcodeProj.swift | 16 +-- .../Scheme/XCScheme+AditionalOption.swift | 16 +-- .../Scheme/XCScheme+AnalyzeAction.swift | 2 +- .../Scheme/XCScheme+BuildAction.swift | 2 +- .../Scheme/XCScheme+BuildableReference.swift | 22 ++-- .../XCScheme+CommandLineArguments.swift | 10 +- .../Scheme/XCScheme+EnvironmentVariable.swift | 10 +- .../Scheme/XCScheme+ExecutionAction.swift | 2 +- .../Scheme/XCScheme+LaunchAction.swift | 6 +- .../XCScheme+LocationScenarioReference.swift | 14 +-- .../Scheme/XCScheme+PathRunnable.swift | 15 ++- .../Scheme/XCScheme+RemoteRunnable.swift | 7 +- .../XcodeProj/Scheme/XCScheme+Runnable.swift | 5 +- .../Scheme/XCScheme+SerialAction.swift | 2 +- .../Scheme/XCScheme+TestAction.swift | 2 +- .../XcodeProj/Scheme/XCScheme+TestItem.swift | 8 +- .../Scheme/XCScheme+TestPlanReference.swift | 2 +- .../Scheme/XCScheme+TestableReference.swift | 2 +- Sources/XcodeProj/Scheme/XCScheme.swift | 2 +- .../Utils/BuildSettingsProvider.swift | 110 ++++++++--------- Sources/XcodeProj/Utils/CommentedString.swift | 2 +- Sources/XcodeProj/Utils/Decoders.swift | 4 +- Sources/XcodeProj/Utils/PBXBatchUpdater.swift | 114 +++++++++--------- Sources/XcodeProj/Utils/PlistValue.swift | 2 +- Sources/XcodeProj/Utils/XCConfig.swift | 10 +- Sources/XcodeProj/Workspace/XCWorkspace.swift | 2 +- .../XcodeProj/Workspace/XCWorkspaceData.swift | 8 +- .../XCWorkspaceDataElementLocationType.swift | 2 +- .../Workspace/XCWorkspaceDataFileRef.swift | 2 +- .../Workspace/XCWorkspaceDataGroup.swift | 2 +- .../Extensions/AEXML+XcodeFormatTests.swift | 2 +- .../PBXCopyFilesBuildPhaseTests.swift | 2 +- .../PBXFrameworksBuildPhaseTests.swift | 2 +- .../PBXHeadersBuildPhaseTests.swift | 2 +- .../PBXResourcesBuildPhaseTests.swift | 2 +- .../PBXShellScriptBuildPhaseTests.swift | 2 +- .../PBXSourcesBuildPhase+Fixtures.swift | 10 +- .../XCBuildConfiguration+Fixtures.swift | 2 +- .../XCBuildConfigurationTests.swift | 2 +- .../XCConfigurationList+Fixtures.swift | 4 +- .../Files/PBXContainerItemProxyTests.swift | 2 +- .../Objects/Files/PBXFileElementTests.swift | 2 +- .../Files/PBXFileReference+Fixtures.swift | 2 +- .../Objects/Files/PBXFileReferenceTests.swift | 2 +- .../Objects/Files/PBXGroup+Fixtures.swift | 6 +- .../Objects/Files/PBXGroupTests.swift | 4 +- .../Files/XCVersionGroup+Fixtures.swift | 2 +- .../Objects/Project/PBXProj+Fixtures.swift | 10 +- .../Objects/Project/PBXProjEncoderTests.swift | 18 +-- .../Objects/Project/PBXProject+Fixtures.swift | 8 +- .../Targets/PBXAggregateTargetTests.swift | 2 +- .../Targets/PBXNativeTargetTests.swift | 2 +- .../Objects/Targets/PBXTarget+Fixtures.swift | 16 +-- .../Project/XCBreakpointListTests.swift | 2 +- .../XcodeProjTests/Scheme/XCSchemeTests.swift | 50 ++++---- Tests/XcodeProjTests/Tests/Fixtures.swift | 2 +- .../Utils/BuildSettingsProviderTests.swift | 81 ++++++------- .../Utils/ReferenceGeneratorTests.swift | 4 +- .../XcodeProjTests/Utils/XCConfigTests.swift | 4 +- .../XCWorkspaceDataElementTests.swift | 10 +- .../Workspace/XCWorkspaceDataTests.swift | 2 +- .../Workspace/XCWorkspaceTests.swift | 12 +- 113 files changed, 562 insertions(+), 582 deletions(-) diff --git a/Fixtures/iOS/AppWithExtensions/AppWithExtensions/AppDelegate.swift b/Fixtures/iOS/AppWithExtensions/AppWithExtensions/AppDelegate.swift index 34ca27d89..ec501c432 100644 --- a/Fixtures/iOS/AppWithExtensions/AppWithExtensions/AppDelegate.swift +++ b/Fixtures/iOS/AppWithExtensions/AppWithExtensions/AppDelegate.swift @@ -2,28 +2,22 @@ import UIKit @UIApplicationMain class AppDelegate: UIResponder, UIApplicationDelegate { - - - - func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { + func application(_: UIApplication, didFinishLaunchingWithOptions _: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { // Override point for customization after application launch. - return true + true } // MARK: UISceneSession Lifecycle - func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration { + func application(_: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options _: UIScene.ConnectionOptions) -> UISceneConfiguration { // Called when a new scene session is being created. // Use this method to select a configuration to create the new scene with. - return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role) + UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role) } - func application(_ application: UIApplication, didDiscardSceneSessions sceneSessions: Set) { + func application(_: UIApplication, didDiscardSceneSessions _: Set) { // Called when the user discards a scene session. // If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions. // Use this method to release any resources that were specific to the discarded scenes, as they will not return. } - - } - diff --git a/Fixtures/iOS/AppWithExtensions/AppWithExtensions/SceneDelegate.swift b/Fixtures/iOS/AppWithExtensions/AppWithExtensions/SceneDelegate.swift index dcee5d055..04d77e854 100644 --- a/Fixtures/iOS/AppWithExtensions/AppWithExtensions/SceneDelegate.swift +++ b/Fixtures/iOS/AppWithExtensions/AppWithExtensions/SceneDelegate.swift @@ -1,12 +1,10 @@ -import UIKit import SwiftUI +import UIKit class SceneDelegate: UIResponder, UIWindowSceneDelegate { - var window: UIWindow? - - func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) { + func scene(_ scene: UIScene, willConnectTo _: UISceneSession, options _: UIScene.ConnectionOptions) { // Use this method to optionally configure and attach the UIWindow `window` to the provided UIWindowScene `scene`. // If using a storyboard, the `window` property will automatically be initialized and attached to the scene. // This delegate does not imply the connecting scene or session are new (see `application:configurationForConnectingSceneSession` instead). @@ -23,34 +21,31 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate { } } - func sceneDidDisconnect(_ scene: UIScene) { + func sceneDidDisconnect(_: UIScene) { // Called as the scene is being released by the system. // This occurs shortly after the scene enters the background, or when its session is discarded. // Release any resources associated with this scene that can be re-created the next time the scene connects. // The scene may re-connect later, as its session was not neccessarily discarded (see `application:didDiscardSceneSessions` instead). } - func sceneDidBecomeActive(_ scene: UIScene) { + func sceneDidBecomeActive(_: UIScene) { // Called when the scene has moved from an inactive state to an active state. // Use this method to restart any tasks that were paused (or not yet started) when the scene was inactive. } - func sceneWillResignActive(_ scene: UIScene) { + func sceneWillResignActive(_: UIScene) { // Called when the scene will move from an active state to an inactive state. // This may occur due to temporary interruptions (ex. an incoming phone call). } - func sceneWillEnterForeground(_ scene: UIScene) { + func sceneWillEnterForeground(_: UIScene) { // Called as the scene transitions from the background to the foreground. // Use this method to undo the changes made on entering the background. } - func sceneDidEnterBackground(_ scene: UIScene) { + func sceneDidEnterBackground(_: UIScene) { // Called as the scene transitions from the foreground to the background. // Use this method to save data, release shared resources, and store enough scene-specific state information // to restore the scene back to its current state. } - - } - diff --git a/Fixtures/iOS/AppWithExtensions/MessagesExtension/MessagesViewController.swift b/Fixtures/iOS/AppWithExtensions/MessagesExtension/MessagesViewController.swift index 774e3b9a0..dc198e59c 100644 --- a/Fixtures/iOS/AppWithExtensions/MessagesExtension/MessagesViewController.swift +++ b/Fixtures/iOS/AppWithExtensions/MessagesExtension/MessagesViewController.swift @@ -1,59 +1,57 @@ -import UIKit import Messages +import UIKit class MessagesViewController: MSMessagesAppViewController { - override func viewDidLoad() { super.viewDidLoad() // Do any additional setup after loading the view. } - + // MARK: - Conversation Handling - - override func willBecomeActive(with conversation: MSConversation) { + + override func willBecomeActive(with _: MSConversation) { // Called when the extension is about to move from the inactive to active state. // This will happen when the extension is about to present UI. - + // Use this method to configure the extension and restore previously stored state. } - - override func didResignActive(with conversation: MSConversation) { + + override func didResignActive(with _: MSConversation) { // Called when the extension is about to move from the active to inactive state. // This will happen when the user dissmises the extension, changes to a different // conversation or quits Messages. - + // Use this method to release shared resources, save user data, invalidate timers, // and store enough state information to restore your extension to its current state // in case it is terminated later. } - - override func didReceive(_ message: MSMessage, conversation: MSConversation) { + + override func didReceive(_: MSMessage, conversation _: MSConversation) { // Called when a message arrives that was generated by another instance of this // extension on a remote device. - + // Use this method to trigger UI updates in response to the message. } - - override func didStartSending(_ message: MSMessage, conversation: MSConversation) { + + override func didStartSending(_: MSMessage, conversation _: MSConversation) { // Called when the user taps the send button. } - - override func didCancelSending(_ message: MSMessage, conversation: MSConversation) { + + override func didCancelSending(_: MSMessage, conversation _: MSConversation) { // Called when the user deletes the message without sending it. - + // Use this to clean up state related to the deleted message. } - - override func willTransition(to presentationStyle: MSMessagesAppPresentationStyle) { + + override func willTransition(to _: MSMessagesAppPresentationStyle) { // Called before the extension transitions to a new presentation style. - + // Use this method to prepare for the change in presentation style. } - - override func didTransition(to presentationStyle: MSMessagesAppPresentationStyle) { + + override func didTransition(to _: MSMessagesAppPresentationStyle) { // Called after the extension transitions to a new presentation style. - + // Use this method to finalize any behaviors associated with the change in presentation style. } - } diff --git a/Fixtures/iOS/AppWithExtensions/TodayViewExtension/TodayViewController.swift b/Fixtures/iOS/AppWithExtensions/TodayViewExtension/TodayViewController.swift index a204fa228..77b53fbb5 100644 --- a/Fixtures/iOS/AppWithExtensions/TodayViewExtension/TodayViewController.swift +++ b/Fixtures/iOS/AppWithExtensions/TodayViewExtension/TodayViewController.swift @@ -1,21 +1,19 @@ -import UIKit import NotificationCenter +import UIKit class TodayViewController: UIViewController, NCWidgetProviding { - override func viewDidLoad() { super.viewDidLoad() // Do any additional setup after loading the view. } - - func widgetPerformUpdate(completionHandler: (@escaping (NCUpdateResult) -> Void)) { + + func widgetPerformUpdate(completionHandler: @escaping (NCUpdateResult) -> Void) { // Perform any setup necessary in order to update the view. - + // If an error is encountered, use NCUpdateResult.Failed // If there's no update required, use NCUpdateResult.NoData // If there's an update, use NCUpdateResult.NewData - + completionHandler(NCUpdateResult.newData) } - } diff --git a/Fixtures/iOS/AppWithExtensions/WatchApp Extension/ExtensionDelegate.swift b/Fixtures/iOS/AppWithExtensions/WatchApp Extension/ExtensionDelegate.swift index 320f84a6b..4af5a3d36 100644 --- a/Fixtures/iOS/AppWithExtensions/WatchApp Extension/ExtensionDelegate.swift +++ b/Fixtures/iOS/AppWithExtensions/WatchApp Extension/ExtensionDelegate.swift @@ -1,7 +1,6 @@ import WatchKit class ExtensionDelegate: NSObject, WKExtensionDelegate { - func applicationDidFinishLaunching() { // Perform any final initialization of your application. } @@ -44,5 +43,4 @@ class ExtensionDelegate: NSObject, WKExtensionDelegate { } } } - } diff --git a/Fixtures/iOS/AppWithExtensions/WatchApp Extension/HostingController.swift b/Fixtures/iOS/AppWithExtensions/WatchApp Extension/HostingController.swift index 76bc329da..b0003125e 100644 --- a/Fixtures/iOS/AppWithExtensions/WatchApp Extension/HostingController.swift +++ b/Fixtures/iOS/AppWithExtensions/WatchApp Extension/HostingController.swift @@ -1,9 +1,9 @@ -import WatchKit import Foundation import SwiftUI +import WatchKit class HostingController: WKHostingController { override var body: ContentView { - return ContentView() + ContentView() } } diff --git a/Fixtures/iOS/AppWithExtensions/WatchApp Extension/NotificationController.swift b/Fixtures/iOS/AppWithExtensions/WatchApp Extension/NotificationController.swift index 73fceb36b..31ae26f25 100644 --- a/Fixtures/iOS/AppWithExtensions/WatchApp Extension/NotificationController.swift +++ b/Fixtures/iOS/AppWithExtensions/WatchApp Extension/NotificationController.swift @@ -1,11 +1,10 @@ -import WatchKit import SwiftUI import UserNotifications +import WatchKit class NotificationController: WKUserNotificationHostingController { - override var body: NotificationView { - return NotificationView() + NotificationView() } override func willActivate() { @@ -18,7 +17,7 @@ class NotificationController: WKUserNotificationHostingController [XCTestCaseEntry] { - return [ + [ testCase(MyLocalPackageTests.allTests), ] } diff --git a/Fixtures/iOS/iOS/AppDelegate.swift b/Fixtures/iOS/iOS/AppDelegate.swift index 39daea524..843ae1f67 100644 --- a/Fixtures/iOS/iOS/AppDelegate.swift +++ b/Fixtures/iOS/iOS/AppDelegate.swift @@ -14,7 +14,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate { func application(_: UIApplication, didFinishLaunchingWithOptions _: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { // Override point for customization after application launch. - return true + true } func applicationWillResignActive(_: UIApplication) { diff --git a/Project.swift b/Project.swift index 37034c361..cf19b20f0 100644 --- a/Project.swift +++ b/Project.swift @@ -11,6 +11,6 @@ let project = Project(name: "XcodeProj_Carthage", dependencies: [ .framework(path: "Carthage/Build/Mac/AEXML.framework"), .framework(path: "Carthage/Build/Mac/PathKit.framework"), - .framework(path: "Carthage/Build/Mac/XcodeProjCExt.framework") + .framework(path: "Carthage/Build/Mac/XcodeProjCExt.framework"), ]), ]) diff --git a/Sources/XcodeProj/Extensions/AEXML+XcodeFormat.swift b/Sources/XcodeProj/Extensions/AEXML+XcodeFormat.swift index 6b6ae4a90..bb378d268 100644 --- a/Sources/XcodeProj/Extensions/AEXML+XcodeFormat.swift +++ b/Sources/XcodeProj/Extensions/AEXML+XcodeFormat.swift @@ -107,7 +107,7 @@ extension AEXMLElement { if !attributes.isEmpty { // insert known attributes in the specified order. var attributes = self.attributes - for key in attributesOrder[self.name] ?? [] { + for key in attributesOrder[name] ?? [] { if let value = attributes.removeValue(forKey: key) { print(key: key, value: value) } diff --git a/Sources/XcodeProj/Extensions/Bool+Extras.swift b/Sources/XcodeProj/Extensions/Bool+Extras.swift index b485d6f85..b4a7923d1 100644 --- a/Sources/XcodeProj/Extensions/Bool+Extras.swift +++ b/Sources/XcodeProj/Extensions/Bool+Extras.swift @@ -3,11 +3,11 @@ import Foundation public extension Bool { /// Returns a XML string value that represents the boolean. var xmlString: String { - return self ? "YES" : "NO" + self ? "YES" : "NO" } /// Returns a 1 for true and 0 for false var int: UInt { - return self ? 1 : 0 + self ? 1 : 0 } } diff --git a/Sources/XcodeProj/Extensions/Dictionary+Extras.swift b/Sources/XcodeProj/Extensions/Dictionary+Extras.swift index af9389332..2044bd530 100644 --- a/Sources/XcodeProj/Extensions/Dictionary+Extras.swift +++ b/Sources/XcodeProj/Extensions/Dictionary+Extras.swift @@ -5,5 +5,5 @@ import Foundation /// - Parameter path: the path of the .plist file. /// - Returns: initialized dictionary. public func loadPlist(path: String) -> [String: AnyObject]? { - return NSDictionary(contentsOfFile: path) as? [String: AnyObject] + NSDictionary(contentsOfFile: path) as? [String: AnyObject] } diff --git a/Sources/XcodeProj/Extensions/KeyedDecodingContainer+Additions.swift b/Sources/XcodeProj/Extensions/KeyedDecodingContainer+Additions.swift index b944ef6d8..4ea384847 100644 --- a/Sources/XcodeProj/Extensions/KeyedDecodingContainer+Additions.swift +++ b/Sources/XcodeProj/Extensions/KeyedDecodingContainer+Additions.swift @@ -2,11 +2,11 @@ import Foundation extension KeyedDecodingContainer { func decode(_ key: KeyedDecodingContainer.Key) throws -> T where T: Decodable { - return try decode(T.self, forKey: key) + try decode(T.self, forKey: key) } func decodeIfPresent(_ key: KeyedDecodingContainer.Key) throws -> T? where T: Decodable { - return try decodeIfPresent(T.self, forKey: key) + try decodeIfPresent(T.self, forKey: key) } func decodeIntIfPresent(_ key: KeyedDecodingContainer.Key) throws -> UInt? { diff --git a/Sources/XcodeProj/Extensions/String+Utils.swift b/Sources/XcodeProj/Extensions/String+Utils.swift index 6765cb31b..a9ac1a05e 100644 --- a/Sources/XcodeProj/Extensions/String+Utils.swift +++ b/Sources/XcodeProj/Extensions/String+Utils.swift @@ -4,17 +4,17 @@ import Foundation import SwiftGlibc public func arc4random_uniform(_ max: UInt32) -> Int32 { - return (SwiftGlibc.rand() % Int32(max - 1)) + (SwiftGlibc.rand() % Int32(max - 1)) } #endif extension String { public var quoted: String { - return "\"\(self)\"" + "\"\(self)\"" } public var isQuoted: Bool { - return hasPrefix("\"") && hasSuffix("\"") + hasPrefix("\"") && hasSuffix("\"") } public static func random(length: Int = 20) -> String { diff --git a/Sources/XcodeProj/Extensions/String+md5.swift b/Sources/XcodeProj/Extensions/String+md5.swift index b45d21094..95c082b15 100644 --- a/Sources/XcodeProj/Extensions/String+md5.swift +++ b/Sources/XcodeProj/Extensions/String+md5.swift @@ -65,7 +65,7 @@ func arrayOfBytes(_ value: T, length: Int? = nil) -> [UInt8] { extension Int { /** Array of bytes with optional padding (little-endian) */ func bytes(_ totalBytes: Int = MemoryLayout.size) -> [UInt8] { - return arrayOfBytes(self, length: totalBytes) + arrayOfBytes(self, length: totalBytes) } } @@ -144,12 +144,12 @@ struct BytesSequence: Sequence { let data: [UInt8] func makeIterator() -> BytesIterator { - return BytesIterator(chunkSize: chunkSize, data: data) + BytesIterator(chunkSize: chunkSize, data: data) } } func rotateLeft(_ value: UInt32, bits: UInt32) -> UInt32 { - return ((value << bits) & 0xFFFF_FFFF) | (value >> (32 - bits)) + ((value << bits) & 0xFFFF_FFFF) | (value >> (32 - bits)) } class MD5: HashProtocol { diff --git a/Sources/XcodeProj/Objects/BuildPhase/PBXBuildFile.swift b/Sources/XcodeProj/Objects/BuildPhase/PBXBuildFile.swift index 8531e5e04..e9da61e4f 100644 --- a/Sources/XcodeProj/Objects/BuildPhase/PBXBuildFile.swift +++ b/Sources/XcodeProj/Objects/BuildPhase/PBXBuildFile.swift @@ -10,7 +10,7 @@ public final class PBXBuildFile: PBXObject { /// Returns the file the build file refers to. public var file: PBXFileElement? { get { - return fileReference?.getObject() + fileReference?.getObject() } set { fileReference = newValue?.reference @@ -23,7 +23,7 @@ public final class PBXBuildFile: PBXObject { /// Product. public var product: XCSwiftPackageProductDependency? { get { - return productReference?.getObject() + productReference?.getObject() } set { productReference = newValue?.reference @@ -143,7 +143,7 @@ extension PBXBuildFile { // Helper for serialize the BuildFile with associated BuildPhase final class PBXBuildPhaseFile: PlistSerializable, Equatable { - var multiline: Bool { return false } + var multiline: Bool { false } let buildFile: PBXBuildFile let buildPhase: PBXBuildPhase @@ -175,6 +175,6 @@ final class PBXBuildPhaseFile: PlistSerializable, Equatable { } static func == (lhs: PBXBuildPhaseFile, rhs: PBXBuildPhaseFile) -> Bool { - return lhs.buildFile == rhs.buildFile && lhs.buildPhase == rhs.buildPhase + lhs.buildFile == rhs.buildFile && lhs.buildPhase == rhs.buildPhase } } diff --git a/Sources/XcodeProj/Objects/BuildPhase/PBXBuildPhase.swift b/Sources/XcodeProj/Objects/BuildPhase/PBXBuildPhase.swift index 31abb120d..1545b882a 100644 --- a/Sources/XcodeProj/Objects/BuildPhase/PBXBuildPhase.swift +++ b/Sources/XcodeProj/Objects/BuildPhase/PBXBuildPhase.swift @@ -14,7 +14,7 @@ public class PBXBuildPhase: PBXContainerItem { /// Build files. public var files: [PBXBuildFile]? { get { - return fileReferences?.objects() + fileReferences?.objects() } set { newValue?.forEach { $0.buildPhase = self } @@ -135,7 +135,7 @@ public extension PBXBuildPhase { /// /// - Returns: build phase type. func type() -> BuildPhase? { - return buildPhase + buildPhase } /// Build phase name. diff --git a/Sources/XcodeProj/Objects/BuildPhase/PBXBuildRule.swift b/Sources/XcodeProj/Objects/BuildPhase/PBXBuildRule.swift index b68e5b5e4..26ad272dc 100644 --- a/Sources/XcodeProj/Objects/BuildPhase/PBXBuildRule.swift +++ b/Sources/XcodeProj/Objects/BuildPhase/PBXBuildRule.swift @@ -86,7 +86,7 @@ public final class PBXBuildRule: PBXObject { // MARK: - PBXBuildRule Extension (PlistSerializable) extension PBXBuildRule: PlistSerializable { - var multiline: Bool { return true } + var multiline: Bool { true } func plistKeyAndValue(proj _: PBXProj, reference: String) -> (key: CommentedString, value: PlistValue) { var dictionary: [CommentedString: PlistValue] = [:] diff --git a/Sources/XcodeProj/Objects/BuildPhase/PBXCopyFilesBuildPhase.swift b/Sources/XcodeProj/Objects/BuildPhase/PBXCopyFilesBuildPhase.swift index ee5b5e369..2882f9ecb 100644 --- a/Sources/XcodeProj/Objects/BuildPhase/PBXCopyFilesBuildPhase.swift +++ b/Sources/XcodeProj/Objects/BuildPhase/PBXCopyFilesBuildPhase.swift @@ -27,8 +27,8 @@ public final class PBXCopyFilesBuildPhase: PBXBuildPhase { /// Copy files build phase name public var name: String? - public override var buildPhase: BuildPhase { - return .copyFiles + override public var buildPhase: BuildPhase { + .copyFiles } // MARK: - Init diff --git a/Sources/XcodeProj/Objects/BuildPhase/PBXFrameworksBuildPhase.swift b/Sources/XcodeProj/Objects/BuildPhase/PBXFrameworksBuildPhase.swift index ae7b82d29..914f55f14 100644 --- a/Sources/XcodeProj/Objects/BuildPhase/PBXFrameworksBuildPhase.swift +++ b/Sources/XcodeProj/Objects/BuildPhase/PBXFrameworksBuildPhase.swift @@ -2,8 +2,8 @@ import Foundation /// This is the element for the framework link build phase. public final class PBXFrameworksBuildPhase: PBXBuildPhase { - public override var buildPhase: BuildPhase { - return .frameworks + override public var buildPhase: BuildPhase { + .frameworks } } diff --git a/Sources/XcodeProj/Objects/BuildPhase/PBXHeadersBuildPhase.swift b/Sources/XcodeProj/Objects/BuildPhase/PBXHeadersBuildPhase.swift index 4dc2e520d..39360be68 100644 --- a/Sources/XcodeProj/Objects/BuildPhase/PBXHeadersBuildPhase.swift +++ b/Sources/XcodeProj/Objects/BuildPhase/PBXHeadersBuildPhase.swift @@ -3,8 +3,8 @@ import PathKit /// This is the element for the framework headers build phase. public final class PBXHeadersBuildPhase: PBXBuildPhase { - public override var buildPhase: BuildPhase { - return .headers + override public var buildPhase: BuildPhase { + .headers } } diff --git a/Sources/XcodeProj/Objects/BuildPhase/PBXResourcesBuildPhase.swift b/Sources/XcodeProj/Objects/BuildPhase/PBXResourcesBuildPhase.swift index 05858df1a..bdf96ba95 100644 --- a/Sources/XcodeProj/Objects/BuildPhase/PBXResourcesBuildPhase.swift +++ b/Sources/XcodeProj/Objects/BuildPhase/PBXResourcesBuildPhase.swift @@ -2,8 +2,8 @@ import Foundation /// This is the element for the resources copy build phase. public final class PBXResourcesBuildPhase: PBXBuildPhase { - public override var buildPhase: BuildPhase { - return .resources + override public var buildPhase: BuildPhase { + .resources } } diff --git a/Sources/XcodeProj/Objects/BuildPhase/PBXRezBuildPhase.swift b/Sources/XcodeProj/Objects/BuildPhase/PBXRezBuildPhase.swift index 8854edf77..3fa7d89fe 100644 --- a/Sources/XcodeProj/Objects/BuildPhase/PBXRezBuildPhase.swift +++ b/Sources/XcodeProj/Objects/BuildPhase/PBXRezBuildPhase.swift @@ -3,8 +3,8 @@ import Foundation /// This is the element for the Build Carbon Resources build phase. /// These are legacy .r files from the Classic Mac OS era. public final class PBXRezBuildPhase: PBXBuildPhase { - public override var buildPhase: BuildPhase { - return .carbonResources + override public var buildPhase: BuildPhase { + .carbonResources } } diff --git a/Sources/XcodeProj/Objects/BuildPhase/PBXShellScriptBuildPhase.swift b/Sources/XcodeProj/Objects/BuildPhase/PBXShellScriptBuildPhase.swift index 939c5f679..28d61dcf3 100644 --- a/Sources/XcodeProj/Objects/BuildPhase/PBXShellScriptBuildPhase.swift +++ b/Sources/XcodeProj/Objects/BuildPhase/PBXShellScriptBuildPhase.swift @@ -22,8 +22,8 @@ public final class PBXShellScriptBuildPhase: PBXBuildPhase { /// Show environment variables in the logs. public var showEnvVarsInLog: Bool - public override var buildPhase: BuildPhase { - return .runScript + override public var buildPhase: BuildPhase { + .runScript } // MARK: - Init diff --git a/Sources/XcodeProj/Objects/BuildPhase/PBXSourcesBuildPhase.swift b/Sources/XcodeProj/Objects/BuildPhase/PBXSourcesBuildPhase.swift index 4524b2636..fbcae7fa3 100644 --- a/Sources/XcodeProj/Objects/BuildPhase/PBXSourcesBuildPhase.swift +++ b/Sources/XcodeProj/Objects/BuildPhase/PBXSourcesBuildPhase.swift @@ -2,8 +2,8 @@ import Foundation /// This is the element for the sources compilation build phase. public final class PBXSourcesBuildPhase: PBXBuildPhase { - public override var buildPhase: BuildPhase { - return .sources + override public var buildPhase: BuildPhase { + .sources } } diff --git a/Sources/XcodeProj/Objects/Configuration/XCBuildConfiguration.swift b/Sources/XcodeProj/Objects/Configuration/XCBuildConfiguration.swift index 109a1838d..27562aee8 100644 --- a/Sources/XcodeProj/Objects/Configuration/XCBuildConfiguration.swift +++ b/Sources/XcodeProj/Objects/Configuration/XCBuildConfiguration.swift @@ -10,7 +10,7 @@ public final class XCBuildConfiguration: PBXObject { /// Base xcconfig file reference. public var baseConfiguration: PBXFileReference? { get { - return baseConfigurationReference?.getObject() + baseConfigurationReference?.getObject() } set { if let newValue = newValue { diff --git a/Sources/XcodeProj/Objects/Configuration/XCConfigurationList.swift b/Sources/XcodeProj/Objects/Configuration/XCConfigurationList.swift index 57c5de7b0..7bbbb874a 100644 --- a/Sources/XcodeProj/Objects/Configuration/XCConfigurationList.swift +++ b/Sources/XcodeProj/Objects/Configuration/XCConfigurationList.swift @@ -13,7 +13,7 @@ public final class XCConfigurationList: PBXObject { buildConfigurationReferences = newValue.references() } get { - return buildConfigurationReferences.objects() + buildConfigurationReferences.objects() } } @@ -69,7 +69,7 @@ extension XCConfigurationList { /// - Parameter name: configuration name. /// - Returns: build configuration if it exists. public func configuration(name: String) -> XCBuildConfiguration? { - return buildConfigurations.first(where: { $0.name == name }) + buildConfigurations.first(where: { $0.name == name }) } /// Adds the default configurations, debug and release @@ -113,7 +113,7 @@ extension XCConfigurationList: PlistSerializable { .map { configReference in let config: XCBuildConfiguration? = configReference.getObject() return .string(CommentedString(configReference.value, comment: config?.name)) - }) + }) dictionary["defaultConfigurationIsVisible"] = .string(CommentedString("\(defaultConfigurationIsVisible.int)")) if let defaultConfigurationName = defaultConfigurationName { dictionary["defaultConfigurationName"] = .string(CommentedString(defaultConfigurationName)) diff --git a/Sources/XcodeProj/Objects/Files/PBXContainerItemProxy.swift b/Sources/XcodeProj/Objects/Files/PBXContainerItemProxy.swift index bf1116028..0817fbccd 100644 --- a/Sources/XcodeProj/Objects/Files/PBXContainerItemProxy.swift +++ b/Sources/XcodeProj/Objects/Files/PBXContainerItemProxy.swift @@ -65,7 +65,7 @@ public final class PBXContainerItemProxy: PBXObject { /// Use isContainerPortalFileReference to check if you can use the getter public var containerPortal: ContainerPortal { get { - return ContainerPortal(object: containerPortalReference.getObject()) + ContainerPortal(object: containerPortalReference.getObject()) } set { guard let reference = newValue.reference else { @@ -81,7 +81,7 @@ public final class PBXContainerItemProxy: PBXObject { /// Element remote global ID reference. ID of the proxied object. public var remoteGlobalID: RemoteGlobalID? { get { - return remoteGlobalIDReference?.id + remoteGlobalIDReference?.id } set { remoteGlobalIDReference = newValue?.reference } diff --git a/Sources/XcodeProj/Objects/Files/PBXFileElement.swift b/Sources/XcodeProj/Objects/Files/PBXFileElement.swift index a869c2c09..9508a1b9b 100644 --- a/Sources/XcodeProj/Objects/Files/PBXFileElement.swift +++ b/Sources/XcodeProj/Objects/Files/PBXFileElement.swift @@ -93,7 +93,7 @@ public class PBXFileElement: PBXContainerItem, PlistSerializable { // MARK: - PlistSerializable - var multiline: Bool { return true } + var multiline: Bool { true } func plistKeyAndValue(proj _: PBXProj, reference: String) throws -> (key: CommentedString, value: PlistValue) { var dictionary: [CommentedString: PlistValue] = [:] @@ -132,7 +132,7 @@ public class PBXFileElement: PBXContainerItem, PlistSerializable { /// /// - Returns: file name. func fileName() -> String? { - return name ?? path + name ?? path } } @@ -185,7 +185,7 @@ public extension PBXFileElement { /// - Returns: path to the variant group base file. /// - Throws: an error if the path cannot be obtained. private func baseVariantGroupPath() throws -> String? { - guard let variantGroup: PBXVariantGroup = self.reference.getObject() else { return nil } + guard let variantGroup: PBXVariantGroup = reference.getObject() else { return nil } guard let baseReference = try variantGroup .childrenReferences .compactMap({ try $0.getThrowingObject() as PBXFileElement }) diff --git a/Sources/XcodeProj/Objects/Files/PBXFileReference.swift b/Sources/XcodeProj/Objects/Files/PBXFileReference.swift index 32b60b53f..7d962915a 100644 --- a/Sources/XcodeProj/Objects/Files/PBXFileReference.swift +++ b/Sources/XcodeProj/Objects/Files/PBXFileReference.swift @@ -105,7 +105,7 @@ public final class PBXFileReference: PBXFileElement { // MARK: - PlistSerializable - override var multiline: Bool { return false } + override var multiline: Bool { false } override func plistKeyAndValue(proj: PBXProj, reference: String) throws -> (key: CommentedString, value: PlistValue) { var dictionary: [CommentedString: PlistValue] = try super.plistKeyAndValue(proj: proj, reference: reference).value.dictionary ?? [:] diff --git a/Sources/XcodeProj/Objects/Files/PBXGroup.swift b/Sources/XcodeProj/Objects/Files/PBXGroup.swift index c187b9257..35bb3c188 100644 --- a/Sources/XcodeProj/Objects/Files/PBXGroup.swift +++ b/Sources/XcodeProj/Objects/Files/PBXGroup.swift @@ -13,7 +13,7 @@ public class PBXGroup: PBXFileElement { childrenReferences = newValue.references() } get { - return childrenReferences.objects() + childrenReferences.objects() } } @@ -106,7 +106,7 @@ public extension PBXGroup { /// - Parameter groupName: group name. /// - Returns: group with the given name contained in the given parent group. func group(named name: String) -> PBXGroup? { - return childrenReferences + childrenReferences .objects() .first(where: { $0.name == name }) } @@ -116,7 +116,7 @@ public extension PBXGroup { /// - Parameter name: file name. /// - Returns: file with the given name contained in the given parent group. func file(named name: String) -> PBXFileReference? { - return childrenReferences + childrenReferences .objects() .first(where: { $0.name == name }) } diff --git a/Sources/XcodeProj/Objects/Files/PBXSourceTree.swift b/Sources/XcodeProj/Objects/Files/PBXSourceTree.swift index c68dbde38..811df5f8f 100644 --- a/Sources/XcodeProj/Objects/Files/PBXSourceTree.swift +++ b/Sources/XcodeProj/Objects/Files/PBXSourceTree.swift @@ -97,6 +97,6 @@ public enum PBXSourceTree: CustomStringConvertible, Equatable, Decodable { extension PBXSourceTree { func plist() -> PlistValue { - return .string(CommentedString(String(describing: self))) + .string(CommentedString(String(describing: self))) } } diff --git a/Sources/XcodeProj/Objects/Files/XCVersionGroup.swift b/Sources/XcodeProj/Objects/Files/XCVersionGroup.swift index b643295bc..f9aa124f9 100644 --- a/Sources/XcodeProj/Objects/Files/XCVersionGroup.swift +++ b/Sources/XcodeProj/Objects/Files/XCVersionGroup.swift @@ -12,7 +12,7 @@ public final class XCVersionGroup: PBXGroup { /// Returns the current version file reference. public var currentVersion: PBXFileReference? { get { - return currentVersionReference?.getObject() + currentVersionReference?.getObject() } set { currentVersionReference = newValue?.reference diff --git a/Sources/XcodeProj/Objects/Project/PBXObject.swift b/Sources/XcodeProj/Objects/Project/PBXObject.swift index a27ffeec8..153cf0513 100644 --- a/Sources/XcodeProj/Objects/Project/PBXObject.swift +++ b/Sources/XcodeProj/Objects/Project/PBXObject.swift @@ -7,7 +7,7 @@ public class PBXObject: Hashable, Decodable, Equatable, AutoEquatable { /// Note: The unique identifier of an object might change when the project gets written. /// If you use this identifier from a scheme, make sure the project is written before the project is. public var uuid: String { - return reference.value + reference.value } /// The object reference in the project that contains it. @@ -52,16 +52,16 @@ public class PBXObject: Hashable, Decodable, Equatable, AutoEquatable { /// Object isa (type id) public static var isa: String { - return String(describing: self) + String(describing: self) } public static func == (lhs: PBXObject, rhs: PBXObject) -> Bool { - return lhs.isEqual(to: rhs) + lhs.isEqual(to: rhs) } @objc dynamic func isEqual(to _: Any?) -> Bool { - return true + true } public func hash(into hasher: inout Hasher) { @@ -73,7 +73,7 @@ public class PBXObject: Hashable, Decodable, Equatable, AutoEquatable { /// - Returns: objects the object belongs to. /// - Throws: an error if this method is accessed before the object has been added to a project. func objects() throws -> PBXObjects { - guard let objects = self.reference.objects else { + guard let objects = reference.objects else { let objectType = String(describing: type(of: self)) throw PBXObjectError.orphaned(type: objectType, reference: reference.value) } diff --git a/Sources/XcodeProj/Objects/Project/PBXObjectReference.swift b/Sources/XcodeProj/Objects/Project/PBXObjectReference.swift index acba62d79..fc4ce56ac 100644 --- a/Sources/XcodeProj/Objects/Project/PBXObjectReference.swift +++ b/Sources/XcodeProj/Objects/Project/PBXObjectReference.swift @@ -72,11 +72,11 @@ class PBXObjectReference: NSObject, Comparable, NSCopying { /// Hash value. override var hash: Int { - return value.hashValue + value.hashValue } func copy(with _: NSZone? = nil) -> Any { - return type(of: self).init(self) + type(of: self).init(self) } /// Compares two instances of PBXObjectReference @@ -86,7 +86,7 @@ class PBXObjectReference: NSObject, Comparable, NSCopying { /// - rhs: second instance to be compared. /// - Returns: true if the two instances are equal. static func == (lhs: PBXObjectReference, rhs: PBXObjectReference) -> Bool { - return lhs.isEqual(rhs) + lhs.isEqual(rhs) } /// Compares with another instance of PBXObjectReference. @@ -106,7 +106,7 @@ class PBXObjectReference: NSObject, Comparable, NSCopying { /// - rhs: second instance to be compared. /// - Returns: comparison result. static func < (lhs: PBXObjectReference, rhs: PBXObjectReference) -> Bool { - return lhs.value < rhs.value + lhs.value < rhs.value } /// Sets the object so it can be retrieved quickly again later @@ -120,7 +120,7 @@ class PBXObjectReference: NSObject, Comparable, NSCopying { /// /// - Returns: object the reference is referring to. Returns nil if the objects property has been released or the reference doesn't exist func getObject() -> T? { - return try? getThrowingObject() + try? getThrowingObject() } /// Returns the object the reference is referfing to. @@ -144,12 +144,12 @@ class PBXObjectReference: NSObject, Comparable, NSCopying { extension Array where Element: PBXObject { func references() -> [PBXObjectReference] { - return map { $0.reference } + map { $0.reference } } } extension Array where Element: PBXObjectReference { func objects() -> [T] { - return compactMap { $0.getObject() } + compactMap { $0.getObject() } } } diff --git a/Sources/XcodeProj/Objects/Project/PBXObjects.swift b/Sources/XcodeProj/Objects/Project/PBXObjects.swift index 09c8fa7bf..803fad32a 100644 --- a/Sources/XcodeProj/Objects/Project/PBXObjects.swift +++ b/Sources/XcodeProj/Objects/Project/PBXObjects.swift @@ -8,126 +8,126 @@ class PBXObjects: Equatable { private var _projects: [PBXObjectReference: PBXProject] = [:] var projects: [PBXObjectReference: PBXProject] { - return lock.whileLocked { _projects } + lock.whileLocked { _projects } } private var _referenceProxies: [PBXObjectReference: PBXReferenceProxy] = [:] var referenceProxies: [PBXObjectReference: PBXReferenceProxy] { - return lock.whileLocked { _referenceProxies } + lock.whileLocked { _referenceProxies } } // File elements private var _fileReferences: [PBXObjectReference: PBXFileReference] = [:] var fileReferences: [PBXObjectReference: PBXFileReference] { - return lock.whileLocked { _fileReferences } + lock.whileLocked { _fileReferences } } private var _versionGroups: [PBXObjectReference: XCVersionGroup] = [:] var versionGroups: [PBXObjectReference: XCVersionGroup] { - return lock.whileLocked { _versionGroups } + lock.whileLocked { _versionGroups } } private var _variantGroups: [PBXObjectReference: PBXVariantGroup] = [:] var variantGroups: [PBXObjectReference: PBXVariantGroup] { - return lock.whileLocked { _variantGroups } + lock.whileLocked { _variantGroups } } private var _groups: [PBXObjectReference: PBXGroup] = [:] var groups: [PBXObjectReference: PBXGroup] { - return lock.whileLocked { _groups } + lock.whileLocked { _groups } } // Configuration private var _buildConfigurations: [PBXObjectReference: XCBuildConfiguration] = [:] var buildConfigurations: [PBXObjectReference: XCBuildConfiguration] { - return lock.whileLocked { _buildConfigurations } + lock.whileLocked { _buildConfigurations } } private var _configurationLists: [PBXObjectReference: XCConfigurationList] = [:] var configurationLists: [PBXObjectReference: XCConfigurationList] { - return lock.whileLocked { _configurationLists } + lock.whileLocked { _configurationLists } } // Targets private var _legacyTargets: [PBXObjectReference: PBXLegacyTarget] = [:] var legacyTargets: [PBXObjectReference: PBXLegacyTarget] { - return lock.whileLocked { _legacyTargets } + lock.whileLocked { _legacyTargets } } private var _aggregateTargets: [PBXObjectReference: PBXAggregateTarget] = [:] var aggregateTargets: [PBXObjectReference: PBXAggregateTarget] { - return lock.whileLocked { _aggregateTargets } + lock.whileLocked { _aggregateTargets } } private var _nativeTargets: [PBXObjectReference: PBXNativeTarget] = [:] var nativeTargets: [PBXObjectReference: PBXNativeTarget] { - return lock.whileLocked { _nativeTargets } + lock.whileLocked { _nativeTargets } } private var _targetDependencies: [PBXObjectReference: PBXTargetDependency] = [:] var targetDependencies: [PBXObjectReference: PBXTargetDependency] { - return lock.whileLocked { _targetDependencies } + lock.whileLocked { _targetDependencies } } private var _containerItemProxies: [PBXObjectReference: PBXContainerItemProxy] = [:] var containerItemProxies: [PBXObjectReference: PBXContainerItemProxy] { - return lock.whileLocked { _containerItemProxies } + lock.whileLocked { _containerItemProxies } } private var _buildRules: [PBXObjectReference: PBXBuildRule] = [:] var buildRules: [PBXObjectReference: PBXBuildRule] { - return lock.whileLocked { _buildRules } + lock.whileLocked { _buildRules } } // Build Phases private var _buildFiles: [PBXObjectReference: PBXBuildFile] = [:] var buildFiles: [PBXObjectReference: PBXBuildFile] { - return lock.whileLocked { _buildFiles } + lock.whileLocked { _buildFiles } } private var _copyFilesBuildPhases: [PBXObjectReference: PBXCopyFilesBuildPhase] = [:] var copyFilesBuildPhases: [PBXObjectReference: PBXCopyFilesBuildPhase] { - return lock.whileLocked { _copyFilesBuildPhases } + lock.whileLocked { _copyFilesBuildPhases } } private var _shellScriptBuildPhases: [PBXObjectReference: PBXShellScriptBuildPhase] = [:] var shellScriptBuildPhases: [PBXObjectReference: PBXShellScriptBuildPhase] { - return lock.whileLocked { _shellScriptBuildPhases } + lock.whileLocked { _shellScriptBuildPhases } } private var _resourcesBuildPhases: [PBXObjectReference: PBXResourcesBuildPhase] = [:] var resourcesBuildPhases: [PBXObjectReference: PBXResourcesBuildPhase] { - return lock.whileLocked { _resourcesBuildPhases } + lock.whileLocked { _resourcesBuildPhases } } private var _frameworksBuildPhases: [PBXObjectReference: PBXFrameworksBuildPhase] = [:] var frameworksBuildPhases: [PBXObjectReference: PBXFrameworksBuildPhase] { - return lock.whileLocked { _frameworksBuildPhases } + lock.whileLocked { _frameworksBuildPhases } } private var _headersBuildPhases: [PBXObjectReference: PBXHeadersBuildPhase] = [:] var headersBuildPhases: [PBXObjectReference: PBXHeadersBuildPhase] { - return lock.whileLocked { _headersBuildPhases } + lock.whileLocked { _headersBuildPhases } } private var _sourcesBuildPhases: [PBXObjectReference: PBXSourcesBuildPhase] = [:] var sourcesBuildPhases: [PBXObjectReference: PBXSourcesBuildPhase] { - return lock.whileLocked { _sourcesBuildPhases } + lock.whileLocked { _sourcesBuildPhases } } private var _carbonResourcesBuildPhases: [PBXObjectReference: PBXRezBuildPhase] = [:] var carbonResourcesBuildPhases: [PBXObjectReference: PBXRezBuildPhase] { - return lock.whileLocked { _carbonResourcesBuildPhases } + lock.whileLocked { _carbonResourcesBuildPhases } } private var _remoteSwiftPackageReferences: [PBXObjectReference: XCRemoteSwiftPackageReference] = [:] var remoteSwiftPackageReferences: [PBXObjectReference: XCRemoteSwiftPackageReference] { - return lock.whileLocked { _remoteSwiftPackageReferences } + lock.whileLocked { _remoteSwiftPackageReferences } } private var _swiftPackageProductDependencies: [PBXObjectReference: XCSwiftPackageProductDependency] = [:] var swiftPackageProductDependencies: [PBXObjectReference: XCSwiftPackageProductDependency] { - return lock.whileLocked { _swiftPackageProductDependencies } + lock.whileLocked { _swiftPackageProductDependencies } } // XCSwiftPackageProductDependency @@ -145,7 +145,7 @@ class PBXObjects: Equatable { // MARK: - Equatable public static func == (lhs: PBXObjects, rhs: PBXObjects) -> Bool { - return lhs.buildFiles == rhs.buildFiles && + lhs.buildFiles == rhs.buildFiles && lhs.legacyTargets == rhs.legacyTargets && lhs.aggregateTargets == rhs.aggregateTargets && lhs.containerItemProxies == rhs.containerItemProxies && diff --git a/Sources/XcodeProj/Objects/Project/PBXOutputSettings.swift b/Sources/XcodeProj/Objects/Project/PBXOutputSettings.swift index 92a6c4849..c6813001d 100644 --- a/Sources/XcodeProj/Objects/Project/PBXOutputSettings.swift +++ b/Sources/XcodeProj/Objects/Project/PBXOutputSettings.swift @@ -34,7 +34,7 @@ public enum PBXFileOrder { internal func sort(lhs: (PBXObjectReference, Object), rhs: (PBXObjectReference, Object)) -> Bool where Object: PlistSerializable & Equatable { - return lhs.0 < rhs.0 + lhs.0 < rhs.0 } internal func sort(lhs: (PBXObjectReference, PBXBuildFile), rhs: (PBXObjectReference, PBXBuildFile)) -> Bool { diff --git a/Sources/XcodeProj/Objects/Project/PBXProj.swift b/Sources/XcodeProj/Objects/Project/PBXProj.swift index cd13ffdae..32b199453 100644 --- a/Sources/XcodeProj/Objects/Project/PBXProj.swift +++ b/Sources/XcodeProj/Objects/Project/PBXProj.swift @@ -25,7 +25,7 @@ public final class PBXProj: Decodable { rootObjectReference = newValue?.reference } get { - return rootObjectReference?.getObject() + rootObjectReference?.getObject() } } @@ -99,41 +99,41 @@ public final class PBXProj: Decodable { public extension PBXProj { // MARK: - Properties - var projects: [PBXProject] { return Array(objects.projects.values) } - var referenceProxies: [PBXReferenceProxy] { return Array(objects.referenceProxies.values) } + var projects: [PBXProject] { Array(objects.projects.values) } + var referenceProxies: [PBXReferenceProxy] { Array(objects.referenceProxies.values) } // File elements - var fileReferences: [PBXFileReference] { return Array(objects.fileReferences.values) } - var versionGroups: [XCVersionGroup] { return Array(objects.versionGroups.values) } - var variantGroups: [PBXVariantGroup] { return Array(objects.variantGroups.values) } - var groups: [PBXGroup] { return Array(objects.groups.values) } + var fileReferences: [PBXFileReference] { Array(objects.fileReferences.values) } + var versionGroups: [XCVersionGroup] { Array(objects.versionGroups.values) } + var variantGroups: [PBXVariantGroup] { Array(objects.variantGroups.values) } + var groups: [PBXGroup] { Array(objects.groups.values) } // Configuration - var buildConfigurations: [XCBuildConfiguration] { return Array(objects.buildConfigurations.values) } - var configurationLists: [XCConfigurationList] { return Array(objects.configurationLists.values) } + var buildConfigurations: [XCBuildConfiguration] { Array(objects.buildConfigurations.values) } + var configurationLists: [XCConfigurationList] { Array(objects.configurationLists.values) } // Targets - var legacyTargets: [PBXLegacyTarget] { return Array(objects.legacyTargets.values) } - var aggregateTargets: [PBXAggregateTarget] { return Array(objects.aggregateTargets.values) } - var nativeTargets: [PBXNativeTarget] { return Array(objects.nativeTargets.values) } - var targetDependencies: [PBXTargetDependency] { return Array(objects.targetDependencies.values) } - var containerItemProxies: [PBXContainerItemProxy] { return Array(objects.containerItemProxies.values) } - var buildRules: [PBXBuildRule] { return Array(objects.buildRules.values) } + var legacyTargets: [PBXLegacyTarget] { Array(objects.legacyTargets.values) } + var aggregateTargets: [PBXAggregateTarget] { Array(objects.aggregateTargets.values) } + var nativeTargets: [PBXNativeTarget] { Array(objects.nativeTargets.values) } + var targetDependencies: [PBXTargetDependency] { Array(objects.targetDependencies.values) } + var containerItemProxies: [PBXContainerItemProxy] { Array(objects.containerItemProxies.values) } + var buildRules: [PBXBuildRule] { Array(objects.buildRules.values) } // Build - var buildFiles: [PBXBuildFile] { return Array(objects.buildFiles.values) } - var copyFilesBuildPhases: [PBXCopyFilesBuildPhase] { return Array(objects.copyFilesBuildPhases.values) } - var shellScriptBuildPhases: [PBXShellScriptBuildPhase] { return Array(objects.shellScriptBuildPhases.values) } - var resourcesBuildPhases: [PBXResourcesBuildPhase] { return Array(objects.resourcesBuildPhases.values) } - var frameworksBuildPhases: [PBXFrameworksBuildPhase] { return Array(objects.frameworksBuildPhases.values) } - var headersBuildPhases: [PBXHeadersBuildPhase] { return Array(objects.headersBuildPhases.values) } - var sourcesBuildPhases: [PBXSourcesBuildPhase] { return Array(objects.sourcesBuildPhases.values) } - var carbonResourcesBuildPhases: [PBXRezBuildPhase] { return Array(objects.carbonResourcesBuildPhases.values) } - var buildPhases: [PBXBuildPhase] { return Array(objects.buildPhases.values) } + var buildFiles: [PBXBuildFile] { Array(objects.buildFiles.values) } + var copyFilesBuildPhases: [PBXCopyFilesBuildPhase] { Array(objects.copyFilesBuildPhases.values) } + var shellScriptBuildPhases: [PBXShellScriptBuildPhase] { Array(objects.shellScriptBuildPhases.values) } + var resourcesBuildPhases: [PBXResourcesBuildPhase] { Array(objects.resourcesBuildPhases.values) } + var frameworksBuildPhases: [PBXFrameworksBuildPhase] { Array(objects.frameworksBuildPhases.values) } + var headersBuildPhases: [PBXHeadersBuildPhase] { Array(objects.headersBuildPhases.values) } + var sourcesBuildPhases: [PBXSourcesBuildPhase] { Array(objects.sourcesBuildPhases.values) } + var carbonResourcesBuildPhases: [PBXRezBuildPhase] { Array(objects.carbonResourcesBuildPhases.values) } + var buildPhases: [PBXBuildPhase] { Array(objects.buildPhases.values) } /// Returns root project. func rootProject() throws -> PBXProject? { - return try rootObjectReference?.getThrowingObject() + try rootObjectReference?.getThrowingObject() } /// Returns root project's root group. @@ -162,7 +162,7 @@ public extension PBXProj { /// - name: target name. /// - Returns: targets with the given name. func targets(named name: String) -> [PBXTarget] { - return objects.targets(named: name) + objects.targets(named: name) } /// Invalidates all the objects UUIDs. diff --git a/Sources/XcodeProj/Objects/Project/PBXProjEncoder.swift b/Sources/XcodeProj/Objects/Project/PBXProjEncoder.swift index 4caac010c..a13c203c8 100644 --- a/Sources/XcodeProj/Objects/Project/PBXProjEncoder.swift +++ b/Sources/XcodeProj/Objects/Project/PBXProjEncoder.swift @@ -7,7 +7,7 @@ protocol PlistSerializable { } extension PlistSerializable { - var multiline: Bool { return true } + var multiline: Bool { true } } final class StateHolder { @@ -28,7 +28,7 @@ final class StateHolder { } func copy() -> StateHolder { - return StateHolder(indent: indent, multiline: multiline) + StateHolder(indent: indent, multiline: multiline) } } diff --git a/Sources/XcodeProj/Objects/Project/PBXProject.swift b/Sources/XcodeProj/Objects/Project/PBXProject.swift index 96b99305c..567af8245 100644 --- a/Sources/XcodeProj/Objects/Project/PBXProject.swift +++ b/Sources/XcodeProj/Objects/Project/PBXProject.swift @@ -16,7 +16,7 @@ public final class PBXProject: PBXObject { buildConfigurationListReference = newValue.reference } get { - return buildConfigurationListReference.getObject() + buildConfigurationListReference.getObject() } } @@ -41,7 +41,7 @@ public final class PBXProject: PBXObject { mainGroupReference = newValue.reference } get { - return mainGroupReference.getObject() + mainGroupReference.getObject() } } @@ -54,7 +54,7 @@ public final class PBXProject: PBXObject { productsGroupReference = newValue?.reference } get { - return productsGroupReference?.getObject() + productsGroupReference?.getObject() } } @@ -76,7 +76,7 @@ public final class PBXProject: PBXObject { } } get { - return projectReferences.map { project in + projectReferences.map { project in project.mapValues { $0.getObject()! } } } @@ -96,7 +96,7 @@ public final class PBXProject: PBXObject { targetReferences = newValue.references() } get { - return targetReferences.objects() + targetReferences.objects() } } @@ -134,7 +134,7 @@ public final class PBXProject: PBXObject { packageReferences = newValue.references() } get { - return packageReferences?.objects() ?? [] + packageReferences?.objects() ?? [] } } @@ -164,7 +164,7 @@ public final class PBXProject: PBXObject { /// - Parameter for: target whose attributes will be returned. /// - Returns: target attributes. public func attributes(for target: PBXTarget) -> [String: Any]? { - return targetAttributeReferences[target.reference] + targetAttributeReferences[target.reference] } /// Adds a remote swift package @@ -477,7 +477,7 @@ extension PBXProject: PlistSerializable { .map { targetReference in let target: PBXTarget? = targetReference.getObject() return .string(CommentedString(targetReference.value, comment: target?.name)) - }) + }) if !packages.isEmpty { dictionary["packageReferences"] = PlistValue.array(packages.map { diff --git a/Sources/XcodeProj/Objects/Sourcery/Equality.generated.swift b/Sources/XcodeProj/Objects/Sourcery/Equality.generated.swift index 7c0ec85e9..468ca29e0 100644 --- a/Sources/XcodeProj/Objects/Sourcery/Equality.generated.swift +++ b/Sources/XcodeProj/Objects/Sourcery/Equality.generated.swift @@ -5,7 +5,7 @@ import Foundation extension PBXAggregateTarget { /// :nodoc: - @objc public override func isEqual(to object: Any?) -> Bool { + @objc override public func isEqual(to object: Any?) -> Bool { guard let rhs = object as? PBXAggregateTarget else { return false } return super.isEqual(to: rhs) } @@ -13,7 +13,7 @@ extension PBXAggregateTarget { extension PBXBuildFile { /// :nodoc: - @objc public override func isEqual(to object: Any?) -> Bool { + @objc override public func isEqual(to object: Any?) -> Bool { guard let rhs = object as? PBXBuildFile else { return false } if fileReference != rhs.fileReference { return false } if !NSDictionary(dictionary: settings ?? [:]).isEqual(to: rhs.settings ?? [:]) { return false } @@ -23,7 +23,7 @@ extension PBXBuildFile { extension PBXBuildPhase { /// :nodoc: - @objc public override func isEqual(to object: Any?) -> Bool { + @objc override public func isEqual(to object: Any?) -> Bool { guard let rhs = object as? PBXBuildPhase else { return false } if buildActionMask != rhs.buildActionMask { return false } if fileReferences != rhs.fileReferences { return false } @@ -36,7 +36,7 @@ extension PBXBuildPhase { extension PBXBuildRule { /// :nodoc: - @objc public override func isEqual(to object: Any?) -> Bool { + @objc override public func isEqual(to object: Any?) -> Bool { guard let rhs = object as? PBXBuildRule else { return false } if compilerSpec != rhs.compilerSpec { return false } if filePatterns != rhs.filePatterns { return false } @@ -52,7 +52,7 @@ extension PBXBuildRule { extension PBXContainerItem { /// :nodoc: - @objc public override func isEqual(to object: Any?) -> Bool { + @objc override public func isEqual(to object: Any?) -> Bool { guard let rhs = object as? PBXContainerItem else { return false } if comments != rhs.comments { return false } return super.isEqual(to: rhs) @@ -61,7 +61,7 @@ extension PBXContainerItem { extension PBXContainerItemProxy { /// :nodoc: - @objc public override func isEqual(to object: Any?) -> Bool { + @objc override public func isEqual(to object: Any?) -> Bool { guard let rhs = object as? PBXContainerItemProxy else { return false } if containerPortalReference != rhs.containerPortalReference { return false } if proxyType != rhs.proxyType { return false } @@ -73,7 +73,7 @@ extension PBXContainerItemProxy { extension PBXCopyFilesBuildPhase { /// :nodoc: - @objc public override func isEqual(to object: Any?) -> Bool { + @objc override public func isEqual(to object: Any?) -> Bool { guard let rhs = object as? PBXCopyFilesBuildPhase else { return false } if dstPath != rhs.dstPath { return false } if dstSubfolderSpec != rhs.dstSubfolderSpec { return false } @@ -84,7 +84,7 @@ extension PBXCopyFilesBuildPhase { extension PBXFileElement { /// :nodoc: - @objc public override func isEqual(to object: Any?) -> Bool { + @objc override public func isEqual(to object: Any?) -> Bool { guard let rhs = object as? PBXFileElement else { return false } if sourceTree != rhs.sourceTree { return false } if path != rhs.path { return false } @@ -100,7 +100,7 @@ extension PBXFileElement { extension PBXFileReference { /// :nodoc: - @objc public override func isEqual(to object: Any?) -> Bool { + @objc override public func isEqual(to object: Any?) -> Bool { guard let rhs = object as? PBXFileReference else { return false } if fileEncoding != rhs.fileEncoding { return false } if explicitFileType != rhs.explicitFileType { return false } @@ -115,7 +115,7 @@ extension PBXFileReference { extension PBXFrameworksBuildPhase { /// :nodoc: - @objc public override func isEqual(to object: Any?) -> Bool { + @objc override public func isEqual(to object: Any?) -> Bool { guard let rhs = object as? PBXFrameworksBuildPhase else { return false } return super.isEqual(to: rhs) } @@ -123,7 +123,7 @@ extension PBXFrameworksBuildPhase { extension PBXGroup { /// :nodoc: - @objc public override func isEqual(to object: Any?) -> Bool { + @objc override public func isEqual(to object: Any?) -> Bool { guard let rhs = object as? PBXGroup else { return false } if childrenReferences != rhs.childrenReferences { return false } return super.isEqual(to: rhs) @@ -132,7 +132,7 @@ extension PBXGroup { extension PBXHeadersBuildPhase { /// :nodoc: - @objc public override func isEqual(to object: Any?) -> Bool { + @objc override public func isEqual(to object: Any?) -> Bool { guard let rhs = object as? PBXHeadersBuildPhase else { return false } return super.isEqual(to: rhs) } @@ -140,7 +140,7 @@ extension PBXHeadersBuildPhase { extension PBXLegacyTarget { /// :nodoc: - @objc public override func isEqual(to object: Any?) -> Bool { + @objc override public func isEqual(to object: Any?) -> Bool { guard let rhs = object as? PBXLegacyTarget else { return false } if buildToolPath != rhs.buildToolPath { return false } if buildArgumentsString != rhs.buildArgumentsString { return false } @@ -152,7 +152,7 @@ extension PBXLegacyTarget { extension PBXNativeTarget { /// :nodoc: - @objc public override func isEqual(to object: Any?) -> Bool { + @objc override public func isEqual(to object: Any?) -> Bool { guard let rhs = object as? PBXNativeTarget else { return false } if productInstallPath != rhs.productInstallPath { return false } return super.isEqual(to: rhs) @@ -161,7 +161,7 @@ extension PBXNativeTarget { extension PBXProject { /// :nodoc: - @objc public override func isEqual(to object: Any?) -> Bool { + @objc override public func isEqual(to object: Any?) -> Bool { guard let rhs = object as? PBXProject else { return false } if name != rhs.name { return false } if buildConfigurationListReference != rhs.buildConfigurationListReference { return false } @@ -183,7 +183,7 @@ extension PBXProject { extension PBXReferenceProxy { /// :nodoc: - @objc public override func isEqual(to object: Any?) -> Bool { + @objc override public func isEqual(to object: Any?) -> Bool { guard let rhs = object as? PBXReferenceProxy else { return false } if fileType != rhs.fileType { return false } if path != rhs.path { return false } @@ -195,7 +195,7 @@ extension PBXReferenceProxy { extension PBXResourcesBuildPhase { /// :nodoc: - @objc public override func isEqual(to object: Any?) -> Bool { + @objc override public func isEqual(to object: Any?) -> Bool { guard let rhs = object as? PBXResourcesBuildPhase else { return false } return super.isEqual(to: rhs) } @@ -203,7 +203,7 @@ extension PBXResourcesBuildPhase { extension PBXRezBuildPhase { /// :nodoc: - @objc public override func isEqual(to object: Any?) -> Bool { + @objc override public func isEqual(to object: Any?) -> Bool { guard let rhs = object as? PBXRezBuildPhase else { return false } return super.isEqual(to: rhs) } @@ -211,7 +211,7 @@ extension PBXRezBuildPhase { extension PBXShellScriptBuildPhase { /// :nodoc: - @objc public override func isEqual(to object: Any?) -> Bool { + @objc override public func isEqual(to object: Any?) -> Bool { guard let rhs = object as? PBXShellScriptBuildPhase else { return false } if name != rhs.name { return false } if inputPaths != rhs.inputPaths { return false } @@ -225,7 +225,7 @@ extension PBXShellScriptBuildPhase { extension PBXSourcesBuildPhase { /// :nodoc: - @objc public override func isEqual(to object: Any?) -> Bool { + @objc override public func isEqual(to object: Any?) -> Bool { guard let rhs = object as? PBXSourcesBuildPhase else { return false } return super.isEqual(to: rhs) } @@ -233,7 +233,7 @@ extension PBXSourcesBuildPhase { extension PBXTarget { /// :nodoc: - @objc public override func isEqual(to object: Any?) -> Bool { + @objc override public func isEqual(to object: Any?) -> Bool { guard let rhs = object as? PBXTarget else { return false } if buildConfigurationListReference != rhs.buildConfigurationListReference { return false } if buildPhaseReferences != rhs.buildPhaseReferences { return false } @@ -249,7 +249,7 @@ extension PBXTarget { extension PBXTargetDependency { /// :nodoc: - @objc public override func isEqual(to object: Any?) -> Bool { + @objc override public func isEqual(to object: Any?) -> Bool { guard let rhs = object as? PBXTargetDependency else { return false } if name != rhs.name { return false } if targetReference != rhs.targetReference { return false } @@ -260,7 +260,7 @@ extension PBXTargetDependency { extension PBXVariantGroup { /// :nodoc: - @objc public override func isEqual(to object: Any?) -> Bool { + @objc override public func isEqual(to object: Any?) -> Bool { guard let rhs = object as? PBXVariantGroup else { return false } return super.isEqual(to: rhs) } @@ -268,7 +268,7 @@ extension PBXVariantGroup { extension XCBuildConfiguration { /// :nodoc: - @objc public override func isEqual(to object: Any?) -> Bool { + @objc override public func isEqual(to object: Any?) -> Bool { guard let rhs = object as? XCBuildConfiguration else { return false } if baseConfigurationReference != rhs.baseConfigurationReference { return false } if !NSDictionary(dictionary: buildSettings).isEqual(to: rhs.buildSettings) { return false } @@ -279,7 +279,7 @@ extension XCBuildConfiguration { extension XCConfigurationList { /// :nodoc: - @objc public override func isEqual(to object: Any?) -> Bool { + @objc override public func isEqual(to object: Any?) -> Bool { guard let rhs = object as? XCConfigurationList else { return false } if buildConfigurationReferences != rhs.buildConfigurationReferences { return false } if defaultConfigurationIsVisible != rhs.defaultConfigurationIsVisible { return false } @@ -290,7 +290,7 @@ extension XCConfigurationList { extension XCVersionGroup { /// :nodoc: - @objc public override func isEqual(to object: Any?) -> Bool { + @objc override public func isEqual(to object: Any?) -> Bool { guard let rhs = object as? XCVersionGroup else { return false } if currentVersionReference != rhs.currentVersionReference { return false } if versionGroupType != rhs.versionGroupType { return false } diff --git a/Sources/XcodeProj/Objects/SwiftPackage/XCRemoteSwiftPackageReference.swift b/Sources/XcodeProj/Objects/SwiftPackage/XCRemoteSwiftPackageReference.swift index d4b11f084..bcb70e9b9 100644 --- a/Sources/XcodeProj/Objects/SwiftPackage/XCRemoteSwiftPackageReference.swift +++ b/Sources/XcodeProj/Objects/SwiftPackage/XCRemoteSwiftPackageReference.swift @@ -125,7 +125,7 @@ public class XCRemoteSwiftPackageReference: PBXContainerItem, PlistSerializable /// It returns the name of the package reference. public var name: String? { - return repositoryURL?.split(separator: "/").last?.replacingOccurrences(of: ".git", with: "") + repositoryURL?.split(separator: "/").last?.replacingOccurrences(of: ".git", with: "") } func plistKeyAndValue(proj: PBXProj, reference: String) throws -> (key: CommentedString, value: PlistValue) { @@ -143,7 +143,7 @@ public class XCRemoteSwiftPackageReference: PBXContainerItem, PlistSerializable // MARK: - Equatable - @objc public override func isEqual(to object: Any?) -> Bool { + @objc override public func isEqual(to object: Any?) -> Bool { guard let rhs = object as? XCRemoteSwiftPackageReference else { return false } if repositoryURL != rhs.repositoryURL { return false } if versionRequirement != rhs.versionRequirement { return false } diff --git a/Sources/XcodeProj/Objects/SwiftPackage/XCSwiftPackageProductDependency.swift b/Sources/XcodeProj/Objects/SwiftPackage/XCSwiftPackageProductDependency.swift index d5e7f41aa..dfccd6278 100644 --- a/Sources/XcodeProj/Objects/SwiftPackage/XCSwiftPackageProductDependency.swift +++ b/Sources/XcodeProj/Objects/SwiftPackage/XCSwiftPackageProductDependency.swift @@ -11,7 +11,7 @@ public class XCSwiftPackageProductDependency: PBXContainerItem, PlistSerializabl /// Package the product dependency refers to. public var package: XCRemoteSwiftPackageReference? { get { - return packageReference?.getObject() + packageReference?.getObject() } set { packageReference = newValue?.reference @@ -61,7 +61,7 @@ public class XCSwiftPackageProductDependency: PBXContainerItem, PlistSerializabl // MARK: - Equatable - @objc public override func isEqual(to object: Any?) -> Bool { + @objc override public func isEqual(to object: Any?) -> Bool { guard let rhs = object as? XCSwiftPackageProductDependency else { return false } if packageReference != rhs.packageReference { return false } if productName != rhs.productName { return false } diff --git a/Sources/XcodeProj/Objects/Targets/PBXReferenceProxy.swift b/Sources/XcodeProj/Objects/Targets/PBXReferenceProxy.swift index c92b24860..900db1aa1 100644 --- a/Sources/XcodeProj/Objects/Targets/PBXReferenceProxy.swift +++ b/Sources/XcodeProj/Objects/Targets/PBXReferenceProxy.swift @@ -15,7 +15,7 @@ public final class PBXReferenceProxy: PBXFileElement { /// Element remote. public var remote: PBXContainerItemProxy? { get { - return remoteReference?.getObject() + remoteReference?.getObject() } set { remoteReference = newValue?.reference diff --git a/Sources/XcodeProj/Objects/Targets/PBXTarget.swift b/Sources/XcodeProj/Objects/Targets/PBXTarget.swift index 6dd41682c..d290c52f6 100644 --- a/Sources/XcodeProj/Objects/Targets/PBXTarget.swift +++ b/Sources/XcodeProj/Objects/Targets/PBXTarget.swift @@ -8,7 +8,7 @@ public class PBXTarget: PBXContainerItem { /// Build configuration list. public var buildConfigurationList: XCConfigurationList? { get { - return buildConfigurationListReference?.getObject() + buildConfigurationListReference?.getObject() } set { buildConfigurationListReference = newValue?.reference @@ -21,7 +21,7 @@ public class PBXTarget: PBXContainerItem { /// Target build phases. public var buildPhases: [PBXBuildPhase] { get { - return buildPhaseReferences.objects() + buildPhaseReferences.objects() } set { buildPhaseReferences = newValue.references() @@ -34,7 +34,7 @@ public class PBXTarget: PBXContainerItem { /// Target build rules. public var buildRules: [PBXBuildRule] { get { - return buildRuleReferences.objects() + buildRuleReferences.objects() } set { buildRuleReferences = newValue.references() @@ -47,7 +47,7 @@ public class PBXTarget: PBXContainerItem { /// Target dependencies. public var dependencies: [PBXTargetDependency] { get { - return dependencyReferences.objects() + dependencyReferences.objects() } set { dependencyReferences = newValue.references() @@ -66,7 +66,7 @@ public class PBXTarget: PBXContainerItem { /// Target product. public var product: PBXFileReference? { get { - return productReference?.getObject() + productReference?.getObject() } set { productReference = newValue?.reference @@ -82,7 +82,7 @@ public class PBXTarget: PBXContainerItem { packageProductDependencyReferences = newValue.references() } get { - return packageProductDependencyReferences.objects() + packageProductDependencyReferences.objects() } } @@ -180,7 +180,7 @@ public class PBXTarget: PBXContainerItem { .map { (buildPhaseReference: PBXObjectReference) in let buildPhase: PBXBuildPhase? = buildPhaseReference.getObject() return .string(CommentedString(buildPhaseReference.value, comment: buildPhase?.name())) - }) + }) // Xcode doesn't write PBXAggregateTarget buildRules or empty PBXLegacyTarget buildRules if !(self is PBXAggregateTarget), !(self is PBXLegacyTarget) || !buildRuleReferences.isEmpty { @@ -217,7 +217,7 @@ public extension PBXTarget { /// - Returns: product name with extension. func productNameWithExtension() -> String? { guard let productName = self.productName else { return nil } - guard let fileExtension = self.productType?.fileExtension else { return nil } + guard let fileExtension = productType?.fileExtension else { return nil } return "\(productName).\(fileExtension)" } @@ -226,7 +226,7 @@ public extension PBXTarget { /// - Returns: frameworks build phase. /// - Throws: an error if the build phase cannot be obtained. func frameworksBuildPhase() throws -> PBXFrameworksBuildPhase? { - return try buildPhaseReferences + try buildPhaseReferences .compactMap { try $0.getThrowingObject() as? PBXBuildPhase } .filter { $0.buildPhase == .frameworks } .compactMap { $0 as? PBXFrameworksBuildPhase } @@ -238,7 +238,7 @@ public extension PBXTarget { /// - Returns: sources build phase. /// - Throws: an error if the build phase cannot be obtained. func sourcesBuildPhase() throws -> PBXSourcesBuildPhase? { - return try buildPhaseReferences + try buildPhaseReferences .compactMap { try $0.getThrowingObject() as? PBXBuildPhase } .filter { $0.buildPhase == .sources } .compactMap { $0 as? PBXSourcesBuildPhase } @@ -250,7 +250,7 @@ public extension PBXTarget { /// - Returns: sources build phase. /// - Throws: an error if the build phase cannot be obtained. func resourcesBuildPhase() throws -> PBXResourcesBuildPhase? { - return try buildPhaseReferences + try buildPhaseReferences .compactMap { try $0.getThrowingObject() as? PBXResourcesBuildPhase } .filter { $0.buildPhase == .resources } .first @@ -261,7 +261,7 @@ public extension PBXTarget { /// - Returns: source files. /// - Throws: an error if something goes wrong. func sourceFiles() throws -> [PBXFileElement] { - return try sourcesBuildPhase()?.fileReferences? + try sourcesBuildPhase()?.fileReferences? .compactMap { try $0.getThrowingObject() as? PBXBuildFile } .filter { $0.fileReference != nil } .compactMap { try $0.fileReference!.getThrowingObject() as? PBXFileElement } @@ -272,7 +272,7 @@ public extension PBXTarget { /// /// - Returns: Embed frameworks build phases. func embedFrameworksBuildPhases() -> [PBXCopyFilesBuildPhase] { - return buildPhases + buildPhases .filter { $0.buildPhase == .copyFiles } .compactMap { $0 as? PBXCopyFilesBuildPhase } .filter { $0.dstSubfolderSpec == .frameworks } diff --git a/Sources/XcodeProj/Objects/Targets/PBXTargetDependency.swift b/Sources/XcodeProj/Objects/Targets/PBXTargetDependency.swift index e9b87a3d8..12d3cefe7 100644 --- a/Sources/XcodeProj/Objects/Targets/PBXTargetDependency.swift +++ b/Sources/XcodeProj/Objects/Targets/PBXTargetDependency.swift @@ -13,7 +13,7 @@ public final class PBXTargetDependency: PBXObject { /// Target. public var target: PBXTarget? { get { - return targetReference?.getObject() + targetReference?.getObject() } set { targetReference = newValue?.reference @@ -26,7 +26,7 @@ public final class PBXTargetDependency: PBXObject { /// Target proxy. public var targetProxy: PBXContainerItemProxy? { get { - return targetProxyReference?.getObject() + targetProxyReference?.getObject() } set { targetProxyReference = newValue?.reference @@ -39,7 +39,7 @@ public final class PBXTargetDependency: PBXObject { /// Product. public var product: XCSwiftPackageProductDependency? { get { - return productReference?.getObject() + productReference?.getObject() } set { productReference = newValue?.reference diff --git a/Sources/XcodeProj/Project/WorkspaceSettings.swift b/Sources/XcodeProj/Project/WorkspaceSettings.swift index 1a400058e..128f9f89d 100644 --- a/Sources/XcodeProj/Project/WorkspaceSettings.swift +++ b/Sources/XcodeProj/Project/WorkspaceSettings.swift @@ -91,7 +91,7 @@ public class WorkspaceSettings: Codable, Equatable, Writable { /// - rhs: Second instance to be compared. /// - Returns: True if the two instances are the same. public static func == (lhs: WorkspaceSettings, rhs: WorkspaceSettings) -> Bool { - return lhs.buildSystem == rhs.buildSystem && + lhs.buildSystem == rhs.buildSystem && lhs.autoCreateSchemes == rhs.autoCreateSchemes } diff --git a/Sources/XcodeProj/Project/XCBreakpointList.swift b/Sources/XcodeProj/Project/XCBreakpointList.swift index dc3b7202e..fb76ff74e 100644 --- a/Sources/XcodeProj/Project/XCBreakpointList.swift +++ b/Sources/XcodeProj/Project/XCBreakpointList.swift @@ -85,7 +85,7 @@ public final class XCBreakpointList: Equatable, Writable { // MARK: - Equatable public static func == (lhs: ActionContent, rhs: ActionContent) -> Bool { - return lhs.consoleCommand == rhs.consoleCommand && + lhs.consoleCommand == rhs.consoleCommand && lhs.message == rhs.message && lhs.conveyanceType == rhs.conveyanceType && lhs.command == rhs.command && @@ -143,7 +143,7 @@ public final class XCBreakpointList: Equatable, Writable { // MARK: - Equatable public static func == (lhs: BreakpointActionProxy, rhs: BreakpointActionProxy) -> Bool { - return lhs.actionExtensionID == rhs.actionExtensionID && + lhs.actionExtensionID == rhs.actionExtensionID && lhs.actionContent == rhs.actionContent } } @@ -163,12 +163,12 @@ public final class XCBreakpointList: Equatable, Writable { } public static func == (_: BreakpointLocationProxy, _: BreakpointLocationProxy) -> Bool { - return true + true } } public static func == (lhs: BreakpointContent, rhs: BreakpointContent) -> Bool { - return lhs.enabled == rhs.enabled && + lhs.enabled == rhs.enabled && lhs.ignoreCount == rhs.ignoreCount && lhs.continueAfterRunningActions == rhs.continueAfterRunningActions && lhs.filePath == rhs.filePath && @@ -353,7 +353,7 @@ public final class XCBreakpointList: Equatable, Writable { // MARK: - Equatable public static func == (lhs: BreakpointProxy, rhs: BreakpointProxy) -> Bool { - return lhs.breakpointExtensionID == rhs.breakpointExtensionID && + lhs.breakpointExtensionID == rhs.breakpointExtensionID && lhs.breakpointContent == rhs.breakpointContent } } @@ -421,7 +421,7 @@ public final class XCBreakpointList: Equatable, Writable { // MARK: - Equatable public static func == (lhs: XCBreakpointList, rhs: XCBreakpointList) -> Bool { - return lhs.breakpoints == rhs.breakpoints && + lhs.breakpoints == rhs.breakpoints && lhs.type == rhs.type && lhs.version == rhs.version } diff --git a/Sources/XcodeProj/Project/XCSharedData.swift b/Sources/XcodeProj/Project/XCSharedData.swift index d3ecffe8d..18d788efd 100644 --- a/Sources/XcodeProj/Project/XCSharedData.swift +++ b/Sources/XcodeProj/Project/XCSharedData.swift @@ -51,7 +51,7 @@ public final class XCSharedData: Equatable { // MARK: - Equatable public static func == (lhs: XCSharedData, rhs: XCSharedData) -> Bool { - return lhs.schemes == rhs.schemes && + lhs.schemes == rhs.schemes && lhs.breakpoints == rhs.breakpoints && lhs.workspaceSettings == rhs.workspaceSettings } diff --git a/Sources/XcodeProj/Project/Xcode.swift b/Sources/XcodeProj/Project/Xcode.swift index 53c8445c4..4e3958ef8 100644 --- a/Sources/XcodeProj/Project/Xcode.swift +++ b/Sources/XcodeProj/Project/Xcode.swift @@ -64,7 +64,7 @@ public struct Xcode { /// - Parameter extension: file extension. /// - Returns: Xcode file type. public static func filetype(extension: String) -> String? { - return allExtensions[`extension`] + allExtensions[`extension`] } // Derived from Xcode3Core.ideplugin in Xcode 11.1 diff --git a/Sources/XcodeProj/Project/XcodeProj.swift b/Sources/XcodeProj/Project/XcodeProj.swift index 0a69104bb..ceddb6bdf 100644 --- a/Sources/XcodeProj/Project/XcodeProj.swift +++ b/Sources/XcodeProj/Project/XcodeProj.swift @@ -69,7 +69,7 @@ public final class XcodeProj: Equatable { // MARK: - Equatable public static func == (lhs: XcodeProj, rhs: XcodeProj) -> Bool { - return lhs.workspace == rhs.workspace && + lhs.workspace == rhs.workspace && lhs.pbxproj == rhs.pbxproj && lhs.sharedData == rhs.sharedData } @@ -121,7 +121,7 @@ extension XcodeProj: Writable { /// - Parameter path: `.xcodeproj` file path /// - Returns: worspace file path relative to the given path. public static func workspacePath(_ path: Path) -> Path { - return path + "project.xcworkspace" + path + "project.xcworkspace" } /// Writes workspace to the given path. @@ -138,7 +138,7 @@ extension XcodeProj: Writable { /// - Parameter path: `.xcodeproj` file path /// - Returns: project file path relative to the given path. public static func pbxprojPath(_ path: Path) -> Path { - return path + "project.pbxproj" + path + "project.pbxproj" } /// Writes project to the given path. @@ -156,7 +156,7 @@ extension XcodeProj: Writable { /// - Parameter path: `.xcodeproj` file path /// - Returns: shared data path relative to the given path. public static func sharedDataPath(_ path: Path) -> Path { - return path + "xcshareddata" + path + "xcshareddata" } /// Returns schemes folder path relative to the given path. @@ -164,7 +164,7 @@ extension XcodeProj: Writable { /// - Parameter path: `.xcodeproj` file path /// - Returns: schemes folder path relative to the given path. public static func schemesPath(_ path: Path) -> Path { - return XcodeProj.sharedDataPath(path) + "xcschemes" + XcodeProj.sharedDataPath(path) + "xcschemes" } /// Returns scheme file path relative to the given path. @@ -173,7 +173,7 @@ extension XcodeProj: Writable { /// - Parameter schemeName: scheme name /// - Returns: scheme file path relative to the given path. public static func schemePath(_ path: Path, schemeName: String) -> Path { - return XcodeProj.schemesPath(path) + "\(schemeName).xcscheme" + XcodeProj.schemesPath(path) + "\(schemeName).xcscheme" } /// Writes all project schemes to the given path. @@ -201,7 +201,7 @@ extension XcodeProj: Writable { /// - Parameter schemeName: scheme name /// - Returns: debugger folder path relative to the given path. public static func debuggerPath(_ path: Path) -> Path { - return XcodeProj.sharedDataPath(path) + "xcdebugger" + XcodeProj.sharedDataPath(path) + "xcdebugger" } /// Returns breakpoints plist path relative to the given path. @@ -210,7 +210,7 @@ extension XcodeProj: Writable { /// - Parameter schemeName: scheme name /// - Returns: breakpoints plist path relative to the given path. public static func breakPointsPath(_ path: Path) -> Path { - return XcodeProj.debuggerPath(path) + "Breakpoints_v2.xcbkptlist" + XcodeProj.debuggerPath(path) + "Breakpoints_v2.xcbkptlist" } /// Writes all project breakpoints to the given path. diff --git a/Sources/XcodeProj/Scheme/XCScheme+AditionalOption.swift b/Sources/XcodeProj/Scheme/XCScheme+AditionalOption.swift index e8c8f0125..5e643047a 100644 --- a/Sources/XcodeProj/Scheme/XCScheme+AditionalOption.swift +++ b/Sources/XcodeProj/Scheme/XCScheme+AditionalOption.swift @@ -27,19 +27,19 @@ extension XCScheme { // MARK: - XML func xmlElement() -> AEXMLElement { - return AEXMLElement(name: "AdditionalOption", - value: nil, - attributes: [ - "key": key, - "value": value, - "isEnabled": isEnabled.xmlString, - ]) + AEXMLElement(name: "AdditionalOption", + value: nil, + attributes: [ + "key": key, + "value": value, + "isEnabled": isEnabled.xmlString, + ]) } // MARK: - Equatable public static func == (lhs: AdditionalOption, rhs: AdditionalOption) -> Bool { - return lhs.key == rhs.key && + lhs.key == rhs.key && lhs.value == rhs.value && lhs.isEnabled == rhs.isEnabled } diff --git a/Sources/XcodeProj/Scheme/XCScheme+AnalyzeAction.swift b/Sources/XcodeProj/Scheme/XCScheme+AnalyzeAction.swift index 2b707e9f6..2a295e7e3 100644 --- a/Sources/XcodeProj/Scheme/XCScheme+AnalyzeAction.swift +++ b/Sources/XcodeProj/Scheme/XCScheme+AnalyzeAction.swift @@ -35,7 +35,7 @@ extension XCScheme { // MARK: - Equatable public static func == (lhs: AnalyzeAction, rhs: AnalyzeAction) -> Bool { - return lhs.buildConfiguration == rhs.buildConfiguration + lhs.buildConfiguration == rhs.buildConfiguration } } } diff --git a/Sources/XcodeProj/Scheme/XCScheme+BuildAction.swift b/Sources/XcodeProj/Scheme/XCScheme+BuildAction.swift index 2ef963934..2be673ade 100644 --- a/Sources/XcodeProj/Scheme/XCScheme+BuildAction.swift +++ b/Sources/XcodeProj/Scheme/XCScheme+BuildAction.swift @@ -65,7 +65,7 @@ extension XCScheme { // MARK: - Equatable public static func == (lhs: Entry, rhs: Entry) -> Bool { - return lhs.buildableReference == rhs.buildableReference && + lhs.buildableReference == rhs.buildableReference && lhs.buildFor == rhs.buildFor } } diff --git a/Sources/XcodeProj/Scheme/XCScheme+BuildableReference.swift b/Sources/XcodeProj/Scheme/XCScheme+BuildableReference.swift index 73720fe97..ba768c034 100644 --- a/Sources/XcodeProj/Scheme/XCScheme+BuildableReference.swift +++ b/Sources/XcodeProj/Scheme/XCScheme+BuildableReference.swift @@ -25,7 +25,7 @@ extension XCScheme { private var blueprint: Blueprint public var blueprintIdentifier: String { - return blueprint.string + blueprint.string } public var buildableName: String @@ -72,21 +72,21 @@ extension XCScheme { } func xmlElement() -> AEXMLElement { - return AEXMLElement(name: "BuildableReference", - value: nil, - attributes: [ - "BuildableIdentifier": buildableIdentifier, - "BlueprintIdentifier": blueprint.string, - "BuildableName": buildableName, - "BlueprintName": blueprintName, - "ReferencedContainer": referencedContainer, - ]) + AEXMLElement(name: "BuildableReference", + value: nil, + attributes: [ + "BuildableIdentifier": buildableIdentifier, + "BlueprintIdentifier": blueprint.string, + "BuildableName": buildableName, + "BlueprintName": blueprintName, + "ReferencedContainer": referencedContainer, + ]) } // MARK: - Equatable public static func == (lhs: BuildableReference, rhs: BuildableReference) -> Bool { - return lhs.referencedContainer == rhs.referencedContainer && + lhs.referencedContainer == rhs.referencedContainer && lhs.blueprintIdentifier == rhs.blueprintIdentifier && lhs.buildableName == rhs.buildableName && lhs.blueprint == rhs.blueprint && diff --git a/Sources/XcodeProj/Scheme/XCScheme+CommandLineArguments.swift b/Sources/XcodeProj/Scheme/XCScheme+CommandLineArguments.swift index 2a37fb584..80330a24a 100644 --- a/Sources/XcodeProj/Scheme/XCScheme+CommandLineArguments.swift +++ b/Sources/XcodeProj/Scheme/XCScheme+CommandLineArguments.swift @@ -39,7 +39,7 @@ extension XCScheme { // MARK: - Equatable public static func == (lhs: CommandLineArguments, rhs: CommandLineArguments) -> Bool { - return lhs.arguments == rhs.arguments + lhs.arguments == rhs.arguments } } } @@ -61,15 +61,15 @@ extension XCScheme.CommandLineArguments { // MARK: - XML func xmlElement() -> AEXMLElement { - return AEXMLElement(name: "CommandLineArgument", - value: nil, - attributes: ["argument": name, "isEnabled": enabled ? "YES" : "NO"]) + AEXMLElement(name: "CommandLineArgument", + value: nil, + attributes: ["argument": name, "isEnabled": enabled ? "YES" : "NO"]) } // MARK: - Equatable public static func == (lhs: CommandLineArgument, rhs: CommandLineArgument) -> Bool { - return lhs.name == rhs.name && + lhs.name == rhs.name && lhs.enabled == rhs.enabled } } diff --git a/Sources/XcodeProj/Scheme/XCScheme+EnvironmentVariable.swift b/Sources/XcodeProj/Scheme/XCScheme+EnvironmentVariable.swift index 00f566108..2f6251063 100644 --- a/Sources/XcodeProj/Scheme/XCScheme+EnvironmentVariable.swift +++ b/Sources/XcodeProj/Scheme/XCScheme+EnvironmentVariable.swift @@ -20,13 +20,13 @@ extension XCScheme { // MARK: - XML func xmlElement() -> AEXMLElement { - return AEXMLElement(name: "EnvironmentVariable", - value: nil, - attributes: ["key": variable, "value": value, "isEnabled": enabled ? "YES" : "NO"]) + AEXMLElement(name: "EnvironmentVariable", + value: nil, + attributes: ["key": variable, "value": value, "isEnabled": enabled ? "YES" : "NO"]) } static func parseVariables(from element: AEXMLElement) throws -> [EnvironmentVariable] { - return try element.children.map { elt in + try element.children.map { elt in guard let variableKey = elt.attributes["key"] else { throw XCSchemeError.missing(property: "key") } @@ -54,7 +54,7 @@ extension XCScheme { // MARK: - Equatable public static func == (lhs: EnvironmentVariable, rhs: EnvironmentVariable) -> Bool { - return lhs.variable == rhs.variable && + lhs.variable == rhs.variable && lhs.value == rhs.value && lhs.enabled == rhs.enabled } diff --git a/Sources/XcodeProj/Scheme/XCScheme+ExecutionAction.swift b/Sources/XcodeProj/Scheme/XCScheme+ExecutionAction.swift index 59837bec1..5dd3d7d21 100644 --- a/Sources/XcodeProj/Scheme/XCScheme+ExecutionAction.swift +++ b/Sources/XcodeProj/Scheme/XCScheme+ExecutionAction.swift @@ -48,7 +48,7 @@ extension XCScheme { // MARK: - Equatable public static func == (lhs: ExecutionAction, rhs: ExecutionAction) -> Bool { - return lhs.title == rhs.title && + lhs.title == rhs.title && lhs.scriptText == rhs.scriptText && lhs.environmentBuildable == rhs.environmentBuildable } diff --git a/Sources/XcodeProj/Scheme/XCScheme+LaunchAction.swift b/Sources/XcodeProj/Scheme/XCScheme+LaunchAction.swift index ce6fc1618..dae6c2d3f 100644 --- a/Sources/XcodeProj/Scheme/XCScheme+LaunchAction.swift +++ b/Sources/XcodeProj/Scheme/XCScheme+LaunchAction.swift @@ -160,12 +160,12 @@ extension XCScheme { } else if remoteRunnableElement.error == nil { runnable = try RemoteRunnable(element: remoteRunnableElement) } - + let pathRunnable = element["PathRunnable"] if pathRunnable.error == nil { self.pathRunnable = try PathRunnable(element: pathRunnable) } - + let buildableReferenceElement = element["MacroExpansion"]["BuildableReference"] if buildableReferenceElement.error == nil { macroExpansion = try BuildableReference(element: buildableReferenceElement) @@ -273,7 +273,7 @@ extension XCScheme { if let runnable = runnable { element.addChild(runnable.xmlElement()) } - + if let pathRunnable = pathRunnable { element.addChild(pathRunnable.xmlElement()) } diff --git a/Sources/XcodeProj/Scheme/XCScheme+LocationScenarioReference.swift b/Sources/XcodeProj/Scheme/XCScheme+LocationScenarioReference.swift index eac6a4993..23e13bb83 100644 --- a/Sources/XcodeProj/Scheme/XCScheme+LocationScenarioReference.swift +++ b/Sources/XcodeProj/Scheme/XCScheme+LocationScenarioReference.swift @@ -23,18 +23,18 @@ extension XCScheme { // MARK: - XML func xmlElement() -> AEXMLElement { - return AEXMLElement(name: "LocationScenarioReference", - value: nil, - attributes: [ - "identifier": identifier, - "referenceType": referenceType, - ]) + AEXMLElement(name: "LocationScenarioReference", + value: nil, + attributes: [ + "identifier": identifier, + "referenceType": referenceType, + ]) } // MARK: - Equatable public static func == (lhs: LocationScenarioReference, rhs: LocationScenarioReference) -> Bool { - return lhs.identifier == rhs.identifier && + lhs.identifier == rhs.identifier && lhs.referenceType == rhs.referenceType } } diff --git a/Sources/XcodeProj/Scheme/XCScheme+PathRunnable.swift b/Sources/XcodeProj/Scheme/XCScheme+PathRunnable.swift index ef2a0deb1..d47a19252 100644 --- a/Sources/XcodeProj/Scheme/XCScheme+PathRunnable.swift +++ b/Sources/XcodeProj/Scheme/XCScheme+PathRunnable.swift @@ -25,19 +25,18 @@ extension XCScheme { // MARK: - XML func xmlElement() -> AEXMLElement { - return AEXMLElement(name: "PathRunnable", - value: nil, - attributes: [ - "runnableDebuggingMode": runnableDebuggingMode, - "FilePath" : filePath - ] - ) + AEXMLElement(name: "PathRunnable", + value: nil, + attributes: [ + "runnableDebuggingMode": runnableDebuggingMode, + "FilePath": filePath, + ]) } // MARK: - Equatable public static func == (lhs: PathRunnable, rhs: PathRunnable) -> Bool { - return lhs.runnableDebuggingMode == rhs.runnableDebuggingMode && + lhs.runnableDebuggingMode == rhs.runnableDebuggingMode && lhs.filePath == rhs.filePath } } diff --git a/Sources/XcodeProj/Scheme/XCScheme+RemoteRunnable.swift b/Sources/XcodeProj/Scheme/XCScheme+RemoteRunnable.swift index a02fea6f7..67413e5c7 100644 --- a/Sources/XcodeProj/Scheme/XCScheme+RemoteRunnable.swift +++ b/Sources/XcodeProj/Scheme/XCScheme+RemoteRunnable.swift @@ -37,18 +37,19 @@ extension XCScheme { } // MARK: - Equatable + override func isEqual(other: XCScheme.Runnable) -> Bool { guard let other = other as? RemoteRunnable else { return false } return super.isEqual(other: other) && - bundleIdentifier == other.bundleIdentifier && - remotePath == other.remotePath + bundleIdentifier == other.bundleIdentifier && + remotePath == other.remotePath } public static func == (lhs: RemoteRunnable, rhs: RemoteRunnable) -> Bool { - return lhs.isEqual(other: rhs) && rhs.isEqual(other: lhs) + lhs.isEqual(other: rhs) && rhs.isEqual(other: lhs) } } } diff --git a/Sources/XcodeProj/Scheme/XCScheme+Runnable.swift b/Sources/XcodeProj/Scheme/XCScheme+Runnable.swift index 8b004b109..6fb8b489e 100644 --- a/Sources/XcodeProj/Scheme/XCScheme+Runnable.swift +++ b/Sources/XcodeProj/Scheme/XCScheme+Runnable.swift @@ -32,13 +32,14 @@ extension XCScheme { } // MARK: - Equatable + func isEqual(other: Runnable) -> Bool { - return runnableDebuggingMode == other.runnableDebuggingMode && + runnableDebuggingMode == other.runnableDebuggingMode && buildableReference == other.buildableReference } public static func == (lhs: Runnable, rhs: Runnable) -> Bool { - return lhs.isEqual(other: rhs) && rhs.isEqual(other: lhs) + lhs.isEqual(other: rhs) && rhs.isEqual(other: lhs) } } } diff --git a/Sources/XcodeProj/Scheme/XCScheme+SerialAction.swift b/Sources/XcodeProj/Scheme/XCScheme+SerialAction.swift index be8cf30b2..0f55ce8fc 100644 --- a/Sources/XcodeProj/Scheme/XCScheme+SerialAction.swift +++ b/Sources/XcodeProj/Scheme/XCScheme+SerialAction.swift @@ -46,7 +46,7 @@ extension XCScheme { } public static func == (lhs: SerialAction, rhs: SerialAction) -> Bool { - return lhs.isEqual(to: rhs) + lhs.isEqual(to: rhs) } } } diff --git a/Sources/XcodeProj/Scheme/XCScheme+TestAction.swift b/Sources/XcodeProj/Scheme/XCScheme+TestAction.swift index d9f6cd3f4..7c2d0cc47 100644 --- a/Sources/XcodeProj/Scheme/XCScheme+TestAction.swift +++ b/Sources/XcodeProj/Scheme/XCScheme+TestAction.swift @@ -224,7 +224,7 @@ extension XCScheme { codeCoverageTargetsElement.addChild(target.xmlElement()) } } - + return element } diff --git a/Sources/XcodeProj/Scheme/XCScheme+TestItem.swift b/Sources/XcodeProj/Scheme/XCScheme+TestItem.swift index cf295cca1..02934909e 100644 --- a/Sources/XcodeProj/Scheme/XCScheme+TestItem.swift +++ b/Sources/XcodeProj/Scheme/XCScheme+TestItem.swift @@ -20,15 +20,15 @@ extension XCScheme { // MARK: - XML func xmlElement() -> AEXMLElement { - return AEXMLElement(name: "Test", - value: nil, - attributes: ["Identifier": identifier]) + AEXMLElement(name: "Test", + value: nil, + attributes: ["Identifier": identifier]) } // MARK: - Equatable public static func == (lhs: TestItem, rhs: TestItem) -> Bool { - return lhs.identifier == rhs.identifier + lhs.identifier == rhs.identifier } } } diff --git a/Sources/XcodeProj/Scheme/XCScheme+TestPlanReference.swift b/Sources/XcodeProj/Scheme/XCScheme+TestPlanReference.swift index 4ce2b5726..1397391f4 100644 --- a/Sources/XcodeProj/Scheme/XCScheme+TestPlanReference.swift +++ b/Sources/XcodeProj/Scheme/XCScheme+TestPlanReference.swift @@ -39,7 +39,7 @@ extension XCScheme { // MARK: - Equatable public static func == (lhs: TestPlanReference, rhs: TestPlanReference) -> Bool { - return lhs.reference == rhs.reference && + lhs.reference == rhs.reference && lhs.default == rhs.default } } diff --git a/Sources/XcodeProj/Scheme/XCScheme+TestableReference.swift b/Sources/XcodeProj/Scheme/XCScheme+TestableReference.swift index ff9755435..fbe0c04f5 100644 --- a/Sources/XcodeProj/Scheme/XCScheme+TestableReference.swift +++ b/Sources/XcodeProj/Scheme/XCScheme+TestableReference.swift @@ -85,7 +85,7 @@ extension XCScheme { // MARK: - Equatable public static func == (lhs: TestableReference, rhs: TestableReference) -> Bool { - return lhs.skipped == rhs.skipped && + lhs.skipped == rhs.skipped && lhs.parallelizable == rhs.parallelizable && lhs.randomExecutionOrdering == rhs.randomExecutionOrdering && lhs.buildableReference == rhs.buildableReference && diff --git a/Sources/XcodeProj/Scheme/XCScheme.swift b/Sources/XcodeProj/Scheme/XCScheme.swift index ee2cb7596..14f1989c5 100644 --- a/Sources/XcodeProj/Scheme/XCScheme.swift +++ b/Sources/XcodeProj/Scheme/XCScheme.swift @@ -118,7 +118,7 @@ public final class XCScheme: Writable, Equatable { // MARK: - Equatable public static func == (lhs: XCScheme, rhs: XCScheme) -> Bool { - return lhs.buildAction == rhs.buildAction && + lhs.buildAction == rhs.buildAction && lhs.testAction == rhs.testAction && lhs.launchAction == rhs.launchAction && lhs.profileAction == rhs.profileAction && diff --git a/Sources/XcodeProj/Utils/BuildSettingsProvider.swift b/Sources/XcodeProj/Utils/BuildSettingsProvider.swift index 67bfe51ff..f9e2ffdd7 100644 --- a/Sources/XcodeProj/Utils/BuildSettingsProvider.swift +++ b/Sources/XcodeProj/Utils/BuildSettingsProvider.swift @@ -45,35 +45,35 @@ public class BuildSettingsProvider { /// - Returns: build settings. public static func targetDefault(variant: Variant? = nil, platform: Platform?, product: Product?, swift: Bool? = nil) -> BuildSettings { var buildSettings: [String: Any] = [:] - + if let platform = platform { buildSettings.merge(targetSettings(platform: platform), uniquingKeysWith: { $1 }) } - + if let product = product { buildSettings.merge(targetSettings(product: product), uniquingKeysWith: { $1 }) } - + if let platform = platform, let product = product { buildSettings.merge(targetSettings(platform: platform, product: product), uniquingKeysWith: { $1 }) } - + if let platform = platform, let variant = variant { buildSettings.merge(targetSettings(variant: variant, platform: platform), uniquingKeysWith: { $1 }) } - + if let variant = variant, let swift = swift, swift == true { buildSettings.merge(targetSwiftSettings(variant: variant), uniquingKeysWith: { $1 }) } - + if let product = product, let swift = swift, swift == true { buildSettings.merge(targetSwiftSettings(product: product), uniquingKeysWith: { $1 }) } - + if let platform = platform, let product = product, let swift = swift, swift == true { buildSettings.merge(targetSwiftSettings(platform: platform, product: product), uniquingKeysWith: { $1 }) } - + return buildSettings } @@ -95,7 +95,7 @@ public class BuildSettingsProvider { // swiftlint:disable:next function_body_length private static func projectAll() -> BuildSettings { - return [ + [ "ALWAYS_SEARCH_USER_PATHS": "NO", "CLANG_ANALYZER_NONNULL": "YES", "CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION": "YES_AGGRESSIVE", @@ -140,7 +140,7 @@ public class BuildSettingsProvider { } private static func projectDebug() -> BuildSettings { - return [ + [ "DEBUG_INFORMATION_FORMAT": "dwarf", "ENABLE_TESTABILITY": "YES", "GCC_DYNAMIC_NO_PIC": "NO", @@ -152,11 +152,11 @@ public class BuildSettingsProvider { } private static func projectRelease() -> BuildSettings { - return [ + [ "DEBUG_INFORMATION_FORMAT": "dwarf-with-dsym", "ENABLE_NS_ASSERTIONS": "NO", "MTL_ENABLE_DEBUG_INFO": "NO", - "VALIDATE_PRODUCT": "YES" + "VALIDATE_PRODUCT": "YES", ] } @@ -166,7 +166,7 @@ public class BuildSettingsProvider { return [ "SDKROOT": "iphoneos", "CODE_SIGN_IDENTITY": "iPhone Developer", - "TARGETED_DEVICE_FAMILY": "1,2" + "TARGETED_DEVICE_FAMILY": "1,2", ] case .macOS: return [ @@ -176,16 +176,16 @@ public class BuildSettingsProvider { case .tvOS: return [ "SDKROOT": "appletvos", - "TARGETED_DEVICE_FAMILY": "3" + "TARGETED_DEVICE_FAMILY": "3", ] case .watchOS: return [ "SDKROOT": "watchos", - "TARGETED_DEVICE_FAMILY": "4" + "TARGETED_DEVICE_FAMILY": "4", ] } } - + private static func targetSettings(product: Product) -> BuildSettings { switch product { case .application: @@ -205,12 +205,12 @@ public class BuildSettingsProvider { "PRODUCT_NAME": "$(TARGET_NAME:c99extidentifier)", "SKIP_INSTALL": "YES", "VERSION_INFO_PREFIX": "", - "VERSIONING_SYSTEM": "apple-generic" + "VERSIONING_SYSTEM": "apple-generic", ] case .bundle: return [ "WRAPPER_EXTENSION": "bundle", - "SKIP_INSTALL": "YES" + "SKIP_INSTALL": "YES", ] default: return [:] @@ -222,22 +222,22 @@ public class BuildSettingsProvider { switch (platform, product) { case (.iOS, .application): return [ - "LD_RUNPATH_SEARCH_PATHS": ["$(inherited)", "@executable_path/Frameworks"] + "LD_RUNPATH_SEARCH_PATHS": ["$(inherited)", "@executable_path/Frameworks"], ] case (.macOS, .application): return [ "COMBINE_HIDPI_IMAGES": "YES", - "LD_RUNPATH_SEARCH_PATHS": ["$(inherited)", "@executable_path/../Frameworks"] + "LD_RUNPATH_SEARCH_PATHS": ["$(inherited)", "@executable_path/../Frameworks"], ] case (.tvOS, .application): return [ "ASSETCATALOG_COMPILER_APPICON_NAME": "App Icon & Top Shelf Image", "ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME": "LaunchImage", - "LD_RUNPATH_SEARCH_PATHS": ["$(inherited)", "@executable_path/Frameworks"] + "LD_RUNPATH_SEARCH_PATHS": ["$(inherited)", "@executable_path/Frameworks"], ] case (.watchOS, .application): return [ - "SKIP_INSTALL": "YES" + "SKIP_INSTALL": "YES", ] case (.iOS, .framework): return [ @@ -247,11 +247,11 @@ public class BuildSettingsProvider { return [ "COMBINE_HIDPI_IMAGES": "YES", "FRAMEWORK_VERSION": "A", - "LD_RUNPATH_SEARCH_PATHS": ["$(inherited)", "@executable_path/../Frameworks", "@loader_path/../Frameworks"] + "LD_RUNPATH_SEARCH_PATHS": ["$(inherited)", "@executable_path/../Frameworks", "@loader_path/../Frameworks"], ] case (.tvOS, .framework): return [ - "LD_RUNPATH_SEARCH_PATHS": ["$(inherited)", "@executable_path/Frameworks", "@loader_path/Frameworks"] + "LD_RUNPATH_SEARCH_PATHS": ["$(inherited)", "@executable_path/Frameworks", "@loader_path/Frameworks"], ] case (.watchOS, .framework): return [ @@ -261,19 +261,19 @@ public class BuildSettingsProvider { case ([.iOS, .tvOS, .watchOS], .staticLibrary): return [ "OTHER_LDFLAGS": "-ObjC", - "SKIP_INSTALL": "YES" + "SKIP_INSTALL": "YES", ] case (.macOS, .staticLibrary): return [ "EXECUTABLE_PREFIX": "lib", - "SKIP_INSTALL": "YES" + "SKIP_INSTALL": "YES", ] case (.macOS, .dynamicLibrary): return [ "DYLIB_COMPATIBILITY_VERSION": "1", "DYLIB_CURRENT_VERSION": "1", "EXECUTABLE_PREFIX": "lib", - "SKIP_INSTALL": "YES" + "SKIP_INSTALL": "YES", ] case (.macOS, .bundle): return [ @@ -282,23 +282,23 @@ public class BuildSettingsProvider { ] case ([.iOS, .tvOS], .appExtension): return [ - "LD_RUNPATH_SEARCH_PATHS": ["$(inherited)", "@executable_path/Frameworks", "@executable_path/../../Frameworks"] + "LD_RUNPATH_SEARCH_PATHS": ["$(inherited)", "@executable_path/Frameworks", "@executable_path/../../Frameworks"], ] case (.macOS, .appExtension): return [ "LD_RUNPATH_SEARCH_PATHS": [ "$(inherited)", "@executable_path/../Frameworks", - "@executable_path/../../../../Frameworks" - ] + "@executable_path/../../../../Frameworks", + ], ] case (.watchOS, .watchExtension): return [ "LD_RUNPATH_SEARCH_PATHS": [ "$(inherited)", "@executable_path/Frameworks", - "@executable_path/../../Frameworks" - ] + "@executable_path/../../Frameworks", + ], ] case (.watchOS, .appExtension): return [ @@ -306,31 +306,31 @@ public class BuildSettingsProvider { "$(inherited)", "@executable_path/Frameworks", "@executable_path/../../Frameworks", - "@executable_path/../../../../Frameworks" - ] + "@executable_path/../../../../Frameworks", + ], ] case ([.iOS, .tvOS], [.unitTests, .uiTests]): - return [ - "LD_RUNPATH_SEARCH_PATHS": ["$(inherited)", "@executable_path/Frameworks", "@loader_path/Frameworks"], - ] + return [ + "LD_RUNPATH_SEARCH_PATHS": ["$(inherited)", "@executable_path/Frameworks", "@loader_path/Frameworks"], + ] case (.macOS, [.unitTests, .uiTests]): - return [ - "LD_RUNPATH_SEARCH_PATHS": ["$(inherited)", "@executable_path/../Frameworks", "@loader_path/../Frameworks"] - ] + return [ + "LD_RUNPATH_SEARCH_PATHS": ["$(inherited)", "@executable_path/../Frameworks", "@loader_path/../Frameworks"], + ] default: return [:] } } - - static private func targetSettings(variant: Variant, + + private static func targetSettings(variant: Variant, platform: Platform) -> BuildSettings { switch (variant, platform) { default: return [:] } } - - static private func targetSwiftSettings(variant: Variant) -> BuildSettings { + + private static func targetSwiftSettings(variant: Variant) -> BuildSettings { switch variant { case .debug: return [ @@ -341,29 +341,29 @@ public class BuildSettingsProvider { case .release: return [ "SWIFT_OPTIMIZATION_LEVEL": "-Owholemodule", - "SWIFT_COMPILATION_MODE": "wholemodule" + "SWIFT_COMPILATION_MODE": "wholemodule", ] default: return [:] } } - - static private func targetSwiftSettings(product: Product) -> BuildSettings { + + private static func targetSwiftSettings(product: Product) -> BuildSettings { switch product { case .framework: return [ - "DEFINES_MODULE": "YES" + "DEFINES_MODULE": "YES", ] default: return [:] } } - - static private func targetSwiftSettings(platform: Platform, product: Product) -> BuildSettings { + + private static func targetSwiftSettings(platform: Platform, product: Product) -> BuildSettings { switch (platform, product) { case (.watchOS, .application): return [ - "ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES": "YES" + "ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES": "YES", ] default: return [:] @@ -375,12 +375,12 @@ public class BuildSettingsProvider { // // - reference: https://docs.swift.org/swift-book/ReferenceManual/Patterns.html#ID426 -private func ~= (lhs: [BuildSettingsProvider.Product], +private func ~= (lhs: [BuildSettingsProvider.Product], rhs: BuildSettingsProvider.Product) -> Bool { - return lhs.contains(rhs) + lhs.contains(rhs) } -private func ~= (lhs: [BuildSettingsProvider.Platform], +private func ~= (lhs: [BuildSettingsProvider.Platform], rhs: BuildSettingsProvider.Platform) -> Bool { - return lhs.contains(rhs) + lhs.contains(rhs) } diff --git a/Sources/XcodeProj/Utils/CommentedString.swift b/Sources/XcodeProj/Utils/CommentedString.swift index ad7358e9e..470d75c82 100644 --- a/Sources/XcodeProj/Utils/CommentedString.swift +++ b/Sources/XcodeProj/Utils/CommentedString.swift @@ -61,7 +61,7 @@ extension CommentedString: Hashable { } static func == (lhs: CommentedString, rhs: CommentedString) -> Bool { - return lhs.string == rhs.string && lhs.comment == rhs.comment + lhs.string == rhs.string && lhs.comment == rhs.comment } } diff --git a/Sources/XcodeProj/Utils/Decoders.swift b/Sources/XcodeProj/Utils/Decoders.swift index 610287280..3aa82a07d 100644 --- a/Sources/XcodeProj/Utils/Decoders.swift +++ b/Sources/XcodeProj/Utils/Decoders.swift @@ -13,7 +13,7 @@ class PBXObjectReferenceRepository { /// - objects: objects. /// - Returns: object reference. func getOrCreate(reference: String, objects: PBXObjects) -> PBXObjectReference { - return lock.whileLocked { + lock.whileLocked { if let objectReference = references[reference] { return objectReference } @@ -71,6 +71,6 @@ extension Decoder { /// Returns the decoding context. var context: ProjectDecodingContext { // swiftlint:disable:next force_cast - return userInfo[.context] as! ProjectDecodingContext + userInfo[.context] as! ProjectDecodingContext } } diff --git a/Sources/XcodeProj/Utils/PBXBatchUpdater.swift b/Sources/XcodeProj/Utils/PBXBatchUpdater.swift index 69674ffab..a00d30c5a 100644 --- a/Sources/XcodeProj/Utils/PBXBatchUpdater.swift +++ b/Sources/XcodeProj/Utils/PBXBatchUpdater.swift @@ -28,17 +28,17 @@ public final class PBXBatchUpdater { sourceTree: PBXSourceTree = .group ) throws -> PBXFileReference { - let (group, groupPath) = try groupAndGroupPathForFile( - at: filePath, - project: project - ) - return try addFile( - to: group, - groupPath: groupPath, - filePath: filePath, - sourceTree: sourceTree - ) - } + let (group, groupPath) = try groupAndGroupPathForFile( + at: filePath, + project: project + ) + return try addFile( + to: group, + groupPath: groupPath, + filePath: filePath, + sourceTree: sourceTree + ) + } /// Adds file at the give path to the project or returns existing file and its reference. /// @@ -54,15 +54,15 @@ public final class PBXBatchUpdater { sourceTree: PBXSourceTree = .group ) throws -> PBXFileReference { - let groupPath = try group.fullPath(sourceRoot: sourceRoot)! - let filePath = groupPath + Path(fileName) - return try addFile( - to: group, - groupPath: groupPath, - filePath: filePath, - sourceTree: sourceTree - ) - } + let groupPath = try group.fullPath(sourceRoot: sourceRoot)! + let filePath = groupPath + Path(fileName) + return try addFile( + to: group, + groupPath: groupPath, + filePath: filePath, + sourceTree: sourceTree + ) + } private func addFile( to group: PBXGroup, @@ -71,36 +71,36 @@ public final class PBXBatchUpdater { sourceTree: PBXSourceTree = .group ) throws -> PBXFileReference { - if let existing = try existingFileReference(at: filePath, in: group) { - return existing - } + if let existing = try existingFileReference(at: filePath, in: group) { + return existing + } - let path: String? - switch sourceTree { - case .group: - path = filePath.relative(to: groupPath).string - case .sourceRoot: - path = filePath.relative(to: sourceRoot).string - case .absolute: - path = filePath.string - default: - path = nil - } - let fileReference = PBXFileReference( - sourceTree: sourceTree, - name: filePath.lastComponent, - explicitFileType: filePath.extension.flatMap(Xcode.filetype), - lastKnownFileType: filePath.extension.flatMap(Xcode.filetype), - path: path - ) - objects.add(object: fileReference) - fileReference.parent = group - references?[filePath] = fileReference.reference - if !group.childrenReferences.contains(fileReference.reference) { - group.childrenReferences.append(fileReference.reference) + let path: String? + switch sourceTree { + case .group: + path = filePath.relative(to: groupPath).string + case .sourceRoot: + path = filePath.relative(to: sourceRoot).string + case .absolute: + path = filePath.string + default: + path = nil + } + let fileReference = PBXFileReference( + sourceTree: sourceTree, + name: filePath.lastComponent, + explicitFileType: filePath.extension.flatMap(Xcode.filetype), + lastKnownFileType: filePath.extension.flatMap(Xcode.filetype), + path: path + ) + objects.add(object: fileReference) + fileReference.parent = group + references?[filePath] = fileReference.reference + if !group.childrenReferences.contains(fileReference.reference) { + group.childrenReferences.append(fileReference.reference) + } + return fileReference } - return fileReference - } private func existingFileReference(at filePath: Path, in group: PBXGroup) throws -> PBXFileReference? { let objectReferences = try lazilyInstantiateObjectReferences() @@ -155,14 +155,14 @@ public final class PBXBatchUpdater { with names: [String] ) throws -> PBXGroup { - var parent = group - for (index, name) in names.enumerated() { - let path = groupPath + Path(components: names[0 ... index]) - parent = try parent.addGroup(named: name).last! - groups?[path] = parent + var parent = group + for (index, name) in names.enumerated() { + let path = groupPath + Path(components: names[0 ... index]) + parent = try parent.addGroup(named: name).last! + groups?[path] = parent + } + return parent } - return parent - } private func lazilyInstantiateObjectReferences() throws -> [Path: PBXObjectReference] { @@ -174,7 +174,7 @@ public final class PBXBatchUpdater { try objects.fileReferences.compactMap { let fullPath = try $0.value.fullPath(sourceRoot: sourceRoot)! return (fullPath, $0.key) - }) + }) references = objectReferences } return objectReferences @@ -189,7 +189,7 @@ public final class PBXBatchUpdater { try objects.groups.compactMap { let fullPath = try $0.value.fullPath(sourceRoot: sourceRoot)! return (fullPath, $0.value) - }) + }) groups = unwrappedGroups } return unwrappedGroups diff --git a/Sources/XcodeProj/Utils/PlistValue.swift b/Sources/XcodeProj/Utils/PlistValue.swift index cd48273ff..abd99a51b 100644 --- a/Sources/XcodeProj/Utils/PlistValue.swift +++ b/Sources/XcodeProj/Utils/PlistValue.swift @@ -105,7 +105,7 @@ extension Dictionary where Key == String { extension Array { func plist() -> PlistValue { - return .array(compactMap { (element) -> PlistValue? in + .array(compactMap { (element) -> PlistValue? in if let array = element as? [Any] { return array.plist() } else if let dictionary = element as? [String: Any] { diff --git a/Sources/XcodeProj/Utils/XCConfig.swift b/Sources/XcodeProj/Utils/XCConfig.swift index 92ee297dd..77bdf7be9 100644 --- a/Sources/XcodeProj/Utils/XCConfig.swift +++ b/Sources/XcodeProj/Utils/XCConfig.swift @@ -51,7 +51,7 @@ final class XCConfigParser { /// - Parameter projectPath: path where the .xcodeproj is, for resolving project-relative includes. /// - Returns: function that parses the line. static func configFrom(path: Path, projectPath: Path?) -> (String) -> (include: Path, config: XCConfig)? { - return { line in + { line in includeRegex.matches(in: line, options: [], range: NSRange(location: 0, @@ -81,10 +81,10 @@ final class XCConfigParser { } static func settingFrom(line: String) -> (key: String, value: String)? { - return settingRegex.matches(in: line, - options: [], - range: NSRange(location: 0, - length: line.count)) + settingRegex.matches(in: line, + options: [], + range: NSRange(location: 0, + length: line.count)) .compactMap { (match) -> (key: String, value: String)? in if match.numberOfRanges == 3 { let key: String = NSString(string: line).substring(with: match.range(at: 1)) diff --git a/Sources/XcodeProj/Workspace/XCWorkspace.swift b/Sources/XcodeProj/Workspace/XCWorkspace.swift index 1c86d6a69..55c575d3d 100644 --- a/Sources/XcodeProj/Workspace/XCWorkspace.swift +++ b/Sources/XcodeProj/Workspace/XCWorkspace.swift @@ -62,6 +62,6 @@ public final class XCWorkspace: Writable, Equatable { // MARK: - Equatable public static func == (lhs: XCWorkspace, rhs: XCWorkspace) -> Bool { - return lhs.data == rhs.data + lhs.data == rhs.data } } diff --git a/Sources/XcodeProj/Workspace/XCWorkspaceData.swift b/Sources/XcodeProj/Workspace/XCWorkspaceData.swift index 67131cd94..61b790ca4 100644 --- a/Sources/XcodeProj/Workspace/XCWorkspaceData.swift +++ b/Sources/XcodeProj/Workspace/XCWorkspaceData.swift @@ -12,7 +12,7 @@ public final class XCWorkspaceData { extension XCWorkspaceData: Equatable { public static func == (lhs: XCWorkspaceData, rhs: XCWorkspaceData) -> Bool { - return lhs.children == rhs.children + lhs.children == rhs.children } } @@ -130,8 +130,8 @@ private extension XCWorkspaceDataFileRef { } func xmlElement() -> AEXMLElement { - return AEXMLElement(name: "FileRef", - value: nil, - attributes: ["location": location.description]) + AEXMLElement(name: "FileRef", + value: nil, + attributes: ["location": location.description]) } } diff --git a/Sources/XcodeProj/Workspace/XCWorkspaceDataElementLocationType.swift b/Sources/XcodeProj/Workspace/XCWorkspaceDataElementLocationType.swift index d3e866d35..f7401ac96 100644 --- a/Sources/XcodeProj/Workspace/XCWorkspaceDataElementLocationType.swift +++ b/Sources/XcodeProj/Workspace/XCWorkspaceDataElementLocationType.swift @@ -71,7 +71,7 @@ public enum XCWorkspaceDataElementLocationType { extension XCWorkspaceDataElementLocationType: CustomStringConvertible { public var description: String { - return "\(schema):\(path)" + "\(schema):\(path)" } } diff --git a/Sources/XcodeProj/Workspace/XCWorkspaceDataFileRef.swift b/Sources/XcodeProj/Workspace/XCWorkspaceDataFileRef.swift index 101fd8c0d..03b59dbd1 100644 --- a/Sources/XcodeProj/Workspace/XCWorkspaceDataFileRef.swift +++ b/Sources/XcodeProj/Workspace/XCWorkspaceDataFileRef.swift @@ -10,6 +10,6 @@ public final class XCWorkspaceDataFileRef { extension XCWorkspaceDataFileRef: Equatable { public static func == (lhs: XCWorkspaceDataFileRef, rhs: XCWorkspaceDataFileRef) -> Bool { - return lhs.location == rhs.location + lhs.location == rhs.location } } diff --git a/Sources/XcodeProj/Workspace/XCWorkspaceDataGroup.swift b/Sources/XcodeProj/Workspace/XCWorkspaceDataGroup.swift index ff18f9b41..5d281d89f 100644 --- a/Sources/XcodeProj/Workspace/XCWorkspaceDataGroup.swift +++ b/Sources/XcodeProj/Workspace/XCWorkspaceDataGroup.swift @@ -14,7 +14,7 @@ public final class XCWorkspaceDataGroup { extension XCWorkspaceDataGroup: Equatable { public static func == (lhs: XCWorkspaceDataGroup, rhs: XCWorkspaceDataGroup) -> Bool { - return lhs.location == rhs.location && + lhs.location == rhs.location && lhs.name == rhs.name && lhs.children == rhs.children } diff --git a/Tests/XcodeProjTests/Extensions/AEXML+XcodeFormatTests.swift b/Tests/XcodeProjTests/Extensions/AEXML+XcodeFormatTests.swift index d97c1b764..f384be869 100644 --- a/Tests/XcodeProjTests/Extensions/AEXML+XcodeFormatTests.swift +++ b/Tests/XcodeProjTests/Extensions/AEXML+XcodeFormatTests.swift @@ -5,7 +5,7 @@ import XCTest extension String { var cleaned: String { - return replacingOccurrences(of: " ", with: "").components(separatedBy: "\n").filter { !$0.isEmpty }.joined(separator: " ") + replacingOccurrences(of: " ", with: "").components(separatedBy: "\n").filter { !$0.isEmpty }.joined(separator: " ") } } diff --git a/Tests/XcodeProjTests/Objects/BuildPhase/PBXCopyFilesBuildPhaseTests.swift b/Tests/XcodeProjTests/Objects/BuildPhase/PBXCopyFilesBuildPhaseTests.swift index bff3259bf..377a09568 100644 --- a/Tests/XcodeProjTests/Objects/BuildPhase/PBXCopyFilesBuildPhaseTests.swift +++ b/Tests/XcodeProjTests/Objects/BuildPhase/PBXCopyFilesBuildPhaseTests.swift @@ -103,7 +103,7 @@ final class PBXCopyFilesBuildPhaseTests: XCTestCase { } func testDictionary() -> [String: Any] { - return [ + [ "dstPath": "dstPath", "buildActionMask": 0, "dstSubfolderSpec": 12, diff --git a/Tests/XcodeProjTests/Objects/BuildPhase/PBXFrameworksBuildPhaseTests.swift b/Tests/XcodeProjTests/Objects/BuildPhase/PBXFrameworksBuildPhaseTests.swift index 9c4e105c5..f81d04329 100644 --- a/Tests/XcodeProjTests/Objects/BuildPhase/PBXFrameworksBuildPhaseTests.swift +++ b/Tests/XcodeProjTests/Objects/BuildPhase/PBXFrameworksBuildPhaseTests.swift @@ -19,7 +19,7 @@ final class PBXFrameworksBuildPhaseTests: XCTestCase { } private func testDictionary() -> [String: Any] { - return [ + [ "files": ["file1"], "runOnlyForDeploymentPostprocessing": 0, "reference": "reference", diff --git a/Tests/XcodeProjTests/Objects/BuildPhase/PBXHeadersBuildPhaseTests.swift b/Tests/XcodeProjTests/Objects/BuildPhase/PBXHeadersBuildPhaseTests.swift index d81845815..70aad7dc8 100644 --- a/Tests/XcodeProjTests/Objects/BuildPhase/PBXHeadersBuildPhaseTests.swift +++ b/Tests/XcodeProjTests/Objects/BuildPhase/PBXHeadersBuildPhaseTests.swift @@ -41,7 +41,7 @@ final class PBXHeadersBuildPhaseTests: XCTestCase { } private func testDictionary() -> [String: Any] { - return [ + [ "buildActionMask": 3, "files": ["file"], "runOnlyForDeploymentPostprocessing": 2, diff --git a/Tests/XcodeProjTests/Objects/BuildPhase/PBXResourcesBuildPhaseTests.swift b/Tests/XcodeProjTests/Objects/BuildPhase/PBXResourcesBuildPhaseTests.swift index 83b1c8280..223c9cc34 100644 --- a/Tests/XcodeProjTests/Objects/BuildPhase/PBXResourcesBuildPhaseTests.swift +++ b/Tests/XcodeProjTests/Objects/BuildPhase/PBXResourcesBuildPhaseTests.swift @@ -8,7 +8,7 @@ final class PBXResourcesBuildPhaseTests: XCTestCase { } private func testDictionary() -> [String: Any] { - return [ + [ "files": ["file1"], "buildActionMask": "333", "runOnlyForDeploymentPostprocessing": "3", diff --git a/Tests/XcodeProjTests/Objects/BuildPhase/PBXShellScriptBuildPhaseTests.swift b/Tests/XcodeProjTests/Objects/BuildPhase/PBXShellScriptBuildPhaseTests.swift index 6850b00ff..da4dbca71 100644 --- a/Tests/XcodeProjTests/Objects/BuildPhase/PBXShellScriptBuildPhaseTests.swift +++ b/Tests/XcodeProjTests/Objects/BuildPhase/PBXShellScriptBuildPhaseTests.swift @@ -25,7 +25,7 @@ final class PBXShellScriptBuildPhaseTests: XCTestCase { } private func testDictionary() -> [String: Any] { - return [ + [ "files": ["files"], "inputPaths": ["input"], "outputPaths": ["output"], diff --git a/Tests/XcodeProjTests/Objects/BuildPhase/PBXSourcesBuildPhase+Fixtures.swift b/Tests/XcodeProjTests/Objects/BuildPhase/PBXSourcesBuildPhase+Fixtures.swift index 403ab751a..77c0de9c1 100644 --- a/Tests/XcodeProjTests/Objects/BuildPhase/PBXSourcesBuildPhase+Fixtures.swift +++ b/Tests/XcodeProjTests/Objects/BuildPhase/PBXSourcesBuildPhase+Fixtures.swift @@ -4,10 +4,10 @@ import Foundation extension PBXSourcesBuildPhase { static func fixture(files: [PBXBuildFile] = []) -> PBXSourcesBuildPhase { - return PBXSourcesBuildPhase(files: files, - inputFileListPaths: nil, - outputFileListPaths: nil, - buildActionMask: PBXBuildPhase.defaultBuildActionMask, - runOnlyForDeploymentPostprocessing: false) + PBXSourcesBuildPhase(files: files, + inputFileListPaths: nil, + outputFileListPaths: nil, + buildActionMask: PBXBuildPhase.defaultBuildActionMask, + runOnlyForDeploymentPostprocessing: false) } } diff --git a/Tests/XcodeProjTests/Objects/Configuration/XCBuildConfiguration+Fixtures.swift b/Tests/XcodeProjTests/Objects/Configuration/XCBuildConfiguration+Fixtures.swift index 94567b6ef..6c2bafdfd 100644 --- a/Tests/XcodeProjTests/Objects/Configuration/XCBuildConfiguration+Fixtures.swift +++ b/Tests/XcodeProjTests/Objects/Configuration/XCBuildConfiguration+Fixtures.swift @@ -3,6 +3,6 @@ import Foundation extension XCBuildConfiguration { static func fixture(name: String = "Debug") -> XCBuildConfiguration { - return XCBuildConfiguration(name: name) + XCBuildConfiguration(name: name) } } diff --git a/Tests/XcodeProjTests/Objects/Configuration/XCBuildConfigurationTests.swift b/Tests/XcodeProjTests/Objects/Configuration/XCBuildConfigurationTests.swift index 1483ebf6b..c818562b8 100644 --- a/Tests/XcodeProjTests/Objects/Configuration/XCBuildConfigurationTests.swift +++ b/Tests/XcodeProjTests/Objects/Configuration/XCBuildConfigurationTests.swift @@ -86,7 +86,7 @@ final class XCBuildConfigurationTests: XCTestCase { } private func testDictionary() -> [String: Any] { - return [ + [ "baseConfigurationReference": "baseConfigurationReference", "buildSettings": [:], "name": "name", diff --git a/Tests/XcodeProjTests/Objects/Configuration/XCConfigurationList+Fixtures.swift b/Tests/XcodeProjTests/Objects/Configuration/XCConfigurationList+Fixtures.swift index 6bd1dac14..f3b6e28ee 100644 --- a/Tests/XcodeProjTests/Objects/Configuration/XCConfigurationList+Fixtures.swift +++ b/Tests/XcodeProjTests/Objects/Configuration/XCConfigurationList+Fixtures.swift @@ -6,7 +6,7 @@ extension XCConfigurationList { XCBuildConfiguration.fixture(name: "Release")], defaultConfigurationName: String? = "Debug", defaultConfigurationIsVisible _: Bool = true) -> XCConfigurationList { - return XCConfigurationList(buildConfigurations: buildConfigurations, - defaultConfigurationName: defaultConfigurationName) + XCConfigurationList(buildConfigurations: buildConfigurations, + defaultConfigurationName: defaultConfigurationName) } } diff --git a/Tests/XcodeProjTests/Objects/Files/PBXContainerItemProxyTests.swift b/Tests/XcodeProjTests/Objects/Files/PBXContainerItemProxyTests.swift index fb3c0d6ee..e5e06c921 100644 --- a/Tests/XcodeProjTests/Objects/Files/PBXContainerItemProxyTests.swift +++ b/Tests/XcodeProjTests/Objects/Files/PBXContainerItemProxyTests.swift @@ -27,7 +27,7 @@ final class PBXContainerItemProxyTests: XCTestCase { } private func testDictionary() -> [String: Any] { - return [ + [ "containerPortal": "containerPortal", "remoteGlobalIDString": "remoteGlobalIDString", "remoteInfo": "remoteInfo", diff --git a/Tests/XcodeProjTests/Objects/Files/PBXFileElementTests.swift b/Tests/XcodeProjTests/Objects/Files/PBXFileElementTests.swift index a73d44f27..9adac1ad8 100644 --- a/Tests/XcodeProjTests/Objects/Files/PBXFileElementTests.swift +++ b/Tests/XcodeProjTests/Objects/Files/PBXFileElementTests.swift @@ -120,7 +120,7 @@ final class PBXFileElementTests: XCTestCase { } private func testDictionary() -> [String: Any] { - return [ + [ "sourceTree": "absolute", "path": "path", "name": "name", diff --git a/Tests/XcodeProjTests/Objects/Files/PBXFileReference+Fixtures.swift b/Tests/XcodeProjTests/Objects/Files/PBXFileReference+Fixtures.swift index 760e097bb..042d56e11 100644 --- a/Tests/XcodeProjTests/Objects/Files/PBXFileReference+Fixtures.swift +++ b/Tests/XcodeProjTests/Objects/Files/PBXFileReference+Fixtures.swift @@ -5,6 +5,6 @@ import Foundation extension PBXFileReference { static func fixture(sourceTree _: PBXSourceTree = .group, name: String? = "Test") -> PBXFileReference { - return PBXFileReference(sourceTree: .group, name: name) + PBXFileReference(sourceTree: .group, name: name) } } diff --git a/Tests/XcodeProjTests/Objects/Files/PBXFileReferenceTests.swift b/Tests/XcodeProjTests/Objects/Files/PBXFileReferenceTests.swift index 1b850a702..1ab99a3b6 100644 --- a/Tests/XcodeProjTests/Objects/Files/PBXFileReferenceTests.swift +++ b/Tests/XcodeProjTests/Objects/Files/PBXFileReferenceTests.swift @@ -39,7 +39,7 @@ final class PBXFileReferenceTests: XCTestCase { } private func testDictionary() -> [String: Any] { - return [ + [ "name": "name", "sourceTree": "group", ] diff --git a/Tests/XcodeProjTests/Objects/Files/PBXGroup+Fixtures.swift b/Tests/XcodeProjTests/Objects/Files/PBXGroup+Fixtures.swift index 14ab6aa27..0f95e2b45 100644 --- a/Tests/XcodeProjTests/Objects/Files/PBXGroup+Fixtures.swift +++ b/Tests/XcodeProjTests/Objects/Files/PBXGroup+Fixtures.swift @@ -5,8 +5,8 @@ extension PBXGroup { static func fixture(children _: [PBXFileElement] = [], sourceTree: PBXSourceTree = .group, name: String = "test") -> PBXGroup { - return PBXGroup(children: [], - sourceTree: sourceTree, - name: name) + PBXGroup(children: [], + sourceTree: sourceTree, + name: name) } } diff --git a/Tests/XcodeProjTests/Objects/Files/PBXGroupTests.swift b/Tests/XcodeProjTests/Objects/Files/PBXGroupTests.swift index 33fe3b825..d0e5a72b8 100644 --- a/Tests/XcodeProjTests/Objects/Files/PBXGroupTests.swift +++ b/Tests/XcodeProjTests/Objects/Files/PBXGroupTests.swift @@ -184,7 +184,7 @@ final class PBXGroupTests: XCTestCase { } private func makeEmptyPBXProj() -> PBXProj { - return PBXProj( + PBXProj( rootObject: nil, objectVersion: 0, archiveVersion: 0, @@ -194,7 +194,7 @@ final class PBXGroupTests: XCTestCase { } private func testDictionary() -> [String: Any] { - return [ + [ "children": ["child"], "name": "name", "sourceTree": "absolute", diff --git a/Tests/XcodeProjTests/Objects/Files/XCVersionGroup+Fixtures.swift b/Tests/XcodeProjTests/Objects/Files/XCVersionGroup+Fixtures.swift index 1fb87a83e..604c1a277 100644 --- a/Tests/XcodeProjTests/Objects/Files/XCVersionGroup+Fixtures.swift +++ b/Tests/XcodeProjTests/Objects/Files/XCVersionGroup+Fixtures.swift @@ -18,7 +18,7 @@ extension XCVersionGroup { if let currentVersion = currentVersion { objects.add(object: currentVersion) } - children.forEach({ objects.add(object: $0) }) + children.forEach { objects.add(object: $0) } objects.add(object: group) return group } diff --git a/Tests/XcodeProjTests/Objects/Project/PBXProj+Fixtures.swift b/Tests/XcodeProjTests/Objects/Project/PBXProj+Fixtures.swift index 69752cdb4..8a397023b 100644 --- a/Tests/XcodeProjTests/Objects/Project/PBXProj+Fixtures.swift +++ b/Tests/XcodeProjTests/Objects/Project/PBXProj+Fixtures.swift @@ -7,10 +7,10 @@ extension PBXProj { archiveVersion: UInt = Xcode.LastKnown.archiveVersion, classes: [String: Any] = [:], objects: [PBXObject] = []) -> PBXProj { - return PBXProj(rootObject: rootObject, - objectVersion: objectVersion, - archiveVersion: archiveVersion, - classes: classes, - objects: objects) + PBXProj(rootObject: rootObject, + objectVersion: objectVersion, + archiveVersion: archiveVersion, + classes: classes, + objects: objects) } } diff --git a/Tests/XcodeProjTests/Objects/Project/PBXProjEncoderTests.swift b/Tests/XcodeProjTests/Objects/Project/PBXProjEncoderTests.swift index 7d31493f4..7b2eb3074 100644 --- a/Tests/XcodeProjTests/Objects/Project/PBXProjEncoderTests.swift +++ b/Tests/XcodeProjTests/Objects/Project/PBXProjEncoderTests.swift @@ -321,7 +321,7 @@ class PBXProjEncoderTests: XCTestCase { } private func lines(fromFile file: String) -> [String] { - return file.replacingOccurrences(of: "\t", with: "").components(separatedBy: "\n") + file.replacingOccurrences(of: "\t", with: "").components(separatedBy: "\n") } } @@ -329,11 +329,11 @@ class PBXProjEncoderTests: XCTestCase { private extension Array where Element == String { @discardableResult func validate(line string: String, betweenLine lineAbove: Int, andLine lineBelow: Int, line: UInt = #line) -> Int { - return validate(string, using: { $0 == $1 }, betweenLine: lineAbove, andLine: lineBelow, line: line) + validate(string, using: { $0 == $1 }, betweenLine: lineAbove, andLine: lineBelow, line: line) } @discardableResult func validate(lineContaining string: String, betweenLine lineAbove: Int, andLine lineBelow: Int, line: UInt = #line) -> Int { - return validate(string, using: { $0.contains($1) }, betweenLine: lineAbove, andLine: lineBelow, line: line) + validate(string, using: { $0.contains($1) }, betweenLine: lineAbove, andLine: lineBelow, line: line) } func validate(_ string: String, using: (String, String) -> Bool, betweenLine lineAbove: Int, andLine lineBelow: Int, line: UInt) -> Int { @@ -345,11 +345,11 @@ private extension Array where Element == String { } @discardableResult func validate(line string: String, onLineAfter: Int, line: UInt = #line) -> Int { - return validate(string, using: { $0 == $1 }, onLineAfter: onLineAfter, line: line) + validate(string, using: { $0 == $1 }, onLineAfter: onLineAfter, line: line) } @discardableResult func validate(lineContaining string: String, onLineAfter: Int, line: UInt = #line) -> Int { - return validate(string, using: { $0.contains($1) }, onLineAfter: onLineAfter, line: line) + validate(string, using: { $0.contains($1) }, onLineAfter: onLineAfter, line: line) } func validate(_ string: String, using: (String, String) -> Bool, onLineAfter: Int, line: UInt) -> Int { @@ -361,11 +361,11 @@ private extension Array where Element == String { } @discardableResult func validate(line string: String, after: Int = 0, line: UInt = #line) -> Int { - return validate(string, using: { $0 == $1 }, after: after, line: line) + validate(string, using: { $0 == $1 }, after: after, line: line) } @discardableResult func validate(lineContaining string: String, after: Int = 0, line: UInt = #line) -> Int { - return validate(string, using: { $0.contains($1) }, after: after, line: line) + validate(string, using: { $0.contains($1) }, after: after, line: line) } func validate(_ string: String, using: (String, String) -> Bool, after: Int, line: UInt) -> Int { @@ -377,11 +377,11 @@ private extension Array where Element == String { } func findLine(_ string: String, after: Int = 0) -> Int { - return findLine(string, matcher: { $0 == $1 }, after: after) + findLine(string, matcher: { $0 == $1 }, after: after) } func findLine(containing string: String, after: Int = 0) -> Int { - return findLine(string, matcher: { $0.contains($1) }, after: after) + findLine(string, matcher: { $0.contains($1) }, after: after) } func findLine(_ string: String, matcher: (String, String) -> Bool, after: Int) -> Int { diff --git a/Tests/XcodeProjTests/Objects/Project/PBXProject+Fixtures.swift b/Tests/XcodeProjTests/Objects/Project/PBXProject+Fixtures.swift index 5edc67534..66e8f9164 100644 --- a/Tests/XcodeProjTests/Objects/Project/PBXProject+Fixtures.swift +++ b/Tests/XcodeProjTests/Objects/Project/PBXProject+Fixtures.swift @@ -6,9 +6,9 @@ extension PBXProject { buildConfigurationList: XCConfigurationList = XCConfigurationList.fixture(), compatibilityVersion: String = Xcode.Default.compatibilityVersion, mainGroup: PBXGroup = PBXGroup.fixture()) -> PBXProject { - return PBXProject(name: name, - buildConfigurationList: buildConfigurationList, - compatibilityVersion: compatibilityVersion, - mainGroup: mainGroup) + PBXProject(name: name, + buildConfigurationList: buildConfigurationList, + compatibilityVersion: compatibilityVersion, + mainGroup: mainGroup) } } diff --git a/Tests/XcodeProjTests/Objects/Targets/PBXAggregateTargetTests.swift b/Tests/XcodeProjTests/Objects/Targets/PBXAggregateTargetTests.swift index d6f9278c4..3e879e75a 100644 --- a/Tests/XcodeProjTests/Objects/Targets/PBXAggregateTargetTests.swift +++ b/Tests/XcodeProjTests/Objects/Targets/PBXAggregateTargetTests.swift @@ -19,7 +19,7 @@ final class PBXAggregateTargetTests: XCTestCase { } func testDictionary() -> [String: Any] { - return [ + [ "buildConfigurationList": "buildConfigurationList", "buildPhases": ["phase"], "buildRules": ["rule"], diff --git a/Tests/XcodeProjTests/Objects/Targets/PBXNativeTargetTests.swift b/Tests/XcodeProjTests/Objects/Targets/PBXNativeTargetTests.swift index 7f82ff482..5dd690fe5 100644 --- a/Tests/XcodeProjTests/Objects/Targets/PBXNativeTargetTests.swift +++ b/Tests/XcodeProjTests/Objects/Targets/PBXNativeTargetTests.swift @@ -19,7 +19,7 @@ final class PBXNativeTargetTests: XCTestCase { } private func testDictionary() -> [String: Any] { - return [ + [ "buildConfigurationList": "test", "buildPhases": ["phase"], "buildRules": ["rule"], diff --git a/Tests/XcodeProjTests/Objects/Targets/PBXTarget+Fixtures.swift b/Tests/XcodeProjTests/Objects/Targets/PBXTarget+Fixtures.swift index 2cbbf25b2..84e882f5d 100644 --- a/Tests/XcodeProjTests/Objects/Targets/PBXTarget+Fixtures.swift +++ b/Tests/XcodeProjTests/Objects/Targets/PBXTarget+Fixtures.swift @@ -11,13 +11,13 @@ extension PBXTarget { productName: String? = "Test", product: PBXFileReference = PBXFileReference.fixture(name: "Test.app"), productType: PBXProductType = PBXProductType.application) -> PBXTarget { - return PBXTarget(name: name, - buildConfigurationList: buildConfigurationList, - buildPhases: buildPhases, - buildRules: buildRules, - dependencies: dependencies, - productName: productName, - product: product, - productType: productType) + PBXTarget(name: name, + buildConfigurationList: buildConfigurationList, + buildPhases: buildPhases, + buildRules: buildRules, + dependencies: dependencies, + productName: productName, + product: product, + productType: productType) } } diff --git a/Tests/XcodeProjTests/Project/XCBreakpointListTests.swift b/Tests/XcodeProjTests/Project/XCBreakpointListTests.swift index c3e95ca35..afe9f930d 100644 --- a/Tests/XcodeProjTests/Project/XCBreakpointListTests.swift +++ b/Tests/XcodeProjTests/Project/XCBreakpointListTests.swift @@ -107,6 +107,6 @@ final class XCBreakpointListIntegrationTests: XCTestCase { } private func fixturePath() -> Path { - return fixturesPath() + "iOS/Project.xcodeproj/xcshareddata/xcdebugger/Breakpoints_v2.xcbkptlist" + fixturesPath() + "iOS/Project.xcodeproj/xcshareddata/xcdebugger/Breakpoints_v2.xcbkptlist" } } diff --git a/Tests/XcodeProjTests/Scheme/XCSchemeTests.swift b/Tests/XcodeProjTests/Scheme/XCSchemeTests.swift index 2e1e721d2..9569529c3 100644 --- a/Tests/XcodeProjTests/Scheme/XCSchemeTests.swift +++ b/Tests/XcodeProjTests/Scheme/XCSchemeTests.swift @@ -8,7 +8,7 @@ final class XCSchemeIntegrationTests: XCTestCase { let subject = try XCScheme(path: iosSchemePath) assert(scheme: subject) } - + func test_write_iosScheme() { testWrite(from: iosSchemePath, initModel: { try? XCScheme(path: $0) }, @@ -95,9 +95,9 @@ final class XCSchemeIntegrationTests: XCTestCase { let subject = reference.xmlElement() // When - let selectedTests = subject.children.first { $0.name == "SelectedTests"} - let skippedTests = subject.children.first { $0.name == "SkippedTests"} - let firstSelectedTest = selectedTests?.children.first { $0.name == "Test"} + let selectedTests = subject.children.first { $0.name == "SelectedTests" } + let skippedTests = subject.children.first { $0.name == "SkippedTests" } + let firstSelectedTest = selectedTests?.children.first { $0.name == "Test" } // Then XCTAssertNil(skippedTests) @@ -121,29 +121,29 @@ final class XCSchemeIntegrationTests: XCTestCase { XCTAssertEqual(subject.attributes["reference"], "to_some_paht") XCTAssertEqual(subject.attributes["default"], "YES") } - + func test_testAction_pathRunnable_serializingAndDeserializing() throws { // Given let filePath = "/usr/bin/foo" let pathRunnable = XCScheme.PathRunnable(filePath: filePath, runnableDebuggingMode: "0") let subject = XCScheme.LaunchAction(runnable: nil, buildConfiguration: "Debug", pathRunnable: pathRunnable) - + // When let element = subject.xmlElement() let reconstructedSubject = try XCScheme.LaunchAction(element: element) - + // Then XCTAssertEqual(subject, reconstructedSubject) } - + func test_testAction_serializingAndDeserializing() throws { // Given let subject = XCScheme.TestAction(buildConfiguration: "Debug", macroExpansion: nil) - + // When let element = subject.xmlElement() let reconstructedSubject = try XCScheme.TestAction(element: element) - + // Then XCTAssertEqual(subject, reconstructedSubject) } @@ -153,7 +153,6 @@ final class XCSchemeIntegrationTests: XCTestCase { let lldbInitPath = "/Users/user/custom/.lldbinit" let subject = XCScheme.LaunchAction(runnable: nil, buildConfiguration: "Debug", customLLDBInitFile: lldbInitPath) - // When let element = subject.xmlElement() let reconstructedSubject = try XCScheme.LaunchAction(element: element) @@ -167,7 +166,6 @@ final class XCSchemeIntegrationTests: XCTestCase { let lldbInitPath = "/Users/user/custom/.lldbinit" let subject = XCScheme.TestAction(buildConfiguration: "Debug", macroExpansion: nil, customLLDBInitFile: lldbInitPath) - // When let element = subject.xmlElement() let reconstructedSubject = try XCScheme.TestAction(element: element) @@ -210,21 +208,21 @@ final class XCSchemeIntegrationTests: XCTestCase { let buildableReferenceA = try buildableReferenceWithStringBluePrint(name: "A") let buildableReferenceB = try buildableReferenceWithStringBluePrint(name: "B") let remoteRunnableA1 = XCScheme.RemoteRunnable(buildableReference: buildableReferenceA, - bundleIdentifier: "io.tuist", - runnableDebuggingMode: "0", - remotePath: "/Some/Path") + bundleIdentifier: "io.tuist", + runnableDebuggingMode: "0", + remotePath: "/Some/Path") let remoteRunnableA2 = XCScheme.RemoteRunnable(buildableReference: buildableReferenceA, - bundleIdentifier: "io.tuist", - runnableDebuggingMode: "0", - remotePath: "/Some/Path") - let remoteRunnableA3 = XCScheme.RemoteRunnable(buildableReference: buildableReferenceA, - bundleIdentifier: "io.another.tuist", - runnableDebuggingMode: "2", - remotePath: "/Some/Other/Path") - let remoteRunnableB = XCScheme.RemoteRunnable(buildableReference: buildableReferenceB, bundleIdentifier: "io.tuist", runnableDebuggingMode: "0", remotePath: "/Some/Path") + let remoteRunnableA3 = XCScheme.RemoteRunnable(buildableReference: buildableReferenceA, + bundleIdentifier: "io.another.tuist", + runnableDebuggingMode: "2", + remotePath: "/Some/Other/Path") + let remoteRunnableB = XCScheme.RemoteRunnable(buildableReference: buildableReferenceB, + bundleIdentifier: "io.tuist", + runnableDebuggingMode: "0", + remotePath: "/Some/Path") let runnableA1 = XCScheme.Runnable(buildableReference: buildableReferenceA, runnableDebuggingMode: "0") @@ -512,16 +510,16 @@ final class XCSchemeIntegrationTests: XCTestCase { } private var iosSchemePath: Path { - return fixturesPath() + "iOS/Project.xcodeproj/xcshareddata/xcschemes/iOS.xcscheme" + fixturesPath() + "iOS/Project.xcodeproj/xcshareddata/xcschemes/iOS.xcscheme" } private var minimalSchemePath: Path { // Not strictly minimal in the sense that it specifies the least amount of information to be valid, // but minimal in the sense it doesn't have most of the standard elements and attributes. - return fixturesPath() + "Schemes/MinimalInformation.xcscheme" + fixturesPath() + "Schemes/MinimalInformation.xcscheme" } private var watchAppSchemePath: Path { - return fixturesPath() + "iOS/AppWithExtensions/AppWithExtensions.xcodeproj/xcshareddata/xcschemes/WatchApp.xcscheme" + fixturesPath() + "iOS/AppWithExtensions/AppWithExtensions.xcodeproj/xcshareddata/xcschemes/WatchApp.xcscheme" } } diff --git a/Tests/XcodeProjTests/Tests/Fixtures.swift b/Tests/XcodeProjTests/Tests/Fixtures.swift index 10511fa03..0222869f1 100644 --- a/Tests/XcodeProjTests/Tests/Fixtures.swift +++ b/Tests/XcodeProjTests/Tests/Fixtures.swift @@ -3,7 +3,7 @@ import PathKit import XcodeProj func fixturesPath() -> Path { - return Path(#file).parent().parent().parent().parent() + "Fixtures" + Path(#file).parent().parent().parent().parent() + "Fixtures" } func iosProjectDictionary() -> (Path, [String: Any]) { diff --git a/Tests/XcodeProjTests/Utils/BuildSettingsProviderTests.swift b/Tests/XcodeProjTests/Utils/BuildSettingsProviderTests.swift index 2723c49bc..9e8e86de5 100644 --- a/Tests/XcodeProjTests/Utils/BuildSettingsProviderTests.swift +++ b/Tests/XcodeProjTests/Utils/BuildSettingsProviderTests.swift @@ -3,37 +3,36 @@ import XCTest @testable import XcodeProj class BuildSettingProviderTests: XCTestCase { - func test_targetSettings_iosAplication() { // Given / When let results = BuildSettingsProvider.targetDefault(variant: .release, platform: .iOS, product: .application, swift: true) - + // Then assertEqualSettings(results, [ "ASSETCATALOG_COMPILER_APPICON_NAME": "AppIcon", "ENABLE_PREVIEWS": "YES", "CODE_SIGN_IDENTITY": "iPhone Developer", "LD_RUNPATH_SEARCH_PATHS": [ - "$(inherited)", - "@executable_path/Frameworks" + "$(inherited)", + "@executable_path/Frameworks", ], "SDKROOT": "iphoneos", "SWIFT_COMPILATION_MODE": "wholemodule", "SWIFT_OPTIMIZATION_LEVEL": "-Owholemodule", - "TARGETED_DEVICE_FAMILY": "1,2" + "TARGETED_DEVICE_FAMILY": "1,2", ]) } - + func test_targetSettings_iosFramework() { // Given / When let results = BuildSettingsProvider.targetDefault(variant: .release, platform: .iOS, product: .framework, swift: true) - + // Then assertEqualSettings(results, [ "CODE_SIGN_IDENTITY": "", @@ -46,7 +45,7 @@ class BuildSettingProviderTests: XCTestCase { "LD_RUNPATH_SEARCH_PATHS": [ "$(inherited)", "@executable_path/Frameworks", - "@loader_path/Frameworks" + "@loader_path/Frameworks", ], "PRODUCT_NAME": "$(TARGET_NAME:c99extidentifier)", "SDKROOT": "iphoneos", @@ -55,17 +54,17 @@ class BuildSettingProviderTests: XCTestCase { "SWIFT_OPTIMIZATION_LEVEL": "-Owholemodule", "TARGETED_DEVICE_FAMILY": "1,2", "VERSIONING_SYSTEM": "apple-generic", - "VERSION_INFO_PREFIX": "" + "VERSION_INFO_PREFIX": "", ]) } - + func test_targetSettings_iosExtension() { // Given / When let results = BuildSettingsProvider.targetDefault(variant: .release, platform: .iOS, product: .appExtension, swift: true) - + // Then assertEqualSettings(results, [ "CODE_SIGN_IDENTITY": "iPhone Developer", @@ -80,14 +79,14 @@ class BuildSettingProviderTests: XCTestCase { "TARGETED_DEVICE_FAMILY": "1,2", ]) } - + func test_targetSettings_macOSAplication() { // Given / When let results = BuildSettingsProvider.targetDefault(variant: .release, platform: .macOS, product: .application, swift: true) - + // Then assertEqualSettings(results, [ "ASSETCATALOG_COMPILER_APPICON_NAME": "AppIcon", @@ -95,45 +94,45 @@ class BuildSettingProviderTests: XCTestCase { "CODE_SIGN_IDENTITY": "-", "COMBINE_HIDPI_IMAGES": "YES", "LD_RUNPATH_SEARCH_PATHS": [ - "$(inherited)", - "@executable_path/../Frameworks" + "$(inherited)", + "@executable_path/../Frameworks", ], "SDKROOT": "macosx", "SWIFT_COMPILATION_MODE": "wholemodule", - "SWIFT_OPTIMIZATION_LEVEL": "-Owholemodule" + "SWIFT_OPTIMIZATION_LEVEL": "-Owholemodule", ]) } - + func test_targetSettings_tvOSAplication() { // Given / When let results = BuildSettingsProvider.targetDefault(variant: .release, platform: .tvOS, product: .application, swift: true) - + // Then assertEqualSettings(results, [ "ASSETCATALOG_COMPILER_APPICON_NAME": "App Icon & Top Shelf Image", "ENABLE_PREVIEWS": "YES", "ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME": "LaunchImage", "LD_RUNPATH_SEARCH_PATHS": [ - "$(inherited)", - "@executable_path/Frameworks" + "$(inherited)", + "@executable_path/Frameworks", ], "SDKROOT": "appletvos", "SWIFT_COMPILATION_MODE": "wholemodule", "SWIFT_OPTIMIZATION_LEVEL": "-Owholemodule", - "TARGETED_DEVICE_FAMILY": "3" + "TARGETED_DEVICE_FAMILY": "3", ]) } - + func test_targetSettings_watchOSAplication() { // Given / When let results = BuildSettingsProvider.targetDefault(variant: .release, platform: .watchOS, product: .application, swift: true) - + // Then assertEqualSettings(results, [ "ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES": "YES", @@ -143,17 +142,17 @@ class BuildSettingProviderTests: XCTestCase { "SKIP_INSTALL": "YES", "SWIFT_COMPILATION_MODE": "wholemodule", "SWIFT_OPTIMIZATION_LEVEL": "-Owholemodule", - "TARGETED_DEVICE_FAMILY": "4" + "TARGETED_DEVICE_FAMILY": "4", ]) } - + func test_targetSettings_iOSUnitTests() { // Given / When let results = BuildSettingsProvider.targetDefault(variant: .debug, platform: .iOS, product: .unitTests, swift: true) - + // Then assertEqualSettings(results, [ "CODE_SIGN_IDENTITY": "iPhone Developer", @@ -161,22 +160,22 @@ class BuildSettingProviderTests: XCTestCase { "LD_RUNPATH_SEARCH_PATHS": [ "$(inherited)", "@executable_path/Frameworks", - "@loader_path/Frameworks" + "@loader_path/Frameworks", ], "SWIFT_ACTIVE_COMPILATION_CONDITIONS": "DEBUG", "SWIFT_COMPILATION_MODE": "singlefile", "SWIFT_OPTIMIZATION_LEVEL": "-Onone", - "TARGETED_DEVICE_FAMILY": "1,2" + "TARGETED_DEVICE_FAMILY": "1,2", ]) } - + func test_targetSettings_iOSUITests() { // Given / When let results = BuildSettingsProvider.targetDefault(variant: .debug, platform: .iOS, product: .uiTests, swift: true) - + // Then assertEqualSettings(results, [ "CODE_SIGN_IDENTITY": "iPhone Developer", @@ -184,22 +183,22 @@ class BuildSettingProviderTests: XCTestCase { "LD_RUNPATH_SEARCH_PATHS": [ "$(inherited)", "@executable_path/Frameworks", - "@loader_path/Frameworks" + "@loader_path/Frameworks", ], "SWIFT_ACTIVE_COMPILATION_CONDITIONS": "DEBUG", "SWIFT_COMPILATION_MODE": "singlefile", "SWIFT_OPTIMIZATION_LEVEL": "-Onone", - "TARGETED_DEVICE_FAMILY": "1,2" + "TARGETED_DEVICE_FAMILY": "1,2", ]) } - + func test_targetSettings_macOSUnitTests() { // Given / When let results = BuildSettingsProvider.targetDefault(variant: .debug, platform: .macOS, product: .unitTests, swift: true) - + // Then assertEqualSettings(results, [ "CODE_SIGN_IDENTITY": "-", @@ -207,38 +206,38 @@ class BuildSettingProviderTests: XCTestCase { "LD_RUNPATH_SEARCH_PATHS": [ "$(inherited)", "@executable_path/../Frameworks", - "@loader_path/../Frameworks" + "@loader_path/../Frameworks", ], "SWIFT_ACTIVE_COMPILATION_CONDITIONS": "DEBUG", "SWIFT_COMPILATION_MODE": "singlefile", "SWIFT_OPTIMIZATION_LEVEL": "-Onone", ]) } - + func test_targetSettings_tvOSUnitTests() { // Given / When let results = BuildSettingsProvider.targetDefault(variant: .debug, platform: .tvOS, product: .unitTests, swift: true) - + // Then assertEqualSettings(results, [ "SDKROOT": "appletvos", "LD_RUNPATH_SEARCH_PATHS": [ "$(inherited)", "@executable_path/Frameworks", - "@loader_path/Frameworks" + "@loader_path/Frameworks", ], "SWIFT_ACTIVE_COMPILATION_CONDITIONS": "DEBUG", "SWIFT_COMPILATION_MODE": "singlefile", "SWIFT_OPTIMIZATION_LEVEL": "-Onone", - "TARGETED_DEVICE_FAMILY": "3" + "TARGETED_DEVICE_FAMILY": "3", ]) } - + // MARK: - Helpers - + func assertEqualSettings(_ lhs: BuildSettings, _ rhs: BuildSettings, file: StaticString = #file, line: UInt = #line) { XCTAssertEqual(lhs as NSDictionary, rhs as NSDictionary, diff --git a/Tests/XcodeProjTests/Utils/ReferenceGeneratorTests.swift b/Tests/XcodeProjTests/Utils/ReferenceGeneratorTests.swift index e288b1eba..988d2f106 100644 --- a/Tests/XcodeProjTests/Utils/ReferenceGeneratorTests.swift +++ b/Tests/XcodeProjTests/Utils/ReferenceGeneratorTests.swift @@ -97,11 +97,11 @@ private extension PBXProj { } func makeFileReference() -> PBXFileReference { - self.makeFileReference(with: Path("../Remote.xcodeproj")) + makeFileReference(with: Path("../Remote.xcodeproj")) } func makeFileReference(with path: Path) -> PBXFileReference { - return try! rootObject!.mainGroup.addFile(at: path, sourceRoot: Path("/"), validatePresence: false) + try! rootObject!.mainGroup.addFile(at: path, sourceRoot: Path("/"), validatePresence: false) } func makeContainerItemProxy(fileReference: PBXFileReference) -> PBXContainerItemProxy { diff --git a/Tests/XcodeProjTests/Utils/XCConfigTests.swift b/Tests/XcodeProjTests/Utils/XCConfigTests.swift index 9940cf95a..692c7d6c0 100644 --- a/Tests/XcodeProjTests/Utils/XCConfigTests.swift +++ b/Tests/XcodeProjTests/Utils/XCConfigTests.swift @@ -93,11 +93,11 @@ final class XCConfigIntegrationTests: XCTestCase { } private func childrenPath() -> Path { - return fixturesPath() + "XCConfigs/Children.xcconfig" + fixturesPath() + "XCConfigs/Children.xcconfig" } private func parentPath() -> Path { - return fixturesPath() + "XCConfigs/Parent.xcconfig" + fixturesPath() + "XCConfigs/Parent.xcconfig" } private func assert(config: XCConfig) { diff --git a/Tests/XcodeProjTests/Workspace/XCWorkspaceDataElementTests.swift b/Tests/XcodeProjTests/Workspace/XCWorkspaceDataElementTests.swift index 1073098f4..8c2ecffa9 100644 --- a/Tests/XcodeProjTests/Workspace/XCWorkspaceDataElementTests.swift +++ b/Tests/XcodeProjTests/Workspace/XCWorkspaceDataElementTests.swift @@ -21,13 +21,13 @@ final class XCWorkspaceDataElementTests: XCTestCase { XCTAssertEqual(element.location, location) } - + func test_equatable_when_unequal_data_elements() { // Given let location: XCWorkspaceDataElementLocationType = .absolute("/path/to/file.swift") let file = XCWorkspaceDataFileRef(location: location) let element = XCWorkspaceDataElement.file(file) - + // When let firstWorkspace = XCWorkspace(data: .init(children: [element])) let secondWorkspace = XCWorkspace(data: .init(children: [])) @@ -35,7 +35,7 @@ final class XCWorkspaceDataElementTests: XCTestCase { // Then XCTAssertNotEqual(firstWorkspace, secondWorkspace) } - + func test_equatable_when_equal_data_elements() { // Given let groupLocation: XCWorkspaceDataElementLocationType = .absolute("/path/to/group") @@ -43,11 +43,11 @@ final class XCWorkspaceDataElementTests: XCTestCase { name: "group", children: []) let elementOne = XCWorkspaceDataElement.group(group) - + let fileLocation: XCWorkspaceDataElementLocationType = .absolute("/path/to/file.swift") let file = XCWorkspaceDataFileRef(location: fileLocation) let elementTwo = XCWorkspaceDataElement.file(file) - + // When let firstWorkspace = XCWorkspace(data: .init(children: [elementOne, elementTwo])) let secondWorkspace = XCWorkspace(data: .init(children: [elementOne, elementTwo])) diff --git a/Tests/XcodeProjTests/Workspace/XCWorkspaceDataTests.swift b/Tests/XcodeProjTests/Workspace/XCWorkspaceDataTests.swift index 68aa7c5e6..e3effd94a 100644 --- a/Tests/XcodeProjTests/Workspace/XCWorkspaceDataTests.swift +++ b/Tests/XcodeProjTests/Workspace/XCWorkspaceDataTests.swift @@ -112,7 +112,7 @@ final class XCWorkspaceDataIntegrationTests: XCTestCase { // MARK: - Private private func fixturePath() -> Path { - return fixturesPath() + "iOS/Project.xcodeproj/project.xcworkspace/contents.xcworkspacedata" + fixturesPath() + "iOS/Project.xcodeproj/project.xcworkspace/contents.xcworkspacedata" } private func fixtureWorkspace() throws -> XCWorkspace { diff --git a/Tests/XcodeProjTests/Workspace/XCWorkspaceTests.swift b/Tests/XcodeProjTests/Workspace/XCWorkspaceTests.swift index ce64b3b1d..0142bca86 100644 --- a/Tests/XcodeProjTests/Workspace/XCWorkspaceTests.swift +++ b/Tests/XcodeProjTests/Workspace/XCWorkspaceTests.swift @@ -21,16 +21,16 @@ final class XCWorkspaceIntegrationTests: XCTestCase { XCTAssertEqual(XCWorkspace().data.children.count, 1) XCTAssertEqual(XCWorkspace().data.children.first, .file(.init(location: .self("")))) } - + func test_equatable_emptyWorkspacesAreEqual() { // When let firstWorkspace = XCWorkspace(data: .init(children: [])) let secondWorkspace = XCWorkspace(data: .init(children: [])) - + // Then XCTAssertEqual(firstWorkspace, secondWorkspace) } - + func test_equatable_unEqualWorkspacesAreNotEqual() { // Given let pathOne = fixturesPath() + "iOS/Project.xcodeproj/project.xcworkspace" @@ -39,11 +39,11 @@ final class XCWorkspaceIntegrationTests: XCTestCase { // When let firstWorkspace = try? XCWorkspace(path: pathOne) let secondWorkspace = try? XCWorkspace(path: pathTwo) - + // Then XCTAssertNotEqual(firstWorkspace, secondWorkspace) } - + func test_equatable_equalWorkspacesAreEqual() { // Given let pathOne = fixturesPath() + "iOS/Workspace.xcworkspace" @@ -52,7 +52,7 @@ final class XCWorkspaceIntegrationTests: XCTestCase { // When let firstWorkspace = try? XCWorkspace(path: pathOne) let secondWorkspace = try? XCWorkspace(path: pathTwo) - + // Then XCTAssertEqual(firstWorkspace, secondWorkspace) } From f54ce91a2df8ce0d565db72d21faa5de3e151cec Mon Sep 17 00:00:00 2001 From: Adam Khazi Date: Tue, 18 Aug 2020 18:57:57 +0100 Subject: [PATCH 075/678] .bundle `explicitFileType` corrected (#563) * .bundle explicit file type corrected * changelog --- CHANGELOG.md | 3 +++ Sources/XcodeProj/Project/Xcode.swift | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index af96e02c2..6e2be62e3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,9 @@ ## Next +### Fixed +- explicitFileType corrected for .bundle https://github.com/tuist/XcodeProj/pull/563 by @adamkhazi + ## 7.14.0 ### Fixed diff --git a/Sources/XcodeProj/Project/Xcode.swift b/Sources/XcodeProj/Project/Xcode.swift index 4e3958ef8..6384e9a59 100644 --- a/Sources/XcodeProj/Project/Xcode.swift +++ b/Sources/XcodeProj/Project/Xcode.swift @@ -102,7 +102,7 @@ public struct Xcode { "avi": "video.avi", "bin": "archive.macbinary", "bmp": "image.bmp", - "bundle": "wrapper.plug-in", + "bundle": "wrapper.cfbundle", "c": "sourcecode.c.c", "c++": "sourcecode.cpp.cpp", "cc": "sourcecode.cpp.cpp", From 2ea33deefc816faf91b4a287cc92076c7198150d Mon Sep 17 00:00:00 2001 From: Bartosz Polaczyk Date: Tue, 6 Oct 2020 18:57:40 +0200 Subject: [PATCH 076/678] Add PBXShellScriptBuildPhase.dependencyFile (#568) * Add PBXShellScriptBuildPhase.dependencyFile * Update PR number in Changelog --- CHANGELOG.md | 3 +++ .../BuildPhase/PBXShellScriptBuildPhase.swift | 13 +++++++++- .../Objects/Sourcery/Equality.generated.swift | 1 + .../PBXShellScriptBuildPhaseTests.swift | 26 +++++++++++++++++++ 4 files changed, 42 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6e2be62e3..302f51d65 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,9 @@ ### Fixed - explicitFileType corrected for .bundle https://github.com/tuist/XcodeProj/pull/563 by @adamkhazi +### Added +- Added `PBXShellScriptBuildPhase.dependencyFile` attribute https://github.com/tuist/xcodeproj/pull/568 by @polac24 + ## 7.14.0 ### Fixed diff --git a/Sources/XcodeProj/Objects/BuildPhase/PBXShellScriptBuildPhase.swift b/Sources/XcodeProj/Objects/BuildPhase/PBXShellScriptBuildPhase.swift index 28d61dcf3..5f4116052 100644 --- a/Sources/XcodeProj/Objects/BuildPhase/PBXShellScriptBuildPhase.swift +++ b/Sources/XcodeProj/Objects/BuildPhase/PBXShellScriptBuildPhase.swift @@ -22,6 +22,9 @@ public final class PBXShellScriptBuildPhase: PBXBuildPhase { /// Show environment variables in the logs. public var showEnvVarsInLog: Bool + /// Path to the discovery .d dependency file + public var dependencyFile: String? + override public var buildPhase: BuildPhase { .runScript } @@ -39,6 +42,7 @@ public final class PBXShellScriptBuildPhase: PBXBuildPhase { /// - shellPath: shell path. /// - shellScript: shell script. /// - buildActionMask: build action mask. + /// - dependencyFile: discovery dependency file path. public init(files: [PBXBuildFile] = [], name: String? = nil, inputPaths: [String] = [], @@ -49,13 +53,15 @@ public final class PBXShellScriptBuildPhase: PBXBuildPhase { shellScript: String? = nil, buildActionMask: UInt = defaultBuildActionMask, runOnlyForDeploymentPostprocessing: Bool = false, - showEnvVarsInLog: Bool = true) { + showEnvVarsInLog: Bool = true, + dependencyFile: String? = nil) { self.name = name self.inputPaths = inputPaths self.outputPaths = outputPaths self.shellPath = shellPath self.shellScript = shellScript self.showEnvVarsInLog = showEnvVarsInLog + self.dependencyFile = dependencyFile super.init(files: files, inputFileListPaths: inputFileListPaths, outputFileListPaths: outputFileListPaths, @@ -72,6 +78,7 @@ public final class PBXShellScriptBuildPhase: PBXBuildPhase { case shellPath case shellScript case showEnvVarsInLog + case dependencyFile } public required init(from decoder: Decoder) throws { @@ -82,6 +89,7 @@ public final class PBXShellScriptBuildPhase: PBXBuildPhase { shellPath = try container.decodeIfPresent(.shellPath) shellScript = try container.decodeIfPresent(.shellScript) showEnvVarsInLog = try container.decodeIntBoolIfPresent(.showEnvVarsInLog) ?? true + dependencyFile = try container.decodeIfPresent(.dependencyFile) try super.init(from: decoder) } } @@ -103,6 +111,9 @@ extension PBXShellScriptBuildPhase: PlistSerializable { if let shellScript = shellScript { dictionary["shellScript"] = .string(CommentedString(shellScript)) } + if let dependencyFile = dependencyFile { + dictionary["dependencyFile"] = .string(CommentedString(dependencyFile)) + } if !showEnvVarsInLog { // Xcode only writes this key if it's set to false; default is true and is omitted dictionary["showEnvVarsInLog"] = .string(CommentedString("\(showEnvVarsInLog.int)")) diff --git a/Sources/XcodeProj/Objects/Sourcery/Equality.generated.swift b/Sources/XcodeProj/Objects/Sourcery/Equality.generated.swift index 468ca29e0..edb8b05a3 100644 --- a/Sources/XcodeProj/Objects/Sourcery/Equality.generated.swift +++ b/Sources/XcodeProj/Objects/Sourcery/Equality.generated.swift @@ -219,6 +219,7 @@ extension PBXShellScriptBuildPhase { if shellPath != rhs.shellPath { return false } if shellScript != rhs.shellScript { return false } if showEnvVarsInLog != rhs.showEnvVarsInLog { return false } + if dependencyFile != rhs.dependencyFile { return false } return super.isEqual(to: rhs) } } diff --git a/Tests/XcodeProjTests/Objects/BuildPhase/PBXShellScriptBuildPhaseTests.swift b/Tests/XcodeProjTests/Objects/BuildPhase/PBXShellScriptBuildPhaseTests.swift index da4dbca71..4a0aea7a4 100644 --- a/Tests/XcodeProjTests/Objects/BuildPhase/PBXShellScriptBuildPhaseTests.swift +++ b/Tests/XcodeProjTests/Objects/BuildPhase/PBXShellScriptBuildPhaseTests.swift @@ -24,6 +24,32 @@ final class PBXShellScriptBuildPhaseTests: XCTestCase { } } + func test_write_dependencyFile() throws { + let discoveryPath = "$(DERIVED_FILE_DIR)/target.d" + let discovery = PBXShellScriptBuildPhase(dependencyFile: discoveryPath) + let proj = PBXProj.fixture() + + let (_, discoveryPlistValue) = try discovery.plistKeyAndValue(proj: proj, reference: "ref") + + XCTAssertEqual(discoveryPlistValue.dictionary?["dependencyFile"]?.string, CommentedString(discoveryPath)) + } + + func test_skips_nilDependencyFile() throws { + let noDiscovery = PBXShellScriptBuildPhase(dependencyFile: nil) + let proj = PBXProj.fixture() + + let (_, noDiscoveryPlistValue) = try noDiscovery.plistKeyAndValue(proj: proj, reference: "ref") + + XCTAssertNil(noDiscoveryPlistValue.dictionary?["dependencyFile"]) + } + + func test_notequal_differentDependencyFile() throws { + let noDiscovery = PBXShellScriptBuildPhase(dependencyFile: nil) + let discovery = PBXShellScriptBuildPhase(dependencyFile: "$(DERIVED_FILE_DIR)/target.d") + + XCTAssertNotEqual(noDiscovery, discovery) + } + private func testDictionary() -> [String: Any] { [ "files": ["files"], From 45f099ab4fa5ef1550319a174a1ed664f4576db8 Mon Sep 17 00:00:00 2001 From: Marcin Iwanicki Date: Tue, 6 Oct 2020 18:22:09 +0100 Subject: [PATCH 077/678] Add support for alwaysOutOfDate flag in PBXShellScriptBuildPhase (#572) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Add support for alwaysOutOfDate flag in PBXShellScriptBuildPhase * Update CHANGELOG * Fix typo Co-authored-by: Marcin Iwanicki Co-authored-by: Pedro Piñera Buendía --- CHANGELOG.md | 1 + .../BuildPhase/PBXShellScriptBuildPhase.swift | 12 ++++++++++ .../PBXShellScriptBuildPhaseTests.swift | 22 +++++++++++++++++++ 3 files changed, 35 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 302f51d65..a93694183 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ - explicitFileType corrected for .bundle https://github.com/tuist/XcodeProj/pull/563 by @adamkhazi ### Added +- Add support for alwaysOutOfDate flag in PBXShellScriptBuildPhase https://github.com/tuist/XcodeProj/pull/572 by @marciniwanicki - Added `PBXShellScriptBuildPhase.dependencyFile` attribute https://github.com/tuist/xcodeproj/pull/568 by @polac24 ## 7.14.0 diff --git a/Sources/XcodeProj/Objects/BuildPhase/PBXShellScriptBuildPhase.swift b/Sources/XcodeProj/Objects/BuildPhase/PBXShellScriptBuildPhase.swift index 5f4116052..4533e1c2a 100644 --- a/Sources/XcodeProj/Objects/BuildPhase/PBXShellScriptBuildPhase.swift +++ b/Sources/XcodeProj/Objects/BuildPhase/PBXShellScriptBuildPhase.swift @@ -22,6 +22,9 @@ public final class PBXShellScriptBuildPhase: PBXBuildPhase { /// Show environment variables in the logs. public var showEnvVarsInLog: Bool + /// Force script to run in all incremental builds. + public var alwaysOutOfDate: Bool + /// Path to the discovery .d dependency file public var dependencyFile: String? @@ -42,6 +45,7 @@ public final class PBXShellScriptBuildPhase: PBXBuildPhase { /// - shellPath: shell path. /// - shellScript: shell script. /// - buildActionMask: build action mask. + /// - alwaysOutOfDate: always out of date. /// - dependencyFile: discovery dependency file path. public init(files: [PBXBuildFile] = [], name: String? = nil, @@ -54,6 +58,7 @@ public final class PBXShellScriptBuildPhase: PBXBuildPhase { buildActionMask: UInt = defaultBuildActionMask, runOnlyForDeploymentPostprocessing: Bool = false, showEnvVarsInLog: Bool = true, + alwaysOutOfDate: Bool = false, dependencyFile: String? = nil) { self.name = name self.inputPaths = inputPaths @@ -61,6 +66,7 @@ public final class PBXShellScriptBuildPhase: PBXBuildPhase { self.shellPath = shellPath self.shellScript = shellScript self.showEnvVarsInLog = showEnvVarsInLog + self.alwaysOutOfDate = alwaysOutOfDate self.dependencyFile = dependencyFile super.init(files: files, inputFileListPaths: inputFileListPaths, @@ -78,6 +84,7 @@ public final class PBXShellScriptBuildPhase: PBXBuildPhase { case shellPath case shellScript case showEnvVarsInLog + case alwaysOutOfDate case dependencyFile } @@ -89,6 +96,7 @@ public final class PBXShellScriptBuildPhase: PBXBuildPhase { shellPath = try container.decodeIfPresent(.shellPath) shellScript = try container.decodeIfPresent(.shellScript) showEnvVarsInLog = try container.decodeIntBoolIfPresent(.showEnvVarsInLog) ?? true + alwaysOutOfDate = try container.decodeIntBoolIfPresent(.alwaysOutOfDate) ?? false dependencyFile = try container.decodeIfPresent(.dependencyFile) try super.init(from: decoder) } @@ -118,6 +126,10 @@ extension PBXShellScriptBuildPhase: PlistSerializable { // Xcode only writes this key if it's set to false; default is true and is omitted dictionary["showEnvVarsInLog"] = .string(CommentedString("\(showEnvVarsInLog.int)")) } + if alwaysOutOfDate { + // Xcode only write this key if it's set to true; default is false and is omitted + dictionary["alwaysOutOfDate"] = .string(CommentedString("\(alwaysOutOfDate.int)")) + } return (key: CommentedString(reference, comment: name ?? "ShellScript"), value: .dictionary(dictionary)) } } diff --git a/Tests/XcodeProjTests/Objects/BuildPhase/PBXShellScriptBuildPhaseTests.swift b/Tests/XcodeProjTests/Objects/BuildPhase/PBXShellScriptBuildPhaseTests.swift index 4a0aea7a4..86692b49a 100644 --- a/Tests/XcodeProjTests/Objects/BuildPhase/PBXShellScriptBuildPhaseTests.swift +++ b/Tests/XcodeProjTests/Objects/BuildPhase/PBXShellScriptBuildPhaseTests.swift @@ -24,6 +24,28 @@ final class PBXShellScriptBuildPhaseTests: XCTestCase { } } + func test_write_alwaysOutOfDate() throws { + // Given + let alwaysOutOfDateNotPresent = PBXShellScriptBuildPhase() + let alwaysOutOfDateFalse = PBXShellScriptBuildPhase(alwaysOutOfDate: false) + let alwaysOutOfDateTrue = PBXShellScriptBuildPhase(alwaysOutOfDate: true) + let proj = PBXProj.fixture() + + // When + guard + case let .dictionary(valuesWhenNotPresent) = try alwaysOutOfDateNotPresent.plistKeyAndValue(proj: proj, reference: "ref").value, + case let .dictionary(valuesWhenFalse) = try alwaysOutOfDateFalse.plistKeyAndValue(proj: proj, reference: "ref").value, + case let .dictionary(valuesWhenTrue) = try alwaysOutOfDateTrue.plistKeyAndValue(proj: proj, reference: "ref").value else { + XCTFail("Plist should contain dictionary") + return + } + + // Then + XCTAssertFalse(valuesWhenNotPresent.keys.contains("alwaysOutOfDate")) + XCTAssertFalse(valuesWhenFalse.keys.contains("alwaysOutOfDate")) + XCTAssertEqual(valuesWhenTrue["alwaysOutOfDate"], "1") + } + func test_write_dependencyFile() throws { let discoveryPath = "$(DERIVED_FILE_DIR)/target.d" let discovery = PBXShellScriptBuildPhase(dependencyFile: discoveryPath) From d168083e71aa660b6da30557f2f5976b300c52ec Mon Sep 17 00:00:00 2001 From: Joseph Colicchio Date: Fri, 9 Oct 2020 09:13:39 -0700 Subject: [PATCH 078/678] Add support for StoreKitConfigurationFileReference (#573) * Add support for StoreKitConfigurationFileReference * Update changelog * Add username to changelog * Add new property to AEXML XcodeFormat * Add test --- CHANGELOG.md | 1 + .../xcshareddata/xcschemes/iOS.xcscheme | 3 ++ .../Extensions/AEXML+XcodeFormat.swift | 1 + .../Scheme/XCScheme+LaunchAction.swift | 14 ++++++ ...e+StoreKitConfigurationFileReference.swift | 43 +++++++++++++++++++ .../XcodeProjTests/Scheme/XCSchemeTests.swift | 2 + XcodeProj_Carthage.xcodeproj/project.pbxproj | 6 ++- 7 files changed, 68 insertions(+), 2 deletions(-) create mode 100644 Sources/XcodeProj/Scheme/XCScheme+StoreKitConfigurationFileReference.swift diff --git a/CHANGELOG.md b/CHANGELOG.md index a93694183..22f125e7c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ ### Added - Add support for alwaysOutOfDate flag in PBXShellScriptBuildPhase https://github.com/tuist/XcodeProj/pull/572 by @marciniwanicki - Added `PBXShellScriptBuildPhase.dependencyFile` attribute https://github.com/tuist/xcodeproj/pull/568 by @polac24 +- Add support for StoreKitConfigurationFileReference in LaunchAction of XCScheme https://github.com/tuist/XcodeProj/pull/573 by @jcolicchio ## 7.14.0 diff --git a/Fixtures/iOS/Project.xcodeproj/xcshareddata/xcschemes/iOS.xcscheme b/Fixtures/iOS/Project.xcodeproj/xcshareddata/xcschemes/iOS.xcscheme index ee296ad61..119ecf609 100644 --- a/Fixtures/iOS/Project.xcodeproj/xcshareddata/xcschemes/iOS.xcscheme +++ b/Fixtures/iOS/Project.xcodeproj/xcshareddata/xcschemes/iOS.xcscheme @@ -194,6 +194,9 @@ identifier = "com.apple.dt.IDEFoundation.CurrentLocationScenarioIdentifier" referenceType = "1"> + + AEXMLElement { + AEXMLElement(name: "StoreKitConfigurationFileReference", + value: nil, + attributes: [ + "identifier": identifier, + ]) + } + + // MARK: - Equatable + + public static func == (lhs: StoreKitConfigurationFileReference, rhs: StoreKitConfigurationFileReference) -> Bool { + lhs.identifier == rhs.identifier + } + } +} diff --git a/Tests/XcodeProjTests/Scheme/XCSchemeTests.swift b/Tests/XcodeProjTests/Scheme/XCSchemeTests.swift index 9569529c3..7447f4cd4 100644 --- a/Tests/XcodeProjTests/Scheme/XCSchemeTests.swift +++ b/Tests/XcodeProjTests/Scheme/XCSchemeTests.swift @@ -305,6 +305,7 @@ final class XCSchemeIntegrationTests: XCTestCase { XCTAssertEqual(scheme.testAction?.enableUBSanitizer, false) XCTAssertEqual(scheme.testAction?.disableMainThreadChecker, false) XCTAssertEqual(scheme.testAction?.additionalOptions.isEmpty, true) + XCTAssertEqual(scheme.launchAction?.storeKitConfigurationFileReference?.identifier, "../../Configuration.storekit") let testEnvironmentVariables = XCTAssertNotNilAndUnwrap(scheme.testAction?.environmentVariables) XCTAssertEqual(testEnvironmentVariables.count, 1) @@ -469,6 +470,7 @@ final class XCSchemeIntegrationTests: XCTestCase { XCTAssertEqual(scheme.launchAction?.disableMainThreadChecker, false) XCTAssertEqual(scheme.launchAction?.stopOnEveryMainThreadCheckerIssue, false) XCTAssertEqual(scheme.launchAction?.additionalOptions.isEmpty, true) + XCTAssertNil(scheme.launchAction?.storeKitConfigurationFileReference) let launchEnvironmentVariables = XCTAssertNotNilAndUnwrap(scheme.launchAction?.environmentVariables) XCTAssertEqual(launchEnvironmentVariables.count, 1) diff --git a/XcodeProj_Carthage.xcodeproj/project.pbxproj b/XcodeProj_Carthage.xcodeproj/project.pbxproj index 72968ca6f..d5aaa336a 100644 --- a/XcodeProj_Carthage.xcodeproj/project.pbxproj +++ b/XcodeProj_Carthage.xcodeproj/project.pbxproj @@ -74,6 +74,7 @@ B07C3C11C0C5E9123C5D9D15 /* PBXObjectParser.swift in Sources */ = {isa = PBXBuildFile; fileRef = AAE4FB9142BF91F6E449998C /* PBXObjectParser.swift */; }; B7703E87F0E986D0BECC6C92 /* PBXResourcesBuildPhase.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8485AE4255BB935C7B7FE93C /* PBXResourcesBuildPhase.swift */; }; B972348A969282D604A5C325 /* XCScheme+Runnable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1D5C2732048660AC71431D9C /* XCScheme+Runnable.swift */; }; + B9B6EEA9252EBD4600BAD611 /* XCScheme+StoreKitConfigurationFileReference.swift in Sources */ = {isa = PBXBuildFile; fileRef = B9B6EEA8252EBD4600BAD611 /* XCScheme+StoreKitConfigurationFileReference.swift */; }; BBA09A7C8D3D9697C10F300B /* PBXLegacyTarget.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9C46C4D934731EA4A844FD3 /* PBXLegacyTarget.swift */; }; BD65503EF698EE4EAF11892C /* Path+Extras.swift in Sources */ = {isa = PBXBuildFile; fileRef = EE041A9A60D18302045BA2AE /* Path+Extras.swift */; }; BD7A3EBFD6C9D1AA78E6E822 /* Decoders.swift in Sources */ = {isa = PBXBuildFile; fileRef = 76F663AC6487521F684ED182 /* Decoders.swift */; }; @@ -192,6 +193,7 @@ B50CD65FDAA9B3F4269F4AAF /* PBXBuildRule.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PBXBuildRule.swift; sourceTree = ""; }; B837566EDF23D002AC881D07 /* XCScheme+CommandLineArguments.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "XCScheme+CommandLineArguments.swift"; sourceTree = ""; }; B92DC66EE80F3D7611319ACC /* XCWorkspaceDataFileRef.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = XCWorkspaceDataFileRef.swift; sourceTree = ""; }; + B9B6EEA8252EBD4600BAD611 /* XCScheme+StoreKitConfigurationFileReference.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "XCScheme+StoreKitConfigurationFileReference.swift"; sourceTree = ""; }; BFFE462CBB08512CB108E356 /* XCScheme+AnalyzeAction.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "XCScheme+AnalyzeAction.swift"; sourceTree = ""; }; C3FE679A53603AE3FE43462F /* XCScheme+ExecutionAction.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "XCScheme+ExecutionAction.swift"; sourceTree = ""; }; C6F7AC32AFFBEA9741906F2B /* PBXVariantGroup.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PBXVariantGroup.swift; sourceTree = ""; }; @@ -348,6 +350,7 @@ 0BFCA27253AECAC6A2EF5E66 /* XCScheme+RemoteRunnable.swift */, 1D5C2732048660AC71431D9C /* XCScheme+Runnable.swift */, 694034B4B7C9DF231B007A84 /* XCScheme+SerialAction.swift */, + B9B6EEA8252EBD4600BAD611 /* XCScheme+StoreKitConfigurationFileReference.swift */, 0AE91C6982618C1EDDAAD596 /* XCScheme+TestableReference.swift */, 161E967D0979EF34C7DF6348 /* XCScheme+TestAction.swift */, 7DFDD2E86D3F0ADE3502A29A /* XCScheme+TestItem.swift */, @@ -548,8 +551,6 @@ 223DB5C7FA35E8FD593C4040 /* Project object */ = { isa = PBXProject; attributes = { - TargetAttributes = { - }; }; buildConfigurationList = 477F800A701B31C60A80EACC /* Build configuration list for PBXProject "XcodeProj_Carthage" */; compatibilityVersion = "Xcode 9.3"; @@ -668,6 +669,7 @@ 735E1C6466FF56969767BAA0 /* XCScheme+CommandLineArguments.swift in Sources */, 7C3555C09B170AEA2D56E8F2 /* XCScheme+EnvironmentVariable.swift in Sources */, AC49ED6F358FFBF504A3D0AE /* XCScheme+ExecutionAction.swift in Sources */, + B9B6EEA9252EBD4600BAD611 /* XCScheme+StoreKitConfigurationFileReference.swift in Sources */, 147157016720CE9BC5943AF2 /* XCScheme+LaunchAction.swift in Sources */, 69CBD38E1B96198049A02795 /* XCScheme+LocationScenarioReference.swift in Sources */, 1270ABC0B6133C84F57A8D3F /* XCScheme+PathRunnable.swift in Sources */, From 1f1743ae9af3be9887b381328305ee5add3e04c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20Pi=C3=B1era?= Date: Fri, 9 Oct 2020 18:14:29 +0200 Subject: [PATCH 079/678] Remove headers --- .../XCScheme+StoreKitConfigurationFileReference.swift | 7 ------- 1 file changed, 7 deletions(-) diff --git a/Sources/XcodeProj/Scheme/XCScheme+StoreKitConfigurationFileReference.swift b/Sources/XcodeProj/Scheme/XCScheme+StoreKitConfigurationFileReference.swift index a802ca5e0..ab42e2af5 100644 --- a/Sources/XcodeProj/Scheme/XCScheme+StoreKitConfigurationFileReference.swift +++ b/Sources/XcodeProj/Scheme/XCScheme+StoreKitConfigurationFileReference.swift @@ -1,10 +1,3 @@ -// -// XCScheme+StoreKitConfigurationFileReference.swift -// XcodeProj -// -// Created by Joseph Colicchio on 10/7/20. -// - import AEXML import Foundation From 4688a339592d0ee8f0fc41093582d65fafbecdcd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20Pi=C3=B1era?= Date: Fri, 9 Oct 2020 18:16:07 +0200 Subject: [PATCH 080/678] Test with Xcode 12 as well --- .github/workflows/checks.yml | 11 +---------- .github/workflows/package.yml | 8 ++++---- 2 files changed, 5 insertions(+), 14 deletions(-) diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index 3d2e47940..65d4a0e02 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -1,7 +1,7 @@ # https://help.github.com/en/github/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#jobsjob_idname name: Checks -on: [pull_request] +on: [push, pull_request] jobs: swiftlint: @@ -13,12 +13,3 @@ jobs: uses: pepibumur/action-swiftlint@0d4afd006bb24e4525b5afcefd4ab5e2537193ac env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - changelog: - name: Changelog - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v1 - - name: Changelog Reminder - uses: peterjgrainger/action-changelog-reminder@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/package.yml b/.github/workflows/package.yml index 93572f8cc..88d70b2f6 100644 --- a/.github/workflows/package.yml +++ b/.github/workflows/package.yml @@ -1,12 +1,12 @@ # https://help.github.com/en/github/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#jobsjob_idname name: Package -on: [push] +on: [push, pull_request] jobs: build: name: Build - runs-on: macOS-latest + runs-on: macos-latest strategy: matrix: xcode: ["11.3", "11.3.1", "11.4"] @@ -19,10 +19,10 @@ jobs: test: name: Test - runs-on: macOS-latest + runs-on: macos-latest strategy: matrix: - xcode: ["11.3", "11.3.1", "11.4"] + xcode: ["11.3", "11.3.1", "11.4", "12.0.1"] steps: - uses: actions/checkout@v1 - name: Select Xcode ${{ matrix.xcode }} From 22c1e9f681b63b563ff5570b3b5dc418f825f921 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20Pi=C3=B1era?= Date: Fri, 9 Oct 2020 18:36:17 +0200 Subject: [PATCH 081/678] Version 7.15.0 --- CHANGELOG.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 22f125e7c..69fc2555d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,10 +2,14 @@ ## Next +## 7.15.0 - Marea + ### Fixed + - explicitFileType corrected for .bundle https://github.com/tuist/XcodeProj/pull/563 by @adamkhazi ### Added + - Add support for alwaysOutOfDate flag in PBXShellScriptBuildPhase https://github.com/tuist/XcodeProj/pull/572 by @marciniwanicki - Added `PBXShellScriptBuildPhase.dependencyFile` attribute https://github.com/tuist/xcodeproj/pull/568 by @polac24 - Add support for StoreKitConfigurationFileReference in LaunchAction of XCScheme https://github.com/tuist/XcodeProj/pull/573 by @jcolicchio @@ -13,13 +17,17 @@ ## 7.14.0 ### Fixed + - lastKnownFileType for .ttf and .sqlite files https://github.com/tuist/XcodeProj/pull/557 by @adamkhazi + ### Added + - Added selectedTests attribute to XCScheme.TestableReference https://github.com/tuist/XcodeProj/pull/559 by @ooodin ## 7.13.0 ### Added + - Support `on-demand-install-capable` application https://github.com/tuist/XcodeProj/pull/554 by @d-date - Add RemotePath to RemoteRunnable https://github.com/tuist/XcodeProj/pull/555 by @kwridan @@ -42,6 +50,7 @@ - Point `XcodeProjCExt` to version 0.1.0 https://github.com/tuist/XcodeProj/pull/540 by @khoi ### Added + - Added `useTestSelectionWhitelist` attribute to `XCScheme.TestableReference` https://github.com/tuist/xcodeproj/pull/516 by @basvankuijck. ### Fixed @@ -51,6 +60,7 @@ ## 7.10.0 ### Changed + - Optimize bottlenecks https://github.com/tuist/XcodeProj/pull/529 by @michaeleisel ## 7.9.0 From cbbe140bd5f50fddceb3dc1eb081fa616c249d0c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20Pi=C3=B1era?= Date: Fri, 9 Oct 2020 18:37:43 +0200 Subject: [PATCH 082/678] Update the version in the README --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 22981b73e..6afd386e0 100644 --- a/README.md +++ b/README.md @@ -37,7 +37,7 @@ Add the dependency in your `Package.swift` file: let package = Package( name: "myproject", dependencies: [ - .package(url: "https://github.com/tuist/xcodeproj.git", .upToNextMajor(from: "7.14.0")) + .package(url: "https://github.com/tuist/xcodeproj.git", .upToNextMajor(from: "7.15.0")) ], targets: [ .target( @@ -59,7 +59,7 @@ github "tuist/xcodeproj" ~> 7.11. ### CocoaPods ```ruby -pod 'xcodeproj', '~> 7.14.0 +pod 'xcodeproj', '~> 7.15.0 ``` ### Scripting From 3038221d72c7202a7b72fb971495dc6257bc3835 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20Pi=C3=B1era?= Date: Fri, 9 Oct 2020 18:39:32 +0200 Subject: [PATCH 083/678] Update podspec --- xcodeproj.podspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xcodeproj.podspec b/xcodeproj.podspec index b4709ba62..d8097078b 100644 --- a/xcodeproj.podspec +++ b/xcodeproj.podspec @@ -1,7 +1,7 @@ Pod::Spec.new do |s| s.name = "xcodeproj" - s.version = "7.14.0" + s.version = "7.15.0" s.summary = "Read/Modify/Write your Xcode projects" s.homepage = "https://github.com/tuist/xcodeproj" s.license = 'MIT' From af9080cad155efd64ad9ba3ff9ae791130bc9db1 Mon Sep 17 00:00:00 2001 From: Dan Fleming Date: Tue, 27 Oct 2020 03:03:49 -0400 Subject: [PATCH 084/678] podspec: add module_name (#578) --- xcodeproj.podspec | 2 ++ 1 file changed, 2 insertions(+) diff --git a/xcodeproj.podspec b/xcodeproj.podspec index d8097078b..2f0f7c1b3 100644 --- a/xcodeproj.podspec +++ b/xcodeproj.podspec @@ -13,6 +13,8 @@ Pod::Spec.new do |s| s.source_files = "Sources/**/*.{swift}" + s.module_name = 'XcodeProj' + s.dependency "XcodeProjCExt", "0.1.0" s.dependency "PathKit", "~> 1.0.0" s.dependency "AEXML", "~> 4.4.0" From f8f0559b704bb32331cb156f0f9bab0c69671ae8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20Pi=C3=B1era?= Date: Tue, 27 Oct 2020 08:05:54 +0100 Subject: [PATCH 085/678] Version 7.16.0 --- CHANGELOG.md | 6 ++++++ README.md | 4 ++-- xcodeproj.podspec | 2 +- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 69fc2555d..f393633af 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,12 @@ ## Next +## 7.16.0 - Cieza + +### Added + +- Set the right `module_name` in the `.podspec.` [#578](https://github.com/tuist/XcodeProj/pull/578) by @dflems + ## 7.15.0 - Marea ### Fixed diff --git a/README.md b/README.md index 6afd386e0..c4cb0d5c7 100644 --- a/README.md +++ b/README.md @@ -37,7 +37,7 @@ Add the dependency in your `Package.swift` file: let package = Package( name: "myproject", dependencies: [ - .package(url: "https://github.com/tuist/xcodeproj.git", .upToNextMajor(from: "7.15.0")) + .package(url: "https://github.com/tuist/xcodeproj.git", .upToNextMajor(from: "7.16.0")) ], targets: [ .target( @@ -59,7 +59,7 @@ github "tuist/xcodeproj" ~> 7.11. ### CocoaPods ```ruby -pod 'xcodeproj', '~> 7.15.0 +pod 'xcodeproj', '~> 7.16.0 ``` ### Scripting diff --git a/xcodeproj.podspec b/xcodeproj.podspec index 2f0f7c1b3..8381b6e5b 100644 --- a/xcodeproj.podspec +++ b/xcodeproj.podspec @@ -1,7 +1,7 @@ Pod::Spec.new do |s| s.name = "xcodeproj" - s.version = "7.15.0" + s.version = "7.16.0" s.summary = "Read/Modify/Write your Xcode projects" s.homepage = "https://github.com/tuist/xcodeproj" s.license = 'MIT' From e38a1aad9b846267db2c96092dcaa807833c7b07 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20Pi=C3=B1era?= Date: Tue, 27 Oct 2020 08:10:31 +0100 Subject: [PATCH 086/678] Fix author link --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f393633af..84ef2b7a0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,7 +6,7 @@ ### Added -- Set the right `module_name` in the `.podspec.` [#578](https://github.com/tuist/XcodeProj/pull/578) by @dflems +- Set the right `module_name` in the `.podspec.` [#578](https://github.com/tuist/XcodeProj/pull/578) by [@dflems](https://github.com/dflems). ## 7.15.0 - Marea From 2426b7b61584f832d13a0e95fda50f345e3eb3b6 Mon Sep 17 00:00:00 2001 From: Sascha Schwabbauer Date: Wed, 28 Oct 2020 09:00:38 +0100 Subject: [PATCH 087/678] Add support for runOncePerArchitecture (#570) * Add support for runOncePerArchitecture * Update changelog --- CHANGELOG.md | 2 ++ .../XcodeProj/Objects/BuildPhase/PBXBuildRule.swift | 12 +++++++++++- .../Objects/Sourcery/Equality.generated.swift | 1 + .../Objects/BuildPhase/PBXBuildRuleTests.swift | 7 +++++-- 4 files changed, 19 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 84ef2b7a0..5768c8e0a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,8 @@ ### Fixed - explicitFileType corrected for .bundle https://github.com/tuist/XcodeProj/pull/563 by @adamkhazi +### Added +- Added `runOncePerArchitecture` attribute to `PBXBuildRule` https://github.com/tuist/XcodeProj/pull/570 by @sascha ### Added diff --git a/Sources/XcodeProj/Objects/BuildPhase/PBXBuildRule.swift b/Sources/XcodeProj/Objects/BuildPhase/PBXBuildRule.swift index 26ad272dc..a18114643 100644 --- a/Sources/XcodeProj/Objects/BuildPhase/PBXBuildRule.swift +++ b/Sources/XcodeProj/Objects/BuildPhase/PBXBuildRule.swift @@ -31,6 +31,9 @@ public final class PBXBuildRule: PBXObject { /// Element script. public var script: String? + /// Element run once per architecture. + public var runOncePerArchitecture: Bool? + // MARK: - Init public init(compilerSpec: String, @@ -41,7 +44,8 @@ public final class PBXBuildRule: PBXObject { outputFiles: [String] = [], inputFiles: [String]? = nil, outputFilesCompilerFlags: [String]? = nil, - script: String? = nil) { + script: String? = nil, + runOncePerArchitecture: Bool? = nil) { self.compilerSpec = compilerSpec self.filePatterns = filePatterns self.fileType = fileType @@ -51,6 +55,7 @@ public final class PBXBuildRule: PBXObject { self.inputFiles = inputFiles self.outputFilesCompilerFlags = outputFilesCompilerFlags self.script = script + self.runOncePerArchitecture = runOncePerArchitecture super.init() } @@ -66,6 +71,7 @@ public final class PBXBuildRule: PBXObject { case inputFiles case outputFilesCompilerFlags case script + case runOncePerArchitecture } public required init(from decoder: Decoder) throws { @@ -79,6 +85,7 @@ public final class PBXBuildRule: PBXObject { inputFiles = try container.decodeIfPresent(.inputFiles) outputFilesCompilerFlags = try container.decodeIfPresent(.outputFilesCompilerFlags) script = try container.decodeIfPresent(.script) + runOncePerArchitecture = try container.decodeIntBoolIfPresent(.runOncePerArchitecture) try super.init(from: decoder) } } @@ -110,6 +117,9 @@ extension PBXBuildRule: PlistSerializable { if let script = script { dictionary["script"] = .string(CommentedString(script)) } + if let runOncePerArchitecture = runOncePerArchitecture { + dictionary["runOncePerArchitecture"] = .string(CommentedString("\(runOncePerArchitecture.int)")) + } return (key: CommentedString(reference, comment: PBXBuildRule.isa), value: .dictionary(dictionary)) } diff --git a/Sources/XcodeProj/Objects/Sourcery/Equality.generated.swift b/Sources/XcodeProj/Objects/Sourcery/Equality.generated.swift index edb8b05a3..1230864d3 100644 --- a/Sources/XcodeProj/Objects/Sourcery/Equality.generated.swift +++ b/Sources/XcodeProj/Objects/Sourcery/Equality.generated.swift @@ -46,6 +46,7 @@ extension PBXBuildRule { if outputFiles != rhs.outputFiles { return false } if outputFilesCompilerFlags != rhs.outputFilesCompilerFlags { return false } if script != rhs.script { return false } + if runOncePerArchitecture != rhs.runOncePerArchitecture { return false } return super.isEqual(to: rhs) } } diff --git a/Tests/XcodeProjTests/Objects/BuildPhase/PBXBuildRuleTests.swift b/Tests/XcodeProjTests/Objects/BuildPhase/PBXBuildRuleTests.swift index c682a3b35..da81bdbc2 100644 --- a/Tests/XcodeProjTests/Objects/BuildPhase/PBXBuildRuleTests.swift +++ b/Tests/XcodeProjTests/Objects/BuildPhase/PBXBuildRuleTests.swift @@ -14,7 +14,8 @@ final class PBXBuildRuleTests: XCTestCase { name: "rule", outputFiles: ["a", "b"], outputFilesCompilerFlags: ["-1", "-2"], - script: "script") + script: "script", + runOncePerArchitecture: false) } func test_init_initializesTheBuildRuleWithTheRightAttributes() { @@ -26,6 +27,7 @@ final class PBXBuildRuleTests: XCTestCase { XCTAssertEqual(subject.outputFiles, ["a", "b"]) XCTAssertEqual(subject.outputFilesCompilerFlags ?? [], ["-1", "-2"]) XCTAssertEqual(subject.script, "script") + XCTAssertEqual(subject.runOncePerArchitecture, false) } func test_isa_returnsTheCorrectValue() { @@ -40,7 +42,8 @@ final class PBXBuildRuleTests: XCTestCase { name: "rule", outputFiles: ["a", "b"], outputFilesCompilerFlags: ["-1", "-2"], - script: "script") + script: "script", + runOncePerArchitecture: false) XCTAssertEqual(subject, another) } } From 2567fb69dece910fb8b634629a6e345ee3fd9d34 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 28 Oct 2020 08:54:17 +0100 Subject: [PATCH 088/678] Bump cocoapods from 1.9.3 to 1.10.0 (#577) Bumps [cocoapods](https://github.com/CocoaPods/CocoaPods) from 1.9.3 to 1.10.0. - [Release notes](https://github.com/CocoaPods/CocoaPods/releases) - [Changelog](https://github.com/CocoaPods/CocoaPods/blob/master/CHANGELOG.md) - [Commits](https://github.com/CocoaPods/CocoaPods/compare/1.9.3...1.10.0) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Gemfile | 2 +- Gemfile.lock | 45 ++++++++++++++++++++++++--------------------- 2 files changed, 25 insertions(+), 22 deletions(-) diff --git a/Gemfile b/Gemfile index 60f60f700..c8fc061e0 100644 --- a/Gemfile +++ b/Gemfile @@ -2,6 +2,6 @@ source "https://rubygems.org" gem "rake" gem "jazzy" -gem "cocoapods", "1.9.3" +gem "cocoapods", "1.10.0" gem "colorize", "~> 0.8.1" gem "redcarpet", "~> 3.5.0" diff --git a/Gemfile.lock b/Gemfile.lock index dda8028ad..9be39d4fb 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -2,25 +2,26 @@ GEM remote: https://rubygems.org/ specs: CFPropertyList (3.0.2) - activesupport (4.2.11.3) - i18n (~> 0.7) + activesupport (5.2.4.4) + concurrent-ruby (~> 1.0, >= 1.0.2) + i18n (>= 0.7, < 2) minitest (~> 5.1) - thread_safe (~> 0.3, >= 0.3.4) tzinfo (~> 1.1) - algoliasearch (1.27.3) + addressable (2.7.0) + public_suffix (>= 2.0.2, < 5.0) + algoliasearch (1.27.4) httpclient (~> 2.8, >= 2.8.3) json (>= 1.5.1) atomos (0.1.3) claide (1.0.3) - cocoapods (1.9.3) - activesupport (>= 4.0.2, < 5) + cocoapods (1.10.0) + addressable (~> 2.6) claide (>= 1.0.2, < 2.0) - cocoapods-core (= 1.9.3) + cocoapods-core (= 1.10.0) cocoapods-deintegrate (>= 1.0.3, < 2.0) - cocoapods-downloader (>= 1.2.2, < 2.0) + cocoapods-downloader (>= 1.4.0, < 2.0) cocoapods-plugins (>= 1.0.0, < 2.0) cocoapods-search (>= 1.0.0, < 2.0) - cocoapods-stats (>= 1.0.0, < 2.0) cocoapods-trunk (>= 1.4.0, < 2.0) cocoapods-try (>= 1.1.0, < 2.0) colored2 (~> 3.1) @@ -30,28 +31,29 @@ GEM molinillo (~> 0.6.6) nap (~> 1.0) ruby-macho (~> 1.4) - xcodeproj (>= 1.14.0, < 2.0) - cocoapods-core (1.9.3) - activesupport (>= 4.0.2, < 6) + xcodeproj (>= 1.19.0, < 2.0) + cocoapods-core (1.10.0) + activesupport (> 5.0, < 6) + addressable (~> 2.6) algoliasearch (~> 1.0) concurrent-ruby (~> 1.1) fuzzy_match (~> 2.0.4) nap (~> 1.0) netrc (~> 0.11) + public_suffix typhoeus (~> 1.0) cocoapods-deintegrate (1.0.4) - cocoapods-downloader (1.3.0) + cocoapods-downloader (1.4.0) cocoapods-plugins (1.0.0) nap cocoapods-search (1.0.0) - cocoapods-stats (1.1.0) cocoapods-trunk (1.5.0) nap (>= 0.8, < 2.0) netrc (~> 0.11) cocoapods-try (1.2.0) colored2 (3.1.2) colorize (0.8.1) - concurrent-ruby (1.1.6) + concurrent-ruby (1.1.7) escape (0.0.4) ethon (0.12.0) ffi (>= 1.3.0) @@ -60,7 +62,7 @@ GEM fuzzy_match (2.0.4) gh_inspector (1.1.3) httpclient (2.8.3) - i18n (0.9.5) + i18n (1.8.5) concurrent-ruby (~> 1.0) jazzy (0.13.5) cocoapods (~> 1.5) @@ -73,13 +75,14 @@ GEM xcinvoke (~> 0.3.0) json (2.3.1) liferaft (0.0.6) - minitest (5.14.1) + minitest (5.14.2) molinillo (0.6.6) mustache (1.1.1) - nanaimo (0.2.6) + nanaimo (0.3.0) nap (1.1.0) netrc (0.11.0) open4 (1.3.4) + public_suffix (4.0.6) rake (13.0.1) redcarpet (3.5.0) rouge (3.20.0) @@ -94,18 +97,18 @@ GEM thread_safe (~> 0.1) xcinvoke (0.3.0) liferaft (~> 0.0.6) - xcodeproj (1.17.0) + xcodeproj (1.19.0) CFPropertyList (>= 2.3.3, < 4.0) atomos (~> 0.1.3) claide (>= 1.0.2, < 2.0) colored2 (~> 3.1) - nanaimo (~> 0.2.6) + nanaimo (~> 0.3.0) PLATFORMS ruby DEPENDENCIES - cocoapods (= 1.9.3) + cocoapods (= 1.10.0) colorize (~> 0.8.1) jazzy rake From 40becd94d3b0b1a9c81a5c45a917abb71b18530d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20Pi=C3=B1era?= Date: Wed, 28 Oct 2020 08:55:51 +0100 Subject: [PATCH 089/678] Rename master to main --- CODE_OF_CONDUCT.md | 2 +- Documentation/migration-guides.md | 11 ++++++----- README.md | 8 ++++---- .../Objects/Project/PBXProjectTests.swift | 8 ++++---- .../XCRemoteSwiftPackageReferenceTests.swift | 4 ++-- 5 files changed, 17 insertions(+), 16 deletions(-) diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index 1ca7fcff6..872148ab7 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -1 +1 @@ -Check out the organization [CODE OF CONDUCT](https://github.com/tuist/tuist/blob/master/docs/contribution/code-of-conduct.md) +Check out the organization [CODE OF CONDUCT](https://github.com/tuist/tuist/blob/main/docs/contribution/code-of-conduct.md) diff --git a/Documentation/migration-guides.md b/Documentation/migration-guides.md index c96c03259..0f256aec4 100644 --- a/Documentation/migration-guides.md +++ b/Documentation/migration-guides.md @@ -8,13 +8,14 @@ This improvement makes the API easier, safer and more convenient, but at the cos - `PBXObjectReference` is an internal class now. Object references to other objects are attributes with the type of the object that is being referred. For example, a `XCConfigurationList` object has an attribute `buildConfigurations` of type `XCBuildConfiguration`. Adding a new configuration is as easy as calling `list.buildConfigurations.append(config)`. - Note that object references have different types of optionals based on the type of attribute: - - **Implicitly unwrapped optional:** When the attribute is required by Xcode. [Example](https://github.com/tuist/xcodeproj/blob/master/Sources/XcodeProj/Objects/Project/PBXProject.swift#L38) - - **Explicitly unwrapped optional:** When the attribute is optional by Xcode. [Example](https://github.com/tuist/xcodeproj/blob/master/Sources/XcodeProj/Objects/Targets/PBXTargetDependency.swift#L11) -- `PBXObjects` has also been made internal. It was exposed through the attribute `objects` on the `PBXProj` class. If you used to use this class for adding, removing, or getting objects, those methods have been moved to the `PBXProj` class - [Public helpers](https://github.com/tuist/xcodeproj/blob/master/Sources/XcodeProj/Objects/Project/PBXProj.swift#L85) + - **Implicitly unwrapped optional:** When the attribute is required by Xcode. [Example](https://github.com/tuist/xcodeproj/blob/main/Sources/XcodeProj/Objects/Project/PBXProject.swift#L38) + - **Explicitly unwrapped optional:** When the attribute is optional by Xcode. [Example](https://github.com/tuist/xcodeproj/blob/main/Sources/XcodeProj/Objects/Targets/PBXTargetDependency.swift#L11) +- `PBXObjects` has also been made internal. It was exposed through the attribute `objects` on the `PBXProj` class. If you used to use this class for adding, removing, or getting objects, those methods have been moved to the `PBXProj` class - [Public helpers](https://github.com/tuist/xcodeproj/blob/main/Sources/XcodeProj/Objects/Project/PBXProj.swift#L85) **And yes, in case you are wondering, it fully supports Xcode 10 🎉** ## To xcodeproj 5 + `xcodeproj` 5 is a major release with important changes in the API focused on making it more convenient, and simplify the references handling. This version hasn't been officially released yet but you can already start updating your project for the new version. These are the changes you'd need to make in your projects: - `xcproj` has been renamed to `xcodeproj` so you need to update all your import statements to use the new name. @@ -22,7 +23,7 @@ This improvement makes the API easier, safer and more convenient, but at the cos - We've replaced `Path` with `AbsolutePath` and `RelativePath` from the Swift Package Manager's `Basic` framework. You might need to change some of the usages to use the new type. - Reference attributes have been renamed to use the naming convention `attributeReference` where `attribute` is the name of the attribute. If you are interested in materializing the reference to get the object, objects provide convenient getters that you can use for that purpose. Those getters throw if the object is not found in the project. -There are some useful additions to the API that you can check out on the [CHANGELOG](https://github.com/tuist/xcodeproj/blob/master/CHANGELOG.md). +There are some useful additions to the API that you can check out on the [CHANGELOG](https://github.com/tuist/xcodeproj/blob/main/CHANGELOG.md). One of those additions is an improvement on how references are managed. - When new objects are added to the project, you get the object reference. The reference is an instance that should be used to refer that object from any other. **The value of that reference is an implementation detail that has been abstracted away from you.** +When new objects are added to the project, you get the object reference. The reference is an instance that should be used to refer that object from any other. **The value of that reference is an implementation detail that has been abstracted away from you.** diff --git a/README.md b/README.md index c4cb0d5c7..ca8bc5b0d 100644 --- a/README.md +++ b/README.md @@ -2,9 +2,9 @@ [![Swift Package Manager](https://img.shields.io/badge/swift%20package%20manager-compatible-brightgreen.svg)](https://swift.org/package-manager/) [![Release](https://img.shields.io/github/release/tuist/xcodeproj.svg)](https://github.com/tuist/xcodeproj/releases) -[![Code Coverage](https://codecov.io/gh/tuist/xcodeproj/branch/master/graph/badge.svg)](https://codecov.io/gh/tuist/xcodeproj) +[![Code Coverage](https://codecov.io/gh/tuist/xcodeproj/branch/main/graph/badge.svg)](https://codecov.io/gh/tuist/xcodeproj) [![Slack](http://slack.tuist.io/badge.svg)](http://slack.tuist.io/) -[![License](https://img.shields.io/badge/License-MIT-yellow.svg)](https://github.com/tuist/xcodeproj/blob/master/LICENSE.md) +[![License](https://img.shields.io/badge/License-MIT-yellow.svg)](https://github.com/tuist/xcodeproj/blob/main/LICENSE.md) XcodeProj is a library written in Swift for parsing and working with Xcode projects. It's heavily inspired by [CocoaPods XcodeProj](https://github.com/CocoaPods/Xcodeproj) and [xcode](https://www.npmjs.com/package/xcode). @@ -122,7 +122,7 @@ Want to start using XcodeProj? Start by digging into our [documentation](/Docume - [Xcodeproj](https://github.com/CocoaPods/Xcodeproj) - [Nanaimo](https://github.com/CocoaPods/Nanaimo) - [Facebook Buck](https://buckbuild.com/javadoc/com/facebook/buck/apple/xcode/xcodeproj/package-summary.html) -- [Swift Package Manager - Xcodeproj](https://github.com/apple/swift-package-manager/tree/master/Sources/Xcodeproj) +- [Swift Package Manager - Xcodeproj](https://github.com/apple/swift-package-manager/tree/main/Sources/Xcodeproj) ## Contributing @@ -132,7 +132,7 @@ Want to start using XcodeProj? Start by digging into our [documentation](/Docume ## License -XcodeProj is released under the MIT license. [See LICENSE](https://github.com/tuist/xcodeproj/blob/master/LICENSE.md) for details. +XcodeProj is released under the MIT license. [See LICENSE](https://github.com/tuist/xcodeproj/blob/main/LICENSE.md) for details. ## Open source diff --git a/Tests/XcodeProjTests/Objects/Project/PBXProjectTests.swift b/Tests/XcodeProjTests/Objects/Project/PBXProjectTests.swift index b82db6adf..2fce790ca 100644 --- a/Tests/XcodeProjTests/Objects/Project/PBXProjectTests.swift +++ b/Tests/XcodeProjTests/Objects/Project/PBXProjectTests.swift @@ -133,7 +133,7 @@ final class PBXProjectTests: XCTestCase { // When let remoteReference = try project.addSwiftPackage(repositoryURL: "url", productName: "Product", - versionRequirement: .branch("master"), + versionRequirement: .branch("main"), targetName: "Target") // Then @@ -186,11 +186,11 @@ final class PBXProjectTests: XCTestCase { // When let packageProduct = try project.addSwiftPackage(repositoryURL: "url", productName: "Product", - versionRequirement: .branch("master"), + versionRequirement: .branch("main"), targetName: target.name) let secondPackageProduct = try project.addSwiftPackage(repositoryURL: "url", productName: "Product", - versionRequirement: .branch("master"), + versionRequirement: .branch("main"), targetName: secondTarget.name) // Then @@ -202,7 +202,7 @@ final class PBXProjectTests: XCTestCase { XCTAssertThrowsSpecificError(try project.addSwiftPackage(repositoryURL: "url", productName: "Product", - versionRequirement: .branch("second-master"), + versionRequirement: .branch("second-main"), targetName: secondTarget.name), PBXProjError.multipleRemotePackages(productName: "Product")) } diff --git a/Tests/XcodeProjTests/Objects/SwiftPackage/XCRemoteSwiftPackageReferenceTests.swift b/Tests/XcodeProjTests/Objects/SwiftPackage/XCRemoteSwiftPackageReferenceTests.swift index 0f33a9c4a..2139fcbf1 100644 --- a/Tests/XcodeProjTests/Objects/SwiftPackage/XCRemoteSwiftPackageReferenceTests.swift +++ b/Tests/XcodeProjTests/Objects/SwiftPackage/XCRemoteSwiftPackageReferenceTests.swift @@ -40,7 +40,7 @@ final class XCRemoteSwiftPackageReferenceTests: XCTestCase { func test_versionRequirement_returnsTheRightPlistValues_when_branch() throws { // When - let subject = XCRemoteSwiftPackageReference.VersionRequirement.branch("master") + let subject = XCRemoteSwiftPackageReference.VersionRequirement.branch("main") // Given let got = subject.plistValues() @@ -48,7 +48,7 @@ final class XCRemoteSwiftPackageReferenceTests: XCTestCase { // Then XCTAssertEqual(got, [ "kind": "branch", - "branch": .string(.init("master")), + "branch": .string(.init("main")), ]) } From 7281d33fce25926f07d53914a23e166df37be016 Mon Sep 17 00:00:00 2001 From: deatondg Date: Wed, 28 Oct 2020 03:57:27 -0400 Subject: [PATCH 090/678] Added the "com.apple.product-type.metal-library" PBXProductType. (#576) --- Sources/XcodeProj/Objects/Targets/PBXProductType.swift | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Sources/XcodeProj/Objects/Targets/PBXProductType.swift b/Sources/XcodeProj/Objects/Targets/PBXProductType.swift index e9820d4b1..389d0ee35 100644 --- a/Sources/XcodeProj/Objects/Targets/PBXProductType.swift +++ b/Sources/XcodeProj/Objects/Targets/PBXProductType.swift @@ -28,6 +28,7 @@ public enum PBXProductType: String, Decodable { case instrumentsPackage = "com.apple.product-type.instruments-package" case intentsServiceExtension = "com.apple.product-type.app-extension.intents-service" case onDemandInstallCapableApplication = "com.apple.product-type.application.on-demand-install-capable" + case metalLibrary = "com.apple.product-type.metal-library" /// Returns the file extension for the given product type. public var fileExtension: String? { @@ -56,6 +57,8 @@ public enum PBXProductType: String, Decodable { return "instrpkg" case .xcFramework: return "xcframework" + case .metalLibrary: + return "metallib" case .none: return nil } From 9b99891a2ce5f43a48471dd9aac33c4d650f7160 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20Pi=C3=B1era?= Date: Wed, 28 Oct 2020 08:58:32 +0100 Subject: [PATCH 091/678] Update CHANGELOG --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5768c8e0a..97c82187e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ ## Next +### Added + +- Added the `com.apple.product-type.metal-library` PBXProductType [#576](https://github.com/tuist/XcodeProj/pull/576) by [@deatondg](https://github.com/deatondg). + ## 7.16.0 - Cieza ### Added From 0c15e48c95b6748108fcc25dc17a1157cc8658dc Mon Sep 17 00:00:00 2001 From: Marcin Iwanicki Date: Wed, 28 Oct 2020 07:59:52 +0000 Subject: [PATCH 092/678] Deprecate PBXBuildPhase.type() function (#571) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Deprecate PBXBuildPhase.type() function * Update CHANGELOG Co-authored-by: Marcin Iwanicki Co-authored-by: Pedro Piñera Buendía --- CHANGELOG.md | 2 +- Sources/XcodeProj/Objects/BuildPhase/PBXBuildPhase.swift | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 97c82187e..d3bea2d7d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ ### Added - Added the `com.apple.product-type.metal-library` PBXProductType [#576](https://github.com/tuist/XcodeProj/pull/576) by [@deatondg](https://github.com/deatondg). +- Deprecate PBXBuildPhase.type() function https://github.com/tuist/XcodeProj/pull/571 by [@marciniwanicki](https://github.com/marciniwanicki). ## 7.16.0 - Cieza @@ -21,7 +22,6 @@ - Added `runOncePerArchitecture` attribute to `PBXBuildRule` https://github.com/tuist/XcodeProj/pull/570 by @sascha ### Added - - Add support for alwaysOutOfDate flag in PBXShellScriptBuildPhase https://github.com/tuist/XcodeProj/pull/572 by @marciniwanicki - Added `PBXShellScriptBuildPhase.dependencyFile` attribute https://github.com/tuist/xcodeproj/pull/568 by @polac24 - Add support for StoreKitConfigurationFileReference in LaunchAction of XCScheme https://github.com/tuist/XcodeProj/pull/573 by @jcolicchio diff --git a/Sources/XcodeProj/Objects/BuildPhase/PBXBuildPhase.swift b/Sources/XcodeProj/Objects/BuildPhase/PBXBuildPhase.swift index 1545b882a..41d29029e 100644 --- a/Sources/XcodeProj/Objects/BuildPhase/PBXBuildPhase.swift +++ b/Sources/XcodeProj/Objects/BuildPhase/PBXBuildPhase.swift @@ -134,6 +134,7 @@ public extension PBXBuildPhase { /// Returns the build phase type. /// /// - Returns: build phase type. + @available(*, deprecated, message: "Please use buildPhase property instead") func type() -> BuildPhase? { buildPhase } From 8e1ae69cec5f39bf11f6b93b5030c6329c12707c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20Pi=C3=B1era?= Date: Wed, 28 Oct 2020 09:01:38 +0100 Subject: [PATCH 093/678] Fix CHANGELOG --- CHANGELOG.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d3bea2d7d..24ab73282 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ - Added the `com.apple.product-type.metal-library` PBXProductType [#576](https://github.com/tuist/XcodeProj/pull/576) by [@deatondg](https://github.com/deatondg). - Deprecate PBXBuildPhase.type() function https://github.com/tuist/XcodeProj/pull/571 by [@marciniwanicki](https://github.com/marciniwanicki). +- Added `runOncePerArchitecture` attribute to `PBXBuildRule` https://github.com/tuist/XcodeProj/pull/570 by @sascha ## 7.16.0 - Cieza @@ -18,10 +19,9 @@ ### Fixed - explicitFileType corrected for .bundle https://github.com/tuist/XcodeProj/pull/563 by @adamkhazi -### Added -- Added `runOncePerArchitecture` attribute to `PBXBuildRule` https://github.com/tuist/XcodeProj/pull/570 by @sascha ### Added + - Add support for alwaysOutOfDate flag in PBXShellScriptBuildPhase https://github.com/tuist/XcodeProj/pull/572 by @marciniwanicki - Added `PBXShellScriptBuildPhase.dependencyFile` attribute https://github.com/tuist/xcodeproj/pull/568 by @polac24 - Add support for StoreKitConfigurationFileReference in LaunchAction of XCScheme https://github.com/tuist/XcodeProj/pull/573 by @jcolicchio From 2ae8e322ddbed99655802533441bc52f9ae76f24 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20Pi=C3=B1era?= Date: Wed, 28 Oct 2020 09:30:20 +0100 Subject: [PATCH 094/678] 7.17.0 - Tempelhof --- CHANGELOG.md | 2 + README.md | 4 +- XcodeProj_Carthage.xcodeproj/project.pbxproj | 10 ++- .../XcodeProj_Carthage-Project.xcscheme | 77 +++++++++++++++++++ xcodeproj.podspec | 2 +- 5 files changed, 88 insertions(+), 7 deletions(-) create mode 100644 XcodeProj_Carthage.xcworkspace/xcshareddata/xcschemes/XcodeProj_Carthage-Project.xcscheme diff --git a/CHANGELOG.md b/CHANGELOG.md index 24ab73282..7b1d74dd2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ ## Next +## 7.17.0 - Tempelhof + ### Added - Added the `com.apple.product-type.metal-library` PBXProductType [#576](https://github.com/tuist/XcodeProj/pull/576) by [@deatondg](https://github.com/deatondg). diff --git a/README.md b/README.md index ca8bc5b0d..0f151808d 100644 --- a/README.md +++ b/README.md @@ -37,7 +37,7 @@ Add the dependency in your `Package.swift` file: let package = Package( name: "myproject", dependencies: [ - .package(url: "https://github.com/tuist/xcodeproj.git", .upToNextMajor(from: "7.16.0")) + .package(url: "https://github.com/tuist/xcodeproj.git", .upToNextMajor(from: "7.17.0")) ], targets: [ .target( @@ -59,7 +59,7 @@ github "tuist/xcodeproj" ~> 7.11. ### CocoaPods ```ruby -pod 'xcodeproj', '~> 7.16.0 +pod 'xcodeproj', '~> 7.17.0 ``` ### Scripting diff --git a/XcodeProj_Carthage.xcodeproj/project.pbxproj b/XcodeProj_Carthage.xcodeproj/project.pbxproj index d5aaa336a..5f0119e58 100644 --- a/XcodeProj_Carthage.xcodeproj/project.pbxproj +++ b/XcodeProj_Carthage.xcodeproj/project.pbxproj @@ -54,6 +54,7 @@ 7CDAEBA81467E39CBAD2E6CF /* PBXSourcesBuildPhase.swift in Sources */ = {isa = PBXBuildFile; fileRef = CC365B2E771B6E2690D751DB /* PBXSourcesBuildPhase.swift */; }; 7DF42666456E27C51CC672C1 /* Array+Extras.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6023B10EB151C2FF48E53395 /* Array+Extras.swift */; }; 7F9ED031DE6A06055F44C2E2 /* JSONDecoding.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9144C9BC5E10BE834E6824A1 /* JSONDecoding.swift */; }; + 80988B37A199C50A3C7A352A /* XCScheme+StoreKitConfigurationFileReference.swift in Sources */ = {isa = PBXBuildFile; fileRef = 59D8B63E53C03F46C90D951D /* XCScheme+StoreKitConfigurationFileReference.swift */; }; 809908EF4E6E71285D110707 /* PBXNativeTarget.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2BD1A6E5AC6502EDE59541C8 /* PBXNativeTarget.swift */; }; 8242B39EB786ADA4A8B32EF3 /* XCBuildConfiguration.swift in Sources */ = {isa = PBXBuildFile; fileRef = D07BF1A8B705E35271076BA1 /* XCBuildConfiguration.swift */; }; 82FA5AD52A7F345C0E7CB14D /* XcodeProjCExt.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DC65006CBA60CAA1F78F6CED /* XcodeProjCExt.framework */; }; @@ -74,7 +75,6 @@ B07C3C11C0C5E9123C5D9D15 /* PBXObjectParser.swift in Sources */ = {isa = PBXBuildFile; fileRef = AAE4FB9142BF91F6E449998C /* PBXObjectParser.swift */; }; B7703E87F0E986D0BECC6C92 /* PBXResourcesBuildPhase.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8485AE4255BB935C7B7FE93C /* PBXResourcesBuildPhase.swift */; }; B972348A969282D604A5C325 /* XCScheme+Runnable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1D5C2732048660AC71431D9C /* XCScheme+Runnable.swift */; }; - B9B6EEA9252EBD4600BAD611 /* XCScheme+StoreKitConfigurationFileReference.swift in Sources */ = {isa = PBXBuildFile; fileRef = B9B6EEA8252EBD4600BAD611 /* XCScheme+StoreKitConfigurationFileReference.swift */; }; BBA09A7C8D3D9697C10F300B /* PBXLegacyTarget.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9C46C4D934731EA4A844FD3 /* PBXLegacyTarget.swift */; }; BD65503EF698EE4EAF11892C /* Path+Extras.swift in Sources */ = {isa = PBXBuildFile; fileRef = EE041A9A60D18302045BA2AE /* Path+Extras.swift */; }; BD7A3EBFD6C9D1AA78E6E822 /* Decoders.swift in Sources */ = {isa = PBXBuildFile; fileRef = 76F663AC6487521F684ED182 /* Decoders.swift */; }; @@ -160,6 +160,7 @@ 51CBC0FF736F69D538FFEC78 /* XCRemoteSwiftPackageReference.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = XCRemoteSwiftPackageReference.swift; sourceTree = ""; }; 568D1BA84A39807930EA26CF /* Dictionary+Enumerate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Dictionary+Enumerate.swift"; sourceTree = ""; }; 577B27811EEAD46794E8DE90 /* PBXRezBuildPhase.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PBXRezBuildPhase.swift; sourceTree = ""; }; + 59D8B63E53C03F46C90D951D /* XCScheme+StoreKitConfigurationFileReference.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "XCScheme+StoreKitConfigurationFileReference.swift"; sourceTree = ""; }; 59F2F50C66ADD5D0C12F3B70 /* XCWorkspaceData.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = XCWorkspaceData.swift; sourceTree = ""; }; 5A4A785AD26E7657312118B9 /* Writable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Writable.swift; sourceTree = ""; }; 5D13E332186D46FFA83BBD50 /* XCScheme.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = XCScheme.swift; sourceTree = ""; }; @@ -193,7 +194,6 @@ B50CD65FDAA9B3F4269F4AAF /* PBXBuildRule.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PBXBuildRule.swift; sourceTree = ""; }; B837566EDF23D002AC881D07 /* XCScheme+CommandLineArguments.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "XCScheme+CommandLineArguments.swift"; sourceTree = ""; }; B92DC66EE80F3D7611319ACC /* XCWorkspaceDataFileRef.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = XCWorkspaceDataFileRef.swift; sourceTree = ""; }; - B9B6EEA8252EBD4600BAD611 /* XCScheme+StoreKitConfigurationFileReference.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "XCScheme+StoreKitConfigurationFileReference.swift"; sourceTree = ""; }; BFFE462CBB08512CB108E356 /* XCScheme+AnalyzeAction.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "XCScheme+AnalyzeAction.swift"; sourceTree = ""; }; C3FE679A53603AE3FE43462F /* XCScheme+ExecutionAction.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "XCScheme+ExecutionAction.swift"; sourceTree = ""; }; C6F7AC32AFFBEA9741906F2B /* PBXVariantGroup.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PBXVariantGroup.swift; sourceTree = ""; }; @@ -350,7 +350,7 @@ 0BFCA27253AECAC6A2EF5E66 /* XCScheme+RemoteRunnable.swift */, 1D5C2732048660AC71431D9C /* XCScheme+Runnable.swift */, 694034B4B7C9DF231B007A84 /* XCScheme+SerialAction.swift */, - B9B6EEA8252EBD4600BAD611 /* XCScheme+StoreKitConfigurationFileReference.swift */, + 59D8B63E53C03F46C90D951D /* XCScheme+StoreKitConfigurationFileReference.swift */, 0AE91C6982618C1EDDAAD596 /* XCScheme+TestableReference.swift */, 161E967D0979EF34C7DF6348 /* XCScheme+TestAction.swift */, 7DFDD2E86D3F0ADE3502A29A /* XCScheme+TestItem.swift */, @@ -551,6 +551,8 @@ 223DB5C7FA35E8FD593C4040 /* Project object */ = { isa = PBXProject; attributes = { + TargetAttributes = { + }; }; buildConfigurationList = 477F800A701B31C60A80EACC /* Build configuration list for PBXProject "XcodeProj_Carthage" */; compatibilityVersion = "Xcode 9.3"; @@ -669,7 +671,6 @@ 735E1C6466FF56969767BAA0 /* XCScheme+CommandLineArguments.swift in Sources */, 7C3555C09B170AEA2D56E8F2 /* XCScheme+EnvironmentVariable.swift in Sources */, AC49ED6F358FFBF504A3D0AE /* XCScheme+ExecutionAction.swift in Sources */, - B9B6EEA9252EBD4600BAD611 /* XCScheme+StoreKitConfigurationFileReference.swift in Sources */, 147157016720CE9BC5943AF2 /* XCScheme+LaunchAction.swift in Sources */, 69CBD38E1B96198049A02795 /* XCScheme+LocationScenarioReference.swift in Sources */, 1270ABC0B6133C84F57A8D3F /* XCScheme+PathRunnable.swift in Sources */, @@ -677,6 +678,7 @@ 209B0AC5FFCE800A35624C49 /* XCScheme+RemoteRunnable.swift in Sources */, B972348A969282D604A5C325 /* XCScheme+Runnable.swift in Sources */, 53CE6B2F74AB5FAA69D58923 /* XCScheme+SerialAction.swift in Sources */, + 80988B37A199C50A3C7A352A /* XCScheme+StoreKitConfigurationFileReference.swift in Sources */, AB74DA38A17EE261024A711C /* XCScheme+TestAction.swift in Sources */, EE4B80C64D6B7911947345E4 /* XCScheme+TestItem.swift in Sources */, D5D82B59980521FBA427EED8 /* XCScheme+TestPlanReference.swift in Sources */, diff --git a/XcodeProj_Carthage.xcworkspace/xcshareddata/xcschemes/XcodeProj_Carthage-Project.xcscheme b/XcodeProj_Carthage.xcworkspace/xcshareddata/xcschemes/XcodeProj_Carthage-Project.xcscheme new file mode 100644 index 000000000..876464d1f --- /dev/null +++ b/XcodeProj_Carthage.xcworkspace/xcshareddata/xcschemes/XcodeProj_Carthage-Project.xcscheme @@ -0,0 +1,77 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/xcodeproj.podspec b/xcodeproj.podspec index 8381b6e5b..86d84ec18 100644 --- a/xcodeproj.podspec +++ b/xcodeproj.podspec @@ -1,7 +1,7 @@ Pod::Spec.new do |s| s.name = "xcodeproj" - s.version = "7.16.0" + s.version = "7.17.0" s.summary = "Read/Modify/Write your Xcode projects" s.homepage = "https://github.com/tuist/xcodeproj" s.license = 'MIT' From 395323e0808fdaafdb718cd678b13bc35694b6d7 Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Wed, 28 Oct 2020 09:35:27 +0100 Subject: [PATCH 095/678] docs: add jcolicchio as a contributor (#579) * docs: update README.md [skip ci] * docs: create .all-contributorsrc [skip ci] Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com> --- .all-contributorsrc | 24 ++++++++++++++++++++++++ README.md | 22 ++++++++++++++++++++++ 2 files changed, 46 insertions(+) create mode 100644 .all-contributorsrc diff --git a/.all-contributorsrc b/.all-contributorsrc new file mode 100644 index 000000000..9082e2170 --- /dev/null +++ b/.all-contributorsrc @@ -0,0 +1,24 @@ +{ + "files": [ + "README.md" + ], + "imageSize": 100, + "commit": false, + "contributors": [ + { + "login": "jcolicchio", + "name": "Joseph Colicchio", + "avatar_url": "https://avatars3.githubusercontent.com/u/2837288?v=4", + "profile": "https://joecolicch.io", + "contributions": [ + "ideas" + ] + } + ], + "contributorsPerLine": 7, + "projectName": "XcodeProj", + "projectOwner": "tuist", + "repoType": "github", + "repoHost": "https://github.com", + "skipCi": true +} diff --git a/README.md b/README.md index 0f151808d..836337a56 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,7 @@ # XcodeProj + +[![All Contributors](https://img.shields.io/badge/all_contributors-1-orange.svg?style=flat-square)](#contributors-) + [![Swift Package Manager](https://img.shields.io/badge/swift%20package%20manager-compatible-brightgreen.svg)](https://swift.org/package-manager/) [![Release](https://img.shields.io/github/release/tuist/xcodeproj.svg)](https://github.com/tuist/xcodeproj/releases) @@ -139,3 +142,22 @@ XcodeProj is released under the MIT license. [See LICENSE](https://github.com/tu Tuist is a proud supporter of the [Software Freedom Conservacy](https://sfconservancy.org/) Become a Conservancy Supporter! + +## Contributors ✨ + +Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)): + + + + + + + + +

Joseph Colicchio

🤔
+ + + + + +This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome! \ No newline at end of file From 21423ef5cb4ffbd4c1c0cb9b9079539c42e25e80 Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Wed, 28 Oct 2020 09:36:04 +0100 Subject: [PATCH 096/678] docs: add deatondg as a contributor (#580) * docs: update README.md [skip ci] * docs: update .all-contributorsrc [skip ci] Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com> --- .all-contributorsrc | 9 +++++++++ README.md | 3 ++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/.all-contributorsrc b/.all-contributorsrc index 9082e2170..559bd34d7 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -13,6 +13,15 @@ "contributions": [ "ideas" ] + }, + { + "login": "deatondg", + "name": "deatondg", + "avatar_url": "https://avatars0.githubusercontent.com/u/3221590?v=4", + "profile": "https://github.com/deatondg", + "contributions": [ + "ideas" + ] } ], "contributorsPerLine": 7, diff --git a/README.md b/README.md index 836337a56..4cc535cfd 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # XcodeProj -[![All Contributors](https://img.shields.io/badge/all_contributors-1-orange.svg?style=flat-square)](#contributors-) +[![All Contributors](https://img.shields.io/badge/all_contributors-2-orange.svg?style=flat-square)](#contributors-) [![Swift Package Manager](https://img.shields.io/badge/swift%20package%20manager-compatible-brightgreen.svg)](https://swift.org/package-manager/) @@ -153,6 +153,7 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d +

Joseph Colicchio

🤔

deatondg

🤔
From 3ce0e966a69651b439d17121d0f89856f3c86226 Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Wed, 28 Oct 2020 09:36:39 +0100 Subject: [PATCH 097/678] docs: add dflems as a contributor (#581) * docs: update README.md [skip ci] * docs: update .all-contributorsrc [skip ci] Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com> --- .all-contributorsrc | 9 +++++++++ README.md | 3 ++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/.all-contributorsrc b/.all-contributorsrc index 559bd34d7..7fe898eea 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -22,6 +22,15 @@ "contributions": [ "ideas" ] + }, + { + "login": "dflems", + "name": "Dan Fleming", + "avatar_url": "https://avatars3.githubusercontent.com/u/925850?v=4", + "profile": "https://github.com/dflems", + "contributions": [ + "code" + ] } ], "contributorsPerLine": 7, diff --git a/README.md b/README.md index 4cc535cfd..6d42dc41c 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # XcodeProj -[![All Contributors](https://img.shields.io/badge/all_contributors-2-orange.svg?style=flat-square)](#contributors-) +[![All Contributors](https://img.shields.io/badge/all_contributors-3-orange.svg?style=flat-square)](#contributors-) [![Swift Package Manager](https://img.shields.io/badge/swift%20package%20manager-compatible-brightgreen.svg)](https://swift.org/package-manager/) @@ -154,6 +154,7 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
Joseph Colicchio

🤔
deatondg

🤔 +
Dan Fleming

💻 From c3e90efcc0db620dbfebaafb25b4750bf9566b1a Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Wed, 28 Oct 2020 09:37:51 +0100 Subject: [PATCH 098/678] docs: add sascha as a contributor (#582) * docs: update README.md [skip ci] * docs: update .all-contributorsrc [skip ci] Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com> --- .all-contributorsrc | 9 +++++++++ README.md | 3 ++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/.all-contributorsrc b/.all-contributorsrc index 7fe898eea..c2a9e3f6e 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -31,6 +31,15 @@ "contributions": [ "code" ] + }, + { + "login": "sascha", + "name": "Sascha Schwabbauer", + "avatar_url": "https://avatars3.githubusercontent.com/u/895505?v=4", + "profile": "https://twitter.com/_SaschaS", + "contributions": [ + "ideas" + ] } ], "contributorsPerLine": 7, diff --git a/README.md b/README.md index 6d42dc41c..34b9dfeaa 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # XcodeProj -[![All Contributors](https://img.shields.io/badge/all_contributors-3-orange.svg?style=flat-square)](#contributors-) +[![All Contributors](https://img.shields.io/badge/all_contributors-4-orange.svg?style=flat-square)](#contributors-) [![Swift Package Manager](https://img.shields.io/badge/swift%20package%20manager-compatible-brightgreen.svg)](https://swift.org/package-manager/) @@ -155,6 +155,7 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
Joseph Colicchio

🤔
deatondg

🤔
Dan Fleming

💻 +
Sascha Schwabbauer

🤔 From 39b18082204d19a300f28c40c657549b03c99926 Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Wed, 28 Oct 2020 09:38:26 +0100 Subject: [PATCH 099/678] docs: add marciniwanicki as a contributor (#583) * docs: update README.md [skip ci] * docs: update .all-contributorsrc [skip ci] Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com> --- .all-contributorsrc | 9 +++++++++ README.md | 3 ++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/.all-contributorsrc b/.all-contributorsrc index c2a9e3f6e..60260d960 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -40,6 +40,15 @@ "contributions": [ "ideas" ] + }, + { + "login": "marciniwanicki", + "name": "Marcin Iwanicki", + "avatar_url": "https://avatars3.githubusercontent.com/u/946649?v=4", + "profile": "https://github.com/marciniwanicki", + "contributions": [ + "maintenance" + ] } ], "contributorsPerLine": 7, diff --git a/README.md b/README.md index 34b9dfeaa..8ce3fc775 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # XcodeProj -[![All Contributors](https://img.shields.io/badge/all_contributors-4-orange.svg?style=flat-square)](#contributors-) +[![All Contributors](https://img.shields.io/badge/all_contributors-5-orange.svg?style=flat-square)](#contributors-) [![Swift Package Manager](https://img.shields.io/badge/swift%20package%20manager-compatible-brightgreen.svg)](https://swift.org/package-manager/) @@ -156,6 +156,7 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
deatondg

🤔
Dan Fleming

💻
Sascha Schwabbauer

🤔 +
Marcin Iwanicki

🚧 From c2b515babc97cea8f2189df4218efd6932c033d7 Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Wed, 28 Oct 2020 09:39:07 +0100 Subject: [PATCH 100/678] docs: add adamkhazi as a contributor (#584) * docs: update README.md [skip ci] * docs: update .all-contributorsrc [skip ci] Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com> --- .all-contributorsrc | 9 +++++++++ README.md | 3 ++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/.all-contributorsrc b/.all-contributorsrc index 60260d960..ebd66203d 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -49,6 +49,15 @@ "contributions": [ "maintenance" ] + }, + { + "login": "adamkhazi", + "name": "Adam Khazi", + "avatar_url": "https://avatars2.githubusercontent.com/u/9820670?v=4", + "profile": "https://github.com/adamkhazi", + "contributions": [ + "maintenance" + ] } ], "contributorsPerLine": 7, diff --git a/README.md b/README.md index 8ce3fc775..532598f22 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # XcodeProj -[![All Contributors](https://img.shields.io/badge/all_contributors-5-orange.svg?style=flat-square)](#contributors-) +[![All Contributors](https://img.shields.io/badge/all_contributors-6-orange.svg?style=flat-square)](#contributors-) [![Swift Package Manager](https://img.shields.io/badge/swift%20package%20manager-compatible-brightgreen.svg)](https://swift.org/package-manager/) @@ -157,6 +157,7 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
Dan Fleming

💻
Sascha Schwabbauer

🤔
Marcin Iwanicki

🚧 +
Adam Khazi

🚧 From 0296a6099a6742ae26e59ced932e20f6a9a5b55a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20Pi=C3=B1era=20Buend=C3=ADa?= Date: Wed, 28 Oct 2020 09:39:46 +0100 Subject: [PATCH 101/678] Update README.md --- README.md | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/README.md b/README.md index 532598f22..edc1c13df 100644 --- a/README.md +++ b/README.md @@ -137,12 +137,6 @@ Want to start using XcodeProj? Start by digging into our [documentation](/Docume XcodeProj is released under the MIT license. [See LICENSE](https://github.com/tuist/xcodeproj/blob/main/LICENSE.md) for details. -## Open source - -Tuist is a proud supporter of the [Software Freedom Conservacy](https://sfconservancy.org/) - -Become a Conservancy Supporter! - ## Contributors ✨ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)): @@ -165,4 +159,4 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d -This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome! \ No newline at end of file +This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome! From 82ecf0c3bb4d98067e12cdf673a8fffab676b6e0 Mon Sep 17 00:00:00 2001 From: Homero Oliveira Date: Tue, 10 Nov 2020 07:12:48 -0300 Subject: [PATCH 102/678] Fix build warning (#587) --- Sources/XcodeProj/Objects/Project/PBXObjects.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/XcodeProj/Objects/Project/PBXObjects.swift b/Sources/XcodeProj/Objects/Project/PBXObjects.swift index 803fad32a..8262d8027 100644 --- a/Sources/XcodeProj/Objects/Project/PBXObjects.swift +++ b/Sources/XcodeProj/Objects/Project/PBXObjects.swift @@ -138,7 +138,7 @@ class PBXObjects: Equatable { /// - objects: project objects init(objects: [PBXObject] = []) { objects.forEach { - _ = self.add(object: $0) + self.add(object: $0) } } From 9c95f18905862aa89ebcbe178bd2f71251da1242 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 10 Nov 2020 11:12:58 +0100 Subject: [PATCH 103/678] Bump jazzy from 0.13.5 to 0.13.6 (#589) Bumps [jazzy](https://github.com/realm/jazzy) from 0.13.5 to 0.13.6. - [Release notes](https://github.com/realm/jazzy/releases) - [Changelog](https://github.com/realm/jazzy/blob/master/CHANGELOG.md) - [Commits](https://github.com/realm/jazzy/compare/v0.13.5...v0.13.6) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Gemfile.lock | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 9be39d4fb..d0aa7a912 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -9,7 +9,7 @@ GEM tzinfo (~> 1.1) addressable (2.7.0) public_suffix (>= 2.0.2, < 5.0) - algoliasearch (1.27.4) + algoliasearch (1.27.5) httpclient (~> 2.8, >= 2.8.3) json (>= 1.5.1) atomos (0.1.3) @@ -64,7 +64,7 @@ GEM httpclient (2.8.3) i18n (1.8.5) concurrent-ruby (~> 1.0) - jazzy (0.13.5) + jazzy (0.13.6) cocoapods (~> 1.5) mustache (~> 1.1) open4 @@ -85,7 +85,7 @@ GEM public_suffix (4.0.6) rake (13.0.1) redcarpet (3.5.0) - rouge (3.20.0) + rouge (3.24.0) ruby-macho (1.4.0) sassc (2.4.0) ffi (~> 1.9) @@ -93,7 +93,7 @@ GEM thread_safe (0.3.6) typhoeus (1.4.0) ethon (>= 0.9.0) - tzinfo (1.2.7) + tzinfo (1.2.8) thread_safe (~> 0.1) xcinvoke (0.3.0) liferaft (~> 0.0.6) From b370051dcb53aa8be7aa8fa049e1b9c4f679009e Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Tue, 10 Nov 2020 11:21:08 +0100 Subject: [PATCH 104/678] docs: add elliottwilliams as a contributor (#591) * docs: update README.md [skip ci] * docs: update .all-contributorsrc [skip ci] Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com> --- .all-contributorsrc | 9 +++++++++ README.md | 3 ++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/.all-contributorsrc b/.all-contributorsrc index ebd66203d..98c74b7b0 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -58,6 +58,15 @@ "contributions": [ "maintenance" ] + }, + { + "login": "elliottwilliams", + "name": "Elliott Williams", + "avatar_url": "https://avatars3.githubusercontent.com/u/910198?v=4", + "profile": "https://github.com/elliottwilliams", + "contributions": [ + "code" + ] } ], "contributorsPerLine": 7, diff --git a/README.md b/README.md index edc1c13df..78e5eb9f8 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # XcodeProj -[![All Contributors](https://img.shields.io/badge/all_contributors-6-orange.svg?style=flat-square)](#contributors-) +[![All Contributors](https://img.shields.io/badge/all_contributors-7-orange.svg?style=flat-square)](#contributors-) [![Swift Package Manager](https://img.shields.io/badge/swift%20package%20manager-compatible-brightgreen.svg)](https://swift.org/package-manager/) @@ -152,6 +152,7 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
Sascha Schwabbauer

🤔
Marcin Iwanicki

🚧
Adam Khazi

🚧 +
Elliott Williams

💻 From ad2d6cbdfade93e3dd95813786c6b78910ab8339 Mon Sep 17 00:00:00 2001 From: Elliott Williams Date: Wed, 11 Nov 2020 00:45:17 -0800 Subject: [PATCH 105/678] Linux support (#585) * Remove XcodeProjCExt and Implement CommentedString w/o bridged APIs * Use CryptoKit to calculate MD5s when available * Bump AEXML to 4.5.0 * Generate LinuxMain.swift * Clean up sourcery template * Move overrides out of templates and drop @objc * Fixups for building and testing on linux/docker * Add GitHub actions for linux * Updated changelog * CI fixups * CI Fixups * Fix swiftlint style violations * Codecov fixups --- .github/workflows/package.yml | 19 ++- sourcery.yml => .sourcery.yml | 0 CHANGELOG.md | 6 + Package.resolved | 17 +-- Package.swift | 4 +- .../XcodeProj/Extensions/Path+Extras.swift | 8 ++ Sources/XcodeProj/Extensions/String+md5.swift | 44 ++++++- .../Objects/BuildPhase/PBXBuildFile.swift | 5 + .../Objects/BuildPhase/PBXBuildPhase.swift | 5 + .../Objects/BuildPhase/PBXBuildRule.swift | 5 + .../BuildPhase/PBXCopyFilesBuildPhase.swift | 5 + .../BuildPhase/PBXFrameworksBuildPhase.swift | 5 + .../BuildPhase/PBXHeadersBuildPhase.swift | 5 + .../BuildPhase/PBXResourcesBuildPhase.swift | 5 + .../Objects/BuildPhase/PBXRezBuildPhase.swift | 5 + .../BuildPhase/PBXShellScriptBuildPhase.swift | 5 + .../BuildPhase/PBXSourcesBuildPhase.swift | 5 + .../Configuration/XCBuildConfiguration.swift | 5 + .../Configuration/XCConfigurationList.swift | 5 + .../Objects/Files/PBXContainerItem.swift | 5 + .../Objects/Files/PBXContainerItemProxy.swift | 5 + .../Objects/Files/PBXFileElement.swift | 5 + .../Objects/Files/PBXFileReference.swift | 5 + .../XcodeProj/Objects/Files/PBXGroup.swift | 5 + .../Objects/Files/PBXVariantGroup.swift | 7 +- .../Objects/Files/XCVersionGroup.swift | 5 + .../XcodeProj/Objects/Project/PBXObject.swift | 2 +- .../Objects/Project/PBXObjectReference.swift | 1 - .../Objects/Project/PBXProjEncoder.swift | 2 +- .../Objects/Project/PBXProject.swift | 5 + .../Objects/Sourcery/Equality.generated.swift | 110 +++++++++--------- .../XCRemoteSwiftPackageReference.swift | 8 +- .../XCSwiftPackageProductDependency.swift | 8 +- .../Objects/Targets/PBXAggregateTarget.swift | 7 +- .../Objects/Targets/PBXLegacyTarget.swift | 5 + .../Objects/Targets/PBXNativeTarget.swift | 5 + .../Objects/Targets/PBXReferenceProxy.swift | 5 + .../XcodeProj/Objects/Targets/PBXTarget.swift | 5 + .../Objects/Targets/PBXTargetDependency.swift | 5 + Sources/XcodeProj/Utils/CommentedString.swift | 83 +++++++++++-- Templates/Equality.stencil | 26 ++--- Tests/LinuxMain.swift | 8 +- .../Project/PBXProjIntegrationTests.swift | 7 +- 43 files changed, 362 insertions(+), 125 deletions(-) rename sourcery.yml => .sourcery.yml (100%) diff --git a/.github/workflows/package.yml b/.github/workflows/package.yml index 88d70b2f6..b1af51c6d 100644 --- a/.github/workflows/package.yml +++ b/.github/workflows/package.yml @@ -5,7 +5,7 @@ on: [push, pull_request] jobs: build: - name: Build + name: Build (macOS) runs-on: macos-latest strategy: matrix: @@ -16,9 +16,15 @@ jobs: run: sudo xcode-select -switch /Applications/Xcode_${{ matrix.xcode }}.app - name: Build run: swift build -c release - + build-linux: + name: Build (Linux) + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v1 + - name: Build + run: swift build -c release test: - name: Test + name: Test (macOS) runs-on: macos-latest strategy: matrix: @@ -33,3 +39,10 @@ jobs: run: xcodebuild test -project XcodeProj.xcodeproj -scheme XcodeProj-Package -enableCodeCoverage YES - name: Send test coverage report run: bash <(curl -s https://codecov.io/bash) + test-linux: + name: Test (Linux) + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v1 + - name: Build and run tests + run: swift test --enable-test-discovery diff --git a/sourcery.yml b/.sourcery.yml similarity index 100% rename from sourcery.yml rename to .sourcery.yml diff --git a/CHANGELOG.md b/CHANGELOG.md index 7b1d74dd2..290916501 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,12 @@ ## Next +### Added + +- Support for building and running on Linux. [#585](https://github.com/tuist/XcodeProj/pull/585) by [@elliottwilliams](https://github.com/elliottwilliams). + - Tested for compatibility with Swift 5.3 on Ubuntu 18.04. + - XcodeProj requires FoundationXML / libxml2, which is part of the standard Swift Linux toolchain but not necessarily available in all environments. + ## 7.17.0 - Tempelhof ### Added diff --git a/Package.resolved b/Package.resolved index 62b16b46f..cd537a787 100644 --- a/Package.resolved +++ b/Package.resolved @@ -6,8 +6,8 @@ "repositoryURL": "https://github.com/tadija/AEXML", "state": { "branch": null, - "revision": "e4d517844dd03dac557e35d77a8e9ab438de91a6", - "version": "4.4.0" + "revision": "8623e73b193386909566a9ca20203e33a09af142", + "version": "4.5.0" } }, { @@ -24,17 +24,8 @@ "repositoryURL": "https://github.com/kylef/Spectre.git", "state": { "branch": null, - "revision": "f14ff47f45642aa5703900980b014c2e9394b6e5", - "version": "0.9.0" - } - }, - { - "package": "XcodeProjCExt", - "repositoryURL": "https://github.com/tuist/XcodeProjCExt", - "state": { - "branch": null, - "revision": "21a510c225ff2bc83d5920a21d902af4b1e7e218", - "version": "0.1.0" + "revision": "f717bbce0e19f0129fc001b2b6bed43b70fd8b87", + "version": "0.9.1" } } ] diff --git a/Package.swift b/Package.swift index 2758eeb28..95e46cdf7 100644 --- a/Package.swift +++ b/Package.swift @@ -8,14 +8,12 @@ let package = Package( .library(name: "XcodeProj", targets: ["XcodeProj"]), ], dependencies: [ - .package(url: "https://github.com/tuist/XcodeProjCExt", .exact("0.1.0")), - .package(url: "https://github.com/tadija/AEXML", .upToNextMinor(from: "4.4.0")), + .package(url: "https://github.com/tadija/AEXML", .upToNextMinor(from: "4.5.0")), .package(url: "https://github.com/kylef/PathKit", .upToNextMinor(from: "1.0.0")), ], targets: [ .target(name: "XcodeProj", dependencies: [ - "XcodeProjCExt", "PathKit", "AEXML", ]), diff --git a/Sources/XcodeProj/Extensions/Path+Extras.swift b/Sources/XcodeProj/Extensions/Path+Extras.swift index 823c45bfb..9a20677cd 100644 --- a/Sources/XcodeProj/Extensions/Path+Extras.swift +++ b/Sources/XcodeProj/Extensions/Path+Extras.swift @@ -4,7 +4,11 @@ import PathKit // MARK: - Path extras. +#if os(macOS) let systemGlob = Darwin.glob +#else +let systemGlob = Glibc.glob +#endif extension Path { /// Creates a directory @@ -28,7 +32,11 @@ extension Path { let flags = GLOB_TILDE | GLOB_BRACE | GLOB_MARK if systemGlob(cPattern, flags, nil, >) == 0 { + #if os(macOS) let matchc = gt.gl_matchc + #else + let matchc = gt.gl_pathc + #endif return (0 ..< Int(matchc)).compactMap { index in if let path = String(validatingUTF8: gt.gl_pathv[index]!) { return Path(path) diff --git a/Sources/XcodeProj/Extensions/String+md5.swift b/Sources/XcodeProj/Extensions/String+md5.swift index 95c082b15..77ad4a934 100644 --- a/Sources/XcodeProj/Extensions/String+md5.swift +++ b/Sources/XcodeProj/Extensions/String+md5.swift @@ -21,18 +21,50 @@ */ import Foundation -import XcodeProjCExt +#if canImport(CryptoKit) +import CryptoKit +#endif extension String { var md5: String { guard let data = data(using: .utf8, allowLossyConversion: true) else { - fatalError("Unable to get UTF-8 string from data") + return self } - return data.withUnsafeBytes { bufferPointer in - let castedBuffer = bufferPointer.bindMemory(to: Int8.self) - let hex = XCPComputeMD5(castedBuffer.baseAddress, Int32(data.count))! - return String(cString: hex, encoding: .ascii)! + #if canImport(CryptoKit) + if #available(OSX 10.15, *) { + var hasher = Insecure.MD5() + hasher.update(data: data) + let digest = hasher.finalize() + return digest.reduce(into: "") { hexString, byte in + hexString.append(String(format: "%02hhx", byte)) + } + } else { + return data.slowMD5 + } + #else + return data.slowMD5 + #endif + } +} + +private extension Data { + // Custom md5 for systems without CryptoKit. + var slowMD5: String { + let message = withUnsafeBytes { bufferPointer in + Array(UnsafeBufferPointer( + start: bufferPointer.baseAddress?.assumingMemoryBound(to: UInt8.self), + count: count + )) + } + + let MD5Calculator = MD5(message) + let MD5Data = MD5Calculator.calculate() + + var MD5String = String() + for c in MD5Data { + MD5String += String(format: "%02x", c) } + return MD5String } } diff --git a/Sources/XcodeProj/Objects/BuildPhase/PBXBuildFile.swift b/Sources/XcodeProj/Objects/BuildPhase/PBXBuildFile.swift index e9da61e4f..7982d6be5 100644 --- a/Sources/XcodeProj/Objects/BuildPhase/PBXBuildFile.swift +++ b/Sources/XcodeProj/Objects/BuildPhase/PBXBuildFile.swift @@ -80,6 +80,11 @@ public final class PBXBuildFile: PBXObject { platformFilter = try container.decodeIfPresent(.platformFilter) try super.init(from: decoder) } + + override func isEqual(to object: Any?) -> Bool { + guard let rhs = object as? PBXBuildFile else { return false } + return isEqual(to: rhs) + } } // MARK: - Internal Helpers diff --git a/Sources/XcodeProj/Objects/BuildPhase/PBXBuildPhase.swift b/Sources/XcodeProj/Objects/BuildPhase/PBXBuildPhase.swift index 41d29029e..b6f261a19 100644 --- a/Sources/XcodeProj/Objects/BuildPhase/PBXBuildPhase.swift +++ b/Sources/XcodeProj/Objects/BuildPhase/PBXBuildPhase.swift @@ -106,6 +106,11 @@ public class PBXBuildPhase: PBXContainerItem { dictionary["runOnlyForDeploymentPostprocessing"] = .string(CommentedString("\(runOnlyForDeploymentPostprocessing.int)")) return dictionary } + + override func isEqual(to object: Any?) -> Bool { + guard let rhs = object as? PBXBuildPhase else { return false } + return isEqual(to: rhs) + } } // MARK: - Helpers diff --git a/Sources/XcodeProj/Objects/BuildPhase/PBXBuildRule.swift b/Sources/XcodeProj/Objects/BuildPhase/PBXBuildRule.swift index a18114643..aadf215cc 100644 --- a/Sources/XcodeProj/Objects/BuildPhase/PBXBuildRule.swift +++ b/Sources/XcodeProj/Objects/BuildPhase/PBXBuildRule.swift @@ -88,6 +88,11 @@ public final class PBXBuildRule: PBXObject { runOncePerArchitecture = try container.decodeIntBoolIfPresent(.runOncePerArchitecture) try super.init(from: decoder) } + + override func isEqual(to object: Any?) -> Bool { + guard let rhs = object as? PBXBuildRule else { return false } + return isEqual(to: rhs) + } } // MARK: - PBXBuildRule Extension (PlistSerializable) diff --git a/Sources/XcodeProj/Objects/BuildPhase/PBXCopyFilesBuildPhase.swift b/Sources/XcodeProj/Objects/BuildPhase/PBXCopyFilesBuildPhase.swift index 2882f9ecb..2c30cc9ae 100644 --- a/Sources/XcodeProj/Objects/BuildPhase/PBXCopyFilesBuildPhase.swift +++ b/Sources/XcodeProj/Objects/BuildPhase/PBXCopyFilesBuildPhase.swift @@ -71,6 +71,11 @@ public final class PBXCopyFilesBuildPhase: PBXBuildPhase { name = try container.decodeIfPresent(.name) try super.init(from: decoder) } + + override func isEqual(to object: Any?) -> Bool { + guard let rhs = object as? PBXCopyFilesBuildPhase else { return false } + return isEqual(to: rhs) + } } // MARK: - PBXCopyFilesBuildPhase Extension (PlistSerializable) diff --git a/Sources/XcodeProj/Objects/BuildPhase/PBXFrameworksBuildPhase.swift b/Sources/XcodeProj/Objects/BuildPhase/PBXFrameworksBuildPhase.swift index 914f55f14..4eecc3a1b 100644 --- a/Sources/XcodeProj/Objects/BuildPhase/PBXFrameworksBuildPhase.swift +++ b/Sources/XcodeProj/Objects/BuildPhase/PBXFrameworksBuildPhase.swift @@ -5,6 +5,11 @@ public final class PBXFrameworksBuildPhase: PBXBuildPhase { override public var buildPhase: BuildPhase { .frameworks } + + override func isEqual(to object: Any?) -> Bool { + guard let rhs = object as? PBXFrameworksBuildPhase else { return false } + return isEqual(to: rhs) + } } // MARK: - PBXFrameworksBuildPhase Extension (PlistSerializable) diff --git a/Sources/XcodeProj/Objects/BuildPhase/PBXHeadersBuildPhase.swift b/Sources/XcodeProj/Objects/BuildPhase/PBXHeadersBuildPhase.swift index 39360be68..9bffc8559 100644 --- a/Sources/XcodeProj/Objects/BuildPhase/PBXHeadersBuildPhase.swift +++ b/Sources/XcodeProj/Objects/BuildPhase/PBXHeadersBuildPhase.swift @@ -6,6 +6,11 @@ public final class PBXHeadersBuildPhase: PBXBuildPhase { override public var buildPhase: BuildPhase { .headers } + + override func isEqual(to object: Any?) -> Bool { + guard let rhs = object as? PBXHeadersBuildPhase else { return false } + return isEqual(to: rhs) + } } // MARK: - PBXHeadersBuildPhase Extension (PlistSerializable) diff --git a/Sources/XcodeProj/Objects/BuildPhase/PBXResourcesBuildPhase.swift b/Sources/XcodeProj/Objects/BuildPhase/PBXResourcesBuildPhase.swift index bdf96ba95..a937087d6 100644 --- a/Sources/XcodeProj/Objects/BuildPhase/PBXResourcesBuildPhase.swift +++ b/Sources/XcodeProj/Objects/BuildPhase/PBXResourcesBuildPhase.swift @@ -5,6 +5,11 @@ public final class PBXResourcesBuildPhase: PBXBuildPhase { override public var buildPhase: BuildPhase { .resources } + + override func isEqual(to object: Any?) -> Bool { + guard let rhs = object as? PBXResourcesBuildPhase else { return false } + return isEqual(to: rhs) + } } // MARK: - PBXResourcesBuildPhase Extension (PlistSerializable) diff --git a/Sources/XcodeProj/Objects/BuildPhase/PBXRezBuildPhase.swift b/Sources/XcodeProj/Objects/BuildPhase/PBXRezBuildPhase.swift index 3fa7d89fe..79a225d19 100644 --- a/Sources/XcodeProj/Objects/BuildPhase/PBXRezBuildPhase.swift +++ b/Sources/XcodeProj/Objects/BuildPhase/PBXRezBuildPhase.swift @@ -6,6 +6,11 @@ public final class PBXRezBuildPhase: PBXBuildPhase { override public var buildPhase: BuildPhase { .carbonResources } + + override func isEqual(to object: Any?) -> Bool { + guard let rhs = object as? PBXRezBuildPhase else { return false } + return isEqual(to: rhs) + } } // MARK: - PBXRezBuildPhase Extension (PlistSerializable) diff --git a/Sources/XcodeProj/Objects/BuildPhase/PBXShellScriptBuildPhase.swift b/Sources/XcodeProj/Objects/BuildPhase/PBXShellScriptBuildPhase.swift index 4533e1c2a..6cfc30fc7 100644 --- a/Sources/XcodeProj/Objects/BuildPhase/PBXShellScriptBuildPhase.swift +++ b/Sources/XcodeProj/Objects/BuildPhase/PBXShellScriptBuildPhase.swift @@ -100,6 +100,11 @@ public final class PBXShellScriptBuildPhase: PBXBuildPhase { dependencyFile = try container.decodeIfPresent(.dependencyFile) try super.init(from: decoder) } + + override func isEqual(to object: Any?) -> Bool { + guard let rhs = object as? PBXShellScriptBuildPhase else { return false } + return isEqual(to: rhs) + } } // MARK: - PBXShellScriptBuildPhase Extension (PlistSerializable) diff --git a/Sources/XcodeProj/Objects/BuildPhase/PBXSourcesBuildPhase.swift b/Sources/XcodeProj/Objects/BuildPhase/PBXSourcesBuildPhase.swift index fbcae7fa3..2b6ed8f89 100644 --- a/Sources/XcodeProj/Objects/BuildPhase/PBXSourcesBuildPhase.swift +++ b/Sources/XcodeProj/Objects/BuildPhase/PBXSourcesBuildPhase.swift @@ -5,6 +5,11 @@ public final class PBXSourcesBuildPhase: PBXBuildPhase { override public var buildPhase: BuildPhase { .sources } + + override func isEqual(to object: Any?) -> Bool { + guard let rhs = object as? PBXSourcesBuildPhase else { return false } + return isEqual(to: rhs) + } } extension PBXSourcesBuildPhase: PlistSerializable { diff --git a/Sources/XcodeProj/Objects/Configuration/XCBuildConfiguration.swift b/Sources/XcodeProj/Objects/Configuration/XCBuildConfiguration.swift index 27562aee8..468984cc4 100644 --- a/Sources/XcodeProj/Objects/Configuration/XCBuildConfiguration.swift +++ b/Sources/XcodeProj/Objects/Configuration/XCBuildConfiguration.swift @@ -89,6 +89,11 @@ public final class XCBuildConfiguration: PBXObject { break } } + + override func isEqual(to object: Any?) -> Bool { + guard let rhs = object as? XCBuildConfiguration else { return false } + return isEqual(to: rhs) + } } // MARK: - PlistSerializable diff --git a/Sources/XcodeProj/Objects/Configuration/XCConfigurationList.swift b/Sources/XcodeProj/Objects/Configuration/XCConfigurationList.swift index 7bbbb874a..0bf2cfe35 100644 --- a/Sources/XcodeProj/Objects/Configuration/XCConfigurationList.swift +++ b/Sources/XcodeProj/Objects/Configuration/XCConfigurationList.swift @@ -59,6 +59,11 @@ public final class XCConfigurationList: PBXObject { defaultConfigurationName = try container.decodeIfPresent(.defaultConfigurationName) try super.init(from: decoder) } + + override func isEqual(to object: Any?) -> Bool { + guard let rhs = object as? XCConfigurationList else { return false } + return isEqual(to: rhs) + } } // MARK: - Helpers diff --git a/Sources/XcodeProj/Objects/Files/PBXContainerItem.swift b/Sources/XcodeProj/Objects/Files/PBXContainerItem.swift index 0995f8b90..2e11f9039 100644 --- a/Sources/XcodeProj/Objects/Files/PBXContainerItem.swift +++ b/Sources/XcodeProj/Objects/Files/PBXContainerItem.swift @@ -31,4 +31,9 @@ public class PBXContainerItem: PBXObject { } return dictionary } + + override func isEqual(to object: Any?) -> Bool { + guard let rhs = object as? PBXContainerItem else { return false } + return isEqual(to: rhs) + } } diff --git a/Sources/XcodeProj/Objects/Files/PBXContainerItemProxy.swift b/Sources/XcodeProj/Objects/Files/PBXContainerItemProxy.swift index 0817fbccd..f244aeada 100644 --- a/Sources/XcodeProj/Objects/Files/PBXContainerItemProxy.swift +++ b/Sources/XcodeProj/Objects/Files/PBXContainerItemProxy.swift @@ -142,6 +142,11 @@ public final class PBXContainerItemProxy: PBXObject { remoteInfo = try container.decodeIfPresent(.remoteInfo) try super.init(from: decoder) } + + override func isEqual(to object: Any?) -> Bool { + guard let rhs = object as? PBXContainerItemProxy else { return false } + return isEqual(to: rhs) + } } // MARK: - PBXContainerItemProxy Extension (PlistSerializable) diff --git a/Sources/XcodeProj/Objects/Files/PBXFileElement.swift b/Sources/XcodeProj/Objects/Files/PBXFileElement.swift index 9508a1b9b..fb245cd55 100644 --- a/Sources/XcodeProj/Objects/Files/PBXFileElement.swift +++ b/Sources/XcodeProj/Objects/Files/PBXFileElement.swift @@ -134,6 +134,11 @@ public class PBXFileElement: PBXContainerItem, PlistSerializable { func fileName() -> String? { name ?? path } + + override func isEqual(to object: Any?) -> Bool { + guard let rhs = object as? PBXFileElement else { return false } + return isEqual(to: rhs) + } } // MARK: - Helpers diff --git a/Sources/XcodeProj/Objects/Files/PBXFileReference.swift b/Sources/XcodeProj/Objects/Files/PBXFileReference.swift index 7d962915a..a1a0ff35f 100644 --- a/Sources/XcodeProj/Objects/Files/PBXFileReference.swift +++ b/Sources/XcodeProj/Objects/Files/PBXFileReference.swift @@ -134,4 +134,9 @@ public final class PBXFileReference: PBXFileElement { return (key: CommentedString(reference, comment: name ?? path), value: .dictionary(dictionary)) } + + override func isEqual(to object: Any?) -> Bool { + guard let rhs = object as? PBXFileReference else { return false } + return isEqual(to: rhs) + } } diff --git a/Sources/XcodeProj/Objects/Files/PBXGroup.swift b/Sources/XcodeProj/Objects/Files/PBXGroup.swift index 35bb3c188..5387cdc3b 100644 --- a/Sources/XcodeProj/Objects/Files/PBXGroup.swift +++ b/Sources/XcodeProj/Objects/Files/PBXGroup.swift @@ -80,6 +80,11 @@ public class PBXGroup: PBXFileElement { comment: name ?? path), value: .dictionary(dictionary)) } + + override func isEqual(to object: Any?) -> Bool { + guard let rhs = object as? PBXGroup else { return false } + return isEqual(to: rhs) + } } // MARK: - Helpers diff --git a/Sources/XcodeProj/Objects/Files/PBXVariantGroup.swift b/Sources/XcodeProj/Objects/Files/PBXVariantGroup.swift index e0fcc01a5..53d3659a9 100644 --- a/Sources/XcodeProj/Objects/Files/PBXVariantGroup.swift +++ b/Sources/XcodeProj/Objects/Files/PBXVariantGroup.swift @@ -1,4 +1,9 @@ import Foundation // This is the element for referencing localized resources. -public final class PBXVariantGroup: PBXGroup {} +public final class PBXVariantGroup: PBXGroup { + override func isEqual(to object: Any?) -> Bool { + guard let rhs = object as? PBXVariantGroup else { return false } + return isEqual(to: rhs) + } +} diff --git a/Sources/XcodeProj/Objects/Files/XCVersionGroup.swift b/Sources/XcodeProj/Objects/Files/XCVersionGroup.swift index f9aa124f9..3087294f2 100644 --- a/Sources/XcodeProj/Objects/Files/XCVersionGroup.swift +++ b/Sources/XcodeProj/Objects/Files/XCVersionGroup.swift @@ -97,4 +97,9 @@ public final class XCVersionGroup: PBXGroup { return (key: CommentedString(reference, comment: path?.split(separator: "/").last.map(String.init)), value: .dictionary(dictionary)) } + + override func isEqual(to object: Any?) -> Bool { + guard let rhs = object as? XCVersionGroup else { return false } + return isEqual(to: rhs) + } } diff --git a/Sources/XcodeProj/Objects/Project/PBXObject.swift b/Sources/XcodeProj/Objects/Project/PBXObject.swift index 153cf0513..780f4154b 100644 --- a/Sources/XcodeProj/Objects/Project/PBXObject.swift +++ b/Sources/XcodeProj/Objects/Project/PBXObject.swift @@ -60,7 +60,7 @@ public class PBXObject: Hashable, Decodable, Equatable, AutoEquatable { lhs.isEqual(to: rhs) } - @objc dynamic func isEqual(to _: Any?) -> Bool { + func isEqual(to _: Any?) -> Bool { true } diff --git a/Sources/XcodeProj/Objects/Project/PBXObjectReference.swift b/Sources/XcodeProj/Objects/Project/PBXObjectReference.swift index fc4ce56ac..c72a943af 100644 --- a/Sources/XcodeProj/Objects/Project/PBXObjectReference.swift +++ b/Sources/XcodeProj/Objects/Project/PBXObjectReference.swift @@ -1,5 +1,4 @@ import Foundation -import os.signpost /// Object used as a reference to PBXObjects from PBXObjects. class PBXObjectReference: NSObject, Comparable, NSCopying { diff --git a/Sources/XcodeProj/Objects/Project/PBXProjEncoder.swift b/Sources/XcodeProj/Objects/Project/PBXProjEncoder.swift index a13c203c8..bbe1c2533 100644 --- a/Sources/XcodeProj/Objects/Project/PBXProjEncoder.swift +++ b/Sources/XcodeProj/Objects/Project/PBXProjEncoder.swift @@ -308,7 +308,7 @@ final class PBXProjEncoder { try write(section: section, proj: proj, objects: objects, sort: outputSettings.projFileListOrder.sort, stateHolder: &stateHolder, to: &output) } - final class PBXProjElement { + final class PBXProjElement: NSObject { let key: CommentedString let value: PlistValue let multiline: Bool diff --git a/Sources/XcodeProj/Objects/Project/PBXProject.swift b/Sources/XcodeProj/Objects/Project/PBXProject.swift index 567af8245..86e3afaae 100644 --- a/Sources/XcodeProj/Objects/Project/PBXProject.swift +++ b/Sources/XcodeProj/Objects/Project/PBXProject.swift @@ -370,6 +370,11 @@ public final class PBXProject: PBXObject { try super.init(from: decoder) } + + override func isEqual(to object: Any?) -> Bool { + guard let rhs = object as? PBXProject else { return false } + return isEqual(to: rhs) + } } // MARK: - Helpers diff --git a/Sources/XcodeProj/Objects/Sourcery/Equality.generated.swift b/Sources/XcodeProj/Objects/Sourcery/Equality.generated.swift index 1230864d3..9daa37a2d 100644 --- a/Sources/XcodeProj/Objects/Sourcery/Equality.generated.swift +++ b/Sources/XcodeProj/Objects/Sourcery/Equality.generated.swift @@ -1,30 +1,30 @@ -// Generated using Sourcery 0.13.1 — https://github.com/krzysztofzablocki/Sourcery +// Generated using Sourcery 1.0.0 — https://github.com/krzysztofzablocki/Sourcery // DO NOT EDIT import Foundation extension PBXAggregateTarget { /// :nodoc: - @objc override public func isEqual(to object: Any?) -> Bool { - guard let rhs = object as? PBXAggregateTarget else { return false } + func isEqual(to rhs: PBXAggregateTarget) -> Bool { return super.isEqual(to: rhs) } } extension PBXBuildFile { /// :nodoc: - @objc override public func isEqual(to object: Any?) -> Bool { - guard let rhs = object as? PBXBuildFile else { return false } + func isEqual(to rhs: PBXBuildFile) -> Bool { if fileReference != rhs.fileReference { return false } + if productReference != rhs.productReference { return false } if !NSDictionary(dictionary: settings ?? [:]).isEqual(to: rhs.settings ?? [:]) { return false } + if platformFilter != rhs.platformFilter { return false } + if buildPhase != rhs.buildPhase { return false } return super.isEqual(to: rhs) } } extension PBXBuildPhase { /// :nodoc: - @objc override public func isEqual(to object: Any?) -> Bool { - guard let rhs = object as? PBXBuildPhase else { return false } + func isEqual(to rhs: PBXBuildPhase) -> Bool { if buildActionMask != rhs.buildActionMask { return false } if fileReferences != rhs.fileReferences { return false } if inputFileListPaths != rhs.inputFileListPaths { return false } @@ -36,14 +36,14 @@ extension PBXBuildPhase { extension PBXBuildRule { /// :nodoc: - @objc override public func isEqual(to object: Any?) -> Bool { - guard let rhs = object as? PBXBuildRule else { return false } + func isEqual(to rhs: PBXBuildRule) -> Bool { if compilerSpec != rhs.compilerSpec { return false } if filePatterns != rhs.filePatterns { return false } if fileType != rhs.fileType { return false } if isEditable != rhs.isEditable { return false } if name != rhs.name { return false } if outputFiles != rhs.outputFiles { return false } + if inputFiles != rhs.inputFiles { return false } if outputFilesCompilerFlags != rhs.outputFilesCompilerFlags { return false } if script != rhs.script { return false } if runOncePerArchitecture != rhs.runOncePerArchitecture { return false } @@ -53,8 +53,7 @@ extension PBXBuildRule { extension PBXContainerItem { /// :nodoc: - @objc override public func isEqual(to object: Any?) -> Bool { - guard let rhs = object as? PBXContainerItem else { return false } + func isEqual(to rhs: PBXContainerItem) -> Bool { if comments != rhs.comments { return false } return super.isEqual(to: rhs) } @@ -62,8 +61,7 @@ extension PBXContainerItem { extension PBXContainerItemProxy { /// :nodoc: - @objc override public func isEqual(to object: Any?) -> Bool { - guard let rhs = object as? PBXContainerItemProxy else { return false } + func isEqual(to rhs: PBXContainerItemProxy) -> Bool { if containerPortalReference != rhs.containerPortalReference { return false } if proxyType != rhs.proxyType { return false } if remoteGlobalIDReference != rhs.remoteGlobalIDReference { return false } @@ -74,8 +72,7 @@ extension PBXContainerItemProxy { extension PBXCopyFilesBuildPhase { /// :nodoc: - @objc override public func isEqual(to object: Any?) -> Bool { - guard let rhs = object as? PBXCopyFilesBuildPhase else { return false } + func isEqual(to rhs: PBXCopyFilesBuildPhase) -> Bool { if dstPath != rhs.dstPath { return false } if dstSubfolderSpec != rhs.dstSubfolderSpec { return false } if name != rhs.name { return false } @@ -85,8 +82,7 @@ extension PBXCopyFilesBuildPhase { extension PBXFileElement { /// :nodoc: - @objc override public func isEqual(to object: Any?) -> Bool { - guard let rhs = object as? PBXFileElement else { return false } + func isEqual(to rhs: PBXFileElement) -> Bool { if sourceTree != rhs.sourceTree { return false } if path != rhs.path { return false } if name != rhs.name { return false } @@ -95,14 +91,14 @@ extension PBXFileElement { if indentWidth != rhs.indentWidth { return false } if tabWidth != rhs.tabWidth { return false } if wrapsLines != rhs.wrapsLines { return false } + if parent != rhs.parent { return false } return super.isEqual(to: rhs) } } extension PBXFileReference { /// :nodoc: - @objc override public func isEqual(to object: Any?) -> Bool { - guard let rhs = object as? PBXFileReference else { return false } + func isEqual(to rhs: PBXFileReference) -> Bool { if fileEncoding != rhs.fileEncoding { return false } if explicitFileType != rhs.explicitFileType { return false } if lastKnownFileType != rhs.lastKnownFileType { return false } @@ -116,16 +112,14 @@ extension PBXFileReference { extension PBXFrameworksBuildPhase { /// :nodoc: - @objc override public func isEqual(to object: Any?) -> Bool { - guard let rhs = object as? PBXFrameworksBuildPhase else { return false } + func isEqual(to rhs: PBXFrameworksBuildPhase) -> Bool { return super.isEqual(to: rhs) } } extension PBXGroup { /// :nodoc: - @objc override public func isEqual(to object: Any?) -> Bool { - guard let rhs = object as? PBXGroup else { return false } + func isEqual(to rhs: PBXGroup) -> Bool { if childrenReferences != rhs.childrenReferences { return false } return super.isEqual(to: rhs) } @@ -133,16 +127,14 @@ extension PBXGroup { extension PBXHeadersBuildPhase { /// :nodoc: - @objc override public func isEqual(to object: Any?) -> Bool { - guard let rhs = object as? PBXHeadersBuildPhase else { return false } + func isEqual(to rhs: PBXHeadersBuildPhase) -> Bool { return super.isEqual(to: rhs) } } extension PBXLegacyTarget { /// :nodoc: - @objc override public func isEqual(to object: Any?) -> Bool { - guard let rhs = object as? PBXLegacyTarget else { return false } + func isEqual(to rhs: PBXLegacyTarget) -> Bool { if buildToolPath != rhs.buildToolPath { return false } if buildArgumentsString != rhs.buildArgumentsString { return false } if passBuildSettingsInEnvironment != rhs.passBuildSettingsInEnvironment { return false } @@ -153,8 +145,7 @@ extension PBXLegacyTarget { extension PBXNativeTarget { /// :nodoc: - @objc override public func isEqual(to object: Any?) -> Bool { - guard let rhs = object as? PBXNativeTarget else { return false } + func isEqual(to rhs: PBXNativeTarget) -> Bool { if productInstallPath != rhs.productInstallPath { return false } return super.isEqual(to: rhs) } @@ -162,8 +153,7 @@ extension PBXNativeTarget { extension PBXProject { /// :nodoc: - @objc override public func isEqual(to object: Any?) -> Bool { - guard let rhs = object as? PBXProject else { return false } + func isEqual(to rhs: PBXProject) -> Bool { if name != rhs.name { return false } if buildConfigurationListReference != rhs.buildConfigurationListReference { return false } if compatibilityVersion != rhs.compatibilityVersion { return false } @@ -178,48 +168,44 @@ extension PBXProject { if targetReferences != rhs.targetReferences { return false } if !NSDictionary(dictionary: attributes).isEqual(to: rhs.attributes) { return false } if !NSDictionary(dictionary: targetAttributeReferences).isEqual(to: rhs.targetAttributeReferences) { return false } + if packageReferences != rhs.packageReferences { return false } return super.isEqual(to: rhs) } } extension PBXReferenceProxy { /// :nodoc: - @objc override public func isEqual(to object: Any?) -> Bool { - guard let rhs = object as? PBXReferenceProxy else { return false } + func isEqual(to rhs: PBXReferenceProxy) -> Bool { if fileType != rhs.fileType { return false } - if path != rhs.path { return false } if remoteReference != rhs.remoteReference { return false } - if sourceTree != rhs.sourceTree { return false } return super.isEqual(to: rhs) } } extension PBXResourcesBuildPhase { /// :nodoc: - @objc override public func isEqual(to object: Any?) -> Bool { - guard let rhs = object as? PBXResourcesBuildPhase else { return false } + func isEqual(to rhs: PBXResourcesBuildPhase) -> Bool { return super.isEqual(to: rhs) } } extension PBXRezBuildPhase { /// :nodoc: - @objc override public func isEqual(to object: Any?) -> Bool { - guard let rhs = object as? PBXRezBuildPhase else { return false } + func isEqual(to rhs: PBXRezBuildPhase) -> Bool { return super.isEqual(to: rhs) } } extension PBXShellScriptBuildPhase { /// :nodoc: - @objc override public func isEqual(to object: Any?) -> Bool { - guard let rhs = object as? PBXShellScriptBuildPhase else { return false } + func isEqual(to rhs: PBXShellScriptBuildPhase) -> Bool { if name != rhs.name { return false } if inputPaths != rhs.inputPaths { return false } if outputPaths != rhs.outputPaths { return false } if shellPath != rhs.shellPath { return false } if shellScript != rhs.shellScript { return false } if showEnvVarsInLog != rhs.showEnvVarsInLog { return false } + if alwaysOutOfDate != rhs.alwaysOutOfDate { return false } if dependencyFile != rhs.dependencyFile { return false } return super.isEqual(to: rhs) } @@ -227,16 +213,14 @@ extension PBXShellScriptBuildPhase { extension PBXSourcesBuildPhase { /// :nodoc: - @objc override public func isEqual(to object: Any?) -> Bool { - guard let rhs = object as? PBXSourcesBuildPhase else { return false } + func isEqual(to rhs: PBXSourcesBuildPhase) -> Bool { return super.isEqual(to: rhs) } } extension PBXTarget { /// :nodoc: - @objc override public func isEqual(to object: Any?) -> Bool { - guard let rhs = object as? PBXTarget else { return false } + func isEqual(to rhs: PBXTarget) -> Bool { if buildConfigurationListReference != rhs.buildConfigurationListReference { return false } if buildPhaseReferences != rhs.buildPhaseReferences { return false } if buildRuleReferences != rhs.buildRuleReferences { return false } @@ -244,6 +228,7 @@ extension PBXTarget { if name != rhs.name { return false } if productName != rhs.productName { return false } if productReference != rhs.productReference { return false } + if packageProductDependencyReferences != rhs.packageProductDependencyReferences { return false } if productType != rhs.productType { return false } return super.isEqual(to: rhs) } @@ -251,27 +236,26 @@ extension PBXTarget { extension PBXTargetDependency { /// :nodoc: - @objc override public func isEqual(to object: Any?) -> Bool { - guard let rhs = object as? PBXTargetDependency else { return false } + func isEqual(to rhs: PBXTargetDependency) -> Bool { if name != rhs.name { return false } if targetReference != rhs.targetReference { return false } if targetProxyReference != rhs.targetProxyReference { return false } + if productReference != rhs.productReference { return false } + if platformFilter != rhs.platformFilter { return false } return super.isEqual(to: rhs) } } extension PBXVariantGroup { /// :nodoc: - @objc override public func isEqual(to object: Any?) -> Bool { - guard let rhs = object as? PBXVariantGroup else { return false } + func isEqual(to rhs: PBXVariantGroup) -> Bool { return super.isEqual(to: rhs) } } extension XCBuildConfiguration { /// :nodoc: - @objc override public func isEqual(to object: Any?) -> Bool { - guard let rhs = object as? XCBuildConfiguration else { return false } + func isEqual(to rhs: XCBuildConfiguration) -> Bool { if baseConfigurationReference != rhs.baseConfigurationReference { return false } if !NSDictionary(dictionary: buildSettings).isEqual(to: rhs.buildSettings) { return false } if name != rhs.name { return false } @@ -281,8 +265,7 @@ extension XCBuildConfiguration { extension XCConfigurationList { /// :nodoc: - @objc override public func isEqual(to object: Any?) -> Bool { - guard let rhs = object as? XCConfigurationList else { return false } + func isEqual(to rhs: XCConfigurationList) -> Bool { if buildConfigurationReferences != rhs.buildConfigurationReferences { return false } if defaultConfigurationIsVisible != rhs.defaultConfigurationIsVisible { return false } if defaultConfigurationName != rhs.defaultConfigurationName { return false } @@ -290,10 +273,27 @@ extension XCConfigurationList { } } +extension XCRemoteSwiftPackageReference { + /// :nodoc: + func isEqual(to rhs: XCRemoteSwiftPackageReference) -> Bool { + if repositoryURL != rhs.repositoryURL { return false } + if versionRequirement != rhs.versionRequirement { return false } + return super.isEqual(to: rhs) + } +} + +extension XCSwiftPackageProductDependency { + /// :nodoc: + func isEqual(to rhs: XCSwiftPackageProductDependency) -> Bool { + if productName != rhs.productName { return false } + if packageReference != rhs.packageReference { return false } + return super.isEqual(to: rhs) + } +} + extension XCVersionGroup { /// :nodoc: - @objc override public func isEqual(to object: Any?) -> Bool { - guard let rhs = object as? XCVersionGroup else { return false } + func isEqual(to rhs: XCVersionGroup) -> Bool { if currentVersionReference != rhs.currentVersionReference { return false } if versionGroupType != rhs.versionGroupType { return false } return super.isEqual(to: rhs) diff --git a/Sources/XcodeProj/Objects/SwiftPackage/XCRemoteSwiftPackageReference.swift b/Sources/XcodeProj/Objects/SwiftPackage/XCRemoteSwiftPackageReference.swift index bcb70e9b9..78b4a86f3 100644 --- a/Sources/XcodeProj/Objects/SwiftPackage/XCRemoteSwiftPackageReference.swift +++ b/Sources/XcodeProj/Objects/SwiftPackage/XCRemoteSwiftPackageReference.swift @@ -141,12 +141,8 @@ public class XCRemoteSwiftPackageReference: PBXContainerItem, PlistSerializable value: .dictionary(dictionary)) } - // MARK: - Equatable - - @objc override public func isEqual(to object: Any?) -> Bool { + override func isEqual(to object: Any?) -> Bool { guard let rhs = object as? XCRemoteSwiftPackageReference else { return false } - if repositoryURL != rhs.repositoryURL { return false } - if versionRequirement != rhs.versionRequirement { return false } - return super.isEqual(to: rhs) + return isEqual(to: rhs) } } diff --git a/Sources/XcodeProj/Objects/SwiftPackage/XCSwiftPackageProductDependency.swift b/Sources/XcodeProj/Objects/SwiftPackage/XCSwiftPackageProductDependency.swift index dfccd6278..f7ae0d4c6 100644 --- a/Sources/XcodeProj/Objects/SwiftPackage/XCSwiftPackageProductDependency.swift +++ b/Sources/XcodeProj/Objects/SwiftPackage/XCSwiftPackageProductDependency.swift @@ -59,12 +59,8 @@ public class XCSwiftPackageProductDependency: PBXContainerItem, PlistSerializabl case package } - // MARK: - Equatable - - @objc override public func isEqual(to object: Any?) -> Bool { + override func isEqual(to object: Any?) -> Bool { guard let rhs = object as? XCSwiftPackageProductDependency else { return false } - if packageReference != rhs.packageReference { return false } - if productName != rhs.productName { return false } - return super.isEqual(to: rhs) + return isEqual(to: rhs) } } diff --git a/Sources/XcodeProj/Objects/Targets/PBXAggregateTarget.swift b/Sources/XcodeProj/Objects/Targets/PBXAggregateTarget.swift index d67b66da8..e963ecd2a 100644 --- a/Sources/XcodeProj/Objects/Targets/PBXAggregateTarget.swift +++ b/Sources/XcodeProj/Objects/Targets/PBXAggregateTarget.swift @@ -1,7 +1,12 @@ import Foundation /// This is the element for a build target that aggregates several others. -public final class PBXAggregateTarget: PBXTarget {} +public final class PBXAggregateTarget: PBXTarget { + override func isEqual(to object: Any?) -> Bool { + guard let rhs = object as? PBXAggregateTarget else { return false } + return isEqual(to: rhs) + } +} // MARK: - PBXAggregateTarget Extension (PlistSerializable) diff --git a/Sources/XcodeProj/Objects/Targets/PBXLegacyTarget.swift b/Sources/XcodeProj/Objects/Targets/PBXLegacyTarget.swift index f53297bdf..1b858e8ca 100644 --- a/Sources/XcodeProj/Objects/Targets/PBXLegacyTarget.swift +++ b/Sources/XcodeProj/Objects/Targets/PBXLegacyTarget.swift @@ -97,6 +97,11 @@ public final class PBXLegacyTarget: PBXTarget { } return (key: key, value: .dictionary(dict)) } + + override func isEqual(to object: Any?) -> Bool { + guard let rhs = object as? PBXLegacyTarget else { return false } + return isEqual(to: rhs) + } } // MARK: - PBXNativeTarget Extension (PlistSerializable) diff --git a/Sources/XcodeProj/Objects/Targets/PBXNativeTarget.swift b/Sources/XcodeProj/Objects/Targets/PBXNativeTarget.swift index aba2a7f5b..5b1296136 100644 --- a/Sources/XcodeProj/Objects/Targets/PBXNativeTarget.swift +++ b/Sources/XcodeProj/Objects/Targets/PBXNativeTarget.swift @@ -59,6 +59,11 @@ public final class PBXNativeTarget: PBXTarget { } return (key: key, value: .dictionary(dict)) } + + override func isEqual(to object: Any?) -> Bool { + guard let rhs = object as? PBXNativeTarget else { return false } + return isEqual(to: rhs) + } } // MARK: - PBXNativeTarget Extension (PlistSerializable) diff --git a/Sources/XcodeProj/Objects/Targets/PBXReferenceProxy.swift b/Sources/XcodeProj/Objects/Targets/PBXReferenceProxy.swift index 900db1aa1..67363c585 100644 --- a/Sources/XcodeProj/Objects/Targets/PBXReferenceProxy.swift +++ b/Sources/XcodeProj/Objects/Targets/PBXReferenceProxy.swift @@ -73,4 +73,9 @@ public final class PBXReferenceProxy: PBXFileElement { return (key: CommentedString(reference, comment: path), value: .dictionary(dictionary)) } + + override func isEqual(to object: Any?) -> Bool { + guard let rhs = object as? PBXReferenceProxy else { return false } + return isEqual(to: rhs) + } } diff --git a/Sources/XcodeProj/Objects/Targets/PBXTarget.swift b/Sources/XcodeProj/Objects/Targets/PBXTarget.swift index d290c52f6..9e2213586 100644 --- a/Sources/XcodeProj/Objects/Targets/PBXTarget.swift +++ b/Sources/XcodeProj/Objects/Targets/PBXTarget.swift @@ -207,6 +207,11 @@ public class PBXTarget: PBXContainerItem { return (key: CommentedString(reference, comment: name), value: .dictionary(dictionary)) } + + override func isEqual(to object: Any?) -> Bool { + guard let rhs = object as? PBXTarget else { return false } + return isEqual(to: rhs) + } } // MARK: - Helpers diff --git a/Sources/XcodeProj/Objects/Targets/PBXTargetDependency.swift b/Sources/XcodeProj/Objects/Targets/PBXTargetDependency.swift index 12d3cefe7..bd3379ac0 100644 --- a/Sources/XcodeProj/Objects/Targets/PBXTargetDependency.swift +++ b/Sources/XcodeProj/Objects/Targets/PBXTargetDependency.swift @@ -99,6 +99,11 @@ public final class PBXTargetDependency: PBXObject { } try super.init(from: decoder) } + + override func isEqual(to object: Any?) -> Bool { + guard let rhs = object as? PBXTargetDependency else { return false } + return isEqual(to: rhs) + } } // MARK: - PlistSerializable diff --git a/Sources/XcodeProj/Utils/CommentedString.swift b/Sources/XcodeProj/Utils/CommentedString.swift index 470d75c82..69b7dc328 100644 --- a/Sources/XcodeProj/Utils/CommentedString.swift +++ b/Sources/XcodeProj/Utils/CommentedString.swift @@ -1,5 +1,4 @@ import Foundation -import XcodeProjCExt /// String that includes a comment struct CommentedString { @@ -30,26 +29,90 @@ struct CommentedString { }() /// Substrings that cause Xcode to quote the string content. - private let invalidStrings = [ - "___", - "//", + /// + /// Matches the strings `___` and `//`. + private let invalidStrings: Trie = [ + "_": ["_": "_"], + "/": "/" ] + /// A tree of characters to efficiently match string prefixes. + private enum Trie: ExpressibleByDictionaryLiteral, ExpressibleByUnicodeScalarLiteral { + case match + case next([(UnicodeScalar, Trie)]) + + init(dictionaryLiteral elements: (UnicodeScalar, Trie)...) { + self = .next(elements) + } + + init(unicodeScalarLiteral value: UnicodeScalar) { + self = .next([(value, .match)]) + } + + /// Accepts a character and mutates to the subtree of strings which match that character. If the character does + /// not match, resets to `default`. + mutating func match(_ character: UnicodeScalar, orResetTo default: Trie) { + switch self { + case .match: + return + case .next(let options): + for (key, subtrie) in options where key == character { + self = subtrie + return + } + self = `default` + } + } + + var accepted: Bool { + switch self { + case .match: return true + case .next: return false + } + } + } + /// Returns a valid string for Xcode projects. var validString: String { switch string { - case "": return "".quoted + case "": return "\"\"" case "false": return "NO" case "true": return "YES" default: break } - return string.withCString { buffer in - let esc = XCPEscapedString(buffer)! - let newString = String(cString: esc) - free(UnsafeMutableRawPointer(mutating: esc)) - return newString + var needsQuoting = false + var matchingInvalidPrefix: Trie = self.invalidStrings + + let escaped = string.reduce(into: "") { escaped, character in + quote: if !needsQuoting { + for scalar in character.unicodeScalars { + matchingInvalidPrefix.match(scalar, orResetTo: self.invalidStrings) + if matchingInvalidPrefix.accepted || CommentedString.invalidCharacters.contains(scalar) { + needsQuoting = true + break quote + } + } + } + // As an optimization, only look at the first scalar. This means we're doing a numeric comparison instead + // of comparing arbitrary-length characters. This is safe because all our cases are a single scalar. + switch character.unicodeScalars.first { + case "\\": + escaped.append("\\\\") + case "\"": + escaped.append("\\\"") + case "\t": + escaped.append("\\t") + case "\n": + escaped.append("\\n") + default: + escaped.append(character) + } + } + if needsQuoting { + return "\"\(escaped)\"" } + return escaped } } diff --git a/Templates/Equality.stencil b/Templates/Equality.stencil index 43df267d7..d8d155a8c 100644 --- a/Templates/Equality.stencil +++ b/Templates/Equality.stencil @@ -3,18 +3,18 @@ import Foundation {% for type in types.implementing.AutoEquatable|class|!annotated:"skipEquality" %} extension {{ type.name }} { /// :nodoc: - @objc override {{ type.accessLevel }} func isEqual(to object: Any?) -> Bool { - guard let rhs = object as? {{ type.name }} else { return false } - {% for variable in type.storedVariables %} - {% if variable.actualTypeName.name == "[String: Any]" or variable.actualTypeName.name == "[String: Any]?" or variable.actualTypeName.name == "BuildSettings"%} - if !NSDictionary(dictionary: self.{{ variable.name}} {% if variable.typeName.isOptional %}?? [:]{% endif %}).isEqual(to: rhs.{{ variable.name }} {% if variable.typeName.isOptional %}?? [:]{% endif %}) { return false } - {% elif variable|!annotated:"skipEquality" %} - if self.{{ variable.name }} != rhs.{{ variable.name }} { return false } - {% endif %} - {% endfor %} - {% for variable in type.computedVariables|annotated:"forceEquality" %}if self.{{ variable.name }} != rhs.{{ variable.name }} { return false } - {% endfor %} - {% if type.inheritedTypes.first == "NSObject" %}return true{% else %}return super.isEqual(to: rhs){% endif %} + func isEqual(to rhs: {{ type.name }}) -> Bool { + {% for variable in type.storedVariables %} + {% if variable.typeName.dictionary %} + if !NSDictionary(dictionary: {{ variable.name}}{% if variable.typeName.isOptional %} ?? [:]{% endif %}).isEqual(to: rhs.{{ variable.name }}{% if variable.typeName.isOptional %} ?? [:]{% endif %}) { return false } + {% elif variable|!annotated:"skipEquality" %} + if {{ variable.name }} != rhs.{{ variable.name }} { return false } + {% endif %} + {% endfor %} + {% for variable in type.computedVariables|annotated:"forceEquality" %}if self.{{ variable.name }} != rhs.{{ variable.name }} { return false } + {% endfor %} + {% if type.inheritedTypes.first == "NSObject" %}return true{% else %}return super.isEqual(to: rhs){% endif %} } } -{% endfor %} \ No newline at end of file + +{% endfor %} diff --git a/Tests/LinuxMain.swift b/Tests/LinuxMain.swift index 938594b30..7a12607d4 100644 --- a/Tests/LinuxMain.swift +++ b/Tests/LinuxMain.swift @@ -1,4 +1,8 @@ import XCTest -@testable import XcodeProjTests -// testDictionaryExtras() +import XcodeProjTests + +var tests = [XCTestCaseEntry]() +tests += XcodeProjTests.__allTests() + +XCTMain(tests) diff --git a/Tests/XcodeProjTests/Objects/Project/PBXProjIntegrationTests.swift b/Tests/XcodeProjTests/Objects/Project/PBXProjIntegrationTests.swift index 3bcd920a7..9a672d9c0 100644 --- a/Tests/XcodeProjTests/Objects/Project/PBXProjIntegrationTests.swift +++ b/Tests/XcodeProjTests/Objects/Project/PBXProjIntegrationTests.swift @@ -3,8 +3,6 @@ import PathKit import XCTest @testable import XcodeProj -import Darwin - final class PBXProjIntegrationTests: XCTestCase { func test_init_initializesTheProjCorrectly() { let data = try! Data(contentsOf: fixturePath().url) @@ -40,7 +38,10 @@ final class PBXProjIntegrationTests: XCTestCase { // Create a commit try checkedOutput("git", ["init"]) try checkedOutput("git", ["add", "."]) - try checkedOutput("git", ["commit", "-m", "test"]) + try checkedOutput("git", [ + "-c", "user.email=test@example.com", "-c", "user.name=Test User", + "commit", "-m", "test" + ]) // Read/write the project let project = try XcodeProj(path: xcodeprojPath) From 6b1228ba2331761f53e81d8ead135b0e3a6c3a56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20Pi=C3=B1era?= Date: Wed, 11 Nov 2020 10:13:16 +0100 Subject: [PATCH 106/678] Version 7.18.0 --- CHANGELOG.md | 6 ++++-- Cartfile | 3 +-- Cartfile.resolved | 3 +-- Package.resolved | 4 ++-- Package.swift | 2 +- README.md | 8 ++++++-- TuistConfig.swift => Tuist/Config.swift | 0 XcodeProj_Carthage.xcodeproj/project.pbxproj | 4 ++-- .../xcshareddata/xcschemes/XcodeProj.xcscheme | 2 +- xcodeproj.podspec | 5 ++--- 10 files changed, 20 insertions(+), 17 deletions(-) rename TuistConfig.swift => Tuist/Config.swift (100%) diff --git a/CHANGELOG.md b/CHANGELOG.md index 290916501..62205688f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,11 +2,13 @@ ## Next +## 7.18.0 - Penguin + ### Added - Support for building and running on Linux. [#585](https://github.com/tuist/XcodeProj/pull/585) by [@elliottwilliams](https://github.com/elliottwilliams). - - Tested for compatibility with Swift 5.3 on Ubuntu 18.04. - - XcodeProj requires FoundationXML / libxml2, which is part of the standard Swift Linux toolchain but not necessarily available in all environments. +- Tested for compatibility with Swift 5.3 on Ubuntu 18.04. +- XcodeProj requires FoundationXML / libxml2, which is part of the standard Swift Linux toolchain but not necessarily available in all environments. ## 7.17.0 - Tempelhof diff --git a/Cartfile b/Cartfile index ce4389d27..dfc7532ed 100644 --- a/Cartfile +++ b/Cartfile @@ -1,3 +1,2 @@ github "tuist/PathKit" == 1.0.0 -github "tadija/AEXML" == 4.4.0 -github "tuist/XcodeProjCExt" == 0.1.0 +github "tadija/AEXML" == 4.6.0 diff --git a/Cartfile.resolved b/Cartfile.resolved index 1972b644f..e53ee3616 100644 --- a/Cartfile.resolved +++ b/Cartfile.resolved @@ -1,3 +1,2 @@ -github "tadija/AEXML" "4.4.0" +github "tadija/AEXML" "4.6.0" github "tuist/PathKit" "1.0.0" -github "tuist/XcodeProjCExt" "0.1.0" diff --git a/Package.resolved b/Package.resolved index cd537a787..9b55b3616 100644 --- a/Package.resolved +++ b/Package.resolved @@ -6,8 +6,8 @@ "repositoryURL": "https://github.com/tadija/AEXML", "state": { "branch": null, - "revision": "8623e73b193386909566a9ca20203e33a09af142", - "version": "4.5.0" + "revision": "502c4d43a6cc9c395d19111e09dc62ad834977b5", + "version": "4.6.0" } }, { diff --git a/Package.swift b/Package.swift index 95e46cdf7..0d7d1b0f7 100644 --- a/Package.swift +++ b/Package.swift @@ -8,7 +8,7 @@ let package = Package( .library(name: "XcodeProj", targets: ["XcodeProj"]), ], dependencies: [ - .package(url: "https://github.com/tadija/AEXML", .upToNextMinor(from: "4.5.0")), + .package(url: "https://github.com/tadija/AEXML", .upToNextMinor(from: "4.6.0")), .package(url: "https://github.com/kylef/PathKit", .upToNextMinor(from: "1.0.0")), ], targets: [ diff --git a/README.md b/README.md index 78e5eb9f8..71100a261 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,9 @@ # XcodeProj + + [![All Contributors](https://img.shields.io/badge/all_contributors-7-orange.svg?style=flat-square)](#contributors-) + [![Swift Package Manager](https://img.shields.io/badge/swift%20package%20manager-compatible-brightgreen.svg)](https://swift.org/package-manager/) @@ -40,7 +43,7 @@ Add the dependency in your `Package.swift` file: let package = Package( name: "myproject", dependencies: [ - .package(url: "https://github.com/tuist/xcodeproj.git", .upToNextMajor(from: "7.17.0")) + .package(url: "https://github.com/tuist/xcodeproj.git", .upToNextMajor(from: "7.18.0")) ], targets: [ .target( @@ -62,7 +65,7 @@ github "tuist/xcodeproj" ~> 7.11. ### CocoaPods ```ruby -pod 'xcodeproj', '~> 7.17.0 +pod 'xcodeproj', '~> 7.18.0 ``` ### Scripting @@ -158,6 +161,7 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d + This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome! diff --git a/TuistConfig.swift b/Tuist/Config.swift similarity index 100% rename from TuistConfig.swift rename to Tuist/Config.swift diff --git a/XcodeProj_Carthage.xcodeproj/project.pbxproj b/XcodeProj_Carthage.xcodeproj/project.pbxproj index 5f0119e58..684580c81 100644 --- a/XcodeProj_Carthage.xcodeproj/project.pbxproj +++ b/XcodeProj_Carthage.xcodeproj/project.pbxproj @@ -734,7 +734,7 @@ SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; SWIFT_COMPILATION_MODE = singlefile; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 5.2.4; + SWIFT_VERSION = 5.3; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; }; @@ -875,7 +875,7 @@ SUPPORTED_PLATFORMS = macosx; SWIFT_COMPILATION_MODE = wholemodule; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; - SWIFT_VERSION = 5.2.4; + SWIFT_VERSION = 5.3; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; }; diff --git a/XcodeProj_Carthage.xcodeproj/xcshareddata/xcschemes/XcodeProj.xcscheme b/XcodeProj_Carthage.xcodeproj/xcshareddata/xcschemes/XcodeProj.xcscheme index ddccf1af4..906385865 100644 --- a/XcodeProj_Carthage.xcodeproj/xcshareddata/xcschemes/XcodeProj.xcscheme +++ b/XcodeProj_Carthage.xcodeproj/xcshareddata/xcschemes/XcodeProj.xcscheme @@ -58,7 +58,7 @@ diff --git a/xcodeproj.podspec b/xcodeproj.podspec index 86d84ec18..320874d42 100644 --- a/xcodeproj.podspec +++ b/xcodeproj.podspec @@ -1,7 +1,7 @@ Pod::Spec.new do |s| s.name = "xcodeproj" - s.version = "7.17.0" + s.version = "7.18.0" s.summary = "Read/Modify/Write your Xcode projects" s.homepage = "https://github.com/tuist/xcodeproj" s.license = 'MIT' @@ -15,7 +15,6 @@ Pod::Spec.new do |s| s.module_name = 'XcodeProj' - s.dependency "XcodeProjCExt", "0.1.0" s.dependency "PathKit", "~> 1.0.0" - s.dependency "AEXML", "~> 4.4.0" + s.dependency "AEXML", "~> 4.6.0" end From 82bf5efcaa27e94ed8c761c1eb3e397b6dea82b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20Pi=C3=B1era?= Date: Wed, 11 Nov 2020 10:20:46 +0100 Subject: [PATCH 107/678] Revert Package.swift update --- Package.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Package.swift b/Package.swift index 0d7d1b0f7..95e46cdf7 100644 --- a/Package.swift +++ b/Package.swift @@ -8,7 +8,7 @@ let package = Package( .library(name: "XcodeProj", targets: ["XcodeProj"]), ], dependencies: [ - .package(url: "https://github.com/tadija/AEXML", .upToNextMinor(from: "4.6.0")), + .package(url: "https://github.com/tadija/AEXML", .upToNextMinor(from: "4.5.0")), .package(url: "https://github.com/kylef/PathKit", .upToNextMinor(from: "1.0.0")), ], targets: [ From c686cdc8f6ce31e3a47734688b3cb86160ddd2b0 Mon Sep 17 00:00:00 2001 From: Tim Wong Date: Thu, 26 Nov 2020 06:21:04 -0800 Subject: [PATCH 108/678] [Fix] JSON decoder not properly decoding `defaultConfigurationIsVisible` in some projects (#593) * test * one more test * fix * Fix tests * reset resolved Co-authored-by: Tim Wong --- .../Extensions/KeyedDecodingContainer+Additions.swift | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Sources/XcodeProj/Extensions/KeyedDecodingContainer+Additions.swift b/Sources/XcodeProj/Extensions/KeyedDecodingContainer+Additions.swift index 4ea384847..02845b25a 100644 --- a/Sources/XcodeProj/Extensions/KeyedDecodingContainer+Additions.swift +++ b/Sources/XcodeProj/Extensions/KeyedDecodingContainer+Additions.swift @@ -10,10 +10,15 @@ extension KeyedDecodingContainer { } func decodeIntIfPresent(_ key: KeyedDecodingContainer.Key) throws -> UInt? { - guard let string: String = try decodeIfPresent(key) else { + if let string: String = try? decodeIfPresent(key) { + return UInt(string) + } else if let bool: Bool = try decodeIfPresent(key) { + // don't `try?` here in case key _does_ exist but isn't an expected type + // ie. not a string/bool + return bool ? 0 : 1 + } else { return nil } - return UInt(string) } func decodeIntBool(_ key: KeyedDecodingContainer.Key) throws -> Bool { From a8cef4417ef3a23e54fb2ffe3bab6ca7f72266ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20Pi=C3=B1era?= Date: Thu, 26 Nov 2020 15:22:33 +0100 Subject: [PATCH 109/678] Updated CHANGELOG --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 62205688f..c3bae40f1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ ## Next +### Fixed + +- JSON decoder not properly decoding `defaultConfigurationIsVisible` in some projects [#593](https://github.com/tuist/XcodeProj/pull/593) by [@tjwio](https://github.com/tjwio) + ## 7.18.0 - Penguin ### Added From a4e4a1484b20f1a24f303cfd5caf96df01fd5613 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 16 Dec 2020 13:16:51 +0100 Subject: [PATCH 110/678] Bump redcarpet from 3.5.0 to 3.5.1 (#599) Bumps [redcarpet](https://github.com/vmg/redcarpet) from 3.5.0 to 3.5.1. - [Release notes](https://github.com/vmg/redcarpet/releases) - [Changelog](https://github.com/vmg/redcarpet/blob/master/CHANGELOG.md) - [Commits](https://github.com/vmg/redcarpet/compare/v3.5.0...v3.5.1) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Gemfile | 2 +- Gemfile.lock | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Gemfile b/Gemfile index c8fc061e0..a7bf3f82c 100644 --- a/Gemfile +++ b/Gemfile @@ -4,4 +4,4 @@ gem "rake" gem "jazzy" gem "cocoapods", "1.10.0" gem "colorize", "~> 0.8.1" -gem "redcarpet", "~> 3.5.0" +gem "redcarpet", "~> 3.5.1" diff --git a/Gemfile.lock b/Gemfile.lock index d0aa7a912..0d895b414 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -84,7 +84,7 @@ GEM open4 (1.3.4) public_suffix (4.0.6) rake (13.0.1) - redcarpet (3.5.0) + redcarpet (3.5.1) rouge (3.24.0) ruby-macho (1.4.0) sassc (2.4.0) @@ -112,7 +112,7 @@ DEPENDENCIES colorize (~> 0.8.1) jazzy rake - redcarpet (~> 3.5.0) + redcarpet (~> 3.5.1) BUNDLED WITH 2.0.2 From 69ec1a2946941da21912355fc43dcc8032d00a37 Mon Sep 17 00:00:00 2001 From: Tim Wong Date: Wed, 16 Dec 2020 22:59:32 -0800 Subject: [PATCH 111/678] [#596][#597] Fix `decodeIntIfPresent` and related tests (#598) * fix int bug and tests * fix comment * changelog Co-authored-by: Tim Wong --- CHANGELOG.md | 2 ++ .../KeyedDecodingContainer+Additions.swift | 17 +++++++++++----- .../PBXCopyFilesBuildPhaseTests.swift | 20 +++++++++---------- .../PBXFrameworksBuildPhaseTests.swift | 4 ++-- .../PBXHeadersBuildPhaseTests.swift | 12 +++++------ 5 files changed, 32 insertions(+), 23 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c3bae40f1..c2ea80fa3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,8 @@ ### Fixed - JSON decoder not properly decoding `defaultConfigurationIsVisible` in some projects [#593](https://github.com/tuist/XcodeProj/pull/593) by [@tjwio](https://github.com/tjwio) +- JSON decoder not properly decoding `proxyType` in some projects [#596](https://github.com/tuist/XcodeProj/issues/596) by [@tjwio](https://github.com/tjwio) +- BuildPhaseTests not handling failure cases properly [#597](https://github.com/tuist/XcodeProj/issues/597) by [@tjwio](https://github.com/tjwio) ## 7.18.0 - Penguin diff --git a/Sources/XcodeProj/Extensions/KeyedDecodingContainer+Additions.swift b/Sources/XcodeProj/Extensions/KeyedDecodingContainer+Additions.swift index 02845b25a..eadc1c410 100644 --- a/Sources/XcodeProj/Extensions/KeyedDecodingContainer+Additions.swift +++ b/Sources/XcodeProj/Extensions/KeyedDecodingContainer+Additions.swift @@ -12,26 +12,33 @@ extension KeyedDecodingContainer { func decodeIntIfPresent(_ key: KeyedDecodingContainer.Key) throws -> UInt? { if let string: String = try? decodeIfPresent(key) { return UInt(string) - } else if let bool: Bool = try decodeIfPresent(key) { - // don't `try?` here in case key _does_ exist but isn't an expected type - // ie. not a string/bool + } else if let bool: Bool = try? decodeIfPresent(key) { return bool ? 0 : 1 + } else if let int: UInt = try decodeIfPresent(key) { + // don't `try?` here in case key _does_ exist but isn't an expected type + // ie. not a string/bool/int + return int } else { return nil } } func decodeIntBool(_ key: KeyedDecodingContainer.Key) throws -> Bool { - guard let int = try decodeIntIfPresent(key) else { + guard let bool = try decodeIntBoolIfPresent(key) else { return false } - return int == 1 + return bool } func decodeIntBoolIfPresent(_ key: KeyedDecodingContainer.Key) throws -> Bool? { guard let int = try decodeIntIfPresent(key) else { return nil } + + guard int <= 2 else { + throw DecodingError.dataCorruptedError(forKey: key, in: self, debugDescription: "Expected to decode Bool but found a number that is not 0 or 1") + } + return int == 1 } } diff --git a/Tests/XcodeProjTests/Objects/BuildPhase/PBXCopyFilesBuildPhaseTests.swift b/Tests/XcodeProjTests/Objects/BuildPhase/PBXCopyFilesBuildPhaseTests.swift index 377a09568..9d1d6c506 100644 --- a/Tests/XcodeProjTests/Objects/BuildPhase/PBXCopyFilesBuildPhaseTests.swift +++ b/Tests/XcodeProjTests/Objects/BuildPhase/PBXCopyFilesBuildPhaseTests.swift @@ -49,8 +49,8 @@ final class PBXCopyFilesBuildPhaseTests: XCTestCase { let data = try! JSONSerialization.data(withJSONObject: dictionary, options: []) let decoder = XcodeprojJSONDecoder() do { - _ = try decoder.decode(PBXCopyFilesBuildPhase.self, from: data) - XCTAssertTrue(false, "Expected to throw an error but it didn't") + let phase = try decoder.decode(PBXCopyFilesBuildPhase.self, from: data) + XCTAssertNil(phase.dstPath, "Expected dstPath to be nil but it's present") } catch {} } @@ -60,8 +60,8 @@ final class PBXCopyFilesBuildPhaseTests: XCTestCase { let data = try! JSONSerialization.data(withJSONObject: dictionary, options: []) let decoder = XcodeprojJSONDecoder() do { - _ = try decoder.decode(PBXCopyFilesBuildPhase.self, from: data) - XCTAssertTrue(false, "Expected to throw an error but it didn't") + let phase = try decoder.decode(PBXCopyFilesBuildPhase.self, from: data) + XCTAssertEqual(phase.buildActionMask, PBXBuildPhase.defaultBuildActionMask, "Expected buildActionMask to be equal to \(PBXBuildPhase.defaultBuildActionMask) but it's \(phase.buildActionMask)") } catch {} } @@ -71,8 +71,8 @@ final class PBXCopyFilesBuildPhaseTests: XCTestCase { let data = try! JSONSerialization.data(withJSONObject: dictionary, options: []) let decoder = XcodeprojJSONDecoder() do { - _ = try decoder.decode(PBXCopyFilesBuildPhase.self, from: data) - XCTAssertTrue(false, "Expected to throw an error but it didn't") + let phase = try decoder.decode(PBXCopyFilesBuildPhase.self, from: data) + XCTAssertNil(phase.dstSubfolderSpec, "Expected dstSubfolderSpec to be nil but it's present") } catch {} } @@ -82,8 +82,8 @@ final class PBXCopyFilesBuildPhaseTests: XCTestCase { let data = try! JSONSerialization.data(withJSONObject: dictionary, options: []) let decoder = XcodeprojJSONDecoder() do { - _ = try decoder.decode(PBXCopyFilesBuildPhase.self, from: data) - XCTAssertTrue(false, "Expected to throw an error but it didn't") + let phase = try decoder.decode(PBXCopyFilesBuildPhase.self, from: data) + XCTAssertNil(phase.files, "Expected files to be nil but it's present") } catch {} } @@ -93,8 +93,8 @@ final class PBXCopyFilesBuildPhaseTests: XCTestCase { let data = try! JSONSerialization.data(withJSONObject: dictionary, options: []) let decoder = XcodeprojJSONDecoder() do { - _ = try decoder.decode(PBXCopyFilesBuildPhase.self, from: data) - XCTAssertTrue(false, "Expected to throw an error but it didn't") + let phase = try decoder.decode(PBXCopyFilesBuildPhase.self, from: data) + XCTAssertFalse(phase.runOnlyForDeploymentPostprocessing, "Expected runOnlyForDeploymentPostprocessing to default to false") } catch {} } diff --git a/Tests/XcodeProjTests/Objects/BuildPhase/PBXFrameworksBuildPhaseTests.swift b/Tests/XcodeProjTests/Objects/BuildPhase/PBXFrameworksBuildPhaseTests.swift index f81d04329..362faf786 100644 --- a/Tests/XcodeProjTests/Objects/BuildPhase/PBXFrameworksBuildPhaseTests.swift +++ b/Tests/XcodeProjTests/Objects/BuildPhase/PBXFrameworksBuildPhaseTests.swift @@ -13,8 +13,8 @@ final class PBXFrameworksBuildPhaseTests: XCTestCase { let data = try! JSONSerialization.data(withJSONObject: dictionary, options: []) let decoder = XcodeprojJSONDecoder() do { - _ = try decoder.decode(PBXFrameworksBuildPhase.self, from: data) - XCTAssertTrue(false, "Expected to throw an error but it didn't") + let phase = try decoder.decode(PBXCopyFilesBuildPhase.self, from: data) + XCTAssertNil(phase.files, "Expected files to be nil but it's present") } catch {} } diff --git a/Tests/XcodeProjTests/Objects/BuildPhase/PBXHeadersBuildPhaseTests.swift b/Tests/XcodeProjTests/Objects/BuildPhase/PBXHeadersBuildPhaseTests.swift index 70aad7dc8..1b6cc38fe 100644 --- a/Tests/XcodeProjTests/Objects/BuildPhase/PBXHeadersBuildPhaseTests.swift +++ b/Tests/XcodeProjTests/Objects/BuildPhase/PBXHeadersBuildPhaseTests.swift @@ -13,8 +13,8 @@ final class PBXHeadersBuildPhaseTests: XCTestCase { let data = try! JSONSerialization.data(withJSONObject: dictionary, options: []) let decoder = XcodeprojJSONDecoder() do { - _ = try decoder.decode(PBXHeadersBuildPhase.self, from: data) - XCTAssertTrue(false, "Expected to throw an error but it didn't") + let phase = try decoder.decode(PBXCopyFilesBuildPhase.self, from: data) + XCTAssertEqual(phase.buildActionMask, PBXBuildPhase.defaultBuildActionMask, "Expected buildActionMask to be equal to \(PBXBuildPhase.defaultBuildActionMask) but it's \(phase.buildActionMask)") } catch {} } @@ -24,8 +24,8 @@ final class PBXHeadersBuildPhaseTests: XCTestCase { let data = try! JSONSerialization.data(withJSONObject: dictionary, options: []) let decoder = XcodeprojJSONDecoder() do { - _ = try decoder.decode(PBXHeadersBuildPhase.self, from: data) - XCTAssertTrue(false, "Expected to throw an error but it didn't") + let phase = try decoder.decode(PBXCopyFilesBuildPhase.self, from: data) + XCTAssertNil(phase.files, "Expected files to be nil but it's present") } catch {} } @@ -35,8 +35,8 @@ final class PBXHeadersBuildPhaseTests: XCTestCase { let data = try! JSONSerialization.data(withJSONObject: dictionary, options: []) let decoder = XcodeprojJSONDecoder() do { - _ = try decoder.decode(PBXHeadersBuildPhase.self, from: data) - XCTAssertTrue(false, "Expected to throw an error but it didn't") + let phase = try decoder.decode(PBXCopyFilesBuildPhase.self, from: data) + XCTAssertFalse(phase.runOnlyForDeploymentPostprocessing, "Expected runOnlyForDeploymentPostprocessing to default to false") } catch {} } From 9dfd1fd12abbd4d62a754e09840248be2784330b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 21 Dec 2020 13:44:01 +0100 Subject: [PATCH 112/678] Bump rake from 13.0.1 to 13.0.3 (#600) Bumps [rake](https://github.com/ruby/rake) from 13.0.1 to 13.0.3. - [Release notes](https://github.com/ruby/rake/releases) - [Changelog](https://github.com/ruby/rake/blob/master/History.rdoc) - [Commits](https://github.com/ruby/rake/compare/v13.0.1...v13.0.3) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 0d895b414..5de5c72c9 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -83,7 +83,7 @@ GEM netrc (0.11.0) open4 (1.3.4) public_suffix (4.0.6) - rake (13.0.1) + rake (13.0.3) redcarpet (3.5.1) rouge (3.24.0) ruby-macho (1.4.0) From 4b14bb161a9a523cb03fee540c2c7b8cfa02609f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 11 Jan 2021 22:34:32 +0100 Subject: [PATCH 113/678] Bump cocoapods from 1.10.0 to 1.10.1 (#601) Bumps [cocoapods](https://github.com/CocoaPods/CocoaPods) from 1.10.0 to 1.10.1. - [Release notes](https://github.com/CocoaPods/CocoaPods/releases) - [Changelog](https://github.com/CocoaPods/CocoaPods/blob/master/CHANGELOG.md) - [Commits](https://github.com/CocoaPods/CocoaPods/compare/1.10.0...1.10.1) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Gemfile | 2 +- Gemfile.lock | 20 ++++++++++---------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/Gemfile b/Gemfile index a7bf3f82c..225c83192 100644 --- a/Gemfile +++ b/Gemfile @@ -2,6 +2,6 @@ source "https://rubygems.org" gem "rake" gem "jazzy" -gem "cocoapods", "1.10.0" +gem "cocoapods", "1.10.1" gem "colorize", "~> 0.8.1" gem "redcarpet", "~> 3.5.1" diff --git a/Gemfile.lock b/Gemfile.lock index 5de5c72c9..c62584803 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ GEM remote: https://rubygems.org/ specs: - CFPropertyList (3.0.2) + CFPropertyList (3.0.3) activesupport (5.2.4.4) concurrent-ruby (~> 1.0, >= 1.0.2) i18n (>= 0.7, < 2) @@ -14,10 +14,10 @@ GEM json (>= 1.5.1) atomos (0.1.3) claide (1.0.3) - cocoapods (1.10.0) + cocoapods (1.10.1) addressable (~> 2.6) claide (>= 1.0.2, < 2.0) - cocoapods-core (= 1.10.0) + cocoapods-core (= 1.10.1) cocoapods-deintegrate (>= 1.0.3, < 2.0) cocoapods-downloader (>= 1.4.0, < 2.0) cocoapods-plugins (>= 1.0.0, < 2.0) @@ -32,7 +32,7 @@ GEM nap (~> 1.0) ruby-macho (~> 1.4) xcodeproj (>= 1.19.0, < 2.0) - cocoapods-core (1.10.0) + cocoapods-core (1.10.1) activesupport (> 5.0, < 6) addressable (~> 2.6) algoliasearch (~> 1.0) @@ -57,12 +57,12 @@ GEM escape (0.0.4) ethon (0.12.0) ffi (>= 1.3.0) - ffi (1.13.1) + ffi (1.14.2) fourflusher (2.3.1) fuzzy_match (2.0.4) gh_inspector (1.1.3) httpclient (2.8.3) - i18n (1.8.5) + i18n (1.8.7) concurrent-ruby (~> 1.0) jazzy (0.13.6) cocoapods (~> 1.5) @@ -73,9 +73,9 @@ GEM sassc (~> 2.1) sqlite3 (~> 1.3) xcinvoke (~> 0.3.0) - json (2.3.1) + json (2.5.1) liferaft (0.0.6) - minitest (5.14.2) + minitest (5.14.3) molinillo (0.6.6) mustache (1.1.1) nanaimo (0.3.0) @@ -93,7 +93,7 @@ GEM thread_safe (0.3.6) typhoeus (1.4.0) ethon (>= 0.9.0) - tzinfo (1.2.8) + tzinfo (1.2.9) thread_safe (~> 0.1) xcinvoke (0.3.0) liferaft (~> 0.0.6) @@ -108,7 +108,7 @@ PLATFORMS ruby DEPENDENCIES - cocoapods (= 1.10.0) + cocoapods (= 1.10.1) colorize (~> 0.8.1) jazzy rake From f0b1d1bf76a50b57e95265d1d72029705da5ed47 Mon Sep 17 00:00:00 2001 From: Artem Loenko Date: Thu, 18 Feb 2021 16:10:00 +0000 Subject: [PATCH 114/678] Add inline comments support to the `xcconfig` parser (#604) * Update xcconfig test data with comment examples * Adjust unit-tests for xcconfig * Update settingRegex regular expression with comments support * Fix comment spelling * Add an edge-case test when a comment has to space * Add CHANGELOG.md entry for the PR --- CHANGELOG.md | 1 + Fixtures/XCConfigs/Children.xcconfig | 4 ++-- Fixtures/XCConfigs/Parent.xcconfig | 5 ++++- Sources/XcodeProj/Utils/XCConfig.swift | 2 +- Tests/XcodeProjTests/Utils/XCConfigTests.swift | 2 ++ 5 files changed, 10 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c2ea80fa3..d42773498 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ - JSON decoder not properly decoding `defaultConfigurationIsVisible` in some projects [#593](https://github.com/tuist/XcodeProj/pull/593) by [@tjwio](https://github.com/tjwio) - JSON decoder not properly decoding `proxyType` in some projects [#596](https://github.com/tuist/XcodeProj/issues/596) by [@tjwio](https://github.com/tjwio) - BuildPhaseTests not handling failure cases properly [#597](https://github.com/tuist/XcodeProj/issues/597) by [@tjwio](https://github.com/tjwio) +- `xcconfig` parser does not support inline comments [#602](https://github.com/tuist/XcodeProj/issues/602) by [@dive](https://github.com/dive) ## 7.18.0 - Penguin diff --git a/Fixtures/XCConfigs/Children.xcconfig b/Fixtures/XCConfigs/Children.xcconfig index fca8692d3..de28539ca 100644 --- a/Fixtures/XCConfigs/Children.xcconfig +++ b/Fixtures/XCConfigs/Children.xcconfig @@ -1,5 +1,5 @@ #include "Parent.xcconfig" -CONFIGURATION_BUILD_DIR = Test/ +CONFIGURATION_BUILD_DIR = Test/ // NOTE: Test comment line to check several slashes GCC_PREPROCESSOR_DEFINITIONS = $(inherited) -WARNING_CFLAGS = -Wall -Wno-direct-ivar-access -Wno-objc-missing-property-synthesis -Wno-readonly-iboutlet-property -Wno-switch-enum -Wno-padded \ No newline at end of file +WARNING_CFLAGS = -Wall -Wno-direct-ivar-access -Wno-objc-missing-property-synthesis -Wno-readonly-iboutlet-property -Wno-switch-enum -Wno-padded diff --git a/Fixtures/XCConfigs/Parent.xcconfig b/Fixtures/XCConfigs/Parent.xcconfig index d70cdb84d..796528af6 100644 --- a/Fixtures/XCConfigs/Parent.xcconfig +++ b/Fixtures/XCConfigs/Parent.xcconfig @@ -1,2 +1,5 @@ +// NOTE: Top level comment OTHER_SWIFT_FLAGS_XCODE_0821 = $(inherited) -OTHER_SWIFT_FLAGS_XCODE_0830 = $(inherited) -enable-bridging-pch \ No newline at end of file +OTHER_SWIFT_FLAGS_XCODE_0830 = $(inherited) -enable-bridging-pch +PRODUCT_NAME = $(TARGET_NAME) // NOTE: Test Comment +SWIFT_OPTIMIZATION_LEVEL = -Onone// Edge-case when a comment has no space diff --git a/Sources/XcodeProj/Utils/XCConfig.swift b/Sources/XcodeProj/Utils/XCConfig.swift index 77bdf7be9..640ad7668 100644 --- a/Sources/XcodeProj/Utils/XCConfig.swift +++ b/Sources/XcodeProj/Utils/XCConfig.swift @@ -99,7 +99,7 @@ final class XCConfigParser { // swiftlint:disable:next force_try private static var includeRegex = try! NSRegularExpression(pattern: "#include\\s+\"(.+\\.xcconfig)\"", options: .caseInsensitive) // swiftlint:disable:next force_try - private static var settingRegex = try! NSRegularExpression(pattern: "^([a-zA-Z0-9_\\[\\]=\\*~]+)\\s*=\\s*(\"?.*?\"?)\\s*(?:;\\s*)?$", options: []) + private static var settingRegex = try! NSRegularExpression(pattern: "^([a-zA-Z0-9_\\[\\]=\\*~]+)\\s*=\\s*(\"?.*?\"?)\\s*(?:;\\s*)?(?=$|\\/\\/)", options: []) } // MARK: - XCConfig Extension (Equatable) diff --git a/Tests/XcodeProjTests/Utils/XCConfigTests.swift b/Tests/XcodeProjTests/Utils/XCConfigTests.swift index 692c7d6c0..ade947b42 100644 --- a/Tests/XcodeProjTests/Utils/XCConfigTests.swift +++ b/Tests/XcodeProjTests/Utils/XCConfigTests.swift @@ -110,5 +110,7 @@ final class XCConfigIntegrationTests: XCTestCase { XCTAssertEqual(config.includes.count, 1) XCTAssertEqual(config.flattenedBuildSettings()["OTHER_SWIFT_FLAGS_XCODE_0821"] as? String, "$(inherited)") XCTAssertEqual(config.flattenedBuildSettings()["OTHER_SWIFT_FLAGS_XCODE_0830"] as? String, "$(inherited) -enable-bridging-pch") + XCTAssertEqual(config.flattenedBuildSettings()["PRODUCT_NAME"] as? String, "$(TARGET_NAME)") + XCTAssertEqual(config.flattenedBuildSettings()["SWIFT_OPTIMIZATION_LEVEL"] as? String, "-Onone") } } From c8afc799be95bbc6c329ba12d15342ffa7c4577d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20Pi=C3=B1era?= Date: Thu, 18 Feb 2021 17:18:26 +0100 Subject: [PATCH 115/678] Version 7.19.0 --- CHANGELOG.md | 2 ++ README.md | 4 ++-- XcodeProj_Carthage.xcodeproj/project.pbxproj | 5 +++-- .../xcshareddata/xcschemes/XcodeProj.xcscheme | 10 +-------- xcodeproj.podspec | 21 +++++++++---------- 5 files changed, 18 insertions(+), 24 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d42773498..c8014fe70 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ ## Next +## 7.19.0 - Kreuzberg + ### Fixed - JSON decoder not properly decoding `defaultConfigurationIsVisible` in some projects [#593](https://github.com/tuist/XcodeProj/pull/593) by [@tjwio](https://github.com/tjwio) diff --git a/README.md b/README.md index 71100a261..1db39bfd0 100644 --- a/README.md +++ b/README.md @@ -43,7 +43,7 @@ Add the dependency in your `Package.swift` file: let package = Package( name: "myproject", dependencies: [ - .package(url: "https://github.com/tuist/xcodeproj.git", .upToNextMajor(from: "7.18.0")) + .package(url: "https://github.com/tuist/xcodeproj.git", .upToNextMajor(from: "7.19.0")) ], targets: [ .target( @@ -65,7 +65,7 @@ github "tuist/xcodeproj" ~> 7.11. ### CocoaPods ```ruby -pod 'xcodeproj', '~> 7.18.0 +pod 'xcodeproj', '~> 7.19.0 ``` ### Scripting diff --git a/XcodeProj_Carthage.xcodeproj/project.pbxproj b/XcodeProj_Carthage.xcodeproj/project.pbxproj index 684580c81..614b06b15 100644 --- a/XcodeProj_Carthage.xcodeproj/project.pbxproj +++ b/XcodeProj_Carthage.xcodeproj/project.pbxproj @@ -110,6 +110,7 @@ 7FAD067EE084B2EF5EFE4BFF /* Embed Frameworks */ = { isa = PBXCopyFilesBuildPhase; buildActionMask = 2147483647; + dstPath = ""; dstSubfolderSpec = 10; files = ( ); @@ -734,7 +735,7 @@ SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; SWIFT_COMPILATION_MODE = singlefile; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 5.3; + SWIFT_VERSION = 5.3.2; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; }; @@ -875,7 +876,7 @@ SUPPORTED_PLATFORMS = macosx; SWIFT_COMPILATION_MODE = wholemodule; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; - SWIFT_VERSION = 5.3; + SWIFT_VERSION = 5.3.2; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; }; diff --git a/XcodeProj_Carthage.xcodeproj/xcshareddata/xcschemes/XcodeProj.xcscheme b/XcodeProj_Carthage.xcodeproj/xcshareddata/xcschemes/XcodeProj.xcscheme index 906385865..bfc23e82f 100644 --- a/XcodeProj_Carthage.xcodeproj/xcshareddata/xcschemes/XcodeProj.xcscheme +++ b/XcodeProj_Carthage.xcodeproj/xcshareddata/xcschemes/XcodeProj.xcscheme @@ -51,21 +51,13 @@ ReferencedContainer = "container:XcodeProj_Carthage.xcodeproj"> - - - - - - - - "https://github.com/tuist/xcodeproj.git", :tag => s.version.to_s } + s.source = { git: 'https://github.com/tuist/xcodeproj.git', tag: s.version.to_s } s.requires_arc = true - s.authors = "Tuist" - s.swift_version = "5.1" + s.authors = 'Tuist' + s.swift_version = '5.1' s.osx.deployment_target = '10.10' - s.source_files = "Sources/**/*.{swift}" + s.source_files = 'Sources/**/*.{swift}' s.module_name = 'XcodeProj' - s.dependency "PathKit", "~> 1.0.0" - s.dependency "AEXML", "~> 4.6.0" + s.dependency 'PathKit', '~> 1.0.0' + s.dependency 'AEXML', '~> 4.6.0' end From 4010ddaea76bc9fb9fd393f9af0435d8af233535 Mon Sep 17 00:00:00 2001 From: Franz Busch Date: Thu, 11 Mar 2021 18:42:13 +0100 Subject: [PATCH 116/678] Add runPostActionsOnFailure to scheme (#603) --- CHANGELOG.md | 1 + Sources/XcodeProj/Extensions/AEXML+XcodeFormat.swift | 1 + Sources/XcodeProj/Scheme/XCScheme+BuildAction.swift | 10 ++++++++-- .../Extensions/AEXML+XcodeFormatTests.swift | 5 ++++- Tests/XcodeProjTests/Scheme/XCSchemeTests.swift | 2 ++ 5 files changed, 16 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c8014fe70..f3303ebc9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ 🚀 Check out the guidelines [here](https://tuist.io/docs/contribution/changelog-guidelines/) ## Next +- Added `runPostActionsOnFailure` to `XCScheme` [#603](https://github.com/tuist/XcodeProj/pull/603) by [@FranzBusch](https://github.com/FranzBusch) ## 7.19.0 - Kreuzberg diff --git a/Sources/XcodeProj/Extensions/AEXML+XcodeFormat.swift b/Sources/XcodeProj/Extensions/AEXML+XcodeFormat.swift index 4e0617b46..f19dd2001 100644 --- a/Sources/XcodeProj/Extensions/AEXML+XcodeFormat.swift +++ b/Sources/XcodeProj/Extensions/AEXML+XcodeFormat.swift @@ -13,6 +13,7 @@ let attributesOrder: [String: [String]] = [ "BuildAction": [ "parallelizeBuildables", "buildImplicitDependencies", + "runPostActionsOnFailure", ], "BuildActionEntry": [ "buildForTesting", diff --git a/Sources/XcodeProj/Scheme/XCScheme+BuildAction.swift b/Sources/XcodeProj/Scheme/XCScheme+BuildAction.swift index 2be673ade..561f9f2a1 100644 --- a/Sources/XcodeProj/Scheme/XCScheme+BuildAction.swift +++ b/Sources/XcodeProj/Scheme/XCScheme+BuildAction.swift @@ -75,6 +75,7 @@ extension XCScheme { public var buildActionEntries: [Entry] public var parallelizeBuild: Bool public var buildImplicitDependencies: Bool + public var runPostActionsOnFailure: Bool // MARK: - Init @@ -82,16 +83,19 @@ extension XCScheme { preActions: [ExecutionAction] = [], postActions: [ExecutionAction] = [], parallelizeBuild: Bool = false, - buildImplicitDependencies: Bool = false) { + buildImplicitDependencies: Bool = false, + runPostActionsOnFailure: Bool = false) { self.buildActionEntries = buildActionEntries self.parallelizeBuild = parallelizeBuild self.buildImplicitDependencies = buildImplicitDependencies + self.runPostActionsOnFailure = runPostActionsOnFailure super.init(preActions, postActions) } override init(element: AEXMLElement) throws { parallelizeBuild = element.attributes["parallelizeBuildables"].map { $0 == "YES" } ?? true buildImplicitDependencies = element.attributes["buildImplicitDependencies"].map { $0 == "YES" } ?? true + runPostActionsOnFailure = element.attributes["runPostActionsOnFailure"].map { $0 == "YES" } ?? false buildActionEntries = try element["BuildActionEntries"]["BuildActionEntry"] .all? .map(Entry.init) ?? [] @@ -115,6 +119,7 @@ extension XCScheme { attributes: [ "parallelizeBuildables": parallelizeBuild.xmlString, "buildImplicitDependencies": buildImplicitDependencies.xmlString, + "runPostActionsOnFailure": runPostActionsOnFailure.xmlString, ]) super.writeXML(parent: element) let entries = element.addChild(name: "BuildActionEntries") @@ -131,7 +136,8 @@ extension XCScheme { return super.isEqual(to: to) && buildActionEntries == rhs.buildActionEntries && parallelizeBuild == rhs.parallelizeBuild && - buildImplicitDependencies == rhs.buildImplicitDependencies + buildImplicitDependencies == rhs.buildImplicitDependencies && + runPostActionsOnFailure == rhs.runPostActionsOnFailure } } } diff --git a/Tests/XcodeProjTests/Extensions/AEXML+XcodeFormatTests.swift b/Tests/XcodeProjTests/Extensions/AEXML+XcodeFormatTests.swift index f384be869..529a82c31 100644 --- a/Tests/XcodeProjTests/Extensions/AEXML+XcodeFormatTests.swift +++ b/Tests/XcodeProjTests/Extensions/AEXML+XcodeFormatTests.swift @@ -15,13 +15,15 @@ class AEXML_XcodeFormatTests: XCTestCase { + buildImplicitDependencies = "NO" + runPostActionsOnFailure = "YES"> """ func test_BuildAction_attributes_sorted_when_original_sorted() { validateAttributes(attributes: [ "parallelizeBuildables": "YES", + "runPostActionsOnFailure": "YES", "buildImplicitDependencies": "NO", ]) } @@ -30,6 +32,7 @@ class AEXML_XcodeFormatTests: XCTestCase { validateAttributes(attributes: [ "buildImplicitDependencies": "NO", "parallelizeBuildables": "YES", + "runPostActionsOnFailure": "YES", ]) } diff --git a/Tests/XcodeProjTests/Scheme/XCSchemeTests.swift b/Tests/XcodeProjTests/Scheme/XCSchemeTests.swift index 7447f4cd4..0041486ea 100644 --- a/Tests/XcodeProjTests/Scheme/XCSchemeTests.swift +++ b/Tests/XcodeProjTests/Scheme/XCSchemeTests.swift @@ -253,6 +253,7 @@ final class XCSchemeIntegrationTests: XCTestCase { // Build action XCTAssertTrue(scheme.buildAction?.parallelizeBuild == true) XCTAssertTrue(scheme.buildAction?.buildImplicitDependencies == true) + XCTAssertTrue(scheme.buildAction?.runPostActionsOnFailure == false) XCTAssertTrue(scheme.buildAction?.buildActionEntries.first?.buildFor.contains(.testing) == true) XCTAssertTrue(scheme.buildAction?.buildActionEntries.first?.buildFor.contains(.running) == true) XCTAssertTrue(scheme.buildAction?.buildActionEntries.first?.buildFor.contains(.profiling) == true) @@ -419,6 +420,7 @@ final class XCSchemeIntegrationTests: XCTestCase { // Build action XCTAssertTrue(scheme.buildAction?.parallelizeBuild == true) XCTAssertTrue(scheme.buildAction?.buildImplicitDependencies == true) + XCTAssertTrue(scheme.buildAction?.runPostActionsOnFailure == false) XCTAssertTrue(scheme.buildAction?.buildActionEntries.first?.buildFor.contains(.testing) == true) XCTAssertTrue(scheme.buildAction?.buildActionEntries.first?.buildFor.contains(.running) == false) XCTAssertTrue(scheme.buildAction?.buildActionEntries.first?.buildFor.contains(.profiling) == true) From 6943d5c5f9085d070dbde3c669144e30d41ec635 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20Pi=C3=B1era?= Date: Wed, 31 Mar 2021 12:28:26 +0200 Subject: [PATCH 117/678] Version 7.20.0 --- CHANGELOG.md | 3 +++ README.md | 4 ++-- .../xcshareddata/xcschemes/XcodeProj.xcscheme | 6 ++---- .../xcschemes/XcodeProj_Carthage-Project.xcscheme | 3 +-- xcodeproj.podspec | 2 +- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f3303ebc9..fe6a5dce9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,9 @@ 🚀 Check out the guidelines [here](https://tuist.io/docs/contribution/changelog-guidelines/) +## 7.20.0 - Sol + ## Next + - Added `runPostActionsOnFailure` to `XCScheme` [#603](https://github.com/tuist/XcodeProj/pull/603) by [@FranzBusch](https://github.com/FranzBusch) ## 7.19.0 - Kreuzberg diff --git a/README.md b/README.md index 1db39bfd0..5a4d582f8 100644 --- a/README.md +++ b/README.md @@ -43,7 +43,7 @@ Add the dependency in your `Package.swift` file: let package = Package( name: "myproject", dependencies: [ - .package(url: "https://github.com/tuist/xcodeproj.git", .upToNextMajor(from: "7.19.0")) + .package(url: "https://github.com/tuist/xcodeproj.git", .upToNextMajor(from: "7.20.0")) ], targets: [ .target( @@ -65,7 +65,7 @@ github "tuist/xcodeproj" ~> 7.11. ### CocoaPods ```ruby -pod 'xcodeproj', '~> 7.19.0 +pod 'xcodeproj', '~> 7.20.0 ``` ### Scripting diff --git a/XcodeProj_Carthage.xcodeproj/xcshareddata/xcschemes/XcodeProj.xcscheme b/XcodeProj_Carthage.xcodeproj/xcshareddata/xcschemes/XcodeProj.xcscheme index bfc23e82f..066eafdeb 100644 --- a/XcodeProj_Carthage.xcodeproj/xcshareddata/xcschemes/XcodeProj.xcscheme +++ b/XcodeProj_Carthage.xcodeproj/xcshareddata/xcschemes/XcodeProj.xcscheme @@ -26,8 +26,7 @@ buildConfiguration = "Debug" selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" - shouldUseLaunchSchemeArgsEnv = "YES" - disableMainThreadChecker = "YES"> + shouldUseLaunchSchemeArgsEnv = "YES"> @@ -40,8 +39,7 @@ ignoresPersistentStateOnLaunch = "NO" debugDocumentVersioning = "YES" debugServiceExtension = "internal" - allowLocationSimulation = "YES" - disableMainThreadChecker = "YES"> + allowLocationSimulation = "YES"> + shouldUseLaunchSchemeArgsEnv = "YES"> diff --git a/xcodeproj.podspec b/xcodeproj.podspec index 994190f00..cafffa775 100644 --- a/xcodeproj.podspec +++ b/xcodeproj.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = 'xcodeproj' - s.version = '7.19.0' + s.version = '7.20.0' s.summary = 'Read/Modify/Write your Xcode projects' s.homepage = 'https://github.com/tuist/xcodeproj' s.license = 'MIT' From c5419e148cc8044983863e24447047877a1aa9c6 Mon Sep 17 00:00:00 2001 From: Alfredo Delli Bovi Date: Mon, 19 Apr 2021 18:57:08 +0200 Subject: [PATCH 118/678] Improve md5 (#606) Co-authored-by: Alfredo Delli Bovi --- Sources/XcodeProj/Extensions/String+md5.swift | 40 +++++++++++++------ 1 file changed, 28 insertions(+), 12 deletions(-) diff --git a/Sources/XcodeProj/Extensions/String+md5.swift b/Sources/XcodeProj/Extensions/String+md5.swift index 77ad4a934..5abdf59a7 100644 --- a/Sources/XcodeProj/Extensions/String+md5.swift +++ b/Sources/XcodeProj/Extensions/String+md5.swift @@ -32,12 +32,8 @@ extension String { } #if canImport(CryptoKit) if #available(OSX 10.15, *) { - var hasher = Insecure.MD5() - hasher.update(data: data) - let digest = hasher.finalize() - return digest.reduce(into: "") { hexString, byte in - hexString.append(String(format: "%02hhx", byte)) - } + return Insecure.MD5.hash(data: data) + .withUnsafeBytes { Array($0) }.hexString } else { return data.slowMD5 } @@ -47,6 +43,31 @@ extension String { } } +private let charA = UInt8(UnicodeScalar("a").value) +private let char0 = UInt8(UnicodeScalar("0").value) + +private extension DataProtocol { + var hexString: String { + let hexLen = self.count * 2 + let ptr = UnsafeMutablePointer.allocate(capacity: hexLen) + var offset = 0 + + self.regions.forEach { (_) in + for i in self { + ptr[Int(offset * 2)] = itoh((i >> 4) & 0xF) + ptr[Int(offset * 2 + 1)] = itoh(i & 0xF) + offset += 1 + } + } + + return String(bytesNoCopy: ptr, length: hexLen, encoding: .utf8, freeWhenDone: true)! + } + + func itoh(_ value: UInt8) -> UInt8 { + return (value > 9) ? (charA + value - 10) : (char0 + value) + } +} + private extension Data { // Custom md5 for systems without CryptoKit. var slowMD5: String { @@ -59,12 +80,7 @@ private extension Data { let MD5Calculator = MD5(message) let MD5Data = MD5Calculator.calculate() - - var MD5String = String() - for c in MD5Data { - MD5String += String(format: "%02x", c) - } - return MD5String + return MD5Data.hexString } } From 0c889906136b7cba277b9327e9a8217669bb4eb3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20Pi=C3=B1era?= Date: Mon, 19 Apr 2021 19:00:09 +0200 Subject: [PATCH 119/678] Version 7.21.0 --- CHANGELOG.md | 8 +++++++- README.md | 4 ++-- xcodeproj.podspec | 2 +- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fe6a5dce9..b7c64a787 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,8 +1,14 @@ 🚀 Check out the guidelines [here](https://tuist.io/docs/contribution/changelog-guidelines/) +## 7.21.0 - Alfredo + +## Changed + +- Speed up md5 generation [#606](https://github.com/tuist/XcodeProj/pull/606) by [@adellibovi](https://github.com/adellibovi) + ## 7.20.0 - Sol -## Next +## Added - Added `runPostActionsOnFailure` to `XCScheme` [#603](https://github.com/tuist/XcodeProj/pull/603) by [@FranzBusch](https://github.com/FranzBusch) diff --git a/README.md b/README.md index 5a4d582f8..d9b8ea302 100644 --- a/README.md +++ b/README.md @@ -43,7 +43,7 @@ Add the dependency in your `Package.swift` file: let package = Package( name: "myproject", dependencies: [ - .package(url: "https://github.com/tuist/xcodeproj.git", .upToNextMajor(from: "7.20.0")) + .package(url: "https://github.com/tuist/xcodeproj.git", .upToNextMajor(from: "7.21.0")) ], targets: [ .target( @@ -65,7 +65,7 @@ github "tuist/xcodeproj" ~> 7.11. ### CocoaPods ```ruby -pod 'xcodeproj', '~> 7.20.0 +pod 'xcodeproj', '~> 7.21.0 ``` ### Scripting diff --git a/xcodeproj.podspec b/xcodeproj.podspec index cafffa775..7776f0bb2 100644 --- a/xcodeproj.podspec +++ b/xcodeproj.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = 'xcodeproj' - s.version = '7.20.0' + s.version = '7.21.0' s.summary = 'Read/Modify/Write your Xcode projects' s.homepage = 'https://github.com/tuist/xcodeproj' s.license = 'MIT' From 5860027a19a46e0ac0c2e8e80b346dd34e7d47fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Fo=C5=99t?= Date: Tue, 27 Apr 2021 11:29:34 +0200 Subject: [PATCH 120/678] Add CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER (#608) * Add CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER to projectAll * Update CHANGELOG * Remove whitespace --- CHANGELOG.md | 10 ++++++++-- Sources/XcodeProj/Utils/BuildSettingsProvider.swift | 1 + 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b7c64a787..2937b3f02 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,14 +1,20 @@ 🚀 Check out the guidelines [here](https://tuist.io/docs/contribution/changelog-guidelines/) +## Next + +### Added + +- `CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER` to default build setting [#608](https://github.com/tuist/XcodeProj/pull/608) by [@fortmarek](https://github.com/fortmarek) + ## 7.21.0 - Alfredo -## Changed +### Changed - Speed up md5 generation [#606](https://github.com/tuist/XcodeProj/pull/606) by [@adellibovi](https://github.com/adellibovi) ## 7.20.0 - Sol -## Added +### Added - Added `runPostActionsOnFailure` to `XCScheme` [#603](https://github.com/tuist/XcodeProj/pull/603) by [@FranzBusch](https://github.com/FranzBusch) diff --git a/Sources/XcodeProj/Utils/BuildSettingsProvider.swift b/Sources/XcodeProj/Utils/BuildSettingsProvider.swift index f9e2ffdd7..dbb23d314 100644 --- a/Sources/XcodeProj/Utils/BuildSettingsProvider.swift +++ b/Sources/XcodeProj/Utils/BuildSettingsProvider.swift @@ -120,6 +120,7 @@ public class BuildSettingsProvider { "CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF": "YES", "CLANG_WARN_OBJC_LITERAL_CONVERSION": "YES", "CLANG_WARN_OBJC_ROOT_CLASS": "YES_ERROR", + "CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER": "YES", "CLANG_WARN_RANGE_LOOP_ANALYSIS": "YES", "CLANG_WARN_STRICT_PROTOTYPES": "YES", "CLANG_WARN_SUSPICIOUS_MOVE": "YES", From 3076b6dbda32169426dd4a6fc37a02ec870634ed Mon Sep 17 00:00:00 2001 From: Fero Date: Tue, 27 Apr 2021 12:51:40 +0200 Subject: [PATCH 121/678] =?UTF-8?q?=F0=9F=9B=91=20Prevent=20overwriting=20?= =?UTF-8?q?identical=20workspace=20data=20(#607)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 🛑 Prevent overwriting identical workspace data * 🛠 Address review comment * 🤦 Okay XCWorkspace != XCWorkspaceData * 🛠 Use data with glo path * 😎 Shift the responsibility of data equality to XCWorkspace * Update Sources/XcodeProj/Workspace/XCWorkspace.swift Co-authored-by: Marek Fořt Co-authored-by: Marek Fořt --- Sources/XcodeProj/Workspace/XCWorkspace.swift | 9 +++++++++ Sources/XcodeProj/Workspace/XCWorkspaceData.swift | 14 +++++++++----- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/Sources/XcodeProj/Workspace/XCWorkspace.swift b/Sources/XcodeProj/Workspace/XCWorkspace.swift index 55c575d3d..5732a9e7c 100644 --- a/Sources/XcodeProj/Workspace/XCWorkspace.swift +++ b/Sources/XcodeProj/Workspace/XCWorkspace.swift @@ -53,6 +53,15 @@ public final class XCWorkspace: Writable, Equatable { public func write(path: Path, override: Bool = true) throws { let dataPath = path + "contents.xcworkspacedata" if override, dataPath.exists { + if let existingContent: String = try? dataPath.read(), + existingContent == data.rawContents() { + // Raw data matches what's on disk + // there's no need to overwrite the contents + // this mitigates Xcode forcing users to + // close and re-open projects/workspaces + // on regeneration. + return + } try dataPath.delete() } try dataPath.mkpath() diff --git a/Sources/XcodeProj/Workspace/XCWorkspaceData.swift b/Sources/XcodeProj/Workspace/XCWorkspaceData.swift index 61b790ca4..2c2ff3a92 100644 --- a/Sources/XcodeProj/Workspace/XCWorkspaceData.swift +++ b/Sources/XcodeProj/Workspace/XCWorkspaceData.swift @@ -36,20 +36,24 @@ extension XCWorkspaceData: Writable { self.init(children: children) } - - // MARK: - - - public func write(path: Path, override: Bool = true) throws { + + func rawContents() -> String { let document = AEXMLDocument() let workspace = document.addChild(name: "Workspace", value: nil, attributes: ["version": "1.0"]) _ = children .map { $0.xmlElement() } .map(workspace.addChild) + return document.xmlXcodeFormat + } + // MARK: - + + public func write(path: Path, override: Bool = true) throws { + let rawXml = rawContents() if override, path.exists { try path.delete() } - try path.write(document.xmlXcodeFormat) + try path.write(rawXml) } } From 94e55232d227f9d78b811c98cb2e5d0cbd08987b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20Pi=C3=B1era?= Date: Tue, 27 Apr 2021 12:53:08 +0200 Subject: [PATCH 122/678] Version 7.22.0 --- CHANGELOG.md | 2 ++ README.md | 4 ++-- xcodeproj.podspec | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2937b3f02..e5cd3697a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ ## Next +## 7.22.0 - Ringui Dingui + ### Added - `CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER` to default build setting [#608](https://github.com/tuist/XcodeProj/pull/608) by [@fortmarek](https://github.com/fortmarek) diff --git a/README.md b/README.md index d9b8ea302..44f100d02 100644 --- a/README.md +++ b/README.md @@ -43,7 +43,7 @@ Add the dependency in your `Package.swift` file: let package = Package( name: "myproject", dependencies: [ - .package(url: "https://github.com/tuist/xcodeproj.git", .upToNextMajor(from: "7.21.0")) + .package(url: "https://github.com/tuist/xcodeproj.git", .upToNextMajor(from: "7.22.0")) ], targets: [ .target( @@ -65,7 +65,7 @@ github "tuist/xcodeproj" ~> 7.11. ### CocoaPods ```ruby -pod 'xcodeproj', '~> 7.21.0 +pod 'xcodeproj', '~> 7.22.0 ``` ### Scripting diff --git a/xcodeproj.podspec b/xcodeproj.podspec index 7776f0bb2..64c342bc2 100644 --- a/xcodeproj.podspec +++ b/xcodeproj.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = 'xcodeproj' - s.version = '7.21.0' + s.version = '7.22.0' s.summary = 'Read/Modify/Write your Xcode projects' s.homepage = 'https://github.com/tuist/xcodeproj' s.license = 'MIT' From 77b7102bfc5824ad2d114430edd4cf9a1b4a8d52 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20Pi=C3=B1era?= Date: Tue, 27 Apr 2021 13:02:37 +0200 Subject: [PATCH 123/678] Fix changelog --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index e5cd3697a..5633fdbfa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,10 @@ - `CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER` to default build setting [#608](https://github.com/tuist/XcodeProj/pull/608) by [@fortmarek](https://github.com/fortmarek) +### Fixed + +- Prevent overwriting identical workspace data [#607](https://github.com/tuist/XcodeProj/pull/607) by [@ferologics](https://github.com/ferologics) + ## 7.21.0 - Alfredo ### Changed From be702b93150292396b0d068cea2a7ffa27f8e36b Mon Sep 17 00:00:00 2001 From: "freddi(Yuki Aki)" Date: Sat, 1 May 2021 21:23:01 +0900 Subject: [PATCH 124/678] Allows passing `BuildableIdentifier` String to `BuildableReference` initializer (#605) - Added an initializer which receives buildableIdentifier as a String - This is needed when adding targets from local swift packages to a scheme --- CHANGELOG.md | 4 ++++ .../Scheme/XCScheme+BuildableReference.swift | 12 ++++++++++++ 2 files changed, 16 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5633fdbfa..6e2785f85 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ ## Next +### Added + +- Allows passing BuildableIdentifier String to BuildableReference initializer [#605](https://github.com/tuist/XcodeProj/pull/605) by [@freddi-kit](https://github.com/freddi-kit) + ## 7.22.0 - Ringui Dingui ### Added diff --git a/Sources/XcodeProj/Scheme/XCScheme+BuildableReference.swift b/Sources/XcodeProj/Scheme/XCScheme+BuildableReference.swift index ba768c034..43c8a08a6 100644 --- a/Sources/XcodeProj/Scheme/XCScheme+BuildableReference.swift +++ b/Sources/XcodeProj/Scheme/XCScheme+BuildableReference.swift @@ -46,6 +46,18 @@ extension XCScheme { self.blueprintName = blueprintName } + public init(referencedContainer: String, + blueprintIdentifier: String, + buildableName: String, + blueprintName: String, + buildableIdentifier: String = "primary") { + self.referencedContainer = referencedContainer + self.blueprint = .string(blueprintIdentifier) + self.buildableName = buildableName + self.buildableIdentifier = buildableIdentifier + self.blueprintName = blueprintName + } + // MARK: - XML init(element: AEXMLElement) throws { From fd0d3d5f82c25540aa2acddb33d7826aa4e2c791 Mon Sep 17 00:00:00 2001 From: Yonas Kolb Date: Tue, 18 May 2021 15:49:51 +1000 Subject: [PATCH 125/678] Fix Linux (#615) * remove objc * update changelog --- CHANGELOG.md | 4 ++++ Sources/XcodeProj/Scheme/XCScheme+SerialAction.swift | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6e2785f85..6a6e05253 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,10 @@ - Allows passing BuildableIdentifier String to BuildableReference initializer [#605](https://github.com/tuist/XcodeProj/pull/605) by [@freddi-kit](https://github.com/freddi-kit) +### Fixed + +- Fixed building on Linux [#615](https://github.com/tuist/XcodeProj/pull/615) by [@yonaskolb](https://github.com/yonaskolb) + ## 7.22.0 - Ringui Dingui ### Added diff --git a/Sources/XcodeProj/Scheme/XCScheme+SerialAction.swift b/Sources/XcodeProj/Scheme/XCScheme+SerialAction.swift index 0f55ce8fc..4a02b06b3 100644 --- a/Sources/XcodeProj/Scheme/XCScheme+SerialAction.swift +++ b/Sources/XcodeProj/Scheme/XCScheme+SerialAction.swift @@ -39,7 +39,7 @@ extension XCScheme { // MARK: - Equatable - @objc dynamic func isEqual(to: Any?) -> Bool { + func isEqual(to: Any?) -> Bool { guard let rhs = to as? SerialAction else { return false } return preActions == rhs.preActions && postActions == rhs.postActions From 45e349e1c4e4da1a85a7b9392b737acde2e2f2a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20Pi=C3=B1era?= Date: Tue, 18 May 2021 07:58:34 +0200 Subject: [PATCH 126/678] Version 7.23.0 --- CHANGELOG.md | 1 + Package.resolved | 4 ++-- Project.swift | 1 - README.md | 8 ++++---- XcodeProj_Carthage.xcodeproj/project.pbxproj | 10 ++++------ .../project.xcworkspace/contents.xcworkspacedata | 3 +++ .../xcshareddata/xcschemes/XcodeProj.xcscheme | 3 ++- .../xcschemes/XcodeProj_Carthage-Project.xcscheme | 3 ++- xcodeproj.podspec | 2 +- 9 files changed, 19 insertions(+), 16 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6a6e05253..c7321bd70 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ ## Next +## 7.23.0 - Bonsai ### Added - Allows passing BuildableIdentifier String to BuildableReference initializer [#605](https://github.com/tuist/XcodeProj/pull/605) by [@freddi-kit](https://github.com/freddi-kit) diff --git a/Package.resolved b/Package.resolved index 9b55b3616..cd537a787 100644 --- a/Package.resolved +++ b/Package.resolved @@ -6,8 +6,8 @@ "repositoryURL": "https://github.com/tadija/AEXML", "state": { "branch": null, - "revision": "502c4d43a6cc9c395d19111e09dc62ad834977b5", - "version": "4.6.0" + "revision": "8623e73b193386909566a9ca20203e33a09af142", + "version": "4.5.0" } }, { diff --git a/Project.swift b/Project.swift index cf19b20f0..d96f3f5ac 100644 --- a/Project.swift +++ b/Project.swift @@ -11,6 +11,5 @@ let project = Project(name: "XcodeProj_Carthage", dependencies: [ .framework(path: "Carthage/Build/Mac/AEXML.framework"), .framework(path: "Carthage/Build/Mac/PathKit.framework"), - .framework(path: "Carthage/Build/Mac/XcodeProjCExt.framework"), ]), ]) diff --git a/README.md b/README.md index 44f100d02..ba33e46d3 100644 --- a/README.md +++ b/README.md @@ -43,7 +43,7 @@ Add the dependency in your `Package.swift` file: let package = Package( name: "myproject", dependencies: [ - .package(url: "https://github.com/tuist/xcodeproj.git", .upToNextMajor(from: "7.22.0")) + .package(url: "https://github.com/tuist/xcodeproj.git", .upToNextMajor(from: "7.23.0")) ], targets: [ .target( @@ -59,13 +59,13 @@ let package = Package( ```bash # Cartfile -github "tuist/xcodeproj" ~> 7.11. +github "tuist/xcodeproj" ~> 7.23.0 ``` ### CocoaPods ```ruby -pod 'xcodeproj', '~> 7.22.0 +pod 'xcodeproj', '~> 7.23.0 ``` ### Scripting @@ -77,7 +77,7 @@ git tag that represents the project’s version: ```swift #!/usr/bin/swift sh import Foundation -import XcodeProj // @tuist ~> 7.11. +import XcodeProj // @tuist ~> 7.23.0 import PathKit guard CommandLine.arguments.count == 3 else { diff --git a/XcodeProj_Carthage.xcodeproj/project.pbxproj b/XcodeProj_Carthage.xcodeproj/project.pbxproj index 614b06b15..ea35e92d8 100644 --- a/XcodeProj_Carthage.xcodeproj/project.pbxproj +++ b/XcodeProj_Carthage.xcodeproj/project.pbxproj @@ -57,7 +57,6 @@ 80988B37A199C50A3C7A352A /* XCScheme+StoreKitConfigurationFileReference.swift in Sources */ = {isa = PBXBuildFile; fileRef = 59D8B63E53C03F46C90D951D /* XCScheme+StoreKitConfigurationFileReference.swift */; }; 809908EF4E6E71285D110707 /* PBXNativeTarget.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2BD1A6E5AC6502EDE59541C8 /* PBXNativeTarget.swift */; }; 8242B39EB786ADA4A8B32EF3 /* XCBuildConfiguration.swift in Sources */ = {isa = PBXBuildFile; fileRef = D07BF1A8B705E35271076BA1 /* XCBuildConfiguration.swift */; }; - 82FA5AD52A7F345C0E7CB14D /* XcodeProjCExt.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DC65006CBA60CAA1F78F6CED /* XcodeProjCExt.framework */; }; 84C672F79741BBA0937580EA /* Sourcery.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3A33AF969BDFF0250420A5E8 /* Sourcery.swift */; }; 8EE72814658F0A23A01AD1E6 /* XCBreakpointList.swift in Sources */ = {isa = PBXBuildFile; fileRef = CC0BF3D061052148207584A5 /* XCBreakpointList.swift */; }; 903A9EC1B895A4920A322898 /* XCScheme+ArchiveAction.swift in Sources */ = {isa = PBXBuildFile; fileRef = 66F7E3085922F586144F562A /* XCScheme+ArchiveAction.swift */; }; @@ -204,7 +203,6 @@ D07BF1A8B705E35271076BA1 /* XCBuildConfiguration.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = XCBuildConfiguration.swift; sourceTree = ""; }; D2D78F3ED94EB9E973644780 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist; path = Info.plist; sourceTree = ""; }; D4AA26E4818BC76E4CB28CEB /* PBXFileElement.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PBXFileElement.swift; sourceTree = ""; }; - DC65006CBA60CAA1F78F6CED /* XcodeProjCExt.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = XcodeProjCExt.framework; sourceTree = ""; }; DE15F98D3349F2FCED4A913A /* PBXTargetDependency.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PBXTargetDependency.swift; sourceTree = ""; }; DF277186917C67A6FF4993F6 /* XCScheme+BuildableReference.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "XCScheme+BuildableReference.swift"; sourceTree = ""; }; E06554AB0BF2937025BC45C6 /* PBXObjectReference.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PBXObjectReference.swift; sourceTree = ""; }; @@ -228,7 +226,6 @@ files = ( 1ADDD97C53AEC0990F693CDA /* AEXML.framework in Frameworks */, 5A9C450597EC43859570B863 /* PathKit.framework in Frameworks */, - 82FA5AD52A7F345C0E7CB14D /* XcodeProjCExt.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -326,7 +323,6 @@ children = ( 0C950F23FEF894B133070990 /* AEXML.framework */, F89DAD13D5505D59F10D0C9F /* PathKit.framework */, - DC65006CBA60CAA1F78F6CED /* XcodeProjCExt.framework */, ); path = Mac; sourceTree = ""; @@ -735,7 +731,7 @@ SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; SWIFT_COMPILATION_MODE = singlefile; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 5.3.2; + SWIFT_VERSION = 5.4; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; }; @@ -767,6 +763,7 @@ CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; @@ -817,6 +814,7 @@ CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; @@ -876,7 +874,7 @@ SUPPORTED_PLATFORMS = macosx; SWIFT_COMPILATION_MODE = wholemodule; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; - SWIFT_VERSION = 5.3.2; + SWIFT_VERSION = 5.4; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; }; diff --git a/XcodeProj_Carthage.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/XcodeProj_Carthage.xcodeproj/project.xcworkspace/contents.xcworkspacedata index 94b2795e2..919434a62 100644 --- a/XcodeProj_Carthage.xcodeproj/project.xcworkspace/contents.xcworkspacedata +++ b/XcodeProj_Carthage.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -1,4 +1,7 @@ + + diff --git a/XcodeProj_Carthage.xcodeproj/xcshareddata/xcschemes/XcodeProj.xcscheme b/XcodeProj_Carthage.xcodeproj/xcshareddata/xcschemes/XcodeProj.xcscheme index 066eafdeb..e9d1ffa1a 100644 --- a/XcodeProj_Carthage.xcodeproj/xcshareddata/xcschemes/XcodeProj.xcscheme +++ b/XcodeProj_Carthage.xcodeproj/xcshareddata/xcschemes/XcodeProj.xcscheme @@ -4,7 +4,8 @@ version = "1.3"> + buildImplicitDependencies = "YES" + runPostActionsOnFailure = "NO"> + buildImplicitDependencies = "YES" + runPostActionsOnFailure = "NO"> Date: Tue, 1 Jun 2021 22:18:20 +0200 Subject: [PATCH 127/678] Fix add group to have correct parent set (#614) * Fix add group to have correct parent set * Update CHANGELOG.md --- CHANGELOG.md | 4 ++++ Sources/XcodeProj/Objects/Files/PBXGroup.swift | 2 +- .../Objects/Files/PBXGroupTests.swift | 16 ++++++++++++++++ 3 files changed, 21 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c7321bd70..28e389501 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ ## Next +### Fixed + +- Adding group set incorrect parent in case of complex path [#614](https://github.com/tuist/XcodeProj/pull/614) by [@avdyushin](https://github.com/avdyushin) + ## 7.23.0 - Bonsai ### Added diff --git a/Sources/XcodeProj/Objects/Files/PBXGroup.swift b/Sources/XcodeProj/Objects/Files/PBXGroup.swift index 5387cdc3b..c2bded056 100644 --- a/Sources/XcodeProj/Objects/Files/PBXGroup.swift +++ b/Sources/XcodeProj/Objects/Files/PBXGroup.swift @@ -138,7 +138,7 @@ public extension PBXGroup { return groupName.components(separatedBy: "/").reduce(into: [PBXGroup]()) { groups, name in let group = groups.last ?? self let newGroup = PBXGroup(children: [], sourceTree: .group, name: name, path: options.contains(.withoutFolder) ? nil : name) - newGroup.parent = self + newGroup.parent = group group.childrenReferences.append(newGroup.reference) objects.add(object: newGroup) groups.append(newGroup) diff --git a/Tests/XcodeProjTests/Objects/Files/PBXGroupTests.swift b/Tests/XcodeProjTests/Objects/Files/PBXGroupTests.swift index d0e5a72b8..6fd5360d5 100644 --- a/Tests/XcodeProjTests/Objects/Files/PBXGroupTests.swift +++ b/Tests/XcodeProjTests/Objects/Files/PBXGroupTests.swift @@ -39,6 +39,22 @@ final class PBXGroupTests: XCTestCase { XCTAssertNotNil(childGroup?.parent) } + func test_addGroup_assignAllParents() { + let project = makeEmptyPBXProj() + let group = PBXGroup(children: [], + sourceTree: .group, + name: "group") + project.add(object: group) + + let expectGroups = ["foo", "bar", "baz"] + let createdGroups = try? group.addGroup(named: expectGroups.joined(separator: "/")) + + XCTAssertEqual(3, createdGroups?.count) + XCTAssertEqual(createdGroups?[0].parent?.name, "group") + XCTAssertEqual(createdGroups?[1].parent?.name, "foo") + XCTAssertEqual(createdGroups?[2].parent?.name, "bar") + } + func test_addVariantGroup() { let project = makeEmptyPBXProj() let group = PBXGroup(children: [], From 1e3cfc3e540092393ae72971def0c2a6e54e5821 Mon Sep 17 00:00:00 2001 From: Vlad Gorlov Date: Thu, 17 Jun 2021 11:27:33 +0200 Subject: [PATCH 128/678] Added new product types. (#618) * Added new product types. * [#617] Change-log update. * Added new tests to PBXProductTypeTests * [#617] Fixes copy/paste issue. --- CHANGELOG.md | 1 + Sources/XcodeProj/Objects/Targets/PBXProductType.swift | 6 ++++++ .../Objects/Targets/PBXProductTypeTests.swift | 8 ++++++++ 3 files changed, 15 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 28e389501..d24fd6653 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ ### Fixed - Adding group set incorrect parent in case of complex path [#614](https://github.com/tuist/XcodeProj/pull/614) by [@avdyushin](https://github.com/avdyushin) +- Added the `com.apple.product-type.driver-extension` and `com.apple.product-type.system-extension` PBXProductType [#618](https://github.com/tuist/XcodeProj/pull/618) by [@vgorloff](https://github.com/vgorloff). ## 7.23.0 - Bonsai ### Added diff --git a/Sources/XcodeProj/Objects/Targets/PBXProductType.swift b/Sources/XcodeProj/Objects/Targets/PBXProductType.swift index 389d0ee35..7ec12ffb1 100644 --- a/Sources/XcodeProj/Objects/Targets/PBXProductType.swift +++ b/Sources/XcodeProj/Objects/Targets/PBXProductType.swift @@ -29,6 +29,8 @@ public enum PBXProductType: String, Decodable { case intentsServiceExtension = "com.apple.product-type.app-extension.intents-service" case onDemandInstallCapableApplication = "com.apple.product-type.application.on-demand-install-capable" case metalLibrary = "com.apple.product-type.metal-library" + case driverExtension = "com.apple.product-type.driver-extension" + case systemExtension = "com.apple.product-type.system-extension" /// Returns the file extension for the given product type. public var fileExtension: String? { @@ -59,6 +61,10 @@ public enum PBXProductType: String, Decodable { return "xcframework" case .metalLibrary: return "metallib" + case .systemExtension: + return "systemextension" + case .driverExtension: + return "dext" case .none: return nil } diff --git a/Tests/XcodeProjTests/Objects/Targets/PBXProductTypeTests.swift b/Tests/XcodeProjTests/Objects/Targets/PBXProductTypeTests.swift index f783d7649..f0c62e312 100644 --- a/Tests/XcodeProjTests/Objects/Targets/PBXProductTypeTests.swift +++ b/Tests/XcodeProjTests/Objects/Targets/PBXProductTypeTests.swift @@ -94,4 +94,12 @@ final class PBXProductTypeTests: XCTestCase { func test_appClip_hasTheRightValue() { XCTAssertEqual(PBXProductType.onDemandInstallCapableApplication.rawValue, "com.apple.product-type.application.on-demand-install-capable") } + + func test_driverExtension_hasTheRightValue() { + XCTAssertEqual(PBXProductType.driverExtension.rawValue, "com.apple.product-type.driver-extension") + } + + func test_systemExtension_hasTheRightValue() { + XCTAssertEqual(PBXProductType.systemExtension.rawValue, "com.apple.product-type.system-extension") + } } From 3bfa83fc2dcd22f8c129a7e4077d0e687e2660c2 Mon Sep 17 00:00:00 2001 From: Kas Date: Thu, 17 Jun 2021 10:27:56 +0100 Subject: [PATCH 129/678] Make `runPostActionsOnFailure` optional (#619) * Make `runPostActionsOnFailure` optional Resolves: https://github.com/tuist/tuist/issues/2991 - Generated projects had `runPostActionsOnFailure` set in their schemes by default to `NO` - Xcode ends up removing this attribute when it's value is `NO` resultting in producing git diffs for any checked in projects that were previously generated - To mitigate this, the `runPostActionsOnFailure` option is being changed to an optional one where it's only written in the case it's explicitly defined to a specific value Test Plan: - Verify unit tests pass * Update change log --- CHANGELOG.md | 4 + .../Schemes/RunPostActionsOnFailure.xcscheme | 79 +++++++++++++++++++ .../Scheme/XCScheme+BuildAction.swift | 21 +++-- .../XcodeProjTests/Scheme/XCSchemeTests.swift | 31 +++++++- 4 files changed, 125 insertions(+), 10 deletions(-) create mode 100644 Fixtures/Schemes/RunPostActionsOnFailure.xcscheme diff --git a/CHANGELOG.md b/CHANGELOG.md index d24fd6653..a81de142f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ - Adding group set incorrect parent in case of complex path [#614](https://github.com/tuist/XcodeProj/pull/614) by [@avdyushin](https://github.com/avdyushin) - Added the `com.apple.product-type.driver-extension` and `com.apple.product-type.system-extension` PBXProductType [#618](https://github.com/tuist/XcodeProj/pull/618) by [@vgorloff](https://github.com/vgorloff). +### Changed + +- **Breaking** Make `runPostActionsOnFailure` optional [#619](https://github.com/tuist/XcodeProj/pull/619) by [@kwridan](https://github.com/kwridan) + ## 7.23.0 - Bonsai ### Added diff --git a/Fixtures/Schemes/RunPostActionsOnFailure.xcscheme b/Fixtures/Schemes/RunPostActionsOnFailure.xcscheme new file mode 100644 index 000000000..995928c83 --- /dev/null +++ b/Fixtures/Schemes/RunPostActionsOnFailure.xcscheme @@ -0,0 +1,79 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Sources/XcodeProj/Scheme/XCScheme+BuildAction.swift b/Sources/XcodeProj/Scheme/XCScheme+BuildAction.swift index 561f9f2a1..147d7cf1a 100644 --- a/Sources/XcodeProj/Scheme/XCScheme+BuildAction.swift +++ b/Sources/XcodeProj/Scheme/XCScheme+BuildAction.swift @@ -75,7 +75,7 @@ extension XCScheme { public var buildActionEntries: [Entry] public var parallelizeBuild: Bool public var buildImplicitDependencies: Bool - public var runPostActionsOnFailure: Bool + public var runPostActionsOnFailure: Bool? // MARK: - Init @@ -84,7 +84,7 @@ extension XCScheme { postActions: [ExecutionAction] = [], parallelizeBuild: Bool = false, buildImplicitDependencies: Bool = false, - runPostActionsOnFailure: Bool = false) { + runPostActionsOnFailure: Bool? = nil) { self.buildActionEntries = buildActionEntries self.parallelizeBuild = parallelizeBuild self.buildImplicitDependencies = buildImplicitDependencies @@ -95,7 +95,7 @@ extension XCScheme { override init(element: AEXMLElement) throws { parallelizeBuild = element.attributes["parallelizeBuildables"].map { $0 == "YES" } ?? true buildImplicitDependencies = element.attributes["buildImplicitDependencies"].map { $0 == "YES" } ?? true - runPostActionsOnFailure = element.attributes["runPostActionsOnFailure"].map { $0 == "YES" } ?? false + runPostActionsOnFailure = element.attributes["runPostActionsOnFailure"].map { $0 == "YES" } buildActionEntries = try element["BuildActionEntries"]["BuildActionEntry"] .all? .map(Entry.init) ?? [] @@ -114,13 +114,18 @@ extension XCScheme { // MARK: - XML func xmlElement() -> AEXMLElement { + var attributes = [ + "parallelizeBuildables": parallelizeBuild.xmlString, + "buildImplicitDependencies": buildImplicitDependencies.xmlString, + ] + + if let runPostActionsOnFailure = runPostActionsOnFailure { + attributes["runPostActionsOnFailure"] = runPostActionsOnFailure.xmlString + } + let element = AEXMLElement(name: "BuildAction", value: nil, - attributes: [ - "parallelizeBuildables": parallelizeBuild.xmlString, - "buildImplicitDependencies": buildImplicitDependencies.xmlString, - "runPostActionsOnFailure": runPostActionsOnFailure.xmlString, - ]) + attributes: attributes) super.writeXML(parent: element) let entries = element.addChild(name: "BuildActionEntries") buildActionEntries.forEach { entry in diff --git a/Tests/XcodeProjTests/Scheme/XCSchemeTests.swift b/Tests/XcodeProjTests/Scheme/XCSchemeTests.swift index 0041486ea..3cea6f5d3 100644 --- a/Tests/XcodeProjTests/Scheme/XCSchemeTests.swift +++ b/Tests/XcodeProjTests/Scheme/XCSchemeTests.swift @@ -245,6 +245,28 @@ final class XCSchemeIntegrationTests: XCTestCase { XCTAssertNotEqual(runnableA1, remoteRunnableA1) } + func test_buildAction_runPostActionsOnFailure() throws { + // Given / When + let subject = try XCScheme(path: runPostActionsOnFailureSchemePath) + + // Then + let buildAction = try XCTUnwrap(subject.buildAction) + XCTAssertTrue(buildAction.runPostActionsOnFailure == true) + } + + func test_buildAction_runPostActionsOnFailure_serializingAndDeserializing() throws { + // Given + let scheme = try XCScheme(path: runPostActionsOnFailureSchemePath) + let subject = try XCTUnwrap(scheme.buildAction) + + // When + let xml = subject.xmlElement() + let reconstructedSubject = try XCScheme.BuildAction(element: xml) + + // Then + XCTAssertEqual(reconstructedSubject, subject) + } + // MARK: - Private private func assert(scheme: XCScheme) { @@ -253,7 +275,7 @@ final class XCSchemeIntegrationTests: XCTestCase { // Build action XCTAssertTrue(scheme.buildAction?.parallelizeBuild == true) XCTAssertTrue(scheme.buildAction?.buildImplicitDependencies == true) - XCTAssertTrue(scheme.buildAction?.runPostActionsOnFailure == false) + XCTAssertNil(scheme.buildAction?.runPostActionsOnFailure) XCTAssertTrue(scheme.buildAction?.buildActionEntries.first?.buildFor.contains(.testing) == true) XCTAssertTrue(scheme.buildAction?.buildActionEntries.first?.buildFor.contains(.running) == true) XCTAssertTrue(scheme.buildAction?.buildActionEntries.first?.buildFor.contains(.profiling) == true) @@ -420,7 +442,7 @@ final class XCSchemeIntegrationTests: XCTestCase { // Build action XCTAssertTrue(scheme.buildAction?.parallelizeBuild == true) XCTAssertTrue(scheme.buildAction?.buildImplicitDependencies == true) - XCTAssertTrue(scheme.buildAction?.runPostActionsOnFailure == false) + XCTAssertNil(scheme.buildAction?.runPostActionsOnFailure) XCTAssertTrue(scheme.buildAction?.buildActionEntries.first?.buildFor.contains(.testing) == true) XCTAssertTrue(scheme.buildAction?.buildActionEntries.first?.buildFor.contains(.running) == false) XCTAssertTrue(scheme.buildAction?.buildActionEntries.first?.buildFor.contains(.profiling) == true) @@ -526,4 +548,9 @@ final class XCSchemeIntegrationTests: XCTestCase { private var watchAppSchemePath: Path { fixturesPath() + "iOS/AppWithExtensions/AppWithExtensions.xcodeproj/xcshareddata/xcschemes/WatchApp.xcscheme" } + + private var runPostActionsOnFailureSchemePath: Path { + // A scheme with the `runPostActionsOnFailure` enabled + fixturesPath() + "Schemes/RunPostActionsOnFailure.xcscheme" + } } From 5115e424acb201ab7bb32049d4d79d264c697cd8 Mon Sep 17 00:00:00 2001 From: Dalton Claybrook Date: Thu, 17 Jun 2021 06:02:33 -0400 Subject: [PATCH 130/678] Add ability to initialize scheme without a blueprint identifier (#612) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Add ability to initialize scheme without a blueprint identifier * Add test for serialization * Update changelog Co-authored-by: Pedro Piñera Buendía --- CHANGELOG.md | 1 + Fixtures/Schemes/NoBlueprintID.xcscheme | 33 +++++++++++++++ .../Scheme/XCScheme+BuildableReference.swift | 41 ++++++++++--------- .../XcodeProjTests/Scheme/XCSchemeTests.swift | 18 ++++++++ 4 files changed, 73 insertions(+), 20 deletions(-) create mode 100644 Fixtures/Schemes/NoBlueprintID.xcscheme diff --git a/CHANGELOG.md b/CHANGELOG.md index a81de142f..7afe7c158 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ ### Fixed - Adding group set incorrect parent in case of complex path [#614](https://github.com/tuist/XcodeProj/pull/614) by [@avdyushin](https://github.com/avdyushin) +- **Breaking** Fixed issue where some schemes could not be deserialized because a buildable reference did not contain a blueprint identifier [#612](https://github.com/tuist/XcodeProj/pull/612) by [@daltonclaybrook](https://github.com/daltonclaybrook) - Added the `com.apple.product-type.driver-extension` and `com.apple.product-type.system-extension` PBXProductType [#618](https://github.com/tuist/XcodeProj/pull/618) by [@vgorloff](https://github.com/vgorloff). ### Changed diff --git a/Fixtures/Schemes/NoBlueprintID.xcscheme b/Fixtures/Schemes/NoBlueprintID.xcscheme new file mode 100644 index 000000000..ef67cbfcf --- /dev/null +++ b/Fixtures/Schemes/NoBlueprintID.xcscheme @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + diff --git a/Sources/XcodeProj/Scheme/XCScheme+BuildableReference.swift b/Sources/XcodeProj/Scheme/XCScheme+BuildableReference.swift index 43c8a08a6..0a092295f 100644 --- a/Sources/XcodeProj/Scheme/XCScheme+BuildableReference.swift +++ b/Sources/XcodeProj/Scheme/XCScheme+BuildableReference.swift @@ -23,9 +23,9 @@ extension XCScheme { blueprint = .reference(object.reference) } - private var blueprint: Blueprint - public var blueprintIdentifier: String { - blueprint.string + private var blueprint: Blueprint? + public var blueprintIdentifier: String? { + blueprint?.string } public var buildableName: String @@ -35,24 +35,24 @@ extension XCScheme { // MARK: - Init public init(referencedContainer: String, - blueprint: PBXObject, + blueprint: PBXObject?, buildableName: String, blueprintName: String, buildableIdentifier: String = "primary") { self.referencedContainer = referencedContainer - self.blueprint = .reference(blueprint.reference) + self.blueprint = blueprint.map { Blueprint.reference($0.reference) } self.buildableName = buildableName self.buildableIdentifier = buildableIdentifier self.blueprintName = blueprintName } public init(referencedContainer: String, - blueprintIdentifier: String, + blueprintIdentifier: String?, buildableName: String, blueprintName: String, buildableIdentifier: String = "primary") { self.referencedContainer = referencedContainer - self.blueprint = .string(blueprintIdentifier) + self.blueprint = blueprintIdentifier.map(Blueprint.string) self.buildableName = buildableName self.buildableIdentifier = buildableIdentifier self.blueprintName = blueprintName @@ -64,9 +64,6 @@ extension XCScheme { guard let buildableIdentifier = element.attributes["BuildableIdentifier"] else { throw XCSchemeError.missing(property: "BuildableIdentifier") } - guard let blueprintIdentifier = element.attributes["BlueprintIdentifier"] else { - throw XCSchemeError.missing(property: "BlueprintIdentifier") - } guard let buildableName = element.attributes["BuildableName"] else { throw XCSchemeError.missing(property: "BuildableName") } @@ -77,22 +74,26 @@ extension XCScheme { throw XCSchemeError.missing(property: "ReferencedContainer") } self.buildableIdentifier = buildableIdentifier - blueprint = .string(blueprintIdentifier) + let blueprintIdentifier = element.attributes["BlueprintIdentifier"] + self.blueprint = blueprintIdentifier.map(Blueprint.string) self.buildableName = buildableName self.blueprintName = blueprintName self.referencedContainer = referencedContainer } func xmlElement() -> AEXMLElement { - AEXMLElement(name: "BuildableReference", - value: nil, - attributes: [ - "BuildableIdentifier": buildableIdentifier, - "BlueprintIdentifier": blueprint.string, - "BuildableName": buildableName, - "BlueprintName": blueprintName, - "ReferencedContainer": referencedContainer, - ]) + var attributes: [String: String] = [ + "BuildableIdentifier": buildableIdentifier, + "BuildableName": buildableName, + "BlueprintName": blueprintName, + "ReferencedContainer": referencedContainer, + ] + if let blueprintIdentifier = blueprint?.string { + attributes["BlueprintIdentifier"] = blueprintIdentifier + } + return AEXMLElement(name: "BuildableReference", + value: nil, + attributes: attributes) } // MARK: - Equatable diff --git a/Tests/XcodeProjTests/Scheme/XCSchemeTests.swift b/Tests/XcodeProjTests/Scheme/XCSchemeTests.swift index 3cea6f5d3..8a6325a1a 100644 --- a/Tests/XcodeProjTests/Scheme/XCSchemeTests.swift +++ b/Tests/XcodeProjTests/Scheme/XCSchemeTests.swift @@ -245,6 +245,19 @@ final class XCSchemeIntegrationTests: XCTestCase { XCTAssertNotEqual(runnableA1, remoteRunnableA1) } + func test_schemeWithoutBlueprintIdentifier_canBeCreated() { + let subject = try? XCScheme(path: noBlueprintIDPath) + XCTAssertNotNil(subject) + } + + func test_schemeWithoutBlueprintIdentifier_serializesWithoutBlueprintIdentifier() throws { + let subject = try XCScheme(path: noBlueprintIDPath) + let buildable = try XCTUnwrap(subject.buildAction?.buildActionEntries.first?.buildableReference) + let buildableXML = buildable.xmlElement() + XCTAssertNotNil(buildableXML.attributes["BlueprintName"]) + XCTAssertNil(buildableXML.attributes["BlueprintIdentifier"]) + } + func test_buildAction_runPostActionsOnFailure() throws { // Given / When let subject = try XCScheme(path: runPostActionsOnFailureSchemePath) @@ -545,6 +558,11 @@ final class XCSchemeIntegrationTests: XCTestCase { fixturesPath() + "Schemes/MinimalInformation.xcscheme" } + /// Path to a scheme with a buildable reference that contains no blueprint identifier + private var noBlueprintIDPath: Path { + fixturesPath() + "Schemes/NoBlueprintID.xcscheme" + } + private var watchAppSchemePath: Path { fixturesPath() + "iOS/AppWithExtensions/AppWithExtensions.xcodeproj/xcshareddata/xcschemes/WatchApp.xcscheme" } From 0b18c3e7a10c241323397a80cb445051f4494971 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20Pi=C3=B1era?= Date: Thu, 17 Jun 2021 12:13:43 +0200 Subject: [PATCH 131/678] Version 8.0.0 --- CHANGELOG.md | 1 + README.md | 24 ++++++++++++++++-------- xcodeproj.podspec | 2 +- 3 files changed, 18 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7afe7c158..82cd05ef0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ ## Next +## 8.0.0 - Amor ### Fixed - Adding group set incorrect parent in case of complex path [#614](https://github.com/tuist/XcodeProj/pull/614) by [@avdyushin](https://github.com/avdyushin) diff --git a/README.md b/README.md index ba33e46d3..05f1ad43f 100644 --- a/README.md +++ b/README.md @@ -16,10 +16,18 @@ XcodeProj is a library written in Swift for parsing and working with Xcode proje --- -- [Projects Using XcodeProj](#projects-using-xcodeproj) -- [Installation](#installation) -- [Contributing](#contributing) -- [License](#license) +- [XcodeProj](#xcodeproj) + - [Projects Using XcodeProj](#projects-using-xcodeproj) + - [Installation](#installation) + - [Swift Package Manager](#swift-package-manager) + - [Carthage](#carthage) + - [CocoaPods](#cocoapods) + - [Scripting](#scripting) + - [Documentation 📝](#documentation-) + - [References 📚](#references-) + - [Contributing](#contributing) + - [License](#license) + - [Contributors ✨](#contributors-) ## Projects Using XcodeProj @@ -43,7 +51,7 @@ Add the dependency in your `Package.swift` file: let package = Package( name: "myproject", dependencies: [ - .package(url: "https://github.com/tuist/xcodeproj.git", .upToNextMajor(from: "7.23.0")) + .package(url: "https://github.com/tuist/xcodeproj.git", .upToNextMajor(from: "8.0.0")) ], targets: [ .target( @@ -59,13 +67,13 @@ let package = Package( ```bash # Cartfile -github "tuist/xcodeproj" ~> 7.23.0 +github "tuist/xcodeproj" ~> 8.0.0 ``` ### CocoaPods ```ruby -pod 'xcodeproj', '~> 7.23.0 +pod 'xcodeproj', '~> 8.0.0 ``` ### Scripting @@ -77,7 +85,7 @@ git tag that represents the project’s version: ```swift #!/usr/bin/swift sh import Foundation -import XcodeProj // @tuist ~> 7.23.0 +import XcodeProj // @tuist ~> 8.0.0 import PathKit guard CommandLine.arguments.count == 3 else { diff --git a/xcodeproj.podspec b/xcodeproj.podspec index 7aa68a4e4..a1c510590 100644 --- a/xcodeproj.podspec +++ b/xcodeproj.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = 'xcodeproj' - s.version = '7.23.0' + s.version = '8.0.0' s.summary = 'Read/Modify/Write your Xcode projects' s.homepage = 'https://github.com/tuist/xcodeproj' s.license = 'MIT' From e4f1ee6db0cd4cc8d10a1f17f7171746c7a6779b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 16 Jul 2021 09:48:58 +0200 Subject: [PATCH 132/678] Bump rake from 13.0.3 to 13.0.6 (#622) --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index c62584803..d4e8a1249 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -83,7 +83,7 @@ GEM netrc (0.11.0) open4 (1.3.4) public_suffix (4.0.6) - rake (13.0.3) + rake (13.0.6) redcarpet (3.5.1) rouge (3.24.0) ruby-macho (1.4.0) From 4ca27e3a4c403d17d46f727a6d4b7c50afc3a8d3 Mon Sep 17 00:00:00 2001 From: Keith Smiley Date: Sun, 12 Sep 2021 09:28:24 -0700 Subject: [PATCH 133/678] Remove unnecessary force unwrap (#631) This validates at least one path exists, and reuses that variable instead --- Sources/XcodeProj/Project/XcodeProj.swift | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/Sources/XcodeProj/Project/XcodeProj.swift b/Sources/XcodeProj/Project/XcodeProj.swift index ceddb6bdf..2f14c24f3 100644 --- a/Sources/XcodeProj/Project/XcodeProj.swift +++ b/Sources/XcodeProj/Project/XcodeProj.swift @@ -22,11 +22,9 @@ public final class XcodeProj: Equatable { var sharedData: XCSharedData? if !path.exists { throw XCodeProjError.notFound(path: path) } - let pbxprojPaths = path.glob("*.pbxproj") - if pbxprojPaths.isEmpty { + guard let pbxprojPath = path.glob("*.pbxproj").first else { throw XCodeProjError.pbxprojNotFound(path: path) } - let pbxprojPath = pbxprojPaths.first! let (pbxProjData, pbxProjDictionary) = try XcodeProj.readPBXProj(path: pbxprojPath) let context = ProjectDecodingContext( pbxProjValueReader: { key in @@ -36,7 +34,7 @@ public final class XcodeProj: Equatable { let plistDecoder = XcodeprojPropertyListDecoder(context: context) pbxproj = try plistDecoder.decode(PBXProj.self, from: pbxProjData) - try pbxproj.updateProjectName(path: pbxprojPaths.first!) + try pbxproj.updateProjectName(path: pbxprojPath) let xcworkspacePaths = path.glob("*.xcworkspace") if xcworkspacePaths.isEmpty { workspace = XCWorkspace() From b1bcbfd58b3c6b5c3255ca56c673dee6a448028d Mon Sep 17 00:00:00 2001 From: Alfredo Delli Bovi Date: Mon, 13 Sep 2021 11:15:38 +0200 Subject: [PATCH 134/678] Improve performance of commented string (#635) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Improve performance of commented string * Update Sources/XcodeProj/Utils/CommentedString.swift Co-authored-by: Marek Fořt * Update CHANGELOG.md Co-authored-by: Marek Fořt Co-authored-by: Alfredo Delli Bovi Co-authored-by: Marek Fořt --- CHANGELOG.md | 4 ++ Sources/XcodeProj/Utils/CommentedString.swift | 68 +++---------------- 2 files changed, 14 insertions(+), 58 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 82cd05ef0..0f6917ace 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ ## Next +### Changed + +- Improve performance of commented string [#635](https://github.com/tuist/XcodeProj/pull/635) by [@adellibovi](https://github.com/adellibovi) + ## 8.0.0 - Amor ### Fixed diff --git a/Sources/XcodeProj/Utils/CommentedString.swift b/Sources/XcodeProj/Utils/CommentedString.swift index 69b7dc328..a3663eec8 100644 --- a/Sources/XcodeProj/Utils/CommentedString.swift +++ b/Sources/XcodeProj/Utils/CommentedString.swift @@ -28,49 +28,8 @@ struct CommentedString { return invalidSet }() - /// Substrings that cause Xcode to quote the string content. - /// - /// Matches the strings `___` and `//`. - private let invalidStrings: Trie = [ - "_": ["_": "_"], - "/": "/" - ] - - /// A tree of characters to efficiently match string prefixes. - private enum Trie: ExpressibleByDictionaryLiteral, ExpressibleByUnicodeScalarLiteral { - case match - case next([(UnicodeScalar, Trie)]) - - init(dictionaryLiteral elements: (UnicodeScalar, Trie)...) { - self = .next(elements) - } - - init(unicodeScalarLiteral value: UnicodeScalar) { - self = .next([(value, .match)]) - } - - /// Accepts a character and mutates to the subtree of strings which match that character. If the character does - /// not match, resets to `default`. - mutating func match(_ character: UnicodeScalar, orResetTo default: Trie) { - switch self { - case .match: - return - case .next(let options): - for (key, subtrie) in options where key == character { - self = subtrie - return - } - self = `default` - } - } - - var accepted: Bool { - switch self { - case .match: return true - case .next: return false - } - } - } + /// Set of characters that are invalid. + private static var specialCheckCharacters = CharacterSet(charactersIn: "_/") /// Returns a valid string for Xcode projects. var validString: String { @@ -81,19 +40,15 @@ struct CommentedString { default: break } - var needsQuoting = false - var matchingInvalidPrefix: Trie = self.invalidStrings + if string.rangeOfCharacter(from: CommentedString.invalidCharacters) == nil { + if string.rangeOfCharacter(from: CommentedString.specialCheckCharacters) == nil { + return string + } else if !string.contains("//") && !string.contains("___") { + return string + } + } let escaped = string.reduce(into: "") { escaped, character in - quote: if !needsQuoting { - for scalar in character.unicodeScalars { - matchingInvalidPrefix.match(scalar, orResetTo: self.invalidStrings) - if matchingInvalidPrefix.accepted || CommentedString.invalidCharacters.contains(scalar) { - needsQuoting = true - break quote - } - } - } // As an optimization, only look at the first scalar. This means we're doing a numeric comparison instead // of comparing arbitrary-length characters. This is safe because all our cases are a single scalar. switch character.unicodeScalars.first { @@ -109,10 +64,7 @@ struct CommentedString { escaped.append(character) } } - if needsQuoting { - return "\"\(escaped)\"" - } - return escaped + return "\"\(escaped)\"" } } From 37c8c5347208c0a2e68941957b364aa27da0a5ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20Pi=C3=B1era?= Date: Mon, 13 Sep 2021 11:22:15 +0200 Subject: [PATCH 135/678] Version 8.1.0 --- CHANGELOG.md | 2 +- README.md | 8 ++++---- RELEASE.md | 14 +++++++++++--- TapestryConfig.swift | 14 -------------- xcodeproj.podspec | 2 +- 5 files changed, 17 insertions(+), 23 deletions(-) delete mode 100644 TapestryConfig.swift diff --git a/CHANGELOG.md b/CHANGELOG.md index 0f6917ace..c9e2ca1e3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,7 @@ 🚀 Check out the guidelines [here](https://tuist.io/docs/contribution/changelog-guidelines/) ## Next - +## 8.1.0 - Barcelona ### Changed - Improve performance of commented string [#635](https://github.com/tuist/XcodeProj/pull/635) by [@adellibovi](https://github.com/adellibovi) diff --git a/README.md b/README.md index 05f1ad43f..f8556a8b6 100644 --- a/README.md +++ b/README.md @@ -51,7 +51,7 @@ Add the dependency in your `Package.swift` file: let package = Package( name: "myproject", dependencies: [ - .package(url: "https://github.com/tuist/xcodeproj.git", .upToNextMajor(from: "8.0.0")) + .package(url: "https://github.com/tuist/xcodeproj.git", .upToNextMajor(from: "8.1.0")) ], targets: [ .target( @@ -67,13 +67,13 @@ let package = Package( ```bash # Cartfile -github "tuist/xcodeproj" ~> 8.0.0 +github "tuist/xcodeproj" ~> 8.1.0 ``` ### CocoaPods ```ruby -pod 'xcodeproj', '~> 8.0.0 +pod 'xcodeproj', '~> 8.1.0 ``` ### Scripting @@ -85,7 +85,7 @@ git tag that represents the project’s version: ```swift #!/usr/bin/swift sh import Foundation -import XcodeProj // @tuist ~> 8.0.0 +import XcodeProj // @tuist ~> 8.1.0 import PathKit guard CommandLine.arguments.count == 3 else { diff --git a/RELEASE.md b/RELEASE.md index c58657b4b..198c6087d 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -2,6 +2,14 @@ In this document you'll find all the necessary steps to release a new version of `xcodeproj`: -1. Run `tapestry release version-number` (eg `tapestry release 7.1.0`) *(Install [tapestry](https://github.com/ackeecz/tapestry) and [tuist](https://github.com/tuist/tuist) if you don't have them installed already)*. -2. Create a new release on [GitHub](https://github.com/tuist/XcodeProj) including the information from the last entry in the `CHANGELOG.md`. -3. Attach `XcodeProj.framework.zip` to the GitHub release. +1. Make sure you are in the `main` branch. +2. Determine the next version based on the unreleased changes. +3. Add the version section to the `CHANGELOG.md`, update the versions in the `README.md` and the `xcodeproj.podspec` file. +4. Commit the changes and tag them `git commit -m "Version x.y.z"` & `git tag x.y.z`. +5. Push the changes `git commit push origin main --tags` +6. Generate the project by running `tuist generate`. +7. Update Carthage dependencies by running `bundle exec rake carthage_update_dependencies`. +8. Run the release checks by running `bundle exec rake release_check`. +9. Publish a new version of the Pod by running `bundle exec pod trunk push --allow-warnings --verbose`. +10. Archive the Carthage binary by running `bundle exec rake archive_carthage`. +11. Create the release on GitHub including the release notes from the `CHANGELOG.md` and attach the archive `XcodeProj.framework.zip` generated by Carthage. diff --git a/TapestryConfig.swift b/TapestryConfig.swift deleted file mode 100644 index 5054f6e3a..000000000 --- a/TapestryConfig.swift +++ /dev/null @@ -1,14 +0,0 @@ -import PackageDescription - -let config = TapestryConfig(release: Release(actions: [.pre(.dependenciesCompatibility([.cocoapods, .spm(.all)])), - .pre(tool: "tuist", arguments: ["generate"]), - .pre(tool: "bundle", arguments: ["exec", "rake", "carthage_update_dependencies"]), - .pre(tool: "bundle", arguments: ["exec", "rake", "release_check"]), - .pre(.docsUpdate), - .post(tool: "bundle", arguments: ["exec", "pod", "trunk", "push", "--allow-warnings", "--verbose"]), - .post(tool: "bundle", arguments: ["exec", "rake", "archive_carthage"])], - add: ["README.md", - "xcodeproj.podspec", - "CHANGELOG.md"], - commitMessage: "Version \(Argument.version)", - push: true)) diff --git a/xcodeproj.podspec b/xcodeproj.podspec index a1c510590..66b0bea86 100644 --- a/xcodeproj.podspec +++ b/xcodeproj.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = 'xcodeproj' - s.version = '8.0.0' + s.version = '8.1.0' s.summary = 'Read/Modify/Write your Xcode projects' s.homepage = 'https://github.com/tuist/xcodeproj' s.license = 'MIT' From 043bec13af76d975aa11f499da50e2df9f8a88d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20Pi=C3=B1era?= Date: Mon, 13 Sep 2021 11:30:28 +0200 Subject: [PATCH 136/678] Update Carhage project --- XcodeProj_Carthage.xcodeproj/project.pbxproj | 4 ++-- .../xcshareddata/xcschemes/XcodeProj.xcscheme | 3 +-- .../xcschemes/XcodeProj_Carthage-Project.xcscheme | 3 +-- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/XcodeProj_Carthage.xcodeproj/project.pbxproj b/XcodeProj_Carthage.xcodeproj/project.pbxproj index ea35e92d8..d9ae6e0a5 100644 --- a/XcodeProj_Carthage.xcodeproj/project.pbxproj +++ b/XcodeProj_Carthage.xcodeproj/project.pbxproj @@ -731,7 +731,7 @@ SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; SWIFT_COMPILATION_MODE = singlefile; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 5.4; + SWIFT_VERSION = 5.4.2; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; }; @@ -874,7 +874,7 @@ SUPPORTED_PLATFORMS = macosx; SWIFT_COMPILATION_MODE = wholemodule; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; - SWIFT_VERSION = 5.4; + SWIFT_VERSION = 5.4.2; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; }; diff --git a/XcodeProj_Carthage.xcodeproj/xcshareddata/xcschemes/XcodeProj.xcscheme b/XcodeProj_Carthage.xcodeproj/xcshareddata/xcschemes/XcodeProj.xcscheme index e9d1ffa1a..066eafdeb 100644 --- a/XcodeProj_Carthage.xcodeproj/xcshareddata/xcschemes/XcodeProj.xcscheme +++ b/XcodeProj_Carthage.xcodeproj/xcshareddata/xcschemes/XcodeProj.xcscheme @@ -4,8 +4,7 @@ version = "1.3"> + buildImplicitDependencies = "YES"> + buildImplicitDependencies = "YES"> Date: Mon, 13 Sep 2021 18:39:11 +0900 Subject: [PATCH 137/678] Update README.md (#634) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Pedro Piñera Buendía --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index f8556a8b6..aabb000b1 100644 --- a/README.md +++ b/README.md @@ -51,7 +51,7 @@ Add the dependency in your `Package.swift` file: let package = Package( name: "myproject", dependencies: [ - .package(url: "https://github.com/tuist/xcodeproj.git", .upToNextMajor(from: "8.1.0")) + .package(url: "https://github.com/tuist/XcodeProj.git", .upToNextMajor(from: "8.1.0")) ], targets: [ .target( From 418e9c9c55625690fdc77c04965fa75c585db3eb Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Mon, 13 Sep 2021 11:39:22 +0200 Subject: [PATCH 138/678] docs: add muukii as a contributor for content (#636) * docs: update README.md [skip ci] * docs: update .all-contributorsrc [skip ci] Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com> --- .all-contributorsrc | 9 +++++++++ README.md | 23 ++++++++++++----------- 2 files changed, 21 insertions(+), 11 deletions(-) diff --git a/.all-contributorsrc b/.all-contributorsrc index 98c74b7b0..f50fbd044 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -67,6 +67,15 @@ "contributions": [ "code" ] + }, + { + "login": "muukii", + "name": "Muukii", + "avatar_url": "https://avatars.githubusercontent.com/u/1888355?v=4", + "profile": "http://muukii.app", + "contributions": [ + "content" + ] } ], "contributorsPerLine": 7, diff --git a/README.md b/README.md index aabb000b1..387da39f9 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,7 @@ # XcodeProj - -[![All Contributors](https://img.shields.io/badge/all_contributors-7-orange.svg?style=flat-square)](#contributors-) - +[![All Contributors](https://img.shields.io/badge/all_contributors-8-orange.svg?style=flat-square)](#contributors-) [![Swift Package Manager](https://img.shields.io/badge/swift%20package%20manager-compatible-brightgreen.svg)](https://swift.org/package-manager/) @@ -157,17 +155,20 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d - - - - - - - + + + + + + + + + +

Joseph Colicchio

🤔

deatondg

🤔

Dan Fleming

💻

Sascha Schwabbauer

🤔

Marcin Iwanicki

🚧

Adam Khazi

🚧

Elliott Williams

💻

Joseph Colicchio

🤔

deatondg

🤔

Dan Fleming

💻

Sascha Schwabbauer

🤔

Marcin Iwanicki

🚧

Adam Khazi

🚧

Elliott Williams

💻

Muukii

🖋
- + From d3f90003945336b97d0397ad6ebdcdcbc08e7eb0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 13 Sep 2021 11:39:59 +0200 Subject: [PATCH 139/678] Bump cocoapods from 1.10.1 to 1.11.0 (#633) Bumps [cocoapods](https://github.com/CocoaPods/CocoaPods) from 1.10.1 to 1.11.0. - [Release notes](https://github.com/CocoaPods/CocoaPods/releases) - [Changelog](https://github.com/CocoaPods/CocoaPods/blob/master/CHANGELOG.md) - [Commits](https://github.com/CocoaPods/CocoaPods/compare/1.10.1...1.11.0) --- updated-dependencies: - dependency-name: cocoapods dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Gemfile | 2 +- Gemfile.lock | 67 +++++++++++++++++++++++++++------------------------- 2 files changed, 36 insertions(+), 33 deletions(-) diff --git a/Gemfile b/Gemfile index 225c83192..3f25545c3 100644 --- a/Gemfile +++ b/Gemfile @@ -2,6 +2,6 @@ source "https://rubygems.org" gem "rake" gem "jazzy" -gem "cocoapods", "1.10.1" +gem "cocoapods", "1.11.0" gem "colorize", "~> 0.8.1" gem "redcarpet", "~> 3.5.1" diff --git a/Gemfile.lock b/Gemfile.lock index d4e8a1249..d2d35b9fe 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -2,22 +2,23 @@ GEM remote: https://rubygems.org/ specs: CFPropertyList (3.0.3) - activesupport (5.2.4.4) + activesupport (6.1.4.1) concurrent-ruby (~> 1.0, >= 1.0.2) - i18n (>= 0.7, < 2) - minitest (~> 5.1) - tzinfo (~> 1.1) - addressable (2.7.0) + i18n (>= 1.6, < 2) + minitest (>= 5.1) + tzinfo (~> 2.0) + zeitwerk (~> 2.3) + addressable (2.8.0) public_suffix (>= 2.0.2, < 5.0) algoliasearch (1.27.5) httpclient (~> 2.8, >= 2.8.3) json (>= 1.5.1) atomos (0.1.3) claide (1.0.3) - cocoapods (1.10.1) - addressable (~> 2.6) + cocoapods (1.11.0) + addressable (~> 2.8) claide (>= 1.0.2, < 2.0) - cocoapods-core (= 1.10.1) + cocoapods-core (= 1.11.0) cocoapods-deintegrate (>= 1.0.3, < 2.0) cocoapods-downloader (>= 1.4.0, < 2.0) cocoapods-plugins (>= 1.0.0, < 2.0) @@ -28,41 +29,41 @@ GEM escape (~> 0.0.4) fourflusher (>= 2.3.0, < 3.0) gh_inspector (~> 1.0) - molinillo (~> 0.6.6) + molinillo (~> 0.8.0) nap (~> 1.0) - ruby-macho (~> 1.4) - xcodeproj (>= 1.19.0, < 2.0) - cocoapods-core (1.10.1) - activesupport (> 5.0, < 6) - addressable (~> 2.6) + ruby-macho (>= 1.0, < 3.0) + xcodeproj (>= 1.21.0, < 2.0) + cocoapods-core (1.11.0) + activesupport (>= 5.0, < 7) + addressable (~> 2.8) algoliasearch (~> 1.0) concurrent-ruby (~> 1.1) fuzzy_match (~> 2.0.4) nap (~> 1.0) netrc (~> 0.11) - public_suffix + public_suffix (~> 4.0) typhoeus (~> 1.0) - cocoapods-deintegrate (1.0.4) - cocoapods-downloader (1.4.0) + cocoapods-deintegrate (1.0.5) + cocoapods-downloader (1.5.0) cocoapods-plugins (1.0.0) nap - cocoapods-search (1.0.0) - cocoapods-trunk (1.5.0) + cocoapods-search (1.0.1) + cocoapods-trunk (1.6.0) nap (>= 0.8, < 2.0) netrc (~> 0.11) cocoapods-try (1.2.0) colored2 (3.1.2) colorize (0.8.1) - concurrent-ruby (1.1.7) + concurrent-ruby (1.1.9) escape (0.0.4) - ethon (0.12.0) - ffi (>= 1.3.0) - ffi (1.14.2) + ethon (0.14.0) + ffi (>= 1.15.0) + ffi (1.15.4) fourflusher (2.3.1) fuzzy_match (2.0.4) gh_inspector (1.1.3) httpclient (2.8.3) - i18n (1.8.7) + i18n (1.8.10) concurrent-ruby (~> 1.0) jazzy (0.13.6) cocoapods (~> 1.5) @@ -75,8 +76,8 @@ GEM xcinvoke (~> 0.3.0) json (2.5.1) liferaft (0.0.6) - minitest (5.14.3) - molinillo (0.6.6) + minitest (5.14.4) + molinillo (0.8.0) mustache (1.1.1) nanaimo (0.3.0) nap (1.1.0) @@ -85,30 +86,32 @@ GEM public_suffix (4.0.6) rake (13.0.6) redcarpet (3.5.1) + rexml (3.2.5) rouge (3.24.0) - ruby-macho (1.4.0) + ruby-macho (2.5.1) sassc (2.4.0) ffi (~> 1.9) sqlite3 (1.4.2) - thread_safe (0.3.6) typhoeus (1.4.0) ethon (>= 0.9.0) - tzinfo (1.2.9) - thread_safe (~> 0.1) + tzinfo (2.0.4) + concurrent-ruby (~> 1.0) xcinvoke (0.3.0) liferaft (~> 0.0.6) - xcodeproj (1.19.0) + xcodeproj (1.21.0) CFPropertyList (>= 2.3.3, < 4.0) atomos (~> 0.1.3) claide (>= 1.0.2, < 2.0) colored2 (~> 3.1) nanaimo (~> 0.3.0) + rexml (~> 3.2.4) + zeitwerk (2.4.2) PLATFORMS ruby DEPENDENCIES - cocoapods (= 1.10.1) + cocoapods (= 1.11.0) colorize (~> 0.8.1) jazzy rake From 510371ea696acc081b9bc1a0e72a12a0005cad7c Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Mon, 13 Sep 2021 11:41:23 +0200 Subject: [PATCH 140/678] docs: add nnsnodnb as a contributor for code (#637) * docs: update README.md [skip ci] * docs: update .all-contributorsrc [skip ci] Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com> --- .all-contributorsrc | 9 +++++++++ README.md | 3 ++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/.all-contributorsrc b/.all-contributorsrc index f50fbd044..c538b306c 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -76,6 +76,15 @@ "contributions": [ "content" ] + }, + { + "login": "nnsnodnb", + "name": "Yuya Oka", + "avatar_url": "https://avatars.githubusercontent.com/u/9856514?v=4", + "profile": "https://nnsnodnb.github.io", + "contributions": [ + "code" + ] } ], "contributorsPerLine": 7, diff --git a/README.md b/README.md index 387da39f9..a3a5c5fe8 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # XcodeProj -[![All Contributors](https://img.shields.io/badge/all_contributors-8-orange.svg?style=flat-square)](#contributors-) +[![All Contributors](https://img.shields.io/badge/all_contributors-9-orange.svg?style=flat-square)](#contributors-) [![Swift Package Manager](https://img.shields.io/badge/swift%20package%20manager-compatible-brightgreen.svg)](https://swift.org/package-manager/) @@ -165,6 +165,7 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
Muukii

🖋 +
Yuya Oka

💻 From 95652e5c4250bcb78b00c3daac8d9a1b08c26dc9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 13 Sep 2021 11:43:19 +0200 Subject: [PATCH 141/678] Bump jazzy from 0.13.6 to 0.14.0 (#629) Bumps [jazzy](https://github.com/realm/jazzy) from 0.13.6 to 0.14.0. - [Release notes](https://github.com/realm/jazzy/releases) - [Changelog](https://github.com/realm/jazzy/blob/master/CHANGELOG.md) - [Commits](https://github.com/realm/jazzy/compare/v0.13.6...v0.14.0) --- updated-dependencies: - dependency-name: jazzy dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Gemfile.lock | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index d2d35b9fe..3385e205c 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -44,7 +44,7 @@ GEM public_suffix (~> 4.0) typhoeus (~> 1.0) cocoapods-deintegrate (1.0.5) - cocoapods-downloader (1.5.0) + cocoapods-downloader (1.5.1) cocoapods-plugins (1.0.0) nap cocoapods-search (1.0.1) @@ -65,11 +65,12 @@ GEM httpclient (2.8.3) i18n (1.8.10) concurrent-ruby (~> 1.0) - jazzy (0.13.6) + jazzy (0.14.0) cocoapods (~> 1.5) mustache (~> 1.1) - open4 + open4 (~> 1.3) redcarpet (~> 3.4) + rexml (~> 3.2) rouge (>= 2.0.6, < 4.0) sassc (~> 2.1) sqlite3 (~> 1.3) @@ -87,7 +88,7 @@ GEM rake (13.0.6) redcarpet (3.5.1) rexml (3.2.5) - rouge (3.24.0) + rouge (3.26.0) ruby-macho (2.5.1) sassc (2.4.0) ffi (~> 1.9) From b575d3bcab0e7681fa4b76ef4e119d1603e572b6 Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Mon, 13 Sep 2021 11:43:28 +0200 Subject: [PATCH 142/678] docs: add keith as a contributor for content (#638) * docs: update README.md [skip ci] * docs: update .all-contributorsrc [skip ci] Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com> --- .all-contributorsrc | 9 +++++++++ README.md | 3 ++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/.all-contributorsrc b/.all-contributorsrc index c538b306c..2110760a3 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -85,6 +85,15 @@ "contributions": [ "code" ] + }, + { + "login": "keith", + "name": "Keith Smiley", + "avatar_url": "https://avatars.githubusercontent.com/u/283886?v=4", + "profile": "https://smileykeith.com", + "contributions": [ + "content" + ] } ], "contributorsPerLine": 7, diff --git a/README.md b/README.md index a3a5c5fe8..40ea63cc3 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # XcodeProj -[![All Contributors](https://img.shields.io/badge/all_contributors-9-orange.svg?style=flat-square)](#contributors-) +[![All Contributors](https://img.shields.io/badge/all_contributors-10-orange.svg?style=flat-square)](#contributors-) [![Swift Package Manager](https://img.shields.io/badge/swift%20package%20manager-compatible-brightgreen.svg)](https://swift.org/package-manager/) @@ -166,6 +166,7 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
Muukii

🖋
Yuya Oka

💻 +
Keith Smiley

🖋 From a39f29d458e33c3b3d9a4bcabcfabf703655e7ef Mon Sep 17 00:00:00 2001 From: Keith Smiley Date: Mon, 13 Sep 2021 02:43:52 -0700 Subject: [PATCH 143/678] Fix indentation in example (#630) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Fix indentation in example This also adds a trailing `,` for easier copy pasting to projects with existing dependencies * It's case sensitive too apparently Co-authored-by: Pedro Piñera Buendía --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 40ea63cc3..c220d7733 100644 --- a/README.md +++ b/README.md @@ -49,8 +49,8 @@ Add the dependency in your `Package.swift` file: let package = Package( name: "myproject", dependencies: [ - .package(url: "https://github.com/tuist/XcodeProj.git", .upToNextMajor(from: "8.1.0")) - ], + .package(url: "https://github.com/tuist/XcodeProj.git", .upToNextMajor(from: "8.1.0")), + ], targets: [ .target( name: "myproject", From 64afa87b9cf0418820beaa51710f395f216a196a Mon Sep 17 00:00:00 2001 From: Ian Leitch Date: Mon, 13 Sep 2021 11:45:05 +0200 Subject: [PATCH 144/678] Add String overload of PBXFileElement.fullPath(sourceRoot:) (#624) --- Sources/XcodeProj/Objects/Files/PBXFileElement.swift | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Sources/XcodeProj/Objects/Files/PBXFileElement.swift b/Sources/XcodeProj/Objects/Files/PBXFileElement.swift index fb245cd55..573e8ee8e 100644 --- a/Sources/XcodeProj/Objects/Files/PBXFileElement.swift +++ b/Sources/XcodeProj/Objects/Files/PBXFileElement.swift @@ -144,6 +144,15 @@ public class PBXFileElement: PBXContainerItem, PlistSerializable { // MARK: - Helpers public extension PBXFileElement { + /// Returns a file absolute path. + /// + /// - Parameter sourceRoot: project source root. + /// - Returns: file element absolute path. + /// - Throws: an error if the absolute path cannot be obtained. + func fullPath(sourceRoot: String) throws -> String? { + try fullPath(sourceRoot: Path(sourceRoot))?.absolute().string + } + /// Returns a file absolute path. /// /// - Parameter sourceRoot: project source root. From 04fd1644ed73dfd29b44f2c17e06d0c49d104ba8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20Pi=C3=B1era?= Date: Mon, 13 Sep 2021 11:46:26 +0200 Subject: [PATCH 145/678] Update CHANGELOG --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index c9e2ca1e3..aa2d84366 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,10 @@ 🚀 Check out the guidelines [here](https://tuist.io/docs/contribution/changelog-guidelines/) ## Next + +### Added + +- Support obtaining the full path of a file element by passing the source root as a string [#624](https://github.com/tuist/XcodeProj/pull/624) by [@ileitch](https://github.com/ileitch). ## 8.1.0 - Barcelona ### Changed From b00832152792237334715829a8e8fe8472555a9c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20Pi=C3=B1era?= Date: Mon, 13 Sep 2021 11:46:41 +0200 Subject: [PATCH 146/678] Remove dependabot configuration --- .github/dependabot.yml | 8 -------- 1 file changed, 8 deletions(-) delete mode 100644 .github/dependabot.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml deleted file mode 100644 index 4017f57c9..000000000 --- a/.github/dependabot.yml +++ /dev/null @@ -1,8 +0,0 @@ -version: 2 -updates: -- package-ecosystem: bundler - directory: "/" - schedule: - interval: daily - time: '11:00' - open-pull-requests-limit: 10 From f2ee957612054b2b38baff58d2d881078fbc0178 Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Mon, 13 Sep 2021 11:47:21 +0200 Subject: [PATCH 147/678] docs: add ileitch as a contributor for code (#639) * docs: update README.md [skip ci] * docs: update .all-contributorsrc [skip ci] Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com> --- .all-contributorsrc | 9 +++++++++ README.md | 3 ++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/.all-contributorsrc b/.all-contributorsrc index 2110760a3..559bfa24b 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -94,6 +94,15 @@ "contributions": [ "content" ] + }, + { + "login": "ileitch", + "name": "Ian Leitch", + "avatar_url": "https://avatars.githubusercontent.com/u/48235?v=4", + "profile": "https://github.com/ileitch", + "contributions": [ + "code" + ] } ], "contributorsPerLine": 7, diff --git a/README.md b/README.md index c220d7733..3fd40cd99 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # XcodeProj -[![All Contributors](https://img.shields.io/badge/all_contributors-10-orange.svg?style=flat-square)](#contributors-) +[![All Contributors](https://img.shields.io/badge/all_contributors-11-orange.svg?style=flat-square)](#contributors-) [![Swift Package Manager](https://img.shields.io/badge/swift%20package%20manager-compatible-brightgreen.svg)](https://swift.org/package-manager/) @@ -167,6 +167,7 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
Muukii

🖋
Yuya Oka

💻
Keith Smiley

🖋 +
Ian Leitch

💻 From d31c485cbd6bc09122d6dde5ca7ae7d190571502 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20Pi=C3=B1era?= Date: Mon, 13 Sep 2021 11:52:09 +0200 Subject: [PATCH 148/678] Add FUNDING.yml document --- .github/FUNDING.yml | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 .github/FUNDING.yml diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100644 index 000000000..fae50dada --- /dev/null +++ b/.github/FUNDING.yml @@ -0,0 +1,2 @@ +open_collective: tuistapp +github: tuist From 41eb6303e2b00c470d897e0cdd19929b1d39421e Mon Sep 17 00:00:00 2001 From: Daniil Subbotin Date: Mon, 13 Sep 2021 13:04:44 +0300 Subject: [PATCH 149/678] Fix bug: if `RemoteRunnable` doesn't contains `BuildableReference` XcodeProj removes xcscheme file (#627) Closes #626 --- ...RunnableWithoutBuildableReference.xcscheme | 98 +++++++++++ .../Scheme/XCScheme+LaunchAction.swift | 2 +- .../Scheme/XCScheme+ProfileAction.swift | 2 +- .../XcodeProj/Scheme/XCScheme+Runnable.swift | 8 +- .../XcodeProjTests/Scheme/XCSchemeTests.swift | 155 ++++++++++++++++-- 5 files changed, 250 insertions(+), 15 deletions(-) create mode 100644 Fixtures/Schemes/RunnableWithoutBuildableReference.xcscheme diff --git a/Fixtures/Schemes/RunnableWithoutBuildableReference.xcscheme b/Fixtures/Schemes/RunnableWithoutBuildableReference.xcscheme new file mode 100644 index 000000000..669fdba94 --- /dev/null +++ b/Fixtures/Schemes/RunnableWithoutBuildableReference.xcscheme @@ -0,0 +1,98 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Sources/XcodeProj/Scheme/XCScheme+LaunchAction.swift b/Sources/XcodeProj/Scheme/XCScheme+LaunchAction.swift index 3a4e8edca..28f794df5 100644 --- a/Sources/XcodeProj/Scheme/XCScheme+LaunchAction.swift +++ b/Sources/XcodeProj/Scheme/XCScheme+LaunchAction.swift @@ -148,7 +148,7 @@ extension XCScheme { selectedDebuggerIdentifier = element.attributes["selectedDebuggerIdentifier"] ?? XCScheme.defaultDebugger selectedLauncherIdentifier = element.attributes["selectedLauncherIdentifier"] ?? XCScheme.defaultLauncher launchStyle = element.attributes["launchStyle"].flatMap { Style(rawValue: $0) } ?? .auto - askForAppToLaunch = element.attributes["askForAppToLaunch"].map { $0 == "YES" } + askForAppToLaunch = element.attributes["askForAppToLaunch"].map { $0 == "YES" || $0 == "Yes" } useCustomWorkingDirectory = element.attributes["useCustomWorkingDirectory"] == "YES" ignoresPersistentStateOnLaunch = element.attributes["ignoresPersistentStateOnLaunch"] == "YES" debugDocumentVersioning = element.attributes["debugDocumentVersioning"].map { $0 == "YES" } ?? true diff --git a/Sources/XcodeProj/Scheme/XCScheme+ProfileAction.swift b/Sources/XcodeProj/Scheme/XCScheme+ProfileAction.swift index a91acf98a..c11e06dc8 100644 --- a/Sources/XcodeProj/Scheme/XCScheme+ProfileAction.swift +++ b/Sources/XcodeProj/Scheme/XCScheme+ProfileAction.swift @@ -60,7 +60,7 @@ extension XCScheme { savedToolIdentifier = element.attributes["savedToolIdentifier"] ?? "" useCustomWorkingDirectory = element.attributes["useCustomWorkingDirectory"] == "YES" debugDocumentVersioning = element.attributes["debugDocumentVersioning"].map { $0 == "YES" } ?? true - askForAppToLaunch = element.attributes["askForAppToLaunch"].map { $0 == "YES" } + askForAppToLaunch = element.attributes["askForAppToLaunch"].map { $0 == "YES" || $0 == "Yes" } ignoresPersistentStateOnLaunch = element.attributes["ignoresPersistentStateOnLaunch"].map { $0 == "YES" } ?? false let buildableProductRunnableElement = element["BuildableProductRunnable"] diff --git a/Sources/XcodeProj/Scheme/XCScheme+Runnable.swift b/Sources/XcodeProj/Scheme/XCScheme+Runnable.swift index 6fb8b489e..b7173dc2c 100644 --- a/Sources/XcodeProj/Scheme/XCScheme+Runnable.swift +++ b/Sources/XcodeProj/Scheme/XCScheme+Runnable.swift @@ -6,7 +6,7 @@ extension XCScheme { // MARK: - Attributes public var runnableDebuggingMode: String - public var buildableReference: BuildableReference + public var buildableReference: BuildableReference? // MARK: - Init @@ -18,7 +18,7 @@ extension XCScheme { init(element: AEXMLElement) throws { runnableDebuggingMode = element.attributes["runnableDebuggingMode"] ?? "0" - buildableReference = try BuildableReference(element: element["BuildableReference"]) + buildableReference = try? BuildableReference(element: element["BuildableReference"]) } // MARK: - XML @@ -27,7 +27,9 @@ extension XCScheme { let element = AEXMLElement(name: "Runnable", value: nil, attributes: ["runnableDebuggingMode": runnableDebuggingMode]) - element.addChild(buildableReference.xmlElement()) + if let buildableReference = buildableReference { + element.addChild(buildableReference.xmlElement()) + } return element } diff --git a/Tests/XcodeProjTests/Scheme/XCSchemeTests.swift b/Tests/XcodeProjTests/Scheme/XCSchemeTests.swift index 8a6325a1a..98fcc5190 100644 --- a/Tests/XcodeProjTests/Scheme/XCSchemeTests.swift +++ b/Tests/XcodeProjTests/Scheme/XCSchemeTests.swift @@ -15,6 +15,34 @@ final class XCSchemeIntegrationTests: XCTestCase { modify: { $0 }, assertion: { assert(scheme: $1) }) } + + func test_read_runnableWithoutBuildableReferenceScheme() { + let subject = try? XCScheme(path: runnableWithoutBuildableReferenceSchemePath) + + XCTAssertNotNil(subject) + if let subject = subject { + assert(runnableWithoutBuildableReferenceScheme: subject) + } + } + + func test_remoteRunnable_runnableWithoutBuildableReferenceScheme() throws { + // Given / When + let subject = try XCScheme(path: runnableWithoutBuildableReferenceSchemePath) + + // Then + let launchAction = try XCTUnwrap(subject.launchAction) + let remoteRunnable = try XCTUnwrap(launchAction.runnable as? XCScheme.RemoteRunnable) + XCTAssertEqual(remoteRunnable.bundleIdentifier, "me.ava.Ava-Staging") + XCTAssertEqual(remoteRunnable.runnableDebuggingMode, "1") + XCTAssertEqual(remoteRunnable.remotePath, "/var/containers/Bundle/Application/018F0933-05E8-4359-9955-39E0523C4246/Ava.app") + } + + func test_write_runnableWithoutBuildableReferenceScheme() { + testWrite(from: runnableWithoutBuildableReferenceSchemePath, + initModel: { try? XCScheme(path: $0) }, + modify: { $0 }, + assertion: { assert(runnableWithoutBuildableReferenceScheme: $1) }) + } func test_read_minimalScheme() { let subject = try? XCScheme(path: minimalSchemePath) @@ -372,11 +400,11 @@ final class XCSchemeIntegrationTests: XCTestCase { XCTAssertEqual(scheme.profileAction?.debugDocumentVersioning, true) XCTAssertNil(scheme.profileAction?.askForAppToLaunch) XCTAssertEqual(scheme.profileAction?.buildableProductRunnable?.runnableDebuggingMode, "0") - XCTAssertEqual(scheme.profileAction?.buildableProductRunnable?.buildableReference.buildableIdentifier, "primary") - XCTAssertEqual(scheme.profileAction?.buildableProductRunnable?.buildableReference.blueprintIdentifier, "23766C111EAA3484007A9026") - XCTAssertEqual(scheme.profileAction?.buildableProductRunnable?.buildableReference.buildableName, "iOS.app") - XCTAssertEqual(scheme.profileAction?.buildableProductRunnable?.buildableReference.blueprintName, "iOS") - XCTAssertEqual(scheme.profileAction?.buildableProductRunnable?.buildableReference.referencedContainer, "container:Project.xcodeproj") + XCTAssertEqual(scheme.profileAction?.buildableProductRunnable?.buildableReference?.buildableIdentifier, "primary") + XCTAssertEqual(scheme.profileAction?.buildableProductRunnable?.buildableReference?.blueprintIdentifier, "23766C111EAA3484007A9026") + XCTAssertEqual(scheme.profileAction?.buildableProductRunnable?.buildableReference?.buildableName, "iOS.app") + XCTAssertEqual(scheme.profileAction?.buildableProductRunnable?.buildableReference?.blueprintName, "iOS") + XCTAssertEqual(scheme.profileAction?.buildableProductRunnable?.buildableReference?.referencedContainer, "container:Project.xcodeproj") XCTAssertEqual(scheme.profileAction?.preActions.isEmpty, true) XCTAssertEqual(scheme.profileAction?.postActions.first?.title, "Run Script") XCTAssertEqual(scheme.profileAction?.postActions.first?.scriptText, "echo analysis done") @@ -404,11 +432,11 @@ final class XCSchemeIntegrationTests: XCTestCase { XCTAssertEqual(scheme.launchAction?.debugServiceExtension, "internal") XCTAssertEqual(scheme.launchAction?.allowLocationSimulation, true) XCTAssertEqual(scheme.launchAction?.runnable?.runnableDebuggingMode, "0") - XCTAssertEqual(scheme.launchAction?.runnable?.buildableReference.buildableIdentifier, "primary") - XCTAssertEqual(scheme.launchAction?.runnable?.buildableReference.blueprintIdentifier, "23766C111EAA3484007A9026") - XCTAssertEqual(scheme.launchAction?.runnable?.buildableReference.buildableName, "iOS.app") - XCTAssertEqual(scheme.launchAction?.runnable?.buildableReference.blueprintName, "iOS") - XCTAssertEqual(scheme.launchAction?.runnable?.buildableReference.referencedContainer, "container:Project.xcodeproj") + XCTAssertEqual(scheme.launchAction?.runnable?.buildableReference?.buildableIdentifier, "primary") + XCTAssertEqual(scheme.launchAction?.runnable?.buildableReference?.blueprintIdentifier, "23766C111EAA3484007A9026") + XCTAssertEqual(scheme.launchAction?.runnable?.buildableReference?.buildableName, "iOS.app") + XCTAssertEqual(scheme.launchAction?.runnable?.buildableReference?.blueprintName, "iOS") + XCTAssertEqual(scheme.launchAction?.runnable?.buildableReference?.referencedContainer, "container:Project.xcodeproj") XCTAssertEqual(scheme.launchAction?.locationScenarioReference?.identifier, "com.apple.dt.IDEFoundation.CurrentLocationScenarioIdentifier") XCTAssertEqual(scheme.launchAction?.locationScenarioReference?.referenceType, "1") XCTAssertEqual(scheme.launchAction?.preActions.first?.title, "") @@ -447,6 +475,109 @@ final class XCSchemeIntegrationTests: XCTestCase { XCTAssertTrue(launchCLIArgs.arguments[0].enabled) XCTAssertNil(scheme.launchAction?.customLLDBInitFile) } + + private func assert(runnableWithoutBuildableReferenceScheme scheme: XCScheme) { + XCTAssertEqual(scheme.version, "2.0") + XCTAssertEqual(scheme.lastUpgradeVersion, "1230", "\(scheme.lastUpgradeVersion!) not equals 1230") + + // Build action + XCTAssertTrue(scheme.buildAction?.parallelizeBuild == true) + XCTAssertTrue(scheme.buildAction?.buildImplicitDependencies == true) + XCTAssertNil(scheme.buildAction?.runPostActionsOnFailure) + XCTAssertEqual(scheme.buildAction?.buildActionEntries.count, 2) + XCTAssertTrue(scheme.buildAction?.buildActionEntries[0].buildFor.contains(.testing) == true) + XCTAssertTrue(scheme.buildAction?.buildActionEntries[0].buildFor.contains(.running) == true) + XCTAssertTrue(scheme.buildAction?.buildActionEntries[0].buildFor.contains(.profiling) == true) + XCTAssertTrue(scheme.buildAction?.buildActionEntries[0].buildFor.contains(.archiving) == true) + XCTAssertTrue(scheme.buildAction?.buildActionEntries[0].buildFor.contains(.analyzing) == true) + XCTAssertEqual(scheme.buildAction?.buildActionEntries[0].buildableReference.buildableIdentifier, "primary") + XCTAssertEqual(scheme.buildAction?.buildActionEntries[0].buildableReference.blueprintIdentifier, "FE7C11D21B6DB70D0041DF02") + XCTAssertEqual(scheme.buildAction?.buildActionEntries[0].buildableReference.buildableName, "Ava.app") + XCTAssertEqual(scheme.buildAction?.buildActionEntries[0].buildableReference.blueprintName, "core-ava") + XCTAssertEqual(scheme.buildAction?.buildActionEntries[0].buildableReference.referencedContainer, "container:core-ava.xcodeproj") + + XCTAssertTrue(scheme.buildAction?.buildActionEntries[1].buildFor.contains(.testing) == true) + XCTAssertTrue(scheme.buildAction?.buildActionEntries[1].buildFor.contains(.running) == false) + XCTAssertTrue(scheme.buildAction?.buildActionEntries[1].buildFor.contains(.profiling) == false) + XCTAssertTrue(scheme.buildAction?.buildActionEntries[1].buildFor.contains(.archiving) == false) + XCTAssertTrue(scheme.buildAction?.buildActionEntries[1].buildFor.contains(.analyzing) == false) + XCTAssertEqual(scheme.buildAction?.buildActionEntries[1].buildableReference.buildableIdentifier, "primary") + XCTAssertEqual(scheme.buildAction?.buildActionEntries[1].buildableReference.blueprintIdentifier, "9942115E25C4D3B7000711CE") + XCTAssertEqual(scheme.buildAction?.buildActionEntries[1].buildableReference.buildableName, "AvaTests.xctest") + XCTAssertEqual(scheme.buildAction?.buildActionEntries[1].buildableReference.blueprintName, "AvaTests") + XCTAssertEqual(scheme.buildAction?.buildActionEntries[1].buildableReference.referencedContainer, "container:core-ava.xcodeproj") + + // Test action + XCTAssertEqual(scheme.testAction?.buildConfiguration, "Debug") + XCTAssertEqual(scheme.testAction?.selectedDebuggerIdentifier, "Xcode.DebuggerFoundation.Debugger.LLDB") + XCTAssertEqual(scheme.testAction?.selectedLauncherIdentifier, "Xcode.DebuggerFoundation.Launcher.LLDB") + XCTAssertTrue(scheme.testAction?.shouldUseLaunchSchemeArgsEnv == true) + XCTAssertTrue(scheme.testAction?.codeCoverageEnabled == false) + XCTAssertEqual(scheme.testAction?.onlyGenerateCoverageForSpecifiedTargets, nil) + XCTAssertNil(scheme.testAction?.macroExpansion) + XCTAssertEqual(scheme.testAction?.enableAddressSanitizer, false) + XCTAssertEqual(scheme.testAction?.enableASanStackUseAfterReturn, false) + XCTAssertEqual(scheme.testAction?.enableThreadSanitizer, false) + XCTAssertEqual(scheme.testAction?.enableUBSanitizer, false) + XCTAssertEqual(scheme.testAction?.disableMainThreadChecker, false) + XCTAssertEqual(scheme.testAction?.additionalOptions.isEmpty, true) + XCTAssertNil(scheme.testAction?.commandlineArguments) + XCTAssertNil(scheme.testAction?.environmentVariables) + + // Launch action + XCTAssertEqual(scheme.launchAction?.selectedDebuggerIdentifier, XCScheme.defaultDebugger) + XCTAssertEqual(scheme.launchAction?.selectedLauncherIdentifier, XCScheme.defaultLauncher) + XCTAssertEqual(scheme.launchAction?.buildConfiguration, "Staging") + XCTAssertEqual(scheme.launchAction?.launchStyle, XCScheme.LaunchAction.Style.auto) + XCTAssertTrue(scheme.launchAction?.askForAppToLaunch == true) + XCTAssertTrue(scheme.launchAction?.useCustomWorkingDirectory == false) + XCTAssertTrue(scheme.launchAction?.ignoresPersistentStateOnLaunch == false) + XCTAssertTrue(scheme.launchAction?.debugDocumentVersioning == true) + XCTAssertEqual(scheme.launchAction?.debugServiceExtension, XCScheme.LaunchAction.defaultDebugServiceExtension) + XCTAssertTrue(scheme.launchAction?.allowLocationSimulation == true) + XCTAssertNil(scheme.launchAction?.locationScenarioReference) + XCTAssertNil(scheme.launchAction?.commandlineArguments) + XCTAssertEqual(scheme.launchAction?.enableAddressSanitizer, false) + XCTAssertEqual(scheme.launchAction?.enableASanStackUseAfterReturn, false) + XCTAssertEqual(scheme.launchAction?.enableThreadSanitizer, false) + XCTAssertEqual(scheme.launchAction?.stopOnEveryThreadSanitizerIssue, false) + XCTAssertEqual(scheme.launchAction?.enableUBSanitizer, false) + XCTAssertEqual(scheme.launchAction?.stopOnEveryUBSanitizerIssue, false) + XCTAssertEqual(scheme.launchAction?.disableMainThreadChecker, false) + XCTAssertEqual(scheme.launchAction?.stopOnEveryMainThreadCheckerIssue, false) + XCTAssertEqual(scheme.launchAction?.additionalOptions.isEmpty, true) + XCTAssertNil(scheme.launchAction?.storeKitConfigurationFileReference) + XCTAssertEqual(scheme.launchAction?.macroExpansion?.buildableIdentifier, "primary") + XCTAssertEqual(scheme.launchAction?.macroExpansion?.blueprintIdentifier, "FE7C11D21B6DB70D0041DF02") + XCTAssertEqual(scheme.launchAction?.macroExpansion?.buildableName, "Ava.app") + XCTAssertEqual(scheme.launchAction?.macroExpansion?.blueprintName, "core-ava") + XCTAssertEqual(scheme.launchAction?.macroExpansion?.referencedContainer, "container:core-ava.xcodeproj") + XCTAssertNil(scheme.launchAction?.environmentVariables) + + // Profile action + XCTAssertEqual(scheme.profileAction?.buildableProductRunnable?.runnableDebuggingMode, "0") + XCTAssertEqual(scheme.profileAction?.buildableProductRunnable?.buildableReference?.blueprintIdentifier, "FE7C11D21B6DB70D0041DF02") + XCTAssertEqual(scheme.profileAction?.buildableProductRunnable?.buildableReference?.buildableIdentifier, "primary") + XCTAssertEqual(scheme.profileAction?.buildableProductRunnable?.buildableReference?.blueprintName, "core-ava") + XCTAssertEqual(scheme.profileAction?.buildableProductRunnable?.buildableReference?.buildableName, "Ava.app") + XCTAssertEqual(scheme.profileAction?.buildableProductRunnable?.buildableReference?.referencedContainer, "container:core-ava.xcodeproj") + XCTAssertEqual(scheme.profileAction?.buildConfiguration, "Release") + XCTAssertTrue(scheme.profileAction?.shouldUseLaunchSchemeArgsEnv == true) + XCTAssertEqual(scheme.profileAction?.savedToolIdentifier, "") + XCTAssertTrue(scheme.profileAction?.useCustomWorkingDirectory == false) + XCTAssertTrue(scheme.profileAction?.debugDocumentVersioning == true) + XCTAssertNil(scheme.profileAction?.askForAppToLaunch) + XCTAssertNil(scheme.profileAction?.commandlineArguments) + XCTAssertNil(scheme.profileAction?.environmentVariables) + + // Analyze action + XCTAssertEqual(scheme.analyzeAction?.buildConfiguration, "Debug") + + // Archive action + XCTAssertEqual(scheme.archiveAction?.buildConfiguration, "Release") + XCTAssertTrue(scheme.archiveAction?.revealArchiveInOrganizer == true) + XCTAssertNil(scheme.archiveAction?.customArchiveName) + } private func assert(minimalScheme scheme: XCScheme) { XCTAssertEqual(scheme.version, "1.3") @@ -557,6 +688,10 @@ final class XCSchemeIntegrationTests: XCTestCase { // but minimal in the sense it doesn't have most of the standard elements and attributes. fixturesPath() + "Schemes/MinimalInformation.xcscheme" } + + private var runnableWithoutBuildableReferenceSchemePath: Path { + fixturesPath() + "Schemes/RunnableWithoutBuildableReference.xcscheme" + } /// Path to a scheme with a buildable reference that contains no blueprint identifier private var noBlueprintIDPath: Path { From 3a93b47a34860a4d7dbcd9cc0ae8e9543c179c61 Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Mon, 13 Sep 2021 12:04:58 +0200 Subject: [PATCH 150/678] docs: add subdan as a contributor for code (#640) * docs: update README.md [skip ci] * docs: update .all-contributorsrc [skip ci] Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com> --- .all-contributorsrc | 9 +++++++++ README.md | 3 ++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/.all-contributorsrc b/.all-contributorsrc index 559bfa24b..e0b6f7aaa 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -103,6 +103,15 @@ "contributions": [ "code" ] + }, + { + "login": "subdan", + "name": "Daniil Subbotin", + "avatar_url": "https://avatars.githubusercontent.com/u/410293?v=4", + "profile": "https://github.com/subdan", + "contributions": [ + "code" + ] } ], "contributorsPerLine": 7, diff --git a/README.md b/README.md index 3fd40cd99..2078db907 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # XcodeProj -[![All Contributors](https://img.shields.io/badge/all_contributors-11-orange.svg?style=flat-square)](#contributors-) +[![All Contributors](https://img.shields.io/badge/all_contributors-12-orange.svg?style=flat-square)](#contributors-) [![Swift Package Manager](https://img.shields.io/badge/swift%20package%20manager-compatible-brightgreen.svg)](https://swift.org/package-manager/) @@ -168,6 +168,7 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
Yuya Oka

💻
Keith Smiley

🖋
Ian Leitch

💻 +
Daniil Subbotin

💻 From ea4c39763f2e65177085e2df3fe9c656cb7d25a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20Pi=C3=B1era?= Date: Mon, 13 Sep 2021 12:06:09 +0200 Subject: [PATCH 151/678] Update CHANGELOG --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index aa2d84366..a4c21cd9d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,10 @@ ### Added - Support obtaining the full path of a file element by passing the source root as a string [#624](https://github.com/tuist/XcodeProj/pull/624) by [@ileitch](https://github.com/ileitch). + +### Fixed + +- If RemoteRunnable doesn't contains BuildableReference XcodeProj removes xcscheme file [#627](https://github.com/tuist/XcodeProj/pull/627) by [@subdan](https://github.com/subdan). ## 8.1.0 - Barcelona ### Changed From 73828de6e565d5f2ee17a67e6c1cc3d1ce4c1299 Mon Sep 17 00:00:00 2001 From: Yuya Oka Date: Mon, 13 Sep 2021 19:07:12 +0900 Subject: [PATCH 152/678] Update AEXML v4.6.1 (#632) * Update AEXML v4.6.1 * Remove .swift-version --- .swift-version | 1 - Cartfile | 2 +- Cartfile.resolved | 2 +- Package.resolved | 4 ++-- Package.swift | 2 +- xcodeproj.podspec | 2 +- 6 files changed, 6 insertions(+), 7 deletions(-) delete mode 100644 .swift-version diff --git a/.swift-version b/.swift-version deleted file mode 100644 index a75b92f1e..000000000 --- a/.swift-version +++ /dev/null @@ -1 +0,0 @@ -5.1 diff --git a/Cartfile b/Cartfile index dfc7532ed..89344226f 100644 --- a/Cartfile +++ b/Cartfile @@ -1,2 +1,2 @@ github "tuist/PathKit" == 1.0.0 -github "tadija/AEXML" == 4.6.0 +github "tadija/AEXML" == 4.6.1 diff --git a/Cartfile.resolved b/Cartfile.resolved index e53ee3616..25e945995 100644 --- a/Cartfile.resolved +++ b/Cartfile.resolved @@ -1,2 +1,2 @@ -github "tadija/AEXML" "4.6.0" +github "tadija/AEXML" "4.6.1" github "tuist/PathKit" "1.0.0" diff --git a/Package.resolved b/Package.resolved index cd537a787..123c89ef4 100644 --- a/Package.resolved +++ b/Package.resolved @@ -6,8 +6,8 @@ "repositoryURL": "https://github.com/tadija/AEXML", "state": { "branch": null, - "revision": "8623e73b193386909566a9ca20203e33a09af142", - "version": "4.5.0" + "revision": "38f7d00b23ecd891e1ee656fa6aeebd6ba04ecc3", + "version": "4.6.1" } }, { diff --git a/Package.swift b/Package.swift index 95e46cdf7..147f14d3f 100644 --- a/Package.swift +++ b/Package.swift @@ -8,7 +8,7 @@ let package = Package( .library(name: "XcodeProj", targets: ["XcodeProj"]), ], dependencies: [ - .package(url: "https://github.com/tadija/AEXML", .upToNextMinor(from: "4.5.0")), + .package(url: "https://github.com/tadija/AEXML", .upToNextMinor(from: "4.6.1")), .package(url: "https://github.com/kylef/PathKit", .upToNextMinor(from: "1.0.0")), ], targets: [ diff --git a/xcodeproj.podspec b/xcodeproj.podspec index 66b0bea86..448e5304b 100644 --- a/xcodeproj.podspec +++ b/xcodeproj.podspec @@ -15,5 +15,5 @@ Pod::Spec.new do |s| s.module_name = 'XcodeProj' s.dependency 'PathKit', '~> 1.0.0' - s.dependency 'AEXML', '~> 4.6.0' + s.dependency 'AEXML', '~> 4.6.1' end From 2a610ab477634c8e375ba65602d2bfbf6ca012f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20Pi=C3=B1era=20Buend=C3=ADa?= Date: Mon, 13 Sep 2021 12:09:58 +0200 Subject: [PATCH 153/678] Update README.md --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index 2078db907..af9a9e068 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,6 @@ [![Swift Package Manager](https://img.shields.io/badge/swift%20package%20manager-compatible-brightgreen.svg)](https://swift.org/package-manager/) [![Release](https://img.shields.io/github/release/tuist/xcodeproj.svg)](https://github.com/tuist/xcodeproj/releases) [![Code Coverage](https://codecov.io/gh/tuist/xcodeproj/branch/main/graph/badge.svg)](https://codecov.io/gh/tuist/xcodeproj) -[![Slack](http://slack.tuist.io/badge.svg)](http://slack.tuist.io/) [![License](https://img.shields.io/badge/License-MIT-yellow.svg)](https://github.com/tuist/xcodeproj/blob/main/LICENSE.md) XcodeProj is a library written in Swift for parsing and working with Xcode projects. It's heavily inspired by [CocoaPods XcodeProj](https://github.com/CocoaPods/Xcodeproj) and [xcode](https://www.npmjs.com/package/xcode). From 5c9d987e32da7a0dca21fc09afb7a0a7591d9de7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20Pi=C3=B1era?= Date: Mon, 13 Sep 2021 12:09:31 +0200 Subject: [PATCH 154/678] CI improvements --- .github/workflows/checks.yml | 15 --------------- .../workflows/{package.yml => xcodeproj.yml} | 19 ++++++++++++++++--- CHANGELOG.md | 4 ++++ 3 files changed, 20 insertions(+), 18 deletions(-) delete mode 100644 .github/workflows/checks.yml rename .github/workflows/{package.yml => xcodeproj.yml} (72%) diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml deleted file mode 100644 index 65d4a0e02..000000000 --- a/.github/workflows/checks.yml +++ /dev/null @@ -1,15 +0,0 @@ -# https://help.github.com/en/github/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#jobsjob_idname -name: Checks - -on: [push, pull_request] - -jobs: - swiftlint: - name: Swiftlint - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v1 - - name: GitHub Action for SwiftLint - uses: pepibumur/action-swiftlint@0d4afd006bb24e4525b5afcefd4ab5e2537193ac - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/package.yml b/.github/workflows/xcodeproj.yml similarity index 72% rename from .github/workflows/package.yml rename to .github/workflows/xcodeproj.yml index b1af51c6d..56021a382 100644 --- a/.github/workflows/package.yml +++ b/.github/workflows/xcodeproj.yml @@ -1,15 +1,19 @@ # https://help.github.com/en/github/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#jobsjob_idname -name: Package +name: XcodeProj on: [push, pull_request] +concurrency: + group: xcodeproj-${{ github.head_ref }} + cancel-in-progress: true + jobs: build: name: Build (macOS) runs-on: macos-latest strategy: matrix: - xcode: ["11.3", "11.3.1", "11.4"] + xcode: ["11.3", "11.3.1", "11.4", "12.0.1", "12.4", "12.5.1"] steps: - uses: actions/checkout@v1 - name: Select Xcode ${{ matrix.xcode }} @@ -28,7 +32,7 @@ jobs: runs-on: macos-latest strategy: matrix: - xcode: ["11.3", "11.3.1", "11.4", "12.0.1"] + xcode: ["11.3", "11.3.1", "11.4", "12.0.1", "12.4", "12.5.1"] steps: - uses: actions/checkout@v1 - name: Select Xcode ${{ matrix.xcode }} @@ -46,3 +50,12 @@ jobs: - uses: actions/checkout@v1 - name: Build and run tests run: swift test --enable-test-discovery + swiftlint: + name: Swiftlint + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v1 + - name: GitHub Action for SwiftLint + uses: pepibumur/action-swiftlint@0d4afd006bb24e4525b5afcefd4ab5e2537193ac + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/CHANGELOG.md b/CHANGELOG.md index a4c21cd9d..cc5c56e36 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,10 @@ ### Fixed - If RemoteRunnable doesn't contains BuildableReference XcodeProj removes xcscheme file [#627](https://github.com/tuist/XcodeProj/pull/627) by [@subdan](https://github.com/subdan). + +### Changed + +- Updated AEXML to 4.6.1 [#632](https://github.com/tuist/XcodeProj/pull/632) by [@nnsnodnb](https://github.com/nnsnodnb). ## 8.1.0 - Barcelona ### Changed From 8e83191dba8bcbfc0be4d7c48bf1e02e7fedc88c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20Pi=C3=B1era?= Date: Mon, 13 Sep 2021 12:11:41 +0200 Subject: [PATCH 155/678] Version 8.2.0 --- CHANGELOG.md | 1 + README.md | 8 ++++---- xcodeproj.podspec | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cc5c56e36..af7c6e098 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ ## Next +### 8.2.0 - Bubbles ### Added - Support obtaining the full path of a file element by passing the source root as a string [#624](https://github.com/tuist/XcodeProj/pull/624) by [@ileitch](https://github.com/ileitch). diff --git a/README.md b/README.md index af9a9e068..359856fc9 100644 --- a/README.md +++ b/README.md @@ -48,7 +48,7 @@ Add the dependency in your `Package.swift` file: let package = Package( name: "myproject", dependencies: [ - .package(url: "https://github.com/tuist/XcodeProj.git", .upToNextMajor(from: "8.1.0")), + .package(url: "https://github.com/tuist/XcodeProj.git", .upToNextMajor(from: "8.2.0")), ], targets: [ .target( @@ -64,13 +64,13 @@ let package = Package( ```bash # Cartfile -github "tuist/xcodeproj" ~> 8.1.0 +github "tuist/xcodeproj" ~> 8.2.0 ``` ### CocoaPods ```ruby -pod 'xcodeproj', '~> 8.1.0 +pod 'xcodeproj', '~> 8.2.0 ``` ### Scripting @@ -82,7 +82,7 @@ git tag that represents the project’s version: ```swift #!/usr/bin/swift sh import Foundation -import XcodeProj // @tuist ~> 8.1.0 +import XcodeProj // @tuist ~> 8.2.0 import PathKit guard CommandLine.arguments.count == 3 else { diff --git a/xcodeproj.podspec b/xcodeproj.podspec index 448e5304b..006a6eee3 100644 --- a/xcodeproj.podspec +++ b/xcodeproj.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = 'xcodeproj' - s.version = '8.1.0' + s.version = '8.2.0' s.summary = 'Read/Modify/Write your Xcode projects' s.homepage = 'https://github.com/tuist/xcodeproj' s.license = 'MIT' From 304b1d417f3da321bb29575c037f9ca61f0ec61a Mon Sep 17 00:00:00 2001 From: Florentin Bekier Date: Tue, 14 Sep 2021 21:05:48 +0200 Subject: [PATCH 156/678] Add CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED to projectAll (#641) * Add CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED to projectAll * Update CHANGELOG --- CHANGELOG.md | 4 ++++ Sources/XcodeProj/Utils/BuildSettingsProvider.swift | 1 + 2 files changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index af7c6e098..21798c40e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ ## Next +### Added + +- `CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED` to default build setting [#641](https://github.com/tuist/XcodeProj/pull/641) by [@flowbe](https://github.com/flowbe) + ### 8.2.0 - Bubbles ### Added diff --git a/Sources/XcodeProj/Utils/BuildSettingsProvider.swift b/Sources/XcodeProj/Utils/BuildSettingsProvider.swift index dbb23d314..b8c5514b6 100644 --- a/Sources/XcodeProj/Utils/BuildSettingsProvider.swift +++ b/Sources/XcodeProj/Utils/BuildSettingsProvider.swift @@ -97,6 +97,7 @@ public class BuildSettingsProvider { private static func projectAll() -> BuildSettings { [ "ALWAYS_SEARCH_USER_PATHS": "NO", + "CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED": "YES", "CLANG_ANALYZER_NONNULL": "YES", "CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION": "YES_AGGRESSIVE", "CLANG_CXX_LANGUAGE_STANDARD": "gnu++14", From 8c12577a2e07b119c85bbee118e719cc4c9f8af7 Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Tue, 14 Sep 2021 21:06:02 +0200 Subject: [PATCH 157/678] docs: add flowbe as a contributor for code (#642) * docs: update README.md [skip ci] * docs: update .all-contributorsrc [skip ci] Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com> --- .all-contributorsrc | 9 +++++++++ README.md | 3 ++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/.all-contributorsrc b/.all-contributorsrc index e0b6f7aaa..2adf733c0 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -112,6 +112,15 @@ "contributions": [ "code" ] + }, + { + "login": "flowbe", + "name": "Florentin Bekier", + "avatar_url": "https://avatars.githubusercontent.com/u/8288625?v=4", + "profile": "https://www.florentin.tech", + "contributions": [ + "code" + ] } ], "contributorsPerLine": 7, diff --git a/README.md b/README.md index 359856fc9..b4ea82a4e 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # XcodeProj -[![All Contributors](https://img.shields.io/badge/all_contributors-12-orange.svg?style=flat-square)](#contributors-) +[![All Contributors](https://img.shields.io/badge/all_contributors-13-orange.svg?style=flat-square)](#contributors-) [![Swift Package Manager](https://img.shields.io/badge/swift%20package%20manager-compatible-brightgreen.svg)](https://swift.org/package-manager/) @@ -168,6 +168,7 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
Keith Smiley

🖋
Ian Leitch

💻
Daniil Subbotin

💻 +
Florentin Bekier

💻 From a2cf76335141d28e876b91fd1e19637bc9285b86 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20Pi=C3=B1era?= Date: Fri, 17 Sep 2021 15:01:11 +0200 Subject: [PATCH 158/678] Update Package.resolved --- Package.resolved | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Package.resolved b/Package.resolved index 123c89ef4..ec3fb3842 100644 --- a/Package.resolved +++ b/Package.resolved @@ -24,8 +24,8 @@ "repositoryURL": "https://github.com/kylef/Spectre.git", "state": { "branch": null, - "revision": "f717bbce0e19f0129fc001b2b6bed43b70fd8b87", - "version": "0.9.1" + "revision": "f79d4ecbf8bc4e1579fbd86c3e1d652fb6876c53", + "version": "0.9.2" } } ] From 3a22f2f51e4317700870fcbee49bc65606d462b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20Pi=C3=B1era?= Date: Fri, 17 Sep 2021 17:28:49 +0200 Subject: [PATCH 159/678] Update pacakges --- Package.resolved | 4 ++-- Package.swift | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Package.resolved b/Package.resolved index ec3fb3842..862c225e5 100644 --- a/Package.resolved +++ b/Package.resolved @@ -3,7 +3,7 @@ "pins": [ { "package": "AEXML", - "repositoryURL": "https://github.com/tadija/AEXML", + "repositoryURL": "https://github.com/tadija/AEXML.git", "state": { "branch": null, "revision": "38f7d00b23ecd891e1ee656fa6aeebd6ba04ecc3", @@ -12,7 +12,7 @@ }, { "package": "PathKit", - "repositoryURL": "https://github.com/kylef/PathKit", + "repositoryURL": "https://github.com/kylef/PathKit.git", "state": { "branch": null, "revision": "73f8e9dca9b7a3078cb79128217dc8f2e585a511", diff --git a/Package.swift b/Package.swift index 147f14d3f..e31baf94b 100644 --- a/Package.swift +++ b/Package.swift @@ -1,4 +1,4 @@ -// swift-tools-version:5.0 +// swift-tools-version:5.2.0 import PackageDescription @@ -8,8 +8,8 @@ let package = Package( .library(name: "XcodeProj", targets: ["XcodeProj"]), ], dependencies: [ - .package(url: "https://github.com/tadija/AEXML", .upToNextMinor(from: "4.6.1")), - .package(url: "https://github.com/kylef/PathKit", .upToNextMinor(from: "1.0.0")), + .package(url: "https://github.com/tadija/AEXML.git", .upToNextMinor(from: "4.6.1")), + .package(url: "https://github.com/kylef/PathKit.git", .upToNextMinor(from: "1.0.0")), ], targets: [ .target(name: "XcodeProj", From 21ceb79854e21ac49f30fac8799b8b423c3faec7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20Pi=C3=B1era?= Date: Fri, 17 Sep 2021 17:34:10 +0200 Subject: [PATCH 160/678] Drop Xcode 11 support --- .github/workflows/xcodeproj.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/xcodeproj.yml b/.github/workflows/xcodeproj.yml index 56021a382..c15507b30 100644 --- a/.github/workflows/xcodeproj.yml +++ b/.github/workflows/xcodeproj.yml @@ -13,7 +13,7 @@ jobs: runs-on: macos-latest strategy: matrix: - xcode: ["11.3", "11.3.1", "11.4", "12.0.1", "12.4", "12.5.1"] + xcode: ["12.0.1", "12.4", "12.5.1"] steps: - uses: actions/checkout@v1 - name: Select Xcode ${{ matrix.xcode }} @@ -32,7 +32,7 @@ jobs: runs-on: macos-latest strategy: matrix: - xcode: ["11.3", "11.3.1", "11.4", "12.0.1", "12.4", "12.5.1"] + xcode: ["12.0.1", "12.4", "12.5.1"] steps: - uses: actions/checkout@v1 - name: Select Xcode ${{ matrix.xcode }} From 2ba6090fe7646e0f9438bc8179beab5c3c9ec57a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20Pi=C3=B1era?= Date: Mon, 20 Sep 2021 12:32:02 +0200 Subject: [PATCH 161/678] Replace 12.5.1 by 12.5 --- .github/workflows/xcodeproj.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/xcodeproj.yml b/.github/workflows/xcodeproj.yml index c15507b30..320868e37 100644 --- a/.github/workflows/xcodeproj.yml +++ b/.github/workflows/xcodeproj.yml @@ -13,7 +13,7 @@ jobs: runs-on: macos-latest strategy: matrix: - xcode: ["12.0.1", "12.4", "12.5.1"] + xcode: ["12.0.1", "12.4", "12.5"] steps: - uses: actions/checkout@v1 - name: Select Xcode ${{ matrix.xcode }} From 02477d7d3b093e987fef14fa274112970b013743 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20Pi=C3=B1era?= Date: Mon, 20 Sep 2021 12:44:27 +0200 Subject: [PATCH 162/678] Turn 12.5.1 into 12.5 also in the Test job --- .github/workflows/xcodeproj.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/xcodeproj.yml b/.github/workflows/xcodeproj.yml index 320868e37..a640405f5 100644 --- a/.github/workflows/xcodeproj.yml +++ b/.github/workflows/xcodeproj.yml @@ -32,7 +32,7 @@ jobs: runs-on: macos-latest strategy: matrix: - xcode: ["12.0.1", "12.4", "12.5.1"] + xcode: ["12.0.1", "12.4", "12.5"] steps: - uses: actions/checkout@v1 - name: Select Xcode ${{ matrix.xcode }} From 316fb754543b84391f7b5dd6d7694268af319faf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20Pi=C3=B1era?= Date: Mon, 20 Sep 2021 13:02:10 +0200 Subject: [PATCH 163/678] Run on macOS 11 --- .github/workflows/xcodeproj.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/xcodeproj.yml b/.github/workflows/xcodeproj.yml index a640405f5..e74f6860f 100644 --- a/.github/workflows/xcodeproj.yml +++ b/.github/workflows/xcodeproj.yml @@ -10,10 +10,10 @@ concurrency: jobs: build: name: Build (macOS) - runs-on: macos-latest + runs-on: macos-11 strategy: matrix: - xcode: ["12.0.1", "12.4", "12.5"] + xcode: ["12.4", "12.5"] steps: - uses: actions/checkout@v1 - name: Select Xcode ${{ matrix.xcode }} @@ -29,10 +29,10 @@ jobs: run: swift build -c release test: name: Test (macOS) - runs-on: macos-latest + runs-on: macos-11 strategy: matrix: - xcode: ["12.0.1", "12.4", "12.5"] + xcode: ["12.4", "12.5"] steps: - uses: actions/checkout@v1 - name: Select Xcode ${{ matrix.xcode }} From 2c89f5c624178170268a5126a4d5a38f61ded639 Mon Sep 17 00:00:00 2001 From: Vadim Smal Date: Mon, 20 Sep 2021 12:09:45 +0100 Subject: [PATCH 164/678] Fix Xcode 13 build error (#643) Co-authored-by: Vadim Smal --- Sources/XcodeProj/Extensions/Path+Extras.swift | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Sources/XcodeProj/Extensions/Path+Extras.swift b/Sources/XcodeProj/Extensions/Path+Extras.swift index 9a20677cd..5b7c70d21 100644 --- a/Sources/XcodeProj/Extensions/Path+Extras.swift +++ b/Sources/XcodeProj/Extensions/Path+Extras.swift @@ -24,7 +24,10 @@ extension Path { /// - Returns: found directories and files. func glob(_ pattern: String) -> [Path] { var gt = glob_t() - let cPattern = strdup((self + pattern).string) + guard let cPattern = strdup((self + pattern).string) else { + globfree(>) + return [] + } defer { globfree(>) free(cPattern) From c2994d3194950cb8e2ca11f624f4dabf78296b3d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20Pi=C3=B1era?= Date: Mon, 20 Sep 2021 13:15:10 +0200 Subject: [PATCH 165/678] Revert "Fix Xcode 13 build error (#643)" This reverts commit 2c89f5c624178170268a5126a4d5a38f61ded639. --- Sources/XcodeProj/Extensions/Path+Extras.swift | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/Sources/XcodeProj/Extensions/Path+Extras.swift b/Sources/XcodeProj/Extensions/Path+Extras.swift index 5b7c70d21..9a20677cd 100644 --- a/Sources/XcodeProj/Extensions/Path+Extras.swift +++ b/Sources/XcodeProj/Extensions/Path+Extras.swift @@ -24,10 +24,7 @@ extension Path { /// - Returns: found directories and files. func glob(_ pattern: String) -> [Path] { var gt = glob_t() - guard let cPattern = strdup((self + pattern).string) else { - globfree(>) - return [] - } + let cPattern = strdup((self + pattern).string) defer { globfree(>) free(cPattern) From ada359887322a84895b1ea70875b1b8d0f89d508 Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Mon, 20 Sep 2021 13:15:52 +0200 Subject: [PATCH 166/678] docs: add CognitiveDisson as a contributor for bug (#645) * docs: update README.md [skip ci] * docs: update .all-contributorsrc [skip ci] Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com> --- .all-contributorsrc | 9 +++++++++ README.md | 3 ++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/.all-contributorsrc b/.all-contributorsrc index 2adf733c0..564054c2f 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -121,6 +121,15 @@ "contributions": [ "code" ] + }, + { + "login": "CognitiveDisson", + "name": "Vadim Smal", + "avatar_url": "https://avatars.githubusercontent.com/u/10621118?v=4", + "profile": "https://github.com/CognitiveDisson", + "contributions": [ + "bug" + ] } ], "contributorsPerLine": 7, diff --git a/README.md b/README.md index b4ea82a4e..ea5d3a5d5 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # XcodeProj -[![All Contributors](https://img.shields.io/badge/all_contributors-13-orange.svg?style=flat-square)](#contributors-) +[![All Contributors](https://img.shields.io/badge/all_contributors-14-orange.svg?style=flat-square)](#contributors-) [![Swift Package Manager](https://img.shields.io/badge/swift%20package%20manager-compatible-brightgreen.svg)](https://swift.org/package-manager/) @@ -169,6 +169,7 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
Ian Leitch

💻
Daniil Subbotin

💻
Florentin Bekier

💻 +
Vadim Smal

🐛 From 24a61fbf9fe790ec65a50a13d29fa80328ba7de4 Mon Sep 17 00:00:00 2001 From: Jared Sorge Date: Wed, 22 Sep 2021 23:34:14 -0700 Subject: [PATCH 167/678] Update package dependencies (#646) --- Package.resolved | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Package.resolved b/Package.resolved index 862c225e5..234bed8df 100644 --- a/Package.resolved +++ b/Package.resolved @@ -15,8 +15,8 @@ "repositoryURL": "https://github.com/kylef/PathKit.git", "state": { "branch": null, - "revision": "73f8e9dca9b7a3078cb79128217dc8f2e585a511", - "version": "1.0.0" + "revision": "3bfd2737b700b9a36565a8c94f4ad2b050a5e574", + "version": "1.0.1" } }, { @@ -24,8 +24,8 @@ "repositoryURL": "https://github.com/kylef/Spectre.git", "state": { "branch": null, - "revision": "f79d4ecbf8bc4e1579fbd86c3e1d652fb6876c53", - "version": "0.9.2" + "revision": "26cc5e9ae0947092c7139ef7ba612e34646086c7", + "version": "0.10.1" } } ] From 56af16e4237215b447f8ab72c737c494a3a20c97 Mon Sep 17 00:00:00 2001 From: fortmarek Date: Thu, 23 Sep 2021 08:37:39 +0200 Subject: [PATCH 168/678] Version 8.3.0 --- CHANGELOG.md | 5 +++++ README.md | 8 ++++---- xcodeproj.podspec | 2 +- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 21798c40e..c5561bdb4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,10 +2,15 @@ ## Next +### 8.3.0 - Mojo ### Added - `CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED` to default build setting [#641](https://github.com/tuist/XcodeProj/pull/641) by [@flowbe](https://github.com/flowbe) +### Fixed + +- Xcode 13 build issues [#646](https://github.com/tuist/XcodeProj/pull/646) by [@jsorge](https://github.com/jsorge) + ### 8.2.0 - Bubbles ### Added diff --git a/README.md b/README.md index ea5d3a5d5..df41198e1 100644 --- a/README.md +++ b/README.md @@ -48,7 +48,7 @@ Add the dependency in your `Package.swift` file: let package = Package( name: "myproject", dependencies: [ - .package(url: "https://github.com/tuist/XcodeProj.git", .upToNextMajor(from: "8.2.0")), + .package(url: "https://github.com/tuist/XcodeProj.git", .upToNextMajor(from: "8.3.0")), ], targets: [ .target( @@ -64,13 +64,13 @@ let package = Package( ```bash # Cartfile -github "tuist/xcodeproj" ~> 8.2.0 +github "tuist/xcodeproj" ~> 8.3.0 ``` ### CocoaPods ```ruby -pod 'xcodeproj', '~> 8.2.0 +pod 'xcodeproj', '~> 8.3.0 ``` ### Scripting @@ -82,7 +82,7 @@ git tag that represents the project’s version: ```swift #!/usr/bin/swift sh import Foundation -import XcodeProj // @tuist ~> 8.2.0 +import XcodeProj // @tuist ~> 8.3.0 import PathKit guard CommandLine.arguments.count == 3 else { diff --git a/xcodeproj.podspec b/xcodeproj.podspec index 006a6eee3..64a7ef958 100644 --- a/xcodeproj.podspec +++ b/xcodeproj.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = 'xcodeproj' - s.version = '8.2.0' + s.version = '8.3.0' s.summary = 'Read/Modify/Write your Xcode projects' s.homepage = 'https://github.com/tuist/xcodeproj' s.license = 'MIT' From acfe03a35cfc438ef9adb2e1b187b41926bfab78 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kry=C5=A1tof=20Mat=C4=9Bj?= Date: Thu, 23 Sep 2021 13:39:35 +0200 Subject: [PATCH 169/678] Fix Xcode 13 build (#648) --- .github/workflows/xcodeproj.yml | 4 ++-- Sources/XcodeProj/Extensions/Path+Extras.swift | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/xcodeproj.yml b/.github/workflows/xcodeproj.yml index e74f6860f..5d95e7d10 100644 --- a/.github/workflows/xcodeproj.yml +++ b/.github/workflows/xcodeproj.yml @@ -13,7 +13,7 @@ jobs: runs-on: macos-11 strategy: matrix: - xcode: ["12.4", "12.5"] + xcode: ["12.4", "12.5", "13.0"] steps: - uses: actions/checkout@v1 - name: Select Xcode ${{ matrix.xcode }} @@ -32,7 +32,7 @@ jobs: runs-on: macos-11 strategy: matrix: - xcode: ["12.4", "12.5"] + xcode: ["12.4", "12.5", "13.0"] steps: - uses: actions/checkout@v1 - name: Select Xcode ${{ matrix.xcode }} diff --git a/Sources/XcodeProj/Extensions/Path+Extras.swift b/Sources/XcodeProj/Extensions/Path+Extras.swift index 9a20677cd..b26a48976 100644 --- a/Sources/XcodeProj/Extensions/Path+Extras.swift +++ b/Sources/XcodeProj/Extensions/Path+Extras.swift @@ -24,7 +24,9 @@ extension Path { /// - Returns: found directories and files. func glob(_ pattern: String) -> [Path] { var gt = glob_t() - let cPattern = strdup((self + pattern).string) + guard let cPattern = strdup((self + pattern).string) else { + fatalError("strdup returned null: Likely out of memory") + } defer { globfree(>) free(cPattern) From 446f3a0db73e141c7f57e26fcdb043096b1db52c Mon Sep 17 00:00:00 2001 From: fortmarek Date: Thu, 23 Sep 2021 13:41:51 +0200 Subject: [PATCH 170/678] Version 8.3.1 --- CHANGELOG.md | 6 ++++++ README.md | 8 ++++---- xcodeproj.podspec | 2 +- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c5561bdb4..4b5c5f5b8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,12 @@ ## Next + +### 8.3.1 +### Fixed + +- Fix Xcode 13 build [#648](https://github.com/tuist/XcodeProj/pull/648) by [@raptorxcz](https://github.com/raptorxcz) + ### 8.3.0 - Mojo ### Added diff --git a/README.md b/README.md index df41198e1..6b27e9d64 100644 --- a/README.md +++ b/README.md @@ -48,7 +48,7 @@ Add the dependency in your `Package.swift` file: let package = Package( name: "myproject", dependencies: [ - .package(url: "https://github.com/tuist/XcodeProj.git", .upToNextMajor(from: "8.3.0")), + .package(url: "https://github.com/tuist/XcodeProj.git", .upToNextMajor(from: "8.3.1")), ], targets: [ .target( @@ -64,13 +64,13 @@ let package = Package( ```bash # Cartfile -github "tuist/xcodeproj" ~> 8.3.0 +github "tuist/xcodeproj" ~> 8.3.1 ``` ### CocoaPods ```ruby -pod 'xcodeproj', '~> 8.3.0 +pod 'xcodeproj', '~> 8.3.1 ``` ### Scripting @@ -82,7 +82,7 @@ git tag that represents the project’s version: ```swift #!/usr/bin/swift sh import Foundation -import XcodeProj // @tuist ~> 8.3.0 +import XcodeProj // @tuist ~> 8.3.1 import PathKit guard CommandLine.arguments.count == 3 else { diff --git a/xcodeproj.podspec b/xcodeproj.podspec index 64a7ef958..b479489e4 100644 --- a/xcodeproj.podspec +++ b/xcodeproj.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = 'xcodeproj' - s.version = '8.3.0' + s.version = '8.3.1' s.summary = 'Read/Modify/Write your Xcode projects' s.homepage = 'https://github.com/tuist/xcodeproj' s.license = 'MIT' From 78895f1ef01cb5a762039ad831ccb0eb413f4519 Mon Sep 17 00:00:00 2001 From: "depfu[bot]" <23717796+depfu[bot]@users.noreply.github.com> Date: Tue, 5 Oct 2021 19:26:32 +0200 Subject: [PATCH 171/678] Update jazzy to version 0.14.1 (#649) Co-authored-by: depfu[bot] <23717796+depfu[bot]@users.noreply.github.com> --- Gemfile.lock | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 3385e205c..119f197a4 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,8 @@ GEM remote: https://rubygems.org/ specs: - CFPropertyList (3.0.3) + CFPropertyList (3.0.4) + rexml activesupport (6.1.4.1) concurrent-ruby (~> 1.0, >= 1.0.2) i18n (>= 1.6, < 2) @@ -65,7 +66,7 @@ GEM httpclient (2.8.3) i18n (1.8.10) concurrent-ruby (~> 1.0) - jazzy (0.14.0) + jazzy (0.14.1) cocoapods (~> 1.5) mustache (~> 1.1) open4 (~> 1.3) @@ -88,7 +89,7 @@ GEM rake (13.0.6) redcarpet (3.5.1) rexml (3.2.5) - rouge (3.26.0) + rouge (3.26.1) ruby-macho (2.5.1) sassc (2.4.0) ffi (~> 1.9) From 5a8b1d5190b0ce59791f6d8520cb17069262e845 Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Thu, 14 Oct 2021 17:14:02 +0200 Subject: [PATCH 172/678] docs: add freddi-kit as a contributor for code (#651) * docs: update README.md [skip ci] * docs: update .all-contributorsrc [skip ci] Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com> --- .all-contributorsrc | 9 +++++++++ README.md | 5 ++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/.all-contributorsrc b/.all-contributorsrc index 564054c2f..cdbb40ca0 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -130,6 +130,15 @@ "contributions": [ "bug" ] + }, + { + "login": "freddi-kit", + "name": "freddi(Yuki Aki)", + "avatar_url": "https://avatars.githubusercontent.com/u/13707872?v=4", + "profile": "http://freddi.dev", + "contributions": [ + "code" + ] } ], "contributorsPerLine": 7, diff --git a/README.md b/README.md index 6b27e9d64..8f88f78fd 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # XcodeProj -[![All Contributors](https://img.shields.io/badge/all_contributors-14-orange.svg?style=flat-square)](#contributors-) +[![All Contributors](https://img.shields.io/badge/all_contributors-15-orange.svg?style=flat-square)](#contributors-) [![Swift Package Manager](https://img.shields.io/badge/swift%20package%20manager-compatible-brightgreen.svg)](https://swift.org/package-manager/) @@ -171,6 +171,9 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
Florentin Bekier

💻
Vadim Smal

🐛 + +
freddi(Yuki Aki)

💻 + From 49787856e91688b71c9a16fb11a77cc7be5f6366 Mon Sep 17 00:00:00 2001 From: "freddi(Yuki Aki)" Date: Fri, 15 Oct 2021 00:14:11 +0900 Subject: [PATCH 173/678] Implement custom Deriveddata path in WorkspaceSettings (#650) * implement deriveddata path in WorkspaceSettings * fix derivedDataLocationStyle to optional * add fixture test * update changelog * fix readme --- CHANGELOG.md | 3 ++ .../OriginalAbsoluteDerivedData.xcsettings | 12 ++++++ .../OriginalRelativeDerivedData.xcsettings | 12 ++++++ .../XcodeProj/Project/WorkspaceSettings.swift | 42 ++++++++++++++++++- .../Project/WorkspaceSettingsTests.swift | 18 ++++++++ 5 files changed, 86 insertions(+), 1 deletion(-) create mode 100644 Fixtures/WorkspaceSettings/OriginalAbsoluteDerivedData.xcsettings create mode 100644 Fixtures/WorkspaceSettings/OriginalRelativeDerivedData.xcsettings diff --git a/CHANGELOG.md b/CHANGELOG.md index 4b5c5f5b8..bf60ddd3c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,9 @@ ## Next +### Added + +- Support customized DerrivedData path in `WorkspaceSettings` [#650](https://github.com/tuist/XcodeProj/pull/650) by [@freddi-kit](https://github.com/freddi-kit). ### 8.3.1 ### Fixed diff --git a/Fixtures/WorkspaceSettings/OriginalAbsoluteDerivedData.xcsettings b/Fixtures/WorkspaceSettings/OriginalAbsoluteDerivedData.xcsettings new file mode 100644 index 000000000..a8063b134 --- /dev/null +++ b/Fixtures/WorkspaceSettings/OriginalAbsoluteDerivedData.xcsettings @@ -0,0 +1,12 @@ + + + + + BuildSystemType + Original + DerivedDataCustomLocation + /User/xcodeproj/DerivedData + DerivedDataLocationStyle + AbsolutePath + + diff --git a/Fixtures/WorkspaceSettings/OriginalRelativeDerivedData.xcsettings b/Fixtures/WorkspaceSettings/OriginalRelativeDerivedData.xcsettings new file mode 100644 index 000000000..236929fd8 --- /dev/null +++ b/Fixtures/WorkspaceSettings/OriginalRelativeDerivedData.xcsettings @@ -0,0 +1,12 @@ + + + + + BuildSystemType + Original + DerivedDataCustomLocation + CustomizedDerivedData + DerivedDataLocationStyle + WorkspaceRelativePath + + diff --git a/Sources/XcodeProj/Project/WorkspaceSettings.swift b/Sources/XcodeProj/Project/WorkspaceSettings.swift index 128f9f89d..8f1e51815 100644 --- a/Sources/XcodeProj/Project/WorkspaceSettings.swift +++ b/Sources/XcodeProj/Project/WorkspaceSettings.swift @@ -15,9 +15,26 @@ public class WorkspaceSettings: Codable, Equatable, Writable { /// New build system case new } + + public enum DerivedDataLocationStyle: String { + /// Default derived data + case `default` = "Default" + + /// Absolute path + case absolutePath = "AbsolutePath" + + /// Relative paht + case workspaceRelativePath = "WorkspaceRelativePath" + } /// Workspace build system. public var buildSystem: BuildSystem + + /// Workspace DerivedData directory. + public var derivedDataLocationStyle: DerivedDataLocationStyle? + + /// Path to workspace DerivedData directory. + public var derivedDataCustomLocation: String? /// When true, Xcode auto-creates schemes in the project. public var autoCreateSchemes: Bool? @@ -27,6 +44,8 @@ public class WorkspaceSettings: Codable, Equatable, Writable { /// - buildSystem: Build system. enum CodingKeys: String, CodingKey { case buildSystem = "BuildSystemType" + case derivedDataLocationStyle = "DerivedDataLocationStyle" + case derivedDataCustomLocation = "DerivedDataCustomLocation" case autoCreateSchemes = "IDEWorkspaceSharedSettings_AutocreateContextsIfNeeded" } @@ -34,10 +53,16 @@ public class WorkspaceSettings: Codable, Equatable, Writable { /// /// - Parameters: /// - buildSystem: Workspace build system. + /// - derivedDataLocationStyle: Workspace DerivedData directory. + /// - derivedDataCustomLocation: Path to workspace DerivedData directory. /// - autoCreateSchemes: When true, Xcode auto-creates schemes in the project. init(buildSystem: BuildSystem = .new, + derivedDataLocationStyle: DerivedDataLocationStyle? = nil, + derivedDataCustomLocation: String? = nil, autoCreateSchemes: Bool? = nil) { self.buildSystem = buildSystem + self.derivedDataLocationStyle = derivedDataLocationStyle + self.derivedDataCustomLocation = derivedDataCustomLocation self.autoCreateSchemes = autoCreateSchemes } @@ -53,6 +78,13 @@ public class WorkspaceSettings: Codable, Equatable, Writable { } else { buildSystem = .new } + if let derivedDataLocationStyleString: String = try container.decodeIfPresent(.derivedDataLocationStyle), + let derivedDataLocationStyle = DerivedDataLocationStyle(rawValue: derivedDataLocationStyleString) { + self.derivedDataLocationStyle = derivedDataLocationStyle + } else { + derivedDataLocationStyle = .default + } + derivedDataCustomLocation = try container.decodeIfPresent(.derivedDataCustomLocation) autoCreateSchemes = try container.decodeIfPresent(.autoCreateSchemes) } @@ -65,6 +97,12 @@ public class WorkspaceSettings: Codable, Equatable, Writable { if buildSystem == .original { try container.encode(buildSystem.rawValue, forKey: .buildSystem) } + if let derivedDataLocationStyle = derivedDataLocationStyle { + try container.encode(derivedDataLocationStyle.rawValue, forKey: .derivedDataLocationStyle) + } + if let derivedDataCustomLocation = derivedDataCustomLocation { + try container.encode(derivedDataCustomLocation, forKey: .derivedDataCustomLocation) + } if let autoCreateSchemes = autoCreateSchemes { try container.encode(autoCreateSchemes, forKey: .autoCreateSchemes) } @@ -92,7 +130,9 @@ public class WorkspaceSettings: Codable, Equatable, Writable { /// - Returns: True if the two instances are the same. public static func == (lhs: WorkspaceSettings, rhs: WorkspaceSettings) -> Bool { lhs.buildSystem == rhs.buildSystem && - lhs.autoCreateSchemes == rhs.autoCreateSchemes + lhs.autoCreateSchemes == rhs.autoCreateSchemes && + lhs.derivedDataLocationStyle == rhs.derivedDataLocationStyle && + lhs.derivedDataCustomLocation == rhs.derivedDataCustomLocation } /// Writes the workspace settings. diff --git a/Tests/XcodeProjTests/Project/WorkspaceSettingsTests.swift b/Tests/XcodeProjTests/Project/WorkspaceSettingsTests.swift index 8ae3e1816..9e55a425e 100644 --- a/Tests/XcodeProjTests/Project/WorkspaceSettingsTests.swift +++ b/Tests/XcodeProjTests/Project/WorkspaceSettingsTests.swift @@ -23,6 +23,20 @@ final class WorkspaceSettingsTests: XCTestCase { XCTAssertTrue(got.autoCreateSchemes == true) } + func test_init_when_relative_derivedData_is_enabled() throws { + let path = fixturesPath() + "WorkspaceSettings/OriginalRelativeDerivedData.xcsettings" + let got = try WorkspaceSettings.at(path: path) + XCTAssertTrue(got.derivedDataCustomLocation == "CustomizedDerivedData") + XCTAssertTrue(got.derivedDataLocationStyle == .workspaceRelativePath) + } + + func test_init_when_absolute_derivedData_is_enabled() throws { + let path = fixturesPath() + "WorkspaceSettings/OriginalAbsoluteDerivedData.xcsettings" + let got = try WorkspaceSettings.at(path: path) + XCTAssertTrue(got.derivedDataCustomLocation == "/User/xcodeproj/DerivedData") + XCTAssertTrue(got.derivedDataLocationStyle == .absolutePath) + } + func test_equals() { let lhs = WorkspaceSettings(buildSystem: .new) let rhs = WorkspaceSettings(buildSystem: .original) @@ -36,10 +50,14 @@ final class WorkspaceSettingsTests: XCTestCase { var settings = try WorkspaceSettings.at(path: path) settings.buildSystem = .original + settings.derivedDataLocationStyle = .workspaceRelativePath + settings.derivedDataCustomLocation = "DerivedData" try settings.write(path: copyPath, override: true) settings = try WorkspaceSettings.at(path: copyPath) XCTAssertEqual(settings.buildSystem, .original) + XCTAssertEqual(settings.derivedDataLocationStyle, .workspaceRelativePath) + XCTAssertEqual(settings.derivedDataCustomLocation, "DerivedData") } } } From 1330d6d6fa9b7932eca8c688f98d298443e78821 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20Pi=C3=B1era?= Date: Thu, 14 Oct 2021 17:15:41 +0200 Subject: [PATCH 174/678] Version 8.4.0 --- CHANGELOG.md | 2 +- README.md | 8 ++++---- xcodeproj.podspec | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bf60ddd3c..b91650011 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,7 @@ 🚀 Check out the guidelines [here](https://tuist.io/docs/contribution/changelog-guidelines/) ## Next - +### 8.4.0 ### Added - Support customized DerrivedData path in `WorkspaceSettings` [#650](https://github.com/tuist/XcodeProj/pull/650) by [@freddi-kit](https://github.com/freddi-kit). diff --git a/README.md b/README.md index 8f88f78fd..489c9231d 100644 --- a/README.md +++ b/README.md @@ -48,7 +48,7 @@ Add the dependency in your `Package.swift` file: let package = Package( name: "myproject", dependencies: [ - .package(url: "https://github.com/tuist/XcodeProj.git", .upToNextMajor(from: "8.3.1")), + .package(url: "https://github.com/tuist/XcodeProj.git", .upToNextMajor(from: "8.4.0")), ], targets: [ .target( @@ -64,13 +64,13 @@ let package = Package( ```bash # Cartfile -github "tuist/xcodeproj" ~> 8.3.1 +github "tuist/xcodeproj" ~> 8.4.0 ``` ### CocoaPods ```ruby -pod 'xcodeproj', '~> 8.3.1 +pod 'xcodeproj', '~> 8.4.0 ``` ### Scripting @@ -82,7 +82,7 @@ git tag that represents the project’s version: ```swift #!/usr/bin/swift sh import Foundation -import XcodeProj // @tuist ~> 8.3.1 +import XcodeProj // @tuist ~> 8.4.0 import PathKit guard CommandLine.arguments.count == 3 else { diff --git a/xcodeproj.podspec b/xcodeproj.podspec index b479489e4..ae025273f 100644 --- a/xcodeproj.podspec +++ b/xcodeproj.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = 'xcodeproj' - s.version = '8.3.1' + s.version = '8.4.0' s.summary = 'Read/Modify/Write your Xcode projects' s.homepage = 'https://github.com/tuist/xcodeproj' s.license = 'MIT' From 5ddd9c817382fdbf1e48c49023e299a6a0580e89 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20Pi=C3=B1era=20Buend=C3=ADa?= Date: Thu, 14 Oct 2021 18:29:10 +0200 Subject: [PATCH 175/678] Update the project to Tuist 2 (#652) --- Tuist/Config.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tuist/Config.swift b/Tuist/Config.swift index 78af64add..c482b403c 100644 --- a/Tuist/Config.swift +++ b/Tuist/Config.swift @@ -1,6 +1,6 @@ import ProjectDescription -let config = TuistConfig(generationOptions: [ +let config = Config(generationOptions: [ // If we generate the manifest target Carthage will attempt to compile it too. // .generateManifest ]) From 8998757fabaa18237994cf33af304bea8e530a0c Mon Sep 17 00:00:00 2001 From: Ikko Ashimine Date: Fri, 15 Oct 2021 02:42:39 +0900 Subject: [PATCH 176/678] Fix typo in WorkspaceSettings.swift (#653) --- Sources/XcodeProj/Project/WorkspaceSettings.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/XcodeProj/Project/WorkspaceSettings.swift b/Sources/XcodeProj/Project/WorkspaceSettings.swift index 8f1e51815..8bab7b90f 100644 --- a/Sources/XcodeProj/Project/WorkspaceSettings.swift +++ b/Sources/XcodeProj/Project/WorkspaceSettings.swift @@ -68,7 +68,7 @@ public class WorkspaceSettings: Codable, Equatable, Writable { /// Initializes the settings decoding the values from the plist representation. /// - /// - Parameter decoder: Propertly list decoder. + /// - Parameter decoder: Property list decoder. /// - Throws: An error if required attributes are missing or have a wrong type. public required init(from decoder: Decoder) throws { let container = try decoder.container(keyedBy: CodingKeys.self) From 0f76476c78184e4707863918c881404db114eb3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20Pi=C3=B1era=20Buend=C3=ADa?= Date: Fri, 15 Oct 2021 18:36:39 +0200 Subject: [PATCH 177/678] Add XCSchemeManagement struct (#565) * Add XCSchemeManagement struct * Update CHANGELOG * Address comments * Add some logs * Fix the linux tests * Set default branch * Add some logs * Store the file as an xml file --- .github/workflows/xcodeproj.yml | 5 + CHANGELOG.md | 1 + Fixtures/Schemes/xcschememanagement.plist | 29 +++ .../XcodeProj/Scheme/XCSchemeManagement.swift | 178 ++++++++++++++++++ .../Extensions/XCTestCase+Shell.swift | 25 +++ .../Project/PBXProjIntegrationTests.swift | 24 --- .../Scheme/XCSchemeManagementTests.swift | 57 ++++++ 7 files changed, 295 insertions(+), 24 deletions(-) create mode 100644 Fixtures/Schemes/xcschememanagement.plist create mode 100644 Sources/XcodeProj/Scheme/XCSchemeManagement.swift create mode 100644 Tests/XcodeProjTests/Extensions/XCTestCase+Shell.swift create mode 100644 Tests/XcodeProjTests/Scheme/XCSchemeManagementTests.swift diff --git a/.github/workflows/xcodeproj.yml b/.github/workflows/xcodeproj.yml index 5d95e7d10..e974c0e25 100644 --- a/.github/workflows/xcodeproj.yml +++ b/.github/workflows/xcodeproj.yml @@ -48,6 +48,11 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v1 + - name: Set Git config + run: | + git config --global user.email "xcodeproj@tuist.io" + git config --global user.name "xcodeproj" + git config --global init.defaultBranch main - name: Build and run tests run: swift test --enable-test-discovery swiftlint: diff --git a/CHANGELOG.md b/CHANGELOG.md index b91650011..ece92e96e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ ### Added - Support customized DerrivedData path in `WorkspaceSettings` [#650](https://github.com/tuist/XcodeProj/pull/650) by [@freddi-kit](https://github.com/freddi-kit). +- Add XCSchemeManagement struct https://github.com/tuist/XcodeProj/pull/565 by @pepibumur. ### 8.3.1 ### Fixed diff --git a/Fixtures/Schemes/xcschememanagement.plist b/Fixtures/Schemes/xcschememanagement.plist new file mode 100644 index 000000000..7a0865f0c --- /dev/null +++ b/Fixtures/Schemes/xcschememanagement.plist @@ -0,0 +1,29 @@ + + + + + SchemeUserState + + Tuist.xcscheme_^#shared#^_ + + orderHint + 0 + isShown + + + XcodeProj.xcscheme + + orderHint + 1 + + + SuppressBuildableAutocreation + + E525238B16245A900012E2BA + + primary + + + + + diff --git a/Sources/XcodeProj/Scheme/XCSchemeManagement.swift b/Sources/XcodeProj/Scheme/XCSchemeManagement.swift new file mode 100644 index 000000000..838bf4ab6 --- /dev/null +++ b/Sources/XcodeProj/Scheme/XCSchemeManagement.swift @@ -0,0 +1,178 @@ +import Foundation +import PathKit + +public enum XCSchemeManagementError: Error, Equatable, LocalizedError, CustomStringConvertible { + /// Thrown when the user tries to initialize a XCSchemeManagement instace passing a path to a file that doesn't exist. + case notFound(path: Path) + + public var description: String { + switch self { + case let .notFound(path): + return "Couldn't initialize XCSchemeManagement because the file at path \(path.string) was not found." + } + } + + public var errorDescription: String? { + return description + } +} + +/// This struct represents the xcschememanagement.plist file that is generated by Xcode +/// to attach metdata to schemes such as the order of schemes orwhether a scheme is shared or no. +/// The file is formatted as a property list file. +public struct XCSchemeManagement: Codable { + + public struct AutocreationBuildable: Equatable, Codable { + var primary: Bool + } + + /// Scheme configuration object. + public struct UserStateScheme: Equatable, Codable { + + /// Coding keys + public enum CodingKeys: String, CodingKey { + case shared + case orderHint + case isShown + case name + } + + /// Name of the scheme (with the .xcscheme extension) + public var name: String + + /// True if the scheme should be shared. + public var shared: Bool + + /// Attribute used by Xcode to sort the schemes. + public var orderHint: Int? + + /// True if the scheme should be shown in the list of schemes. + public var isShown: Bool? + + /// The key that should be used when encoding the scheme configuration. + var key: String { + var key = name + if shared { + key.append("_^#shared#^_") + } + return key + } + + /// It initializes the scheme configuration with its attributes. + /// - Parameters: + /// - name: Name of the scheme (with the .xcscheme extension) + /// - shared: True if the scheme should be shared. + /// - orderHint: Attribute used by Xcode to sort the schemes. + /// - isShown: True if the scheme should be shown in the list of schemes. + public init(name: String, + shared: Bool = false, + orderHint: Int? = nil, + isShown: Bool? = nil) { + self.name = name + self.shared = shared + self.orderHint = orderHint + self.isShown = isShown + } + + // MARK: - Codable + + public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + self.orderHint = try container.decodeIfPresent(.orderHint) + self.isShown = try container.decodeIfPresent(.isShown) + self.shared = try container.decodeIfPresent(.shared) ?? false + self.name = try container.decode(.name) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + if let orderHint = orderHint { + try container.encode(orderHint, forKey: .orderHint) + } + if let isShown = isShown { + try container.encode(isShown, forKey: .isShown) + } + } + } + + + /// Coding keys. + public enum CodingKeys: String, CodingKey { + case schemeUserState = "SchemeUserState" + case suppressBuildableAutocreation = "SuppressBuildableAutocreation" + } + + /// An array that contains the configuration of the schemes. + public var schemeUserState: [XCSchemeManagement.UserStateScheme]? + + /// A dictionary where the key is the object reference of the target, and the value the configuration for auto-creating schemes. + public var suppressBuildableAutocreation: [String: XCSchemeManagement.AutocreationBuildable]? + + + /// Default constructor. + /// - Parameters: + /// - schemeUserState: An array that contains the configuration of the schemes. + /// - suppressBuildableAutocreation: A dictionary where the key is the object reference of the target, and the value the configuration for auto-creating schemes. + public init(schemeUserState: [XCSchemeManagement.UserStateScheme]? = nil, + suppressBuildableAutocreation: [String: XCSchemeManagement.AutocreationBuildable]? = nil) { + self.schemeUserState = schemeUserState + self.suppressBuildableAutocreation = suppressBuildableAutocreation + } + + /// Initializes the XCSchemeManagement instance by parsing an existing xcschememanagement.plist + /// - Parameter path: Path to the xcschememanagement.plist file. + /// - Throws: An error if the file is malformated. + public init(path: Path) throws { + if !path.exists { + throw XCSchemeManagementError.notFound(path: path) + } + let decoder = XcodeprojPropertyListDecoder() + self = try decoder.decode(XCSchemeManagement.self, from: try path.read()) + } + + /// Converts the object into a property list and writes it at the given path. + /// - Parameter path: Path to the file where it should be written. + /// - Throws: An error if the write fails. + public func write(path: Path) throws { + let encoder = PropertyListEncoder() + encoder.outputFormat = .xml + try encoder.encode(self).write(to: path.url) + } + // MARK: - Codable + + public init(from decoder: Decoder) throws { + let plistDecoder = XcodeprojPropertyListDecoder() + let container = try decoder.container(keyedBy: CodingKeys.self) + self.suppressBuildableAutocreation = try container.decodeIfPresent(.suppressBuildableAutocreation) + if let schemeUserStateDictionary = try container.decodeIfPresent([String: Any].self, forKey: .schemeUserState) { + self.schemeUserState = try schemeUserStateDictionary.compactMap({ (key, value) -> XCSchemeManagement.UserStateScheme? in + var name = key + guard var valueDictionary = value as? [String: Any] else { return nil } + if key.contains("_^#shared#^_") { + valueDictionary["shared"] = true + name = key.replacingOccurrences(of: "_^#shared#^_", with: "") + } + valueDictionary["name"] = name + + let data = try PropertyListSerialization.data(fromPropertyList: valueDictionary, format: .xml, options: 0) + return try plistDecoder.decode(XCSchemeManagement.UserStateScheme.self, from: data) + }) + } else { + self.suppressBuildableAutocreation = nil + } + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + if let suppressBuildableAutocreation = suppressBuildableAutocreation { + try container.encode(suppressBuildableAutocreation, forKey: .suppressBuildableAutocreation) + } + + if let schemeUserState = schemeUserState { + let encodableSchemeUserState = schemeUserState + .reduce(into: [String: XCSchemeManagement.UserStateScheme]()) { $0[$1.key] = $1 } + try container.encode(encodableSchemeUserState, forKey: .schemeUserState) + } + } +} diff --git a/Tests/XcodeProjTests/Extensions/XCTestCase+Shell.swift b/Tests/XcodeProjTests/Extensions/XCTestCase+Shell.swift new file mode 100644 index 000000000..5ea654b4c --- /dev/null +++ b/Tests/XcodeProjTests/Extensions/XCTestCase+Shell.swift @@ -0,0 +1,25 @@ +import Foundation + +/// Returns the output of running `executable` with `args`. Throws an error if the process exits indicating failure. +@discardableResult +func checkedOutput(_ executable: String, _ args: [String]) throws -> String? { + let process = Process() + let output = Pipe() + + if executable.contains("/") { + process.launchPath = executable + } else { + process.launchPath = try checkedOutput("/usr/bin/which", [executable])?.trimmingCharacters(in: .newlines) + } + + process.arguments = args + process.standardOutput = output + process.launch() + process.waitUntilExit() + + guard process.terminationStatus == 0 else { + throw NSError(domain: NSPOSIXErrorDomain, code: Int(process.terminationStatus)) + } + + return String(data: output.fileHandleForReading.readDataToEndOfFile(), encoding: .utf8) +} diff --git a/Tests/XcodeProjTests/Objects/Project/PBXProjIntegrationTests.swift b/Tests/XcodeProjTests/Objects/Project/PBXProjIntegrationTests.swift index 9a672d9c0..93838e4d0 100644 --- a/Tests/XcodeProjTests/Objects/Project/PBXProjIntegrationTests.swift +++ b/Tests/XcodeProjTests/Objects/Project/PBXProjIntegrationTests.swift @@ -84,27 +84,3 @@ final class PBXProjIntegrationTests: XCTestCase { XCTAssertEqual(proj.objects.remoteSwiftPackageReferences.count, 1) } } - -/// Returns the output of running `executable` with `args`. Throws an error if the process exits indicating failure. -@discardableResult -private func checkedOutput(_ executable: String, _ args: [String]) throws -> String? { - let process = Process() - let output = Pipe() - - if executable.contains("/") { - process.launchPath = executable - } else { - process.launchPath = try checkedOutput("/usr/bin/which", [executable])?.trimmingCharacters(in: .newlines) - } - - process.arguments = args - process.standardOutput = output - process.launch() - process.waitUntilExit() - - guard process.terminationStatus == 0 else { - throw NSError(domain: NSPOSIXErrorDomain, code: Int(process.terminationStatus)) - } - - return String(data: output.fileHandleForReading.readDataToEndOfFile(), encoding: .utf8) -} diff --git a/Tests/XcodeProjTests/Scheme/XCSchemeManagementTests.swift b/Tests/XcodeProjTests/Scheme/XCSchemeManagementTests.swift new file mode 100644 index 000000000..5b42b50de --- /dev/null +++ b/Tests/XcodeProjTests/Scheme/XCSchemeManagementTests.swift @@ -0,0 +1,57 @@ +import Foundation +import XCTest +import AEXML +import PathKit +@testable import XcodeProj + +final class XCSchemeManagementTests: XCTestCase { + func test_init_from_path() throws { + // Given + let path = fixturesPath() + "Schemes/xcschememanagement.plist" + + // When + let got = try XCSchemeManagement.init(path: path) + + // Then + let autocreationTarget = try XCTUnwrap(got.suppressBuildableAutocreation?["E525238B16245A900012E2BA"]) + XCTAssertEqual(autocreationTarget.primary, true) + + let tuistScheme = try XCTUnwrap(got.schemeUserState?.first(where: {$0.name == "Tuist.xcscheme"})) + XCTAssertEqual(tuistScheme.name, "Tuist.xcscheme") + XCTAssertTrue(tuistScheme.shared) + XCTAssertEqual(tuistScheme.isShown, true) + XCTAssertEqual(tuistScheme.orderHint, 0) + + let xcodeprojScheme = try XCTUnwrap(got.schemeUserState?.first(where: {$0.name == "XcodeProj.xcscheme"})) + XCTAssertEqual(xcodeprojScheme.name, "XcodeProj.xcscheme") + XCTAssertFalse(xcodeprojScheme.shared) + XCTAssertNil(xcodeprojScheme.isShown) + XCTAssertEqual(xcodeprojScheme.orderHint, 1) + } + + func test_write_produces_no_diff() throws { + let tmpDir = try Path.uniqueTemporary() + defer { + try? tmpDir.delete() + } + + try tmpDir.chdir { + // Write + let plistPath = tmpDir + "xcschememanagement.plist" + let subject = XCSchemeManagement(schemeUserState: [.init(name: "Test.xcscheme", shared: true, orderHint: 0, isShown: true)], + suppressBuildableAutocreation: ["E525238B16245A900012E2BA": .init(primary: true)]) + try subject.write(path: plistPath) + + // Create a commit + try checkedOutput("git", ["init"]) + try checkedOutput("git", ["add", "."]) + try checkedOutput("git", ["commit", "-m", "test"]) + + // Write again + try subject.write(path: plistPath) + + let got = try checkedOutput("git", ["status"]) + XCTAssertTrue(got?.contains("nothing to commit") ?? false) + } + } +} From 2db72013b66df2cfc041b9526034798c1a55bac8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20Pi=C3=B1era?= Date: Fri, 15 Oct 2021 18:40:50 +0200 Subject: [PATCH 178/678] Update constants --- CHANGELOG.md | 3 +++ Sources/XcodeProj/Project/Xcode.swift | 20 ++++++++++---------- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ece92e96e..967131ad7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,9 @@ - Support customized DerrivedData path in `WorkspaceSettings` [#650](https://github.com/tuist/XcodeProj/pull/650) by [@freddi-kit](https://github.com/freddi-kit). - Add XCSchemeManagement struct https://github.com/tuist/XcodeProj/pull/565 by @pepibumur. +### Changed +- Update the last-known and default constants to align with Xcode 13. + ### 8.3.1 ### Fixed diff --git a/Sources/XcodeProj/Project/Xcode.swift b/Sources/XcodeProj/Project/Xcode.swift index 6384e9a59..6e6a91d95 100644 --- a/Sources/XcodeProj/Project/Xcode.swift +++ b/Sources/XcodeProj/Project/Xcode.swift @@ -7,41 +7,41 @@ public struct Xcode { /// Last known SDKs. public struct SDK { /// Last known SDK for iOS. - public static let ios: String = "12.0" + public static let ios: String = "14.0" /// Last known SDK for macOS. - public static let macos: String = "10.14" + public static let macos: String = "10.15" /// Last known SDK for tvOS. - public static let tvos: String = "12.0" + public static let tvos: String = "14.0" /// Last known SDK for watchos. - public static let watchos: String = "5.0" + public static let watchos: String = "7.0" } /// Last known archive version for Xcodeproj. public static let archiveVersion: UInt = 1 /// Last known Swift version (stable). - public static let swiftVersion = "4.2" + public static let swiftVersion = "5.4.2" /// Last known object version for Xcodeproj. - public static let objectVersion: UInt = 54 + public static let objectVersion: UInt = 55 /// Last known upgrade check. - public static let upgradeCheck = "1000" + public static let upgradeCheck = "1240" /// Last known Swift upgrade check. - public static let swiftUpgradeCheck = "1000" + public static let swiftUpgradeCheck = "1240" } /// Default values. public struct Default { /// The default object version for Xcodeproj. - public static let objectVersion: UInt = 52 // Xcode 11 + public static let objectVersion: UInt = 46 /// Default compatibility version. - public static let compatibilityVersion: String = "Xcode 9.3" + public static let compatibilityVersion: String = "Xcode 13.0" /// Default development region. public static let developmentRegion: String = "en" From 6ad244ac36f52e6ef4ffbf8613f8f36407b485e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20Pi=C3=B1era?= Date: Fri, 15 Oct 2021 18:42:30 +0200 Subject: [PATCH 179/678] Version 8.5.0 --- CHANGELOG.md | 14 ++++++++++---- README.md | 8 ++++---- xcodeproj.podspec | 2 +- 3 files changed, 15 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 967131ad7..add4a6e93 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,21 +1,27 @@ 🚀 Check out the guidelines [here](https://tuist.io/docs/contribution/changelog-guidelines/) ## Next -### 8.4.0 + +## 8.5.0 + ### Added -- Support customized DerrivedData path in `WorkspaceSettings` [#650](https://github.com/tuist/XcodeProj/pull/650) by [@freddi-kit](https://github.com/freddi-kit). - Add XCSchemeManagement struct https://github.com/tuist/XcodeProj/pull/565 by @pepibumur. ### Changed - Update the last-known and default constants to align with Xcode 13. +## 8.4.0 +### Added + +- Support customized DerrivedData path in `WorkspaceSettings` [#650](https://github.com/tuist/XcodeProj/pull/650) by [@freddi-kit](https://github.com/freddi-kit). + ### 8.3.1 ### Fixed - Fix Xcode 13 build [#648](https://github.com/tuist/XcodeProj/pull/648) by [@raptorxcz](https://github.com/raptorxcz) -### 8.3.0 - Mojo +## 8.3.0 - Mojo ### Added - `CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED` to default build setting [#641](https://github.com/tuist/XcodeProj/pull/641) by [@flowbe](https://github.com/flowbe) @@ -24,7 +30,7 @@ - Xcode 13 build issues [#646](https://github.com/tuist/XcodeProj/pull/646) by [@jsorge](https://github.com/jsorge) -### 8.2.0 - Bubbles +## 8.2.0 - Bubbles ### Added - Support obtaining the full path of a file element by passing the source root as a string [#624](https://github.com/tuist/XcodeProj/pull/624) by [@ileitch](https://github.com/ileitch). diff --git a/README.md b/README.md index 489c9231d..604ffd7bd 100644 --- a/README.md +++ b/README.md @@ -48,7 +48,7 @@ Add the dependency in your `Package.swift` file: let package = Package( name: "myproject", dependencies: [ - .package(url: "https://github.com/tuist/XcodeProj.git", .upToNextMajor(from: "8.4.0")), + .package(url: "https://github.com/tuist/XcodeProj.git", .upToNextMajor(from: "8.5.0")), ], targets: [ .target( @@ -64,13 +64,13 @@ let package = Package( ```bash # Cartfile -github "tuist/xcodeproj" ~> 8.4.0 +github "tuist/xcodeproj" ~> 8.5.0 ``` ### CocoaPods ```ruby -pod 'xcodeproj', '~> 8.4.0 +pod 'xcodeproj', '~> 8.5.0 ``` ### Scripting @@ -82,7 +82,7 @@ git tag that represents the project’s version: ```swift #!/usr/bin/swift sh import Foundation -import XcodeProj // @tuist ~> 8.4.0 +import XcodeProj // @tuist ~> 8.5.0 import PathKit guard CommandLine.arguments.count == 3 else { diff --git a/xcodeproj.podspec b/xcodeproj.podspec index ae025273f..91f70b7d0 100644 --- a/xcodeproj.podspec +++ b/xcodeproj.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = 'xcodeproj' - s.version = '8.4.0' + s.version = '8.5.0' s.summary = 'Read/Modify/Write your Xcode projects' s.homepage = 'https://github.com/tuist/xcodeproj' s.license = 'MIT' From 05a48b11b8ea0a863d60f4e9aa2ecc8a7dfd4224 Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Fri, 3 Dec 2021 13:10:17 +0100 Subject: [PATCH 180/678] docs: add KrisRJack as a contributor for code (#656) * docs: update README.md [skip ci] * docs: update .all-contributorsrc [skip ci] Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com> --- .all-contributorsrc | 9 +++++++++ README.md | 3 ++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/.all-contributorsrc b/.all-contributorsrc index cdbb40ca0..28f4ec158 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -139,6 +139,15 @@ "contributions": [ "code" ] + }, + { + "login": "KrisRJack", + "name": "Kristopher Jackson", + "avatar_url": "https://avatars.githubusercontent.com/u/35638500?v=4", + "profile": "http://KrisRJack.com", + "contributions": [ + "code" + ] } ], "contributorsPerLine": 7, diff --git a/README.md b/README.md index 604ffd7bd..3b1d79af2 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # XcodeProj -[![All Contributors](https://img.shields.io/badge/all_contributors-15-orange.svg?style=flat-square)](#contributors-) +[![All Contributors](https://img.shields.io/badge/all_contributors-16-orange.svg?style=flat-square)](#contributors-) [![Swift Package Manager](https://img.shields.io/badge/swift%20package%20manager-compatible-brightgreen.svg)](https://swift.org/package-manager/) @@ -173,6 +173,7 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
freddi(Yuki Aki)

💻 +
Kristopher Jackson

💻 From 1e4016ad68ebbed2dec7213501bacae92eebeb29 Mon Sep 17 00:00:00 2001 From: Kristopher Jackson Date: Fri, 3 Dec 2021 09:03:19 -0500 Subject: [PATCH 181/678] Added locationScenarioReference to TestableReference (#654) --- CHANGELOG.md | 3 +++ .../Scheme/XCScheme+TestableReference.swift | 14 ++++++++++++++ 2 files changed, 17 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index add4a6e93..2978acf1e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,9 @@ 🚀 Check out the guidelines [here](https://tuist.io/docs/contribution/changelog-guidelines/) ## Next +### Added + +- Support for location added to test targets (`TestableReference`) [#654](https://github.com/tuist/XcodeProj/pull/654) by [@KrisRJack](https://github.com/KrisRJack) ## 8.5.0 diff --git a/Sources/XcodeProj/Scheme/XCScheme+TestableReference.swift b/Sources/XcodeProj/Scheme/XCScheme+TestableReference.swift index fbe0c04f5..ac73ba3ac 100644 --- a/Sources/XcodeProj/Scheme/XCScheme+TestableReference.swift +++ b/Sources/XcodeProj/Scheme/XCScheme+TestableReference.swift @@ -10,6 +10,7 @@ extension XCScheme { public var randomExecutionOrdering: Bool public var useTestSelectionWhitelist: Bool? public var buildableReference: BuildableReference + public var locationScenarioReference: LocationScenarioReference? public var skippedTests: [TestItem] public var selectedTests: [TestItem] @@ -19,6 +20,7 @@ extension XCScheme { parallelizable: Bool = false, randomExecutionOrdering: Bool = false, buildableReference: BuildableReference, + locationScenarioReference: LocationScenarioReference? = nil, skippedTests: [TestItem] = [], selectedTests: [TestItem] = [], useTestSelectionWhitelist: Bool? = nil) { @@ -26,6 +28,7 @@ extension XCScheme { self.parallelizable = parallelizable self.randomExecutionOrdering = randomExecutionOrdering self.buildableReference = buildableReference + self.locationScenarioReference = locationScenarioReference self.useTestSelectionWhitelist = useTestSelectionWhitelist self.selectedTests = selectedTests self.skippedTests = skippedTests @@ -37,6 +40,12 @@ extension XCScheme { useTestSelectionWhitelist = element.attributes["useTestSelectionWhitelist"] == "YES" randomExecutionOrdering = element.attributes["testExecutionOrdering"] == "random" buildableReference = try BuildableReference(element: element["BuildableReference"]) + + if element["LocationScenarioReference"].all?.first != nil { + locationScenarioReference = try LocationScenarioReference(element: element["LocationScenarioReference"]) + } else { + locationScenarioReference = nil + } if let selectedTests = element["SelectedTests"]["Test"].all { self.selectedTests = try selectedTests.map(TestItem.init) @@ -64,6 +73,10 @@ extension XCScheme { attributes: attributes) element.addChild(buildableReference.xmlElement()) + if let locationScenarioReference = locationScenarioReference { + element.addChild(locationScenarioReference.xmlElement()) + } + if useTestSelectionWhitelist == true { if !selectedTests.isEmpty { let selectedTestsElement = element.addChild(name: "SelectedTests") @@ -89,6 +102,7 @@ extension XCScheme { lhs.parallelizable == rhs.parallelizable && lhs.randomExecutionOrdering == rhs.randomExecutionOrdering && lhs.buildableReference == rhs.buildableReference && + lhs.locationScenarioReference == rhs.locationScenarioReference && lhs.useTestSelectionWhitelist == rhs.useTestSelectionWhitelist && lhs.skippedTests == rhs.skippedTests && lhs.selectedTests == rhs.selectedTests From a9a469884e966b61bba7df94feee219b7efbae56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20Pi=C3=B1era?= Date: Fri, 15 Oct 2021 18:44:17 +0200 Subject: [PATCH 182/678] Recreate the carthage project --- XcodeProj_Carthage.xcodeproj/project.pbxproj | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/XcodeProj_Carthage.xcodeproj/project.pbxproj b/XcodeProj_Carthage.xcodeproj/project.pbxproj index d9ae6e0a5..2a558b0f8 100644 --- a/XcodeProj_Carthage.xcodeproj/project.pbxproj +++ b/XcodeProj_Carthage.xcodeproj/project.pbxproj @@ -27,6 +27,7 @@ 3A59F800668B0D6F550B9C09 /* PBXGroup.swift in Sources */ = {isa = PBXBuildFile; fileRef = 249AAF8AE1978D1546C0ADB5 /* PBXGroup.swift */; }; 3D5DBC9A4315D97D1B39CF19 /* PBXProjEncoder.swift in Sources */ = {isa = PBXBuildFile; fileRef = 41A031713D5F31DDCC2D61EF /* PBXProjEncoder.swift */; }; 3E2EE77196F6B2BECE8DF3DB /* BuildSettingsProvider.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1977C44246CCF9C13AB856C2 /* BuildSettingsProvider.swift */; }; + 468F48B3D19F3D1611181A2E /* XCSchemeManagement.swift in Sources */ = {isa = PBXBuildFile; fileRef = 69BA327A9CAF3CCFF60AD469 /* XCSchemeManagement.swift */; }; 46A5D9862729AC0C6D85D4FB /* XCScheme+BuildAction.swift in Sources */ = {isa = PBXBuildFile; fileRef = E525B9A065757F329F0E4002 /* XCScheme+BuildAction.swift */; }; 4716E044E5786AC68205911A /* XCVersionGroup.swift in Sources */ = {isa = PBXBuildFile; fileRef = 39E419CA05304074ADCDACE8 /* XCVersionGroup.swift */; }; 494EF8FD09FAEE56F6ACF3BE /* XCWorkspaceDataElementLocationType.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0AE25C88F5874509586B3AD4 /* XCWorkspaceDataElementLocationType.swift */; }; @@ -169,6 +170,7 @@ 66F7E3085922F586144F562A /* XCScheme+ArchiveAction.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "XCScheme+ArchiveAction.swift"; sourceTree = ""; }; 683F0C05F5FD6006924AA43C /* CommentedString.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CommentedString.swift; sourceTree = ""; }; 694034B4B7C9DF231B007A84 /* XCScheme+SerialAction.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "XCScheme+SerialAction.swift"; sourceTree = ""; }; + 69BA327A9CAF3CCFF60AD469 /* XCSchemeManagement.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = XCSchemeManagement.swift; sourceTree = ""; }; 6A113CBABFAE791D1B9C6BBE /* BuildSettings.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BuildSettings.swift; sourceTree = ""; }; 6B2C739F39DD3CC1B77E1075 /* PBXProj.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PBXProj.swift; sourceTree = ""; }; 72E6494F0E28769F9B11FD30 /* BuildPhase.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BuildPhase.swift; sourceTree = ""; }; @@ -352,6 +354,7 @@ 161E967D0979EF34C7DF6348 /* XCScheme+TestAction.swift */, 7DFDD2E86D3F0ADE3502A29A /* XCScheme+TestItem.swift */, 87331972540CB510D7E0C333 /* XCScheme+TestPlanReference.swift */, + 69BA327A9CAF3CCFF60AD469 /* XCSchemeManagement.swift */, ); path = Scheme; sourceTree = ""; @@ -681,6 +684,7 @@ D5D82B59980521FBA427EED8 /* XCScheme+TestPlanReference.swift in Sources */, 0390AF375B465D1DC7AB6194 /* XCScheme+TestableReference.swift in Sources */, E113D0F651A2213459C65387 /* XCScheme.swift in Sources */, + 468F48B3D19F3D1611181A2E /* XCSchemeManagement.swift in Sources */, 3E2EE77196F6B2BECE8DF3DB /* BuildSettingsProvider.swift in Sources */, 4E9B74BA2A6381FEDEA26092 /* CommentedString.swift in Sources */, BD7A3EBFD6C9D1AA78E6E822 /* Decoders.swift in Sources */, @@ -741,6 +745,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; CLANG_ANALYZER_NONNULL = YES; CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; @@ -792,6 +797,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; CLANG_ANALYZER_NONNULL = YES; CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; From aa2a42c7a744ca18b5918771fdd6cf40f9753db5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20Pi=C3=B1era?= Date: Fri, 3 Dec 2021 16:00:43 +0100 Subject: [PATCH 183/678] Version 8.6.0 --- CHANGELOG.md | 2 ++ README.md | 8 ++++---- xcodeproj.podspec | 2 +- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2978acf1e..367418959 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,8 @@ 🚀 Check out the guidelines [here](https://tuist.io/docs/contribution/changelog-guidelines/) ## Next + +## 8.6.0 ### Added - Support for location added to test targets (`TestableReference`) [#654](https://github.com/tuist/XcodeProj/pull/654) by [@KrisRJack](https://github.com/KrisRJack) diff --git a/README.md b/README.md index 3b1d79af2..f78ca78c3 100644 --- a/README.md +++ b/README.md @@ -48,7 +48,7 @@ Add the dependency in your `Package.swift` file: let package = Package( name: "myproject", dependencies: [ - .package(url: "https://github.com/tuist/XcodeProj.git", .upToNextMajor(from: "8.5.0")), + .package(url: "https://github.com/tuist/XcodeProj.git", .upToNextMajor(from: "8.6.0")), ], targets: [ .target( @@ -64,13 +64,13 @@ let package = Package( ```bash # Cartfile -github "tuist/xcodeproj" ~> 8.5.0 +github "tuist/xcodeproj" ~> 8.6.0 ``` ### CocoaPods ```ruby -pod 'xcodeproj', '~> 8.5.0 +pod 'xcodeproj', '~> 8.6.0 ``` ### Scripting @@ -82,7 +82,7 @@ git tag that represents the project’s version: ```swift #!/usr/bin/swift sh import Foundation -import XcodeProj // @tuist ~> 8.5.0 +import XcodeProj // @tuist ~> 8.6.0 import PathKit guard CommandLine.arguments.count == 3 else { diff --git a/xcodeproj.podspec b/xcodeproj.podspec index 91f70b7d0..941d65665 100644 --- a/xcodeproj.podspec +++ b/xcodeproj.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = 'xcodeproj' - s.version = '8.5.0' + s.version = '8.6.0' s.summary = 'Read/Modify/Write your Xcode projects' s.homepage = 'https://github.com/tuist/xcodeproj' s.license = 'MIT' From 5fd76223e2bd51af9c3baad5134f3581e0df5893 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20Pi=C3=B1era?= Date: Fri, 3 Dec 2021 18:07:07 +0100 Subject: [PATCH 184/678] Update the Carthage project --- XcodeProj_Carthage.xcodeproj/project.pbxproj | 24 +++----------------- 1 file changed, 3 insertions(+), 21 deletions(-) diff --git a/XcodeProj_Carthage.xcodeproj/project.pbxproj b/XcodeProj_Carthage.xcodeproj/project.pbxproj index 2a558b0f8..d7ff76fe0 100644 --- a/XcodeProj_Carthage.xcodeproj/project.pbxproj +++ b/XcodeProj_Carthage.xcodeproj/project.pbxproj @@ -532,7 +532,6 @@ buildPhases = ( 65398CA885D62783C577D0FA /* Sources */, 987C550AD2D049BE77E633BD /* Resources */, - 2C9C6B5EADA641EDF5BC523E /* Embed Precompiled Frameworks */, 7FAD067EE084B2EF5EFE4BFF /* Embed Frameworks */, ECC1E0A3315EECC3AF534E1B /* Frameworks */, ); @@ -555,7 +554,7 @@ }; }; buildConfigurationList = 477F800A701B31C60A80EACC /* Build configuration list for PBXProject "XcodeProj_Carthage" */; - compatibilityVersion = "Xcode 9.3"; + compatibilityVersion = "Xcode 13.0"; developmentRegion = en; hasScannedForEncodings = 0; knownRegions = ( @@ -582,23 +581,6 @@ }; /* End PBXResourcesBuildPhase section */ -/* Begin PBXShellScriptBuildPhase section */ - 2C9C6B5EADA641EDF5BC523E /* Embed Precompiled Frameworks */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - name = "Embed Precompiled Frameworks"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "echo \"Skipping, nothing to be embedded.\""; - }; -/* End PBXShellScriptBuildPhase section */ - /* Begin PBXSourcesBuildPhase section */ 65398CA885D62783C577D0FA /* Sources */ = { isa = PBXSourcesBuildPhase; @@ -735,7 +717,7 @@ SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; SWIFT_COMPILATION_MODE = singlefile; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 5.4.2; + SWIFT_VERSION = 5.5.1; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; }; @@ -880,7 +862,7 @@ SUPPORTED_PLATFORMS = macosx; SWIFT_COMPILATION_MODE = wholemodule; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; - SWIFT_VERSION = 5.4.2; + SWIFT_VERSION = 5.5.1; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; }; From 520b9c8cbeb7c9809894f5bc25273ecb8f1b0787 Mon Sep 17 00:00:00 2001 From: Jake Prickett Date: Thu, 16 Dec 2021 07:20:51 -0500 Subject: [PATCH 185/678] Add docc file type support (#660) * Add Support for .docc source files * Update CHANGELOG.md * Update CHANGELOG.md --- CHANGELOG.md | 3 +++ Sources/XcodeProj/Project/Xcode.swift | 1 + 2 files changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 367418959..0125f7db8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,9 @@ 🚀 Check out the guidelines [here](https://tuist.io/docs/contribution/changelog-guidelines/) ## Next +### Added + +- Add DocC Xcode File Type (`.docc`) [#660](https://github.com/tuist/XcodeProj/pull/660) by [@Jake-Prickett](https://github.com/Jake-Prickett) ## 8.6.0 ### Added diff --git a/Sources/XcodeProj/Project/Xcode.swift b/Sources/XcodeProj/Project/Xcode.swift index 6e6a91d95..2a990af2e 100644 --- a/Sources/XcodeProj/Project/Xcode.swift +++ b/Sources/XcodeProj/Project/Xcode.swift @@ -124,6 +124,7 @@ public struct Xcode { "defs": "sourcecode.mig", "dext": "wrapper.driver-extension", "dict": "text.plist", + "docc": "folder.documentationcatalog", "dsym": "wrapper.dsym", "dtd": "text.xml", "dylan": "sourcecode.dylan", From c6f26c3840bbfbc7ef04dbe220eb8d9c96c438d3 Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Thu, 16 Dec 2021 13:21:11 +0100 Subject: [PATCH 186/678] docs: add Jake-Prickett as a contributor for code (#661) * docs: update README.md [skip ci] * docs: update .all-contributorsrc [skip ci] Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com> --- .all-contributorsrc | 9 +++++++++ README.md | 3 ++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/.all-contributorsrc b/.all-contributorsrc index 28f4ec158..4619b181c 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -148,6 +148,15 @@ "contributions": [ "code" ] + }, + { + "login": "Jake-Prickett", + "name": "Jake Prickett", + "avatar_url": "https://avatars.githubusercontent.com/u/26095410?v=4", + "profile": "https://github.com/Jake-Prickett", + "contributions": [ + "code" + ] } ], "contributorsPerLine": 7, diff --git a/README.md b/README.md index f78ca78c3..f162ff99f 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # XcodeProj -[![All Contributors](https://img.shields.io/badge/all_contributors-16-orange.svg?style=flat-square)](#contributors-) +[![All Contributors](https://img.shields.io/badge/all_contributors-17-orange.svg?style=flat-square)](#contributors-) [![Swift Package Manager](https://img.shields.io/badge/swift%20package%20manager-compatible-brightgreen.svg)](https://swift.org/package-manager/) @@ -174,6 +174,7 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
freddi(Yuki Aki)

💻
Kristopher Jackson

💻 +
Jake Prickett

💻 From 714e350a6600e3db1e77b3db3f78acac96ac93b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20Pi=C3=B1era?= Date: Thu, 16 Dec 2021 13:21:49 +0100 Subject: [PATCH 187/678] Version 8.7.0 --- CHANGELOG.md | 2 ++ README.md | 8 ++++---- xcodeproj.podspec | 2 +- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0125f7db8..2c6484763 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,8 @@ 🚀 Check out the guidelines [here](https://tuist.io/docs/contribution/changelog-guidelines/) ## Next + +## 8.7.0 ### Added - Add DocC Xcode File Type (`.docc`) [#660](https://github.com/tuist/XcodeProj/pull/660) by [@Jake-Prickett](https://github.com/Jake-Prickett) diff --git a/README.md b/README.md index f162ff99f..ebacb4ff7 100644 --- a/README.md +++ b/README.md @@ -48,7 +48,7 @@ Add the dependency in your `Package.swift` file: let package = Package( name: "myproject", dependencies: [ - .package(url: "https://github.com/tuist/XcodeProj.git", .upToNextMajor(from: "8.6.0")), + .package(url: "https://github.com/tuist/XcodeProj.git", .upToNextMajor(from: "8.7.0")), ], targets: [ .target( @@ -64,13 +64,13 @@ let package = Package( ```bash # Cartfile -github "tuist/xcodeproj" ~> 8.6.0 +github "tuist/xcodeproj" ~> 8.7.0 ``` ### CocoaPods ```ruby -pod 'xcodeproj', '~> 8.6.0 +pod 'xcodeproj', '~> 8.7.0 ``` ### Scripting @@ -82,7 +82,7 @@ git tag that represents the project’s version: ```swift #!/usr/bin/swift sh import Foundation -import XcodeProj // @tuist ~> 8.6.0 +import XcodeProj // @tuist ~> 8.7.0 import PathKit guard CommandLine.arguments.count == 3 else { diff --git a/xcodeproj.podspec b/xcodeproj.podspec index 941d65665..81e231050 100644 --- a/xcodeproj.podspec +++ b/xcodeproj.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = 'xcodeproj' - s.version = '8.6.0' + s.version = '8.7.0' s.summary = 'Read/Modify/Write your Xcode projects' s.homepage = 'https://github.com/tuist/xcodeproj' s.license = 'MIT' From fae1867893ba4ccf0a57e55e1a9b4097246d4cd2 Mon Sep 17 00:00:00 2001 From: Jake Adams Date: Thu, 16 Dec 2021 09:25:09 -0500 Subject: [PATCH 188/678] Make `WorkspaceSettings` initializer `public` (#658) * Require `WorkspaceSettings.autoCreateSchemes` and make initializer `public`. * Revert to optional boolean. * Update encoder as well. * Set output format to `xml` to avoid binary default. --- .../XcodeProj/Project/WorkspaceSettings.swift | 24 +++++++++++-------- .../Project/WorkspaceSettingsTests.swift | 6 ++--- 2 files changed, 17 insertions(+), 13 deletions(-) diff --git a/Sources/XcodeProj/Project/WorkspaceSettings.swift b/Sources/XcodeProj/Project/WorkspaceSettings.swift index 8bab7b90f..4cf306b57 100644 --- a/Sources/XcodeProj/Project/WorkspaceSettings.swift +++ b/Sources/XcodeProj/Project/WorkspaceSettings.swift @@ -15,24 +15,24 @@ public class WorkspaceSettings: Codable, Equatable, Writable { /// New build system case new } - + public enum DerivedDataLocationStyle: String { /// Default derived data case `default` = "Default" /// Absolute path case absolutePath = "AbsolutePath" - + /// Relative paht case workspaceRelativePath = "WorkspaceRelativePath" } /// Workspace build system. public var buildSystem: BuildSystem - + /// Workspace DerivedData directory. public var derivedDataLocationStyle: DerivedDataLocationStyle? - + /// Path to workspace DerivedData directory. public var derivedDataCustomLocation: String? @@ -56,10 +56,11 @@ public class WorkspaceSettings: Codable, Equatable, Writable { /// - derivedDataLocationStyle: Workspace DerivedData directory. /// - derivedDataCustomLocation: Path to workspace DerivedData directory. /// - autoCreateSchemes: When true, Xcode auto-creates schemes in the project. - init(buildSystem: BuildSystem = .new, - derivedDataLocationStyle: DerivedDataLocationStyle? = nil, - derivedDataCustomLocation: String? = nil, - autoCreateSchemes: Bool? = nil) { + public init(buildSystem: BuildSystem = .new, + derivedDataLocationStyle: DerivedDataLocationStyle? = nil, + derivedDataCustomLocation: String? = nil, + autoCreateSchemes: Bool? = nil) + { self.buildSystem = buildSystem self.derivedDataLocationStyle = derivedDataLocationStyle self.derivedDataCustomLocation = derivedDataCustomLocation @@ -73,13 +74,15 @@ public class WorkspaceSettings: Codable, Equatable, Writable { public required init(from decoder: Decoder) throws { let container = try decoder.container(keyedBy: CodingKeys.self) if let buildSystemString: String = try container.decodeIfPresent(.buildSystem), - let buildSystem = BuildSystem(rawValue: buildSystemString) { + let buildSystem = BuildSystem(rawValue: buildSystemString) + { self.buildSystem = buildSystem } else { buildSystem = .new } if let derivedDataLocationStyleString: String = try container.decodeIfPresent(.derivedDataLocationStyle), - let derivedDataLocationStyle = DerivedDataLocationStyle(rawValue: derivedDataLocationStyleString) { + let derivedDataLocationStyle = DerivedDataLocationStyle(rawValue: derivedDataLocationStyleString) + { self.derivedDataLocationStyle = derivedDataLocationStyle } else { derivedDataLocationStyle = .default @@ -142,6 +145,7 @@ public class WorkspaceSettings: Codable, Equatable, Writable { /// - Throws: writing error if something goes wrong. public func write(path: Path, override: Bool) throws { let encoder = PropertyListEncoder() + encoder.outputFormat = .xml let data = try encoder.encode(self) if override, path.exists { try path.delete() diff --git a/Tests/XcodeProjTests/Project/WorkspaceSettingsTests.swift b/Tests/XcodeProjTests/Project/WorkspaceSettingsTests.swift index 9e55a425e..7c70e40d6 100644 --- a/Tests/XcodeProjTests/Project/WorkspaceSettingsTests.swift +++ b/Tests/XcodeProjTests/Project/WorkspaceSettingsTests.swift @@ -29,7 +29,7 @@ final class WorkspaceSettingsTests: XCTestCase { XCTAssertTrue(got.derivedDataCustomLocation == "CustomizedDerivedData") XCTAssertTrue(got.derivedDataLocationStyle == .workspaceRelativePath) } - + func test_init_when_absolute_derivedData_is_enabled() throws { let path = fixturesPath() + "WorkspaceSettings/OriginalAbsoluteDerivedData.xcsettings" let got = try WorkspaceSettings.at(path: path) @@ -38,8 +38,8 @@ final class WorkspaceSettingsTests: XCTestCase { } func test_equals() { - let lhs = WorkspaceSettings(buildSystem: .new) - let rhs = WorkspaceSettings(buildSystem: .original) + let lhs = WorkspaceSettings(buildSystem: .new, autoCreateSchemes: true) + let rhs = WorkspaceSettings(buildSystem: .original, autoCreateSchemes: true) XCTAssertNotEqual(lhs, rhs) } From c75c3acc25460195cfd203a04dde165395bf00e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20Pi=C3=B1era?= Date: Thu, 16 Dec 2021 15:46:39 +0100 Subject: [PATCH 189/678] Version 8.7.1 --- CHANGELOG.md | 5 +++++ README.md | 8 ++++---- xcodeproj.podspec | 2 +- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2c6484763..d3ec3b4b1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,11 @@ ## Next +## 8.7.1 + +### Changed +- Make WorkspaceSettings initializer public [#658](https://github.com/tuist/XcodeProj/pull/658) by [@jakeatoms](https://github.com/jakeatoms) + ## 8.7.0 ### Added diff --git a/README.md b/README.md index ebacb4ff7..449a470c4 100644 --- a/README.md +++ b/README.md @@ -48,7 +48,7 @@ Add the dependency in your `Package.swift` file: let package = Package( name: "myproject", dependencies: [ - .package(url: "https://github.com/tuist/XcodeProj.git", .upToNextMajor(from: "8.7.0")), + .package(url: "https://github.com/tuist/XcodeProj.git", .upToNextMajor(from: "8.7.1")), ], targets: [ .target( @@ -64,13 +64,13 @@ let package = Package( ```bash # Cartfile -github "tuist/xcodeproj" ~> 8.7.0 +github "tuist/xcodeproj" ~> 8.7.1 ``` ### CocoaPods ```ruby -pod 'xcodeproj', '~> 8.7.0 +pod 'xcodeproj', '~> 8.7.1 ``` ### Scripting @@ -82,7 +82,7 @@ git tag that represents the project’s version: ```swift #!/usr/bin/swift sh import Foundation -import XcodeProj // @tuist ~> 8.7.0 +import XcodeProj // @tuist ~> 8.7.1 import PathKit guard CommandLine.arguments.count == 3 else { diff --git a/xcodeproj.podspec b/xcodeproj.podspec index 81e231050..e063e07e6 100644 --- a/xcodeproj.podspec +++ b/xcodeproj.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = 'xcodeproj' - s.version = '8.7.0' + s.version = '8.7.1' s.summary = 'Read/Modify/Write your Xcode projects' s.homepage = 'https://github.com/tuist/xcodeproj' s.license = 'MIT' From fd5b3d7a5112e91eca0434ad2bb28ce1fed9cf8c Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Thu, 16 Dec 2021 15:48:02 +0100 Subject: [PATCH 190/678] docs: add jakeatoms as a contributor for code (#662) * docs: update README.md [skip ci] * docs: update .all-contributorsrc [skip ci] Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com> --- .all-contributorsrc | 9 +++++++++ README.md | 3 ++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/.all-contributorsrc b/.all-contributorsrc index 4619b181c..c0351ffdc 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -157,6 +157,15 @@ "contributions": [ "code" ] + }, + { + "login": "jakeatoms", + "name": "Jake Adams", + "avatar_url": "https://avatars.githubusercontent.com/u/3605966?v=4", + "profile": "http://www.jakeadams.co", + "contributions": [ + "code" + ] } ], "contributorsPerLine": 7, diff --git a/README.md b/README.md index 449a470c4..72831c173 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # XcodeProj -[![All Contributors](https://img.shields.io/badge/all_contributors-17-orange.svg?style=flat-square)](#contributors-) +[![All Contributors](https://img.shields.io/badge/all_contributors-18-orange.svg?style=flat-square)](#contributors-) [![Swift Package Manager](https://img.shields.io/badge/swift%20package%20manager-compatible-brightgreen.svg)](https://swift.org/package-manager/) @@ -175,6 +175,7 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
freddi(Yuki Aki)

💻
Kristopher Jackson

💻
Jake Prickett

💻 +
Jake Adams

💻 From b030c965498b9e7d76044049b22844910fee23eb Mon Sep 17 00:00:00 2001 From: Brentley Jones Date: Mon, 28 Feb 2022 14:05:41 -0600 Subject: [PATCH 191/678] Fix equality checking of dictionaries (#667) --- .../XcodeProj/Objects/Sourcery/Equality.generated.swift | 8 ++++---- Templates/Equality.stencil | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Sources/XcodeProj/Objects/Sourcery/Equality.generated.swift b/Sources/XcodeProj/Objects/Sourcery/Equality.generated.swift index 9daa37a2d..7b9c985e4 100644 --- a/Sources/XcodeProj/Objects/Sourcery/Equality.generated.swift +++ b/Sources/XcodeProj/Objects/Sourcery/Equality.generated.swift @@ -15,7 +15,7 @@ extension PBXBuildFile { func isEqual(to rhs: PBXBuildFile) -> Bool { if fileReference != rhs.fileReference { return false } if productReference != rhs.productReference { return false } - if !NSDictionary(dictionary: settings ?? [:]).isEqual(to: rhs.settings ?? [:]) { return false } + if !NSDictionary(dictionary: settings ?? [:]).isEqual(NSDictionary(dictionary: rhs.settings ?? [:])) { return false } if platformFilter != rhs.platformFilter { return false } if buildPhase != rhs.buildPhase { return false } return super.isEqual(to: rhs) @@ -166,8 +166,8 @@ extension PBXProject { if projectReferences != rhs.projectReferences { return false } if projectRoots != rhs.projectRoots { return false } if targetReferences != rhs.targetReferences { return false } - if !NSDictionary(dictionary: attributes).isEqual(to: rhs.attributes) { return false } - if !NSDictionary(dictionary: targetAttributeReferences).isEqual(to: rhs.targetAttributeReferences) { return false } + if !NSDictionary(dictionary: attributes).isEqual(NSDictionary(dictionary: rhs.attributes)) { return false } + if !NSDictionary(dictionary: targetAttributeReferences).isEqual(NSDictionary(dictionary: rhs.targetAttributeReferences)) { return false } if packageReferences != rhs.packageReferences { return false } return super.isEqual(to: rhs) } @@ -257,7 +257,7 @@ extension XCBuildConfiguration { /// :nodoc: func isEqual(to rhs: XCBuildConfiguration) -> Bool { if baseConfigurationReference != rhs.baseConfigurationReference { return false } - if !NSDictionary(dictionary: buildSettings).isEqual(to: rhs.buildSettings) { return false } + if !NSDictionary(dictionary: buildSettings).isEqual(NSDictionary(dictionary: rhs.buildSettings)) { return false } if name != rhs.name { return false } return super.isEqual(to: rhs) } diff --git a/Templates/Equality.stencil b/Templates/Equality.stencil index d8d155a8c..4d149477d 100644 --- a/Templates/Equality.stencil +++ b/Templates/Equality.stencil @@ -6,7 +6,7 @@ extension {{ type.name }} { func isEqual(to rhs: {{ type.name }}) -> Bool { {% for variable in type.storedVariables %} {% if variable.typeName.dictionary %} - if !NSDictionary(dictionary: {{ variable.name}}{% if variable.typeName.isOptional %} ?? [:]{% endif %}).isEqual(to: rhs.{{ variable.name }}{% if variable.typeName.isOptional %} ?? [:]{% endif %}) { return false } + if !NSDictionary(dictionary: {{ variable.name}}{% if variable.typeName.isOptional %} ?? [:]{% endif %}).isEqual(NSDictionary(dictionary: rhs.{{ variable.name }}{% if variable.typeName.isOptional %} ?? [:]{% endif %})) { return false } {% elif variable|!annotated:"skipEquality" %} if {{ variable.name }} != rhs.{{ variable.name }} { return false } {% endif %} From 6f2c1a7e40da1b600277899b9365c6a5cb2df818 Mon Sep 17 00:00:00 2001 From: "depfu[bot]" <23717796+depfu[bot]@users.noreply.github.com> Date: Sun, 20 Mar 2022 12:06:47 +0100 Subject: [PATCH 192/678] Update jazzy to version 0.14.2 (#669) Co-authored-by: depfu[bot] <23717796+depfu[bot]@users.noreply.github.com> --- Gemfile.lock | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 119f197a4..69b17eeed 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,9 +1,9 @@ GEM remote: https://rubygems.org/ specs: - CFPropertyList (3.0.4) + CFPropertyList (3.0.5) rexml - activesupport (6.1.4.1) + activesupport (6.1.5) concurrent-ruby (~> 1.0, >= 1.0.2) i18n (>= 1.6, < 2) minitest (>= 5.1) @@ -15,7 +15,7 @@ GEM httpclient (~> 2.8, >= 2.8.3) json (>= 1.5.1) atomos (0.1.3) - claide (1.0.3) + claide (1.1.0) cocoapods (1.11.0) addressable (~> 2.8) claide (>= 1.0.2, < 2.0) @@ -57,16 +57,16 @@ GEM colorize (0.8.1) concurrent-ruby (1.1.9) escape (0.0.4) - ethon (0.14.0) + ethon (0.15.0) ffi (>= 1.15.0) - ffi (1.15.4) + ffi (1.15.5) fourflusher (2.3.1) fuzzy_match (2.0.4) gh_inspector (1.1.3) httpclient (2.8.3) - i18n (1.8.10) + i18n (1.10.0) concurrent-ruby (~> 1.0) - jazzy (0.14.1) + jazzy (0.14.2) cocoapods (~> 1.5) mustache (~> 1.1) open4 (~> 1.3) @@ -76,9 +76,9 @@ GEM sassc (~> 2.1) sqlite3 (~> 1.3) xcinvoke (~> 0.3.0) - json (2.5.1) + json (2.6.1) liferaft (0.0.6) - minitest (5.14.4) + minitest (5.15.0) molinillo (0.8.0) mustache (1.1.1) nanaimo (0.3.0) @@ -89,7 +89,7 @@ GEM rake (13.0.6) redcarpet (3.5.1) rexml (3.2.5) - rouge (3.26.1) + rouge (3.28.0) ruby-macho (2.5.1) sassc (2.4.0) ffi (~> 1.9) @@ -107,7 +107,7 @@ GEM colored2 (~> 3.1) nanaimo (~> 0.3.0) rexml (~> 3.2.4) - zeitwerk (2.4.2) + zeitwerk (2.5.4) PLATFORMS ruby From 6b7707cedd8dde065560868193b0e0a6e32ce10b Mon Sep 17 00:00:00 2001 From: Isaac Halvorson Date: Tue, 5 Apr 2022 14:54:08 -0500 Subject: [PATCH 193/678] Quiet new warnings from Xcode 13.3 (#673) * Rename .self to ._self to quiet Xcode 13.3 * Change _self to current * Switch swiftlint GitHub action to norio-nomura/action-swiftlint@3.2.1 --- .github/workflows/xcodeproj.yml | 2 +- Sources/XcodeProj/Workspace/XCWorkspace.swift | 2 +- .../Workspace/XCWorkspaceDataElementLocationType.swift | 10 +++++----- .../Workspace/XCWorkspaceDataTests.swift | 6 +++--- Tests/XcodeProjTests/Workspace/XCWorkspaceTests.swift | 2 +- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/xcodeproj.yml b/.github/workflows/xcodeproj.yml index e974c0e25..5e61b10b9 100644 --- a/.github/workflows/xcodeproj.yml +++ b/.github/workflows/xcodeproj.yml @@ -61,6 +61,6 @@ jobs: steps: - uses: actions/checkout@v1 - name: GitHub Action for SwiftLint - uses: pepibumur/action-swiftlint@0d4afd006bb24e4525b5afcefd4ab5e2537193ac + uses: norio-nomura/action-swiftlint@3.2.1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/Sources/XcodeProj/Workspace/XCWorkspace.swift b/Sources/XcodeProj/Workspace/XCWorkspace.swift index 5732a9e7c..a2b549a6d 100644 --- a/Sources/XcodeProj/Workspace/XCWorkspace.swift +++ b/Sources/XcodeProj/Workspace/XCWorkspace.swift @@ -28,7 +28,7 @@ public final class XCWorkspace: Writable, Equatable { /// Initializes a default workspace with a single reference that points to self: public convenience init() { - let data = XCWorkspaceData(children: [.file(.init(location: .self("")))]) + let data = XCWorkspaceData(children: [.file(.init(location: .current("")))]) self.init(data: data) } diff --git a/Sources/XcodeProj/Workspace/XCWorkspaceDataElementLocationType.swift b/Sources/XcodeProj/Workspace/XCWorkspaceDataElementLocationType.swift index f7401ac96..aac0d8bdb 100644 --- a/Sources/XcodeProj/Workspace/XCWorkspaceDataElementLocationType.swift +++ b/Sources/XcodeProj/Workspace/XCWorkspaceDataElementLocationType.swift @@ -9,7 +9,7 @@ public enum XCWorkspaceDataElementLocationType { case container(String) // "Relative to container" case developer(String) // "Relative to Developer Directory" case group(String) // "Relative to group" - case `self`(String) // Single project workspace in xcodeproj directory + case current(String) // Single project workspace in xcodeproj directory case other(String, String) public var schema: String { @@ -22,7 +22,7 @@ public enum XCWorkspaceDataElementLocationType { return "developer" case .group: return "group" - case .self: + case .current: return "self" case let .other(schema, _): return schema @@ -39,7 +39,7 @@ public enum XCWorkspaceDataElementLocationType { return path case let .group(path): return path - case let .self(path): + case let .current(path): return path case let .other(_, path): return path @@ -62,7 +62,7 @@ public enum XCWorkspaceDataElementLocationType { case "group": self = .group(path) case "self": - self = .self(path) + self = .current(path) default: self = .other(schema, path) } @@ -86,7 +86,7 @@ extension XCWorkspaceDataElementLocationType: Equatable { return lhs == rhs case let (.group(lhs), .group(rhs)): return lhs == rhs - case let (.self(lhs), .self(rhs)): + case let (.current(lhs), .current(rhs)): return lhs == rhs case let (.other(lhs0, lhs1), .other(rhs0, rhs1)): return lhs0 == rhs0 && lhs1 == rhs1 diff --git a/Tests/XcodeProjTests/Workspace/XCWorkspaceDataTests.swift b/Tests/XcodeProjTests/Workspace/XCWorkspaceDataTests.swift index e3effd94a..420ea7ed2 100644 --- a/Tests/XcodeProjTests/Workspace/XCWorkspaceDataTests.swift +++ b/Tests/XcodeProjTests/Workspace/XCWorkspaceDataTests.swift @@ -10,7 +10,7 @@ final class XCWorkspaceDataTests: XCTestCase { override func setUp() { super.setUp() fileRef = XCWorkspaceDataFileRef( - location: .self("path") + location: .current("path") ) subject = XCWorkspaceData(children: []) } @@ -26,7 +26,7 @@ final class XCWorkspaceDataIntegrationTests: XCTestCase { let path = fixturePath() let got = try XCWorkspaceData(path: path) if case let XCWorkspaceDataElement.file(location: fileRef) = got.children.first! { - XCTAssertEqual(fileRef.location, .self("")) + XCTAssertEqual(fileRef.location, .current("")) } else { XCTAssertTrue(false, "Expected file reference") } @@ -45,7 +45,7 @@ final class XCWorkspaceDataIntegrationTests: XCTestCase { initModel: { try? XCWorkspaceData(path: $0) }, modify: { $0.children.append( - .group(.init(location: .self("shakira"), + .group(.init(location: .current("shakira"), name: "shakira", children: [])) ) diff --git a/Tests/XcodeProjTests/Workspace/XCWorkspaceTests.swift b/Tests/XcodeProjTests/Workspace/XCWorkspaceTests.swift index 0142bca86..a4820b1c5 100644 --- a/Tests/XcodeProjTests/Workspace/XCWorkspaceTests.swift +++ b/Tests/XcodeProjTests/Workspace/XCWorkspaceTests.swift @@ -19,7 +19,7 @@ final class XCWorkspaceIntegrationTests: XCTestCase { func test_init_returnsAWorkspaceWithTheCorrectReference() { XCTAssertEqual(XCWorkspace().data.children.count, 1) - XCTAssertEqual(XCWorkspace().data.children.first, .file(.init(location: .self("")))) + XCTAssertEqual(XCWorkspace().data.children.first, .file(.init(location: .current("")))) } func test_equatable_emptyWorkspacesAreEqual() { From e1462528f3417969711ff655fbfaebe028fe7305 Mon Sep 17 00:00:00 2001 From: "depfu[bot]" <23717796+depfu[bot]@users.noreply.github.com> Date: Wed, 6 Apr 2022 20:50:38 +0200 Subject: [PATCH 194/678] Update cocoapods-downloader to version 1.6.3 (#675) Co-authored-by: depfu[bot] <23717796+depfu[bot]@users.noreply.github.com> --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 69b17eeed..5b62c4e92 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -45,7 +45,7 @@ GEM public_suffix (~> 4.0) typhoeus (~> 1.0) cocoapods-deintegrate (1.0.5) - cocoapods-downloader (1.5.1) + cocoapods-downloader (1.6.3) cocoapods-plugins (1.0.0) nap cocoapods-search (1.0.1) From 668509f68a297314ac7b8e4b799295f2e92dcdb4 Mon Sep 17 00:00:00 2001 From: Ikko Ashimine Date: Sun, 24 Apr 2022 17:08:41 +0900 Subject: [PATCH 195/678] Fix typo in PBXOutputSettings.swift (#678) preceeding -> preceding --- Sources/XcodeProj/Objects/Project/PBXOutputSettings.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/XcodeProj/Objects/Project/PBXOutputSettings.swift b/Sources/XcodeProj/Objects/Project/PBXOutputSettings.swift index c6813001d..374e725a1 100644 --- a/Sources/XcodeProj/Objects/Project/PBXOutputSettings.swift +++ b/Sources/XcodeProj/Objects/Project/PBXOutputSettings.swift @@ -81,7 +81,7 @@ public enum PBXNavigatorFileOrder { /// Leave the files unsorted. case unsorted - /// Sort the file by their file name. This is a case sensitive sort with uppercase name preceeding lowercase names. + /// Sort the file by their file name. This is a case sensitive sort with uppercase name preceding lowercase names. case byFilename /// Sorts the files by their file names with all groups appear at the top of the list. From 077da3f0307c4d24a721ed4f7137a75fa443b549 Mon Sep 17 00:00:00 2001 From: Brentley Jones Date: Wed, 27 Apr 2022 15:03:16 -0500 Subject: [PATCH 196/678] Add `addDependency()` helper method to `PBXAggregateTarget` (#677) --- .../Objects/Targets/PBXAggregateTarget.swift | 27 +++++++++++++++++ .../Targets/PBXAggregateTargetTests.swift | 30 +++++++++++++++++++ 2 files changed, 57 insertions(+) diff --git a/Sources/XcodeProj/Objects/Targets/PBXAggregateTarget.swift b/Sources/XcodeProj/Objects/Targets/PBXAggregateTarget.swift index e963ecd2a..ec87371fe 100644 --- a/Sources/XcodeProj/Objects/Targets/PBXAggregateTarget.swift +++ b/Sources/XcodeProj/Objects/Targets/PBXAggregateTarget.swift @@ -15,3 +15,30 @@ extension PBXAggregateTarget: PlistSerializable { return try plistValues(proj: proj, isa: PBXAggregateTarget.isa, reference: reference) } } + +// MARK: - Helpers + +public extension PBXAggregateTarget { + /// Adds a local target dependency to the target. + /// + /// - Parameter target: dependency target. + /// - Returns: target dependency reference. + /// - Throws: an error if the dependency cannot be created. + func addDependency(target: PBXTarget) throws -> PBXTargetDependency? { + let objects = try target.objects() + guard let project = objects.projects.first?.value else { + return nil + } + let proxy = PBXContainerItemProxy(containerPortal: .project(project), + remoteGlobalID: .object(target), + proxyType: .nativeTarget, + remoteInfo: target.name) + objects.add(object: proxy) + let targetDependency = PBXTargetDependency(name: target.name, + target: target, + targetProxy: proxy) + objects.add(object: targetDependency) + dependencies.append(targetDependency) + return targetDependency + } +} diff --git a/Tests/XcodeProjTests/Objects/Targets/PBXAggregateTargetTests.swift b/Tests/XcodeProjTests/Objects/Targets/PBXAggregateTargetTests.swift index 3e879e75a..d16bfd075 100644 --- a/Tests/XcodeProjTests/Objects/Targets/PBXAggregateTargetTests.swift +++ b/Tests/XcodeProjTests/Objects/Targets/PBXAggregateTargetTests.swift @@ -27,4 +27,34 @@ final class PBXAggregateTargetTests: XCTestCase { "name": "name", ] } + + func test_addDependency() throws { + let objects = PBXObjects(objects: []) + + let configurationList = XCConfigurationList.fixture() + let mainGroup = PBXGroup.fixture() + objects.add(object: configurationList) + objects.add(object: mainGroup) + + let project = PBXProject(name: "Project", + buildConfigurationList: configurationList, + compatibilityVersion: "0", + mainGroup: mainGroup) + + objects.add(object: project) + let target = PBXAggregateTarget(name: "Target", buildConfigurationList: nil) + let dependency = PBXAggregateTarget(name: "Dependency", buildConfigurationList: nil) + objects.add(object: target) + objects.add(object: dependency) + _ = try target.addDependency(target: dependency) + let targetDependency: PBXTargetDependency? = target.dependencyReferences.first?.getObject() + + XCTAssertEqual(targetDependency?.name, "Dependency") + XCTAssertEqual(targetDependency?.targetReference, dependency.reference) + let containerItemProxy: PBXContainerItemProxy? = targetDependency?.targetProxyReference?.getObject() + XCTAssertEqual(containerItemProxy?.containerPortalReference, project.reference) + XCTAssertEqual(containerItemProxy?.remoteGlobalID?.uuid, dependency.reference.value) + XCTAssertEqual(containerItemProxy?.proxyType, .nativeTarget) + XCTAssertEqual(containerItemProxy?.remoteInfo, "Dependency") + } } From 3b80ed8787f52eebeb9c638d34040b4ff80f1448 Mon Sep 17 00:00:00 2001 From: Maxwell Elliott Date: Wed, 27 Apr 2022 13:03:51 -0700 Subject: [PATCH 197/678] Fix syntax error in docs (#679) use forEach over each --- Documentation/getting-started.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Documentation/getting-started.md b/Documentation/getting-started.md index 26d6512e9..fd7975b54 100644 --- a/Documentation/getting-started.md +++ b/Documentation/getting-started.md @@ -68,7 +68,7 @@ We the project already in memory, we are going to output all the targets that ar ```swift let pbxproj = xcodeproj.pbxproj // Returns a PBXProj -pbxproj.nativeTargets.each { target in +pbxproj.nativeTargets.forEach { target in print(target.name) } ``` @@ -104,4 +104,4 @@ try xcodeproj.write(path: path) If something goes wrong during the project writing, `write` will throw an error. In most cases, writing issues are related to misconfigured projects. For that reason it's important that you understand the modifications that we are introducing to your projects. -**Bear in mind that xcodeproj makes the process of configuring Xcode project more convenient, but doesn't prevent you from having to read and understand the Xcode project structure** \ No newline at end of file +**Bear in mind that xcodeproj makes the process of configuring Xcode project more convenient, but doesn't prevent you from having to read and understand the Xcode project structure** From 8aa9591d2a1514c1f4fc79b0836b548bcc08ec5c Mon Sep 17 00:00:00 2001 From: Maxwell Elliott Date: Wed, 27 Apr 2022 23:49:45 -0700 Subject: [PATCH 198/678] Misspelling in comment (#680) --- Sources/XcodeProj/Project/XcodeProj.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/XcodeProj/Project/XcodeProj.swift b/Sources/XcodeProj/Project/XcodeProj.swift index 2f14c24f3..dcdd52411 100644 --- a/Sources/XcodeProj/Project/XcodeProj.swift +++ b/Sources/XcodeProj/Project/XcodeProj.swift @@ -8,7 +8,7 @@ public final class XcodeProj: Equatable { /// Project workspace public var workspace: XCWorkspace - /// .pbxproj representatino + /// .pbxproj representation public var pbxproj: PBXProj /// Shared data. From 92e43edf92548a3a72410e4a54d381a921c398a0 Mon Sep 17 00:00:00 2001 From: Maxwell Elliott Date: Wed, 27 Apr 2022 23:50:10 -0700 Subject: [PATCH 199/678] Mispelling in comment (#681) --- Sources/XcodeProj/Objects/Targets/PBXNativeTarget.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/XcodeProj/Objects/Targets/PBXNativeTarget.swift b/Sources/XcodeProj/Objects/Targets/PBXNativeTarget.swift index 5b1296136..45c4bbcb3 100644 --- a/Sources/XcodeProj/Objects/Targets/PBXNativeTarget.swift +++ b/Sources/XcodeProj/Objects/Targets/PBXNativeTarget.swift @@ -9,7 +9,7 @@ public final class PBXNativeTarget: PBXTarget { /// /// - Parameters: /// - name: target name. - /// - buildConfigurationList: build configuratino list. + /// - buildConfigurationList: build configuration list. /// - buildPhases: build phases. /// - buildRules: build rules. /// - dependencies: dependencies. From 65ca255bfc9a20876f89380df7b30c1ef5e8ff34 Mon Sep 17 00:00:00 2001 From: Maxwell Elliott Date: Sun, 8 May 2022 00:21:33 -0700 Subject: [PATCH 200/678] Allow for initializing a PBXProj via a direct path (#682) - Allows for a `PBXProj` to be initiated with a direct path - Moves some related code to the `PBXProj` class --- .../XcodeProj/Objects/Project/PBXProj.swift | 60 ++++++++++++++++++- Sources/XcodeProj/Project/XcodeProj.swift | 28 +-------- 2 files changed, 61 insertions(+), 27 deletions(-) diff --git a/Sources/XcodeProj/Objects/Project/PBXProj.swift b/Sources/XcodeProj/Objects/Project/PBXProj.swift index 32b199453..1319ac847 100644 --- a/Sources/XcodeProj/Objects/Project/PBXProj.swift +++ b/Sources/XcodeProj/Objects/Project/PBXProj.swift @@ -52,6 +52,35 @@ public final class PBXProj: Decodable { } } + /// Initializes the project with a path to the pbxproj file. + /// + /// - Parameters: + /// - path: Path to a pbxproj file. + public convenience init(path: Path) throws { + let pbxproj: PBXProj = try PBXProj.createPBXProj(path: path) + self.init( + rootObject: pbxproj.rootObject, + objectVersion: pbxproj.objectVersion, + archiveVersion: pbxproj.archiveVersion, + classes: pbxproj.classes, + objects: pbxproj.objects + ) + } + + private init( + rootObject: PBXProject? = nil, + objectVersion: UInt = Xcode.LastKnown.objectVersion, + archiveVersion: UInt = Xcode.LastKnown.archiveVersion, + classes: [String: Any] = [:], + objects: PBXObjects + ) { + self.archiveVersion = archiveVersion + self.objectVersion = objectVersion + self.classes = classes + rootObjectReference = rootObject?.reference + self.objects = objects + } + // MARK: - Decodable fileprivate enum CodingKeys: String, CodingKey { @@ -92,6 +121,35 @@ public final class PBXProj: Decodable { try rootGroup()?.assignParentToChildren() } + + // MARK: Static Methods + + private static func createPBXProj(path: Path) throws -> PBXProj { + let (pbxProjData, pbxProjDictionary) = try PBXProj.readPBXProj(path: path) + let context = ProjectDecodingContext( + pbxProjValueReader: { key in + pbxProjDictionary[key] + } + ) + + let plistDecoder = XcodeprojPropertyListDecoder(context: context) + let pbxproj: PBXProj = try plistDecoder.decode(PBXProj.self, from: pbxProjData) + try pbxproj.updateProjectName(path: path) + return pbxproj + } + + private static func readPBXProj(path: Path) throws -> (Data, [String: Any]) { + let plistXML = try Data(contentsOf: path.url) + var propertyListFormat = PropertyListSerialization.PropertyListFormat.xml + let serialized = try PropertyListSerialization.propertyList( + from: plistXML, + options: .mutableContainersAndLeaves, + format: &propertyListFormat + ) + // swiftlint:disable:next force_cast + let pbxProjDictionary = serialized as! [String: Any] + return (plistXML, pbxProjDictionary) + } } // MARK: - Public helpers @@ -198,7 +256,7 @@ public extension PBXProj { extension PBXProj { /// Infers project name from Path and sets it as project name /// - /// Project name is needed for certain comments when serialising PBXProj + /// Project name is needed for certain comments when serializing PBXProj /// /// - Parameters: /// - path: path to .xcodeproj directory. diff --git a/Sources/XcodeProj/Project/XcodeProj.swift b/Sources/XcodeProj/Project/XcodeProj.swift index dcdd52411..e373ce40c 100644 --- a/Sources/XcodeProj/Project/XcodeProj.swift +++ b/Sources/XcodeProj/Project/XcodeProj.swift @@ -25,16 +25,7 @@ public final class XcodeProj: Equatable { guard let pbxprojPath = path.glob("*.pbxproj").first else { throw XCodeProjError.pbxprojNotFound(path: path) } - let (pbxProjData, pbxProjDictionary) = try XcodeProj.readPBXProj(path: pbxprojPath) - let context = ProjectDecodingContext( - pbxProjValueReader: { key in - pbxProjDictionary[key] - } - ) - - let plistDecoder = XcodeprojPropertyListDecoder(context: context) - pbxproj = try plistDecoder.decode(PBXProj.self, from: pbxProjData) - try pbxproj.updateProjectName(path: pbxprojPath) + pbxproj = try PBXProj(path: pbxprojPath) let xcworkspacePaths = path.glob("*.xcworkspace") if xcworkspacePaths.isEmpty { workspace = XCWorkspace() @@ -71,21 +62,6 @@ public final class XcodeProj: Equatable { lhs.pbxproj == rhs.pbxproj && lhs.sharedData == rhs.sharedData } - - // MARK: - Private - - private static func readPBXProj(path: Path) throws -> (Data, [String: Any]) { - let plistXML = try Data(contentsOf: path.url) - var propertyListFormat = PropertyListSerialization.PropertyListFormat.xml - let serialized = try PropertyListSerialization.propertyList( - from: plistXML, - options: .mutableContainersAndLeaves, - format: &propertyListFormat - ) - // swiftlint:disable:next force_cast - let pbxProjDictionary = serialized as! [String: Any] - return (plistXML, pbxProjDictionary) - } } // MARK: - @@ -117,7 +93,7 @@ extension XcodeProj: Writable { /// Returns workspace file path relative to the given path. /// /// - Parameter path: `.xcodeproj` file path - /// - Returns: worspace file path relative to the given path. + /// - Returns: workspace file path relative to the given path. public static func workspacePath(_ path: Path) -> Path { path + "project.xcworkspace" } From 5a4ce5537db95403df7823886916aa879f7b724f Mon Sep 17 00:00:00 2001 From: Maxwell Elliott Date: Wed, 1 Jun 2022 22:24:24 -0700 Subject: [PATCH 201/678] Ensure correct `LaunchAction` scheme order Adds logic and tests to ensure that the XML ordering for `LaunchAction` matches what xcode expects --- .../Extensions/AEXML+XcodeFormat.swift | 1 + .../Extensions/AEXML+XcodeFormatTests.swift | 81 +++++++++++++++---- 2 files changed, 68 insertions(+), 14 deletions(-) diff --git a/Sources/XcodeProj/Extensions/AEXML+XcodeFormat.swift b/Sources/XcodeProj/Extensions/AEXML+XcodeFormat.swift index f19dd2001..aa1161f3d 100644 --- a/Sources/XcodeProj/Extensions/AEXML+XcodeFormat.swift +++ b/Sources/XcodeProj/Extensions/AEXML+XcodeFormat.swift @@ -43,6 +43,7 @@ let attributesOrder: [String: [String]] = [ "buildConfiguration", "selectedDebuggerIdentifier", "selectedLauncherIdentifier", + "customLLDBInitFile", "language", "region", "launchStyle", diff --git a/Tests/XcodeProjTests/Extensions/AEXML+XcodeFormatTests.swift b/Tests/XcodeProjTests/Extensions/AEXML+XcodeFormatTests.swift index 529a82c31..d16b61974 100644 --- a/Tests/XcodeProjTests/Extensions/AEXML+XcodeFormatTests.swift +++ b/Tests/XcodeProjTests/Extensions/AEXML+XcodeFormatTests.swift @@ -10,7 +10,7 @@ extension String { } class AEXML_XcodeFormatTests: XCTestCase { - private let expectedXml = + private let expecteBuildActionXml = """ """ + private let expectedLaunchActionXml = + """ + + + + """ + func test_BuildAction_attributes_sorted_when_original_sorted() { - validateAttributes(attributes: [ - "parallelizeBuildables": "YES", - "runPostActionsOnFailure": "YES", - "buildImplicitDependencies": "NO", - ]) + validateAttributes( + expectedXML: expecteBuildActionXml.cleaned, + childName: "BuildAction", + attributes: [ + "parallelizeBuildables": "YES", + "runPostActionsOnFailure": "YES", + "buildImplicitDependencies": "NO", + ] + ) } func test_BuildAction_attributes_sorted_when_original_unsorted() { - validateAttributes(attributes: [ - "buildImplicitDependencies": "NO", - "parallelizeBuildables": "YES", - "runPostActionsOnFailure": "YES", - ]) + validateAttributes( + expectedXML: expecteBuildActionXml.cleaned, + childName: "BuildAction", + attributes: [ + "buildImplicitDependencies": "NO", + "parallelizeBuildables": "YES", + "runPostActionsOnFailure": "YES", + ] + ) + } + + func test_LaunchAction_attributes_sorted_when_original_sorted() { + validateAttributes( + expectedXML: expectedLaunchActionXml.cleaned, + childName: "LaunchAction", + attributes: [ + "buildConfiguration": "Debug", + "selectedLauncherIdentifier": "Xcode.DebuggerFoundation.Launcher.LLDB", + "customLLDBInitFile": "$(BAZEL_LLDB_INIT)", + "launchStyle": "0", + "allowLocationSimulation": "YES" + ] + ) + } + + func test_LaunchAction_attributes_sorted_when_original_unsorted() { + validateAttributes( + expectedXML: expectedLaunchActionXml.cleaned, + childName: "LaunchAction", + attributes: [ + "customLLDBInitFile": "$(BAZEL_LLDB_INIT)", + "allowLocationSimulation": "YES", + "buildConfiguration": "Debug", + "selectedLauncherIdentifier": "Xcode.DebuggerFoundation.Launcher.LLDB", + "launchStyle": "0", + ] + ) } - func validateAttributes(attributes: [String: String], line: UInt = #line) { + func validateAttributes( + expectedXML: String, + childName: String, + attributes: [String: String], + line: UInt = #line + ) { let document = AEXMLDocument() - let child = document.addChild(name: "BuildAction") + let child = document.addChild(name: childName) child.attributes = attributes let result = document.xmlXcodeFormat - XCTAssertEqual(expectedXml.cleaned, result.cleaned, line: line) + XCTAssertEqual(expectedXML, result.cleaned, line: line) } } From e9803042c11e3607c2eb09ca9a1c164c3c0192f8 Mon Sep 17 00:00:00 2001 From: Maxwell Elliott Date: Fri, 3 Jun 2022 13:23:42 -0700 Subject: [PATCH 202/678] spelling --- .../XcodeProjTests/Extensions/AEXML+XcodeFormatTests.swift | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Tests/XcodeProjTests/Extensions/AEXML+XcodeFormatTests.swift b/Tests/XcodeProjTests/Extensions/AEXML+XcodeFormatTests.swift index d16b61974..37d9fa17c 100644 --- a/Tests/XcodeProjTests/Extensions/AEXML+XcodeFormatTests.swift +++ b/Tests/XcodeProjTests/Extensions/AEXML+XcodeFormatTests.swift @@ -10,7 +10,7 @@ extension String { } class AEXML_XcodeFormatTests: XCTestCase { - private let expecteBuildActionXml = + private let expectedBuildActionXml = """ Date: Fri, 10 Jun 2022 22:27:15 -0700 Subject: [PATCH 203/678] Update Tests/XcodeProjTests/Extensions/AEXML+XcodeFormatTests.swift Co-authored-by: Daniele Formichelli --- Tests/XcodeProjTests/Extensions/AEXML+XcodeFormatTests.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/XcodeProjTests/Extensions/AEXML+XcodeFormatTests.swift b/Tests/XcodeProjTests/Extensions/AEXML+XcodeFormatTests.swift index 37d9fa17c..cb4ea0284 100644 --- a/Tests/XcodeProjTests/Extensions/AEXML+XcodeFormatTests.swift +++ b/Tests/XcodeProjTests/Extensions/AEXML+XcodeFormatTests.swift @@ -94,6 +94,6 @@ class AEXML_XcodeFormatTests: XCTestCase { let child = document.addChild(name: childName) child.attributes = attributes let result = document.xmlXcodeFormat - XCTAssertEqual(expectedXML, result.cleaned, line: line) + XCTAssertEqual(result.cleaned, expectedXML, line: line) } } From 4dccbc03047c1b82bb2091ac29df671d4d4994b8 Mon Sep 17 00:00:00 2001 From: Maxwell Elliott Date: Thu, 16 Jun 2022 12:02:24 -0700 Subject: [PATCH 204/678] Fix TestAction scheme attribute ordering (#689) - The `customLLDBInitFile` attribute is now ordered correctly within the scheme's `TestAction` - This can be verified by manually adding a custom lldb init to a scheme's test action and inspecting the `.xcscheme` file --- .../Extensions/AEXML+XcodeFormat.swift | 1 + .../Extensions/AEXML+XcodeFormatTests.swift | 37 +++++++++++++++++++ 2 files changed, 38 insertions(+) diff --git a/Sources/XcodeProj/Extensions/AEXML+XcodeFormat.swift b/Sources/XcodeProj/Extensions/AEXML+XcodeFormat.swift index aa1161f3d..6ac2cbc08 100644 --- a/Sources/XcodeProj/Extensions/AEXML+XcodeFormat.swift +++ b/Sources/XcodeProj/Extensions/AEXML+XcodeFormat.swift @@ -33,6 +33,7 @@ let attributesOrder: [String: [String]] = [ "buildConfiguration", "selectedDebuggerIdentifier", "selectedLauncherIdentifier", + "customLLDBInitFile", "language", "region", "codeCoverageEnabled", diff --git a/Tests/XcodeProjTests/Extensions/AEXML+XcodeFormatTests.swift b/Tests/XcodeProjTests/Extensions/AEXML+XcodeFormatTests.swift index cb4ea0284..c7abde562 100644 --- a/Tests/XcodeProjTests/Extensions/AEXML+XcodeFormatTests.swift +++ b/Tests/XcodeProjTests/Extensions/AEXML+XcodeFormatTests.swift @@ -32,6 +32,17 @@ class AEXML_XcodeFormatTests: XCTestCase { """ + private let expectedTestActionXml = + """ + + + + """ + func test_BuildAction_attributes_sorted_when_original_sorted() { validateAttributes( expectedXML: expectedBuildActionXml.cleaned, @@ -84,6 +95,32 @@ class AEXML_XcodeFormatTests: XCTestCase { ) } + func test_TestAction_attributes_sorted_when_original_sorted() { + validateAttributes( + expectedXML: expectedTestActionXml.cleaned, + childName: "TestAction", + attributes: [ + "buildConfiguration": "Debug", + "customLLDBInitFile": "$(BAZEL_LLDB_INIT)", + "selectedLauncherIdentifier": "Xcode.DebuggerFoundation.Launcher.LLDB", + "shouldUseLaunchSchemeArgsEnv": "YES" + ] + ) + } + + func test_TestAction_attributes_sorted_when_original_unsorted() { + validateAttributes( + expectedXML: expectedTestActionXml.cleaned, + childName: "TestAction", + attributes: [ + "shouldUseLaunchSchemeArgsEnv": "YES", + "buildConfiguration": "Debug", + "customLLDBInitFile": "$(BAZEL_LLDB_INIT)", + "selectedLauncherIdentifier": "Xcode.DebuggerFoundation.Launcher.LLDB" + ] + ) + } + func validateAttributes( expectedXML: String, childName: String, From de6f72269fe04274e6aac6dc4a4740dfa9a33f50 Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Sat, 25 Jun 2022 15:33:45 +0200 Subject: [PATCH 205/678] docs: add mtj0928 as a contributor for code (#692) * docs: update README.md [skip ci] * docs: update .all-contributorsrc [skip ci] Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com> --- .all-contributorsrc | 9 +++++++++ README.md | 3 ++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/.all-contributorsrc b/.all-contributorsrc index c0351ffdc..2c7ab1b24 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -166,6 +166,15 @@ "contributions": [ "code" ] + }, + { + "login": "mtj0928", + "name": "matsuji", + "avatar_url": "https://avatars.githubusercontent.com/u/12427733?v=4", + "profile": "https://github.com/mtj0928", + "contributions": [ + "code" + ] } ], "contributorsPerLine": 7, diff --git a/README.md b/README.md index 72831c173..26d7647eb 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # XcodeProj -[![All Contributors](https://img.shields.io/badge/all_contributors-18-orange.svg?style=flat-square)](#contributors-) +[![All Contributors](https://img.shields.io/badge/all_contributors-19-orange.svg?style=flat-square)](#contributors-) [![Swift Package Manager](https://img.shields.io/badge/swift%20package%20manager-compatible-brightgreen.svg)](https://swift.org/package-manager/) @@ -176,6 +176,7 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
Kristopher Jackson

💻
Jake Prickett

💻
Jake Adams

💻 +
matsuji

💻 From 2fe19ca7d99a92e95bbbe95e6aa60f7b26860b66 Mon Sep 17 00:00:00 2001 From: matsuji Date: Wed, 29 Jun 2022 15:44:51 +0900 Subject: [PATCH 206/678] Add `.extensionKitExtension` as the new `PBXProductType` (#691) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Resolves: https://github.com/tuist/XcodeProj/issues/687 ### Short description 📝 From Xcode14 beta 1, `com.apple.product-type.extensionkit-extension` was introduced as the new productType. The new productType is used for a new app extension like AppIntents Extension. ### Solution 📦 Added `.extensionKitExtension` as the new case of `PBXProductType` in this PR, to support the new productType. ### Implementation 👩‍💻👨‍💻 - [x] Added `.extensionKitExtension` as the new case of `PBXProductType` - [x] Added `fileExtension` of `.extensionKitExtension` - [x] Added a new UnitTest for `.extensionKitExtension` --- Sources/XcodeProj/Objects/Targets/PBXProductType.swift | 4 +++- .../XcodeProjTests/Objects/Targets/PBXProductTypeTests.swift | 4 ++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Sources/XcodeProj/Objects/Targets/PBXProductType.swift b/Sources/XcodeProj/Objects/Targets/PBXProductType.swift index 7ec12ffb1..21dbf8b78 100644 --- a/Sources/XcodeProj/Objects/Targets/PBXProductType.swift +++ b/Sources/XcodeProj/Objects/Targets/PBXProductType.swift @@ -12,6 +12,7 @@ public enum PBXProductType: String, Decodable { case unitTestBundle = "com.apple.product-type.bundle.unit-test" case uiTestBundle = "com.apple.product-type.bundle.ui-testing" case appExtension = "com.apple.product-type.app-extension" + case extensionKitExtension = "com.apple.product-type.extensionkit-extension" case commandLineTool = "com.apple.product-type.tool" case watchApp = "com.apple.product-type.application.watchapp" case watch2App = "com.apple.product-type.application.watchapp2" @@ -47,7 +48,8 @@ public enum PBXProductType: String, Decodable { return "bundle" case .unitTestBundle, .uiTestBundle: return "xctest" - case .appExtension, .tvExtension, .watchExtension, .watch2Extension, .messagesExtension, .stickerPack, .xcodeExtension, .intentsServiceExtension: + case .appExtension, .extensionKitExtension, .tvExtension, .watchExtension, .watch2Extension, .messagesExtension, .stickerPack, .xcodeExtension, + .intentsServiceExtension: return "appex" case .commandLineTool: return nil diff --git a/Tests/XcodeProjTests/Objects/Targets/PBXProductTypeTests.swift b/Tests/XcodeProjTests/Objects/Targets/PBXProductTypeTests.swift index f0c62e312..83d62f3d0 100644 --- a/Tests/XcodeProjTests/Objects/Targets/PBXProductTypeTests.swift +++ b/Tests/XcodeProjTests/Objects/Targets/PBXProductTypeTests.swift @@ -39,6 +39,10 @@ final class PBXProductTypeTests: XCTestCase { XCTAssertEqual(PBXProductType.appExtension.rawValue, "com.apple.product-type.app-extension") } + func test_extensionKitExtension_hasTheRightValue() { + XCTAssertEqual(PBXProductType.extensionKitExtension.rawValue, "com.apple.product-type.extensionkit-extension") + } + func test_commandLineTool_hasTheRightValue() { XCTAssertEqual(PBXProductType.commandLineTool.rawValue, "com.apple.product-type.tool") } From e02240fd29933c9fd24db9859659f44f4f45b3f2 Mon Sep 17 00:00:00 2001 From: Bogdan Belogurov Date: Thu, 30 Jun 2022 11:01:18 +0300 Subject: [PATCH 207/678] Add disablePerformanceAntipatternChecker to scheme (#694) * Add disablePerformanceAntipatternChecker to LaunchAction * Cover with tests disablePerformanceAntipatternChecker action * Update CHANGELOG.md - Add entry about adding `disablePerformanceAntipatternChecker` action --- CHANGELOG.md | 4 ++++ Sources/XcodeProj/Scheme/XCScheme+LaunchAction.swift | 8 ++++++++ Tests/XcodeProjTests/Scheme/XCSchemeTests.swift | 3 +++ 3 files changed, 15 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d3ec3b4b1..22d25cbae 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ ## Next +### Added + +- Added `disablePerformanceAntipatternChecker` to `XCScheme` [#693](https://github.com/tuist/XcodeProj/pull/603) by [@Bogdan-Belogurov](https://github.com/Bogdan-Belogurov) + ## 8.7.1 ### Changed diff --git a/Sources/XcodeProj/Scheme/XCScheme+LaunchAction.swift b/Sources/XcodeProj/Scheme/XCScheme+LaunchAction.swift index 28f794df5..10e2ca44a 100644 --- a/Sources/XcodeProj/Scheme/XCScheme+LaunchAction.swift +++ b/Sources/XcodeProj/Scheme/XCScheme+LaunchAction.swift @@ -57,6 +57,7 @@ extension XCScheme { public var enableUBSanitizer: Bool public var stopOnEveryUBSanitizerIssue: Bool public var disableMainThreadChecker: Bool + public var disablePerformanceAntipatternChecker: Bool public var stopOnEveryMainThreadCheckerIssue: Bool public var additionalOptions: [AdditionalOption] public var commandlineArguments: CommandLineArguments? @@ -96,6 +97,7 @@ extension XCScheme { enableUBSanitizer: Bool = false, stopOnEveryUBSanitizerIssue: Bool = false, disableMainThreadChecker: Bool = false, + disablePerformanceAntipatternChecker: Bool = false, stopOnEveryMainThreadCheckerIssue: Bool = false, additionalOptions: [AdditionalOption] = [], commandlineArguments: CommandLineArguments? = nil, @@ -129,6 +131,7 @@ extension XCScheme { self.enableUBSanitizer = enableUBSanitizer self.stopOnEveryUBSanitizerIssue = stopOnEveryUBSanitizerIssue self.disableMainThreadChecker = disableMainThreadChecker + self.disablePerformanceAntipatternChecker = disablePerformanceAntipatternChecker self.stopOnEveryMainThreadCheckerIssue = stopOnEveryMainThreadCheckerIssue self.additionalOptions = additionalOptions self.commandlineArguments = commandlineArguments @@ -191,6 +194,7 @@ extension XCScheme { enableUBSanitizer = element.attributes["enableUBSanitizer"] == "YES" stopOnEveryUBSanitizerIssue = element.attributes["stopOnEveryUBSanitizerIssue"] == "YES" disableMainThreadChecker = element.attributes["disableMainThreadChecker"] == "YES" + disablePerformanceAntipatternChecker = element.attributes["disablePerformanceAntipatternChecker"] == "YES" stopOnEveryMainThreadCheckerIssue = element.attributes["stopOnEveryMainThreadCheckerIssue"] == "YES" additionalOptions = try element["AdditionalOptions"]["AdditionalOption"] @@ -267,6 +271,9 @@ extension XCScheme { if disableMainThreadChecker { attributes["disableMainThreadChecker"] = disableMainThreadChecker.xmlString } + if disablePerformanceAntipatternChecker { + attributes["disablePerformanceAntipatternChecker"] = disablePerformanceAntipatternChecker.xmlString + } if stopOnEveryMainThreadCheckerIssue { attributes["stopOnEveryMainThreadCheckerIssue"] = stopOnEveryMainThreadCheckerIssue.xmlString } @@ -365,6 +372,7 @@ extension XCScheme { enableUBSanitizer == rhs.enableUBSanitizer && stopOnEveryUBSanitizerIssue == rhs.stopOnEveryUBSanitizerIssue && disableMainThreadChecker == rhs.disableMainThreadChecker && + disablePerformanceAntipatternChecker == rhs.disablePerformanceAntipatternChecker && stopOnEveryMainThreadCheckerIssue == rhs.stopOnEveryMainThreadCheckerIssue && additionalOptions == rhs.additionalOptions && commandlineArguments == rhs.commandlineArguments && diff --git a/Tests/XcodeProjTests/Scheme/XCSchemeTests.swift b/Tests/XcodeProjTests/Scheme/XCSchemeTests.swift index 98fcc5190..f3eb64681 100644 --- a/Tests/XcodeProjTests/Scheme/XCSchemeTests.swift +++ b/Tests/XcodeProjTests/Scheme/XCSchemeTests.swift @@ -460,6 +460,7 @@ final class XCSchemeIntegrationTests: XCTestCase { XCTAssertEqual(scheme.launchAction?.enableUBSanitizer, false) XCTAssertEqual(scheme.launchAction?.stopOnEveryUBSanitizerIssue, false) XCTAssertEqual(scheme.launchAction?.disableMainThreadChecker, false) + XCTAssertEqual(scheme.launchAction?.disablePerformanceAntipatternChecker, false) XCTAssertEqual(scheme.launchAction?.stopOnEveryMainThreadCheckerIssue, false) XCTAssertEqual(scheme.launchAction?.additionalOptions.isEmpty, true) @@ -544,6 +545,7 @@ final class XCSchemeIntegrationTests: XCTestCase { XCTAssertEqual(scheme.launchAction?.enableUBSanitizer, false) XCTAssertEqual(scheme.launchAction?.stopOnEveryUBSanitizerIssue, false) XCTAssertEqual(scheme.launchAction?.disableMainThreadChecker, false) + XCTAssertEqual(scheme.launchAction?.disablePerformanceAntipatternChecker, false) XCTAssertEqual(scheme.launchAction?.stopOnEveryMainThreadCheckerIssue, false) XCTAssertEqual(scheme.launchAction?.additionalOptions.isEmpty, true) XCTAssertNil(scheme.launchAction?.storeKitConfigurationFileReference) @@ -636,6 +638,7 @@ final class XCSchemeIntegrationTests: XCTestCase { XCTAssertEqual(scheme.launchAction?.enableUBSanitizer, false) XCTAssertEqual(scheme.launchAction?.stopOnEveryUBSanitizerIssue, false) XCTAssertEqual(scheme.launchAction?.disableMainThreadChecker, false) + XCTAssertEqual(scheme.launchAction?.disablePerformanceAntipatternChecker, false) XCTAssertEqual(scheme.launchAction?.stopOnEveryMainThreadCheckerIssue, false) XCTAssertEqual(scheme.launchAction?.additionalOptions.isEmpty, true) XCTAssertNil(scheme.launchAction?.storeKitConfigurationFileReference) From 6b61781a5a96731a4051c59ed9c3b5a5566c77e9 Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Thu, 30 Jun 2022 11:15:54 +0200 Subject: [PATCH 208/678] docs: add Bogdan-Belogurov as a contributor for code (#695) * docs: update README.md [skip ci] * docs: update .all-contributorsrc [skip ci] Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com> --- .all-contributorsrc | 9 +++++++++ README.md | 3 ++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/.all-contributorsrc b/.all-contributorsrc index 2c7ab1b24..971a24924 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -175,6 +175,15 @@ "contributions": [ "code" ] + }, + { + "login": "Bogdan-Belogurov", + "name": "Bogdan Belogurov", + "avatar_url": "https://avatars.githubusercontent.com/u/39379705?v=4", + "profile": "https://github.com/Bogdan-Belogurov", + "contributions": [ + "code" + ] } ], "contributorsPerLine": 7, diff --git a/README.md b/README.md index 26d7647eb..890fe4647 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # XcodeProj -[![All Contributors](https://img.shields.io/badge/all_contributors-19-orange.svg?style=flat-square)](#contributors-) +[![All Contributors](https://img.shields.io/badge/all_contributors-20-orange.svg?style=flat-square)](#contributors-) [![Swift Package Manager](https://img.shields.io/badge/swift%20package%20manager-compatible-brightgreen.svg)](https://swift.org/package-manager/) @@ -177,6 +177,7 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
Jake Prickett

💻
Jake Adams

💻
matsuji

💻 +
Bogdan Belogurov

💻 From 2fa16ab94fe8f615f21eb926f22d22b6194bebc6 Mon Sep 17 00:00:00 2001 From: Maxwell Elliott Date: Thu, 7 Jul 2022 07:36:46 -0400 Subject: [PATCH 209/678] Fix `Testables` element ordering (#702) --- Sources/XcodeProj/Scheme/XCScheme+TestAction.swift | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Sources/XcodeProj/Scheme/XCScheme+TestAction.swift b/Sources/XcodeProj/Scheme/XCScheme+TestAction.swift index 7c2d0cc47..d95caeb15 100644 --- a/Sources/XcodeProj/Scheme/XCScheme+TestAction.swift +++ b/Sources/XcodeProj/Scheme/XCScheme+TestAction.swift @@ -194,15 +194,16 @@ extension XCScheme { } } - let testablesElement = element.addChild(name: "Testables") - testables.forEach { testable in - testablesElement.addChild(testable.xmlElement()) - } if let macroExpansion = macroExpansion { let macro = element.addChild(name: "MacroExpansion") macro.addChild(macroExpansion.xmlElement()) } + let testablesElement = element.addChild(name: "Testables") + testables.forEach { testable in + testablesElement.addChild(testable.xmlElement()) + } + if let commandlineArguments = commandlineArguments { element.addChild(commandlineArguments.xmlElement()) } From b952b2e5d6488259ddbf70c4ff5a7a3d670a02d6 Mon Sep 17 00:00:00 2001 From: Maxwell Elliott Date: Thu, 7 Jul 2022 07:36:58 -0400 Subject: [PATCH 210/678] Fix `RemoteRunnable` scheme attr order (#701) --- .../Extensions/AEXML+XcodeFormat.swift | 5 +++++ .../Extensions/AEXML+XcodeFormatTests.swift | 22 +++++++++++++++++++ 2 files changed, 27 insertions(+) diff --git a/Sources/XcodeProj/Extensions/AEXML+XcodeFormat.swift b/Sources/XcodeProj/Extensions/AEXML+XcodeFormat.swift index 6ac2cbc08..c9c04f8c2 100644 --- a/Sources/XcodeProj/Extensions/AEXML+XcodeFormat.swift +++ b/Sources/XcodeProj/Extensions/AEXML+XcodeFormat.swift @@ -92,6 +92,11 @@ let attributesOrder: [String: [String]] = [ "symbolName", "moduleName", ], + "RemoteRunnable": [ + "runnableDebuggingMode", + "BundleIdentifier", + "RemotePath" + ] ] extension AEXMLElement { diff --git a/Tests/XcodeProjTests/Extensions/AEXML+XcodeFormatTests.swift b/Tests/XcodeProjTests/Extensions/AEXML+XcodeFormatTests.swift index c7abde562..638f4ffc9 100644 --- a/Tests/XcodeProjTests/Extensions/AEXML+XcodeFormatTests.swift +++ b/Tests/XcodeProjTests/Extensions/AEXML+XcodeFormatTests.swift @@ -43,6 +43,16 @@ class AEXML_XcodeFormatTests: XCTestCase { """ + private let expectedRemoteRunnableXml = + """ + + + + """ + func test_BuildAction_attributes_sorted_when_original_sorted() { validateAttributes( expectedXML: expectedBuildActionXml.cleaned, @@ -121,6 +131,18 @@ class AEXML_XcodeFormatTests: XCTestCase { ) } + func test_RemoteRunnable() { + validateAttributes( + expectedXML: expectedRemoteRunnableXml.cleaned, + childName: "RemoteRunnable", + attributes: [ + "BundleIdentifier": "BundleID", + "RemotePath": "REMOTE_PATH", + "runnableDebuggingMode": "2" + ] + ) + } + func validateAttributes( expectedXML: String, childName: String, From cb1a9683794492846293e5da2b7837e02b83ced2 Mon Sep 17 00:00:00 2001 From: Maxwell Elliott Date: Thu, 7 Jul 2022 07:37:10 -0400 Subject: [PATCH 211/678] Missing `askForAppToLaunch` in `ProfileAction` (#700) --- Fixtures/Schemes/RunnableWithoutBuildableReference.xcscheme | 1 + Sources/XcodeProj/Scheme/XCScheme+ProfileAction.swift | 3 +++ Tests/XcodeProjTests/Scheme/XCSchemeTests.swift | 2 +- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Fixtures/Schemes/RunnableWithoutBuildableReference.xcscheme b/Fixtures/Schemes/RunnableWithoutBuildableReference.xcscheme index 669fdba94..600c7822a 100644 --- a/Fixtures/Schemes/RunnableWithoutBuildableReference.xcscheme +++ b/Fixtures/Schemes/RunnableWithoutBuildableReference.xcscheme @@ -72,6 +72,7 @@
Date: Thu, 7 Jul 2022 07:37:21 -0400 Subject: [PATCH 212/678] Add `launchAutomaticallySubstyle`->`ProfileAction` (#699) --- .../RunnableWithoutBuildableReference.xcscheme | 3 ++- .../XcodeProj/Scheme/XCScheme+ProfileAction.swift | 12 ++++++++++-- Tests/XcodeProjTests/Scheme/XCSchemeTests.swift | 1 + 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/Fixtures/Schemes/RunnableWithoutBuildableReference.xcscheme b/Fixtures/Schemes/RunnableWithoutBuildableReference.xcscheme index 600c7822a..3849dcb0d 100644 --- a/Fixtures/Schemes/RunnableWithoutBuildableReference.xcscheme +++ b/Fixtures/Schemes/RunnableWithoutBuildableReference.xcscheme @@ -77,7 +77,8 @@ shouldUseLaunchSchemeArgsEnv = "YES" savedToolIdentifier = "" useCustomWorkingDirectory = "NO" - debugDocumentVersioning = "YES"> + debugDocumentVersioning = "YES" + launchAutomaticallySubstyle = "2"> Date: Sat, 9 Jul 2022 04:22:24 -0400 Subject: [PATCH 213/678] Fix ordering of Scheme toplevel attrs (#698) - Fix for incorrect ordering of `Scheme` attrs when using `wasCreatedForAppExtension` value --- .../Extensions/AEXML+XcodeFormat.swift | 5 +++ .../Extensions/AEXML+XcodeFormatTests.swift | 34 +++++++++++++++++++ 2 files changed, 39 insertions(+) diff --git a/Sources/XcodeProj/Extensions/AEXML+XcodeFormat.swift b/Sources/XcodeProj/Extensions/AEXML+XcodeFormat.swift index c9c04f8c2..e51edd75c 100644 --- a/Sources/XcodeProj/Extensions/AEXML+XcodeFormat.swift +++ b/Sources/XcodeProj/Extensions/AEXML+XcodeFormat.swift @@ -96,6 +96,11 @@ let attributesOrder: [String: [String]] = [ "runnableDebuggingMode", "BundleIdentifier", "RemotePath" + ], + "Scheme": [ + "LastUpgradeVersion", + "wasCreatedForAppExtension", + "version" ] ] diff --git a/Tests/XcodeProjTests/Extensions/AEXML+XcodeFormatTests.swift b/Tests/XcodeProjTests/Extensions/AEXML+XcodeFormatTests.swift index 638f4ffc9..7c86759fd 100644 --- a/Tests/XcodeProjTests/Extensions/AEXML+XcodeFormatTests.swift +++ b/Tests/XcodeProjTests/Extensions/AEXML+XcodeFormatTests.swift @@ -43,6 +43,16 @@ class AEXML_XcodeFormatTests: XCTestCase { """ + private let expectedSchemeXml = + """ + + + + """ + private let expectedRemoteRunnableXml = """ @@ -131,6 +141,30 @@ class AEXML_XcodeFormatTests: XCTestCase { ) } + func test_Scheme_attributes_sorted_when_original_sorted() { + validateAttributes( + expectedXML: expectedSchemeXml.cleaned, + childName: "Scheme", + attributes: [ + "LastUpgradeVersion": "1320", + "wasCreatedForAppExtension": "YES", + "version": "1.7" + ] + ) + } + + func test_Scheme_attributes_sorted_when_original_unsorted() { + validateAttributes( + expectedXML: expectedSchemeXml.cleaned, + childName: "Scheme", + attributes: [ + "wasCreatedForAppExtension": "YES", + "LastUpgradeVersion": "1320", + "version": "1.7" + ] + ) + } + func test_RemoteRunnable() { validateAttributes( expectedXML: expectedRemoteRunnableXml.cleaned, From 59779d24b3423d31cbd21a9d8ee18ad70cbe292b Mon Sep 17 00:00:00 2001 From: Maxwell Elliott Date: Sat, 9 Jul 2022 04:40:42 -0400 Subject: [PATCH 214/678] Use `Runnable` in `ProfileAction` (#703) - This is needed to support application extension schemes (like WidgetKit Extensions) - This matches the behavior of `LaunchAction` by accepting the more abstract `Runnable` type - To avoid breaking changes, conveinece init and public properties were added that proxy `buildableProductRunnable` to `runnable` --- .../Scheme/XCScheme+ProfileAction.swift | 60 ++++++++++++++++--- .../XcodeProjTests/Scheme/XCSchemeTests.swift | 42 ++++++------- 2 files changed, 73 insertions(+), 29 deletions(-) diff --git a/Sources/XcodeProj/Scheme/XCScheme+ProfileAction.swift b/Sources/XcodeProj/Scheme/XCScheme+ProfileAction.swift index fe2cd3137..c96a5d023 100644 --- a/Sources/XcodeProj/Scheme/XCScheme+ProfileAction.swift +++ b/Sources/XcodeProj/Scheme/XCScheme+ProfileAction.swift @@ -10,7 +10,11 @@ extension XCScheme { // MARK: - Attributes - public var buildableProductRunnable: BuildableProductRunnable? + public var runnable: Runnable? + public var buildableProductRunnable: BuildableProductRunnable? { + // For backwards compatibility - can be removed in the next major version + runnable as? BuildableProductRunnable + } public var buildConfiguration: String public var shouldUseLaunchSchemeArgsEnv: Bool public var savedToolIdentifier: String @@ -26,7 +30,7 @@ extension XCScheme { // MARK: - Init - public init(buildableProductRunnable: BuildableProductRunnable?, + public init(runnable: Runnable?, buildConfiguration: String, preActions: [ExecutionAction] = [], postActions: [ExecutionAction] = [], @@ -41,7 +45,7 @@ extension XCScheme { environmentVariables: [EnvironmentVariable]? = nil, enableTestabilityWhenProfilingTests: Bool = true, launchAutomaticallySubstyle: String? = nil) { - self.buildableProductRunnable = buildableProductRunnable + self.runnable = runnable self.buildConfiguration = buildConfiguration self.macroExpansion = macroExpansion self.shouldUseLaunchSchemeArgsEnv = shouldUseLaunchSchemeArgsEnv @@ -57,6 +61,41 @@ extension XCScheme { super.init(preActions, postActions) } + public convenience init( + buildableProductRunnable: Runnable?, + buildConfiguration: String, + preActions: [ExecutionAction] = [], + postActions: [ExecutionAction] = [], + macroExpansion: BuildableReference? = nil, + shouldUseLaunchSchemeArgsEnv: Bool = true, + savedToolIdentifier: String = "", + ignoresPersistentStateOnLaunch: Bool = false, + useCustomWorkingDirectory: Bool = false, + debugDocumentVersioning: Bool = true, + askForAppToLaunch: Bool? = nil, + commandlineArguments: CommandLineArguments? = nil, + environmentVariables: [EnvironmentVariable]? = nil, + enableTestabilityWhenProfilingTests: Bool = true, + launchAutomaticallySubstyle: String? = nil) + { + self.init( + runnable: buildableProductRunnable, + buildConfiguration: buildConfiguration, + preActions: preActions, + postActions: postActions, + macroExpansion: macroExpansion, + shouldUseLaunchSchemeArgsEnv: shouldUseLaunchSchemeArgsEnv, + savedToolIdentifier: savedToolIdentifier, + ignoresPersistentStateOnLaunch: ignoresPersistentStateOnLaunch, + useCustomWorkingDirectory: useCustomWorkingDirectory, + debugDocumentVersioning: debugDocumentVersioning, + askForAppToLaunch: askForAppToLaunch, + commandlineArguments: commandlineArguments, + environmentVariables: environmentVariables, + enableTestabilityWhenProfilingTests: enableTestabilityWhenProfilingTests, + launchAutomaticallySubstyle: launchAutomaticallySubstyle) + } + override init(element: AEXMLElement) throws { buildConfiguration = element.attributes["buildConfiguration"] ?? ProfileAction.defaultBuildConfiguration shouldUseLaunchSchemeArgsEnv = element.attributes["shouldUseLaunchSchemeArgsEnv"].map { $0 == "YES" } ?? true @@ -66,10 +105,15 @@ extension XCScheme { askForAppToLaunch = element.attributes["askForAppToLaunch"].map { $0 == "YES" || $0 == "Yes" } ignoresPersistentStateOnLaunch = element.attributes["ignoresPersistentStateOnLaunch"].map { $0 == "YES" } ?? false + // Runnable let buildableProductRunnableElement = element["BuildableProductRunnable"] + let remoteRunnableElement = element["RemoteRunnable"] if buildableProductRunnableElement.error == nil { - buildableProductRunnable = try BuildableProductRunnable(element: buildableProductRunnableElement) + runnable = try BuildableProductRunnable(element: buildableProductRunnableElement) + } else if remoteRunnableElement.error == nil { + runnable = try RemoteRunnable(element: remoteRunnableElement) } + let buildableReferenceElement = element["MacroExpansion"]["BuildableReference"] if buildableReferenceElement.error == nil { macroExpansion = try BuildableReference(element: buildableReferenceElement) @@ -100,6 +144,9 @@ extension XCScheme { "debugDocumentVersioning": debugDocumentVersioning.xmlString, ]) super.writeXML(parent: element) + if let runnable = runnable { + element.addChild(runnable.xmlElement()) + } if let askForAppToLaunch = askForAppToLaunch { element.attributes["askForAppToLaunch"] = askForAppToLaunch.xmlString } @@ -109,9 +156,6 @@ extension XCScheme { if !enableTestabilityWhenProfilingTests { element.attributes["enableTestabilityWhenProfilingTests"] = "No" } - if let buildableProductRunnable = buildableProductRunnable { - element.addChild(buildableProductRunnable.xmlElement()) - } if let commandlineArguments = commandlineArguments { element.addChild(commandlineArguments.xmlElement()) } @@ -135,7 +179,7 @@ extension XCScheme { override func isEqual(to: Any?) -> Bool { guard let rhs = to as? ProfileAction else { return false } return super.isEqual(to: to) && - buildableProductRunnable == rhs.buildableProductRunnable && + runnable == rhs.runnable && buildConfiguration == rhs.buildConfiguration && shouldUseLaunchSchemeArgsEnv == rhs.shouldUseLaunchSchemeArgsEnv && savedToolIdentifier == rhs.savedToolIdentifier && diff --git a/Tests/XcodeProjTests/Scheme/XCSchemeTests.swift b/Tests/XcodeProjTests/Scheme/XCSchemeTests.swift index 9d232a010..2ec14710c 100644 --- a/Tests/XcodeProjTests/Scheme/XCSchemeTests.swift +++ b/Tests/XcodeProjTests/Scheme/XCSchemeTests.swift @@ -15,7 +15,7 @@ final class XCSchemeIntegrationTests: XCTestCase { modify: { $0 }, assertion: { assert(scheme: $1) }) } - + func test_read_runnableWithoutBuildableReferenceScheme() { let subject = try? XCScheme(path: runnableWithoutBuildableReferenceSchemePath) @@ -24,7 +24,7 @@ final class XCSchemeIntegrationTests: XCTestCase { assert(runnableWithoutBuildableReferenceScheme: subject) } } - + func test_remoteRunnable_runnableWithoutBuildableReferenceScheme() throws { // Given / When let subject = try XCScheme(path: runnableWithoutBuildableReferenceSchemePath) @@ -36,7 +36,7 @@ final class XCSchemeIntegrationTests: XCTestCase { XCTAssertEqual(remoteRunnable.runnableDebuggingMode, "1") XCTAssertEqual(remoteRunnable.remotePath, "/var/containers/Bundle/Application/018F0933-05E8-4359-9955-39E0523C4246/Ava.app") } - + func test_write_runnableWithoutBuildableReferenceScheme() { testWrite(from: runnableWithoutBuildableReferenceSchemePath, initModel: { try? XCScheme(path: $0) }, @@ -285,7 +285,7 @@ final class XCSchemeIntegrationTests: XCTestCase { XCTAssertNotNil(buildableXML.attributes["BlueprintName"]) XCTAssertNil(buildableXML.attributes["BlueprintIdentifier"]) } - + func test_buildAction_runPostActionsOnFailure() throws { // Given / When let subject = try XCScheme(path: runPostActionsOnFailureSchemePath) @@ -399,12 +399,12 @@ final class XCSchemeIntegrationTests: XCTestCase { XCTAssertEqual(scheme.profileAction?.useCustomWorkingDirectory, false) XCTAssertEqual(scheme.profileAction?.debugDocumentVersioning, true) XCTAssertNil(scheme.profileAction?.askForAppToLaunch) - XCTAssertEqual(scheme.profileAction?.buildableProductRunnable?.runnableDebuggingMode, "0") - XCTAssertEqual(scheme.profileAction?.buildableProductRunnable?.buildableReference?.buildableIdentifier, "primary") - XCTAssertEqual(scheme.profileAction?.buildableProductRunnable?.buildableReference?.blueprintIdentifier, "23766C111EAA3484007A9026") - XCTAssertEqual(scheme.profileAction?.buildableProductRunnable?.buildableReference?.buildableName, "iOS.app") - XCTAssertEqual(scheme.profileAction?.buildableProductRunnable?.buildableReference?.blueprintName, "iOS") - XCTAssertEqual(scheme.profileAction?.buildableProductRunnable?.buildableReference?.referencedContainer, "container:Project.xcodeproj") + XCTAssertEqual(scheme.profileAction?.runnable?.runnableDebuggingMode, "0") + XCTAssertEqual(scheme.profileAction?.runnable?.buildableReference?.buildableIdentifier, "primary") + XCTAssertEqual(scheme.profileAction?.runnable?.buildableReference?.blueprintIdentifier, "23766C111EAA3484007A9026") + XCTAssertEqual(scheme.profileAction?.runnable?.buildableReference?.buildableName, "iOS.app") + XCTAssertEqual(scheme.profileAction?.runnable?.buildableReference?.blueprintName, "iOS") + XCTAssertEqual(scheme.profileAction?.runnable?.buildableReference?.referencedContainer, "container:Project.xcodeproj") XCTAssertEqual(scheme.profileAction?.preActions.isEmpty, true) XCTAssertEqual(scheme.profileAction?.postActions.first?.title, "Run Script") XCTAssertEqual(scheme.profileAction?.postActions.first?.scriptText, "echo analysis done") @@ -476,7 +476,7 @@ final class XCSchemeIntegrationTests: XCTestCase { XCTAssertTrue(launchCLIArgs.arguments[0].enabled) XCTAssertNil(scheme.launchAction?.customLLDBInitFile) } - + private func assert(runnableWithoutBuildableReferenceScheme scheme: XCScheme) { XCTAssertEqual(scheme.version, "2.0") XCTAssertEqual(scheme.lastUpgradeVersion, "1230", "\(scheme.lastUpgradeVersion!) not equals 1230") @@ -496,7 +496,7 @@ final class XCSchemeIntegrationTests: XCTestCase { XCTAssertEqual(scheme.buildAction?.buildActionEntries[0].buildableReference.buildableName, "Ava.app") XCTAssertEqual(scheme.buildAction?.buildActionEntries[0].buildableReference.blueprintName, "core-ava") XCTAssertEqual(scheme.buildAction?.buildActionEntries[0].buildableReference.referencedContainer, "container:core-ava.xcodeproj") - + XCTAssertTrue(scheme.buildAction?.buildActionEntries[1].buildFor.contains(.testing) == true) XCTAssertTrue(scheme.buildAction?.buildActionEntries[1].buildFor.contains(.running) == false) XCTAssertTrue(scheme.buildAction?.buildActionEntries[1].buildFor.contains(.profiling) == false) @@ -555,14 +555,14 @@ final class XCSchemeIntegrationTests: XCTestCase { XCTAssertEqual(scheme.launchAction?.macroExpansion?.blueprintName, "core-ava") XCTAssertEqual(scheme.launchAction?.macroExpansion?.referencedContainer, "container:core-ava.xcodeproj") XCTAssertNil(scheme.launchAction?.environmentVariables) - + // Profile action - XCTAssertEqual(scheme.profileAction?.buildableProductRunnable?.runnableDebuggingMode, "0") - XCTAssertEqual(scheme.profileAction?.buildableProductRunnable?.buildableReference?.blueprintIdentifier, "FE7C11D21B6DB70D0041DF02") - XCTAssertEqual(scheme.profileAction?.buildableProductRunnable?.buildableReference?.buildableIdentifier, "primary") - XCTAssertEqual(scheme.profileAction?.buildableProductRunnable?.buildableReference?.blueprintName, "core-ava") - XCTAssertEqual(scheme.profileAction?.buildableProductRunnable?.buildableReference?.buildableName, "Ava.app") - XCTAssertEqual(scheme.profileAction?.buildableProductRunnable?.buildableReference?.referencedContainer, "container:core-ava.xcodeproj") + XCTAssertEqual(scheme.profileAction?.runnable?.runnableDebuggingMode, "0") + XCTAssertEqual(scheme.profileAction?.runnable?.buildableReference?.blueprintIdentifier, "FE7C11D21B6DB70D0041DF02") + XCTAssertEqual(scheme.profileAction?.runnable?.buildableReference?.buildableIdentifier, "primary") + XCTAssertEqual(scheme.profileAction?.runnable?.buildableReference?.blueprintName, "core-ava") + XCTAssertEqual(scheme.profileAction?.runnable?.buildableReference?.buildableName, "Ava.app") + XCTAssertEqual(scheme.profileAction?.runnable?.buildableReference?.referencedContainer, "container:core-ava.xcodeproj") XCTAssertEqual(scheme.profileAction?.buildConfiguration, "Release") XCTAssertTrue(scheme.profileAction?.shouldUseLaunchSchemeArgsEnv == true) XCTAssertEqual(scheme.profileAction?.savedToolIdentifier, "") @@ -651,7 +651,7 @@ final class XCSchemeIntegrationTests: XCTestCase { XCTAssertTrue(launchEnvironmentVariables[0].enabled) // Profile action - XCTAssertNil(scheme.profileAction?.buildableProductRunnable) + XCTAssertNil(scheme.profileAction?.runnable) XCTAssertEqual(scheme.profileAction?.buildConfiguration, "Release") XCTAssertTrue(scheme.profileAction?.shouldUseLaunchSchemeArgsEnv == true) XCTAssertEqual(scheme.profileAction?.savedToolIdentifier, "") @@ -692,7 +692,7 @@ final class XCSchemeIntegrationTests: XCTestCase { // but minimal in the sense it doesn't have most of the standard elements and attributes. fixturesPath() + "Schemes/MinimalInformation.xcscheme" } - + private var runnableWithoutBuildableReferenceSchemePath: Path { fixturesPath() + "Schemes/RunnableWithoutBuildableReference.xcscheme" } From d8f4b0619c0260f3447f375cba3d5bd67f021314 Mon Sep 17 00:00:00 2001 From: Maxwell Elliott Date: Sat, 9 Jul 2022 05:26:36 -0400 Subject: [PATCH 215/678] Fix order for `askForAppToLaunch` attr (#705) --- Sources/XcodeProj/Extensions/AEXML+XcodeFormat.swift | 1 + Tests/XcodeProjTests/Extensions/AEXML+XcodeFormatTests.swift | 3 +++ 2 files changed, 4 insertions(+) diff --git a/Sources/XcodeProj/Extensions/AEXML+XcodeFormat.swift b/Sources/XcodeProj/Extensions/AEXML+XcodeFormat.swift index e51edd75c..837d3ef7b 100644 --- a/Sources/XcodeProj/Extensions/AEXML+XcodeFormat.swift +++ b/Sources/XcodeProj/Extensions/AEXML+XcodeFormat.swift @@ -48,6 +48,7 @@ let attributesOrder: [String: [String]] = [ "language", "region", "launchStyle", + "askForAppToLaunch", "useCustomWorkingDirectory", "ignoresPersistentStateOnLaunch", "debugDocumentVersioning", diff --git a/Tests/XcodeProjTests/Extensions/AEXML+XcodeFormatTests.swift b/Tests/XcodeProjTests/Extensions/AEXML+XcodeFormatTests.swift index 7c86759fd..b9d369e96 100644 --- a/Tests/XcodeProjTests/Extensions/AEXML+XcodeFormatTests.swift +++ b/Tests/XcodeProjTests/Extensions/AEXML+XcodeFormatTests.swift @@ -28,6 +28,7 @@ class AEXML_XcodeFormatTests: XCTestCase { selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" customLLDBInitFile = "$(BAZEL_LLDB_INIT)" launchStyle = "0" + askForAppToLaunch = "YES" allowLocationSimulation = "YES"> """ @@ -96,6 +97,7 @@ class AEXML_XcodeFormatTests: XCTestCase { "selectedLauncherIdentifier": "Xcode.DebuggerFoundation.Launcher.LLDB", "customLLDBInitFile": "$(BAZEL_LLDB_INIT)", "launchStyle": "0", + "askForAppToLaunch": "YES", "allowLocationSimulation": "YES" ] ) @@ -111,6 +113,7 @@ class AEXML_XcodeFormatTests: XCTestCase { "buildConfiguration": "Debug", "selectedLauncherIdentifier": "Xcode.DebuggerFoundation.Launcher.LLDB", "launchStyle": "0", + "askForAppToLaunch": "YES" ] ) } From 490057ab6f8a29559648ad04d743900ac5cf234e Mon Sep 17 00:00:00 2001 From: Kas Date: Wed, 13 Jul 2022 21:12:39 +0100 Subject: [PATCH 216/678] Add `DEAD_CODE_STRIPPING` default project setting (#706) - As of Xcode 14, `DEAD_CODE_STRIPPING` is now a recommended setting for macOS or iOS with catalyst projects and targets - iOS already had `DEAD_CODE_STRIPPING` enabled as a default in prior Xcode versions, so explicitly setting shouldn't cause a change in behaviour https://github.com/tuist/tuist/discussions/4531 --- Sources/XcodeProj/Utils/BuildSettingsProvider.swift | 1 + 1 file changed, 1 insertion(+) diff --git a/Sources/XcodeProj/Utils/BuildSettingsProvider.swift b/Sources/XcodeProj/Utils/BuildSettingsProvider.swift index b8c5514b6..ebafcf367 100644 --- a/Sources/XcodeProj/Utils/BuildSettingsProvider.swift +++ b/Sources/XcodeProj/Utils/BuildSettingsProvider.swift @@ -128,6 +128,7 @@ public class BuildSettingsProvider { "CLANG_WARN_UNGUARDED_AVAILABILITY": "YES_AGGRESSIVE", "CLANG_WARN_UNREACHABLE_CODE": "YES", "COPY_PHASE_STRIP": "NO", + "DEAD_CODE_STRIPPING": "YES", "ENABLE_STRICT_OBJC_MSGSEND": "YES", "GCC_C_LANGUAGE_STANDARD": "gnu11", "GCC_NO_COMMON_BLOCKS": "YES", From 099c64c7595541f62ec39b8749cff3ffe3088fdd Mon Sep 17 00:00:00 2001 From: Kas Date: Thu, 14 Jul 2022 07:57:05 +0100 Subject: [PATCH 217/678] Fix ordering of diagnostics scheme options (#704) - The ordering for the runtime checker (main thread, thread performance) were incorrect - This aligns the order with the order created by Xcode Test Plan: - Verify order matches that created by Xcode e.g. ```xml ``` --- .../XcodeProj/Extensions/AEXML+XcodeFormat.swift | 5 ++++- .../Extensions/AEXML+XcodeFormatTests.swift | 15 ++++++++++++--- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/Sources/XcodeProj/Extensions/AEXML+XcodeFormat.swift b/Sources/XcodeProj/Extensions/AEXML+XcodeFormat.swift index 837d3ef7b..3a0ab2ec2 100644 --- a/Sources/XcodeProj/Extensions/AEXML+XcodeFormat.swift +++ b/Sources/XcodeProj/Extensions/AEXML+XcodeFormat.swift @@ -35,16 +35,19 @@ let attributesOrder: [String: [String]] = [ "selectedLauncherIdentifier", "customLLDBInitFile", "language", + "shouldUseLaunchSchemeArgsEnv", + "disableMainThreadChecker", "region", "codeCoverageEnabled", "onlyGenerateCoverageForSpecifiedTargets", - "shouldUseLaunchSchemeArgsEnv", ], "LaunchAction": [ "buildConfiguration", "selectedDebuggerIdentifier", "selectedLauncherIdentifier", "customLLDBInitFile", + "disableMainThreadChecker", + "disablePerformanceAntipatternChecker", "language", "region", "launchStyle", diff --git a/Tests/XcodeProjTests/Extensions/AEXML+XcodeFormatTests.swift b/Tests/XcodeProjTests/Extensions/AEXML+XcodeFormatTests.swift index b9d369e96..d56389809 100644 --- a/Tests/XcodeProjTests/Extensions/AEXML+XcodeFormatTests.swift +++ b/Tests/XcodeProjTests/Extensions/AEXML+XcodeFormatTests.swift @@ -27,6 +27,8 @@ class AEXML_XcodeFormatTests: XCTestCase { buildConfiguration = "Debug" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" customLLDBInitFile = "$(BAZEL_LLDB_INIT)" + disableMainThreadChecker = "YES" + disablePerformanceAntipatternChecker = "YES" launchStyle = "0" askForAppToLaunch = "YES" allowLocationSimulation = "YES"> @@ -40,7 +42,8 @@ class AEXML_XcodeFormatTests: XCTestCase { buildConfiguration = "Debug" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" customLLDBInitFile = "$(BAZEL_LLDB_INIT)" - shouldUseLaunchSchemeArgsEnv = "YES"> + shouldUseLaunchSchemeArgsEnv = "YES" + disableMainThreadChecker = "YES"> """ @@ -98,7 +101,9 @@ class AEXML_XcodeFormatTests: XCTestCase { "customLLDBInitFile": "$(BAZEL_LLDB_INIT)", "launchStyle": "0", "askForAppToLaunch": "YES", - "allowLocationSimulation": "YES" + "allowLocationSimulation": "YES", + "disableMainThreadChecker": "YES", + "disablePerformanceAntipatternChecker": "YES", ] ) } @@ -108,6 +113,8 @@ class AEXML_XcodeFormatTests: XCTestCase { expectedXML: expectedLaunchActionXml.cleaned, childName: "LaunchAction", attributes: [ + "disableMainThreadChecker": "YES", + "disablePerformanceAntipatternChecker": "YES", "customLLDBInitFile": "$(BAZEL_LLDB_INIT)", "allowLocationSimulation": "YES", "buildConfiguration": "Debug", @@ -126,7 +133,8 @@ class AEXML_XcodeFormatTests: XCTestCase { "buildConfiguration": "Debug", "customLLDBInitFile": "$(BAZEL_LLDB_INIT)", "selectedLauncherIdentifier": "Xcode.DebuggerFoundation.Launcher.LLDB", - "shouldUseLaunchSchemeArgsEnv": "YES" + "shouldUseLaunchSchemeArgsEnv": "YES", + "disableMainThreadChecker": "YES", ] ) } @@ -136,6 +144,7 @@ class AEXML_XcodeFormatTests: XCTestCase { expectedXML: expectedTestActionXml.cleaned, childName: "TestAction", attributes: [ + "disableMainThreadChecker": "YES", "shouldUseLaunchSchemeArgsEnv": "YES", "buildConfiguration": "Debug", "customLLDBInitFile": "$(BAZEL_LLDB_INIT)", From de1496a030dddcbc831d835215e3d7a3e524798c Mon Sep 17 00:00:00 2001 From: Kas Date: Thu, 14 Jul 2022 17:40:42 +0100 Subject: [PATCH 218/678] Update changelog for the 8.8.0 release (#707) - To prepare for the 8.8.0 the changelog was updated Notes: - The auto-generate changelog feature of GitHub was used to create an curate this list (with some manualy re-formatting to match existing style) https://docs.github.com/en/repositories/releasing-projects-on-github/automatically-generated-release-notes#about-automatically-generated-release-notes --- CHANGELOG.md | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 22d25cbae..33c42c9d7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,9 +2,37 @@ ## Next +## 8.8.0 + +### Fixed + +- Fix equality checking of dictionaries [#667](https://github.com/tuist/XcodeProj/pull/667) by [@brentleyjones](https://github.com/brentleyjones) +- Quiet new warnings from Xcode 13.3 [#673](https://github.com/tuist/XcodeProj/pull/673) by [@hisaac](https://github.com/hisaac) +- Fix typo in PBXOutputSettings.swift [#678](https://github.com/tuist/XcodeProj/pull/678) by [@eltociear](https://github.com/eltociear) +- Fix syntax error in docs [#679](https://github.com/tuist/XcodeProj/pull/679) by [@maxwellE](https://github.com/maxwellE) +- Misspelling in comment [#680](https://github.com/tuist/XcodeProj/pull/680) by [@maxwellE](https://github.com/maxwellE) +- Misspelling in comment [#681](https://github.com/tuist/XcodeProj/pull/681) by [@maxwellE](https://github.com/maxwellE) +- Ensure correct `LaunchAction` scheme order [#686](https://github.com/tuist/XcodeProj/pull/686) by [@maxwellE](https://github.com/maxwellE) +- Fix TestAction scheme attribute ordering [#689](https://github.com/tuist/XcodeProj/pull/689) by [@maxwellE](https://github.com/maxwellE) +- Fix `Testables` element ordering [#702](https://github.com/tuist/XcodeProj/pull/702) by [@maxwellE](https://github.com/maxwellE) +- Fix `RemoteRunnable` scheme attr order [#701](https://github.com/tuist/XcodeProj/pull/701) by [@maxwellE](https://github.com/maxwellE) +- Fix ordering of Scheme toplevel attrs [#698](https://github.com/tuist/XcodeProj/pull/698) by [@maxwellE](https://github.com/maxwellE) +- Fix order for `askForAppToLaunch` attr [#705](https://github.com/tuist/XcodeProj/pull/705) by [@maxwellE](https://github.com/maxwellE) +- Fix ordering of diagnostics scheme options [#704](https://github.com/tuist/XcodeProj/pull/704) by [@kwridan](https://github.com/kwridan) + ### Added +- Add `addDependency()` helper method to `PBXAggregateTarget` [#677](https://github.com/tuist/XcodeProj/pull/677) by [@brentleyjones](https://github.com/brentleyjones) +- Allow for initializing a PBXProj via a direct path [#682](https://github.com/tuist/XcodeProj/pull/682) by [@maxwellE](https://github.com/maxwellE) +- Add `.extensionKitExtension` as the new `PBXProductType` [#691](https://github.com/tuist/XcodeProj/pull/691) by [@mtj0928](https://github.com/mtj0928) - Added `disablePerformanceAntipatternChecker` to `XCScheme` [#693](https://github.com/tuist/XcodeProj/pull/603) by [@Bogdan-Belogurov](https://github.com/Bogdan-Belogurov) +- Added missing `askForAppToLaunch` in `ProfileAction` [#700](https://github.com/tuist/XcodeProj/pull/700) by [@maxwellE](https://github.com/maxwellE) +- Add `launchAutomaticallySubstyle`->`ProfileAction` [#699](https://github.com/tuist/XcodeProj/pull/699) by [@maxwellE](https://github.com/maxwellE) +- Add `DEAD_CODE_STRIPPING` default project setting [#706](https://github.com/tuist/XcodeProj/pull/706) by [@kwridan](https://github.com/kwridan) + +### Changed + +- Use `Runnable` in `ProfileAction` [#703](https://github.com/tuist/XcodeProj/pull/703) by [@maxwellE](https://github.com/maxwellE) ## 8.7.1 From 439e89e0e2ee555fc1f5b8f62b7e7f2185c65cf8 Mon Sep 17 00:00:00 2001 From: Kas Date: Thu, 14 Jul 2022 18:30:56 +0100 Subject: [PATCH 219/678] Fix Tuist generated project (for release) (#708) - Following `RELEASE.md` one of the steps is genreate a tuist project used for the Carthage integration - The Tuist config was out dated (generationOptions API has changed in Tuist 3.x) - The steps ordering was incorrect, to ensure a successful generation, the carthage dependency frameworks need to be built first Test Plan: - Run `bundle exec rake carthage_update_dependencies` - Run `tuist generate` - Verify the project successfully generates --- RELEASE.md | 4 ++-- Tuist/Config.swift | 5 +---- XcodeProj_Carthage.xcodeproj/project.pbxproj | 6 ++---- .../xcshareddata/xcschemes/XcodeProj.xcscheme | 3 ++- .../xcshareddata/WorkspaceSettings.xcsettings | 8 ++++++++ ...ect.xcscheme => XcodeProj_Carthage-Workspace.xcscheme} | 0 6 files changed, 15 insertions(+), 11 deletions(-) create mode 100644 XcodeProj_Carthage.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings rename XcodeProj_Carthage.xcworkspace/xcshareddata/xcschemes/{XcodeProj_Carthage-Project.xcscheme => XcodeProj_Carthage-Workspace.xcscheme} (100%) diff --git a/RELEASE.md b/RELEASE.md index 198c6087d..352089c77 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -7,8 +7,8 @@ In this document you'll find all the necessary steps to release a new version of 3. Add the version section to the `CHANGELOG.md`, update the versions in the `README.md` and the `xcodeproj.podspec` file. 4. Commit the changes and tag them `git commit -m "Version x.y.z"` & `git tag x.y.z`. 5. Push the changes `git commit push origin main --tags` -6. Generate the project by running `tuist generate`. -7. Update Carthage dependencies by running `bundle exec rake carthage_update_dependencies`. +6. Update Carthage dependencies by running `bundle exec rake carthage_update_dependencies`. +7. Generate the project by running `tuist generate`. 8. Run the release checks by running `bundle exec rake release_check`. 9. Publish a new version of the Pod by running `bundle exec pod trunk push --allow-warnings --verbose`. 10. Archive the Carthage binary by running `bundle exec rake archive_carthage`. diff --git a/Tuist/Config.swift b/Tuist/Config.swift index c482b403c..4b9d60274 100644 --- a/Tuist/Config.swift +++ b/Tuist/Config.swift @@ -1,6 +1,3 @@ import ProjectDescription -let config = Config(generationOptions: [ - // If we generate the manifest target Carthage will attempt to compile it too. - // .generateManifest -]) +let config = Config(generationOptions: .options()) diff --git a/XcodeProj_Carthage.xcodeproj/project.pbxproj b/XcodeProj_Carthage.xcodeproj/project.pbxproj index d7ff76fe0..1d1804141 100644 --- a/XcodeProj_Carthage.xcodeproj/project.pbxproj +++ b/XcodeProj_Carthage.xcodeproj/project.pbxproj @@ -713,11 +713,10 @@ PRODUCT_NAME = XcodeProj; SDKROOT = macosx; SKIP_INSTALL = YES; - SUPPORTED_PLATFORMS = macosx; SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; SWIFT_COMPILATION_MODE = singlefile; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 5.5.1; + SWIFT_VERSION = 5.6.1; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; }; @@ -859,10 +858,9 @@ PRODUCT_NAME = XcodeProj; SDKROOT = macosx; SKIP_INSTALL = YES; - SUPPORTED_PLATFORMS = macosx; SWIFT_COMPILATION_MODE = wholemodule; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; - SWIFT_VERSION = 5.5.1; + SWIFT_VERSION = 5.6.1; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; }; diff --git a/XcodeProj_Carthage.xcodeproj/xcshareddata/xcschemes/XcodeProj.xcscheme b/XcodeProj_Carthage.xcodeproj/xcshareddata/xcschemes/XcodeProj.xcscheme index 066eafdeb..876464d1f 100644 --- a/XcodeProj_Carthage.xcodeproj/xcshareddata/xcschemes/XcodeProj.xcscheme +++ b/XcodeProj_Carthage.xcodeproj/xcshareddata/xcschemes/XcodeProj.xcscheme @@ -26,7 +26,8 @@ buildConfiguration = "Debug" selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" - shouldUseLaunchSchemeArgsEnv = "YES"> + shouldUseLaunchSchemeArgsEnv = "YES" + disableMainThreadChecker = "YES"> diff --git a/XcodeProj_Carthage.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/XcodeProj_Carthage.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings new file mode 100644 index 000000000..08de0be8d --- /dev/null +++ b/XcodeProj_Carthage.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings @@ -0,0 +1,8 @@ + + + + + IDEWorkspaceSharedSettings_AutocreateContextsIfNeeded + + + diff --git a/XcodeProj_Carthage.xcworkspace/xcshareddata/xcschemes/XcodeProj_Carthage-Project.xcscheme b/XcodeProj_Carthage.xcworkspace/xcshareddata/xcschemes/XcodeProj_Carthage-Workspace.xcscheme similarity index 100% rename from XcodeProj_Carthage.xcworkspace/xcshareddata/xcschemes/XcodeProj_Carthage-Project.xcscheme rename to XcodeProj_Carthage.xcworkspace/xcshareddata/xcschemes/XcodeProj_Carthage-Workspace.xcscheme From b6de1bfe021b861c94e7c83821b595083f74b997 Mon Sep 17 00:00:00 2001 From: Kassem Wridan Date: Thu, 14 Jul 2022 18:42:28 +0100 Subject: [PATCH 220/678] Version 8.8.0 --- README.md | 8 ++++---- xcodeproj.podspec | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 890fe4647..910e72ca2 100644 --- a/README.md +++ b/README.md @@ -48,7 +48,7 @@ Add the dependency in your `Package.swift` file: let package = Package( name: "myproject", dependencies: [ - .package(url: "https://github.com/tuist/XcodeProj.git", .upToNextMajor(from: "8.7.1")), + .package(url: "https://github.com/tuist/XcodeProj.git", .upToNextMajor(from: "8.8.0")), ], targets: [ .target( @@ -64,13 +64,13 @@ let package = Package( ```bash # Cartfile -github "tuist/xcodeproj" ~> 8.7.1 +github "tuist/xcodeproj" ~> 8.8.0 ``` ### CocoaPods ```ruby -pod 'xcodeproj', '~> 8.7.1 +pod 'xcodeproj', '~> 8.8.0 ``` ### Scripting @@ -82,7 +82,7 @@ git tag that represents the project’s version: ```swift #!/usr/bin/swift sh import Foundation -import XcodeProj // @tuist ~> 8.7.1 +import XcodeProj // @tuist ~> 8.8.0 import PathKit guard CommandLine.arguments.count == 3 else { diff --git a/xcodeproj.podspec b/xcodeproj.podspec index e063e07e6..405c05e22 100644 --- a/xcodeproj.podspec +++ b/xcodeproj.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = 'xcodeproj' - s.version = '8.7.1' + s.version = '8.8.0' s.summary = 'Read/Modify/Write your Xcode projects' s.homepage = 'https://github.com/tuist/xcodeproj' s.license = 'MIT' From 8f0f4b544b40f173a7847a163dfbfd03ec7a03d2 Mon Sep 17 00:00:00 2001 From: JP Simard Date: Tue, 2 Aug 2022 11:25:18 -0400 Subject: [PATCH 221/678] Fix warning compiling for macOS 13 (#710) --- Sources/XcodeProj/Extensions/String+md5.swift | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Sources/XcodeProj/Extensions/String+md5.swift b/Sources/XcodeProj/Extensions/String+md5.swift index 5abdf59a7..8d470d110 100644 --- a/Sources/XcodeProj/Extensions/String+md5.swift +++ b/Sources/XcodeProj/Extensions/String+md5.swift @@ -50,6 +50,8 @@ private extension DataProtocol { var hexString: String { let hexLen = self.count * 2 let ptr = UnsafeMutablePointer.allocate(capacity: hexLen) + ptr.assign(repeating: 0, count: hexLen) + defer { ptr.deallocate() } var offset = 0 self.regions.forEach { (_) in @@ -60,7 +62,7 @@ private extension DataProtocol { } } - return String(bytesNoCopy: ptr, length: hexLen, encoding: .utf8, freeWhenDone: true)! + return String(cString: ptr) } func itoh(_ value: UInt8) -> UInt8 { From 3e3a2168019b2df4c11637277e7371a4d9e3428a Mon Sep 17 00:00:00 2001 From: Kas Date: Fri, 12 Aug 2022 15:49:13 +0100 Subject: [PATCH 222/678] Revert "Fix warning compiling for macOS 13 (#710)" (#715) Resolves: https://github.com/tuist/XcodeProj/issues/714 - Reverts tuist/XcodeProj#710 (8f0f4b544b40f173a7847a163dfbfd03ec7a03d2) - Sadly this commit made the references unstable, we can revert and reintroduce once the stability issues have been addressed - Running the tests repeatedly helps surface the issue --- Sources/XcodeProj/Extensions/String+md5.swift | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Sources/XcodeProj/Extensions/String+md5.swift b/Sources/XcodeProj/Extensions/String+md5.swift index 8d470d110..5abdf59a7 100644 --- a/Sources/XcodeProj/Extensions/String+md5.swift +++ b/Sources/XcodeProj/Extensions/String+md5.swift @@ -50,8 +50,6 @@ private extension DataProtocol { var hexString: String { let hexLen = self.count * 2 let ptr = UnsafeMutablePointer.allocate(capacity: hexLen) - ptr.assign(repeating: 0, count: hexLen) - defer { ptr.deallocate() } var offset = 0 self.regions.forEach { (_) in @@ -62,7 +60,7 @@ private extension DataProtocol { } } - return String(cString: ptr) + return String(bytesNoCopy: ptr, length: hexLen, encoding: .utf8, freeWhenDone: true)! } func itoh(_ value: UInt8) -> UInt8 { From e6497b2f2619327090b8e5a6a9f6797549950d1d Mon Sep 17 00:00:00 2001 From: Chuck Grindel Date: Fri, 12 Aug 2022 13:45:58 -0600 Subject: [PATCH 223/678] Implement Hashable for XCScheme.BuildableReference (#712) --- .../Scheme/XCScheme+BuildableReference.swift | 11 ++++++++- .../XCScheme+BuildableReferenceTests.swift | 24 +++++++++++++++++++ 2 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 Tests/XcodeProjTests/Scheme/XCScheme+BuildableReferenceTests.swift diff --git a/Sources/XcodeProj/Scheme/XCScheme+BuildableReference.swift b/Sources/XcodeProj/Scheme/XCScheme+BuildableReference.swift index 0a092295f..f35011ed7 100644 --- a/Sources/XcodeProj/Scheme/XCScheme+BuildableReference.swift +++ b/Sources/XcodeProj/Scheme/XCScheme+BuildableReference.swift @@ -2,7 +2,7 @@ import AEXML import Foundation extension XCScheme { - public final class BuildableReference: Equatable { + public final class BuildableReference: Equatable, Hashable { // MARK: - Attributes public var referencedContainer: String @@ -105,5 +105,14 @@ extension XCScheme { lhs.blueprint == rhs.blueprint && lhs.blueprintName == rhs.blueprintName } + + // MARK: - Hashable + + public func hash(into hasher: inout Hasher) { + hasher.combine(referencedContainer) + hasher.combine(blueprintIdentifier) + hasher.combine(buildableName) + hasher.combine(blueprintName) + } } } diff --git a/Tests/XcodeProjTests/Scheme/XCScheme+BuildableReferenceTests.swift b/Tests/XcodeProjTests/Scheme/XCScheme+BuildableReferenceTests.swift new file mode 100644 index 000000000..d1ee337dc --- /dev/null +++ b/Tests/XcodeProjTests/Scheme/XCScheme+BuildableReferenceTests.swift @@ -0,0 +1,24 @@ +@testable import XcodeProj +import XCTest + +final class XCSchemeBuildableReferenceTests: XCTestCase { + func test_hash() throws { + // Values that are equal must generate the same hash value + let aBuildRef = XCScheme.BuildableReference( + referencedContainer: "container ref", + blueprint: nil, + buildableName: "buildable name", + blueprintName: "blueprint name" + ) + let bBuildRef = XCScheme.BuildableReference( + referencedContainer: "container ref", + blueprint: nil, + buildableName: "buildable name", + blueprintName: "blueprint name" + ) + XCTAssertEqual(aBuildRef, bBuildRef) + + let buildRefs: Set = [aBuildRef] + XCTAssertTrue(buildRefs.contains(bBuildRef)) + } +} From 2ad4d413f6f381b57001b77d64a41194481aa14d Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Fri, 12 Aug 2022 21:46:42 +0200 Subject: [PATCH 224/678] docs: add cgrindel as a contributor for code (#713) --- .all-contributorsrc | 9 +++++++++ README.md | 3 ++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/.all-contributorsrc b/.all-contributorsrc index 971a24924..01de4c687 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -184,6 +184,15 @@ "contributions": [ "code" ] + }, + { + "login": "cgrindel", + "name": "Chuck Grindel", + "avatar_url": "https://avatars.githubusercontent.com/u/159968?v=4", + "profile": "https://chuckgrindel.com/", + "contributions": [ + "code" + ] } ], "contributorsPerLine": 7, diff --git a/README.md b/README.md index 910e72ca2..af9f72034 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # XcodeProj -[![All Contributors](https://img.shields.io/badge/all_contributors-20-orange.svg?style=flat-square)](#contributors-) +[![All Contributors](https://img.shields.io/badge/all_contributors-21-orange.svg?style=flat-square)](#contributors-) [![Swift Package Manager](https://img.shields.io/badge/swift%20package%20manager-compatible-brightgreen.svg)](https://swift.org/package-manager/) @@ -178,6 +178,7 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
Jake Adams

💻
matsuji

💻
Bogdan Belogurov

💻 +
Chuck Grindel

💻 From 13c235ab76922123780ff86259bac7aba31dc5c4 Mon Sep 17 00:00:00 2001 From: Michael McGuire Date: Tue, 30 Aug 2022 12:45:54 -0700 Subject: [PATCH 225/678] Add accessor for runScript Build Phases on PBXTarget. (#717) - Other accessors already exist for quickly accessing the other PBXBuildPhase types. --- .../XcodeProj/Objects/Targets/PBXTarget.swift | 9 ++++ .../Objects/Targets/PBXTargetTests.swift | 44 +++++++++++++++++++ 2 files changed, 53 insertions(+) diff --git a/Sources/XcodeProj/Objects/Targets/PBXTarget.swift b/Sources/XcodeProj/Objects/Targets/PBXTarget.swift index 9e2213586..b5440059f 100644 --- a/Sources/XcodeProj/Objects/Targets/PBXTarget.swift +++ b/Sources/XcodeProj/Objects/Targets/PBXTarget.swift @@ -282,4 +282,13 @@ public extension PBXTarget { .compactMap { $0 as? PBXCopyFilesBuildPhase } .filter { $0.dstSubfolderSpec == .frameworks } } + + /// Returns the run script build phases. + /// + /// - Returns: Run script build phases. + func runScriptBuildPhases() -> [PBXShellScriptBuildPhase] { + buildPhases + .filter { $0.buildPhase == .runScript } + .compactMap { $0 as? PBXShellScriptBuildPhase } + } } diff --git a/Tests/XcodeProjTests/Objects/Targets/PBXTargetTests.swift b/Tests/XcodeProjTests/Objects/Targets/PBXTargetTests.swift index a0fe6b00e..a47242a3c 100644 --- a/Tests/XcodeProjTests/Objects/Targets/PBXTargetTests.swift +++ b/Tests/XcodeProjTests/Objects/Targets/PBXTargetTests.swift @@ -85,4 +85,48 @@ final class PBXTargetTests: XCTestCase { XCTAssertTrue(embedFrameworkBuildPhases.contains(embedFrameworkBuildPhase1)) XCTAssertTrue(embedFrameworkBuildPhases.contains(embedFrameworkBuildPhase2)) } + + func test_runScriptBuildPhases_returnsEmptyIfNoRunScriptBuildPhases() { + let notShellScriptBuildPhase1 = PBXFrameworksBuildPhase( + files: [], + inputFileListPaths: nil, + outputFileListPaths: nil, buildActionMask: PBXBuildPhase.defaultBuildActionMask, + runOnlyForDeploymentPostprocessing: true + ) + let notShellScriptBuildPhase2 = PBXCopyFilesBuildPhase( + dstPath: nil, + dstSubfolderSpec: .resources, + name: "Embed Frameworks", + buildActionMask: PBXBuildPhase.defaultBuildActionMask, + files: [], + runOnlyForDeploymentPostprocessing: true + ) + + subject.buildPhases.append(notShellScriptBuildPhase1) + subject.buildPhases.append(notShellScriptBuildPhase2) + + let runScriptBuildPhases = subject.runScriptBuildPhases() + XCTAssertTrue(runScriptBuildPhases.isEmpty) + } + + func test_runScriptBuildPhases_returnsRunScriptBuildPhasesIfPresent() { + let otherScriptBuildPhase1 = PBXFrameworksBuildPhase() + let runScriptBuildPhase1 = PBXShellScriptBuildPhase( + name: "Run Script 1" + ) + let runScriptBuildPhase2 = PBXShellScriptBuildPhase( + name: "Run Script 2" + ) + let otherScriptBuildPhase2 = PBXCopyFilesBuildPhase() + + subject.buildPhases.append(otherScriptBuildPhase1) + subject.buildPhases.append(runScriptBuildPhase1) + subject.buildPhases.append(runScriptBuildPhase2) + subject.buildPhases.append(otherScriptBuildPhase2) + + let runScriptBuildPhases = subject.runScriptBuildPhases() + XCTAssertEqual(runScriptBuildPhases.count, 2) + XCTAssertTrue(runScriptBuildPhases.contains(runScriptBuildPhase1)) + XCTAssertTrue(runScriptBuildPhases.contains(runScriptBuildPhase2)) + } } From bc78c5562e54ecb7b20c78da780b1c625326a808 Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Tue, 30 Aug 2022 21:46:50 +0200 Subject: [PATCH 226/678] docs: add michaelmcguire as a contributor for code (#719) * docs: update README.md [skip ci] * docs: update .all-contributorsrc [skip ci] Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com> --- .all-contributorsrc | 9 +++++++++ README.md | 5 ++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/.all-contributorsrc b/.all-contributorsrc index 01de4c687..0d0f4cc5e 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -193,6 +193,15 @@ "contributions": [ "code" ] + }, + { + "login": "michaelmcguire", + "name": "Michael McGuire", + "avatar_url": "https://avatars.githubusercontent.com/u/429790?v=4", + "profile": "https://twitter.com/MonocularVision", + "contributions": [ + "code" + ] } ], "contributorsPerLine": 7, diff --git a/README.md b/README.md index af9f72034..9a8a2358f 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # XcodeProj -[![All Contributors](https://img.shields.io/badge/all_contributors-21-orange.svg?style=flat-square)](#contributors-) +[![All Contributors](https://img.shields.io/badge/all_contributors-22-orange.svg?style=flat-square)](#contributors-) [![Swift Package Manager](https://img.shields.io/badge/swift%20package%20manager-compatible-brightgreen.svg)](https://swift.org/package-manager/) @@ -180,6 +180,9 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
Bogdan Belogurov

💻
Chuck Grindel

💻 + +
Michael McGuire

💻 + From c36d3a8501588e280f4199b00c5cfc5a23b27dbf Mon Sep 17 00:00:00 2001 From: Michael McGuire Date: Tue, 30 Aug 2022 14:38:04 -0700 Subject: [PATCH 227/678] Update Contributing instructions to directly open Package.swift with Xcode instead of using deprecated SPM command. (#718) --- README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/README.md b/README.md index 9a8a2358f..8ca51e514 100644 --- a/README.md +++ b/README.md @@ -138,8 +138,7 @@ Want to start using XcodeProj? Start by digging into our [documentation](/Docume ## Contributing 1. Git clone the repository `git@github.com:tuist/xcodeproj.git`. -2. Generate xcodeproj with `swift package generate-xcodeproj`. -3. Open `XcodeProj.xcodeproj`. +2. Open `Package.swift` with Xcode. ## License From 4fdab090246666049cfbe86e407cb9d1c8696399 Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Wed, 7 Sep 2022 10:12:31 -0400 Subject: [PATCH 228/678] docs: add CrazyFanFan as a contributor for code (#722) * docs: update README.md [skip ci] * docs: update .all-contributorsrc [skip ci] Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com> --- .all-contributorsrc | 9 +++++++++ README.md | 3 ++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/.all-contributorsrc b/.all-contributorsrc index 0d0f4cc5e..4210d4dcf 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -202,6 +202,15 @@ "contributions": [ "code" ] + }, + { + "login": "CrazyFanFan", + "name": "C-凡", + "avatar_url": "https://avatars.githubusercontent.com/u/15794964?v=4", + "profile": "https://github.com/CrazyFanFan", + "contributions": [ + "code" + ] } ], "contributorsPerLine": 7, diff --git a/README.md b/README.md index 8ca51e514..0262ff7bb 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # XcodeProj -[![All Contributors](https://img.shields.io/badge/all_contributors-22-orange.svg?style=flat-square)](#contributors-) +[![All Contributors](https://img.shields.io/badge/all_contributors-23-orange.svg?style=flat-square)](#contributors-) [![Swift Package Manager](https://img.shields.io/badge/swift%20package%20manager-compatible-brightgreen.svg)](https://swift.org/package-manager/) @@ -181,6 +181,7 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
Michael McGuire

💻 +
C-凡

💻 From 1259fdc2df64fc6c062e8590ced4f26eaba010c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C-=E5=87=A1?= <827799383@qq.com> Date: Wed, 7 Sep 2022 22:17:14 +0800 Subject: [PATCH 229/678] Add shellToInvoke to XCScheme.ExecutionAction (#721) Co-authored-by: kongkaikai --- .../xcshareddata/xcschemes/iOS.xcscheme | 3 ++- .../Scheme/XCScheme+ExecutionAction.swift | 24 +++++++++++++++---- .../XcodeProjTests/Scheme/XCSchemeTests.swift | 2 ++ 3 files changed, 23 insertions(+), 6 deletions(-) diff --git a/Fixtures/iOS/Project.xcodeproj/xcshareddata/xcschemes/iOS.xcscheme b/Fixtures/iOS/Project.xcodeproj/xcshareddata/xcschemes/iOS.xcscheme index 119ecf609..441f0e3b2 100644 --- a/Fixtures/iOS/Project.xcodeproj/xcshareddata/xcschemes/iOS.xcscheme +++ b/Fixtures/iOS/Project.xcodeproj/xcshareddata/xcschemes/iOS.xcscheme @@ -19,7 +19,8 @@ ActionType = "Xcode.IDEStandardExecutionActionsCore.ExecutionActionType.ShellScriptAction"> + scriptText = "echo postbuild" + shellToInvoke = "/bin/sh"> diff --git a/Sources/XcodeProj/Scheme/XCScheme+ExecutionAction.swift b/Sources/XcodeProj/Scheme/XCScheme+ExecutionAction.swift index 5dd3d7d21..484e99aaa 100644 --- a/Sources/XcodeProj/Scheme/XCScheme+ExecutionAction.swift +++ b/Sources/XcodeProj/Scheme/XCScheme+ExecutionAction.swift @@ -9,19 +9,29 @@ extension XCScheme { public var title: String public var scriptText: String + public var shellToInvoke: String? public var environmentBuildable: BuildableReference? // MARK: - Init - public init(scriptText: String, title: String = "Run Script", environmentBuildable: BuildableReference? = nil) { + public init( + scriptText: String, + title: String = "Run Script", + shellToInvoke: String? = nil, + environmentBuildable: BuildableReference? = nil + ) { self.scriptText = scriptText self.title = title + self.shellToInvoke = shellToInvoke self.environmentBuildable = environmentBuildable } init(element: AEXMLElement) throws { scriptText = element["ActionContent"].attributes["scriptText"] ?? "" title = element["ActionContent"].attributes["title"] ?? "Run Script" + if let shellToInvoke = element["ActionContent"].attributes["shellToInvoke"] { + self.shellToInvoke = shellToInvoke + } environmentBuildable = try? BuildableReference(element: element["ActionContent"]["EnvironmentBuildable"]["BuildableReference"]) } @@ -31,12 +41,16 @@ extension XCScheme { let element = AEXMLElement(name: "ExecutionAction", value: nil, attributes: ["ActionType": ExecutionAction.ActionType]) + var attributes = [ + "title": title, + "scriptText": scriptText, + ] + if let shellToInvoke = shellToInvoke { + attributes["shellToInvoke"] = shellToInvoke + } let content = AEXMLElement(name: "ActionContent", value: nil, - attributes: [ - "title": title, - "scriptText": scriptText, - ]) + attributes: attributes) element.addChild(content) if let environmentBuildable = environmentBuildable { let environment = content.addChild(name: "EnvironmentBuildable") diff --git a/Tests/XcodeProjTests/Scheme/XCSchemeTests.swift b/Tests/XcodeProjTests/Scheme/XCSchemeTests.swift index 2ec14710c..678147597 100644 --- a/Tests/XcodeProjTests/Scheme/XCSchemeTests.swift +++ b/Tests/XcodeProjTests/Scheme/XCSchemeTests.swift @@ -329,8 +329,10 @@ final class XCSchemeIntegrationTests: XCTestCase { XCTAssertEqual(scheme.buildAction?.buildActionEntries.first?.buildableReference.referencedContainer, "container:Project.xcodeproj") XCTAssertEqual(scheme.buildAction?.preActions.first?.title, "Build Pre-action") XCTAssertEqual(scheme.buildAction?.preActions.first?.scriptText, "echo prebuild") + XCTAssertNil(scheme.buildAction?.preActions.first?.shellToInvoke) XCTAssertEqual(scheme.buildAction?.postActions.first?.title, "Build Post-action") XCTAssertEqual(scheme.buildAction?.postActions.first?.scriptText, "echo postbuild") + XCTAssertEqual(scheme.buildAction?.postActions.first?.shellToInvoke, "/bin/sh") // Test action XCTAssertEqual(scheme.testAction?.buildConfiguration, "Debug") XCTAssertEqual(scheme.testAction?.selectedDebuggerIdentifier, "Xcode.DebuggerFoundation.Debugger.LLDB") From d5f3532a36993a266cd227873ccefbb5d8e33e47 Mon Sep 17 00:00:00 2001 From: Kas Date: Wed, 7 Sep 2022 15:18:27 +0100 Subject: [PATCH 230/678] Update watchOS application default settings (#711) - Xcode 14 supports extensionless watchOS applications (that have the regular application product identifier) - Those target can now include source, resources and can link other frameworks like regular application targets - The default settings are being updated to accomodate this, more specifically the linker search paths Test Plan: - Verify tests pass References: - https://github.com/tuist/tuist/pull/4658 - https://github.com/tuist/tuist/issues/4572 --- Sources/XcodeProj/Utils/BuildSettingsProvider.swift | 1 + Tests/XcodeProjTests/Utils/BuildSettingsProviderTests.swift | 1 + 2 files changed, 2 insertions(+) diff --git a/Sources/XcodeProj/Utils/BuildSettingsProvider.swift b/Sources/XcodeProj/Utils/BuildSettingsProvider.swift index ebafcf367..f9040c5ee 100644 --- a/Sources/XcodeProj/Utils/BuildSettingsProvider.swift +++ b/Sources/XcodeProj/Utils/BuildSettingsProvider.swift @@ -241,6 +241,7 @@ public class BuildSettingsProvider { case (.watchOS, .application): return [ "SKIP_INSTALL": "YES", + "LD_RUNPATH_SEARCH_PATHS": ["$(inherited)", "@executable_path/Frameworks"], ] case (.iOS, .framework): return [ diff --git a/Tests/XcodeProjTests/Utils/BuildSettingsProviderTests.swift b/Tests/XcodeProjTests/Utils/BuildSettingsProviderTests.swift index 9e8e86de5..b7cad6cde 100644 --- a/Tests/XcodeProjTests/Utils/BuildSettingsProviderTests.swift +++ b/Tests/XcodeProjTests/Utils/BuildSettingsProviderTests.swift @@ -138,6 +138,7 @@ class BuildSettingProviderTests: XCTestCase { "ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES": "YES", "ASSETCATALOG_COMPILER_APPICON_NAME": "AppIcon", "ENABLE_PREVIEWS": "YES", + "LD_RUNPATH_SEARCH_PATHS": ["$(inherited)", "@executable_path/Frameworks"], "SDKROOT": "watchos", "SKIP_INSTALL": "YES", "SWIFT_COMPILATION_MODE": "wholemodule", From b7e93122d08e59497211ea12f4da73e6a4d7d598 Mon Sep 17 00:00:00 2001 From: Maxwell Elliott Date: Wed, 7 Sep 2022 10:19:19 -0400 Subject: [PATCH 231/678] Sets `customWorkingDirectory` for schemes (#720) * Sets `customWorkingDirectory` for schemes This attribute was missed in launch and profile schemes * remove debug * ensure correct attribute order * feedback --- .../RunnableWithoutBuildableReference.xcscheme | 1 + Sources/XcodeProj/Extensions/AEXML+XcodeFormat.swift | 2 ++ Sources/XcodeProj/Scheme/XCScheme+LaunchAction.swift | 10 ++++++++++ .../XcodeProj/Scheme/XCScheme+ProfileAction.swift | 12 ++++++++++++ Tests/XcodeProjTests/Scheme/XCSchemeTests.swift | 6 ++++++ 5 files changed, 31 insertions(+) diff --git a/Fixtures/Schemes/RunnableWithoutBuildableReference.xcscheme b/Fixtures/Schemes/RunnableWithoutBuildableReference.xcscheme index 3849dcb0d..edc29a307 100644 --- a/Fixtures/Schemes/RunnableWithoutBuildableReference.xcscheme +++ b/Fixtures/Schemes/RunnableWithoutBuildableReference.xcscheme @@ -51,6 +51,7 @@ launchStyle = "0" askForAppToLaunch = "Yes" useCustomWorkingDirectory = "NO" + customWorkingDirectory = "/customWorkingDirectory" ignoresPersistentStateOnLaunch = "NO" debugDocumentVersioning = "YES" debugServiceExtension = "internal" diff --git a/Sources/XcodeProj/Extensions/AEXML+XcodeFormat.swift b/Sources/XcodeProj/Extensions/AEXML+XcodeFormat.swift index 3a0ab2ec2..33a5a9b65 100644 --- a/Sources/XcodeProj/Extensions/AEXML+XcodeFormat.swift +++ b/Sources/XcodeProj/Extensions/AEXML+XcodeFormat.swift @@ -53,6 +53,7 @@ let attributesOrder: [String: [String]] = [ "launchStyle", "askForAppToLaunch", "useCustomWorkingDirectory", + "customWorkingDirectory", "ignoresPersistentStateOnLaunch", "debugDocumentVersioning", "debugServiceExtension", @@ -66,6 +67,7 @@ let attributesOrder: [String: [String]] = [ "shouldUseLaunchSchemeArgsEnv", "savedToolIdentifier", "useCustomWorkingDirectory", + "customWorkingDirectory", "ignoresPersistentStateOnLaunch", "debugDocumentVersioning", "enableTestabilityWhenProfilingTests", diff --git a/Sources/XcodeProj/Scheme/XCScheme+LaunchAction.swift b/Sources/XcodeProj/Scheme/XCScheme+LaunchAction.swift index 10e2ca44a..6f3461ee1 100644 --- a/Sources/XcodeProj/Scheme/XCScheme+LaunchAction.swift +++ b/Sources/XcodeProj/Scheme/XCScheme+LaunchAction.swift @@ -42,6 +42,7 @@ extension XCScheme { public var launchStyle: Style public var askForAppToLaunch: Bool? public var pathRunnable: PathRunnable? + public var customWorkingDirectory: String? public var useCustomWorkingDirectory: Bool public var ignoresPersistentStateOnLaunch: Bool public var debugDocumentVersioning: Bool @@ -82,6 +83,7 @@ extension XCScheme { launchStyle: Style = .auto, askForAppToLaunch: Bool? = nil, pathRunnable: PathRunnable? = nil, + customWorkingDirectory: String? = nil, useCustomWorkingDirectory: Bool = false, ignoresPersistentStateOnLaunch: Bool = false, debugDocumentVersioning: Bool = true, @@ -116,6 +118,7 @@ extension XCScheme { self.selectedLauncherIdentifier = selectedLauncherIdentifier self.askForAppToLaunch = askForAppToLaunch self.pathRunnable = pathRunnable + self.customWorkingDirectory = customWorkingDirectory self.useCustomWorkingDirectory = useCustomWorkingDirectory self.ignoresPersistentStateOnLaunch = ignoresPersistentStateOnLaunch self.debugDocumentVersioning = debugDocumentVersioning @@ -222,6 +225,9 @@ extension XCScheme { } customLaunchCommand = element.attributes["customLaunchCommand"] customLLDBInitFile = element.attributes["customLLDBInitFile"] + if let elementCustomWorkingDirectory: String = element.attributes["customWorkingDirectory"] { + customWorkingDirectory = elementCustomWorkingDirectory + } try super.init(element: element) } @@ -277,6 +283,9 @@ extension XCScheme { if stopOnEveryMainThreadCheckerIssue { attributes["stopOnEveryMainThreadCheckerIssue"] = stopOnEveryMainThreadCheckerIssue.xmlString } + if let customWorkingDirectory = customWorkingDirectory { + attributes["customWorkingDirectory"] = customWorkingDirectory + } return attributes } @@ -357,6 +366,7 @@ extension XCScheme { launchStyle == rhs.launchStyle && askForAppToLaunch == rhs.askForAppToLaunch && pathRunnable == rhs.pathRunnable && + customWorkingDirectory == rhs.customWorkingDirectory && useCustomWorkingDirectory == rhs.useCustomWorkingDirectory && ignoresPersistentStateOnLaunch == rhs.ignoresPersistentStateOnLaunch && debugDocumentVersioning == rhs.debugDocumentVersioning && diff --git a/Sources/XcodeProj/Scheme/XCScheme+ProfileAction.swift b/Sources/XcodeProj/Scheme/XCScheme+ProfileAction.swift index c96a5d023..023b79576 100644 --- a/Sources/XcodeProj/Scheme/XCScheme+ProfileAction.swift +++ b/Sources/XcodeProj/Scheme/XCScheme+ProfileAction.swift @@ -19,6 +19,7 @@ extension XCScheme { public var shouldUseLaunchSchemeArgsEnv: Bool public var savedToolIdentifier: String public var ignoresPersistentStateOnLaunch: Bool + public var customWorkingDirectory: String? public var useCustomWorkingDirectory: Bool public var debugDocumentVersioning: Bool public var askForAppToLaunch: Bool? @@ -38,6 +39,7 @@ extension XCScheme { shouldUseLaunchSchemeArgsEnv: Bool = true, savedToolIdentifier: String = "", ignoresPersistentStateOnLaunch: Bool = false, + customWorkingDirectory: String? = nil, useCustomWorkingDirectory: Bool = false, debugDocumentVersioning: Bool = true, askForAppToLaunch: Bool? = nil, @@ -50,6 +52,7 @@ extension XCScheme { self.macroExpansion = macroExpansion self.shouldUseLaunchSchemeArgsEnv = shouldUseLaunchSchemeArgsEnv self.savedToolIdentifier = savedToolIdentifier + self.customWorkingDirectory = customWorkingDirectory self.useCustomWorkingDirectory = useCustomWorkingDirectory self.debugDocumentVersioning = debugDocumentVersioning self.askForAppToLaunch = askForAppToLaunch @@ -70,6 +73,7 @@ extension XCScheme { shouldUseLaunchSchemeArgsEnv: Bool = true, savedToolIdentifier: String = "", ignoresPersistentStateOnLaunch: Bool = false, + customWorkingDirectory: String? = nil, useCustomWorkingDirectory: Bool = false, debugDocumentVersioning: Bool = true, askForAppToLaunch: Bool? = nil, @@ -87,6 +91,7 @@ extension XCScheme { shouldUseLaunchSchemeArgsEnv: shouldUseLaunchSchemeArgsEnv, savedToolIdentifier: savedToolIdentifier, ignoresPersistentStateOnLaunch: ignoresPersistentStateOnLaunch, + customWorkingDirectory: customWorkingDirectory, useCustomWorkingDirectory: useCustomWorkingDirectory, debugDocumentVersioning: debugDocumentVersioning, askForAppToLaunch: askForAppToLaunch, @@ -128,6 +133,9 @@ extension XCScheme { } enableTestabilityWhenProfilingTests = element.attributes["enableTestabilityWhenProfilingTests"].map { $0 != "No" } ?? true launchAutomaticallySubstyle = element.attributes["launchAutomaticallySubstyle"] + if let elementCustomWorkingDirectory: String = element.attributes["customWorkingDirectory"] { + customWorkingDirectory = elementCustomWorkingDirectory + } try super.init(element: element) } @@ -165,6 +173,9 @@ extension XCScheme { if let launchAutomaticallySubstyle = launchAutomaticallySubstyle { element.attributes["launchAutomaticallySubstyle"] = launchAutomaticallySubstyle } + if let customWorkingDirectory = customWorkingDirectory { + element.attributes["customWorkingDirectory"] = customWorkingDirectory + } if let macroExpansion = macroExpansion { let macro = element.addChild(name: "MacroExpansion") @@ -184,6 +195,7 @@ extension XCScheme { shouldUseLaunchSchemeArgsEnv == rhs.shouldUseLaunchSchemeArgsEnv && savedToolIdentifier == rhs.savedToolIdentifier && ignoresPersistentStateOnLaunch == rhs.ignoresPersistentStateOnLaunch && + customWorkingDirectory == rhs.customWorkingDirectory && useCustomWorkingDirectory == rhs.useCustomWorkingDirectory && debugDocumentVersioning == rhs.debugDocumentVersioning && askForAppToLaunch == rhs.askForAppToLaunch && diff --git a/Tests/XcodeProjTests/Scheme/XCSchemeTests.swift b/Tests/XcodeProjTests/Scheme/XCSchemeTests.swift index 678147597..86680b14e 100644 --- a/Tests/XcodeProjTests/Scheme/XCSchemeTests.swift +++ b/Tests/XcodeProjTests/Scheme/XCSchemeTests.swift @@ -398,6 +398,7 @@ final class XCSchemeIntegrationTests: XCTestCase { XCTAssertEqual(scheme.profileAction?.buildConfiguration, "Release") XCTAssertEqual(scheme.profileAction?.shouldUseLaunchSchemeArgsEnv, true) XCTAssertEqual(scheme.profileAction?.savedToolIdentifier, "") + XCTAssertNil(scheme.profileAction?.customWorkingDirectory) XCTAssertEqual(scheme.profileAction?.useCustomWorkingDirectory, false) XCTAssertEqual(scheme.profileAction?.debugDocumentVersioning, true) XCTAssertNil(scheme.profileAction?.askForAppToLaunch) @@ -428,6 +429,7 @@ final class XCSchemeIntegrationTests: XCTestCase { XCTAssertEqual(scheme.launchAction?.selectedLauncherIdentifier, "Xcode.DebuggerFoundation.Launcher.LLDB") XCTAssertEqual(scheme.launchAction?.launchStyle, .custom) XCTAssertNil(scheme.launchAction?.askForAppToLaunch) + XCTAssertNil(scheme.launchAction?.customWorkingDirectory) XCTAssertEqual(scheme.launchAction?.useCustomWorkingDirectory, false) XCTAssertEqual(scheme.launchAction?.ignoresPersistentStateOnLaunch, false) XCTAssertEqual(scheme.launchAction?.debugDocumentVersioning, true) @@ -533,6 +535,7 @@ final class XCSchemeIntegrationTests: XCTestCase { XCTAssertEqual(scheme.launchAction?.buildConfiguration, "Staging") XCTAssertEqual(scheme.launchAction?.launchStyle, XCScheme.LaunchAction.Style.auto) XCTAssertTrue(scheme.launchAction?.askForAppToLaunch == true) + XCTAssertEqual(scheme.launchAction?.customWorkingDirectory, "/customWorkingDirectory") XCTAssertTrue(scheme.launchAction?.useCustomWorkingDirectory == false) XCTAssertTrue(scheme.launchAction?.ignoresPersistentStateOnLaunch == false) XCTAssertTrue(scheme.launchAction?.debugDocumentVersioning == true) @@ -568,6 +571,7 @@ final class XCSchemeIntegrationTests: XCTestCase { XCTAssertEqual(scheme.profileAction?.buildConfiguration, "Release") XCTAssertTrue(scheme.profileAction?.shouldUseLaunchSchemeArgsEnv == true) XCTAssertEqual(scheme.profileAction?.savedToolIdentifier, "") + XCTAssertNil(scheme.profileAction?.customWorkingDirectory) XCTAssertTrue(scheme.profileAction?.useCustomWorkingDirectory == false) XCTAssertTrue(scheme.profileAction?.debugDocumentVersioning == true) XCTAssertTrue(scheme.profileAction?.askForAppToLaunch == true) @@ -627,6 +631,7 @@ final class XCSchemeIntegrationTests: XCTestCase { XCTAssertEqual(scheme.launchAction?.buildConfiguration, "Debug") XCTAssertEqual(scheme.launchAction?.launchStyle, XCScheme.LaunchAction.Style.auto) XCTAssertNil(scheme.launchAction?.askForAppToLaunch) + XCTAssertNil(scheme.launchAction?.customWorkingDirectory) XCTAssertTrue(scheme.launchAction?.useCustomWorkingDirectory == false) XCTAssertTrue(scheme.launchAction?.ignoresPersistentStateOnLaunch == false) XCTAssertTrue(scheme.launchAction?.debugDocumentVersioning == true) @@ -657,6 +662,7 @@ final class XCSchemeIntegrationTests: XCTestCase { XCTAssertEqual(scheme.profileAction?.buildConfiguration, "Release") XCTAssertTrue(scheme.profileAction?.shouldUseLaunchSchemeArgsEnv == true) XCTAssertEqual(scheme.profileAction?.savedToolIdentifier, "") + XCTAssertNil(scheme.profileAction?.customWorkingDirectory) XCTAssertTrue(scheme.profileAction?.useCustomWorkingDirectory == false) XCTAssertTrue(scheme.profileAction?.debugDocumentVersioning == true) XCTAssertNil(scheme.profileAction?.askForAppToLaunch) From 3471fa50291a3b889e4c41c35a1f6955188b21f7 Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Tue, 13 Sep 2022 22:17:42 +0200 Subject: [PATCH 232/678] docs: add brentleyjones as a contributor for code (#726) * docs: update README.md [skip ci] * docs: update .all-contributorsrc [skip ci] Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com> --- .all-contributorsrc | 9 +++++++++ README.md | 3 ++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/.all-contributorsrc b/.all-contributorsrc index 4210d4dcf..449470941 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -211,6 +211,15 @@ "contributions": [ "code" ] + }, + { + "login": "brentleyjones", + "name": "Brentley Jones", + "avatar_url": "https://avatars.githubusercontent.com/u/158658?v=4", + "profile": "https://brentleyjones.com", + "contributions": [ + "code" + ] } ], "contributorsPerLine": 7, diff --git a/README.md b/README.md index 0262ff7bb..871d4ea84 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # XcodeProj -[![All Contributors](https://img.shields.io/badge/all_contributors-23-orange.svg?style=flat-square)](#contributors-) +[![All Contributors](https://img.shields.io/badge/all_contributors-24-orange.svg?style=flat-square)](#contributors-) [![Swift Package Manager](https://img.shields.io/badge/swift%20package%20manager-compatible-brightgreen.svg)](https://swift.org/package-manager/) @@ -182,6 +182,7 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
Michael McGuire

💻
C-凡

💻 +
Brentley Jones

💻 From 5a3c1185473733506165fba461305f06fcb7e0e3 Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Tue, 13 Sep 2022 22:19:24 +0200 Subject: [PATCH 233/678] docs: add maxwellE as a contributor for code (#727) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * docs: update README.md [skip ci] * docs: update .all-contributorsrc [skip ci] Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com> Co-authored-by: Marek Fořt --- .all-contributorsrc | 9 +++++++++ README.md | 1 + 2 files changed, 10 insertions(+) diff --git a/.all-contributorsrc b/.all-contributorsrc index 449470941..d9c170812 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -212,6 +212,15 @@ "code" ] }, + { + "login": "maxwellE", + "name": "Maxwell Elliott", + "avatar_url": "https://avatars.githubusercontent.com/u/566328?v=4", + "profile": "http://www.tinder.com", + "contributions": [ + "code" + ] + }, { "login": "brentleyjones", "name": "Brentley Jones", diff --git a/README.md b/README.md index 871d4ea84..30b78020a 100644 --- a/README.md +++ b/README.md @@ -182,6 +182,7 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
Michael McGuire

💻
C-凡

💻 +
Maxwell Elliott

💻
Brentley Jones

💻 From d85034e0fbd179a64f61083c70158b2fa29f6c6a Mon Sep 17 00:00:00 2001 From: DevTchernov Date: Wed, 14 Sep 2022 03:21:32 +0700 Subject: [PATCH 234/678] Add Rugby tool in 'projects using' table (#723) There's package importing: https://github.com/swiftyfinch/Rugby/blob/21cd79fb2d8be25772c44c0b27fc8087ea8f9bed/Package.swift#L26 Examples of usage: https://github.com/swiftyfinch/Rugby/tree/main/Sources/Rugby/Common/XcodeProj --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 30b78020a..29abef1b6 100644 --- a/README.md +++ b/README.md @@ -35,6 +35,7 @@ XcodeProj is a library written in Swift for parsing and working with Xcode proje | ProjLint | [github.com/JamitLabs/ProjLint](https://github.com/JamitLabs/ProjLint) | | XcodeGen | [github.com/yonaskolb/XcodeGen](https://github.com/yonaskolb/XcodeGen) | | xspm | [gitlab.com/Pyroh/xspm](https://gitlab.com/Pyroh/xspm) | +| Rugby | [github.com/swiftyfinch/Rugby](https://github.com/swiftyfinch/Rugby) | If you are also leveraging XcodeProj in your project, feel free to open a PR to include it in the list above. From 61b9bc801d3866a78a2de532c1266841bc245f23 Mon Sep 17 00:00:00 2001 From: Blake McAnally Date: Sun, 16 Oct 2022 05:53:06 -0500 Subject: [PATCH 235/678] Have Xcode highlight Bazel file syntax in generated projects (#730) --- Sources/XcodeProj/Project/Xcode.swift | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Sources/XcodeProj/Project/Xcode.swift b/Sources/XcodeProj/Project/Xcode.swift index 2a990af2e..4d8a1d154 100644 --- a/Sources/XcodeProj/Project/Xcode.swift +++ b/Sources/XcodeProj/Project/Xcode.swift @@ -100,9 +100,11 @@ public struct Xcode { "atlas": "folder.skatlas", "au": "audio.au", "avi": "video.avi", + "bazel": "text.script.python", "bin": "archive.macbinary", "bmp": "image.bmp", "bundle": "wrapper.cfbundle", + "bzl": "text.script.python", "c": "sourcecode.c.c", "c++": "sourcecode.cpp.cpp", "cc": "sourcecode.cpp.cpp", From a448075d4e0f0f60d888f9394a6b38f8c90b7232 Mon Sep 17 00:00:00 2001 From: Brentley Jones Date: Sun, 16 Oct 2022 05:53:44 -0500 Subject: [PATCH 236/678] Add rules_xcodeproj to "projects using" table (#729) --- README.md | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 29abef1b6..4ee167d8e 100644 --- a/README.md +++ b/README.md @@ -28,14 +28,15 @@ XcodeProj is a library written in Swift for parsing and working with Xcode proje ## Projects Using XcodeProj -| Project | Repository | -| -------- | -------------------------------------------------------------------------------------- | -| Tuist | [github.com/tuist/tuist](https://github.com/tuist/tuist) | -| Sourcery | [github.com/krzysztofzablocki/Sourcery](https://github.com/krzysztofzablocki/Sourcery) | -| ProjLint | [github.com/JamitLabs/ProjLint](https://github.com/JamitLabs/ProjLint) | -| XcodeGen | [github.com/yonaskolb/XcodeGen](https://github.com/yonaskolb/XcodeGen) | -| xspm | [gitlab.com/Pyroh/xspm](https://gitlab.com/Pyroh/xspm) | -| Rugby | [github.com/swiftyfinch/Rugby](https://github.com/swiftyfinch/Rugby) | +| Project | Repository | +| --------------- | -------------------------------------------------------------------------------------------- | +| ProjLint | [github.com/JamitLabs/ProjLint](https://github.com/JamitLabs/ProjLint) | +| rules_xcodeproj | [github.com/buildbuddy-io/rules_xcodeproj](https://github.com/buildbuddy-io/rules_xcodeproj) | +| Rugby | [github.com/swiftyfinch/Rugby](https://github.com/swiftyfinch/Rugby) | +| Sourcery | [github.com/krzysztofzablocki/Sourcery](https://github.com/krzysztofzablocki/Sourcery) | +| Tuist | [github.com/tuist/tuist](https://github.com/tuist/tuist) | +| XcodeGen | [github.com/yonaskolb/XcodeGen](https://github.com/yonaskolb/XcodeGen) | +| xspm | [gitlab.com/Pyroh/xspm](https://gitlab.com/Pyroh/xspm) | If you are also leveraging XcodeProj in your project, feel free to open a PR to include it in the list above. From e4d7ed11d0df98337fe6550de5f530ddcaf866b0 Mon Sep 17 00:00:00 2001 From: Maxwell Elliott Date: Tue, 6 Dec 2022 02:34:42 -0500 Subject: [PATCH 237/678] Allow specifying `platformFilter` in `PBXBuildFile` init - Add the ability to specify the platform filter in the init for `PBXBuildFile` for convenience. --- Sources/XcodeProj/Objects/BuildPhase/PBXBuildFile.swift | 4 +++- .../Objects/BuildPhase/PBXBuildFileTests.swift | 7 +++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/Sources/XcodeProj/Objects/BuildPhase/PBXBuildFile.swift b/Sources/XcodeProj/Objects/BuildPhase/PBXBuildFile.swift index 7982d6be5..5c5d45773 100644 --- a/Sources/XcodeProj/Objects/BuildPhase/PBXBuildFile.swift +++ b/Sources/XcodeProj/Objects/BuildPhase/PBXBuildFile.swift @@ -50,10 +50,12 @@ public final class PBXBuildFile: PBXObject { /// - settings: build file settings. public init(file: PBXFileElement? = nil, product: XCSwiftPackageProductDependency? = nil, - settings: [String: Any]? = nil) { + settings: [String: Any]? = nil, + platformFilter: String? = nil) { fileReference = file?.reference productReference = product?.reference self.settings = settings + self.platformFilter = platformFilter super.init() } diff --git a/Tests/XcodeProjTests/Objects/BuildPhase/PBXBuildFileTests.swift b/Tests/XcodeProjTests/Objects/BuildPhase/PBXBuildFileTests.swift index 517e2dec9..517dad192 100644 --- a/Tests/XcodeProjTests/Objects/BuildPhase/PBXBuildFileTests.swift +++ b/Tests/XcodeProjTests/Objects/BuildPhase/PBXBuildFileTests.swift @@ -6,4 +6,11 @@ final class PBXBuildFileTests: XCTestCase { func test_isa_returnsTheCorrectValue() { XCTAssertEqual(PBXBuildFile.isa, "PBXBuildFile") } + + func test_platformFilterIsSet() { + let pbxBuildFile: PBXBuildFile = PBXBuildFile( + platformFilter: "platformFilter" + ) + XCTAssertEqual(pbxBuildFile.platformFilter, "platformFilter") + } } From 6e96bdcd2a00edb4b3addc31aa30d97ce3b3280d Mon Sep 17 00:00:00 2001 From: Maxwell Elliott Date: Wed, 21 Dec 2022 06:04:18 -0500 Subject: [PATCH 238/678] Add `platformFilters` attribute (#737) - Add support for `platformFilters` (plural) attribute - When selecting multiple platform filters, Xcode uses a different attribute `platformFilters` (plural) vs when using a single one it uses `platformFilter` (singular) --- .../XcodeProj/Objects/BuildPhase/PBXBuildFile.swift | 12 +++++++++++- .../Objects/Targets/PBXTargetDependency.swift | 11 +++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/Sources/XcodeProj/Objects/BuildPhase/PBXBuildFile.swift b/Sources/XcodeProj/Objects/BuildPhase/PBXBuildFile.swift index 5c5d45773..99e8c8445 100644 --- a/Sources/XcodeProj/Objects/BuildPhase/PBXBuildFile.swift +++ b/Sources/XcodeProj/Objects/BuildPhase/PBXBuildFile.swift @@ -37,6 +37,9 @@ public final class PBXBuildFile: PBXObject { /// Introduced in: Xcode 11 public var platformFilter: String? + /// Platform filters attribute. + public var platformFilters: [String]? + /// The cached build phase this build file belongs to weak var buildPhase: PBXBuildPhase? @@ -51,11 +54,13 @@ public final class PBXBuildFile: PBXObject { public init(file: PBXFileElement? = nil, product: XCSwiftPackageProductDependency? = nil, settings: [String: Any]? = nil, - platformFilter: String? = nil) { + platformFilter: String? = nil, + platformFilters: [String]? = nil) { fileReference = file?.reference productReference = product?.reference self.settings = settings self.platformFilter = platformFilter + self.platformFilters = platformFilters super.init() } @@ -66,6 +71,7 @@ public final class PBXBuildFile: PBXObject { case settings case productRef case platformFilter + case platformFilters } public required init(from decoder: Decoder) throws { @@ -80,6 +86,7 @@ public final class PBXBuildFile: PBXObject { } settings = try container.decodeIfPresent([String: Any].self, forKey: .settings) platformFilter = try container.decodeIfPresent(.platformFilter) + platformFilters = try container.decodeIfPresent([String].self, forKey: .platformFilters) try super.init(from: decoder) } @@ -176,6 +183,9 @@ final class PBXBuildPhaseFile: PlistSerializable, Equatable { if let platformFilter = buildFile.platformFilter { dictionary["platformFilter"] = .string(.init(platformFilter)) } + if let platformFilters = buildFile.platformFilters { + dictionary["platformFilters"] = .array(platformFilters.map { .string(.init($0)) }) + } let comment = try buildPhase.name().flatMap { "\(try buildFile.fileName() ?? "(null)") in \($0)" } return (key: CommentedString(reference, comment: comment), value: .dictionary(dictionary)) diff --git a/Sources/XcodeProj/Objects/Targets/PBXTargetDependency.swift b/Sources/XcodeProj/Objects/Targets/PBXTargetDependency.swift index bd3379ac0..22603e5b3 100644 --- a/Sources/XcodeProj/Objects/Targets/PBXTargetDependency.swift +++ b/Sources/XcodeProj/Objects/Targets/PBXTargetDependency.swift @@ -50,6 +50,9 @@ public final class PBXTargetDependency: PBXObject { /// Introduced in: Xcode 11 public var platformFilter: String? + /// Platform filters attribute. + public var platformFilters: [String]? + // MARK: - Init /// Initializes the target dependency with dependencies as objects. @@ -57,15 +60,18 @@ public final class PBXTargetDependency: PBXObject { /// - Parameters: /// - name: Dependency name. /// - platformFilter: Platform filter. + /// - platformFilters: Platform filters. /// - target: Target. /// - targetProxy: Target proxy. public init(name: String? = nil, platformFilter: String? = nil, + platformFilters: [String]? = nil, target: PBXTarget? = nil, targetProxy: PBXContainerItemProxy? = nil, product: XCSwiftPackageProductDependency? = nil) { self.name = name self.platformFilter = platformFilter + self.platformFilters = platformFilters targetReference = target?.reference targetProxyReference = targetProxy?.reference productReference = product?.reference @@ -77,6 +83,7 @@ public final class PBXTargetDependency: PBXObject { fileprivate enum CodingKeys: String, CodingKey { case name case platformFilter + case platformFilters case target case targetProxy case productRef @@ -88,6 +95,7 @@ public final class PBXTargetDependency: PBXObject { let objects = decoder.context.objects name = try container.decodeIfPresent(.name) platformFilter = try container.decodeIfPresent(.platformFilter) + platformFilters = try container.decodeIfPresent([String].self, forKey: .platformFilters) if let targetReference: String = try container.decodeIfPresent(.target) { self.targetReference = referenceRepository.getOrCreate(reference: targetReference, objects: objects) } @@ -118,6 +126,9 @@ extension PBXTargetDependency: PlistSerializable { if let platformFilter = platformFilter { dictionary["platformFilter"] = .string(CommentedString(platformFilter)) } + if let platformFilters = platformFilters { + dictionary["platformFilters"] = .array(platformFilters.map { .string(.init($0)) }) + } if let targetReference = targetReference { let targetObject: PBXTarget? = targetReference.getObject() dictionary["target"] = .string(CommentedString(targetReference.value, comment: targetObject?.name)) From cbf71c8d3d4a7e3c86f08285b8c94241d0567952 Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Fri, 20 Jan 2023 18:33:19 +0000 Subject: [PATCH 239/678] docs: add teameh as a contributor for code (#741) * docs: update README.md [skip ci] * docs: update .all-contributorsrc [skip ci] Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com> --- .all-contributorsrc | 12 +++++++- README.md | 71 +++++++++++++++++++++++---------------------- 2 files changed, 48 insertions(+), 35 deletions(-) diff --git a/.all-contributorsrc b/.all-contributorsrc index d9c170812..152b10d00 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -229,6 +229,15 @@ "contributions": [ "code" ] + }, + { + "login": "teameh", + "name": "Teameh", + "avatar_url": "https://avatars.githubusercontent.com/u/1330668?v=4", + "profile": "https://www.linkedin.com/in/tiemevanveen", + "contributions": [ + "code" + ] } ], "contributorsPerLine": 7, @@ -236,5 +245,6 @@ "projectOwner": "tuist", "repoType": "github", "repoHost": "https://github.com", - "skipCi": true + "skipCi": true, + "commitConvention": "angular" } diff --git a/README.md b/README.md index 4ee167d8e..ef35173c7 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # XcodeProj -[![All Contributors](https://img.shields.io/badge/all_contributors-24-orange.svg?style=flat-square)](#contributors-) +[![All Contributors](https://img.shields.io/badge/all_contributors-26-orange.svg?style=flat-square)](#contributors-) [![Swift Package Manager](https://img.shields.io/badge/swift%20package%20manager-compatible-brightgreen.svg)](https://swift.org/package-manager/) @@ -154,39 +154,42 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Joseph Colicchio

🤔

deatondg

🤔

Dan Fleming

💻

Sascha Schwabbauer

🤔

Marcin Iwanicki

🚧

Adam Khazi

🚧

Elliott Williams

💻

Muukii

🖋

Yuya Oka

💻

Keith Smiley

🖋

Ian Leitch

💻

Daniil Subbotin

💻

Florentin Bekier

💻

Vadim Smal

🐛

freddi(Yuki Aki)

💻

Kristopher Jackson

💻

Jake Prickett

💻

Jake Adams

💻

matsuji

💻

Bogdan Belogurov

💻

Chuck Grindel

💻

Michael McGuire

💻

C-凡

💻

Maxwell Elliott

💻

Brentley Jones

💻
Joseph Colicchio
Joseph Colicchio

🤔
deatondg
deatondg

🤔
Dan Fleming
Dan Fleming

💻
Sascha Schwabbauer
Sascha Schwabbauer

🤔
Marcin Iwanicki
Marcin Iwanicki

🚧
Adam Khazi
Adam Khazi

🚧
Elliott Williams
Elliott Williams

💻
Muukii
Muukii

🖋
Yuya Oka
Yuya Oka

💻
Keith Smiley
Keith Smiley

🖋
Ian Leitch
Ian Leitch

💻
Daniil Subbotin
Daniil Subbotin

💻
Florentin Bekier
Florentin Bekier

💻
Vadim Smal
Vadim Smal

🐛
freddi(Yuki Aki)
freddi(Yuki Aki)

💻
Kristopher Jackson
Kristopher Jackson

💻
Jake Prickett
Jake Prickett

💻
Jake Adams
Jake Adams

💻
matsuji
matsuji

💻
Bogdan Belogurov
Bogdan Belogurov

💻
Chuck Grindel
Chuck Grindel

💻
Michael McGuire
Michael McGuire

💻
C-凡
C-凡

💻
Maxwell Elliott
Maxwell Elliott

💻
Brentley Jones
Brentley Jones

💻
Teameh
Teameh

💻
From 9227827beb1c8a1564c534b280a3948ee1602b17 Mon Sep 17 00:00:00 2001 From: "depfu[bot]" <23717796+depfu[bot]@users.noreply.github.com> Date: Fri, 20 Jan 2023 18:33:33 +0000 Subject: [PATCH 240/678] Update all of rails to version 6.1.7.1 (#742) Co-authored-by: depfu[bot] <23717796+depfu[bot]@users.noreply.github.com> --- Gemfile.lock | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 5b62c4e92..0726db82b 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -3,7 +3,7 @@ GEM specs: CFPropertyList (3.0.5) rexml - activesupport (6.1.5) + activesupport (6.1.7.1) concurrent-ruby (~> 1.0, >= 1.0.2) i18n (>= 1.6, < 2) minitest (>= 5.1) @@ -55,7 +55,7 @@ GEM cocoapods-try (1.2.0) colored2 (3.1.2) colorize (0.8.1) - concurrent-ruby (1.1.9) + concurrent-ruby (1.1.10) escape (0.0.4) ethon (0.15.0) ffi (>= 1.15.0) @@ -64,7 +64,7 @@ GEM fuzzy_match (2.0.4) gh_inspector (1.1.3) httpclient (2.8.3) - i18n (1.10.0) + i18n (1.12.0) concurrent-ruby (~> 1.0) jazzy (0.14.2) cocoapods (~> 1.5) @@ -78,7 +78,7 @@ GEM xcinvoke (~> 0.3.0) json (2.6.1) liferaft (0.0.6) - minitest (5.15.0) + minitest (5.17.0) molinillo (0.8.0) mustache (1.1.1) nanaimo (0.3.0) @@ -96,7 +96,7 @@ GEM sqlite3 (1.4.2) typhoeus (1.4.0) ethon (>= 0.9.0) - tzinfo (2.0.4) + tzinfo (2.0.5) concurrent-ruby (~> 1.0) xcinvoke (0.3.0) liferaft (~> 0.0.6) @@ -107,7 +107,7 @@ GEM colored2 (~> 3.1) nanaimo (~> 0.3.0) rexml (~> 3.2.4) - zeitwerk (2.5.4) + zeitwerk (2.6.6) PLATFORMS ruby From 13705282e17ab2955790a204827f8827068a79f2 Mon Sep 17 00:00:00 2001 From: Teameh Date: Thu, 2 Feb 2023 15:23:26 +0100 Subject: [PATCH 241/678] Add support for xcuserdata (#739) - Added support for creating and reading `XCUserData` - Multiple `XCUserData` elements can be optionally added to generated projects - By default `XCUserData` and its nested elements are only replaced if explicitly specified, however if left unspecified any elements on disk are left as is - This was a conscious choice to support project generation workflows where users may have custom local schemes / breakpoints etc... which shouldn't get erased when projects are re-generated - Updated path handling for some of the common elements (e.e. breakpoints, schemes, etc...) to allow sharing logic between shared data and user data --- CHANGELOG.md | 2 + Fixtures/Schemes/xcschememanagement.plist | 4 +- .../xcdebugger/Breakpoints_v2.xcbkptlist | 8 ++ .../xcshareddata/xcschemes/iOS.xcscheme | 55 ++++---- .../xcdebugger/Breakpoints_v2.xcbkptlist | 41 ++++++ .../xcschemes/iOS-debug.xcscheme | 58 +++++++++ .../xcschemes/iOS-other.xcscheme | 58 +++++++++ .../xcschemes/iOS-release.xcscheme | 58 +++++++++ .../xcschemes/xcschememanagement.plist | 45 +++++++ .../xcschemes/iOSTests.xcscheme | 55 ++++++++ .../xcschemes/custom-scheme.xcscheme | 58 +++++++++ Sources/XcodeProj/Errors/Errors.swift | 16 +++ .../XcodeProj/Project/XCBreakpointList.swift | 10 ++ Sources/XcodeProj/Project/XCDebugger.swift | 13 ++ Sources/XcodeProj/Project/XCSharedData.swift | 52 +++++++- Sources/XcodeProj/Project/XCUserData.swift | 117 ++++++++++++++++++ Sources/XcodeProj/Project/XcodeProj.swift | 91 ++++++++++---- Sources/XcodeProj/Scheme/XCScheme.swift | 19 +++ .../XcodeProj/Scheme/XCSchemeManagement.swift | 25 +++- .../Project/XCUserDataTests.swift | 42 +++++++ .../Project/XcodeProjTests.swift | 60 +++++++++ .../Scheme/XCSchemeManagementTests.swift | 17 ++- .../XcodeProjTests/Scheme/XCSchemeTests.swift | 5 + Tests/XcodeProjTests/Tests/testWrite.swift | 30 +++++ 24 files changed, 871 insertions(+), 68 deletions(-) create mode 100644 Fixtures/iOS/Project.xcodeproj/xcuserdata/username1.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist create mode 100644 Fixtures/iOS/Project.xcodeproj/xcuserdata/username1.xcuserdatad/xcschemes/iOS-debug.xcscheme create mode 100644 Fixtures/iOS/Project.xcodeproj/xcuserdata/username1.xcuserdatad/xcschemes/iOS-other.xcscheme create mode 100644 Fixtures/iOS/Project.xcodeproj/xcuserdata/username1.xcuserdatad/xcschemes/iOS-release.xcscheme create mode 100644 Fixtures/iOS/Project.xcodeproj/xcuserdata/username1.xcuserdatad/xcschemes/xcschememanagement.plist create mode 100644 Fixtures/iOS/Project.xcodeproj/xcuserdata/username2.xcuserdatad/xcschemes/iOSTests.xcscheme create mode 100644 Fixtures/iOS/Project.xcodeproj/xcuserdata/username3.xcuserdatad/xcschemes/custom-scheme.xcscheme create mode 100644 Sources/XcodeProj/Project/XCDebugger.swift create mode 100644 Sources/XcodeProj/Project/XCUserData.swift create mode 100644 Tests/XcodeProjTests/Project/XCUserDataTests.swift create mode 100644 Tests/XcodeProjTests/Project/XcodeProjTests.swift diff --git a/CHANGELOG.md b/CHANGELOG.md index 33c42c9d7..f7591ba6c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ ## Next +- Add XCUserData [#739](https://github.com/tuist/XcodeProj/pull/739) by [@teameh](https://github.com/teameh) + ## 8.8.0 ### Fixed diff --git a/Fixtures/Schemes/xcschememanagement.plist b/Fixtures/Schemes/xcschememanagement.plist index 7a0865f0c..44373b956 100644 --- a/Fixtures/Schemes/xcschememanagement.plist +++ b/Fixtures/Schemes/xcschememanagement.plist @@ -6,10 +6,10 @@ Tuist.xcscheme_^#shared#^_ + isShown + orderHint 0 - isShown - XcodeProj.xcscheme diff --git a/Fixtures/iOS/Project.xcodeproj/xcshareddata/xcdebugger/Breakpoints_v2.xcbkptlist b/Fixtures/iOS/Project.xcodeproj/xcshareddata/xcdebugger/Breakpoints_v2.xcbkptlist index a03326804..931805c0a 100644 --- a/Fixtures/iOS/Project.xcodeproj/xcshareddata/xcdebugger/Breakpoints_v2.xcbkptlist +++ b/Fixtures/iOS/Project.xcodeproj/xcshareddata/xcdebugger/Breakpoints_v2.xcbkptlist @@ -17,6 +17,8 @@ + + + + + + + + diff --git a/Fixtures/iOS/Project.xcodeproj/xcshareddata/xcschemes/iOS.xcscheme b/Fixtures/iOS/Project.xcodeproj/xcshareddata/xcschemes/iOS.xcscheme index 441f0e3b2..fb8299e4a 100644 --- a/Fixtures/iOS/Project.xcodeproj/xcshareddata/xcschemes/iOS.xcscheme +++ b/Fixtures/iOS/Project.xcodeproj/xcshareddata/xcschemes/iOS.xcscheme @@ -45,9 +45,9 @@ buildConfiguration = "Debug" selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" + shouldUseLaunchSchemeArgsEnv = "YES" codeCoverageEnabled = "YES" - onlyGenerateCoverageForSpecifiedTargets = "YES" - shouldUseLaunchSchemeArgsEnv = "YES"> + onlyGenerateCoverageForSpecifiedTargets = "YES"> @@ -80,6 +80,12 @@ + + + + + + + + + + - - - - - - - - - - + allowLocationSimulation = "YES" + customLaunchCommand = "custom command"> @@ -178,6 +179,10 @@ ReferencedContainer = "container:Project.xcodeproj">
+ + - - + identifier = "../../Configuration.storekit"> + + + + + + + + + + + + + + + + + + + + diff --git a/Fixtures/iOS/Project.xcodeproj/xcuserdata/username1.xcuserdatad/xcschemes/iOS-debug.xcscheme b/Fixtures/iOS/Project.xcodeproj/xcuserdata/username1.xcuserdatad/xcschemes/iOS-debug.xcscheme new file mode 100644 index 000000000..7cb38d44f --- /dev/null +++ b/Fixtures/iOS/Project.xcodeproj/xcuserdata/username1.xcuserdatad/xcschemes/iOS-debug.xcscheme @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Fixtures/iOS/Project.xcodeproj/xcuserdata/username1.xcuserdatad/xcschemes/iOS-other.xcscheme b/Fixtures/iOS/Project.xcodeproj/xcuserdata/username1.xcuserdatad/xcschemes/iOS-other.xcscheme new file mode 100644 index 000000000..7cb38d44f --- /dev/null +++ b/Fixtures/iOS/Project.xcodeproj/xcuserdata/username1.xcuserdatad/xcschemes/iOS-other.xcscheme @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Fixtures/iOS/Project.xcodeproj/xcuserdata/username1.xcuserdatad/xcschemes/iOS-release.xcscheme b/Fixtures/iOS/Project.xcodeproj/xcuserdata/username1.xcuserdatad/xcschemes/iOS-release.xcscheme new file mode 100644 index 000000000..3549252de --- /dev/null +++ b/Fixtures/iOS/Project.xcodeproj/xcuserdata/username1.xcuserdatad/xcschemes/iOS-release.xcscheme @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Fixtures/iOS/Project.xcodeproj/xcuserdata/username1.xcuserdatad/xcschemes/xcschememanagement.plist b/Fixtures/iOS/Project.xcodeproj/xcuserdata/username1.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 000000000..0bcfc80ee --- /dev/null +++ b/Fixtures/iOS/Project.xcodeproj/xcuserdata/username1.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,45 @@ + + + + + SchemeUserState + + Rx (Playground) 1.xcscheme + + isShown + + orderHint + 5 + + Rx (Playground) 2.xcscheme + + isShown + + orderHint + 6 + + Rx (Playground).xcscheme + + isShown + + orderHint + 4 + + iOS-debug.xcscheme + + orderHint + 0 + + iOS-release.xcscheme + + orderHint + 1 + + iOS.xcscheme_^#shared#^_ + + orderHint + 3 + + + + diff --git a/Fixtures/iOS/Project.xcodeproj/xcuserdata/username2.xcuserdatad/xcschemes/iOSTests.xcscheme b/Fixtures/iOS/Project.xcodeproj/xcuserdata/username2.xcuserdatad/xcschemes/iOSTests.xcscheme new file mode 100644 index 000000000..972b4579e --- /dev/null +++ b/Fixtures/iOS/Project.xcodeproj/xcuserdata/username2.xcuserdatad/xcschemes/iOSTests.xcscheme @@ -0,0 +1,55 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Fixtures/iOS/Project.xcodeproj/xcuserdata/username3.xcuserdatad/xcschemes/custom-scheme.xcscheme b/Fixtures/iOS/Project.xcodeproj/xcuserdata/username3.xcuserdatad/xcschemes/custom-scheme.xcscheme new file mode 100644 index 000000000..7cb38d44f --- /dev/null +++ b/Fixtures/iOS/Project.xcodeproj/xcuserdata/username3.xcuserdatad/xcschemes/custom-scheme.xcscheme @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Sources/XcodeProj/Errors/Errors.swift b/Sources/XcodeProj/Errors/Errors.swift index 1b781e8b4..6554f83fa 100644 --- a/Sources/XcodeProj/Errors/Errors.swift +++ b/Sources/XcodeProj/Errors/Errors.swift @@ -41,6 +41,22 @@ public enum XCSharedDataError: Error, CustomStringConvertible { } } +// MARK: - XCUserData + +/// XCUserData errors. +/// +/// - notFound: the user data hasn't been found. +public enum XCUserDataError: Error, CustomStringConvertible { + case notFound(path: Path) + + public var description: String { + switch self { + case let .notFound(path): + return "xcuserdata not found at path \(path.string)" + } + } +} + // MARK: - XCWorkspace /// XCWorkspace Errors diff --git a/Sources/XcodeProj/Project/XCBreakpointList.swift b/Sources/XcodeProj/Project/XCBreakpointList.swift index fb76ff74e..60b5b8ff7 100644 --- a/Sources/XcodeProj/Project/XCBreakpointList.swift +++ b/Sources/XcodeProj/Project/XCBreakpointList.swift @@ -426,3 +426,13 @@ public final class XCBreakpointList: Equatable, Writable { lhs.version == rhs.version } } + +extension XCBreakpointList { + /// Returns breakpoints plist path relative to the given path. + /// + /// - Parameter path: debugger folder + /// - Returns: breakpoints plist path relative to the given path. + public static func path(_ path: Path) -> Path { + path + "Breakpoints_v2.xcbkptlist" + } +} diff --git a/Sources/XcodeProj/Project/XCDebugger.swift b/Sources/XcodeProj/Project/XCDebugger.swift new file mode 100644 index 000000000..ce79058aa --- /dev/null +++ b/Sources/XcodeProj/Project/XCDebugger.swift @@ -0,0 +1,13 @@ +import AEXML +import Foundation +import PathKit + +enum XCDebugger { + /// Returns debugger folder path relative to the given path. + /// + /// - Parameter path: parent folder of debugger folder (xcshareddata or xcuserdata) + /// - Returns: debugger folder path relative to the given path. + public static func path(_ path: Path) -> Path { + path + "xcdebugger" + } +} diff --git a/Sources/XcodeProj/Project/XCSharedData.swift b/Sources/XcodeProj/Project/XCSharedData.swift index 18d788efd..ffc8ee4e7 100644 --- a/Sources/XcodeProj/Project/XCSharedData.swift +++ b/Sources/XcodeProj/Project/XCSharedData.swift @@ -1,7 +1,7 @@ import Foundation import PathKit -public final class XCSharedData: Equatable { +public final class XCSharedData: Equatable, Writable { // MARK: - Attributes /// Shared data schemes. @@ -36,9 +36,11 @@ public final class XCSharedData: Equatable { if !path.exists { throw XCSharedDataError.notFound(path: path) } - schemes = path.glob("xcschemes/*.xcscheme") + schemes = XCScheme.schemesPath(path) + .glob("*.xcscheme") .compactMap { try? XCScheme(path: $0) } - breakpoints = try? XCBreakpointList(path: path + "xcdebugger/Breakpoints_v2.xcbkptlist") + + breakpoints = try? XCBreakpointList(path: XCBreakpointList.path(XCDebugger.path(path))) let workspaceSettingsPath = path + "WorkspaceSettings.xcsettings" if workspaceSettingsPath.exists { @@ -55,4 +57,48 @@ public final class XCSharedData: Equatable { lhs.breakpoints == rhs.breakpoints && lhs.workspaceSettings == rhs.workspaceSettings } + + // MARK: - Writable + + public func write(path: Path, override: Bool) throws { + try writeSchemes(path: path, override: override) + try writeBreakpoints(path: path, override: override) + } + + func writeSchemes(path: Path, override: Bool) throws { + let schemesPath = XCScheme.schemesPath(path) + if override, schemesPath.exists { + try schemesPath.delete() + } + + guard !schemes.isEmpty else { return } + + try schemesPath.mkpath() + for scheme in schemes { + let schemePath = XCScheme.path(path, schemeName: scheme.name) + try scheme.write(path: schemePath, override: override) + } + } + + func writeBreakpoints(path: Path, override: Bool) throws { + let debuggerPath = XCDebugger.path(path) + if override, debuggerPath.exists { + try debuggerPath.delete() + } + + guard let breakpoints = breakpoints else { return } + + try debuggerPath.mkpath() + try breakpoints.write(path: XCBreakpointList.path(debuggerPath), override: override) + } +} + +extension XCSharedData { + /// Returns shared data path relative to the given path. + /// + /// - Parameter path: `.xcodeproj` file path + /// - Returns: shared data path relative to the given path. + public static func path(_ path: Path) -> Path { + path + "xcshareddata" + } } diff --git a/Sources/XcodeProj/Project/XCUserData.swift b/Sources/XcodeProj/Project/XCUserData.swift new file mode 100644 index 000000000..1d3bf328d --- /dev/null +++ b/Sources/XcodeProj/Project/XCUserData.swift @@ -0,0 +1,117 @@ +import Foundation +import PathKit +import AEXML + +public final class XCUserData: Equatable, Writable { + // MARK: - Attributes + + /// User name + public var userName: String + + /// User data schemes. + public var schemes: [XCScheme] + + /// Metdata for schemes + public var schemeManagement: XCSchemeManagement? + + /// User data breakpoints. + public var breakpoints: XCBreakpointList? + + // MARK: - Init + + /// Initializes the shared data with its properties. + /// + /// - Parameters: + /// - userName: User name + /// - schemes: User data schemes. + /// - breakpoints: User data breakpoints. + /// - schemeManagement: Metdata for schemes + public init(userName: String, + schemes: [XCScheme], + breakpoints: XCBreakpointList? = nil, + schemeManagement: XCSchemeManagement? = nil) { + self.userName = userName + self.schemes = schemes + self.breakpoints = breakpoints + self.schemeManagement = schemeManagement + } + + /// Initializes the XCUserData reading the content from the disk. + /// + /// - Parameter path: path where the .xcuserdatad is. + public init(path: Path) throws { + if !path.exists { + throw XCUserDataError.notFound(path: path) + } + userName = path.lastComponentWithoutExtension + + let schemesPath = XCScheme.schemesPath(path) + schemes = schemesPath + .glob("*.xcscheme") + .compactMap { try? XCScheme(path: $0) } + schemeManagement = try? XCSchemeManagement(path: XCSchemeManagement.path(schemesPath)) + + breakpoints = try? XCBreakpointList(path: XCBreakpointList.path(XCDebugger.path(path))) + } + + // MARK: - Equatable + + public static func == (lhs: XCUserData, rhs: XCUserData) -> Bool { + lhs.userName == rhs.userName && + lhs.schemes == rhs.schemes && + lhs.breakpoints == rhs.breakpoints && + lhs.schemeManagement == rhs.schemeManagement + } + + // MARK: - Writable + + public func write(path: Path, override: Bool) throws { + try writeSchemes(path: path, override: override) + try writeBreakpoints(path: path, override: override) + try writeSchemeManagement(path: path, override: override) + } + + func writeSchemes(path: Path, override: Bool) throws { + guard !schemes.isEmpty else { return } + + try XCScheme.schemesPath(path).mkpath() + for scheme in schemes { + let schemePath = XCScheme.path(path, schemeName: scheme.name) + try scheme.write(path: schemePath, override: override) + } + } + + func writeSchemeManagement(path: Path, override: Bool) throws { + guard let schemeManagement = schemeManagement else { return } + + let schemesPath = XCScheme.schemesPath(path) + try schemesPath.mkpath() + try schemeManagement.write(path: XCSchemeManagement.path(schemesPath), override: override) + } + + func writeBreakpoints(path: Path, override: Bool) throws { + guard let breakpoints = breakpoints else { return } + + let debuggerPath = XCDebugger.path(path) + try debuggerPath.mkpath() + try breakpoints.write(path: XCBreakpointList.path(debuggerPath), override: override) + } +} + +extension XCUserData { + /// Returns user data path relative to the given path. + /// + /// - Parameter path: `.xcodeproj` file path + /// - Returns: user data path relative to the given path. + public static func path(_ path: Path) -> Path { + path + "xcuserdata" + } + + /// Returns user data path for a specific user relative to the given path. + /// + /// - Parameter path: `.xcodeproj` file path + /// - Returns: user data path relative to the given path. + public static func path(_ path: Path, userName: String) -> Path { + XCUserData.path(path) + "\(userName).xcuserdatad" + } +} diff --git a/Sources/XcodeProj/Project/XcodeProj.swift b/Sources/XcodeProj/Project/XcodeProj.swift index e373ce40c..83734f246 100644 --- a/Sources/XcodeProj/Project/XcodeProj.swift +++ b/Sources/XcodeProj/Project/XcodeProj.swift @@ -14,12 +14,16 @@ public final class XcodeProj: Equatable { /// Shared data. public var sharedData: XCSharedData? + /// User data. + public var userData: [XCUserData] + // MARK: - Init public init(path: Path) throws { var pbxproj: PBXProj! var workspace: XCWorkspace! var sharedData: XCSharedData? + var userData: [XCUserData] if !path.exists { throw XCodeProjError.notFound(path: path) } guard let pbxprojPath = path.glob("*.pbxproj").first else { @@ -35,9 +39,14 @@ public final class XcodeProj: Equatable { let sharedDataPath = path + "xcshareddata" sharedData = try? XCSharedData(path: sharedDataPath) + userData = XCUserData.path(path) + .glob("*.xcuserdatad") + .compactMap { try? XCUserData(path: $0) } + self.pbxproj = pbxproj self.workspace = workspace self.sharedData = sharedData + self.userData = userData } public convenience init(pathString: String) throws { @@ -49,10 +58,16 @@ public final class XcodeProj: Equatable { /// - Parameters: /// - workspace: project internal workspace. /// - pbxproj: project .pbxproj. - public init(workspace: XCWorkspace, pbxproj: PBXProj, sharedData: XCSharedData? = nil) { + /// - sharedData: shared data + /// - userData: user data + public init(workspace: XCWorkspace, + pbxproj: PBXProj, + sharedData: XCSharedData? = nil, + userData: [XCUserData] = []) { self.workspace = workspace self.pbxproj = pbxproj self.sharedData = sharedData + self.userData = userData } // MARK: - Equatable @@ -60,7 +75,8 @@ public final class XcodeProj: Equatable { public static func == (lhs: XcodeProj, rhs: XcodeProj) -> Bool { lhs.workspace == rhs.workspace && lhs.pbxproj == rhs.pbxproj && - lhs.sharedData == rhs.sharedData + lhs.sharedData == rhs.sharedData && + lhs.userData == rhs.userData } } @@ -86,8 +102,8 @@ extension XcodeProj: Writable { try path.mkpath() try writeWorkspace(path: path, override: override) try writePBXProj(path: path, override: override, outputSettings: outputSettings) - try writeSchemes(path: path, override: override) - try writeBreakPoints(path: path, override: override) + try writeSharedData(path: path, override: override) + try writeUserData(path: path, override: override) } /// Returns workspace file path relative to the given path. @@ -130,24 +146,48 @@ extension XcodeProj: Writable { /// - Parameter path: `.xcodeproj` file path /// - Returns: shared data path relative to the given path. public static func sharedDataPath(_ path: Path) -> Path { - path + "xcshareddata" + XCSharedData.path(path) + } + + /// Writes shared data to the given path. + /// + /// - Parameter path: path to `.xcodeproj` file. + /// - Parameter override: if shared data should be overridden. Default is true. + /// - Parameter outputSettings: Controls the writing of various files. + /// If false will throw error if shared data already exists at the given path. + public func writeSharedData(path: Path, override: Bool = true) throws { + try sharedData?.write(path: XCSharedData.path(path), override: override) } - /// Returns schemes folder path relative to the given path. + /// Writes user data to the given path. + /// + /// - Parameter path: path to `.xcodeproj` file. + /// - Parameter override: if user data should be overridden. Default is true. + /// - Parameter outputSettings: Controls the writing of various files. + /// If false will throw error if user data already exists at the given path. + public func writeUserData(path: Path, override: Bool = true) throws { + for userData in userData { + try userData.write(path: XCUserData.path(path, userName: userData.userName), override: override) + } + } + + /// Returns shared schemes folder path relative to the given path. /// /// - Parameter path: `.xcodeproj` file path /// - Returns: schemes folder path relative to the given path. + @available(*, deprecated, message: "use XCScheme.schemesPath(path:)") public static func schemesPath(_ path: Path) -> Path { - XcodeProj.sharedDataPath(path) + "xcschemes" + XCScheme.schemesPath(sharedDataPath(path)) } - /// Returns scheme file path relative to the given path. + /// Returns shared scheme file path relative to the given path. /// /// - Parameter path: `.xcodeproj` file path /// - Parameter schemeName: scheme name /// - Returns: scheme file path relative to the given path. + @available(*, deprecated, message: "use XCScheme.path(path:schemeName)") public static func schemePath(_ path: Path, schemeName: String) -> Path { - XcodeProj.schemesPath(path) + "\(schemeName).xcscheme" + XCScheme.path(schemesPath(path), schemeName: schemeName) } /// Writes all project schemes to the given path. @@ -157,34 +197,32 @@ extension XcodeProj: Writable { /// If true will remove all existing schemes before writing. /// If false will throw error if scheme already exists at the given path. public func writeSchemes(path: Path, override: Bool = true) throws { - guard let sharedData = sharedData else { return } + try sharedData?.writeSchemes(path: XCSharedData.path(path), override: override) - let schemesPath = XcodeProj.schemesPath(path) - if override, schemesPath.exists { - try schemesPath.delete() - } - try schemesPath.mkpath() - for scheme in sharedData.schemes { - try scheme.write(path: XcodeProj.schemePath(path, schemeName: scheme.name), override: override) + for userData in userData { + let userDataPath = XCUserData.path(path, userName: userData.userName) + try userData.writeSchemes(path: userDataPath, override: override) } } - /// Returns debugger folder path relative to the given path. + /// Returns shared debugger folder path relative to the given path. /// /// - Parameter path: `.xcodeproj` file path /// - Parameter schemeName: scheme name /// - Returns: debugger folder path relative to the given path. + @available(*, deprecated, message: "use XCDebugger.path(path:)") public static func debuggerPath(_ path: Path) -> Path { - XcodeProj.sharedDataPath(path) + "xcdebugger" + XCDebugger.path(XCSharedData.path(path)) } - /// Returns breakpoints plist path relative to the given path. + /// Returns shared breakpoints plist path relative to the given path. /// /// - Parameter path: `.xcodeproj` file path /// - Parameter schemeName: scheme name /// - Returns: breakpoints plist path relative to the given path. + @available(*, deprecated, message: "use XCBreakpointList.path(path:)") public static func breakPointsPath(_ path: Path) -> Path { - XcodeProj.debuggerPath(path) + "Breakpoints_v2.xcbkptlist" + XCBreakpointList.path(debuggerPath(path)) } /// Writes all project breakpoints to the given path. @@ -194,13 +232,12 @@ extension XcodeProj: Writable { /// If true will remove all existing debugger data before writing. /// If false will throw error if breakpoints file exists at the given path. public func writeBreakPoints(path: Path, override: Bool = true) throws { - guard let sharedData = sharedData else { return } + let sharedDataPath = XcodeProj.sharedDataPath(path) + try sharedData?.writeBreakpoints(path: sharedDataPath, override: override) - let debuggerPath = XcodeProj.debuggerPath(path) - if override, debuggerPath.exists { - try debuggerPath.delete() + for userData in userData { + let userDataPath = XCUserData.path(path, userName: userData.userName) + try userData.writeBreakpoints(path: userDataPath, override: override) } - try debuggerPath.mkpath() - try sharedData.breakpoints?.write(path: XcodeProj.breakPointsPath(path), override: override) } } diff --git a/Sources/XcodeProj/Scheme/XCScheme.swift b/Sources/XcodeProj/Scheme/XCScheme.swift index 14f1989c5..c64a8e0fb 100644 --- a/Sources/XcodeProj/Scheme/XCScheme.swift +++ b/Sources/XcodeProj/Scheme/XCScheme.swift @@ -130,3 +130,22 @@ public final class XCScheme: Writable, Equatable { lhs.wasCreatedForAppExtension == rhs.wasCreatedForAppExtension } } + +extension XCScheme { + /// Returns schemes folder path relative to the given path. + /// + /// - Parameter path: parent folder of schemes folder (xcshareddata or xcuserdata) + /// - Returns: schemes folder path relative to the given path. + static func schemesPath(_ path: Path) -> Path { + path + "xcschemes" + } + + /// Returns scheme file path relative to the given path. + /// + /// - Parameter path: parent folder of schemes folder (xcshareddata or xcuserdata) + /// - Parameter schemeName: scheme name + /// - Returns: scheme file path relative to the given path. + static func path(_ path: Path, schemeName: String) -> Path { + XCScheme.schemesPath(path) + "\(schemeName).xcscheme" + } +} diff --git a/Sources/XcodeProj/Scheme/XCSchemeManagement.swift b/Sources/XcodeProj/Scheme/XCSchemeManagement.swift index 838bf4ab6..61bbe5c6b 100644 --- a/Sources/XcodeProj/Scheme/XCSchemeManagement.swift +++ b/Sources/XcodeProj/Scheme/XCSchemeManagement.swift @@ -20,8 +20,7 @@ public enum XCSchemeManagementError: Error, Equatable, LocalizedError, CustomStr /// This struct represents the xcschememanagement.plist file that is generated by Xcode /// to attach metdata to schemes such as the order of schemes orwhether a scheme is shared or no. /// The file is formatted as a property list file. -public struct XCSchemeManagement: Codable { - +public struct XCSchemeManagement: Codable, Equatable, Writable { public struct AutocreationBuildable: Equatable, Codable { var primary: Bool } @@ -95,7 +94,6 @@ public struct XCSchemeManagement: Codable { } } - /// Coding keys. public enum CodingKeys: String, CodingKey { case schemeUserState = "SchemeUserState" @@ -108,7 +106,6 @@ public struct XCSchemeManagement: Codable { /// A dictionary where the key is the object reference of the target, and the value the configuration for auto-creating schemes. public var suppressBuildableAutocreation: [String: XCSchemeManagement.AutocreationBuildable]? - /// Default constructor. /// - Parameters: /// - schemeUserState: An array that contains the configuration of the schemes. @@ -132,12 +129,20 @@ public struct XCSchemeManagement: Codable { /// Converts the object into a property list and writes it at the given path. /// - Parameter path: Path to the file where it should be written. + /// - Parameter override: if project should be overridden. Default is false. + /// If true will remove all existing data before writing. + /// If false will throw error iff file exists at the given path. /// - Throws: An error if the write fails. - public func write(path: Path) throws { + public func write(path: Path, override: Bool = false) throws { + if override, path.exists { + try path.delete() + } + let encoder = PropertyListEncoder() encoder.outputFormat = .xml try encoder.encode(self).write(to: path.url) } + // MARK: - Codable public init(from decoder: Decoder) throws { @@ -176,3 +181,13 @@ public struct XCSchemeManagement: Codable { } } } + +extension XCSchemeManagement { + /// Returns scheme management file path relative to the given path. + /// + /// - Parameter path: schemes folder + /// - Returns: scheme management plist path relative to the given path. + static func path(_ path: Path) -> Path { + path + "xcschememanagement.plist" + } +} diff --git a/Tests/XcodeProjTests/Project/XCUserDataTests.swift b/Tests/XcodeProjTests/Project/XCUserDataTests.swift new file mode 100644 index 000000000..36fb1ff36 --- /dev/null +++ b/Tests/XcodeProjTests/Project/XCUserDataTests.swift @@ -0,0 +1,42 @@ +import Foundation +import PathKit +import XCTest +@testable import XcodeProj + +final class XCUserDataTests: XCTestCase { + func test_read_userData() throws { + let subject = try XCUserData(path: userDataPath) + assert(userData: subject, userName: "username1") + } + + func test_write_userData() { + testWrite(from: userDataPath, + initModel: { try? XCUserData(path: $0) }, + modify: { userData in + // XCScheme's that are already in place (the removed element) should not be removed by a write + userData.schemes = userData.schemes.filter { $0.name != "iOS-other"} + return userData + }, + assertion: { + assert(userData: $1, userName: "copy") + }) + } + + func test_read_write_produces_no_diff() throws { + try testReadWriteProducesNoDiff(from: userDataPath, + initModel: XCUserData.init(path:)) + } + + // MARK: - Private + + private func assert(userData: XCUserData, userName: String) { + XCTAssertEqual(userData.userName, userName) + XCTAssertEqual(userData.schemes.count, 3) + XCTAssertEqual(userData.breakpoints?.breakpoints.count, 2) + XCTAssertEqual(userData.schemeManagement?.schemeUserState?.count, 6) + } + + private var userDataPath: Path { + fixturesPath() + "iOS/Project.xcodeproj/xcuserdata/username1.xcuserdatad" + } +} diff --git a/Tests/XcodeProjTests/Project/XcodeProjTests.swift b/Tests/XcodeProjTests/Project/XcodeProjTests.swift new file mode 100644 index 000000000..3c8507d3e --- /dev/null +++ b/Tests/XcodeProjTests/Project/XcodeProjTests.swift @@ -0,0 +1,60 @@ +import Foundation +import PathKit +import XCTest +@testable import XcodeProj + +final class XcodeProjIntegrationTests: XCTestCase { + func test_read_iosXcodeProj() throws { + let subject = try XcodeProj(path: iosProjectPath) + assert(project: subject) + } + + func test_write_iosXcodeProj() { + testWrite(from: iosProjectPath, + initModel: { try? XcodeProj(path: $0) }, + modify: { project in + // XCUserData that is already in place (the removed element) should not be removed by a write + _ = project.userData.removeLast() + return project + }, + assertion: { assert(project: $1) }) + } + + func test_read_write_produces_no_diff() throws { + try testReadWriteProducesNoDiff(from: iosProjectPath, + initModel: XcodeProj.init(path:)) + } + + // MARK: - Private + + private func assert(project: XcodeProj) { + // Workspace + XCTAssertEqual(project.workspace.data.children.count, 1) + + // Project + XCTAssertEqual(project.pbxproj.objects.buildFiles.count, 13) + + // Shared Data + XCTAssertNotNil(project.sharedData) + XCTAssertEqual(project.sharedData?.schemes.count, 1) + XCTAssertNotNil(project.sharedData?.breakpoints) + XCTAssertNil(project.sharedData?.workspaceSettings) + + // User Data + XCTAssertEqual(project.userData.count, 3) + + XCTAssertEqual(project.userData[0].userName, "username1") + XCTAssertEqual(project.userData[0].schemes.count, 3) + XCTAssertEqual(project.userData[0].breakpoints?.breakpoints.count, 2) + XCTAssertNotNil(project.userData[0].schemeManagement) + + XCTAssertEqual(project.userData[1].userName, "username2") + XCTAssertEqual(project.userData[1].schemes.count, 1) + XCTAssertNil(project.userData[1].breakpoints?.breakpoints) + XCTAssertNil(project.userData[1].schemeManagement) + } + + private var iosProjectPath: Path { + fixturesPath() + "iOS/Project.xcodeproj" + } +} diff --git a/Tests/XcodeProjTests/Scheme/XCSchemeManagementTests.swift b/Tests/XcodeProjTests/Scheme/XCSchemeManagementTests.swift index 5b42b50de..06c93307c 100644 --- a/Tests/XcodeProjTests/Scheme/XCSchemeManagementTests.swift +++ b/Tests/XcodeProjTests/Scheme/XCSchemeManagementTests.swift @@ -7,7 +7,7 @@ import PathKit final class XCSchemeManagementTests: XCTestCase { func test_init_from_path() throws { // Given - let path = fixturesPath() + "Schemes/xcschememanagement.plist" + let path = xcschememanagementPath // When let got = try XCSchemeManagement.init(path: path) @@ -28,7 +28,12 @@ final class XCSchemeManagementTests: XCTestCase { XCTAssertNil(xcodeprojScheme.isShown) XCTAssertEqual(xcodeprojScheme.orderHint, 1) } - + + func test_read_write_produces_no_diff() throws { + try testReadWriteProducesNoDiff(from: xcschememanagementPath, + initModel: XCSchemeManagement.init(path:)) + } + func test_write_produces_no_diff() throws { let tmpDir = try Path.uniqueTemporary() defer { @@ -40,7 +45,7 @@ final class XCSchemeManagementTests: XCTestCase { let plistPath = tmpDir + "xcschememanagement.plist" let subject = XCSchemeManagement(schemeUserState: [.init(name: "Test.xcscheme", shared: true, orderHint: 0, isShown: true)], suppressBuildableAutocreation: ["E525238B16245A900012E2BA": .init(primary: true)]) - try subject.write(path: plistPath) + try subject.write(path: plistPath, override: true) // Create a commit try checkedOutput("git", ["init"]) @@ -48,10 +53,14 @@ final class XCSchemeManagementTests: XCTestCase { try checkedOutput("git", ["commit", "-m", "test"]) // Write again - try subject.write(path: plistPath) + try subject.write(path: plistPath, override: true) let got = try checkedOutput("git", ["status"]) XCTAssertTrue(got?.contains("nothing to commit") ?? false) } } + + private var xcschememanagementPath: Path { + fixturesPath() + "Schemes/xcschememanagement.plist" + } } diff --git a/Tests/XcodeProjTests/Scheme/XCSchemeTests.swift b/Tests/XcodeProjTests/Scheme/XCSchemeTests.swift index 86680b14e..3d1f16112 100644 --- a/Tests/XcodeProjTests/Scheme/XCSchemeTests.swift +++ b/Tests/XcodeProjTests/Scheme/XCSchemeTests.swift @@ -16,6 +16,11 @@ final class XCSchemeIntegrationTests: XCTestCase { assertion: { assert(scheme: $1) }) } + func test_read_write_produces_no_diff() throws { + try testReadWriteProducesNoDiff(from: iosSchemePath, + initModel: XCScheme.init(path:)) + } + func test_read_runnableWithoutBuildableReferenceScheme() { let subject = try? XCScheme(path: runnableWithoutBuildableReferenceSchemePath) diff --git a/Tests/XcodeProjTests/Tests/testWrite.swift b/Tests/XcodeProjTests/Tests/testWrite.swift index 47bb10142..01e8ebfc3 100644 --- a/Tests/XcodeProjTests/Tests/testWrite.swift +++ b/Tests/XcodeProjTests/Tests/testWrite.swift @@ -37,3 +37,33 @@ func testWrite(file: StaticString = #file, } try? copyPath.delete() } + +func testReadWriteProducesNoDiff(file: StaticString = #file, + line: UInt = #line, + from path: Path, + initModel: (Path) throws -> T) throws { + let tmpDir = try Path.uniqueTemporary() + defer { + try? tmpDir.delete() + } + + let fileName = path.lastComponent + let tmpPath = tmpDir + fileName + try path.copy(tmpPath) + + try tmpDir.chdir { + // Create a commit + try checkedOutput("git", ["init"]) + try checkedOutput("git", ["add", "."]) + try checkedOutput("git", [ + "-c", "user.email=test@example.com", "-c", "user.name=Test User", + "commit", "-m", "test" + ]) + + let object = try initModel(tmpPath) + try object.write(path: tmpPath, override: true) + + let diff = try XCTUnwrap(try checkedOutput("git", ["diff"])) + XCTAssertEqual(diff, "") + } +} From 8acb7fa0ccfc42fee60afb2b413411a4cba84b50 Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Sat, 18 Feb 2023 11:03:46 +0100 Subject: [PATCH 242/678] docs: add technocidal as a contributor for code (#735) * docs: update README.md [skip ci] * docs: update .all-contributorsrc [skip ci] --------- Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com> Co-authored-by: Kas --- .all-contributorsrc | 9 +++++++++ README.md | 1 + 2 files changed, 10 insertions(+) diff --git a/.all-contributorsrc b/.all-contributorsrc index 152b10d00..009cfbbf7 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -238,6 +238,15 @@ "contributions": [ "code" ] + }, + { + "login": "technocidal", + "name": "Johannes Ebeling", + "avatar_url": "https://avatars.githubusercontent.com/u/14994778?v=4", + "profile": "https://technocidal.com", + "contributions": [ + "code" + ] } ], "contributorsPerLine": 7, diff --git a/README.md b/README.md index ef35173c7..79b65ccc0 100644 --- a/README.md +++ b/README.md @@ -187,6 +187,7 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d C-凡
C-凡

💻 Maxwell Elliott
Maxwell Elliott

💻 Brentley Jones
Brentley Jones

💻 + Johannes Ebeling
Johannes Ebeling

💻 Teameh
Teameh

💻 From fae27b48bc14ff3fd9b02902e48c4665ce5a0793 Mon Sep 17 00:00:00 2001 From: Daniele Formichelli Date: Sat, 18 Feb 2023 13:50:08 +0100 Subject: [PATCH 243/678] Version 8.9.0 --- CHANGELOG.md | 11 +++++++++-- README.md | 2 +- xcodeproj.podspec | 2 +- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f7591ba6c..3b93fdb13 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,8 +1,15 @@ 🚀 Check out the guidelines [here](https://tuist.io/docs/contribution/changelog-guidelines/) -## Next +## 8.9.0 -- Add XCUserData [#739](https://github.com/tuist/XcodeProj/pull/739) by [@teameh](https://github.com/teameh) +### Added + +- Update watchOS application default settings for Xcode 14 [#711](https://github.com/tuist/XcodeProj/pull/711) by [@kwridan](https://github.com/kwridan) +- Implement `Hashable` for `XCScheme.BuildableReference` [#712](https://github.com/tuist/XcodeProj/pull/712) by [@cgrindel](https://github.com/cgrindel) +- Sets customWorkingDirectory for schemes [#720](https://github.com/tuist/XcodeProj/pull/720) by [@maxwellE](https://github.com/maxwellE) +- Add `XCScheme.ExecutionAction.shellToInvoke` [#721](https://github.com/tuist/XcodeProj/pull/721) by [@CrazyFanFan](https://github.com/CrazyFanFan) +- Add `platformFilters` attribute to `PBXBuildFile` and `PBXTargetDependency` [#737](https://github.com/tuist/XcodeProj/pull/737) by [@maxwellE](https://github.com/maxwellE) +- Add suppot for `XCUserData` [#739](https://github.com/tuist/XcodeProj/pull/739) by [@teameh](https://github.com/teameh) ## 8.8.0 diff --git a/README.md b/README.md index 79b65ccc0..5cbfac3ae 100644 --- a/README.md +++ b/README.md @@ -50,7 +50,7 @@ Add the dependency in your `Package.swift` file: let package = Package( name: "myproject", dependencies: [ - .package(url: "https://github.com/tuist/XcodeProj.git", .upToNextMajor(from: "8.8.0")), + .package(url: "https://github.com/tuist/XcodeProj.git", .upToNextMajor(from: "8.9.0")), ], targets: [ .target( diff --git a/xcodeproj.podspec b/xcodeproj.podspec index 405c05e22..e4b808233 100644 --- a/xcodeproj.podspec +++ b/xcodeproj.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = 'xcodeproj' - s.version = '8.8.0' + s.version = '8.9.0' s.summary = 'Read/Modify/Write your Xcode projects' s.homepage = 'https://github.com/tuist/xcodeproj' s.license = 'MIT' From b81dbc4a553e54037c3d77ef97c0ca189aeb3e7f Mon Sep 17 00:00:00 2001 From: Daniele Formichelli Date: Sat, 18 Feb 2023 13:55:06 +0100 Subject: [PATCH 244/678] fix RELEASE step --- RELEASE.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RELEASE.md b/RELEASE.md index 352089c77..f8b829879 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -6,7 +6,7 @@ In this document you'll find all the necessary steps to release a new version of 2. Determine the next version based on the unreleased changes. 3. Add the version section to the `CHANGELOG.md`, update the versions in the `README.md` and the `xcodeproj.podspec` file. 4. Commit the changes and tag them `git commit -m "Version x.y.z"` & `git tag x.y.z`. -5. Push the changes `git commit push origin main --tags` +5. Push the changes `git push origin main --tags` 6. Update Carthage dependencies by running `bundle exec rake carthage_update_dependencies`. 7. Generate the project by running `tuist generate`. 8. Run the release checks by running `bundle exec rake release_check`. From 0008426de59474fe642236083eb75b4a64abb7c8 Mon Sep 17 00:00:00 2001 From: Daniele Formichelli Date: Sat, 18 Feb 2023 14:21:31 +0100 Subject: [PATCH 245/678] fix release steps --- .ruby-version | 2 +- RELEASE.md | 2 +- Tests/XcodeProjTests/Project/XCUserDataTests.swift | 3 +-- .../Scheme/XCSchemeManagementTests.swift | 3 +-- XcodeProj_Carthage.xcodeproj/project.pbxproj | 14 ++++++++++++-- 5 files changed, 16 insertions(+), 8 deletions(-) diff --git a/.ruby-version b/.ruby-version index 57cf282eb..1f7da99d4 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -2.6.5 +2.7.7 diff --git a/RELEASE.md b/RELEASE.md index f8b829879..9e9c4e925 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -12,4 +12,4 @@ In this document you'll find all the necessary steps to release a new version of 8. Run the release checks by running `bundle exec rake release_check`. 9. Publish a new version of the Pod by running `bundle exec pod trunk push --allow-warnings --verbose`. 10. Archive the Carthage binary by running `bundle exec rake archive_carthage`. -11. Create the release on GitHub including the release notes from the `CHANGELOG.md` and attach the archive `XcodeProj.framework.zip` generated by Carthage. +11. Create the release on GitHub including the release notes from the `CHANGELOG.md` and attach the archive `xcodeproj.framework.zip` generated by Carthage. diff --git a/Tests/XcodeProjTests/Project/XCUserDataTests.swift b/Tests/XcodeProjTests/Project/XCUserDataTests.swift index 36fb1ff36..0f3b76d01 100644 --- a/Tests/XcodeProjTests/Project/XCUserDataTests.swift +++ b/Tests/XcodeProjTests/Project/XCUserDataTests.swift @@ -23,8 +23,7 @@ final class XCUserDataTests: XCTestCase { } func test_read_write_produces_no_diff() throws { - try testReadWriteProducesNoDiff(from: userDataPath, - initModel: XCUserData.init(path:)) + try testReadWriteProducesNoDiff(from: userDataPath, initModel: XCUserData.init(path:)) } // MARK: - Private diff --git a/Tests/XcodeProjTests/Scheme/XCSchemeManagementTests.swift b/Tests/XcodeProjTests/Scheme/XCSchemeManagementTests.swift index 06c93307c..161609409 100644 --- a/Tests/XcodeProjTests/Scheme/XCSchemeManagementTests.swift +++ b/Tests/XcodeProjTests/Scheme/XCSchemeManagementTests.swift @@ -30,8 +30,7 @@ final class XCSchemeManagementTests: XCTestCase { } func test_read_write_produces_no_diff() throws { - try testReadWriteProducesNoDiff(from: xcschememanagementPath, - initModel: XCSchemeManagement.init(path:)) + try testReadWriteProducesNoDiff(from: xcschememanagementPath, initModel: XCSchemeManagement.init(path:)) } func test_write_produces_no_diff() throws { diff --git a/XcodeProj_Carthage.xcodeproj/project.pbxproj b/XcodeProj_Carthage.xcodeproj/project.pbxproj index 1d1804141..d63d3eac4 100644 --- a/XcodeProj_Carthage.xcodeproj/project.pbxproj +++ b/XcodeProj_Carthage.xcodeproj/project.pbxproj @@ -25,6 +25,7 @@ 33C049021FCA541192F40AD1 /* XCWorkspaceDataFileRef.swift in Sources */ = {isa = PBXBuildFile; fileRef = B92DC66EE80F3D7611319ACC /* XCWorkspaceDataFileRef.swift */; }; 364C132E6ABF980BF9E84649 /* XCScheme+ProfileAction.swift in Sources */ = {isa = PBXBuildFile; fileRef = B2E17A977543393ED7B848A9 /* XCScheme+ProfileAction.swift */; }; 3A59F800668B0D6F550B9C09 /* PBXGroup.swift in Sources */ = {isa = PBXBuildFile; fileRef = 249AAF8AE1978D1546C0ADB5 /* PBXGroup.swift */; }; + 3AF2A0A0965EB5EC74923244 /* XCDebugger.swift in Sources */ = {isa = PBXBuildFile; fileRef = 26A96BC0C027BB173BC23C8D /* XCDebugger.swift */; }; 3D5DBC9A4315D97D1B39CF19 /* PBXProjEncoder.swift in Sources */ = {isa = PBXBuildFile; fileRef = 41A031713D5F31DDCC2D61EF /* PBXProjEncoder.swift */; }; 3E2EE77196F6B2BECE8DF3DB /* BuildSettingsProvider.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1977C44246CCF9C13AB856C2 /* BuildSettingsProvider.swift */; }; 468F48B3D19F3D1611181A2E /* XCSchemeManagement.swift in Sources */ = {isa = PBXBuildFile; fileRef = 69BA327A9CAF3CCFF60AD469 /* XCSchemeManagement.swift */; }; @@ -61,6 +62,7 @@ 84C672F79741BBA0937580EA /* Sourcery.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3A33AF969BDFF0250420A5E8 /* Sourcery.swift */; }; 8EE72814658F0A23A01AD1E6 /* XCBreakpointList.swift in Sources */ = {isa = PBXBuildFile; fileRef = CC0BF3D061052148207584A5 /* XCBreakpointList.swift */; }; 903A9EC1B895A4920A322898 /* XCScheme+ArchiveAction.swift in Sources */ = {isa = PBXBuildFile; fileRef = 66F7E3085922F586144F562A /* XCScheme+ArchiveAction.swift */; }; + 9D3FF6643048C116F1881471 /* XCUserData.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5D25A0190B14740F9DDDB98B /* XCUserData.swift */; }; 9D897705DD334A50C4431887 /* PBXBuildRule.swift in Sources */ = {isa = PBXBuildFile; fileRef = B50CD65FDAA9B3F4269F4AAF /* PBXBuildRule.swift */; }; 9DBF777FEB60396E520D2595 /* KeyedDecodingContainer+Additions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1ABCF05523B52C542BC48C31 /* KeyedDecodingContainer+Additions.swift */; }; 9F27802B144AFC7C1A739492 /* PBXObjects.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5CC513CEDABAA9712FB4DC6 /* PBXObjects.swift */; }; @@ -137,6 +139,7 @@ 20B1225FED6E1D49EE385AA0 /* XCScheme+EnvironmentVariable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "XCScheme+EnvironmentVariable.swift"; sourceTree = ""; }; 2370B4E19828CEFC032511A1 /* PBXContainerItemProxy.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PBXContainerItemProxy.swift; sourceTree = ""; }; 249AAF8AE1978D1546C0ADB5 /* PBXGroup.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PBXGroup.swift; sourceTree = ""; }; + 26A96BC0C027BB173BC23C8D /* XCDebugger.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = XCDebugger.swift; sourceTree = ""; }; 26EF076F4983A1ABBD3CC81B /* XCScheme+PathRunnable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "XCScheme+PathRunnable.swift"; sourceTree = ""; }; 2B928006AD1C96D4D8072BD9 /* XCConfig.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = XCConfig.swift; sourceTree = ""; }; 2BD1A6E5AC6502EDE59541C8 /* PBXNativeTarget.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PBXNativeTarget.swift; sourceTree = ""; }; @@ -165,6 +168,7 @@ 59F2F50C66ADD5D0C12F3B70 /* XCWorkspaceData.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = XCWorkspaceData.swift; sourceTree = ""; }; 5A4A785AD26E7657312118B9 /* Writable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Writable.swift; sourceTree = ""; }; 5D13E332186D46FFA83BBD50 /* XCScheme.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = XCScheme.swift; sourceTree = ""; }; + 5D25A0190B14740F9DDDB98B /* XCUserData.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = XCUserData.swift; sourceTree = ""; }; 6023B10EB151C2FF48E53395 /* Array+Extras.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Array+Extras.swift"; sourceTree = ""; }; 60E927F019715C98BA849930 /* PBXBuildPhase.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PBXBuildPhase.swift; sourceTree = ""; }; 66F7E3085922F586144F562A /* XCScheme+ArchiveAction.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "XCScheme+ArchiveAction.swift"; sourceTree = ""; }; @@ -454,9 +458,11 @@ children = ( 3353E37D0FBA49BA04C82476 /* WorkspaceSettings.swift */, CC0BF3D061052148207584A5 /* XCBreakpointList.swift */, + 26A96BC0C027BB173BC23C8D /* XCDebugger.swift */, A7DAFF5CC89FBB59D02F72B9 /* Xcode.swift */, F8B667CA83B0BB0285F470F1 /* XcodeProj.swift */, AF73D1E4C0B20C16D61865F6 /* XCSharedData.swift */, + 5D25A0190B14740F9DDDB98B /* XCUserData.swift */, ); path = Project; sourceTree = ""; @@ -640,7 +646,9 @@ D5DB78ED46F818640BC41A9D /* PBXTargetDependency.swift in Sources */, ED4BFA372B68053D67F0E379 /* WorkspaceSettings.swift in Sources */, 8EE72814658F0A23A01AD1E6 /* XCBreakpointList.swift in Sources */, + 3AF2A0A0965EB5EC74923244 /* XCDebugger.swift in Sources */, BEBC1583A85423F1F1BF3E30 /* XCSharedData.swift in Sources */, + 9D3FF6643048C116F1881471 /* XCUserData.swift in Sources */, CE58E51C93B8A19FA4F79E22 /* Xcode.swift in Sources */, E82A4CE0E0E385A2DED27887 /* XcodeProj.swift in Sources */, C333BEA47F06D2357DE8B1EA /* Writable.swift in Sources */, @@ -716,7 +724,7 @@ SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; SWIFT_COMPILATION_MODE = singlefile; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 5.6.1; + SWIFT_VERSION = 5.0; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; }; @@ -757,6 +765,7 @@ CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; COPY_PHASE_STRIP = NO; + DEAD_CODE_STRIPPING = YES; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; ENABLE_NS_ASSERTIONS = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; @@ -809,6 +818,7 @@ CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; COPY_PHASE_STRIP = NO; + DEAD_CODE_STRIPPING = YES; DEBUG_INFORMATION_FORMAT = dwarf; ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_TESTABILITY = YES; @@ -860,7 +870,7 @@ SKIP_INSTALL = YES; SWIFT_COMPILATION_MODE = wholemodule; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; - SWIFT_VERSION = 5.6.1; + SWIFT_VERSION = 5.0; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; }; From 1c8daed114934a46236409843717ecd415cf511e Mon Sep 17 00:00:00 2001 From: Dayton Bobbitt <12210193+dayton-bobbitt@users.noreply.github.com> Date: Mon, 6 Mar 2023 09:50:12 -0600 Subject: [PATCH 246/678] Update XCSharedData Writable conformance to include WorkspaceSettings (#743) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Resolves https://github.com/tuist/XcodeProj/issues/738 ### Short description 📝 - Update `XCSharedData` `Writable` conformance so that `WorkspaceSettings` are written. ### Solution 📦 - There was already a pattern defined for writing `XCSharedData` properties (`schemes` and `breakpoints`), and so I followed the same pattern to write the `workspaceSettings` property. --- .../XcodeProj/Project/WorkspaceSettings.swift | 6 ++++++ Sources/XcodeProj/Project/XCSharedData.swift | 15 +++++++++++++++ .../Project/XcodeProjTests.swift | 19 +++++++++++++++++++ 3 files changed, 40 insertions(+) diff --git a/Sources/XcodeProj/Project/WorkspaceSettings.swift b/Sources/XcodeProj/Project/WorkspaceSettings.swift index 4cf306b57..c8f775735 100644 --- a/Sources/XcodeProj/Project/WorkspaceSettings.swift +++ b/Sources/XcodeProj/Project/WorkspaceSettings.swift @@ -153,3 +153,9 @@ public class WorkspaceSettings: Codable, Equatable, Writable { try path.write(data) } } + +extension WorkspaceSettings { + static func path(_ path: Path) -> Path { + path + "WorkspaceSettings.xcsettings" + } +} diff --git a/Sources/XcodeProj/Project/XCSharedData.swift b/Sources/XcodeProj/Project/XCSharedData.swift index ffc8ee4e7..9469970c9 100644 --- a/Sources/XcodeProj/Project/XCSharedData.swift +++ b/Sources/XcodeProj/Project/XCSharedData.swift @@ -63,6 +63,7 @@ public final class XCSharedData: Equatable, Writable { public func write(path: Path, override: Bool) throws { try writeSchemes(path: path, override: override) try writeBreakpoints(path: path, override: override) + try writeWorkspaceSettings(path: path, override: override) } func writeSchemes(path: Path, override: Bool) throws { @@ -91,6 +92,20 @@ public final class XCSharedData: Equatable, Writable { try debuggerPath.mkpath() try breakpoints.write(path: XCBreakpointList.path(debuggerPath), override: override) } + + func writeWorkspaceSettings(path: Path, override: Bool) throws { + /** + * We don't want to delete this path when `override` is `true` because + * that will delete everything in the folder, including schemes and breakpoints. + * Instead, just create the path if it doesn't exist and let the `write` method + * in `WorkspaceSettings` handle the override. + */ + if !path.exists { + try path.mkpath() + } + + try workspaceSettings?.write(path: WorkspaceSettings.path(path), override: override) + } } extension XCSharedData { diff --git a/Tests/XcodeProjTests/Project/XcodeProjTests.swift b/Tests/XcodeProjTests/Project/XcodeProjTests.swift index 3c8507d3e..dabb8348d 100644 --- a/Tests/XcodeProjTests/Project/XcodeProjTests.swift +++ b/Tests/XcodeProjTests/Project/XcodeProjTests.swift @@ -24,6 +24,25 @@ final class XcodeProjIntegrationTests: XCTestCase { try testReadWriteProducesNoDiff(from: iosProjectPath, initModel: XcodeProj.init(path:)) } + + func test_write_includes_workspace_settings() throws { + // Define workspace settings that should be written + let workspaceSettings = WorkspaceSettings(buildSystem: .new, derivedDataLocationStyle: .default, autoCreateSchemes: false) + + testWrite(from: iosProjectPath, + initModel: { try? XcodeProj(path: $0) }, + modify: { project in + project.sharedData?.workspaceSettings = workspaceSettings + return project + }, + assertion: { + /** + * Expect that the workspace settings read from file are equal to the + * workspace settings we expected to write. + */ + XCTAssertEqual($1.sharedData?.workspaceSettings, workspaceSettings) + }) + } // MARK: - Private From bdf32a6e025747b0094fceaefb4e29929ad9c9bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20Kov=C3=A1cs?= Date: Tue, 7 Mar 2023 00:54:28 +0900 Subject: [PATCH 247/678] docs: Add try-catch to getting started (#745) - The getting started docs were slightly out of sync with the code and didn't include the necessary `try` statements --- Documentation/getting-started.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Documentation/getting-started.md b/Documentation/getting-started.md index fd7975b54..dfb3441c5 100644 --- a/Documentation/getting-started.md +++ b/Documentation/getting-started.md @@ -57,7 +57,11 @@ import PathKit import XcodeProj let path = Path("/path/to/my/Project.xcodeproj") // Your project path -let xcodeproj = XcodeProj(path: path) +do { + let xcodeproj = try XcodeProj(path: path) +} catch { + print(error) +} ``` xcodeproj will parse and map the project structure into Swift classes that you can interact with. From 232cbaf6290f1d731335b5714792693cf92620ca Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Mon, 6 Mar 2023 15:54:59 +0000 Subject: [PATCH 248/678] docs: add AlexKobachiJP as a contributor for doc (#746) * docs: update README.md [skip ci] * docs: update .all-contributorsrc [skip ci] --------- Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com> --- .all-contributorsrc | 9 +++++++ README.md | 57 +++++++++++++++++++++++---------------------- 2 files changed, 38 insertions(+), 28 deletions(-) diff --git a/.all-contributorsrc b/.all-contributorsrc index 009cfbbf7..5a4113318 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -247,6 +247,15 @@ "contributions": [ "code" ] + }, + { + "login": "AlexKobachiJP", + "name": "Alex Kovács", + "avatar_url": "https://avatars.githubusercontent.com/u/103150233?v=4", + "profile": "https://kobachi.jp", + "contributions": [ + "doc" + ] } ], "contributorsPerLine": 7, diff --git a/README.md b/README.md index 5cbfac3ae..1abfaeed7 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # XcodeProj -[![All Contributors](https://img.shields.io/badge/all_contributors-26-orange.svg?style=flat-square)](#contributors-) +[![All Contributors](https://img.shields.io/badge/all_contributors-28-orange.svg?style=flat-square)](#contributors-) [![Swift Package Manager](https://img.shields.io/badge/swift%20package%20manager-compatible-brightgreen.svg)](https://swift.org/package-manager/) @@ -156,39 +156,40 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d - - - - - - - + + + + + + + - - - - - - - + + + + + + + - - - - - - - + + + + + + + - - - - - - + + + + + + +
Joseph Colicchio
Joseph Colicchio

🤔
deatondg
deatondg

🤔
Dan Fleming
Dan Fleming

💻
Sascha Schwabbauer
Sascha Schwabbauer

🤔
Marcin Iwanicki
Marcin Iwanicki

🚧
Adam Khazi
Adam Khazi

🚧
Elliott Williams
Elliott Williams

💻
Joseph Colicchio
Joseph Colicchio

🤔
deatondg
deatondg

🤔
Dan Fleming
Dan Fleming

💻
Sascha Schwabbauer
Sascha Schwabbauer

🤔
Marcin Iwanicki
Marcin Iwanicki

🚧
Adam Khazi
Adam Khazi

🚧
Elliott Williams
Elliott Williams

💻
Muukii
Muukii

🖋
Yuya Oka
Yuya Oka

💻
Keith Smiley
Keith Smiley

🖋
Ian Leitch
Ian Leitch

💻
Daniil Subbotin
Daniil Subbotin

💻
Florentin Bekier
Florentin Bekier

💻
Vadim Smal
Vadim Smal

🐛
Muukii
Muukii

🖋
Yuya Oka
Yuya Oka

💻
Keith Smiley
Keith Smiley

🖋
Ian Leitch
Ian Leitch

💻
Daniil Subbotin
Daniil Subbotin

💻
Florentin Bekier
Florentin Bekier

💻
Vadim Smal
Vadim Smal

🐛
freddi(Yuki Aki)
freddi(Yuki Aki)

💻
Kristopher Jackson
Kristopher Jackson

💻
Jake Prickett
Jake Prickett

💻
Jake Adams
Jake Adams

💻
matsuji
matsuji

💻
Bogdan Belogurov
Bogdan Belogurov

💻
Chuck Grindel
Chuck Grindel

💻
freddi(Yuki Aki)
freddi(Yuki Aki)

💻
Kristopher Jackson
Kristopher Jackson

💻
Jake Prickett
Jake Prickett

💻
Jake Adams
Jake Adams

💻
matsuji
matsuji

💻
Bogdan Belogurov
Bogdan Belogurov

💻
Chuck Grindel
Chuck Grindel

💻
Michael McGuire
Michael McGuire

💻
C-凡
C-凡

💻
Maxwell Elliott
Maxwell Elliott

💻
Brentley Jones
Brentley Jones

💻
Johannes Ebeling
Johannes Ebeling

💻
Teameh
Teameh

💻
Michael McGuire
Michael McGuire

💻
C-凡
C-凡

💻
Maxwell Elliott
Maxwell Elliott

💻
Brentley Jones
Brentley Jones

💻
Teameh
Teameh

💻
Johannes Ebeling
Johannes Ebeling

💻
Alex Kovács
Alex Kovács

📖
From d9d0567d9a992101b8d22c25a7ba4a5d65c93760 Mon Sep 17 00:00:00 2001 From: "depfu[bot]" <23717796+depfu[bot]@users.noreply.github.com> Date: Fri, 17 Mar 2023 08:01:26 +0000 Subject: [PATCH 249/678] Update all of rails to version 6.1.7.3 (#751) Co-authored-by: depfu[bot] <23717796+depfu[bot]@users.noreply.github.com> --- Gemfile.lock | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 0726db82b..b8d278e6e 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -3,7 +3,7 @@ GEM specs: CFPropertyList (3.0.5) rexml - activesupport (6.1.7.1) + activesupport (6.1.7.3) concurrent-ruby (~> 1.0, >= 1.0.2) i18n (>= 1.6, < 2) minitest (>= 5.1) @@ -55,7 +55,7 @@ GEM cocoapods-try (1.2.0) colored2 (3.1.2) colorize (0.8.1) - concurrent-ruby (1.1.10) + concurrent-ruby (1.2.2) escape (0.0.4) ethon (0.15.0) ffi (>= 1.15.0) @@ -78,7 +78,7 @@ GEM xcinvoke (~> 0.3.0) json (2.6.1) liferaft (0.0.6) - minitest (5.17.0) + minitest (5.18.0) molinillo (0.8.0) mustache (1.1.1) nanaimo (0.3.0) @@ -96,7 +96,7 @@ GEM sqlite3 (1.4.2) typhoeus (1.4.0) ethon (>= 0.9.0) - tzinfo (2.0.5) + tzinfo (2.0.6) concurrent-ruby (~> 1.0) xcinvoke (0.3.0) liferaft (~> 0.0.6) @@ -107,7 +107,7 @@ GEM colored2 (~> 3.1) nanaimo (~> 0.3.0) rexml (~> 3.2.4) - zeitwerk (2.6.6) + zeitwerk (2.6.7) PLATFORMS ruby From ac1e834b49693677a0f09ae8fbfc31264ba5eb81 Mon Sep 17 00:00:00 2001 From: baegteun Date: Fri, 17 Mar 2023 17:06:31 +0900 Subject: [PATCH 250/678] docs :: Build Settings Provider (#747) - Add missing cases from doc comments - Fix typos --- Sources/XcodeProj/Utils/BuildSettingsProvider.swift | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Sources/XcodeProj/Utils/BuildSettingsProvider.swift b/Sources/XcodeProj/Utils/BuildSettingsProvider.swift index f9040c5ee..376466853 100644 --- a/Sources/XcodeProj/Utils/BuildSettingsProvider.swift +++ b/Sources/XcodeProj/Utils/BuildSettingsProvider.swift @@ -29,8 +29,10 @@ public class BuildSettingsProvider { /// - dynamicLibrary: dynamic library. /// - application: application. /// - bundle: bundle. - /// - appExtension: application extension - /// - watchExtension: watch extension + /// - appExtension: application extension. + /// - watchExtension: watch extension. + /// - unitTests: unit tests. + /// - uiTests: ui tests. public enum Product { case framework, staticLibrary, dynamicLibrary, application, bundle, appExtension, watchExtension, unitTests, uiTests } @@ -79,6 +81,7 @@ public class BuildSettingsProvider { /// Returns default build settings that Xcode sets in new projects. /// + /// - Parameters variant: build settings variant. /// - Returns: build settings. public static func projectDefault(variant: Variant) -> BuildSettings { switch variant { From 6f7d7c3d7566f41e720dad90783a3fded3d9b0a3 Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Fri, 17 Mar 2023 10:47:52 -0400 Subject: [PATCH 251/678] docs: add baekteun as a contributor for doc (#749) * docs: update README.md [skip ci] * docs: update .all-contributorsrc [skip ci] --------- Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com> Co-authored-by: Luis Padron --- .all-contributorsrc | 9 +++++++++ README.md | 1 + 2 files changed, 10 insertions(+) diff --git a/.all-contributorsrc b/.all-contributorsrc index 5a4113318..d8a1a4e14 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -248,6 +248,15 @@ "code" ] }, + { + "login": "baekteun", + "name": "baegteun", + "avatar_url": "https://avatars.githubusercontent.com/u/74440939?v=4", + "profile": "https://baegteun.com", + "contributions": [ + "doc" + ] + }, { "login": "AlexKobachiJP", "name": "Alex Kovács", diff --git a/README.md b/README.md index 1abfaeed7..7b40e9b53 100644 --- a/README.md +++ b/README.md @@ -189,6 +189,7 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d Brentley Jones
Brentley Jones

💻 Teameh
Teameh

💻 Johannes Ebeling
Johannes Ebeling

💻 + baegteun
baegteun

📖 Alex Kovács
Alex Kovács

📖 From 049a452f6152449303a08483ef824c7a7ebed7bf Mon Sep 17 00:00:00 2001 From: JP Simard Date: Tue, 18 Apr 2023 11:40:19 -0400 Subject: [PATCH 252/678] Fix typos in `Writable.swift` (#755) --- Sources/XcodeProj/Protocols/Writable.swift | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Sources/XcodeProj/Protocols/Writable.swift b/Sources/XcodeProj/Protocols/Writable.swift index e6faa6a2a..b41ecfcda 100644 --- a/Sources/XcodeProj/Protocols/Writable.swift +++ b/Sources/XcodeProj/Protocols/Writable.swift @@ -1,19 +1,19 @@ import Foundation import PathKit -/// Protocol that defines how an entity can be writed into disk +/// Protocol that defines how an entity can be written to disk public protocol Writable { /// Writes the object that conforms the protocol. /// /// - Parameter path: The path to write to - /// - Parameter override: True if the content should be overriden if it already exists. + /// - Parameter override: True if the content should be overridden if it already exists. /// - Throws: writing error if something goes wrong. func write(path: Path, override: Bool) throws /// Writes the object that conforms the protocol. /// /// - Parameter pathString: The path string to write to - /// - Parameter override: True if the content should be overriden if it already exists. + /// - Parameter override: True if the content should be overridden if it already exists. /// - Throws: writing error if something goes wrong. func write(pathString: String, override: Bool) throws } From ceb372103fda55671a8b48d1fe57998bb14d53cf Mon Sep 17 00:00:00 2001 From: Kas Date: Mon, 24 Apr 2023 08:05:20 +0100 Subject: [PATCH 253/678] Fix unstable reads for `XCSchemeManagement` (#758) Resolves: https://github.com/tuist/XcodeProj/issues/756 - Reading the same `xcschememanagement.plist` file was resulting in different `XCSchemeManagement` objects - This was due to the internal conversion of the `schemeUserState` from a dictionary to an array without sorting the dictionary key - This lead to having differently ordered `XCSchemeManagement` arrays each time the plist was read - Wrties were stable (going from `XCSchemeManagement` > `plist`) is most likely why this wasn't previously noticed - To address this, they dictionary elements are sorted by key name - Read stability tests have also been added and fixture updated to include more entries to aid with testing Note: it's unclear why the `schemeUserState` is stored as an array, it's a candidate to be changed to dictionary in the next major release as it would be a breaking change to do so now without any compatibility accessors to maintain the same public API. Test Plan: - Verify unit tests pass - Verify writing an `xcschememanagement.plist` file remains unchanged by these changes --- Fixtures/Schemes/xcschememanagement.plist | 23 +++++++- .../XcodeProj/Scheme/XCSchemeManagement.swift | 4 +- .../Scheme/XCSchemeManagementTests.swift | 52 +++++++++++++------ 3 files changed, 60 insertions(+), 19 deletions(-) diff --git a/Fixtures/Schemes/xcschememanagement.plist b/Fixtures/Schemes/xcschememanagement.plist index 44373b956..fa9e03037 100644 --- a/Fixtures/Schemes/xcschememanagement.plist +++ b/Fixtures/Schemes/xcschememanagement.plist @@ -4,17 +4,36 @@ SchemeUserState + App.xcscheme + + isShown + + orderHint + 0 + + Test 0.xcscheme + + orderHint + 3 + + Test 1.xcscheme + + isShown + + orderHint + 4 + Tuist.xcscheme_^#shared#^_ isShown orderHint - 0 + 1 XcodeProj.xcscheme orderHint - 1 + 2 SuppressBuildableAutocreation diff --git a/Sources/XcodeProj/Scheme/XCSchemeManagement.swift b/Sources/XcodeProj/Scheme/XCSchemeManagement.swift index 61bbe5c6b..09cc01d8a 100644 --- a/Sources/XcodeProj/Scheme/XCSchemeManagement.swift +++ b/Sources/XcodeProj/Scheme/XCSchemeManagement.swift @@ -150,7 +150,9 @@ public struct XCSchemeManagement: Codable, Equatable, Writable { let container = try decoder.container(keyedBy: CodingKeys.self) self.suppressBuildableAutocreation = try container.decodeIfPresent(.suppressBuildableAutocreation) if let schemeUserStateDictionary = try container.decodeIfPresent([String: Any].self, forKey: .schemeUserState) { - self.schemeUserState = try schemeUserStateDictionary.compactMap({ (key, value) -> XCSchemeManagement.UserStateScheme? in + self.schemeUserState = try schemeUserStateDictionary + .sorted(by: { $0.key < $1.key }) + .compactMap({ (key, value) -> XCSchemeManagement.UserStateScheme? in var name = key guard var valueDictionary = value as? [String: Any] else { return nil } if key.contains("_^#shared#^_") { diff --git a/Tests/XcodeProjTests/Scheme/XCSchemeManagementTests.swift b/Tests/XcodeProjTests/Scheme/XCSchemeManagementTests.swift index 161609409..f94252f48 100644 --- a/Tests/XcodeProjTests/Scheme/XCSchemeManagementTests.swift +++ b/Tests/XcodeProjTests/Scheme/XCSchemeManagementTests.swift @@ -13,26 +13,37 @@ final class XCSchemeManagementTests: XCTestCase { let got = try XCSchemeManagement.init(path: path) // Then - let autocreationTarget = try XCTUnwrap(got.suppressBuildableAutocreation?["E525238B16245A900012E2BA"]) - XCTAssertEqual(autocreationTarget.primary, true) - - let tuistScheme = try XCTUnwrap(got.schemeUserState?.first(where: {$0.name == "Tuist.xcscheme"})) - XCTAssertEqual(tuistScheme.name, "Tuist.xcscheme") - XCTAssertTrue(tuistScheme.shared) - XCTAssertEqual(tuistScheme.isShown, true) - XCTAssertEqual(tuistScheme.orderHint, 0) - - let xcodeprojScheme = try XCTUnwrap(got.schemeUserState?.first(where: {$0.name == "XcodeProj.xcscheme"})) - XCTAssertEqual(xcodeprojScheme.name, "XcodeProj.xcscheme") - XCTAssertFalse(xcodeprojScheme.shared) - XCTAssertNil(xcodeprojScheme.isShown) - XCTAssertEqual(xcodeprojScheme.orderHint, 1) + XCTAssertEqual(got.suppressBuildableAutocreation, [ + "E525238B16245A900012E2BA": .init(primary: true), + ]) + + XCTAssertEqual(got.schemeUserState, [ + .init(name: "App.xcscheme", shared: false, orderHint: 0, isShown: false), + .init(name: "Test 0.xcscheme", shared: false, orderHint: 3, isShown: nil), + .init(name: "Test 1.xcscheme", shared: false, orderHint: 4, isShown: false), + .init(name: "Tuist.xcscheme", shared: true, orderHint: 1, isShown: true), + .init(name: "XcodeProj.xcscheme", shared: false, orderHint: 2, isShown: nil), + ]) } func test_read_write_produces_no_diff() throws { try testReadWriteProducesNoDiff(from: xcschememanagementPath, initModel: XCSchemeManagement.init(path:)) } + func test_read_is_stable() throws { + // Given + let path = xcschememanagementPath + + // When + let reads = try (0..<10).map { _ in + try XCSchemeManagement(path: path) + } + + // Then + let unstableReads = reads.dropFirst().filter { $0 != reads.first } + XCTAssertTrue(unstableReads.isEmpty) + } + func test_write_produces_no_diff() throws { let tmpDir = try Path.uniqueTemporary() defer { @@ -42,8 +53,17 @@ final class XCSchemeManagementTests: XCTestCase { try tmpDir.chdir { // Write let plistPath = tmpDir + "xcschememanagement.plist" - let subject = XCSchemeManagement(schemeUserState: [.init(name: "Test.xcscheme", shared: true, orderHint: 0, isShown: true)], - suppressBuildableAutocreation: ["E525238B16245A900012E2BA": .init(primary: true)]) + let subject = XCSchemeManagement( + schemeUserState: [ + .init(name: "Test 0.xcscheme", shared: true, orderHint: 0, isShown: true), + .init(name: "Test 1.xcscheme", shared: true, orderHint: 1, isShown: true), + .init(name: "Test 2.xcscheme", shared: true, orderHint: 2, isShown: false), + .init(name: "Test 3.xcscheme", shared: true, orderHint: 3, isShown: true), + ], + suppressBuildableAutocreation: [ + "E525238B16245A900012E2BA": .init(primary: true), + ] + ) try subject.write(path: plistPath, override: true) // Create a commit From 5fdac93cb4a7fd4bad5ac2da34e5bc878263043f Mon Sep 17 00:00:00 2001 From: Kassem Wridan Date: Mon, 24 Apr 2023 13:37:45 +0100 Subject: [PATCH 254/678] Version 8.10.0 --- CHANGELOG.md | 6 ++++++ xcodeproj.podspec | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3b93fdb13..06ee49464 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ 🚀 Check out the guidelines [here](https://tuist.io/docs/contribution/changelog-guidelines/) +## 8.10.0 + +### Fixed + +- Fix unstable reads for `XCSchemeManagement` [#758](https://github.com/tuist/XcodeProj/pull/758) by [@kwridan](https://github.com/kwridan) + ## 8.9.0 ### Added diff --git a/xcodeproj.podspec b/xcodeproj.podspec index e4b808233..05a1954cc 100644 --- a/xcodeproj.podspec +++ b/xcodeproj.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = 'xcodeproj' - s.version = '8.9.0' + s.version = '8.10.0' s.summary = 'Read/Modify/Write your Xcode projects' s.homepage = 'https://github.com/tuist/xcodeproj' s.license = 'MIT' From f570155209af12643309ac4e758b875c63dcbf50 Mon Sep 17 00:00:00 2001 From: Kassem Wridan Date: Mon, 24 Apr 2023 14:06:46 +0100 Subject: [PATCH 255/678] Update changelog for 8.10.0 --- CHANGELOG.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 06ee49464..3c280c588 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,9 +2,19 @@ ## 8.10.0 +### Added + +- Add try-catch to getting started documentation [#745](https://github.com/tuist/XcodeProj/pull/745) by [@AlexKobachiJP](https://github.com/AlexKobachiJP) +- Add missing Build Settings Provider documentation [#747](https://github.com/tuist/XcodeProj/pull/747) by [@baekteun](https://github.com/baekteun) + ### Fixed - Fix unstable reads for `XCSchemeManagement` [#758](https://github.com/tuist/XcodeProj/pull/758) by [@kwridan](https://github.com/kwridan) +- Fix typos in `Writable.swift` [#755](https://github.com/tuist/XcodeProj/pull/755) by [@jpsim](https://github.com/jpsim) + +### Changed + +- Update `XCSharedData` Writable conformance to include `WorkspaceSettings` [#743](https://github.com/tuist/XcodeProj/pull/743) by [@dayton-bobbitt](https://github.com/dayton-bobbitt) ## 8.9.0 From 0d2bbe546f58ba0df56b1fe07cd9b8107128a739 Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Mon, 26 Jun 2023 13:17:03 +0200 Subject: [PATCH 256/678] docs: add zenangst as a contributor for code (#762) * docs: update README.md [skip ci] * docs: update .all-contributorsrc [skip ci] --------- Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com> --- .all-contributorsrc | 12 +++++++++++- README.md | 5 ++++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/.all-contributorsrc b/.all-contributorsrc index d8a1a4e14..1ddf076e4 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -265,6 +265,15 @@ "contributions": [ "doc" ] + }, + { + "login": "zenangst", + "name": "Christoffer Winterkvist", + "avatar_url": "https://avatars.githubusercontent.com/u/57446?v=4", + "profile": "http://zenangst.com", + "contributions": [ + "code" + ] } ], "contributorsPerLine": 7, @@ -273,5 +282,6 @@ "repoType": "github", "repoHost": "https://github.com", "skipCi": true, - "commitConvention": "angular" + "commitConvention": "angular", + "commitType": "docs" } diff --git a/README.md b/README.md index 7b40e9b53..a0c3a82ae 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # XcodeProj -[![All Contributors](https://img.shields.io/badge/all_contributors-28-orange.svg?style=flat-square)](#contributors-) +[![All Contributors](https://img.shields.io/badge/all_contributors-30-orange.svg?style=flat-square)](#contributors-) [![Swift Package Manager](https://img.shields.io/badge/swift%20package%20manager-compatible-brightgreen.svg)](https://swift.org/package-manager/) @@ -190,7 +190,10 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d Teameh
Teameh

💻 Johannes Ebeling
Johannes Ebeling

💻 baegteun
baegteun

📖 + + Alex Kovács
Alex Kovács

📖 + Christoffer Winterkvist
Christoffer Winterkvist

💻 From 6097424f34555413962395e82b2eb0f718bf2ce3 Mon Sep 17 00:00:00 2001 From: Christoffer Winterkvist Date: Mon, 26 Jun 2023 13:21:25 +0200 Subject: [PATCH 257/678] Add support for Xcode Runtime issue breakpoints (#761) * Add support for Xcode Runtime issue breakpoints - Adds new `BreakpointExtensionID` case to support runtime issue breakpoints - Expands the `XCBreakpointListTests` to include looking for the runtime exception - Update the breakpoints fixture to include a runtime issue breakpoint * Fix casing that caused a compiler error: `.runTimeException` => `.runtimeException` * Fix fixture spacing - Ensure fixture is identical to the way XcodeProj serialises it - This allows diff tests to verify the write process is sable * Improve naming to fit better with Apple's own vocabulary --------- Co-authored-by: Kas --- .../xcdebugger/Breakpoints_v2.xcbkptlist | 18 ++++++++++++++++++ .../XcodeProj/Project/XCBreakpointList.swift | 1 + .../Project/XCBreakpointListTests.swift | 11 +++++++++++ 3 files changed, 30 insertions(+) diff --git a/Fixtures/iOS/Project.xcodeproj/xcshareddata/xcdebugger/Breakpoints_v2.xcbkptlist b/Fixtures/iOS/Project.xcodeproj/xcshareddata/xcdebugger/Breakpoints_v2.xcbkptlist index 931805c0a..80fbab8a7 100644 --- a/Fixtures/iOS/Project.xcodeproj/xcshareddata/xcdebugger/Breakpoints_v2.xcbkptlist +++ b/Fixtures/iOS/Project.xcodeproj/xcshareddata/xcdebugger/Breakpoints_v2.xcbkptlist @@ -124,5 +124,23 @@ + + + + + + + + + + + + diff --git a/Sources/XcodeProj/Project/XCBreakpointList.swift b/Sources/XcodeProj/Project/XCBreakpointList.swift index 60b5b8ff7..1b7d8e6c6 100644 --- a/Sources/XcodeProj/Project/XCBreakpointList.swift +++ b/Sources/XcodeProj/Project/XCBreakpointList.swift @@ -316,6 +316,7 @@ public final class XCBreakpointList: Equatable, Writable { case symbolic = "Xcode.Breakpoint.SymbolicBreakpoint" case ideConstraintError = "Xcode.Breakpoint.IDEConstraintErrorBreakpoint" case ideTestFailure = "Xcode.Breakpoint.IDETestFailureBreakpoint" + case runtimeIssue = "Xcode.Breakpoint.RuntimeIssueBreakpoint" } // MARK: - Attributes diff --git a/Tests/XcodeProjTests/Project/XCBreakpointListTests.swift b/Tests/XcodeProjTests/Project/XCBreakpointListTests.swift index afe9f930d..44783730a 100644 --- a/Tests/XcodeProjTests/Project/XCBreakpointListTests.swift +++ b/Tests/XcodeProjTests/Project/XCBreakpointListTests.swift @@ -104,6 +104,17 @@ final class XCBreakpointListIntegrationTests: XCTestCase { let ideTestFailureAppleScriptAction = ideTestFailureContent.actions[0] XCTAssertEqual(ideTestFailureAppleScriptAction.actionExtensionID, .appleScript) XCTAssertNotNil(ideTestFailureAppleScriptAction.actionContent) + + // Runtime exception failure + let runtimeIssue = breakpointList.breakpoints[6] + XCTAssertEqual(runtimeIssue.breakpointExtensionID, .runtimeIssue) + let runtimeIssueContent = runtimeIssue.breakpointContent + XCTAssertEqual(runtimeIssueContent.enabled, true) + XCTAssertEqual(runtimeIssueContent.ignoreCount, "0") + XCTAssertEqual(runtimeIssueContent.continueAfterRunningActions, false) + let runtimeExceptionAppleScriptAction = runtimeIssueContent.actions[0] + XCTAssertEqual(runtimeExceptionAppleScriptAction.actionExtensionID, .appleScript) + XCTAssertNotNil(runtimeExceptionAppleScriptAction.actionContent) } private func fixturePath() -> Path { From 6d65656d1323abed49d0e886a454e4122da45c99 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 26 Jun 2023 13:21:46 +0200 Subject: [PATCH 258/678] Add renovate.json (#764) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- renovate.json | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 renovate.json diff --git a/renovate.json b/renovate.json new file mode 100644 index 000000000..39a2b6e9a --- /dev/null +++ b/renovate.json @@ -0,0 +1,6 @@ +{ + "$schema": "https://docs.renovatebot.com/renovate-schema.json", + "extends": [ + "config:base" + ] +} From bd5f74ba623908127988e352205349e05632e238 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20Pi=C3=B1era=20Buend=C3=ADa?= <663605+pepicrft@users.noreply.github.com> Date: Mon, 26 Jun 2023 13:22:30 +0200 Subject: [PATCH 259/678] Configure renovate.json to auto-merge updates --- renovate.json | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/renovate.json b/renovate.json index 39a2b6e9a..7066eafd7 100644 --- a/renovate.json +++ b/renovate.json @@ -2,5 +2,12 @@ "$schema": "https://docs.renovatebot.com/renovate-schema.json", "extends": [ "config:base" + ], + "packageRules": [ + { + "matchUpdateTypes": ["minor", "patch", "pin", "digest"], + "automerge": true, + "automergeType": "pr" + } ] } From 038b8cf77c58549595b847a80b4cb5e10a091335 Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Mon, 26 Jun 2023 17:12:55 +0200 Subject: [PATCH 260/678] docs: add timothycosta as a contributor for code (#770) * docs: update README.md [skip ci] * docs: update .all-contributorsrc [skip ci] --------- Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com> --- .all-contributorsrc | 9 +++++++++ README.md | 3 ++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/.all-contributorsrc b/.all-contributorsrc index 1ddf076e4..56815151f 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -274,6 +274,15 @@ "contributions": [ "code" ] + }, + { + "login": "timothycosta", + "name": "Timothy Costa", + "avatar_url": "https://avatars.githubusercontent.com/u/948806?v=4", + "profile": "http://www.timothycosta.com", + "contributions": [ + "code" + ] } ], "contributorsPerLine": 7, diff --git a/README.md b/README.md index a0c3a82ae..d45468987 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # XcodeProj -[![All Contributors](https://img.shields.io/badge/all_contributors-30-orange.svg?style=flat-square)](#contributors-) +[![All Contributors](https://img.shields.io/badge/all_contributors-31-orange.svg?style=flat-square)](#contributors-) [![Swift Package Manager](https://img.shields.io/badge/swift%20package%20manager-compatible-brightgreen.svg)](https://swift.org/package-manager/) @@ -194,6 +194,7 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d Alex Kovács
Alex Kovács

📖 Christoffer Winterkvist
Christoffer Winterkvist

💻 + Timothy Costa
Timothy Costa

💻 From 0ab0f58ece7fee64b88a09983c040e51407827fa Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 26 Jun 2023 17:13:08 +0200 Subject: [PATCH 261/678] chore(deps): update dependency jazzy to v0.14.3 (#766) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- Gemfile.lock | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index b8d278e6e..e6e5e88c5 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ GEM remote: https://rubygems.org/ specs: - CFPropertyList (3.0.5) + CFPropertyList (3.0.6) rexml activesupport (6.1.7.3) concurrent-ruby (~> 1.0, >= 1.0.2) @@ -9,8 +9,8 @@ GEM minitest (>= 5.1) tzinfo (~> 2.0) zeitwerk (~> 2.3) - addressable (2.8.0) - public_suffix (>= 2.0.2, < 5.0) + addressable (2.8.4) + public_suffix (>= 2.0.2, < 6.0) algoliasearch (1.27.5) httpclient (~> 2.8, >= 2.8.3) json (>= 1.5.1) @@ -66,7 +66,7 @@ GEM httpclient (2.8.3) i18n (1.12.0) concurrent-ruby (~> 1.0) - jazzy (0.14.2) + jazzy (0.14.3) cocoapods (~> 1.5) mustache (~> 1.1) open4 (~> 1.3) @@ -76,16 +76,16 @@ GEM sassc (~> 2.1) sqlite3 (~> 1.3) xcinvoke (~> 0.3.0) - json (2.6.1) + json (2.6.3) liferaft (0.0.6) - minitest (5.18.0) + minitest (5.18.1) molinillo (0.8.0) mustache (1.1.1) nanaimo (0.3.0) nap (1.1.0) netrc (0.11.0) open4 (1.3.4) - public_suffix (4.0.6) + public_suffix (4.0.7) rake (13.0.6) redcarpet (3.5.1) rexml (3.2.5) @@ -93,7 +93,7 @@ GEM ruby-macho (2.5.1) sassc (2.4.0) ffi (~> 1.9) - sqlite3 (1.4.2) + sqlite3 (1.4.4) typhoeus (1.4.0) ethon (>= 0.9.0) tzinfo (2.0.6) @@ -107,7 +107,7 @@ GEM colored2 (~> 3.1) nanaimo (~> 0.3.0) rexml (~> 3.2.4) - zeitwerk (2.6.7) + zeitwerk (2.6.8) PLATFORMS ruby From 96679598697f23d51736b42a6217fbfd8f97b44b Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 26 Jun 2023 17:29:21 +0200 Subject: [PATCH 262/678] chore(deps): update dependency cocoapods to v1.12.1 (#772) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- Gemfile | 2 +- Gemfile.lock | 22 +++++++++++----------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/Gemfile b/Gemfile index 3f25545c3..4300aed5e 100644 --- a/Gemfile +++ b/Gemfile @@ -2,6 +2,6 @@ source "https://rubygems.org" gem "rake" gem "jazzy" -gem "cocoapods", "1.11.0" +gem "cocoapods", "1.12.1" gem "colorize", "~> 0.8.1" gem "redcarpet", "~> 3.5.1" diff --git a/Gemfile.lock b/Gemfile.lock index e6e5e88c5..6b4f1c9e1 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -16,15 +16,15 @@ GEM json (>= 1.5.1) atomos (0.1.3) claide (1.1.0) - cocoapods (1.11.0) + cocoapods (1.12.1) addressable (~> 2.8) claide (>= 1.0.2, < 2.0) - cocoapods-core (= 1.11.0) + cocoapods-core (= 1.12.1) cocoapods-deintegrate (>= 1.0.3, < 2.0) - cocoapods-downloader (>= 1.4.0, < 2.0) + cocoapods-downloader (>= 1.6.0, < 2.0) cocoapods-plugins (>= 1.0.0, < 2.0) cocoapods-search (>= 1.0.0, < 2.0) - cocoapods-trunk (>= 1.4.0, < 2.0) + cocoapods-trunk (>= 1.6.0, < 2.0) cocoapods-try (>= 1.1.0, < 2.0) colored2 (~> 3.1) escape (~> 0.0.4) @@ -32,10 +32,10 @@ GEM gh_inspector (~> 1.0) molinillo (~> 0.8.0) nap (~> 1.0) - ruby-macho (>= 1.0, < 3.0) + ruby-macho (>= 2.3.0, < 3.0) xcodeproj (>= 1.21.0, < 2.0) - cocoapods-core (1.11.0) - activesupport (>= 5.0, < 7) + cocoapods-core (1.12.1) + activesupport (>= 5.0, < 8) addressable (~> 2.8) algoliasearch (~> 1.0) concurrent-ruby (~> 1.1) @@ -57,14 +57,14 @@ GEM colorize (0.8.1) concurrent-ruby (1.2.2) escape (0.0.4) - ethon (0.15.0) + ethon (0.16.0) ffi (>= 1.15.0) ffi (1.15.5) fourflusher (2.3.1) fuzzy_match (2.0.4) gh_inspector (1.1.3) httpclient (2.8.3) - i18n (1.12.0) + i18n (1.14.1) concurrent-ruby (~> 1.0) jazzy (0.14.3) cocoapods (~> 1.5) @@ -100,7 +100,7 @@ GEM concurrent-ruby (~> 1.0) xcinvoke (0.3.0) liferaft (~> 0.0.6) - xcodeproj (1.21.0) + xcodeproj (1.22.0) CFPropertyList (>= 2.3.3, < 4.0) atomos (~> 0.1.3) claide (>= 1.0.2, < 2.0) @@ -113,7 +113,7 @@ PLATFORMS ruby DEPENDENCIES - cocoapods (= 1.11.0) + cocoapods (= 1.12.1) colorize (~> 0.8.1) jazzy rake From cab5929dc35790615f059c5d5536a475d8fe02f7 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 26 Jun 2023 17:30:05 +0200 Subject: [PATCH 263/678] chore(deps): update dependency kylef/pathkit to from: "1.0.1" (#767) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- Package.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Package.swift b/Package.swift index e31baf94b..6af0ff9cd 100644 --- a/Package.swift +++ b/Package.swift @@ -9,7 +9,7 @@ let package = Package( ], dependencies: [ .package(url: "https://github.com/tadija/AEXML.git", .upToNextMinor(from: "4.6.1")), - .package(url: "https://github.com/kylef/PathKit.git", .upToNextMinor(from: "1.0.0")), + .package(url: "https://github.com/kylef/PathKit.git", .upToNextMinor(from: "1.0.1")), ], targets: [ .target(name: "XcodeProj", From 4938776dbf66db4cc99612c6a25f37138af1413e Mon Sep 17 00:00:00 2001 From: Mary Date: Mon, 26 Jun 2023 11:33:07 -0400 Subject: [PATCH 264/678] BuildSettingsProvider: add support for xros (#765) --- Sources/XcodeProj/Utils/BuildSettingsProvider.swift | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Sources/XcodeProj/Utils/BuildSettingsProvider.swift b/Sources/XcodeProj/Utils/BuildSettingsProvider.swift index 376466853..8f22c6781 100644 --- a/Sources/XcodeProj/Utils/BuildSettingsProvider.swift +++ b/Sources/XcodeProj/Utils/BuildSettingsProvider.swift @@ -19,7 +19,7 @@ public class BuildSettingsProvider { /// - tvOS: tvOS. /// - watchOS: watchOS. public enum Platform { - case iOS, macOS, tvOS, watchOS + case iOS, macOS, tvOS, watchOS, visionOS } /// Target product type. @@ -189,6 +189,11 @@ public class BuildSettingsProvider { "SDKROOT": "watchos", "TARGETED_DEVICE_FAMILY": "4", ] + case .visionOS: + return [ + "SDKROOT": "xros", + "TARGETED_DEVICE_FAMILY": "1,2,7", + ] } } From 5187ec552e688eb3c0ebd024e6a18ef935dd0c45 Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Mon, 26 Jun 2023 17:34:10 +0200 Subject: [PATCH 265/678] docs: add Mstrodl as a contributor for code (#773) * docs: update README.md [skip ci] * docs: update .all-contributorsrc [skip ci] --------- Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com> --- .all-contributorsrc | 9 +++++++++ README.md | 3 ++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/.all-contributorsrc b/.all-contributorsrc index 56815151f..52b9e73f7 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -283,6 +283,15 @@ "contributions": [ "code" ] + }, + { + "login": "Mstrodl", + "name": "Mary ", + "avatar_url": "https://avatars.githubusercontent.com/u/6877780?v=4", + "profile": "https://coolmathgames.tech", + "contributions": [ + "code" + ] } ], "contributorsPerLine": 7, diff --git a/README.md b/README.md index d45468987..a3b90b631 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # XcodeProj -[![All Contributors](https://img.shields.io/badge/all_contributors-31-orange.svg?style=flat-square)](#contributors-) +[![All Contributors](https://img.shields.io/badge/all_contributors-32-orange.svg?style=flat-square)](#contributors-) [![Swift Package Manager](https://img.shields.io/badge/swift%20package%20manager-compatible-brightgreen.svg)](https://swift.org/package-manager/) @@ -195,6 +195,7 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d Alex Kovács
Alex Kovács

📖 Christoffer Winterkvist
Christoffer Winterkvist

💻 Timothy Costa
Timothy Costa

💻 + Mary
Mary

💻 From 520a907ed41d3b4e0139af5f413952f0bf0e9ad8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20Pi=C3=B1era=20Buend=C3=ADa?= <663605+pepicrft@users.noreply.github.com> Date: Mon, 26 Jun 2023 17:49:48 +0200 Subject: [PATCH 266/678] Consider UUID when sorting (#769) * Ensure filename sort considers UUIDs correctly * Consider edge cases in filename sorting * Updated comments and renamed sort methods for clarity. * Added tests for sorting with matching filenames * Updated PBXProjEncoderTests for new files * Revert changes in the Fixture * Add new fixture * Fix tests * Include fixtures' xcuserdata * Add some tests * Add a test for duplicated file references in the same group * Fix tests * Update Xcode versions list and add beta --------- Co-authored-by: Timothy Costa --- .github/workflows/xcodeproj.yml | 2 +- .gitignore | 1 + .../project.pbxproj | 462 ++++++++++++++++++ .../contents.xcworkspacedata | 7 + .../xcshareddata/IDEWorkspaceChecks.plist | 8 + .../xcschemes/xcschememanagement.plist | 14 + .../FileSharedAcrossTargets.h | 7 + .../FileSharedAcrossTargets/SharedHeader.h | 5 + .../FileSharedAcrossTargetsTests.swift | 29 ++ .../UserInterfaceState.xcuserstate | Bin 0 -> 14766 bytes .../contents.xcworkspacedata | 7 + .../xcshareddata/IDEWorkspaceChecks.plist | 8 + Fixtures/iOS/SameName/SameName.h | 19 + .../Objects/Project/PBXOutputSettings.swift | 33 +- .../Project/PBXOutputSettingsTests.swift | 292 +++++++---- .../Objects/Project/PBXProjEncoderTests.swift | 122 ++++- Tests/XcodeProjTests/Tests/Fixtures.swift | 5 + 17 files changed, 879 insertions(+), 142 deletions(-) create mode 100644 Fixtures/FileSharedAcrossTargets/FileSharedAcrossTargets.xcodeproj/project.pbxproj create mode 100644 Fixtures/FileSharedAcrossTargets/FileSharedAcrossTargets.xcodeproj/project.xcworkspace/contents.xcworkspacedata create mode 100644 Fixtures/FileSharedAcrossTargets/FileSharedAcrossTargets.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist create mode 100644 Fixtures/FileSharedAcrossTargets/FileSharedAcrossTargets.xcodeproj/xcuserdata/pepicrft.xcuserdatad/xcschemes/xcschememanagement.plist create mode 100644 Fixtures/FileSharedAcrossTargets/FileSharedAcrossTargets/FileSharedAcrossTargets.h create mode 100644 Fixtures/FileSharedAcrossTargets/FileSharedAcrossTargets/SharedHeader.h create mode 100644 Fixtures/FileSharedAcrossTargets/FileSharedAcrossTargetsTests/FileSharedAcrossTargetsTests.swift create mode 100644 Fixtures/iOS/Project.xcodeproj/project.xcworkspace/xcuserdata/pepicrft.xcuserdatad/UserInterfaceState.xcuserstate create mode 100644 Fixtures/iOS/ProjectWithoutProductsGroup.xcodeproj/project.xcworkspace/contents.xcworkspacedata create mode 100644 Fixtures/iOS/ProjectWithoutProductsGroup.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist create mode 100644 Fixtures/iOS/SameName/SameName.h diff --git a/.github/workflows/xcodeproj.yml b/.github/workflows/xcodeproj.yml index 5e61b10b9..c7f54a5fe 100644 --- a/.github/workflows/xcodeproj.yml +++ b/.github/workflows/xcodeproj.yml @@ -13,7 +13,7 @@ jobs: runs-on: macos-11 strategy: matrix: - xcode: ["12.4", "12.5", "13.0"] + xcode: ["12.5.1", "13.4.1", "14.3.1", "beta"] steps: - uses: actions/checkout@v1 - name: Select Xcode ${{ matrix.xcode }} diff --git a/.gitignore b/.gitignore index 3c11c1db0..0dac9e3e9 100644 --- a/.gitignore +++ b/.gitignore @@ -185,3 +185,4 @@ XcodeProj.xcodeproj tmp/ XcodeProj.framework.zip +!Fixtures/**/xcuserdata/ diff --git a/Fixtures/FileSharedAcrossTargets/FileSharedAcrossTargets.xcodeproj/project.pbxproj b/Fixtures/FileSharedAcrossTargets/FileSharedAcrossTargets.xcodeproj/project.pbxproj new file mode 100644 index 000000000..e5059b59e --- /dev/null +++ b/Fixtures/FileSharedAcrossTargets/FileSharedAcrossTargets.xcodeproj/project.pbxproj @@ -0,0 +1,462 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 56; + objects = { + +/* Begin PBXBuildFile section */ + 6C103C032A49CC5400D7EFE4 /* FileSharedAcrossTargets.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6C103BFA2A49CC5300D7EFE4 /* FileSharedAcrossTargets.framework */; }; + 6C103C082A49CC5400D7EFE4 /* FileSharedAcrossTargetsTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6C103C072A49CC5400D7EFE4 /* FileSharedAcrossTargetsTests.swift */; }; + 6C103C092A49CC5400D7EFE4 /* FileSharedAcrossTargets.h in Headers */ = {isa = PBXBuildFile; fileRef = 6C103BFD2A49CC5300D7EFE4 /* FileSharedAcrossTargets.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 6C103C132A49CC7300D7EFE4 /* SharedHeader.h in Headers */ = {isa = PBXBuildFile; fileRef = 6C103C122A49CC7300D7EFE4 /* SharedHeader.h */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 6C103C042A49CC5400D7EFE4 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 6C103BF12A49CC5300D7EFE4 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 6C103BF92A49CC5300D7EFE4; + remoteInfo = FileSharedAcrossTargets; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + 6C103BFA2A49CC5300D7EFE4 /* FileSharedAcrossTargets.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = FileSharedAcrossTargets.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 6C103BFD2A49CC5300D7EFE4 /* FileSharedAcrossTargets.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FileSharedAcrossTargets.h; sourceTree = ""; }; + 6C103C022A49CC5400D7EFE4 /* FileSharedAcrossTargetsTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = FileSharedAcrossTargetsTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + 6C103C072A49CC5400D7EFE4 /* FileSharedAcrossTargetsTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FileSharedAcrossTargetsTests.swift; sourceTree = ""; }; + 6C103C122A49CC7300D7EFE4 /* SharedHeader.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SharedHeader.h; sourceTree = ""; }; + 6CB965012A49DC1F009186C6 /* FileSharedAcrossTargetsTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FileSharedAcrossTargetsTests.swift; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 6C103BF72A49CC5300D7EFE4 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 6C103BFF2A49CC5400D7EFE4 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 6C103C032A49CC5400D7EFE4 /* FileSharedAcrossTargets.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 6C103BF02A49CC5300D7EFE4 = { + isa = PBXGroup; + children = ( + 6C103BFC2A49CC5300D7EFE4 /* FileSharedAcrossTargets */, + 6C103C062A49CC5400D7EFE4 /* FileSharedAcrossTargetsTests */, + 6C103BFB2A49CC5300D7EFE4 /* Products */, + ); + sourceTree = ""; + }; + 6C103BFB2A49CC5300D7EFE4 /* Products */ = { + isa = PBXGroup; + children = ( + 6C103BFA2A49CC5300D7EFE4 /* FileSharedAcrossTargets.framework */, + 6C103C022A49CC5400D7EFE4 /* FileSharedAcrossTargetsTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 6C103BFC2A49CC5300D7EFE4 /* FileSharedAcrossTargets */ = { + isa = PBXGroup; + children = ( + 6C103BFD2A49CC5300D7EFE4 /* FileSharedAcrossTargets.h */, + 6C103C122A49CC7300D7EFE4 /* SharedHeader.h */, + ); + path = FileSharedAcrossTargets; + sourceTree = ""; + }; + 6C103C062A49CC5400D7EFE4 /* FileSharedAcrossTargetsTests */ = { + isa = PBXGroup; + children = ( + 6CB965012A49DC1F009186C6 /* FileSharedAcrossTargetsTests.swift */, + 6C103C072A49CC5400D7EFE4 /* FileSharedAcrossTargetsTests.swift */, + ); + path = FileSharedAcrossTargetsTests; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXHeadersBuildPhase section */ + 6C103BF52A49CC5300D7EFE4 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + 6C103C132A49CC7300D7EFE4 /* SharedHeader.h in Headers */, + 6C103C092A49CC5400D7EFE4 /* FileSharedAcrossTargets.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXHeadersBuildPhase section */ + +/* Begin PBXNativeTarget section */ + 6C103BF92A49CC5300D7EFE4 /* FileSharedAcrossTargets */ = { + isa = PBXNativeTarget; + buildConfigurationList = 6C103C0C2A49CC5400D7EFE4 /* Build configuration list for PBXNativeTarget "FileSharedAcrossTargets" */; + buildPhases = ( + 6C103BF52A49CC5300D7EFE4 /* Headers */, + 6C103BF62A49CC5300D7EFE4 /* Sources */, + 6C103BF72A49CC5300D7EFE4 /* Frameworks */, + 6C103BF82A49CC5300D7EFE4 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = FileSharedAcrossTargets; + productName = FileSharedAcrossTargets; + productReference = 6C103BFA2A49CC5300D7EFE4 /* FileSharedAcrossTargets.framework */; + productType = "com.apple.product-type.framework"; + }; + 6C103C012A49CC5400D7EFE4 /* FileSharedAcrossTargetsTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 6C103C0F2A49CC5400D7EFE4 /* Build configuration list for PBXNativeTarget "FileSharedAcrossTargetsTests" */; + buildPhases = ( + 6C103BFE2A49CC5400D7EFE4 /* Sources */, + 6C103BFF2A49CC5400D7EFE4 /* Frameworks */, + 6C103C002A49CC5400D7EFE4 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 6C103C052A49CC5400D7EFE4 /* PBXTargetDependency */, + ); + name = FileSharedAcrossTargetsTests; + productName = FileSharedAcrossTargetsTests; + productReference = 6C103C022A49CC5400D7EFE4 /* FileSharedAcrossTargetsTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 6C103BF12A49CC5300D7EFE4 /* Project object */ = { + isa = PBXProject; + attributes = { + BuildIndependentTargetsInParallel = 1; + LastSwiftUpdateCheck = 1430; + LastUpgradeCheck = 1430; + TargetAttributes = { + 6C103BF92A49CC5300D7EFE4 = { + CreatedOnToolsVersion = 14.3.1; + }; + 6C103C012A49CC5400D7EFE4 = { + CreatedOnToolsVersion = 14.3.1; + }; + }; + }; + buildConfigurationList = 6C103BF42A49CC5300D7EFE4 /* Build configuration list for PBXProject "FileSharedAcrossTargets" */; + compatibilityVersion = "Xcode 14.0"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 6C103BF02A49CC5300D7EFE4; + productRefGroup = 6C103BFB2A49CC5300D7EFE4 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 6C103BF92A49CC5300D7EFE4 /* FileSharedAcrossTargets */, + 6C103C012A49CC5400D7EFE4 /* FileSharedAcrossTargetsTests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 6C103BF82A49CC5300D7EFE4 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 6C103C002A49CC5400D7EFE4 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 6C103BF62A49CC5300D7EFE4 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 6C103BFE2A49CC5400D7EFE4 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 6C103C082A49CC5400D7EFE4 /* FileSharedAcrossTargetsTests.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 6C103C052A49CC5400D7EFE4 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 6C103BF92A49CC5300D7EFE4 /* FileSharedAcrossTargets */; + targetProxy = 6C103C042A49CC5400D7EFE4 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin XCBuildConfiguration section */ + 6C103C0A2A49CC5400D7EFE4 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + CURRENT_PROJECT_VERSION = 1; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + MACOSX_DEPLOYMENT_TARGET = 13.3; + MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; + MTL_FAST_MATH = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = macosx; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Debug; + }; + 6C103C0B2A49CC5400D7EFE4 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + CURRENT_PROJECT_VERSION = 1; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + MACOSX_DEPLOYMENT_TARGET = 13.3; + MTL_ENABLE_DEBUG_INFO = NO; + MTL_FAST_MATH = YES; + SDKROOT = macosx; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Release; + }; + 6C103C0D2A49CC5400D7EFE4 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + CODE_SIGN_STYLE = Automatic; + COMBINE_HIDPI_IMAGES = YES; + CURRENT_PROJECT_VERSION = 1; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + ENABLE_MODULE_VERIFIER = YES; + GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_KEY_NSHumanReadableCopyright = ""; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/../Frameworks", + "@loader_path/Frameworks", + ); + MARKETING_VERSION = 1.0; + MODULE_VERIFIER_SUPPORTED_LANGUAGES = "objective-c objective-c++"; + MODULE_VERIFIER_SUPPORTED_LANGUAGE_STANDARDS = "gnu11 gnu++20"; + PRODUCT_BUNDLE_IDENTIFIER = io.tuist.XcodeProj.FileSharedAcrossTargets; + PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; + SKIP_INSTALL = YES; + SWIFT_EMIT_LOC_STRINGS = YES; + SWIFT_VERSION = 5.0; + }; + name = Debug; + }; + 6C103C0E2A49CC5400D7EFE4 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + CODE_SIGN_STYLE = Automatic; + COMBINE_HIDPI_IMAGES = YES; + CURRENT_PROJECT_VERSION = 1; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + ENABLE_MODULE_VERIFIER = YES; + GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_KEY_NSHumanReadableCopyright = ""; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/../Frameworks", + "@loader_path/Frameworks", + ); + MARKETING_VERSION = 1.0; + MODULE_VERIFIER_SUPPORTED_LANGUAGES = "objective-c objective-c++"; + MODULE_VERIFIER_SUPPORTED_LANGUAGE_STANDARDS = "gnu11 gnu++20"; + PRODUCT_BUNDLE_IDENTIFIER = io.tuist.XcodeProj.FileSharedAcrossTargets; + PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; + SKIP_INSTALL = YES; + SWIFT_EMIT_LOC_STRINGS = YES; + SWIFT_VERSION = 5.0; + }; + name = Release; + }; + 6C103C102A49CC5400D7EFE4 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + GENERATE_INFOPLIST_FILE = YES; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = io.tuist.XcodeProj.FileSharedAcrossTargetsTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_EMIT_LOC_STRINGS = NO; + SWIFT_VERSION = 5.0; + }; + name = Debug; + }; + 6C103C112A49CC5400D7EFE4 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + GENERATE_INFOPLIST_FILE = YES; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = io.tuist.XcodeProj.FileSharedAcrossTargetsTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_EMIT_LOC_STRINGS = NO; + SWIFT_VERSION = 5.0; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 6C103BF42A49CC5300D7EFE4 /* Build configuration list for PBXProject "FileSharedAcrossTargets" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 6C103C0A2A49CC5400D7EFE4 /* Debug */, + 6C103C0B2A49CC5400D7EFE4 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 6C103C0C2A49CC5400D7EFE4 /* Build configuration list for PBXNativeTarget "FileSharedAcrossTargets" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 6C103C0D2A49CC5400D7EFE4 /* Debug */, + 6C103C0E2A49CC5400D7EFE4 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 6C103C0F2A49CC5400D7EFE4 /* Build configuration list for PBXNativeTarget "FileSharedAcrossTargetsTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 6C103C102A49CC5400D7EFE4 /* Debug */, + 6C103C112A49CC5400D7EFE4 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 6C103BF12A49CC5300D7EFE4 /* Project object */; +} diff --git a/Fixtures/FileSharedAcrossTargets/FileSharedAcrossTargets.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/Fixtures/FileSharedAcrossTargets/FileSharedAcrossTargets.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 000000000..919434a62 --- /dev/null +++ b/Fixtures/FileSharedAcrossTargets/FileSharedAcrossTargets.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/Fixtures/FileSharedAcrossTargets/FileSharedAcrossTargets.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/Fixtures/FileSharedAcrossTargets/FileSharedAcrossTargets.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 000000000..18d981003 --- /dev/null +++ b/Fixtures/FileSharedAcrossTargets/FileSharedAcrossTargets.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/Fixtures/FileSharedAcrossTargets/FileSharedAcrossTargets.xcodeproj/xcuserdata/pepicrft.xcuserdatad/xcschemes/xcschememanagement.plist b/Fixtures/FileSharedAcrossTargets/FileSharedAcrossTargets.xcodeproj/xcuserdata/pepicrft.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 000000000..891ed6fd3 --- /dev/null +++ b/Fixtures/FileSharedAcrossTargets/FileSharedAcrossTargets.xcodeproj/xcuserdata/pepicrft.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,14 @@ + + + + + SchemeUserState + + FileSharedAcrossTargets.xcscheme_^#shared#^_ + + orderHint + 0 + + + + diff --git a/Fixtures/FileSharedAcrossTargets/FileSharedAcrossTargets/FileSharedAcrossTargets.h b/Fixtures/FileSharedAcrossTargets/FileSharedAcrossTargets/FileSharedAcrossTargets.h new file mode 100644 index 000000000..ca50f46c0 --- /dev/null +++ b/Fixtures/FileSharedAcrossTargets/FileSharedAcrossTargets/FileSharedAcrossTargets.h @@ -0,0 +1,7 @@ +#import + +//! Project version number for FileSharedAcrossTargets. +FOUNDATION_EXPORT double FileSharedAcrossTargetsVersionNumber; + +//! Project version string for FileSharedAcrossTargets. +FOUNDATION_EXPORT const unsigned char FileSharedAcrossTargetsVersionString[]; diff --git a/Fixtures/FileSharedAcrossTargets/FileSharedAcrossTargets/SharedHeader.h b/Fixtures/FileSharedAcrossTargets/FileSharedAcrossTargets/SharedHeader.h new file mode 100644 index 000000000..0a277a70f --- /dev/null +++ b/Fixtures/FileSharedAcrossTargets/FileSharedAcrossTargets/SharedHeader.h @@ -0,0 +1,5 @@ +#ifndef SharedHeader_h +#define SharedHeader_h + + +#endif /* SharedHeader_h */ diff --git a/Fixtures/FileSharedAcrossTargets/FileSharedAcrossTargetsTests/FileSharedAcrossTargetsTests.swift b/Fixtures/FileSharedAcrossTargets/FileSharedAcrossTargetsTests/FileSharedAcrossTargetsTests.swift new file mode 100644 index 000000000..62976e867 --- /dev/null +++ b/Fixtures/FileSharedAcrossTargets/FileSharedAcrossTargetsTests/FileSharedAcrossTargetsTests.swift @@ -0,0 +1,29 @@ +import XCTest +@testable import FileSharedAcrossTargets + +final class FileSharedAcrossTargetsTests: XCTestCase { + + override func setUpWithError() throws { + // Put setup code here. This method is called before the invocation of each test method in the class. + } + + override func tearDownWithError() throws { + // Put teardown code here. This method is called after the invocation of each test method in the class. + } + + func testExample() throws { + // This is an example of a functional test case. + // Use XCTAssert and related functions to verify your tests produce the correct results. + // Any test you write for XCTest can be annotated as throws and async. + // Mark your test throws to produce an unexpected failure when your test encounters an uncaught error. + // Mark your test async to allow awaiting for asynchronous code to complete. Check the results with assertions afterwards. + } + + func testPerformanceExample() throws { + // This is an example of a performance test case. + self.measure { + // Put the code you want to measure the time of here. + } + } + +} diff --git a/Fixtures/iOS/Project.xcodeproj/project.xcworkspace/xcuserdata/pepicrft.xcuserdatad/UserInterfaceState.xcuserstate b/Fixtures/iOS/Project.xcodeproj/project.xcworkspace/xcuserdata/pepicrft.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 0000000000000000000000000000000000000000..b620692025bad6a4b9008e2d3146322e578a8d59 GIT binary patch literal 14766 zcmeHOcYM=T*S{le)1+-y)3l5OtRUxBZ|Yw->E7JMtd1NY#2@K(GHKa6+a$MG}xS^OM6 zf{)_&@cZ}!{2~4bAHyHxA@Rga z(usvwiH+FFD3U=k$wX2_ib)A6C1s?XOd{uzYEnaL$@#=Z8c7prCauIxyrhE!NRTWe z%Snh_OfDgplPk#8>ElZKLhfL%p>B@#)TL?Ka1 zR1$5S$rEgAJBVUY98w@9(x8Nyl{J|QxlaFV`0SPAdQ(%I%kS?-Dx_wF(QXuvv`oT! znBJ+3uP7~>>Gdu2cet9kQg2hRo$~~oN>g4|XY(c}(2s9GuQ8F^16qJgL$iyO8B#UBF7R_W#&SF?Bi`#>dl71@v-jY1hH6OCpHmdq|;t5`9+iQUX{*=_80rgJJ))j>~**Aw8D2CBIxAkFVo z4lCsrxPongvSxR{>k}TLzufDqtDfecThtVQhg{Rt%C&QFIPoj2QOfxPZjUPf&mEeJ zeVl7yhu00u2_xVsH^V~@AAhFX)9hWs?L{G^l)QmaYa0_9~6~SnK#scX)b@D&d)Uurnb0KoG8pQ4>fP_cz%O0 zsTF7{a&)07EWQg(V_K%GanGnZfT}l04D{D&O8oHssp`o&7hMf_U=~p35BS`k7B05?`{vaxj^QeE?;|ou1H-gatk)1 zm%18Z zH|T5PN?_c-84s(}!i%eFb9uy-oXP@mec^XbmCwtY*qUHRhu3%3ZiB{zk8l}U&9iP5 zGj*YVuym$7h^~awUxltl*Pu1LxHY=`+#LAyad1hX1sGyxmgZE}FL1YUV@Ho34f5~v zkM7_)+)cg(fzf_n)94m=pf%W-+2m~>9S8zW7%lA0lQ+8Dy)+Q?asJUD)}w1cRx9DZ zzCSWs#p_>-*40(kz!UC9Yy0_qJ=(}?#2e6!=q7YCx&_^eZbP@D4d@PLVOC~ib~cJ- zuuL|ZIat;f)P=f*pF7cJ(1+dV9%N(LEMNF3VCRB9%x4ooH^My)>%Rn%wV8fF%Ltln z#Mzy#-X+uB9(TK|!>LRevYWrp5--3XR}0*0@{nUHJd1h7*2aNWJbRTkSEn}^C|erf zJUpO+F~+l3Y4Um7+5~N#>0Ph@ROe7D`3H<@b9;cEp^sD)477TEu+iDwycm~z+nV8l z55=t|K3B&ySlNF-Fq%8it}e8b<*+>Q`{QWWCb$CO2iPwD|zSZNpfl9dmBUMGd8ROVEk_aAsl@SHN2 zf>rbfIzT;y_x~Q9;`jf7P3l5FvdK(0R}^cmxyt3?>iFS(M)EiGJ3sa`o6?2;VABTC zim5>BRHw4`KR|1*o&tJ7s5(F^^pcAsu?!R{j>1wL&8D+THlqj2aSV=SRcs!c&p*^r zgVdNP2Vp=EHvQAQO#&tXK^|&&m5*EO_6Gg6E?*1Ri+4(REaz0(hgjVywiO56ZOv7! zpbh=vu7bQ^4M;kUXXmlJLs*9saS~GCVR$$mfk)2jQz5f>o9z#{+B@ciMG$lwt7SE; zn$7($F_kx8pPX{+zBA0-6byi}2d82qHnBQZ&t~>uGfu}A*1%@5*-Te29;{wuj8kd& zi<1xFukJ5~IF-t&&BhYhxu5LEoMvDQr5|qvE^(9TgfhBjD^_6yrd^ON=nCM<>eM-kIBm}E-Wl| zI0_5%v-2E%VtSTHmb(2-ZGfMfd85js%Ir)S{a4pm?rsZkJ^`eL_bNMkFOx_{eu>ak zmR%kuBcrM<*y8ro`2_JnsSzwz74J+8B(NasOe*^LRN(l_ zuKd!!?8+67HHf?6qlmKxb@ehM_bfgQ$&CE+GxrUPm=`YsU5h)Iw+s7N2Y=n^A}1zu zu4cef{a4#}r@fZy5MB(=XbE15p23}X8D0)PY4||`X0PUbsuFL|69Bv~+BvpJiIr4* zT`Td0FkV=yh6{A#i%`RW@8S~;;Y+&k#mvtFGkd8K=dQx5VS_Lt=K?)=75)cm0H6j- zRfUgsCB900&f$hN_}ak@>+t%)4L9PO#D@Cij!_23%J9tF@a=;KZp2-K8#dw1eSEx& zUC4B2afdAmuXZoKZ}8*?@PmUJw&O)8$LMy8+b_LsG}TX@(APIo{sVx?fw znmBL_0t>vpcBe97U~`2ZeElXL7l83+bj)-Etmk;krxa(@luoU8`P?o(S}|ztu!uR8 zYH_3xxC?;00cd_!-{ih-k)m=}ySojXXYD|Gri0aQ6WtxfnJ%F6?3Qzz7YCY!^JSbd z`foXTb%Iw3w&0A(S^1f{_3kR(1D!2?WaW*@7GJ;#9=@s>?Ke{2;_rEI1Z`dT2X+f@ ztaxko6aGaUc&qqCe#58d_dO8-(DvZpct|S_{{#QBk-<=yN-)~hLkOWn!Zxsttc%~P z&-EhF0^YjgzvgBQ*b9#k_NpGxMASl4_kR(Z5-k~t9Cwifq9chUi3}sd$q2TI-N`ny zyV%|A9=7E!q9@6yo1_pO|1#KCb}!2h;c+mAe-yg;@b<(QP`MADpi_A+-w=+v)w&w_ z5Et(raXx3+nB2m`lB~jv+|vAGBJar#5aTc(gU(`?PV;<5XG(?j+LS1lj2d`CMS1gSbLJuq=09zgJh9x zl0$My9?56-vHRIJ_5gd3J;WZq3)x5^8B4~I@$lEVz}4;SMYfl{0)M^A+ax9IUIVUf zrE9UfMF`OdO?_XBAmRtnL>N^U;G=VH&Og)L9B371R(Sj!pdY-x{$YJH2Mpsk=$p># zQxS#olX`V2nM|euawQdH3Yp3tVUMyMJ!CqmBs17f_B?xmCshPF;Xq5@KAC+?2Rg%k zLSHY0m?rtW!49#5_p!q}){)uBv5C}^nWTZtV!PO5>~Z$QCNhW2CG*G}_9T0XJq^EM z=XeoE30Gd+$tyPjv8ediVBb!BGicvB54cYNy3QP&D6YXZ*HsMe3e&@p1t6z+HIk1*8p(6j{i2cae7X%)gui@jJ4J_y|~lVc?DNvRlPxcB;WIve9hI%+4zucOXg{9aG!k3bf9GFfq4uG627BnS5rit2kSD z;Y;|pt&BJjr%;Sxe60!2A|j5Ml@yai!~D5*xb+4Z{xwr339`01qjjbaS_g^#0Ly1sc=DOGhztBB2RZ-4r`i#th9!( zt8^gUV*R^B!2)Yx0eeQbY*Yi##774G0P{vWvi|N8QDsO1OXTEs%SI^4f&79oe|u)> z@6W)@v8pcFf$`^@`}e2)BonSBS~p{TcTq`qaj{X1vmn%6T4tQMNc?7;xN5KPSJx!i zWwNSAmR2!4%%sd#NENCeFOmrX{izVFc0vT&18KibNcOD)8@d4!eUGA@=t;C2;zzHb z{pe#z;Qb~f@1%Gnr0h(Pq$>yitQLH-^C3OA6tBkD;_LBExC@eRcSF+cWqc42*bzv% z9mA)Hgv1gxq|%Zgfi@1(X46R(B+TX#CnU-i5kFZHX~eAgcv@Ko*lF zU}egdcC?9hVn#5)2chcS+!8Sn%0Iwf9nb^IcJf~C-yH8$HacqqlS=Bd^1dbe}d*En;s`o{@xs0I|jr=_A96oGqz8|>)cP_$t+w1Qj+kcq5h zd%8#^sA*7@X@ZY)mXa3UQYJuXc$$DFjT1X23VaK%bSYWIuXGuEsf(;;FY_y<1R?4S zft&@L&&M^FfVOGz`a1h!r4^-OAd*}uAg(^a3a_|^+=?7q$+hG&f-x267|0 ziQG(XVf)x?>~*%Ey}=H!gX|D{lfA{>-b!vm8Ds;wgKQ*Sq?`1RP2^6pnH`2;=DX|& zJIdZ;pN6n5gpDC=3gNMWQ3_j}ev?)MDl{PYUsa&&oJw0U2ap{+w)PId-F~k}uoQeu zy%%|iQ$_os=+*n6O=|+3ZQSgEorc~7UKO8z_e0S53?&XK-q_)TkTvj0$no{2-kS&O zdI0O;Zq6l8D@X#&Rtagk7O-CY8F-nUKi##|-R@q-HTT*84cMk$GK9gR>cq*?IgP(J<-R} zZt@sv7}zj-MhEAq@BnP{Dfs1OdHvlG_6Wd{CyUXqAAMON<$6K`-3&Lym_puMz`|KF|1Q7QJ zqG#}$5Q5fR^r!gmpb%3`B+=v`x|-d=K4N0noV-Qe9y-L;O%C&VW2opCZ|~nFN669H z9l%`CYh}mT$4=$+|4Sn0tcb37Hy@A>=YTE>bEcbo1a~u_K^*llIW8h??L+Gx?tUKu*E$pTP6@ntj7gv#&!qf%iKGy*iaB+oHb^eg$INWO#+3l%TO`p?_ZQ z8vq=bm1Cd7pKvN59RVti1PB~#YvzG)6;vKnbBlst%t0maxpA=Ry(CjYBLN0eN+mRc zon+s#?|NtypHyMr3n>-Qi)voZi~PM?3rGtjIjn}DQ;-@GZ@B5;W+!0)9> z_5;g1Of@u~YH0#eP#sOANpu(;j;^L7sUBVjp(!BJ&Ar)_LD#?sLqI(P%;k9hhc_|3 zdEvp=2qgIVVxRsTvr{?TBlsD;0&wPd)u3K}pMk-2m>s64-wO2EE%qz>86Mav_8a`( zzH{8uj!$nOX?wz-=!n=)F3klnw@-JX@}9e`(qXF#)Q4mcBi z{?C9b?54TA$Pd{kUR*wiH!WblLvVqPg)19J$AhEL6a?ew>CJEqSdaY?!rCEkm`-)1^&fPM5YITL|()LQ*$`6=GI5 zgf-y8!gKilw5}hN%6}@YOM|?ASRBG}y?I^QIb>cpe9Mep42~!bg|M=VUJ}Bpzn8$J ztLYVdvUNYboQ(@%bvM}y+1B^@Z0i|$*6>Ex(se?1mab(JLpc7gCx|cYW_k;toHJjV zpr^a(t^89Px)UCKSZ_N;bsi>Q1BJ?jE_z1@Cw9@U5QfSa9xv6`_CX~<6^oDcPW($Z z-AwNa;b9?c=(9+43%wtzl;~D^FTF2>hllWp5FXh>w;>ySFogB2IE0fS;tZ?yqldZt zxBhUE629`lY`Uw(;|>IyxmkUuG){D%KM+;ZUG&MJwtEV7)7>GQ!iU;Y`3qCP5@F=W z<2mERxx0mh`rs7ZLtlYt34M|7r7zK!LpUvj%^{o~!j?_+Rl1M9MqdwMYY1nCupV~1!M(k;Wi?IS4zOc}L7l>M zsH}mqwpYxLOSqP8r0z;iE2nGZu{oXcC4EpdV4v#)T zzu`v%(#YrU&+xAyd0gPKZbB_2p9Cr(J%D(p)U3hWRsu}&g11MpXvLqz&No} zEOzK6LJ}c~9%8;k2J>S=cnm)uN-_Fx&Ny*}K@bRlAL1oC`RlFq3U_-zqDBgdMiS2# z6Ey=Qn4yxK8XQQ9jI#f4%Z5Kts-@8~c}y%H6H;s9wFwZ{88&>xNPV(CCB)313?v;1$S}@ow96mwzF+_2I3j z3$u8v*YCRZzi`;Ck4TZbAaqH6O+W(pUz0cw6dH+jm{8Lv9;weesVEgsHObc@9D@ga z%}XIsA&#pIwl{JO`BVpFxM#=K3b8I_R<;ic@H+;d8x zpsl*5cIIrcSQbiKi_7vHg}H^L8Dk2vp|lm!u^B}txrPpdx(a4-)dTw}-ca=38FTHdZg7Tq-ts%cdR&z(>(u?Xl* zge!y88RrpMUsqRADmqQD_28}=xCSPa;{r2s3QEU}$;mFt$S%##&v0ay6lD|_mKS7< zDbH~fPJkV?*3dTsOZ4Up^knX1n_ReHw!iNx8n_XBksnV@LfVJ{e4hP{~+ED zVZHtMC&)RCfU0*skRK!~$faZr1b=QKw~*T)zO#|s1tEdAp>q8Qc@G>dB{)F_s81gQ zn7R~d(!KOru+R6?2k1j!+K$sN=+E>w36jK0l!6XKeIdX(;`i`xNpc8}7x0H9L81eN z6fV34mDmGKiKs!W)^)+@lc3Oh6#Rb=W6=aC`>ltf)A{5m)X{%KegZEr8mi`%P&cmw zw`@4LWVryHTj@%ui4W0Bpe}wjy_{Z2uZG(A>i}om4ZtEy@ph<;-$@^%Ptg7J1pO7N z-7S)_l9`fD$(54Ll7}UaNuH2ACD|=`QSy@H70Euy>yncZmWcBr=0~_9nj#iNv_@PI z;fYuhaZ$uSBCd#77qKDYu88|19*%e-;)RGK5yv9Fi8vkcXC#i4L`FtRBUO>ZBS%Kg zj%x&*QKzH+kRs_UX`{4N+AdutT_e3tx=wn% z^hW8;(p#msOYe|&NqeL_rH@IUkUk~dEqzw{ymXIruk>Z|xm>vgc*{Wd~(PW$(#8kbN#YCHqx&TK0#W$|K}a@@Tn2u9qjv zN6AOav*fw*eEAr8nS7GGLOxY~hx}goHu;0{?ea(EJLNCPUy&b{ACbQ&|4@EReq8>o z{CoK+`A;#GF>_)XW13?Y#I(kEV;05uV}dbDVm8OT8B1ehVimEfSWT=cHZyiiY-wzH z?Bv)fvD0FEV(*RJ6}vn3+1Te}_r>eLeP#*n_ce#vYCRI4&~I5SJ4-K5jx>QCvw} zRor=T)p50P^Ws*?1r&J?U1*%fjBvplKnyOM&rCO%CQgwr>M|H32e$@l2hg6TN_NZP_y`}m)lX`PTCP^9)#_xmL7k#DsvYVqb+$TJU8F8nm#E9s)#@5`t-4-4Pkn)Up}I}& zQ7>1oP_I;9q`peMMtz-nz4`|AP3n8pTh%+&yVQ@VpHRP~ep&sBdY}4T^%3<^_512C z)nBPksJ~I4R{yEN8i^)SBh@5mhH26@<2C1MCTfZ`rJ8chWX%-KG)<+ZO2cVdG;Ym8 zO}oacS)}o6f|@0oPR(-7D$VVhM>Vf&j%j|0kBd)?&xkLJpBe9t-xB{o{GRxI@rUC- zia#FzY5eE$r{aH(|26*i_&>E+E7Qhm6cnAWOwXbZJtwd1vA+G*NKZI!lKTdQ?x zo3xy^MY~(OPy4#|4edeghuUM> zdslZ<_rC5!-7(#9-A{?KM15jbVp(EC;(|nf;f=DhZ6TB z9!~ru@$1BsiQgsukoaTbpGi20CPgGgB}FG0l5&%#C$%O8lNKi}N$N~mpVXDKDQR=k zJxN=W?n~O6^hVOxNhg!O8<{n7?8v5(7mQpt@@M^Uy+v==XXqXJY<;eNuAbBT^g;a+ z{WARu{e}8&{Z{?G`up`e^v~;$=-<s#`Q)*M{Q=BR1r!=N4Oj(+; zEM-N?g(<63Zcph>*_rZ8%Bv}_rR+~Nq*_z+Qpcv2r_M-SmU>a@mehw+A5Gnv`dI3V zsfSYENbI%ir=CjvIrZ1n)5a*{aATHnf^n*Gp|Rb#%os9W zV!X__+IWreTH{*ddgBeot;VN}`;G4yj~d@MerUp`k)|S3jcJkTGShXYZKelJ51Sq_ z?J(^!J#Ko^^t9=)>0Q%N)BC0mO~*{fO(#shnogVkNJDArwBoesY4vICX}+|})7GY4 zpLS!~&1v0fPo_Pc_H5e6X`iHhmiEuIuhPCwJDK)f+7ISfv(l_K$D0$(iRR&ElR3+r zW6m=dm`lyG%yZ37bEBCvx0)B4J?2H`fO(1eD)Soib>?;E>&-WrZ!zCy-eB%B_n7ZA zKWqLdJt93leQNrm^y|~Nryoo|nf^=q>GVG>*dnuNELw}sl4Kcf8ELUuGAs^DjwRnR z#!_c#w6s{oV&F$L&wrciW$}zhXaR|H%Hi{Y(4T z_HXS!+kdnFJ_?N@qhdyBN7+W@j2f4fn^llCF{?7Gt`~U_@l%o%#vI~j*4+OA3lx4d literal 0 HcmV?d00001 diff --git a/Fixtures/iOS/ProjectWithoutProductsGroup.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/Fixtures/iOS/ProjectWithoutProductsGroup.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 000000000..919434a62 --- /dev/null +++ b/Fixtures/iOS/ProjectWithoutProductsGroup.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/Fixtures/iOS/ProjectWithoutProductsGroup.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/Fixtures/iOS/ProjectWithoutProductsGroup.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 000000000..18d981003 --- /dev/null +++ b/Fixtures/iOS/ProjectWithoutProductsGroup.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/Fixtures/iOS/SameName/SameName.h b/Fixtures/iOS/SameName/SameName.h new file mode 100644 index 000000000..520f4062e --- /dev/null +++ b/Fixtures/iOS/SameName/SameName.h @@ -0,0 +1,19 @@ +// +// SameName.h +// SameName +// +// Created by Timothy Costa on 2022/06/10. +// Copyright © 2022 es.ppinera. All rights reserved. +// + +#import + +//! Project version number for SameName. +FOUNDATION_EXPORT double SameNameVersionNumber; + +//! Project version string for SameName. +FOUNDATION_EXPORT const unsigned char SameNameVersionString[]; + +// In this header, you should import all the public headers of your framework using statements like #import + + diff --git a/Sources/XcodeProj/Objects/Project/PBXOutputSettings.swift b/Sources/XcodeProj/Objects/Project/PBXOutputSettings.swift index 374e725a1..77bf7b7ec 100644 --- a/Sources/XcodeProj/Objects/Project/PBXOutputSettings.swift +++ b/Sources/XcodeProj/Objects/Project/PBXOutputSettings.swift @@ -5,19 +5,26 @@ import Foundation // MARK: - Core sort functions // Because of the number of optional data items in PBXBuildFiles, we've externalised the core code in these two functions. -// Note, PBXBuildFile's contains PBXFileElements so this first function is an optional handling wrapper driving the second. +// Note, the first function should be preferred as it considers more context when filenames are equal. // Also note that we use the .fileName() function to retrieve the name as both .path and .name properties can be nil. -private func sortUsingNames(_ lhs: PBXBuildFile, _ rhs: PBXBuildFile) -> Bool { - if let lhsFile = lhs.file, let rhsFile = rhs.file { - return sortUsingNames(lhsFile, rhsFile) +private func sortBuildFilesByName(_ lhs: PBXBuildFile, _ rhs: PBXBuildFile) -> Bool { + guard let lhsFile = lhs.file, let rhsFile = rhs.file else { + return lhs.uuid < rhs.uuid + } + // If the filename is the same, the PBXFileElement UUIDs may or may not match. + if let lhsFilename = lhsFile.fileName(), let rhsFilename = rhsFile.fileName(), lhsFilename != rhsFilename { + return lhsFilename < rhsFilename + } + if lhsFile.uuid != rhsFile.uuid { + return lhsFile.uuid < rhsFile.uuid } return lhs.uuid < rhs.uuid } -private func sortUsingNames(_ lhs: PBXFileElement, _ rhs: PBXFileElement) -> Bool { - if let lhsFilename = lhs.fileName(), let rhsFilename = rhs.fileName() { - return lhsFilename == rhsFilename ? lhs.uuid < rhs.uuid : lhsFilename < rhsFilename +private func sortFileElementsByName(_ lhs: PBXFileElement, _ rhs: PBXFileElement) -> Bool { + if let lhsFilename = lhs.fileName(), let rhsFilename = rhs.fileName(), lhsFilename != rhsFilename { + return lhsFilename < rhsFilename } return lhs.uuid < rhs.uuid } @@ -40,7 +47,7 @@ public enum PBXFileOrder { internal func sort(lhs: (PBXObjectReference, PBXBuildFile), rhs: (PBXObjectReference, PBXBuildFile)) -> Bool { switch self { case .byFilename: - return sortUsingNames(lhs.1, rhs.1) + return sortBuildFilesByName(lhs.1, rhs.1) default: return lhs.0 < rhs.0 } @@ -49,7 +56,7 @@ public enum PBXFileOrder { internal func sort(lhs: (PBXObjectReference, PBXBuildPhaseFile), rhs: (PBXObjectReference, PBXBuildPhaseFile)) -> Bool { switch self { case .byFilename: - return sortUsingNames(lhs.1.buildFile, rhs.1.buildFile) + return sortBuildFilesByName(lhs.1.buildFile, rhs.1.buildFile) default: return lhs.0 < rhs.0 } @@ -58,7 +65,7 @@ public enum PBXFileOrder { internal func sort(lhs: (PBXObjectReference, PBXFileReference), rhs: (PBXObjectReference, PBXFileReference)) -> Bool { switch self { case .byFilename: - return sortUsingNames(lhs.1, rhs.1) + return sortFileElementsByName(lhs.1, rhs.1) default: return lhs.0 < rhs.0 @@ -90,7 +97,7 @@ public enum PBXNavigatorFileOrder { internal var sort: ((PBXFileElement, PBXFileElement) -> Bool)? { switch self { case .byFilename: - return { sortUsingNames($0, $1) } + return { sortFileElementsByName($0, $1) } case .byFilenameGroupsFirst: return { lhs, rhs in @@ -98,7 +105,7 @@ public enum PBXNavigatorFileOrder { if lhsIsGroup != rhs.isGroup { return lhsIsGroup } - return sortUsingNames(lhs, rhs) + return sortFileElementsByName(lhs, rhs) } default: @@ -119,7 +126,7 @@ public enum PBXBuildPhaseFileOrder { switch self { case .byFilename: return { lhs, rhs in - sortUsingNames(lhs, rhs) + sortBuildFilesByName(lhs, rhs) } default: diff --git a/Tests/XcodeProjTests/Objects/Project/PBXOutputSettingsTests.swift b/Tests/XcodeProjTests/Objects/Project/PBXOutputSettingsTests.swift index 3f20341ce..33c5fc8f3 100644 --- a/Tests/XcodeProjTests/Objects/Project/PBXOutputSettingsTests.swift +++ b/Tests/XcodeProjTests/Objects/Project/PBXOutputSettingsTests.swift @@ -3,147 +3,128 @@ import XCTest @testable import XcodeProj class PBXOutputSettingsTests: XCTestCase { - var proj: PBXProj! - var buildFileAssets: PBXBuildFile! - var buildFileMain: PBXBuildFile! - - var objectBuildFileAssets: (PBXObjectReference, PBXBuildFile)! - var objectBuildFileMain: (PBXObjectReference, PBXBuildFile)! - - var objectBuildPhaseFileAssets: (PBXObjectReference, PBXBuildPhaseFile)! - var objectBuildPhaseFileMain: (PBXObjectReference, PBXBuildPhaseFile)! + // MARK: - PBXFileOrder - PBXBuldFile - var fileReferenceAssets: PBXFileReference! - var fileReferenceCoreData: PBXFileReference! + func test_PBXFileOrder_PBXBuildFile_by_uuid_when_iosProject() { + let iosProject = self.iosProject() - var objectFileReferenceAssets: (PBXObjectReference, PBXFileReference)! - var objectFileReferenceCoreData: (PBXObjectReference, PBXFileReference)! + XCTAssertFalse(PBXFileOrder.byUUID.sort(lhs: iosProject.objectBuildFileAssets, rhs: iosProject.objectBuildFileMain)) + XCTAssertTrue(PBXFileOrder.byUUID.sort(lhs: iosProject.objectBuildFileMain, rhs: iosProject.objectBuildFileAssets)) + } - var groupFrameworks: PBXGroup! - var groupProducts: PBXGroup! + func test_PBXFileOrder_PBXBuildFile_by_filename_when_iosProject() { + let iosProject = self.iosProject() - var objectGroupFrameworks: (PBXObjectReference, PBXGroup)! - var objectGroupProducts: (PBXObjectReference, PBXGroup)! + XCTAssertTrue(PBXFileOrder.byFilename.sort(lhs: iosProject.objectBuildFileAssets, rhs: iosProject.objectBuildFileMain)) + XCTAssertFalse(PBXFileOrder.byFilename.sort(lhs: iosProject.objectBuildFileMain, rhs: iosProject.objectBuildFileAssets)) + } - var navigatorFileGroup: PBXGroup! + func test_PBXFileOrder_PBXBuildFile_by_filename_when_fileSharedAcrossTargetsProject() { + let fileSharedAcrossTargetsProject = self.fileSharedAcrossTargetsProject() - override func setUp() { - let dic = iosProjectDictionary() - do { - proj = try PBXProj(jsonDictionary: dic.1) - } catch { - XCTFail("Failed to load project from file: \(error)") - } - -// proj.buildFiles.forEach { print("\(type(of: $0.file!)) \($0.file!.fileName()!)") } - buildFileAssets = proj.buildFiles.first { $0.file?.fileName() == "Assets.xcassets" }! - buildFileMain = proj.buildFiles.first { $0.file?.fileName() == "Main.storyboard" }! + let sameNameByFilename = fileSharedAcrossTargetsProject.objectBuildFileSameName.sorted(by: PBXFileOrder.byFilename.sort) + XCTAssertLessThan(sameNameByFilename.first!.1.uuid, sameNameByFilename.last!.1.uuid) + } - objectBuildFileAssets = (buildFileAssets.reference, buildFileAssets) - objectBuildFileMain = (buildFileMain.reference, buildFileMain) + func test_PBXFileOrder_PBXBuildFile_by_filename_when_nil_name_and_path_when_iosProject() { + let iosProject = self.iosProject() - objectBuildPhaseFileAssets = proj.objects.buildPhaseFile.first { $0.value.buildFile.file?.fileName() == "Assets.xcassets" }! - objectBuildPhaseFileMain = proj.objects.buildPhaseFile.first { $0.value.buildFile.file?.fileName() == "Main.storyboard" }! + iosProject.buildFileAssets.file?.name = nil + iosProject.buildFileMain.file?.name = nil + iosProject.buildFileAssets.file?.path = nil + iosProject.buildFileMain.file?.path = nil + XCTAssertFalse(PBXFileOrder.byFilename.sort(lhs: iosProject.objectBuildFileAssets, rhs: iosProject.objectBuildFileMain)) + XCTAssertTrue(PBXFileOrder.byFilename.sort(lhs: iosProject.objectBuildFileMain, rhs: iosProject.objectBuildFileAssets)) + } - fileReferenceAssets = proj.fileReferences.first { $0.fileName() == "Assets.xcassets" }! - fileReferenceCoreData = proj.fileReferences.first { $0.fileName() == "CoreData.framework" }! + func test_PBXFileOrder_PBXBuildFile_by_filename_when_no_file_when_iosProject() { + let iosProject = self.iosProject() - objectFileReferenceAssets = (buildFileAssets.reference, fileReferenceAssets) - objectFileReferenceCoreData = (buildFileMain.reference, fileReferenceCoreData) + let ref1 = iosProject.buildFileAssets.reference + let ref2 = iosProject.buildFileMain.reference + iosProject.buildFileAssets.file = nil + iosProject.buildFileMain.file = nil + XCTAssertFalse(PBXFileOrder.byFilename.sort(lhs: (ref1, iosProject.buildFileAssets), rhs: (ref2, iosProject.buildFileMain))) + XCTAssertTrue(PBXFileOrder.byFilename.sort(lhs: (ref2, iosProject.buildFileMain), rhs: (ref1, iosProject.buildFileAssets))) + } - groupFrameworks = proj.groups.first { $0.fileName() == "Frameworks" }! - groupProducts = proj.groups.first { $0.fileName() == "Products" }! + // MARK: - PBXFileOrder - PBXBuildPhaseFile - objectGroupFrameworks = (groupFrameworks.reference, groupFrameworks) - objectGroupProducts = (groupProducts.reference, groupProducts) + func test_PBXFileOrder_PBXBuildPhaseFile_by_uuid_when_iosProject() { + let iosProject = self.iosProject() - navigatorFileGroup = proj.groups.first { $0.fileName() == "iOS" }! + XCTAssertFalse(PBXFileOrder.byUUID.sort(lhs: iosProject.objectBuildPhaseFileAssets, rhs: iosProject.objectBuildPhaseFileMain)) + XCTAssertTrue(PBXFileOrder.byUUID.sort(lhs: iosProject.objectBuildPhaseFileMain, rhs: iosProject.objectBuildPhaseFileAssets)) } - // MARK: - PBXFileOrder - PBXBuldFile + func test_PBXFileOrder_PBXBuildPhaseFile_by_filename_when_iosProject() { + let iosProject = self.iosProject() - func test_PBXFileOrder_PBXBuildFile_by_uuid() { - XCTAssertFalse(PBXFileOrder.byUUID.sort(lhs: objectBuildFileAssets, rhs: objectBuildFileMain)) - XCTAssertTrue(PBXFileOrder.byUUID.sort(lhs: objectBuildFileMain, rhs: objectBuildFileAssets)) + XCTAssertTrue(PBXFileOrder.byFilename.sort(lhs: iosProject.objectBuildPhaseFileAssets, rhs: iosProject.objectBuildPhaseFileMain)) + XCTAssertFalse(PBXFileOrder.byFilename.sort(lhs: iosProject.objectBuildPhaseFileMain, rhs: iosProject.objectBuildPhaseFileAssets)) } - func test_PBXFileOrder_PBXBuildFile_by_filename() { - XCTAssertTrue(PBXFileOrder.byFilename.sort(lhs: objectBuildFileAssets, rhs: objectBuildFileMain)) - XCTAssertFalse(PBXFileOrder.byFilename.sort(lhs: objectBuildFileMain, rhs: objectBuildFileAssets)) - } + // MARK: - PBXFileOrder - PBXFileReference - func test_PBXFileOrder_PBXBuildFile_by_filename_when_nil_name_and_path() { - buildFileAssets.file?.name = nil - buildFileMain.file?.name = nil - buildFileAssets.file?.path = nil - buildFileMain.file?.path = nil - XCTAssertFalse(PBXFileOrder.byFilename.sort(lhs: objectBuildFileAssets, rhs: objectBuildFileMain)) - XCTAssertTrue(PBXFileOrder.byFilename.sort(lhs: objectBuildFileMain, rhs: objectBuildFileAssets)) - } + func test_PBXFileOrder_PBXFileReference_by_uuid_when_iosProject() { + let iosProject = self.iosProject() - func test_PBXFileOrder_PBXBuildFile_by_filename_when_no_file() { - let ref1 = buildFileAssets.reference - let ref2 = buildFileMain.reference - buildFileAssets.file = nil - buildFileMain.file = nil - XCTAssertFalse(PBXFileOrder.byFilename.sort(lhs: (ref1, buildFileAssets), rhs: (ref2, buildFileMain))) - XCTAssertTrue(PBXFileOrder.byFilename.sort(lhs: (ref2, buildFileMain), rhs: (ref1, buildFileAssets))) + XCTAssertFalse(PBXFileOrder.byUUID.sort(lhs: iosProject.objectFileReferenceAssets, rhs: iosProject.objectFileReferenceCoreData)) + XCTAssertTrue(PBXFileOrder.byUUID.sort(lhs: iosProject.objectFileReferenceCoreData, rhs: iosProject.objectFileReferenceAssets)) } - // MARK: - PBXFileOrder - PBXBuildPhaseFile - - func test_PBXFileOrder_PBXBuildPhaseFile_by_uuid() { - XCTAssertFalse(PBXFileOrder.byUUID.sort(lhs: objectBuildPhaseFileAssets, rhs: objectBuildPhaseFileMain)) - XCTAssertTrue(PBXFileOrder.byUUID.sort(lhs: objectBuildPhaseFileMain, rhs: objectBuildPhaseFileAssets)) - } + func test_PBXFileOrder_PBXFileReference_by_filename_when_iosProject() { + let iosProject = self.iosProject() - func test_PBXFileOrder_PBXBuildPhaseFile_by_filename() { - XCTAssertTrue(PBXFileOrder.byFilename.sort(lhs: objectBuildPhaseFileAssets, rhs: objectBuildPhaseFileMain)) - XCTAssertFalse(PBXFileOrder.byFilename.sort(lhs: objectBuildPhaseFileMain, rhs: objectBuildPhaseFileAssets)) + XCTAssertTrue(PBXFileOrder.byFilename.sort(lhs: iosProject.objectFileReferenceAssets, rhs: iosProject.objectFileReferenceCoreData)) + XCTAssertFalse(PBXFileOrder.byFilename.sort(lhs: iosProject.objectFileReferenceCoreData, rhs: iosProject.objectFileReferenceAssets)) } - // MARK: - PBXFileOrder - PBXFileReference + func test_PBXFileOrder_PBXFileReference_by_filename_when_fileSharedAcrossTargetsProject() { + let fileSharedAcrossTargetsProject = self.fileSharedAcrossTargetsProject() - func test_PBXFileOrder_PBXFileReference_by_uuid() { - XCTAssertFalse(PBXFileOrder.byUUID.sort(lhs: objectFileReferenceAssets, rhs: objectFileReferenceCoreData)) - XCTAssertTrue(PBXFileOrder.byUUID.sort(lhs: objectFileReferenceCoreData, rhs: objectFileReferenceAssets)) + let sameNameByFilename = fileSharedAcrossTargetsProject.objectFileReferenceSameName.sorted(by: PBXFileOrder.byFilename.sort) + XCTAssertLessThan(sameNameByFilename.first!.1.uuid, sameNameByFilename.last!.1.uuid) } - func test_PBXFileOrder_PBXFileReference_by_filename() { - XCTAssertTrue(PBXFileOrder.byFilename.sort(lhs: objectFileReferenceAssets, rhs: objectFileReferenceCoreData)) - XCTAssertFalse(PBXFileOrder.byFilename.sort(lhs: objectFileReferenceCoreData, rhs: objectFileReferenceAssets)) - } + func test_PBXFileOrder_PBXFileReference_by_filename_when_nil_name_and_path_when_iosProject() { + let iosProject = self.iosProject() - func test_PBXFileOrder_PBXFileReference_by_filename_when_nil_name_and_path() { - fileReferenceAssets.name = nil - fileReferenceCoreData.name = nil - fileReferenceAssets.path = nil - fileReferenceCoreData.path = nil - XCTAssertFalse(PBXFileOrder.byFilename.sort(lhs: objectFileReferenceAssets, rhs: objectFileReferenceCoreData)) - XCTAssertTrue(PBXFileOrder.byFilename.sort(lhs: objectFileReferenceCoreData, rhs: objectFileReferenceAssets)) + iosProject.fileReferenceAssets.name = nil + iosProject.fileReferenceCoreData.name = nil + iosProject.fileReferenceAssets.path = nil + iosProject.fileReferenceCoreData.path = nil + XCTAssertFalse(PBXFileOrder.byFilename.sort(lhs: iosProject.objectFileReferenceAssets, rhs: iosProject.objectFileReferenceCoreData)) + XCTAssertTrue(PBXFileOrder.byFilename.sort(lhs: iosProject.objectFileReferenceCoreData, rhs: iosProject.objectFileReferenceAssets)) } // MARK: - PBXFileOrder - Other - func test_PBXFileOrder_Other_by_uuid() { - XCTAssertTrue(PBXFileOrder.byUUID.sort(lhs: objectGroupFrameworks, rhs: objectGroupProducts)) - XCTAssertFalse(PBXFileOrder.byUUID.sort(lhs: objectGroupProducts, rhs: objectGroupFrameworks)) + func test_PBXFileOrder_Other_by_uuid_when_iosProject() { + let iosProject = self.iosProject() + + XCTAssertTrue(PBXFileOrder.byUUID.sort(lhs: iosProject.objectGroupFrameworks, rhs: iosProject.objectGroupProducts)) + XCTAssertFalse(PBXFileOrder.byUUID.sort(lhs: iosProject.objectGroupProducts, rhs: iosProject.objectGroupFrameworks)) } - func test_PBXFileOrder_Other_by_filename() { - XCTAssertTrue(PBXFileOrder.byFilename.sort(lhs: objectGroupFrameworks, rhs: objectGroupProducts)) - XCTAssertFalse(PBXFileOrder.byFilename.sort(lhs: objectGroupProducts, rhs: objectGroupFrameworks)) + func test_PBXFileOrder_Other_by_filename_when_iosProject() { + let iosProject = self.iosProject() + + XCTAssertTrue(PBXFileOrder.byFilename.sort(lhs: iosProject.objectGroupFrameworks, rhs: iosProject.objectGroupProducts)) + XCTAssertFalse(PBXFileOrder.byFilename.sort(lhs: iosProject.objectGroupProducts, rhs: iosProject.objectGroupFrameworks)) } // MARK: - PBXNavigatorFileOrder - func test_PBXNavigatorFileOrder_unsorted() { + func test_PBXNavigatorFileOrder_unsorted_when_iosProject() { XCTAssertNil(PBXNavigatorFileOrder.unsorted.sort) } - func test_PBXNavigatorFileOrder_by_filename() { + func test_PBXNavigatorFileOrder_by_filename_when_iosProject() { + let iosProject = self.iosProject() + let sort: (PBXFileElement, PBXFileElement) -> Bool = PBXNavigatorFileOrder.byFilename.sort! - let sorted = navigatorFileGroup.children.sorted(by: sort).map { $0.fileName()! } + let sorted = iosProject.navigatorFileGroup.children.sorted(by: sort).map { $0.fileName()! } XCTAssertEqual([ "AppDelegate.swift", "Assets.xcassets", @@ -159,9 +140,11 @@ class PBXOutputSettingsTests: XCTestCase { ], sorted) } - func test_PBXNavigatorFileOrder_by_filename_groups_first() { + func test_PBXNavigatorFileOrder_by_filename_groups_first_when_iosProject() { + let iosProject = self.iosProject() + let sort: (PBXFileElement, PBXFileElement) -> Bool = PBXNavigatorFileOrder.byFilenameGroupsFirst.sort! - let sorted = navigatorFileGroup.children.sorted(by: sort).map { $0.fileName()! } + let sorted = iosProject.navigatorFileGroup.children.sorted(by: sort).map { $0.fileName()! } XCTAssertEqual([ "GroupWithoutFolder", "AppDelegate.swift", @@ -183,8 +166,111 @@ class PBXOutputSettingsTests: XCTestCase { XCTAssertNil(PBXBuildPhaseFileOrder.unsorted.sort) } - func test_PBXBuildPhaseFileOrder_by_filename() { - XCTAssertTrue(PBXBuildPhaseFileOrder.byFilename.sort!(buildFileAssets, buildFileMain)) - XCTAssertFalse(PBXBuildPhaseFileOrder.byFilename.sort!(buildFileMain, buildFileAssets)) + func test_PBXBuildPhaseFileOrder_by_filename_when_iosProject() { + let iosProject = self.iosProject() + + XCTAssertTrue(PBXBuildPhaseFileOrder.byFilename.sort!(iosProject.buildFileAssets, iosProject.buildFileMain)) + XCTAssertFalse(PBXBuildPhaseFileOrder.byFilename.sort!(iosProject.buildFileMain, iosProject.buildFileAssets)) + } + + // MARK: - Private + + struct iOSProject { + var proj: PBXProj! + var buildFileAssets: PBXBuildFile! + var buildFileMain: PBXBuildFile! + + var objectBuildFileAssets: (PBXObjectReference, PBXBuildFile)! + var objectBuildFileMain: (PBXObjectReference, PBXBuildFile)! + + var objectBuildPhaseFileAssets: (PBXObjectReference, PBXBuildPhaseFile)! + var objectBuildPhaseFileMain: (PBXObjectReference, PBXBuildPhaseFile)! + + var fileReferenceAssets: PBXFileReference! + var fileReferenceCoreData: PBXFileReference! + + var objectFileReferenceAssets: (PBXObjectReference, PBXFileReference)! + var objectFileReferenceCoreData: (PBXObjectReference, PBXFileReference)! + + var groupFrameworks: PBXGroup! + var groupProducts: PBXGroup! + + var objectGroupFrameworks: (PBXObjectReference, PBXGroup)! + var objectGroupProducts: (PBXObjectReference, PBXGroup)! + + var navigatorFileGroup: PBXGroup! + } + + private func iosProject() -> iOSProject { + let dic = iosProjectDictionary() + let proj = try! PBXProj(jsonDictionary: dic.1) + + let buildFileAssets = proj.buildFiles.first { $0.file?.fileName() == "Assets.xcassets" }! + let buildFileMain = proj.buildFiles.first { $0.file?.fileName() == "Main.storyboard" }! + + let objectBuildFileAssets = (buildFileAssets.reference, buildFileAssets) + let objectBuildFileMain = (buildFileMain.reference, buildFileMain) + + let objectBuildPhaseFileAssets = proj.objects.buildPhaseFile.first { $0.value.buildFile.file?.fileName() == "Assets.xcassets" }! + let objectBuildPhaseFileMain = proj.objects.buildPhaseFile.first { $0.value.buildFile.file?.fileName() == "Main.storyboard" }! + + let fileReferenceAssets = proj.fileReferences.first { $0.fileName() == "Assets.xcassets" }! + let fileReferenceCoreData = proj.fileReferences.first { $0.fileName() == "CoreData.framework" }! + + let objectFileReferenceAssets = (buildFileAssets.reference, fileReferenceAssets) + let objectFileReferenceCoreData = (buildFileMain.reference, fileReferenceCoreData) + + let groupFrameworks = proj.groups.first { $0.fileName() == "Frameworks" }! + let groupProducts = proj.groups.first { $0.fileName() == "Products" }! + + let objectGroupFrameworks = (groupFrameworks.reference, groupFrameworks) + let objectGroupProducts = (groupProducts.reference, groupProducts) + + let navigatorFileGroup = proj.groups.first { $0.fileName() == "iOS" }! + + return iOSProject( + proj: proj, + buildFileAssets: buildFileAssets, + buildFileMain: buildFileMain, + objectBuildFileAssets: objectBuildFileAssets, + objectBuildFileMain: objectBuildFileMain, + objectBuildPhaseFileAssets: objectBuildPhaseFileAssets, + objectBuildPhaseFileMain: objectBuildPhaseFileMain, + fileReferenceAssets: fileReferenceAssets, + fileReferenceCoreData: fileReferenceCoreData, + objectFileReferenceAssets: objectFileReferenceAssets, + objectFileReferenceCoreData: objectFileReferenceCoreData, + groupFrameworks: groupFrameworks, + groupProducts: groupProducts, + objectGroupFrameworks: objectGroupFrameworks, + objectGroupProducts: objectGroupProducts, + navigatorFileGroup: navigatorFileGroup + ) + } + + struct FileSharedAcrossTargetsProject { + var proj: PBXProj! + var buildFileSameName: [PBXBuildFile]! + var objectBuildFileSameName: [(PBXObjectReference, PBXBuildFile)]! + var fileReferenceSameName: [PBXFileReference]! + var objectFileReferenceSameName: [(PBXObjectReference, PBXFileReference)]! + } + + func fileSharedAcrossTargetsProject() -> FileSharedAcrossTargetsProject { + let dic = fileSharedAcrossTargetsDictionary() + let proj = try! PBXProj(jsonDictionary: dic.1) + + let buildFileSameName = proj.buildFiles.filter { $0.file?.fileName() == "SameName.h" } + let objectBuildFileSameName = proj.buildFiles.map { ($0.reference, $0) } + let fileReferenceSameName = proj.fileReferences.filter { $0.fileName() == "FileSharedAcrossTargetsTests.swift" } + let objectFileReferenceSameName = fileReferenceSameName.map { ($0.reference, $0) } + + return FileSharedAcrossTargetsProject( + proj: proj, + buildFileSameName: buildFileSameName, + objectBuildFileSameName: objectBuildFileSameName, + fileReferenceSameName: fileReferenceSameName, + objectFileReferenceSameName: objectFileReferenceSameName + ) } } diff --git a/Tests/XcodeProjTests/Objects/Project/PBXProjEncoderTests.swift b/Tests/XcodeProjTests/Objects/Project/PBXProjEncoderTests.swift index 7b2eb3074..9bd31a169 100644 --- a/Tests/XcodeProjTests/Objects/Project/PBXProjEncoderTests.swift +++ b/Tests/XcodeProjTests/Objects/Project/PBXProjEncoderTests.swift @@ -6,19 +6,11 @@ import XCTest class PBXProjEncoderTests: XCTestCase { var proj: PBXProj! - override func setUp() { - super.setUp() - let dic = iosProjectDictionary() - do { - proj = try PBXProj(jsonDictionary: dic.1) - } catch { - XCTFail("Failed to load project from file \(error)") - } - } - // MARK: - Header - func test_writeHeaders() throws { + func test_writeHeaders_when_iOSProject() throws { + loadiOSProject() + let lines = self.lines(fromFile: encodeProject()) XCTAssertEqual(583, lines.count) XCTAssertEqual("// !$*UTF8*$!", lines[0]) @@ -26,7 +18,9 @@ class PBXProjEncoderTests: XCTestCase { // MARK: - Internal file lists - func test_buildFiles_in_default_uuid_order() { + func test_buildFiles_in_default_uuid_order_when_iOSProject() { + loadiOSProject() + let lines = self.lines(fromFile: encodeProject()) var line = lines.validate(line: "/* Begin PBXBuildFile section */") line = lines.validate(lineContaining: "04D5C09F1F153824008A2F98 /* CoreData.framework in Frameworks */", onLineAfter: line) @@ -45,7 +39,9 @@ class PBXProjEncoderTests: XCTestCase { lines.validate(line: "/* End PBXBuildFile section */", onLineAfter: line) } - func test_buildFiles_in_filename_order() { + func test_buildFiles_in_filename_order_when_iOSProject() { + loadiOSProject() + let settings = PBXOutputSettings(projFileListOrder: .byFilename) let lines = self.lines(fromFile: encodeProject(settings: settings)) var line = lines.validate(line: "/* Begin PBXBuildFile section */") @@ -65,7 +61,24 @@ class PBXProjEncoderTests: XCTestCase { lines.validate(line: "/* End PBXBuildFile section */", onLineAfter: line) } - func test_file_references_in_default_uuid_order() { + func test_buildFiles_in_filename_order_when_fileSharedAcrossTargetsProject() { + loadFileSharedAcrossTargetsProject() + + let settings = PBXOutputSettings(projFileListOrder: .byFilename) + let lines = self.lines(fromFile: encodeProject(settings: settings)) + var line = lines.validate(line: "/* Begin PBXBuildFile section */") + + line = lines.validate(lineContaining: "6C103C032A49CC5400D7EFE4 /* FileSharedAcrossTargets.framework in Frameworks */", onLineAfter: line) + line = lines.validate(lineContaining: "6C103C092A49CC5400D7EFE4 /* FileSharedAcrossTargets.h in Headers */", onLineAfter: line) + line = lines.validate(lineContaining: "6C103C082A49CC5400D7EFE4 /* FileSharedAcrossTargetsTests.swift in Sources */", onLineAfter: line) + line = lines.validate(lineContaining: "6C103C132A49CC7300D7EFE4 /* SharedHeader.h in Headers */", onLineAfter: line) + + lines.validate(line: "/* End PBXBuildFile section */", onLineAfter: line) + } + + func test_file_references_in_default_uuid_order_when_iOSProject() { + loadiOSProject() + let lines = self.lines(fromFile: encodeProject()) var line = lines.validate(line: "/* Begin PBXFileReference section */") line = lines.validate(lineContaining: "04D5C09E1F153824008A2F98 /* CoreData.framework */", onLineAfter: line) @@ -85,10 +98,28 @@ class PBXProjEncoderTests: XCTestCase { line = lines.validate(lineContaining: "23C1E0AF23657FB500B8D1EF /* iOS.xctestplan */", onLineAfter: line) line = lines.validate(lineContaining: "3CD1EADC205763E400DAEECB /* Model.xcdatamodel */", onLineAfter: line) line = lines.validate(lineContaining: "42AA1A1822AAF41000428760 /* MyLocalPackage */", onLineAfter: line) + lines.validate(line: "/* End PBXFileReference section */", onLineAfter: line) } - func test_file_references_in_filename_order() { + func test_file_references_in_default_uuid_order_when_fileSharedAcrossTargetsProject() { + loadFileSharedAcrossTargetsProject() + + let lines = self.lines(fromFile: encodeProject()) + var line = lines.validate(line: "/* Begin PBXFileReference section */") + line = lines.validate(lineContaining: "6C103BFA2A49CC5300D7EFE4 /* FileSharedAcrossTargets.framework */", onLineAfter: line) + line = lines.validate(lineContaining: "6C103BFD2A49CC5300D7EFE4 /* FileSharedAcrossTargets.h */", onLineAfter: line) + line = lines.validate(lineContaining: "6C103C022A49CC5400D7EFE4 /* FileSharedAcrossTargetsTests.xctest */", onLineAfter: line) + line = lines.validate(lineContaining: "6C103C072A49CC5400D7EFE4 /* FileSharedAcrossTargetsTests.swift */", onLineAfter: line) + line = lines.validate(lineContaining: "6C103C122A49CC7300D7EFE4 /* SharedHeader.h */", onLineAfter: line) + line = lines.validate(lineContaining: "6CB965012A49DC1F009186C6 /* FileSharedAcrossTargetsTests.swift */", onLineAfter: line) + + lines.validate(line: "/* End PBXFileReference section */", onLineAfter: line) + } + + func test_file_references_in_filename_order_when_iOSProject() { + loadiOSProject() + let settings = PBXOutputSettings(projFileListOrder: .byFilename) let lines = self.lines(fromFile: encodeProject(settings: settings)) var line = lines.validate(line: "/* Begin PBXFileReference section */") @@ -112,9 +143,26 @@ class PBXProjEncoderTests: XCTestCase { lines.validate(line: "/* End PBXFileReference section */", onLineAfter: line) } + func test_file_references_in_filename_order_when_fileSharedAcrossTargetsProject() { + loadFileSharedAcrossTargetsProject() + + let settings = PBXOutputSettings(projFileListOrder: .byFilename) + let lines = self.lines(fromFile: encodeProject(settings: settings)) + var line = lines.validate(line: "/* Begin PBXFileReference section */") + line = lines.validate(lineContaining: "6C103BFA2A49CC5300D7EFE4 /* FileSharedAcrossTargets.framework */", onLineAfter: line) + line = lines.validate(lineContaining: "6C103BFD2A49CC5300D7EFE4 /* FileSharedAcrossTargets.h */", onLineAfter: line) + line = lines.validate(lineContaining: "6C103C072A49CC5400D7EFE4 /* FileSharedAcrossTargetsTests.swift */", onLineAfter: line) + line = lines.validate(lineContaining: "6CB965012A49DC1F009186C6 /* FileSharedAcrossTargetsTests.swift */", onLineAfter: line) + line = lines.validate(lineContaining: "6C103C022A49CC5400D7EFE4 /* FileSharedAcrossTargetsTests.xctest */", onLineAfter: line) + line = lines.validate(lineContaining: "6C103C122A49CC7300D7EFE4 /* SharedHeader.h */", onLineAfter: line) + lines.validate(line: "/* End PBXFileReference section */", onLineAfter: line) + } + // MARK: - Navigator - func test_navigator_groups_in_default_order() { + func test_navigator_groups_in_default_order_when_iOSProject() { + loadiOSProject() + let lines = self.lines(fromFile: encodeProject()) let beginGroup = lines.findLine("/* Begin PBXGroup section */") @@ -155,7 +203,9 @@ class PBXProjEncoderTests: XCTestCase { lines.validate(line: "23766C2C1EAA3484007A9026 /* Info.plist */,", betweenLine: iosTestsChildrenStart, andLine: iosTestsChildrenEnd) } - func test_navigator_groups_in_filename_order() { + func test_navigator_groups_in_filename_order_when_iOSProject() { + loadiOSProject() + let settings = PBXOutputSettings(projNavigatorFileOrder: .byFilename) let lines = self.lines(fromFile: encodeProject(settings: settings)) @@ -194,7 +244,9 @@ class PBXProjEncoderTests: XCTestCase { lines.validate(line: ");", after: line) } - func test_navigator_groups_in_filename_groups_first_order() { + func test_navigator_groups_in_filename_groups_first_order_when_iOSProject() { + loadiOSProject() + let settings = PBXOutputSettings(projNavigatorFileOrder: .byFilenameGroupsFirst) let lines = self.lines(fromFile: encodeProject(settings: settings)) @@ -235,7 +287,9 @@ class PBXProjEncoderTests: XCTestCase { // MARK: - Build phases - func test_build_phase_sources_unsorted() { + func test_build_phase_sources_unsorted_when_iOSProject() { + loadiOSProject() + let lines = self.lines(fromFile: encodeProject()) let beginGroup = lines.findLine("/* Begin PBXSourcesBuildPhase section */") let files = lines.findLine("files = (", after: beginGroup) @@ -245,7 +299,9 @@ class PBXProjEncoderTests: XCTestCase { lines.validate(line: "3CD1EADD205763E400DAEECB /* Model.xcdatamodeld in Sources */,", betweenLine: files, andLine: endGroup) } - func test_build_phase_sources_sorted() { + func test_build_phase_sources_sorted_when_iOSProject() { + loadiOSProject() + let settings = PBXOutputSettings(projBuildPhaseFileOrder: .byFilename) let lines = self.lines(fromFile: encodeProject(settings: settings)) let beginGroup = lines.findLine("/* Begin PBXSourcesBuildPhase section */") @@ -256,7 +312,9 @@ class PBXProjEncoderTests: XCTestCase { line = lines.validate(line: "/* End PBXSourcesBuildPhase section */", after: line) } - func test_build_phase_headers_unsorted() { + func test_build_phase_headers_unsorted_when_iOSProject() { + loadiOSProject() + let lines = self.lines(fromFile: encodeProject()) let beginGroup = lines.findLine("/* Begin PBXHeadersBuildPhase section */") let files = lines.findLine("files = (", after: beginGroup) @@ -266,7 +324,9 @@ class PBXProjEncoderTests: XCTestCase { lines.validate(line: "04D5C0A31F153924008A2F98 /* Public.h in Headers */,", betweenLine: files, andLine: endGroup) } - func test_build_phase_headers_sorted() { + func test_build_phase_headers_sorted_when_iOSProject() { + loadiOSProject() + let settings = PBXOutputSettings(projBuildPhaseFileOrder: .byFilename) let lines = self.lines(fromFile: encodeProject(settings: settings)) let beginGroup = lines.findLine("/* Begin PBXHeadersBuildPhase section */") @@ -277,7 +337,9 @@ class PBXProjEncoderTests: XCTestCase { line = lines.validate(line: "/* End PBXHeadersBuildPhase section */", after: line) } - func test_build_phase_resources_unsorted() { + func test_build_phase_resources_unsorted_when_iOSProject() { + loadiOSProject() + let lines = self.lines(fromFile: encodeProject()) let beginGroup = lines.findLine("/* Begin PBXResourcesBuildPhase section */") let files = lines.findLine("files = (", after: beginGroup) @@ -287,7 +349,9 @@ class PBXProjEncoderTests: XCTestCase { lines.validate(line: "23766C201EAA3484007A9026 /* LaunchScreen.storyboard in Resources */,", betweenLine: files, andLine: endGroup) } - func test_build_phase_resources_sorted() { + func test_build_phase_resources_sorted_when_iOSProject() { + loadiOSProject() + let settings = PBXOutputSettings(projBuildPhaseFileOrder: .byFilename) let lines = self.lines(fromFile: encodeProject(settings: settings)) let beginGroup = lines.findLine("/* Begin PBXResourcesBuildPhase section */") @@ -323,6 +387,14 @@ class PBXProjEncoderTests: XCTestCase { private func lines(fromFile file: String) -> [String] { file.replacingOccurrences(of: "\t", with: "").components(separatedBy: "\n") } + + private func loadiOSProject() { + proj = try! PBXProj(jsonDictionary: iosProjectDictionary().1) + } + + private func loadFileSharedAcrossTargetsProject() { + proj = try! PBXProj(jsonDictionary: fileSharedAcrossTargetsDictionary().1) + } } // MARK: - Line validations @@ -394,7 +466,7 @@ private extension Array where Element == String { } func log() { - var line: Int = 0 + var line = 0 forEach { let lineStr = "\(line)" let lineNo = lineStr + String(repeating: " ", count: 5 - lineStr.count) diff --git a/Tests/XcodeProjTests/Tests/Fixtures.swift b/Tests/XcodeProjTests/Tests/Fixtures.swift index 0222869f1..90b533b97 100644 --- a/Tests/XcodeProjTests/Tests/Fixtures.swift +++ b/Tests/XcodeProjTests/Tests/Fixtures.swift @@ -10,3 +10,8 @@ func iosProjectDictionary() -> (Path, [String: Any]) { let iosProject = fixturesPath() + "iOS/Project.xcodeproj/project.pbxproj" return (iosProject, loadPlist(path: iosProject.string)!) } + +func fileSharedAcrossTargetsDictionary() -> (Path, [String: Any]) { + let fileSharedAcrossTargetsProject = fixturesPath() + "FileSharedAcrossTargets/FileSharedAcrossTargets.xcodeproj/project.pbxproj" + return (fileSharedAcrossTargetsProject, loadPlist(path: fileSharedAcrossTargetsProject.string)!) +} From f24faa973e46c270718893bdf3c5d2afd75adeb4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20Pi=C3=B1era=20Buend=C3=ADa?= <663605+pepicrft@users.noreply.github.com> Date: Mon, 26 Jun 2023 17:53:23 +0200 Subject: [PATCH 267/678] Add stale workflow (#774) --- .github/workflows/stale.yml | 52 +++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 .github/workflows/stale.yml diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml new file mode 100644 index 000000000..553433e49 --- /dev/null +++ b/.github/workflows/stale.yml @@ -0,0 +1,52 @@ +name: 'Close stale issues and PRs' +on: + schedule: + - cron: '30 1 * * *' + +jobs: + stale: + runs-on: ubuntu-latest + steps: + - uses: actions/stale@v8 + with: + stale-issue-message: | + Hola 👋, + + We want to inform you that the issue has been marked as stale. This means that there hasn't been any activity or updates on it for quite some time, and it's possible that it may no longer be relevant or actionable. + If you still believe that this issue is valid and requires attention, please provide an update or any additional information that can help us address it. Otherwise, we may consider closing it in the near future. + Thank you for your understanding. + + stale-pr-message: | + Hola 👋, + + We want to let you know that your pull request has been marked as stale. It seems that there hasn't been any activity or updates on it for a while. + + If you're still interested in having this pull request merged or reviewed, please provide any necessary updates or address any feedback that may have been given. We would be happy to continue the review process and consider merging it into the `main` branch. + + However, if this pull request is no longer a priority or if you've decided to take a different approach, please let us know so we can close it accordingly. + + Thank you for your understanding and contribution. + close-issue-message: | + Hola 👋, + + We want to inform you that we have decided to close this stale issue as there hasn't been any activity or response regarding it after marking it as stale. + + We understand that circumstances may have changed or priorities may have shifted, and that's completely understandable. If you still believe that this issue needs to be addressed, please feel free to reopen it and provide any necessary updates or additional information. + + We appreciate your understanding and look forward to your continued contributions to the project. + + Thank you. + close-pr-message: | + Hola 👋, + + We want to let you know that we have decided to close your pull request #456 due to prolonged inactivity. Despite the initial interest and efforts put into the pull request, we haven't seen any updates or responses for a considerable period of time. + + We understand that circumstances change and priorities shift, which may have led to this inactivity. If you still wish to contribute or have further discussions on this feature or bug fix, please don't hesitate to reopen the pull request and engage with the community. + + We appreciate your understanding and the time you invested in submitting the pull request. Your contributions are valuable, and we hope to collaborate with you on future endeavors. + + Thank you. + stale-issue-label: 'stale' + stale-pr-label: 'stale' + days-before-stale: 30 + days-before-close: 5 From a1d74dce4ce6a5783bf7fa6702de3f3ee1faf0c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20Pi=C3=B1era?= Date: Mon, 26 Jun 2023 19:09:54 +0200 Subject: [PATCH 268/678] Version 8.11.0 --- CHANGELOG.md | 17 +++++++++++++++++ README.md | 2 +- xcodeproj.podspec | 2 +- 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3c280c588..bc5e32c51 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,22 @@ 🚀 Check out the guidelines [here](https://tuist.io/docs/contribution/changelog-guidelines/) +## Unreleased + +## 8.11.0 + +### Added + +- Support for Xcode runtime issue breakpoints [#761](https://github.com/tuist/XcodeProj/pull/761) by [@zenangst](https://github.com/zenangst) +- `Platform.visionOS` case and updated `BuildSettingsProvider` to return the default build settings for visionOS projects [#765](https://github.com/tuist/XcodeProj/pull/765) by [@Mstrodl](https://github.com/Mstrodl). + +### Changed + +- [PathKit](https://github.com/kylef/PathKit) version to [1.0.1](https://github.com/kylef/PathKit/blob/HEAD/CHANGELOG.md#%E2%80%8B101-2021-09-22) + +### Fixed + +- Ensured UUIDs are considered when sorting by filename to ensure information is not lost when filenames are equal [#769](https://github.com/tuist/XcodeProj/pull/769) by [@timothycosta](https://github.com/timothycosta). + ## 8.10.0 ### Added diff --git a/README.md b/README.md index a3b90b631..8891a3f88 100644 --- a/README.md +++ b/README.md @@ -50,7 +50,7 @@ Add the dependency in your `Package.swift` file: let package = Package( name: "myproject", dependencies: [ - .package(url: "https://github.com/tuist/XcodeProj.git", .upToNextMajor(from: "8.9.0")), + .package(url: "https://github.com/tuist/XcodeProj.git", .upToNextMajor(from: "8.11.0")), ], targets: [ .target( diff --git a/xcodeproj.podspec b/xcodeproj.podspec index 05a1954cc..399f19767 100644 --- a/xcodeproj.podspec +++ b/xcodeproj.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = 'xcodeproj' - s.version = '8.10.0' + s.version = '8.11.0' s.summary = 'Read/Modify/Write your Xcode projects' s.homepage = 'https://github.com/tuist/xcodeproj' s.license = 'MIT' From 3e3849fc38943ecc8cc7375997242bcebe7b1114 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20Pi=C3=B1era?= Date: Mon, 26 Jun 2023 19:11:34 +0200 Subject: [PATCH 269/678] Update PathKit version in xcodeproj.podspec and Cartfile --- Cartfile | 2 +- xcodeproj.podspec | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Cartfile b/Cartfile index 89344226f..6230be438 100644 --- a/Cartfile +++ b/Cartfile @@ -1,2 +1,2 @@ -github "tuist/PathKit" == 1.0.0 +github "tuist/PathKit" == 1.0.1 github "tadija/AEXML" == 4.6.1 diff --git a/xcodeproj.podspec b/xcodeproj.podspec index 399f19767..077aa2482 100644 --- a/xcodeproj.podspec +++ b/xcodeproj.podspec @@ -14,6 +14,6 @@ Pod::Spec.new do |s| s.module_name = 'XcodeProj' - s.dependency 'PathKit', '~> 1.0.0' + s.dependency 'PathKit', '~> 1.0.1' s.dependency 'AEXML', '~> 4.6.1' end From 7431d391606dfa231cb68b3c526a427e3f507e4f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20Pi=C3=B1era?= Date: Mon, 26 Jun 2023 19:16:13 +0200 Subject: [PATCH 270/678] Remove Carthage support --- CHANGELOG.md | 8 +- Cartfile | 2 - Cartfile.resolved | 2 - Documentation/getting-started.md | 10 - Project.swift | 15 - README.md | 10 - RELEASE.md | 4 +- Rakefile | 12 - XcodeProj_Carthage.xcodeproj/project.pbxproj | 903 ------------------ .../contents.xcworkspacedata | 7 - .../xcshareddata/xcschemes/XcodeProj.xcscheme | 77 -- .../.tuist-generated | 0 .../contents.xcworkspacedata | 7 - .../xcshareddata/IDEWorkspaceChecks.plist | 8 - .../xcshareddata/WorkspaceSettings.xcsettings | 8 - .../XcodeProj_Carthage-Workspace.xcscheme | 76 -- 16 files changed, 7 insertions(+), 1142 deletions(-) delete mode 100644 Cartfile delete mode 100644 Cartfile.resolved delete mode 100644 Project.swift delete mode 100644 XcodeProj_Carthage.xcodeproj/project.pbxproj delete mode 100644 XcodeProj_Carthage.xcodeproj/project.xcworkspace/contents.xcworkspacedata delete mode 100644 XcodeProj_Carthage.xcodeproj/xcshareddata/xcschemes/XcodeProj.xcscheme delete mode 100644 XcodeProj_Carthage.xcworkspace/.tuist-generated delete mode 100644 XcodeProj_Carthage.xcworkspace/contents.xcworkspacedata delete mode 100644 XcodeProj_Carthage.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist delete mode 100644 XcodeProj_Carthage.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings delete mode 100644 XcodeProj_Carthage.xcworkspace/xcshareddata/xcschemes/XcodeProj_Carthage-Workspace.xcscheme diff --git a/CHANGELOG.md b/CHANGELOG.md index bc5e32c51..3f33a0c84 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,12 +6,16 @@ ### Added -- Support for Xcode runtime issue breakpoints [#761](https://github.com/tuist/XcodeProj/pull/761) by [@zenangst](https://github.com/zenangst) +- Support for Xcode runtime issue breakpoints [#761](https://github.com/tuist/XcodeProj/pull/761) by [@zenangst](https://github.com/zenangst). - `Platform.visionOS` case and updated `BuildSettingsProvider` to return the default build settings for visionOS projects [#765](https://github.com/tuist/XcodeProj/pull/765) by [@Mstrodl](https://github.com/Mstrodl). ### Changed -- [PathKit](https://github.com/kylef/PathKit) version to [1.0.1](https://github.com/kylef/PathKit/blob/HEAD/CHANGELOG.md#%E2%80%8B101-2021-09-22) +- [PathKit](https://github.com/kylef/PathKit) version to [1.0.1](https://github.com/kylef/PathKit/blob/HEAD/CHANGELOG.md#%E2%80%8B101-2021-09-22). + +### Removed + +- [Carthage](https://github.com/Carthage/Carthage) support. ### Fixed diff --git a/Cartfile b/Cartfile deleted file mode 100644 index 6230be438..000000000 --- a/Cartfile +++ /dev/null @@ -1,2 +0,0 @@ -github "tuist/PathKit" == 1.0.1 -github "tadija/AEXML" == 4.6.1 diff --git a/Cartfile.resolved b/Cartfile.resolved deleted file mode 100644 index 25e945995..000000000 --- a/Cartfile.resolved +++ /dev/null @@ -1,2 +0,0 @@ -github "tadija/AEXML" "4.6.1" -github "tuist/PathKit" "1.0.0" diff --git a/Documentation/getting-started.md b/Documentation/getting-started.md index dfb3441c5..9f10e34cd 100644 --- a/Documentation/getting-started.md +++ b/Documentation/getting-started.md @@ -14,16 +14,6 @@ pod 'xcodeproj' After that, you can run `pod install` *(or `bundle install` if you are using Bundler for managing your gems)* and you should get the latest version of xcodeproj integrated into your project. -### Carthage - -If you are using Carthage instead, you can add the following file to the project `Cartfile`: - -```bash -github "tuist/xcodeproj" -``` - -Then run `carthage update`. It'll pull the latest version available and compile a dynamic framework that you can link from your apps. - ### Swift Package Manager If you are developing a package instead *(with the SwiftPM)* you can integrate xcodeproj by adding the following line to the dependencies list of your `Package.swift`: diff --git a/Project.swift b/Project.swift deleted file mode 100644 index d96f3f5ac..000000000 --- a/Project.swift +++ /dev/null @@ -1,15 +0,0 @@ -import ProjectDescription - -let project = Project(name: "XcodeProj_Carthage", - targets: [ - Target(name: "XcodeProj", - platform: .macOS, - product: .framework, - bundleId: "io.tuist.XcodeProj", - infoPlist: "Info.plist", - sources: "Sources/XcodeProj/**", - dependencies: [ - .framework(path: "Carthage/Build/Mac/AEXML.framework"), - .framework(path: "Carthage/Build/Mac/PathKit.framework"), - ]), - ]) diff --git a/README.md b/README.md index 8891a3f88..7a5b4fc94 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,6 @@ XcodeProj is a library written in Swift for parsing and working with Xcode proje - [Projects Using XcodeProj](#projects-using-xcodeproj) - [Installation](#installation) - [Swift Package Manager](#swift-package-manager) - - [Carthage](#carthage) - [CocoaPods](#cocoapods) - [Scripting](#scripting) - [Documentation 📝](#documentation-) @@ -60,15 +59,6 @@ let package = Package( ) ``` -### Carthage - -**Only macOS** - -```bash -# Cartfile -github "tuist/xcodeproj" ~> 8.8.0 -``` - ### CocoaPods ```ruby diff --git a/RELEASE.md b/RELEASE.md index 9e9c4e925..e34f3534f 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -7,9 +7,7 @@ In this document you'll find all the necessary steps to release a new version of 3. Add the version section to the `CHANGELOG.md`, update the versions in the `README.md` and the `xcodeproj.podspec` file. 4. Commit the changes and tag them `git commit -m "Version x.y.z"` & `git tag x.y.z`. 5. Push the changes `git push origin main --tags` -6. Update Carthage dependencies by running `bundle exec rake carthage_update_dependencies`. 7. Generate the project by running `tuist generate`. 8. Run the release checks by running `bundle exec rake release_check`. 9. Publish a new version of the Pod by running `bundle exec pod trunk push --allow-warnings --verbose`. -10. Archive the Carthage binary by running `bundle exec rake archive_carthage`. -11. Create the release on GitHub including the release notes from the `CHANGELOG.md` and attach the archive `xcodeproj.framework.zip` generated by Carthage. +11. Create the release on GitHub including the release notes from the `CHANGELOG.md`. diff --git a/Rakefile b/Rakefile index 65e21d28c..bc8b32f94 100644 --- a/Rakefile +++ b/Rakefile @@ -14,18 +14,6 @@ task :release_check do puts "Building for release".colorize(:cyan) system("swift build -c release") - - puts "Compiling Carthage project".colorize(:cyan) - system("xcodebuild -project Xcodeproj_Carthage.xcodeproj -scheme XcodeProj") -end - -task :archive_carthage do - system("carthage build --no-skip-current --platform macOS") - system("carthage archive xcodeproj") -end - -task :carthage_update_dependencies do - system("carthage update --platform macOS") end def system(*args) diff --git a/XcodeProj_Carthage.xcodeproj/project.pbxproj b/XcodeProj_Carthage.xcodeproj/project.pbxproj deleted file mode 100644 index d63d3eac4..000000000 --- a/XcodeProj_Carthage.xcodeproj/project.pbxproj +++ /dev/null @@ -1,903 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 50; - objects = { - -/* Begin PBXBuildFile section */ - 0390AF375B465D1DC7AB6194 /* XCScheme+TestableReference.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0AE91C6982618C1EDDAAD596 /* XCScheme+TestableReference.swift */; }; - 03FCD0C75E642B6E50DE9095 /* PBXCopyFilesBuildPhase.swift in Sources */ = {isa = PBXBuildFile; fileRef = 19C42E5F8AAD8E3C04E8A9B5 /* PBXCopyFilesBuildPhase.swift */; }; - 062694C004A53F24E7A92B85 /* PBXProductType.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3A15BA73673DDD200166C9EC /* PBXProductType.swift */; }; - 0B364FCF8F7A557C252929EA /* XCConfig.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2B928006AD1C96D4D8072BD9 /* XCConfig.swift */; }; - 0C6F7F2EF3EE9D97F081D9FD /* PBXAggregateTarget.swift in Sources */ = {isa = PBXBuildFile; fileRef = A11172C9DBADEDF3203564B7 /* PBXAggregateTarget.swift */; }; - 1009BFBC8BD95556803FF2C9 /* Dictionary+Extras.swift in Sources */ = {isa = PBXBuildFile; fileRef = 48D03946AD764A02121872F7 /* Dictionary+Extras.swift */; }; - 1270ABC0B6133C84F57A8D3F /* XCScheme+PathRunnable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 26EF076F4983A1ABBD3CC81B /* XCScheme+PathRunnable.swift */; }; - 13CBB83040E0B373CE80CB16 /* PBXBuildFile.swift in Sources */ = {isa = PBXBuildFile; fileRef = 13177CF1296C6C32BF4C5B7C /* PBXBuildFile.swift */; }; - 147157016720CE9BC5943AF2 /* XCScheme+LaunchAction.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4EE77276DEE6859DE961F94D /* XCScheme+LaunchAction.swift */; }; - 1ADDD97C53AEC0990F693CDA /* AEXML.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0C950F23FEF894B133070990 /* AEXML.framework */; }; - 1C99B6399AB8732EA97B1EEC /* XCSwiftPackageProductDependency.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2D9937B44A9FCDD847F79008 /* XCSwiftPackageProductDependency.swift */; }; - 209B0AC5FFCE800A35624C49 /* XCScheme+RemoteRunnable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0BFCA27253AECAC6A2EF5E66 /* XCScheme+RemoteRunnable.swift */; }; - 23A0E815358EB2D937F40513 /* PBXBatchUpdater.swift in Sources */ = {isa = PBXBuildFile; fileRef = 08B779835760A818E59969D1 /* PBXBatchUpdater.swift */; }; - 2B2D208723F7AE79632BAEAE /* PBXFileElement.swift in Sources */ = {isa = PBXBuildFile; fileRef = D4AA26E4818BC76E4CB28CEB /* PBXFileElement.swift */; }; - 2BC374D574269FB75F978D6F /* PBXProject.swift in Sources */ = {isa = PBXBuildFile; fileRef = A93C80F128CBCDFA4EA63EFB /* PBXProject.swift */; }; - 33C049021FCA541192F40AD1 /* XCWorkspaceDataFileRef.swift in Sources */ = {isa = PBXBuildFile; fileRef = B92DC66EE80F3D7611319ACC /* XCWorkspaceDataFileRef.swift */; }; - 364C132E6ABF980BF9E84649 /* XCScheme+ProfileAction.swift in Sources */ = {isa = PBXBuildFile; fileRef = B2E17A977543393ED7B848A9 /* XCScheme+ProfileAction.swift */; }; - 3A59F800668B0D6F550B9C09 /* PBXGroup.swift in Sources */ = {isa = PBXBuildFile; fileRef = 249AAF8AE1978D1546C0ADB5 /* PBXGroup.swift */; }; - 3AF2A0A0965EB5EC74923244 /* XCDebugger.swift in Sources */ = {isa = PBXBuildFile; fileRef = 26A96BC0C027BB173BC23C8D /* XCDebugger.swift */; }; - 3D5DBC9A4315D97D1B39CF19 /* PBXProjEncoder.swift in Sources */ = {isa = PBXBuildFile; fileRef = 41A031713D5F31DDCC2D61EF /* PBXProjEncoder.swift */; }; - 3E2EE77196F6B2BECE8DF3DB /* BuildSettingsProvider.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1977C44246CCF9C13AB856C2 /* BuildSettingsProvider.swift */; }; - 468F48B3D19F3D1611181A2E /* XCSchemeManagement.swift in Sources */ = {isa = PBXBuildFile; fileRef = 69BA327A9CAF3CCFF60AD469 /* XCSchemeManagement.swift */; }; - 46A5D9862729AC0C6D85D4FB /* XCScheme+BuildAction.swift in Sources */ = {isa = PBXBuildFile; fileRef = E525B9A065757F329F0E4002 /* XCScheme+BuildAction.swift */; }; - 4716E044E5786AC68205911A /* XCVersionGroup.swift in Sources */ = {isa = PBXBuildFile; fileRef = 39E419CA05304074ADCDACE8 /* XCVersionGroup.swift */; }; - 494EF8FD09FAEE56F6ACF3BE /* XCWorkspaceDataElementLocationType.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0AE25C88F5874509586B3AD4 /* XCWorkspaceDataElementLocationType.swift */; }; - 4C5079131989ADE80FF17EFF /* Bool+Extras.swift in Sources */ = {isa = PBXBuildFile; fileRef = E23B1EFAE9DC6596E4EA4BCD /* Bool+Extras.swift */; }; - 4E9B74BA2A6381FEDEA26092 /* CommentedString.swift in Sources */ = {isa = PBXBuildFile; fileRef = 683F0C05F5FD6006924AA43C /* CommentedString.swift */; }; - 4F427C99A47227F5592A1522 /* BuildSettings.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6A113CBABFAE791D1B9C6BBE /* BuildSettings.swift */; }; - 53CE6B2F74AB5FAA69D58923 /* XCScheme+SerialAction.swift in Sources */ = {isa = PBXBuildFile; fileRef = 694034B4B7C9DF231B007A84 /* XCScheme+SerialAction.swift */; }; - 586BB941B8D71312F85033A1 /* PBXContainerItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA2A4EEFB9DE8F475B051FDE /* PBXContainerItem.swift */; }; - 5A9C450597EC43859570B863 /* PathKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F89DAD13D5505D59F10D0C9F /* PathKit.framework */; }; - 61FFC23B7055683822148DDE /* PBXContainerItemProxy.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2370B4E19828CEFC032511A1 /* PBXContainerItemProxy.swift */; }; - 625CFEF76B6D5B02D3A1CEC6 /* Equality.generated.swift in Sources */ = {isa = PBXBuildFile; fileRef = E639EC9D100AFD2CEAEE82E0 /* Equality.generated.swift */; }; - 64DB0043086F77457C7B223D /* String+Utils.swift in Sources */ = {isa = PBXBuildFile; fileRef = 88DAB211D02099ECDC268AE2 /* String+Utils.swift */; }; - 65476234B5AA54D4EB33FEA7 /* PBXTarget.swift in Sources */ = {isa = PBXBuildFile; fileRef = 32F121F70B66AA9787F99BC3 /* PBXTarget.swift */; }; - 6619158CCA6E2D05A39860B8 /* Errors.swift in Sources */ = {isa = PBXBuildFile; fileRef = 325DDB80858F8DD8C5C27A07 /* Errors.swift */; }; - 69CBD38E1B96198049A02795 /* XCScheme+LocationScenarioReference.swift in Sources */ = {isa = PBXBuildFile; fileRef = 39B8CB253365692579B8C8E2 /* XCScheme+LocationScenarioReference.swift */; }; - 6AA90F1144C42F9275124B0F /* PBXFrameworksBuildPhase.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3BEB2811DE4A8D3EE6DC46B7 /* PBXFrameworksBuildPhase.swift */; }; - 6BCC38DC97A295B5179C0565 /* PBXRezBuildPhase.swift in Sources */ = {isa = PBXBuildFile; fileRef = 577B27811EEAD46794E8DE90 /* PBXRezBuildPhase.swift */; }; - 730CEE3BF13DFC6608790F33 /* XCWorkspace.swift in Sources */ = {isa = PBXBuildFile; fileRef = 15DE1D6B3000410D531F05AA /* XCWorkspace.swift */; }; - 735E1C6466FF56969767BAA0 /* XCScheme+CommandLineArguments.swift in Sources */ = {isa = PBXBuildFile; fileRef = B837566EDF23D002AC881D07 /* XCScheme+CommandLineArguments.swift */; }; - 73E2CEC84B1EE4E25AF9030C /* PBXShellScriptBuildPhase.swift in Sources */ = {isa = PBXBuildFile; fileRef = FC12E1A11D67971AEC27AA12 /* PBXShellScriptBuildPhase.swift */; }; - 74A56CC842A9E89D622A49A0 /* PBXProj.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6B2C739F39DD3CC1B77E1075 /* PBXProj.swift */; }; - 7823F76B43696121C7401C35 /* PBXBuildPhase.swift in Sources */ = {isa = PBXBuildFile; fileRef = 60E927F019715C98BA849930 /* PBXBuildPhase.swift */; }; - 792583786825191D2E186E9D /* XCRemoteSwiftPackageReference.swift in Sources */ = {isa = PBXBuildFile; fileRef = 51CBC0FF736F69D538FFEC78 /* XCRemoteSwiftPackageReference.swift */; }; - 7C3555C09B170AEA2D56E8F2 /* XCScheme+EnvironmentVariable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 20B1225FED6E1D49EE385AA0 /* XCScheme+EnvironmentVariable.swift */; }; - 7CDAEBA81467E39CBAD2E6CF /* PBXSourcesBuildPhase.swift in Sources */ = {isa = PBXBuildFile; fileRef = CC365B2E771B6E2690D751DB /* PBXSourcesBuildPhase.swift */; }; - 7DF42666456E27C51CC672C1 /* Array+Extras.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6023B10EB151C2FF48E53395 /* Array+Extras.swift */; }; - 7F9ED031DE6A06055F44C2E2 /* JSONDecoding.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9144C9BC5E10BE834E6824A1 /* JSONDecoding.swift */; }; - 80988B37A199C50A3C7A352A /* XCScheme+StoreKitConfigurationFileReference.swift in Sources */ = {isa = PBXBuildFile; fileRef = 59D8B63E53C03F46C90D951D /* XCScheme+StoreKitConfigurationFileReference.swift */; }; - 809908EF4E6E71285D110707 /* PBXNativeTarget.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2BD1A6E5AC6502EDE59541C8 /* PBXNativeTarget.swift */; }; - 8242B39EB786ADA4A8B32EF3 /* XCBuildConfiguration.swift in Sources */ = {isa = PBXBuildFile; fileRef = D07BF1A8B705E35271076BA1 /* XCBuildConfiguration.swift */; }; - 84C672F79741BBA0937580EA /* Sourcery.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3A33AF969BDFF0250420A5E8 /* Sourcery.swift */; }; - 8EE72814658F0A23A01AD1E6 /* XCBreakpointList.swift in Sources */ = {isa = PBXBuildFile; fileRef = CC0BF3D061052148207584A5 /* XCBreakpointList.swift */; }; - 903A9EC1B895A4920A322898 /* XCScheme+ArchiveAction.swift in Sources */ = {isa = PBXBuildFile; fileRef = 66F7E3085922F586144F562A /* XCScheme+ArchiveAction.swift */; }; - 9D3FF6643048C116F1881471 /* XCUserData.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5D25A0190B14740F9DDDB98B /* XCUserData.swift */; }; - 9D897705DD334A50C4431887 /* PBXBuildRule.swift in Sources */ = {isa = PBXBuildFile; fileRef = B50CD65FDAA9B3F4269F4AAF /* PBXBuildRule.swift */; }; - 9DBF777FEB60396E520D2595 /* KeyedDecodingContainer+Additions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1ABCF05523B52C542BC48C31 /* KeyedDecodingContainer+Additions.swift */; }; - 9F27802B144AFC7C1A739492 /* PBXObjects.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5CC513CEDABAA9712FB4DC6 /* PBXObjects.swift */; }; - A1476A0B7C8DA244920775F1 /* Dictionary+Enumerate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 568D1BA84A39807930EA26CF /* Dictionary+Enumerate.swift */; }; - A2344E4A960C21715FAD3F86 /* PBXObject.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4E93E589F09F66B673712EAE /* PBXObject.swift */; }; - AB74DA38A17EE261024A711C /* XCScheme+TestAction.swift in Sources */ = {isa = PBXBuildFile; fileRef = 161E967D0979EF34C7DF6348 /* XCScheme+TestAction.swift */; }; - ABE0F9CFD5549F302EB3A417 /* PBXSourceTree.swift in Sources */ = {isa = PBXBuildFile; fileRef = 34A0180EB1FDA8CC7D553950 /* PBXSourceTree.swift */; }; - AC49ED6F358FFBF504A3D0AE /* XCScheme+ExecutionAction.swift in Sources */ = {isa = PBXBuildFile; fileRef = C3FE679A53603AE3FE43462F /* XCScheme+ExecutionAction.swift */; }; - ACC38711B1FD79AED6D63C9D /* PBXHeadersBuildPhase.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0A909937001696EF804CE15C /* PBXHeadersBuildPhase.swift */; }; - AECDFCA5C2DD558AAC48E945 /* NSRecursiveLock+Sync.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3C96888CEF5888DBA6D3136D /* NSRecursiveLock+Sync.swift */; }; - AEF9DAF6D599FAD8B64827C6 /* String+md5.swift in Sources */ = {isa = PBXBuildFile; fileRef = 47E5583E488968962DD4B38D /* String+md5.swift */; }; - B07C3C11C0C5E9123C5D9D15 /* PBXObjectParser.swift in Sources */ = {isa = PBXBuildFile; fileRef = AAE4FB9142BF91F6E449998C /* PBXObjectParser.swift */; }; - B7703E87F0E986D0BECC6C92 /* PBXResourcesBuildPhase.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8485AE4255BB935C7B7FE93C /* PBXResourcesBuildPhase.swift */; }; - B972348A969282D604A5C325 /* XCScheme+Runnable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1D5C2732048660AC71431D9C /* XCScheme+Runnable.swift */; }; - BBA09A7C8D3D9697C10F300B /* PBXLegacyTarget.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9C46C4D934731EA4A844FD3 /* PBXLegacyTarget.swift */; }; - BD65503EF698EE4EAF11892C /* Path+Extras.swift in Sources */ = {isa = PBXBuildFile; fileRef = EE041A9A60D18302045BA2AE /* Path+Extras.swift */; }; - BD7A3EBFD6C9D1AA78E6E822 /* Decoders.swift in Sources */ = {isa = PBXBuildFile; fileRef = 76F663AC6487521F684ED182 /* Decoders.swift */; }; - BEBC1583A85423F1F1BF3E30 /* XCSharedData.swift in Sources */ = {isa = PBXBuildFile; fileRef = AF73D1E4C0B20C16D61865F6 /* XCSharedData.swift */; }; - BEE9FCB78D7D7F7A0DBF6F73 /* PBXReferenceProxy.swift in Sources */ = {isa = PBXBuildFile; fileRef = 095A027B0DAEF11404E9612F /* PBXReferenceProxy.swift */; }; - C2DB3BAC484E34097E80471E /* XCConfigurationList.swift in Sources */ = {isa = PBXBuildFile; fileRef = 412215420E6CF8CD85C2908C /* XCConfigurationList.swift */; }; - C333BEA47F06D2357DE8B1EA /* Writable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5A4A785AD26E7657312118B9 /* Writable.swift */; }; - C907FC5616048E42925FB93E /* XCWorkspaceDataGroup.swift in Sources */ = {isa = PBXBuildFile; fileRef = F7419D9A4F0B11214441DFA3 /* XCWorkspaceDataGroup.swift */; }; - C95FAEE0675588942633875E /* XCScheme+BuildableReference.swift in Sources */ = {isa = PBXBuildFile; fileRef = DF277186917C67A6FF4993F6 /* XCScheme+BuildableReference.swift */; }; - CE58E51C93B8A19FA4F79E22 /* Xcode.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7DAFF5CC89FBB59D02F72B9 /* Xcode.swift */; }; - D07F87005EA408048A765039 /* XCScheme+BuildableProductRunnable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 39AC139F340CD22E72E37FF3 /* XCScheme+BuildableProductRunnable.swift */; }; - D32D0514F1A4256071EDB1A1 /* XCScheme+AditionalOption.swift in Sources */ = {isa = PBXBuildFile; fileRef = 87054AE28F2715C09767FE77 /* XCScheme+AditionalOption.swift */; }; - D4CDCEFF10BE6E80B9057132 /* PBXOutputSettings.swift in Sources */ = {isa = PBXBuildFile; fileRef = E1325A961D9CCFB45B639868 /* PBXOutputSettings.swift */; }; - D5D82B59980521FBA427EED8 /* XCScheme+TestPlanReference.swift in Sources */ = {isa = PBXBuildFile; fileRef = 87331972540CB510D7E0C333 /* XCScheme+TestPlanReference.swift */; }; - D5DB78ED46F818640BC41A9D /* PBXTargetDependency.swift in Sources */ = {isa = PBXBuildFile; fileRef = DE15F98D3349F2FCED4A913A /* PBXTargetDependency.swift */; }; - DA0ACE91B9EEA6D3BD7170F3 /* PBXVariantGroup.swift in Sources */ = {isa = PBXBuildFile; fileRef = C6F7AC32AFFBEA9741906F2B /* PBXVariantGroup.swift */; }; - DE1F130B4C81A1ABE9DB6DC0 /* ReferenceGenerator.swift in Sources */ = {isa = PBXBuildFile; fileRef = FF9EA2BB676DB8C978248670 /* ReferenceGenerator.swift */; }; - DF37E12A489F0FBFDCF4C7A1 /* XCWorkspaceDataElement.swift in Sources */ = {isa = PBXBuildFile; fileRef = 747281C8826015AE5CE869D8 /* XCWorkspaceDataElement.swift */; }; - DF91D1F6BECD6145A4BEEE7B /* PBXObjectReference.swift in Sources */ = {isa = PBXBuildFile; fileRef = E06554AB0BF2937025BC45C6 /* PBXObjectReference.swift */; }; - E113D0F651A2213459C65387 /* XCScheme.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5D13E332186D46FFA83BBD50 /* XCScheme.swift */; }; - E31DA2A4BF344AC0BB4B1EC8 /* BuildPhase.swift in Sources */ = {isa = PBXBuildFile; fileRef = 72E6494F0E28769F9B11FD30 /* BuildPhase.swift */; }; - E82A4CE0E0E385A2DED27887 /* XcodeProj.swift in Sources */ = {isa = PBXBuildFile; fileRef = F8B667CA83B0BB0285F470F1 /* XcodeProj.swift */; }; - E863D2A025082CB472079D90 /* PBXFileReference.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7A72367B782B23A3759F3A1D /* PBXFileReference.swift */; }; - EC0897B21DBC4594857BAD07 /* XCWorkspaceData.swift in Sources */ = {isa = PBXBuildFile; fileRef = 59F2F50C66ADD5D0C12F3B70 /* XCWorkspaceData.swift */; }; - ED4BFA372B68053D67F0E379 /* WorkspaceSettings.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3353E37D0FBA49BA04C82476 /* WorkspaceSettings.swift */; }; - EE4B80C64D6B7911947345E4 /* XCScheme+TestItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7DFDD2E86D3F0ADE3502A29A /* XCScheme+TestItem.swift */; }; - F48082472D45B18B36F00F09 /* AEXML+XcodeFormat.swift in Sources */ = {isa = PBXBuildFile; fileRef = AB3D1A6857702BDE0C036055 /* AEXML+XcodeFormat.swift */; }; - F6AF8B5725B94DC6136239DF /* PlistValue.swift in Sources */ = {isa = PBXBuildFile; fileRef = CB0549EED6A8FF85CA7FEBC5 /* PlistValue.swift */; }; - FEBD1114F05F3A9667F26CCC /* XCScheme+AnalyzeAction.swift in Sources */ = {isa = PBXBuildFile; fileRef = BFFE462CBB08512CB108E356 /* XCScheme+AnalyzeAction.swift */; }; -/* End PBXBuildFile section */ - -/* Begin PBXCopyFilesBuildPhase section */ - 7FAD067EE084B2EF5EFE4BFF /* Embed Frameworks */ = { - isa = PBXCopyFilesBuildPhase; - buildActionMask = 2147483647; - dstPath = ""; - dstSubfolderSpec = 10; - files = ( - ); - name = "Embed Frameworks"; - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXCopyFilesBuildPhase section */ - -/* Begin PBXFileReference section */ - 08B779835760A818E59969D1 /* PBXBatchUpdater.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PBXBatchUpdater.swift; sourceTree = ""; }; - 095A027B0DAEF11404E9612F /* PBXReferenceProxy.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PBXReferenceProxy.swift; sourceTree = ""; }; - 0A909937001696EF804CE15C /* PBXHeadersBuildPhase.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PBXHeadersBuildPhase.swift; sourceTree = ""; }; - 0AE25C88F5874509586B3AD4 /* XCWorkspaceDataElementLocationType.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = XCWorkspaceDataElementLocationType.swift; sourceTree = ""; }; - 0AE91C6982618C1EDDAAD596 /* XCScheme+TestableReference.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "XCScheme+TestableReference.swift"; sourceTree = ""; }; - 0BFCA27253AECAC6A2EF5E66 /* XCScheme+RemoteRunnable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "XCScheme+RemoteRunnable.swift"; sourceTree = ""; }; - 0C950F23FEF894B133070990 /* AEXML.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = AEXML.framework; sourceTree = ""; }; - 13177CF1296C6C32BF4C5B7C /* PBXBuildFile.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PBXBuildFile.swift; sourceTree = ""; }; - 15DE1D6B3000410D531F05AA /* XCWorkspace.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = XCWorkspace.swift; sourceTree = ""; }; - 161E967D0979EF34C7DF6348 /* XCScheme+TestAction.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "XCScheme+TestAction.swift"; sourceTree = ""; }; - 1977C44246CCF9C13AB856C2 /* BuildSettingsProvider.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BuildSettingsProvider.swift; sourceTree = ""; }; - 19C42E5F8AAD8E3C04E8A9B5 /* PBXCopyFilesBuildPhase.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PBXCopyFilesBuildPhase.swift; sourceTree = ""; }; - 1ABCF05523B52C542BC48C31 /* KeyedDecodingContainer+Additions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "KeyedDecodingContainer+Additions.swift"; sourceTree = ""; }; - 1D5C2732048660AC71431D9C /* XCScheme+Runnable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "XCScheme+Runnable.swift"; sourceTree = ""; }; - 20B1225FED6E1D49EE385AA0 /* XCScheme+EnvironmentVariable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "XCScheme+EnvironmentVariable.swift"; sourceTree = ""; }; - 2370B4E19828CEFC032511A1 /* PBXContainerItemProxy.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PBXContainerItemProxy.swift; sourceTree = ""; }; - 249AAF8AE1978D1546C0ADB5 /* PBXGroup.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PBXGroup.swift; sourceTree = ""; }; - 26A96BC0C027BB173BC23C8D /* XCDebugger.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = XCDebugger.swift; sourceTree = ""; }; - 26EF076F4983A1ABBD3CC81B /* XCScheme+PathRunnable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "XCScheme+PathRunnable.swift"; sourceTree = ""; }; - 2B928006AD1C96D4D8072BD9 /* XCConfig.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = XCConfig.swift; sourceTree = ""; }; - 2BD1A6E5AC6502EDE59541C8 /* PBXNativeTarget.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PBXNativeTarget.swift; sourceTree = ""; }; - 2D9937B44A9FCDD847F79008 /* XCSwiftPackageProductDependency.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = XCSwiftPackageProductDependency.swift; sourceTree = ""; }; - 325DDB80858F8DD8C5C27A07 /* Errors.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Errors.swift; sourceTree = ""; }; - 32F121F70B66AA9787F99BC3 /* PBXTarget.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PBXTarget.swift; sourceTree = ""; }; - 3353E37D0FBA49BA04C82476 /* WorkspaceSettings.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WorkspaceSettings.swift; sourceTree = ""; }; - 34A0180EB1FDA8CC7D553950 /* PBXSourceTree.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PBXSourceTree.swift; sourceTree = ""; }; - 39AC139F340CD22E72E37FF3 /* XCScheme+BuildableProductRunnable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "XCScheme+BuildableProductRunnable.swift"; sourceTree = ""; }; - 39B8CB253365692579B8C8E2 /* XCScheme+LocationScenarioReference.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "XCScheme+LocationScenarioReference.swift"; sourceTree = ""; }; - 39E419CA05304074ADCDACE8 /* XCVersionGroup.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = XCVersionGroup.swift; sourceTree = ""; }; - 3A15BA73673DDD200166C9EC /* PBXProductType.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PBXProductType.swift; sourceTree = ""; }; - 3A33AF969BDFF0250420A5E8 /* Sourcery.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Sourcery.swift; sourceTree = ""; }; - 3BEB2811DE4A8D3EE6DC46B7 /* PBXFrameworksBuildPhase.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PBXFrameworksBuildPhase.swift; sourceTree = ""; }; - 3C96888CEF5888DBA6D3136D /* NSRecursiveLock+Sync.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "NSRecursiveLock+Sync.swift"; sourceTree = ""; }; - 412215420E6CF8CD85C2908C /* XCConfigurationList.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = XCConfigurationList.swift; sourceTree = ""; }; - 41A031713D5F31DDCC2D61EF /* PBXProjEncoder.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PBXProjEncoder.swift; sourceTree = ""; }; - 47E5583E488968962DD4B38D /* String+md5.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "String+md5.swift"; sourceTree = ""; }; - 48D03946AD764A02121872F7 /* Dictionary+Extras.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Dictionary+Extras.swift"; sourceTree = ""; }; - 4E93E589F09F66B673712EAE /* PBXObject.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PBXObject.swift; sourceTree = ""; }; - 4EE77276DEE6859DE961F94D /* XCScheme+LaunchAction.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "XCScheme+LaunchAction.swift"; sourceTree = ""; }; - 51CBC0FF736F69D538FFEC78 /* XCRemoteSwiftPackageReference.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = XCRemoteSwiftPackageReference.swift; sourceTree = ""; }; - 568D1BA84A39807930EA26CF /* Dictionary+Enumerate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Dictionary+Enumerate.swift"; sourceTree = ""; }; - 577B27811EEAD46794E8DE90 /* PBXRezBuildPhase.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PBXRezBuildPhase.swift; sourceTree = ""; }; - 59D8B63E53C03F46C90D951D /* XCScheme+StoreKitConfigurationFileReference.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "XCScheme+StoreKitConfigurationFileReference.swift"; sourceTree = ""; }; - 59F2F50C66ADD5D0C12F3B70 /* XCWorkspaceData.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = XCWorkspaceData.swift; sourceTree = ""; }; - 5A4A785AD26E7657312118B9 /* Writable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Writable.swift; sourceTree = ""; }; - 5D13E332186D46FFA83BBD50 /* XCScheme.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = XCScheme.swift; sourceTree = ""; }; - 5D25A0190B14740F9DDDB98B /* XCUserData.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = XCUserData.swift; sourceTree = ""; }; - 6023B10EB151C2FF48E53395 /* Array+Extras.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Array+Extras.swift"; sourceTree = ""; }; - 60E927F019715C98BA849930 /* PBXBuildPhase.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PBXBuildPhase.swift; sourceTree = ""; }; - 66F7E3085922F586144F562A /* XCScheme+ArchiveAction.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "XCScheme+ArchiveAction.swift"; sourceTree = ""; }; - 683F0C05F5FD6006924AA43C /* CommentedString.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CommentedString.swift; sourceTree = ""; }; - 694034B4B7C9DF231B007A84 /* XCScheme+SerialAction.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "XCScheme+SerialAction.swift"; sourceTree = ""; }; - 69BA327A9CAF3CCFF60AD469 /* XCSchemeManagement.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = XCSchemeManagement.swift; sourceTree = ""; }; - 6A113CBABFAE791D1B9C6BBE /* BuildSettings.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BuildSettings.swift; sourceTree = ""; }; - 6B2C739F39DD3CC1B77E1075 /* PBXProj.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PBXProj.swift; sourceTree = ""; }; - 72E6494F0E28769F9B11FD30 /* BuildPhase.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BuildPhase.swift; sourceTree = ""; }; - 747281C8826015AE5CE869D8 /* XCWorkspaceDataElement.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = XCWorkspaceDataElement.swift; sourceTree = ""; }; - 76F663AC6487521F684ED182 /* Decoders.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Decoders.swift; sourceTree = ""; }; - 7A72367B782B23A3759F3A1D /* PBXFileReference.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PBXFileReference.swift; sourceTree = ""; }; - 7DFDD2E86D3F0ADE3502A29A /* XCScheme+TestItem.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "XCScheme+TestItem.swift"; sourceTree = ""; }; - 8485AE4255BB935C7B7FE93C /* PBXResourcesBuildPhase.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PBXResourcesBuildPhase.swift; sourceTree = ""; }; - 87054AE28F2715C09767FE77 /* XCScheme+AditionalOption.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "XCScheme+AditionalOption.swift"; sourceTree = ""; }; - 87331972540CB510D7E0C333 /* XCScheme+TestPlanReference.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "XCScheme+TestPlanReference.swift"; sourceTree = ""; }; - 88DAB211D02099ECDC268AE2 /* String+Utils.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "String+Utils.swift"; sourceTree = ""; }; - 9144C9BC5E10BE834E6824A1 /* JSONDecoding.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = JSONDecoding.swift; sourceTree = ""; }; - A11172C9DBADEDF3203564B7 /* PBXAggregateTarget.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PBXAggregateTarget.swift; sourceTree = ""; }; - A5CC513CEDABAA9712FB4DC6 /* PBXObjects.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PBXObjects.swift; sourceTree = ""; }; - A7DAFF5CC89FBB59D02F72B9 /* Xcode.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Xcode.swift; sourceTree = ""; }; - A93C80F128CBCDFA4EA63EFB /* PBXProject.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PBXProject.swift; sourceTree = ""; }; - A9C46C4D934731EA4A844FD3 /* PBXLegacyTarget.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PBXLegacyTarget.swift; sourceTree = ""; }; - AA2A4EEFB9DE8F475B051FDE /* PBXContainerItem.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PBXContainerItem.swift; sourceTree = ""; }; - AAE4FB9142BF91F6E449998C /* PBXObjectParser.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PBXObjectParser.swift; sourceTree = ""; }; - AB3D1A6857702BDE0C036055 /* AEXML+XcodeFormat.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "AEXML+XcodeFormat.swift"; sourceTree = ""; }; - AF73D1E4C0B20C16D61865F6 /* XCSharedData.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = XCSharedData.swift; sourceTree = ""; }; - B2E17A977543393ED7B848A9 /* XCScheme+ProfileAction.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "XCScheme+ProfileAction.swift"; sourceTree = ""; }; - B50CD65FDAA9B3F4269F4AAF /* PBXBuildRule.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PBXBuildRule.swift; sourceTree = ""; }; - B837566EDF23D002AC881D07 /* XCScheme+CommandLineArguments.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "XCScheme+CommandLineArguments.swift"; sourceTree = ""; }; - B92DC66EE80F3D7611319ACC /* XCWorkspaceDataFileRef.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = XCWorkspaceDataFileRef.swift; sourceTree = ""; }; - BFFE462CBB08512CB108E356 /* XCScheme+AnalyzeAction.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "XCScheme+AnalyzeAction.swift"; sourceTree = ""; }; - C3FE679A53603AE3FE43462F /* XCScheme+ExecutionAction.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "XCScheme+ExecutionAction.swift"; sourceTree = ""; }; - C6F7AC32AFFBEA9741906F2B /* PBXVariantGroup.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PBXVariantGroup.swift; sourceTree = ""; }; - CB0549EED6A8FF85CA7FEBC5 /* PlistValue.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PlistValue.swift; sourceTree = ""; }; - CC0BF3D061052148207584A5 /* XCBreakpointList.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = XCBreakpointList.swift; sourceTree = ""; }; - CC365B2E771B6E2690D751DB /* PBXSourcesBuildPhase.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PBXSourcesBuildPhase.swift; sourceTree = ""; }; - D07BF1A8B705E35271076BA1 /* XCBuildConfiguration.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = XCBuildConfiguration.swift; sourceTree = ""; }; - D2D78F3ED94EB9E973644780 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist; path = Info.plist; sourceTree = ""; }; - D4AA26E4818BC76E4CB28CEB /* PBXFileElement.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PBXFileElement.swift; sourceTree = ""; }; - DE15F98D3349F2FCED4A913A /* PBXTargetDependency.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PBXTargetDependency.swift; sourceTree = ""; }; - DF277186917C67A6FF4993F6 /* XCScheme+BuildableReference.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "XCScheme+BuildableReference.swift"; sourceTree = ""; }; - E06554AB0BF2937025BC45C6 /* PBXObjectReference.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PBXObjectReference.swift; sourceTree = ""; }; - E1325A961D9CCFB45B639868 /* PBXOutputSettings.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PBXOutputSettings.swift; sourceTree = ""; }; - E23B1EFAE9DC6596E4EA4BCD /* Bool+Extras.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Bool+Extras.swift"; sourceTree = ""; }; - E525B9A065757F329F0E4002 /* XCScheme+BuildAction.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "XCScheme+BuildAction.swift"; sourceTree = ""; }; - E639EC9D100AFD2CEAEE82E0 /* Equality.generated.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Equality.generated.swift; sourceTree = ""; }; - E63AB43AF9F4C4F938680EA9 /* XcodeProj.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = XcodeProj.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - EE041A9A60D18302045BA2AE /* Path+Extras.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Path+Extras.swift"; sourceTree = ""; }; - F7419D9A4F0B11214441DFA3 /* XCWorkspaceDataGroup.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = XCWorkspaceDataGroup.swift; sourceTree = ""; }; - F89DAD13D5505D59F10D0C9F /* PathKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = PathKit.framework; sourceTree = ""; }; - F8B667CA83B0BB0285F470F1 /* XcodeProj.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = XcodeProj.swift; sourceTree = ""; }; - FC12E1A11D67971AEC27AA12 /* PBXShellScriptBuildPhase.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PBXShellScriptBuildPhase.swift; sourceTree = ""; }; - FF9EA2BB676DB8C978248670 /* ReferenceGenerator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReferenceGenerator.swift; sourceTree = ""; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - ECC1E0A3315EECC3AF534E1B /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 1ADDD97C53AEC0990F693CDA /* AEXML.framework in Frameworks */, - 5A9C450597EC43859570B863 /* PathKit.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 0CD2DD5DADB19C09C88643D9 /* XcodeProj */ = { - isa = PBXGroup; - children = ( - 3F46E1251C6FA94B4422C839 /* Errors */, - 14D604A8346D8605E2CCE6AF /* Extensions */, - D282D20607C553BCACED0FF1 /* Objects */, - 9BE2FF13BAF4C1BEA7C47C73 /* Project */, - 0D370649A1842C31CDEAE9A6 /* Protocols */, - 3DB2726F254A120563894AF8 /* Scheme */, - 0EB3E92970501B73F90EACC6 /* Utils */, - 5481114562D03AFF284A4D4B /* Workspace */, - ); - path = XcodeProj; - sourceTree = ""; - }; - 0D370649A1842C31CDEAE9A6 /* Protocols */ = { - isa = PBXGroup; - children = ( - 5A4A785AD26E7657312118B9 /* Writable.swift */, - ); - path = Protocols; - sourceTree = ""; - }; - 0E4511E9D37FE834D40A107C /* SwiftPackage */ = { - isa = PBXGroup; - children = ( - 51CBC0FF736F69D538FFEC78 /* XCRemoteSwiftPackageReference.swift */, - 2D9937B44A9FCDD847F79008 /* XCSwiftPackageProductDependency.swift */, - ); - path = SwiftPackage; - sourceTree = ""; - }; - 0EB3E92970501B73F90EACC6 /* Utils */ = { - isa = PBXGroup; - children = ( - 1977C44246CCF9C13AB856C2 /* BuildSettingsProvider.swift */, - 683F0C05F5FD6006924AA43C /* CommentedString.swift */, - 76F663AC6487521F684ED182 /* Decoders.swift */, - 9144C9BC5E10BE834E6824A1 /* JSONDecoding.swift */, - 08B779835760A818E59969D1 /* PBXBatchUpdater.swift */, - CB0549EED6A8FF85CA7FEBC5 /* PlistValue.swift */, - FF9EA2BB676DB8C978248670 /* ReferenceGenerator.swift */, - 2B928006AD1C96D4D8072BD9 /* XCConfig.swift */, - ); - path = Utils; - sourceTree = ""; - }; - 14D604A8346D8605E2CCE6AF /* Extensions */ = { - isa = PBXGroup; - children = ( - AB3D1A6857702BDE0C036055 /* AEXML+XcodeFormat.swift */, - 6023B10EB151C2FF48E53395 /* Array+Extras.swift */, - E23B1EFAE9DC6596E4EA4BCD /* Bool+Extras.swift */, - 568D1BA84A39807930EA26CF /* Dictionary+Enumerate.swift */, - 48D03946AD764A02121872F7 /* Dictionary+Extras.swift */, - 1ABCF05523B52C542BC48C31 /* KeyedDecodingContainer+Additions.swift */, - 3C96888CEF5888DBA6D3136D /* NSRecursiveLock+Sync.swift */, - EE041A9A60D18302045BA2AE /* Path+Extras.swift */, - 47E5583E488968962DD4B38D /* String+md5.swift */, - 88DAB211D02099ECDC268AE2 /* String+Utils.swift */, - ); - path = Extensions; - sourceTree = ""; - }; - 1E404A60E69E892516E32929 /* Targets */ = { - isa = PBXGroup; - children = ( - A11172C9DBADEDF3203564B7 /* PBXAggregateTarget.swift */, - A9C46C4D934731EA4A844FD3 /* PBXLegacyTarget.swift */, - 2BD1A6E5AC6502EDE59541C8 /* PBXNativeTarget.swift */, - 3A15BA73673DDD200166C9EC /* PBXProductType.swift */, - 095A027B0DAEF11404E9612F /* PBXReferenceProxy.swift */, - 32F121F70B66AA9787F99BC3 /* PBXTarget.swift */, - DE15F98D3349F2FCED4A913A /* PBXTargetDependency.swift */, - ); - path = Targets; - sourceTree = ""; - }; - 25C374C70C6324F44964CA1A /* Products */ = { - isa = PBXGroup; - children = ( - E63AB43AF9F4C4F938680EA9 /* XcodeProj.framework */, - ); - name = Products; - sourceTree = ""; - }; - 3A8CD2E0DBF7926CA8099221 /* Mac */ = { - isa = PBXGroup; - children = ( - 0C950F23FEF894B133070990 /* AEXML.framework */, - F89DAD13D5505D59F10D0C9F /* PathKit.framework */, - ); - path = Mac; - sourceTree = ""; - }; - 3DB2726F254A120563894AF8 /* Scheme */ = { - isa = PBXGroup; - children = ( - 5D13E332186D46FFA83BBD50 /* XCScheme.swift */, - 87054AE28F2715C09767FE77 /* XCScheme+AditionalOption.swift */, - BFFE462CBB08512CB108E356 /* XCScheme+AnalyzeAction.swift */, - 66F7E3085922F586144F562A /* XCScheme+ArchiveAction.swift */, - 39AC139F340CD22E72E37FF3 /* XCScheme+BuildableProductRunnable.swift */, - DF277186917C67A6FF4993F6 /* XCScheme+BuildableReference.swift */, - E525B9A065757F329F0E4002 /* XCScheme+BuildAction.swift */, - B837566EDF23D002AC881D07 /* XCScheme+CommandLineArguments.swift */, - 20B1225FED6E1D49EE385AA0 /* XCScheme+EnvironmentVariable.swift */, - C3FE679A53603AE3FE43462F /* XCScheme+ExecutionAction.swift */, - 4EE77276DEE6859DE961F94D /* XCScheme+LaunchAction.swift */, - 39B8CB253365692579B8C8E2 /* XCScheme+LocationScenarioReference.swift */, - 26EF076F4983A1ABBD3CC81B /* XCScheme+PathRunnable.swift */, - B2E17A977543393ED7B848A9 /* XCScheme+ProfileAction.swift */, - 0BFCA27253AECAC6A2EF5E66 /* XCScheme+RemoteRunnable.swift */, - 1D5C2732048660AC71431D9C /* XCScheme+Runnable.swift */, - 694034B4B7C9DF231B007A84 /* XCScheme+SerialAction.swift */, - 59D8B63E53C03F46C90D951D /* XCScheme+StoreKitConfigurationFileReference.swift */, - 0AE91C6982618C1EDDAAD596 /* XCScheme+TestableReference.swift */, - 161E967D0979EF34C7DF6348 /* XCScheme+TestAction.swift */, - 7DFDD2E86D3F0ADE3502A29A /* XCScheme+TestItem.swift */, - 87331972540CB510D7E0C333 /* XCScheme+TestPlanReference.swift */, - 69BA327A9CAF3CCFF60AD469 /* XCSchemeManagement.swift */, - ); - path = Scheme; - sourceTree = ""; - }; - 3F46E1251C6FA94B4422C839 /* Errors */ = { - isa = PBXGroup; - children = ( - 325DDB80858F8DD8C5C27A07 /* Errors.swift */, - ); - path = Errors; - sourceTree = ""; - }; - 5481114562D03AFF284A4D4B /* Workspace */ = { - isa = PBXGroup; - children = ( - 15DE1D6B3000410D531F05AA /* XCWorkspace.swift */, - 59F2F50C66ADD5D0C12F3B70 /* XCWorkspaceData.swift */, - 747281C8826015AE5CE869D8 /* XCWorkspaceDataElement.swift */, - 0AE25C88F5874509586B3AD4 /* XCWorkspaceDataElementLocationType.swift */, - B92DC66EE80F3D7611319ACC /* XCWorkspaceDataFileRef.swift */, - F7419D9A4F0B11214441DFA3 /* XCWorkspaceDataGroup.swift */, - ); - path = Workspace; - sourceTree = ""; - }; - 75B1DAE9A58776B613C0505F /* Configuration */ = { - isa = PBXGroup; - children = ( - 6A113CBABFAE791D1B9C6BBE /* BuildSettings.swift */, - D07BF1A8B705E35271076BA1 /* XCBuildConfiguration.swift */, - 412215420E6CF8CD85C2908C /* XCConfigurationList.swift */, - ); - path = Configuration; - sourceTree = ""; - }; - 791C387E48AEA6D5F75AC47F = { - isa = PBXGroup; - children = ( - 80D59D67CEEE76EA108CFAAB /* Project */, - ECC157E4B43A303EC5B7C202 /* Frameworks */, - 25C374C70C6324F44964CA1A /* Products */, - ); - sourceTree = ""; - }; - 7EDBBC6ACE86FC676ABA8907 /* Build */ = { - isa = PBXGroup; - children = ( - 3A8CD2E0DBF7926CA8099221 /* Mac */, - ); - path = Build; - sourceTree = ""; - }; - 8036291DDCEF10624F3285CD /* Sourcery */ = { - isa = PBXGroup; - children = ( - E639EC9D100AFD2CEAEE82E0 /* Equality.generated.swift */, - 3A33AF969BDFF0250420A5E8 /* Sourcery.swift */, - ); - path = Sourcery; - sourceTree = ""; - }; - 80D59D67CEEE76EA108CFAAB /* Project */ = { - isa = PBXGroup; - children = ( - 844A2C8AF87F23D7DE2CD3AB /* Carthage */, - BA1E76638FEE70CBAD8B9592 /* Sources */, - D2D78F3ED94EB9E973644780 /* Info.plist */, - ); - name = Project; - sourceTree = ""; - }; - 844A2C8AF87F23D7DE2CD3AB /* Carthage */ = { - isa = PBXGroup; - children = ( - 7EDBBC6ACE86FC676ABA8907 /* Build */, - ); - path = Carthage; - sourceTree = ""; - }; - 8D7B131E2371306262CF7D29 /* Files */ = { - isa = PBXGroup; - children = ( - AA2A4EEFB9DE8F475B051FDE /* PBXContainerItem.swift */, - 2370B4E19828CEFC032511A1 /* PBXContainerItemProxy.swift */, - D4AA26E4818BC76E4CB28CEB /* PBXFileElement.swift */, - 7A72367B782B23A3759F3A1D /* PBXFileReference.swift */, - 249AAF8AE1978D1546C0ADB5 /* PBXGroup.swift */, - 34A0180EB1FDA8CC7D553950 /* PBXSourceTree.swift */, - C6F7AC32AFFBEA9741906F2B /* PBXVariantGroup.swift */, - 39E419CA05304074ADCDACE8 /* XCVersionGroup.swift */, - ); - path = Files; - sourceTree = ""; - }; - 9BE2FF13BAF4C1BEA7C47C73 /* Project */ = { - isa = PBXGroup; - children = ( - 3353E37D0FBA49BA04C82476 /* WorkspaceSettings.swift */, - CC0BF3D061052148207584A5 /* XCBreakpointList.swift */, - 26A96BC0C027BB173BC23C8D /* XCDebugger.swift */, - A7DAFF5CC89FBB59D02F72B9 /* Xcode.swift */, - F8B667CA83B0BB0285F470F1 /* XcodeProj.swift */, - AF73D1E4C0B20C16D61865F6 /* XCSharedData.swift */, - 5D25A0190B14740F9DDDB98B /* XCUserData.swift */, - ); - path = Project; - sourceTree = ""; - }; - BA1E76638FEE70CBAD8B9592 /* Sources */ = { - isa = PBXGroup; - children = ( - 0CD2DD5DADB19C09C88643D9 /* XcodeProj */, - ); - path = Sources; - sourceTree = ""; - }; - D282D20607C553BCACED0FF1 /* Objects */ = { - isa = PBXGroup; - children = ( - F1CB61748771C9E402969232 /* BuildPhase */, - 75B1DAE9A58776B613C0505F /* Configuration */, - 8D7B131E2371306262CF7D29 /* Files */, - FBA38FBC1A539330B4F10351 /* Project */, - 8036291DDCEF10624F3285CD /* Sourcery */, - 0E4511E9D37FE834D40A107C /* SwiftPackage */, - 1E404A60E69E892516E32929 /* Targets */, - ); - path = Objects; - sourceTree = ""; - }; - ECC157E4B43A303EC5B7C202 /* Frameworks */ = { - isa = PBXGroup; - children = ( - ); - name = Frameworks; - sourceTree = ""; - }; - F1CB61748771C9E402969232 /* BuildPhase */ = { - isa = PBXGroup; - children = ( - 72E6494F0E28769F9B11FD30 /* BuildPhase.swift */, - 13177CF1296C6C32BF4C5B7C /* PBXBuildFile.swift */, - 60E927F019715C98BA849930 /* PBXBuildPhase.swift */, - B50CD65FDAA9B3F4269F4AAF /* PBXBuildRule.swift */, - 19C42E5F8AAD8E3C04E8A9B5 /* PBXCopyFilesBuildPhase.swift */, - 3BEB2811DE4A8D3EE6DC46B7 /* PBXFrameworksBuildPhase.swift */, - 0A909937001696EF804CE15C /* PBXHeadersBuildPhase.swift */, - 8485AE4255BB935C7B7FE93C /* PBXResourcesBuildPhase.swift */, - 577B27811EEAD46794E8DE90 /* PBXRezBuildPhase.swift */, - FC12E1A11D67971AEC27AA12 /* PBXShellScriptBuildPhase.swift */, - CC365B2E771B6E2690D751DB /* PBXSourcesBuildPhase.swift */, - ); - path = BuildPhase; - sourceTree = ""; - }; - FBA38FBC1A539330B4F10351 /* Project */ = { - isa = PBXGroup; - children = ( - 4E93E589F09F66B673712EAE /* PBXObject.swift */, - AAE4FB9142BF91F6E449998C /* PBXObjectParser.swift */, - E06554AB0BF2937025BC45C6 /* PBXObjectReference.swift */, - A5CC513CEDABAA9712FB4DC6 /* PBXObjects.swift */, - E1325A961D9CCFB45B639868 /* PBXOutputSettings.swift */, - 6B2C739F39DD3CC1B77E1075 /* PBXProj.swift */, - A93C80F128CBCDFA4EA63EFB /* PBXProject.swift */, - 41A031713D5F31DDCC2D61EF /* PBXProjEncoder.swift */, - ); - path = Project; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - A44FAD6035FC8C5CF9618B92 /* XcodeProj */ = { - isa = PBXNativeTarget; - buildConfigurationList = 0F14FE388CA9F84B0EA8D7E6 /* Build configuration list for PBXNativeTarget "XcodeProj" */; - buildPhases = ( - 65398CA885D62783C577D0FA /* Sources */, - 987C550AD2D049BE77E633BD /* Resources */, - 7FAD067EE084B2EF5EFE4BFF /* Embed Frameworks */, - ECC1E0A3315EECC3AF534E1B /* Frameworks */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = XcodeProj; - productName = XcodeProj; - productReference = E63AB43AF9F4C4F938680EA9 /* XcodeProj.framework */; - productType = "com.apple.product-type.framework"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - 223DB5C7FA35E8FD593C4040 /* Project object */ = { - isa = PBXProject; - attributes = { - TargetAttributes = { - }; - }; - buildConfigurationList = 477F800A701B31C60A80EACC /* Build configuration list for PBXProject "XcodeProj_Carthage" */; - compatibilityVersion = "Xcode 13.0"; - developmentRegion = en; - hasScannedForEncodings = 0; - knownRegions = ( - Base, - en, - ); - mainGroup = 791C387E48AEA6D5F75AC47F; - productRefGroup = 25C374C70C6324F44964CA1A /* Products */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - A44FAD6035FC8C5CF9618B92 /* XcodeProj */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXResourcesBuildPhase section */ - 987C550AD2D049BE77E633BD /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXResourcesBuildPhase section */ - -/* Begin PBXSourcesBuildPhase section */ - 65398CA885D62783C577D0FA /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 6619158CCA6E2D05A39860B8 /* Errors.swift in Sources */, - F48082472D45B18B36F00F09 /* AEXML+XcodeFormat.swift in Sources */, - 7DF42666456E27C51CC672C1 /* Array+Extras.swift in Sources */, - 4C5079131989ADE80FF17EFF /* Bool+Extras.swift in Sources */, - A1476A0B7C8DA244920775F1 /* Dictionary+Enumerate.swift in Sources */, - 1009BFBC8BD95556803FF2C9 /* Dictionary+Extras.swift in Sources */, - 9DBF777FEB60396E520D2595 /* KeyedDecodingContainer+Additions.swift in Sources */, - AECDFCA5C2DD558AAC48E945 /* NSRecursiveLock+Sync.swift in Sources */, - BD65503EF698EE4EAF11892C /* Path+Extras.swift in Sources */, - 64DB0043086F77457C7B223D /* String+Utils.swift in Sources */, - AEF9DAF6D599FAD8B64827C6 /* String+md5.swift in Sources */, - E31DA2A4BF344AC0BB4B1EC8 /* BuildPhase.swift in Sources */, - 13CBB83040E0B373CE80CB16 /* PBXBuildFile.swift in Sources */, - 7823F76B43696121C7401C35 /* PBXBuildPhase.swift in Sources */, - 9D897705DD334A50C4431887 /* PBXBuildRule.swift in Sources */, - 03FCD0C75E642B6E50DE9095 /* PBXCopyFilesBuildPhase.swift in Sources */, - 6AA90F1144C42F9275124B0F /* PBXFrameworksBuildPhase.swift in Sources */, - ACC38711B1FD79AED6D63C9D /* PBXHeadersBuildPhase.swift in Sources */, - B7703E87F0E986D0BECC6C92 /* PBXResourcesBuildPhase.swift in Sources */, - 6BCC38DC97A295B5179C0565 /* PBXRezBuildPhase.swift in Sources */, - 73E2CEC84B1EE4E25AF9030C /* PBXShellScriptBuildPhase.swift in Sources */, - 7CDAEBA81467E39CBAD2E6CF /* PBXSourcesBuildPhase.swift in Sources */, - 4F427C99A47227F5592A1522 /* BuildSettings.swift in Sources */, - 8242B39EB786ADA4A8B32EF3 /* XCBuildConfiguration.swift in Sources */, - C2DB3BAC484E34097E80471E /* XCConfigurationList.swift in Sources */, - 586BB941B8D71312F85033A1 /* PBXContainerItem.swift in Sources */, - 61FFC23B7055683822148DDE /* PBXContainerItemProxy.swift in Sources */, - 2B2D208723F7AE79632BAEAE /* PBXFileElement.swift in Sources */, - E863D2A025082CB472079D90 /* PBXFileReference.swift in Sources */, - 3A59F800668B0D6F550B9C09 /* PBXGroup.swift in Sources */, - ABE0F9CFD5549F302EB3A417 /* PBXSourceTree.swift in Sources */, - DA0ACE91B9EEA6D3BD7170F3 /* PBXVariantGroup.swift in Sources */, - 4716E044E5786AC68205911A /* XCVersionGroup.swift in Sources */, - A2344E4A960C21715FAD3F86 /* PBXObject.swift in Sources */, - B07C3C11C0C5E9123C5D9D15 /* PBXObjectParser.swift in Sources */, - DF91D1F6BECD6145A4BEEE7B /* PBXObjectReference.swift in Sources */, - 9F27802B144AFC7C1A739492 /* PBXObjects.swift in Sources */, - D4CDCEFF10BE6E80B9057132 /* PBXOutputSettings.swift in Sources */, - 74A56CC842A9E89D622A49A0 /* PBXProj.swift in Sources */, - 3D5DBC9A4315D97D1B39CF19 /* PBXProjEncoder.swift in Sources */, - 2BC374D574269FB75F978D6F /* PBXProject.swift in Sources */, - 625CFEF76B6D5B02D3A1CEC6 /* Equality.generated.swift in Sources */, - 84C672F79741BBA0937580EA /* Sourcery.swift in Sources */, - 792583786825191D2E186E9D /* XCRemoteSwiftPackageReference.swift in Sources */, - 1C99B6399AB8732EA97B1EEC /* XCSwiftPackageProductDependency.swift in Sources */, - 0C6F7F2EF3EE9D97F081D9FD /* PBXAggregateTarget.swift in Sources */, - BBA09A7C8D3D9697C10F300B /* PBXLegacyTarget.swift in Sources */, - 809908EF4E6E71285D110707 /* PBXNativeTarget.swift in Sources */, - 062694C004A53F24E7A92B85 /* PBXProductType.swift in Sources */, - BEE9FCB78D7D7F7A0DBF6F73 /* PBXReferenceProxy.swift in Sources */, - 65476234B5AA54D4EB33FEA7 /* PBXTarget.swift in Sources */, - D5DB78ED46F818640BC41A9D /* PBXTargetDependency.swift in Sources */, - ED4BFA372B68053D67F0E379 /* WorkspaceSettings.swift in Sources */, - 8EE72814658F0A23A01AD1E6 /* XCBreakpointList.swift in Sources */, - 3AF2A0A0965EB5EC74923244 /* XCDebugger.swift in Sources */, - BEBC1583A85423F1F1BF3E30 /* XCSharedData.swift in Sources */, - 9D3FF6643048C116F1881471 /* XCUserData.swift in Sources */, - CE58E51C93B8A19FA4F79E22 /* Xcode.swift in Sources */, - E82A4CE0E0E385A2DED27887 /* XcodeProj.swift in Sources */, - C333BEA47F06D2357DE8B1EA /* Writable.swift in Sources */, - D32D0514F1A4256071EDB1A1 /* XCScheme+AditionalOption.swift in Sources */, - FEBD1114F05F3A9667F26CCC /* XCScheme+AnalyzeAction.swift in Sources */, - 903A9EC1B895A4920A322898 /* XCScheme+ArchiveAction.swift in Sources */, - 46A5D9862729AC0C6D85D4FB /* XCScheme+BuildAction.swift in Sources */, - D07F87005EA408048A765039 /* XCScheme+BuildableProductRunnable.swift in Sources */, - C95FAEE0675588942633875E /* XCScheme+BuildableReference.swift in Sources */, - 735E1C6466FF56969767BAA0 /* XCScheme+CommandLineArguments.swift in Sources */, - 7C3555C09B170AEA2D56E8F2 /* XCScheme+EnvironmentVariable.swift in Sources */, - AC49ED6F358FFBF504A3D0AE /* XCScheme+ExecutionAction.swift in Sources */, - 147157016720CE9BC5943AF2 /* XCScheme+LaunchAction.swift in Sources */, - 69CBD38E1B96198049A02795 /* XCScheme+LocationScenarioReference.swift in Sources */, - 1270ABC0B6133C84F57A8D3F /* XCScheme+PathRunnable.swift in Sources */, - 364C132E6ABF980BF9E84649 /* XCScheme+ProfileAction.swift in Sources */, - 209B0AC5FFCE800A35624C49 /* XCScheme+RemoteRunnable.swift in Sources */, - B972348A969282D604A5C325 /* XCScheme+Runnable.swift in Sources */, - 53CE6B2F74AB5FAA69D58923 /* XCScheme+SerialAction.swift in Sources */, - 80988B37A199C50A3C7A352A /* XCScheme+StoreKitConfigurationFileReference.swift in Sources */, - AB74DA38A17EE261024A711C /* XCScheme+TestAction.swift in Sources */, - EE4B80C64D6B7911947345E4 /* XCScheme+TestItem.swift in Sources */, - D5D82B59980521FBA427EED8 /* XCScheme+TestPlanReference.swift in Sources */, - 0390AF375B465D1DC7AB6194 /* XCScheme+TestableReference.swift in Sources */, - E113D0F651A2213459C65387 /* XCScheme.swift in Sources */, - 468F48B3D19F3D1611181A2E /* XCSchemeManagement.swift in Sources */, - 3E2EE77196F6B2BECE8DF3DB /* BuildSettingsProvider.swift in Sources */, - 4E9B74BA2A6381FEDEA26092 /* CommentedString.swift in Sources */, - BD7A3EBFD6C9D1AA78E6E822 /* Decoders.swift in Sources */, - 7F9ED031DE6A06055F44C2E2 /* JSONDecoding.swift in Sources */, - 23A0E815358EB2D937F40513 /* PBXBatchUpdater.swift in Sources */, - F6AF8B5725B94DC6136239DF /* PlistValue.swift in Sources */, - DE1F130B4C81A1ABE9DB6DC0 /* ReferenceGenerator.swift in Sources */, - 0B364FCF8F7A557C252929EA /* XCConfig.swift in Sources */, - 730CEE3BF13DFC6608790F33 /* XCWorkspace.swift in Sources */, - EC0897B21DBC4594857BAD07 /* XCWorkspaceData.swift in Sources */, - DF37E12A489F0FBFDCF4C7A1 /* XCWorkspaceDataElement.swift in Sources */, - 494EF8FD09FAEE56F6ACF3BE /* XCWorkspaceDataElementLocationType.swift in Sources */, - 33C049021FCA541192F40AD1 /* XCWorkspaceDataFileRef.swift in Sources */, - C907FC5616048E42925FB93E /* XCWorkspaceDataGroup.swift in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin XCBuildConfiguration section */ - 33295D1BD7296777883C7019 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - CODE_SIGN_IDENTITY = ""; - COMBINE_HIDPI_IMAGES = YES; - CURRENT_PROJECT_VERSION = 1; - DEFINES_MODULE = YES; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - DYLIB_INSTALL_NAME_BASE = "@rpath"; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "$(SRCROOT)/Carthage/Build/Mac", - ); - FRAMEWORK_VERSION = A; - INFOPLIST_FILE = Info.plist; - INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/../Frameworks", - "@loader_path/../Frameworks", - ); - PRODUCT_BUNDLE_IDENTIFIER = io.tuist.XcodeProj; - PRODUCT_NAME = XcodeProj; - SDKROOT = macosx; - SKIP_INSTALL = YES; - SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; - SWIFT_COMPILATION_MODE = singlefile; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 5.0; - VERSIONING_SYSTEM = "apple-generic"; - VERSION_INFO_PREFIX = ""; - }; - name = Debug; - }; - 731F89D8DD1568204C64A902 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; - CLANG_ANALYZER_NONNULL = YES; - CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_ENABLE_OBJC_WEAK = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_DOCUMENTATION_COMMENTS = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - COPY_PHASE_STRIP = NO; - DEAD_CODE_STRIPPING = YES; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_NS_ASSERTIONS = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_C_LANGUAGE_STANDARD = gnu11; - GCC_NO_COMMON_BLOCKS = YES; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - MTL_ENABLE_DEBUG_INFO = NO; - PRODUCT_NAME = "$(TARGET_NAME)"; - VALIDATE_PRODUCT = YES; - }; - name = Release; - }; - 87A4E737EC3E625DEC8CDEC0 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; - CLANG_ANALYZER_NONNULL = YES; - CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_ENABLE_OBJC_WEAK = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_DOCUMENTATION_COMMENTS = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - COPY_PHASE_STRIP = NO; - DEAD_CODE_STRIPPING = YES; - DEBUG_INFORMATION_FORMAT = dwarf; - ENABLE_STRICT_OBJC_MSGSEND = YES; - ENABLE_TESTABILITY = YES; - GCC_C_LANGUAGE_STANDARD = gnu11; - GCC_DYNAMIC_NO_PIC = NO; - GCC_NO_COMMON_BLOCKS = YES; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - MTL_ENABLE_DEBUG_INFO = YES; - ONLY_ACTIVE_ARCH = YES; - PRODUCT_NAME = "$(TARGET_NAME)"; - }; - name = Debug; - }; - D5796A15286EF9ADD0F090D4 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - CODE_SIGN_IDENTITY = ""; - COMBINE_HIDPI_IMAGES = YES; - CURRENT_PROJECT_VERSION = 1; - DEFINES_MODULE = YES; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - DYLIB_INSTALL_NAME_BASE = "@rpath"; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "$(SRCROOT)/Carthage/Build/Mac", - ); - FRAMEWORK_VERSION = A; - INFOPLIST_FILE = Info.plist; - INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/../Frameworks", - "@loader_path/../Frameworks", - ); - PRODUCT_BUNDLE_IDENTIFIER = io.tuist.XcodeProj; - PRODUCT_NAME = XcodeProj; - SDKROOT = macosx; - SKIP_INSTALL = YES; - SWIFT_COMPILATION_MODE = wholemodule; - SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; - SWIFT_VERSION = 5.0; - VERSIONING_SYSTEM = "apple-generic"; - VERSION_INFO_PREFIX = ""; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - 0F14FE388CA9F84B0EA8D7E6 /* Build configuration list for PBXNativeTarget "XcodeProj" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 33295D1BD7296777883C7019 /* Debug */, - D5796A15286EF9ADD0F090D4 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 477F800A701B31C60A80EACC /* Build configuration list for PBXProject "XcodeProj_Carthage" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 87A4E737EC3E625DEC8CDEC0 /* Debug */, - 731F89D8DD1568204C64A902 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = 223DB5C7FA35E8FD593C4040 /* Project object */; -} diff --git a/XcodeProj_Carthage.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/XcodeProj_Carthage.xcodeproj/project.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index 919434a62..000000000 --- a/XcodeProj_Carthage.xcodeproj/project.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/XcodeProj_Carthage.xcodeproj/xcshareddata/xcschemes/XcodeProj.xcscheme b/XcodeProj_Carthage.xcodeproj/xcshareddata/xcschemes/XcodeProj.xcscheme deleted file mode 100644 index 876464d1f..000000000 --- a/XcodeProj_Carthage.xcodeproj/xcshareddata/xcschemes/XcodeProj.xcscheme +++ /dev/null @@ -1,77 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/XcodeProj_Carthage.xcworkspace/.tuist-generated b/XcodeProj_Carthage.xcworkspace/.tuist-generated deleted file mode 100644 index e69de29bb..000000000 diff --git a/XcodeProj_Carthage.xcworkspace/contents.xcworkspacedata b/XcodeProj_Carthage.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index fefc83e8a..000000000 --- a/XcodeProj_Carthage.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/XcodeProj_Carthage.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/XcodeProj_Carthage.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist deleted file mode 100644 index 18d981003..000000000 --- a/XcodeProj_Carthage.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +++ /dev/null @@ -1,8 +0,0 @@ - - - - - IDEDidComputeMac32BitWarning - - - diff --git a/XcodeProj_Carthage.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/XcodeProj_Carthage.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings deleted file mode 100644 index 08de0be8d..000000000 --- a/XcodeProj_Carthage.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings +++ /dev/null @@ -1,8 +0,0 @@ - - - - - IDEWorkspaceSharedSettings_AutocreateContextsIfNeeded - - - diff --git a/XcodeProj_Carthage.xcworkspace/xcshareddata/xcschemes/XcodeProj_Carthage-Workspace.xcscheme b/XcodeProj_Carthage.xcworkspace/xcshareddata/xcschemes/XcodeProj_Carthage-Workspace.xcscheme deleted file mode 100644 index 066eafdeb..000000000 --- a/XcodeProj_Carthage.xcworkspace/xcshareddata/xcschemes/XcodeProj_Carthage-Workspace.xcscheme +++ /dev/null @@ -1,76 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - From e468fe4c62bf39c2181ffe927e33f9adcbc85a0c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20Pi=C3=B1era?= Date: Mon, 26 Jun 2023 19:17:42 +0200 Subject: [PATCH 271/678] Remove Carthage steps from the RELEASE.md --- RELEASE.md | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/RELEASE.md b/RELEASE.md index e34f3534f..344fd1f18 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -7,7 +7,6 @@ In this document you'll find all the necessary steps to release a new version of 3. Add the version section to the `CHANGELOG.md`, update the versions in the `README.md` and the `xcodeproj.podspec` file. 4. Commit the changes and tag them `git commit -m "Version x.y.z"` & `git tag x.y.z`. 5. Push the changes `git push origin main --tags` -7. Generate the project by running `tuist generate`. -8. Run the release checks by running `bundle exec rake release_check`. -9. Publish a new version of the Pod by running `bundle exec pod trunk push --allow-warnings --verbose`. -11. Create the release on GitHub including the release notes from the `CHANGELOG.md`. +6. Run the release checks by running `bundle exec rake release_check`. +7. Publish a new version of the Pod by running `bundle exec pod trunk push --allow-warnings --verbose`. +8. Create the release on GitHub including the release notes from the `CHANGELOG.md`. From fd700015c182f72e914cba9d4c698d2cd7a116fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20Pi=C3=B1era?= Date: Mon, 26 Jun 2023 19:21:07 +0200 Subject: [PATCH 272/678] Bump xcodeproj.podspec macOS deployment target to 10.13 --- CHANGELOG.md | 1 + xcodeproj.podspec | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3f33a0c84..626348ac6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ ### Changed - [PathKit](https://github.com/kylef/PathKit) version to [1.0.1](https://github.com/kylef/PathKit/blob/HEAD/CHANGELOG.md#%E2%80%8B101-2021-09-22). +- Bump `xcodeproj.podspec` macOS deployment target to 10.13. ### Removed diff --git a/xcodeproj.podspec b/xcodeproj.podspec index 077aa2482..6c51efafa 100644 --- a/xcodeproj.podspec +++ b/xcodeproj.podspec @@ -8,7 +8,7 @@ Pod::Spec.new do |s| s.requires_arc = true s.authors = 'Tuist' s.swift_version = '5.1' - s.osx.deployment_target = '10.10' + s.osx.deployment_target = '10.13' s.source_files = 'Sources/**/*.{swift}' From 59c7f8d4201a7bd37ef509edebd5777811c7de78 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20Pi=C3=B1era?= Date: Mon, 26 Jun 2023 19:46:06 +0200 Subject: [PATCH 273/678] Drop support for CocoaPods --- CHANGELOG.md | 3 ++- Documentation/getting-started.md | 10 ---------- Gemfile | 2 -- README.md | 7 ------- RELEASE.md | 1 - xcodeproj.podspec | 19 ------------------- 6 files changed, 2 insertions(+), 40 deletions(-) delete mode 100644 xcodeproj.podspec diff --git a/CHANGELOG.md b/CHANGELOG.md index 626348ac6..27791b058 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,7 +16,8 @@ ### Removed -- [Carthage](https://github.com/Carthage/Carthage) support. +- **Breaking** [Carthage](https://github.com/Carthage/Carthage) support: Since the tool is not actively maintained. +- **Breaking** CocoaPods support: With the Apple ecosystem moving to Swift Package Manager we'd like to support the transition by dropping support for CocoaPods. The drop will simplify our release process. ### Fixed diff --git a/Documentation/getting-started.md b/Documentation/getting-started.md index 9f10e34cd..384fddbc7 100644 --- a/Documentation/getting-started.md +++ b/Documentation/getting-started.md @@ -4,16 +4,6 @@ If you want to use xcodeproj in your projects, you need to add the library as a ## 1. Adding the dependency/package -### CocoaPods - -If you would like to integrate xcodeproj into your project using CocoaPods, you only need to add the following line to your `Podfile`: - -```ruby -pod 'xcodeproj' -``` - -After that, you can run `pod install` *(or `bundle install` if you are using Bundler for managing your gems)* and you should get the latest version of xcodeproj integrated into your project. - ### Swift Package Manager If you are developing a package instead *(with the SwiftPM)* you can integrate xcodeproj by adding the following line to the dependencies list of your `Package.swift`: diff --git a/Gemfile b/Gemfile index 4300aed5e..29a495476 100644 --- a/Gemfile +++ b/Gemfile @@ -1,7 +1,5 @@ source "https://rubygems.org" gem "rake" -gem "jazzy" -gem "cocoapods", "1.12.1" gem "colorize", "~> 0.8.1" gem "redcarpet", "~> 3.5.1" diff --git a/README.md b/README.md index 7a5b4fc94..8e57cb8f2 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,6 @@ XcodeProj is a library written in Swift for parsing and working with Xcode proje - [Projects Using XcodeProj](#projects-using-xcodeproj) - [Installation](#installation) - [Swift Package Manager](#swift-package-manager) - - [CocoaPods](#cocoapods) - [Scripting](#scripting) - [Documentation 📝](#documentation-) - [References 📚](#references-) @@ -59,12 +58,6 @@ let package = Package( ) ``` -### CocoaPods - -```ruby -pod 'xcodeproj', '~> 8.8.0 -``` - ### Scripting Using [`swift-sh`] you can automate project-tasks using scripts, for example we diff --git a/RELEASE.md b/RELEASE.md index 344fd1f18..da533d05f 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -8,5 +8,4 @@ In this document you'll find all the necessary steps to release a new version of 4. Commit the changes and tag them `git commit -m "Version x.y.z"` & `git tag x.y.z`. 5. Push the changes `git push origin main --tags` 6. Run the release checks by running `bundle exec rake release_check`. -7. Publish a new version of the Pod by running `bundle exec pod trunk push --allow-warnings --verbose`. 8. Create the release on GitHub including the release notes from the `CHANGELOG.md`. diff --git a/xcodeproj.podspec b/xcodeproj.podspec deleted file mode 100644 index 6c51efafa..000000000 --- a/xcodeproj.podspec +++ /dev/null @@ -1,19 +0,0 @@ -Pod::Spec.new do |s| - s.name = 'xcodeproj' - s.version = '8.11.0' - s.summary = 'Read/Modify/Write your Xcode projects' - s.homepage = 'https://github.com/tuist/xcodeproj' - s.license = 'MIT' - s.source = { git: 'https://github.com/tuist/xcodeproj.git', tag: s.version.to_s } - s.requires_arc = true - s.authors = 'Tuist' - s.swift_version = '5.1' - s.osx.deployment_target = '10.13' - - s.source_files = 'Sources/**/*.{swift}' - - s.module_name = 'XcodeProj' - - s.dependency 'PathKit', '~> 1.0.1' - s.dependency 'AEXML', '~> 4.6.1' -end From d2042ddb26bacfbd734197c224662d419eeeefe7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20Pi=C3=B1era?= Date: Mon, 26 Jun 2023 19:48:35 +0200 Subject: [PATCH 274/678] Updated CHANGELOG --- CHANGELOG.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 27791b058..3663df328 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,8 +16,8 @@ ### Removed -- **Breaking** [Carthage](https://github.com/Carthage/Carthage) support: Since the tool is not actively maintained. -- **Breaking** CocoaPods support: With the Apple ecosystem moving to Swift Package Manager we'd like to support the transition by dropping support for CocoaPods. The drop will simplify our release process. +- **(Breaking)** Dropped [Carthage](https://github.com/Carthage/Carthage) support: Since the tool is not actively maintained. +- **(Breaking)** Dropped CocoaPods support: With the Apple ecosystem moving to Swift Package Manager we'd like to support the transition by dropping support for CocoaPods. The drop will simplify our release process. ### Fixed From 7af4756f14730e0db918a9d09a9e85fc3f79940c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20Pi=C3=B1era?= Date: Mon, 26 Jun 2023 20:09:42 +0200 Subject: [PATCH 275/678] Add Netlify badge --- .swift-version | 1 + Package.resolved | 18 ++++++++++++++++++ Package.swift | 1 + README.md | 2 ++ 4 files changed, 22 insertions(+) create mode 100644 .swift-version diff --git a/.swift-version b/.swift-version new file mode 100644 index 000000000..1802e771b --- /dev/null +++ b/.swift-version @@ -0,0 +1 @@ +5.8.1 diff --git a/Package.resolved b/Package.resolved index 234bed8df..03a6b4a69 100644 --- a/Package.resolved +++ b/Package.resolved @@ -27,6 +27,24 @@ "revision": "26cc5e9ae0947092c7139ef7ba612e34646086c7", "version": "0.10.1" } + }, + { + "package": "SwiftDocCPlugin", + "repositoryURL": "https://github.com/apple/swift-docc-plugin", + "state": { + "branch": null, + "revision": "26ac5758409154cc448d7ab82389c520fa8a8247", + "version": "1.3.0" + } + }, + { + "package": "SymbolKit", + "repositoryURL": "https://github.com/apple/swift-docc-symbolkit", + "state": { + "branch": null, + "revision": "b45d1f2ed151d057b54504d653e0da5552844e34", + "version": "1.0.0" + } } ] }, diff --git a/Package.swift b/Package.swift index 6af0ff9cd..24e6f3dcf 100644 --- a/Package.swift +++ b/Package.swift @@ -10,6 +10,7 @@ let package = Package( dependencies: [ .package(url: "https://github.com/tadija/AEXML.git", .upToNextMinor(from: "4.6.1")), .package(url: "https://github.com/kylef/PathKit.git", .upToNextMinor(from: "1.0.1")), + .package(url: "https://github.com/apple/swift-docc-plugin", from: "1.1.0") ], targets: [ .target(name: "XcodeProj", diff --git a/README.md b/README.md index 8e57cb8f2..f4e5460ff 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # XcodeProj +[![Netlify Status](https://api.netlify.com/api/v1/badges/005ef674-d103-4b05-a4d1-79413ce9d766/deploy-status)](https://app.netlify.com/sites/xcodeproj/deploys) + [![All Contributors](https://img.shields.io/badge/all_contributors-32-orange.svg?style=flat-square)](#contributors-) From 468d9cf46107f6d463466cc6dd8498d40171074f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20Pi=C3=B1era?= Date: Mon, 26 Jun 2023 20:13:20 +0200 Subject: [PATCH 276/678] Fix CI pipeline --- .github/workflows/xcodeproj.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/xcodeproj.yml b/.github/workflows/xcodeproj.yml index c7f54a5fe..a1237c5cb 100644 --- a/.github/workflows/xcodeproj.yml +++ b/.github/workflows/xcodeproj.yml @@ -13,7 +13,7 @@ jobs: runs-on: macos-11 strategy: matrix: - xcode: ["12.5.1", "13.4.1", "14.3.1", "beta"] + xcode: ["12.5.1", "13.4.1", "14.3.1", "Beta"] steps: - uses: actions/checkout@v1 - name: Select Xcode ${{ matrix.xcode }} From 4f83ea70da2c8c04dc83769a8fdbd625624ad6f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20Pi=C3=B1era?= Date: Mon, 26 Jun 2023 20:15:28 +0200 Subject: [PATCH 277/678] Use macos-latest --- .github/workflows/xcodeproj.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/xcodeproj.yml b/.github/workflows/xcodeproj.yml index a1237c5cb..34287b889 100644 --- a/.github/workflows/xcodeproj.yml +++ b/.github/workflows/xcodeproj.yml @@ -10,10 +10,10 @@ concurrency: jobs: build: name: Build (macOS) - runs-on: macos-11 + runs-on: macos-latest strategy: matrix: - xcode: ["12.5.1", "13.4.1", "14.3.1", "Beta"] + xcode: ["12.5.1", "13.4.1", "14.3.1", "15.0"] steps: - uses: actions/checkout@v1 - name: Select Xcode ${{ matrix.xcode }} From 7c6771855568aad81c466a5ba162b76ba142107a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20Pi=C3=B1era?= Date: Mon, 26 Jun 2023 20:19:50 +0200 Subject: [PATCH 278/678] Use the two most recent Xcode versions --- .github/workflows/xcodeproj.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/xcodeproj.yml b/.github/workflows/xcodeproj.yml index 34287b889..1b2bef3b3 100644 --- a/.github/workflows/xcodeproj.yml +++ b/.github/workflows/xcodeproj.yml @@ -13,7 +13,7 @@ jobs: runs-on: macos-latest strategy: matrix: - xcode: ["12.5.1", "13.4.1", "14.3.1", "15.0"] + xcode: ["14.3.1", "15.0"] steps: - uses: actions/checkout@v1 - name: Select Xcode ${{ matrix.xcode }} From 950e944e78785d962564912a477beafa295543da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20Pi=C3=B1era?= Date: Mon, 26 Jun 2023 20:21:17 +0200 Subject: [PATCH 279/678] Improve the pipeline --- .github/workflows/xcodeproj.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/xcodeproj.yml b/.github/workflows/xcodeproj.yml index 1b2bef3b3..2a902404f 100644 --- a/.github/workflows/xcodeproj.yml +++ b/.github/workflows/xcodeproj.yml @@ -9,7 +9,7 @@ concurrency: jobs: build: - name: Build (macOS) + name: Build (macOS / Xcode ${{ matrix.xcode }}) runs-on: macos-latest strategy: matrix: @@ -28,11 +28,11 @@ jobs: - name: Build run: swift build -c release test: - name: Test (macOS) + name: Test (macOS / Xcode ${{ matrix.xcode }}) runs-on: macos-11 strategy: matrix: - xcode: ["12.4", "12.5", "13.0"] + xcode: ["14.3.1", "15.0"] steps: - uses: actions/checkout@v1 - name: Select Xcode ${{ matrix.xcode }} From 3a75a36cc515541eb53356842937a47fd372a53a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20Pi=C3=B1era?= Date: Mon, 26 Jun 2023 20:26:30 +0200 Subject: [PATCH 280/678] Remove Ruby --- .jazzy.yaml | 56 ----------------------- .rspec | 1 - Gemfile | 5 --- Gemfile.lock | 123 --------------------------------------------------- Rakefile | 21 --------- 5 files changed, 206 deletions(-) delete mode 100644 .jazzy.yaml delete mode 100644 .rspec delete mode 100644 Gemfile delete mode 100644 Gemfile.lock delete mode 100644 Rakefile diff --git a/.jazzy.yaml b/.jazzy.yaml deleted file mode 100644 index 4605b3c64..000000000 --- a/.jazzy.yaml +++ /dev/null @@ -1,56 +0,0 @@ -author: Tuist -module: XcodeProj -github_url: https://github.com/tuist/xcodeproj -copyright: 'Copyright © from 2018 Pedro Piñera Buendía. All rights reserved.' -readme: ABOUT.md -documentation: guides/*.md -sdk: macosx -xcodebuild_arguments: - - -project - - XcodeProj.xcodeproj - - -scheme - - XcodeProj-Package -skip_undocumented: true -custom_categories: - - name: Models - children: - - BuildSettings - - XCConfig - - XCWorkspace - - XcodeProj - - XCBuildConfiguration - - XCConfigurationList - - XCScheme - - XCSharedData - - PBXProductType - - PBXNativeTarget - - PBXProj - - PBXObject - - PBXSourceTree - - PBXAggregateTarget - - PBXBuildFile - - PBXContainerItemProxy - - PBXFileElement - - PBXFileReference - - PBXGroup - - PBXProject - - PBXFrameworksBuildPhase - - PBXHeadersBuildPhase - - PBXResourcesBuildPhase - - PBXCopyFilesBuildPhase - - PBXShellScriptBuildPhase - - PBXSourcesBuildPhase - - PBXTargetDependency - - PBXVariantGroup - - name: Protocols - children: - - ProjectElement - - name: Errors - children: - - XCConfigError - - XCSchemeError - - XCSharedDataError - - XCWorkspaceDataError - - XCWorkspaceError - - XCodeProjError - - PBXObjectError diff --git a/.rspec b/.rspec deleted file mode 100644 index c99d2e739..000000000 --- a/.rspec +++ /dev/null @@ -1 +0,0 @@ ---require spec_helper diff --git a/Gemfile b/Gemfile deleted file mode 100644 index 29a495476..000000000 --- a/Gemfile +++ /dev/null @@ -1,5 +0,0 @@ -source "https://rubygems.org" - -gem "rake" -gem "colorize", "~> 0.8.1" -gem "redcarpet", "~> 3.5.1" diff --git a/Gemfile.lock b/Gemfile.lock deleted file mode 100644 index 6b4f1c9e1..000000000 --- a/Gemfile.lock +++ /dev/null @@ -1,123 +0,0 @@ -GEM - remote: https://rubygems.org/ - specs: - CFPropertyList (3.0.6) - rexml - activesupport (6.1.7.3) - concurrent-ruby (~> 1.0, >= 1.0.2) - i18n (>= 1.6, < 2) - minitest (>= 5.1) - tzinfo (~> 2.0) - zeitwerk (~> 2.3) - addressable (2.8.4) - public_suffix (>= 2.0.2, < 6.0) - algoliasearch (1.27.5) - httpclient (~> 2.8, >= 2.8.3) - json (>= 1.5.1) - atomos (0.1.3) - claide (1.1.0) - cocoapods (1.12.1) - addressable (~> 2.8) - claide (>= 1.0.2, < 2.0) - cocoapods-core (= 1.12.1) - cocoapods-deintegrate (>= 1.0.3, < 2.0) - cocoapods-downloader (>= 1.6.0, < 2.0) - cocoapods-plugins (>= 1.0.0, < 2.0) - cocoapods-search (>= 1.0.0, < 2.0) - cocoapods-trunk (>= 1.6.0, < 2.0) - cocoapods-try (>= 1.1.0, < 2.0) - colored2 (~> 3.1) - escape (~> 0.0.4) - fourflusher (>= 2.3.0, < 3.0) - gh_inspector (~> 1.0) - molinillo (~> 0.8.0) - nap (~> 1.0) - ruby-macho (>= 2.3.0, < 3.0) - xcodeproj (>= 1.21.0, < 2.0) - cocoapods-core (1.12.1) - activesupport (>= 5.0, < 8) - addressable (~> 2.8) - algoliasearch (~> 1.0) - concurrent-ruby (~> 1.1) - fuzzy_match (~> 2.0.4) - nap (~> 1.0) - netrc (~> 0.11) - public_suffix (~> 4.0) - typhoeus (~> 1.0) - cocoapods-deintegrate (1.0.5) - cocoapods-downloader (1.6.3) - cocoapods-plugins (1.0.0) - nap - cocoapods-search (1.0.1) - cocoapods-trunk (1.6.0) - nap (>= 0.8, < 2.0) - netrc (~> 0.11) - cocoapods-try (1.2.0) - colored2 (3.1.2) - colorize (0.8.1) - concurrent-ruby (1.2.2) - escape (0.0.4) - ethon (0.16.0) - ffi (>= 1.15.0) - ffi (1.15.5) - fourflusher (2.3.1) - fuzzy_match (2.0.4) - gh_inspector (1.1.3) - httpclient (2.8.3) - i18n (1.14.1) - concurrent-ruby (~> 1.0) - jazzy (0.14.3) - cocoapods (~> 1.5) - mustache (~> 1.1) - open4 (~> 1.3) - redcarpet (~> 3.4) - rexml (~> 3.2) - rouge (>= 2.0.6, < 4.0) - sassc (~> 2.1) - sqlite3 (~> 1.3) - xcinvoke (~> 0.3.0) - json (2.6.3) - liferaft (0.0.6) - minitest (5.18.1) - molinillo (0.8.0) - mustache (1.1.1) - nanaimo (0.3.0) - nap (1.1.0) - netrc (0.11.0) - open4 (1.3.4) - public_suffix (4.0.7) - rake (13.0.6) - redcarpet (3.5.1) - rexml (3.2.5) - rouge (3.28.0) - ruby-macho (2.5.1) - sassc (2.4.0) - ffi (~> 1.9) - sqlite3 (1.4.4) - typhoeus (1.4.0) - ethon (>= 0.9.0) - tzinfo (2.0.6) - concurrent-ruby (~> 1.0) - xcinvoke (0.3.0) - liferaft (~> 0.0.6) - xcodeproj (1.22.0) - CFPropertyList (>= 2.3.3, < 4.0) - atomos (~> 0.1.3) - claide (>= 1.0.2, < 2.0) - colored2 (~> 3.1) - nanaimo (~> 0.3.0) - rexml (~> 3.2.4) - zeitwerk (2.6.8) - -PLATFORMS - ruby - -DEPENDENCIES - cocoapods (= 1.12.1) - colorize (~> 0.8.1) - jazzy - rake - redcarpet (~> 3.5.1) - -BUNDLED WITH - 2.0.2 diff --git a/Rakefile b/Rakefile deleted file mode 100644 index bc8b32f94..000000000 --- a/Rakefile +++ /dev/null @@ -1,21 +0,0 @@ -#!/usr/bin/rake - -require 'fileutils' -require 'colorize' - -task :style_correct do - system("swiftformat .") - system("swiftlint autocorrect") -end - -task :release_check do - puts "Running tests".colorize(:cyan) - system("swift test") - - puts "Building for release".colorize(:cyan) - system("swift build -c release") -end - -def system(*args) - Kernel.system(*args) || abort -end From 2662cd55634fc8e084cb632ce80050547fc63df1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20Pi=C3=B1era?= Date: Mon, 26 Jun 2023 20:33:47 +0200 Subject: [PATCH 281/678] Fix pipeline --- .github/workflows/xcodeproj.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/xcodeproj.yml b/.github/workflows/xcodeproj.yml index 2a902404f..2c4a104f5 100644 --- a/.github/workflows/xcodeproj.yml +++ b/.github/workflows/xcodeproj.yml @@ -9,14 +9,14 @@ concurrency: jobs: build: - name: Build (macOS / Xcode ${{ matrix.xcode }}) + name: Build (macOS) runs-on: macos-latest strategy: matrix: - xcode: ["14.3.1", "15.0"] + xcode: ["14.3.1"] steps: - uses: actions/checkout@v1 - - name: Select Xcode ${{ matrix.xcode }} + - name: Sele run: sudo xcode-select -switch /Applications/Xcode_${{ matrix.xcode }}.app - name: Build run: swift build -c release @@ -28,11 +28,11 @@ jobs: - name: Build run: swift build -c release test: - name: Test (macOS / Xcode ${{ matrix.xcode }}) + name: Test (macOS / Xcode) runs-on: macos-11 strategy: matrix: - xcode: ["14.3.1", "15.0"] + xcode: ["14.3.1"] steps: - uses: actions/checkout@v1 - name: Select Xcode ${{ matrix.xcode }} From 6e6be1fa1ea387d401ff482eedfff96cf9f1f346 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20Pi=C3=B1era?= Date: Mon, 26 Jun 2023 20:39:11 +0200 Subject: [PATCH 282/678] Fix Xcode selection --- .github/workflows/xcodeproj.yml | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/.github/workflows/xcodeproj.yml b/.github/workflows/xcodeproj.yml index 2c4a104f5..4c4457e61 100644 --- a/.github/workflows/xcodeproj.yml +++ b/.github/workflows/xcodeproj.yml @@ -11,13 +11,11 @@ jobs: build: name: Build (macOS) runs-on: macos-latest - strategy: - matrix: - xcode: ["14.3.1"] steps: - uses: actions/checkout@v1 - - name: Sele - run: sudo xcode-select -switch /Applications/Xcode_${{ matrix.xcode }}.app + - uses: maxim-lobanov/setup-xcode@v1 + with: + xcode-version: latest-stable - name: Build run: swift build -c release build-linux: @@ -30,13 +28,11 @@ jobs: test: name: Test (macOS / Xcode) runs-on: macos-11 - strategy: - matrix: - xcode: ["14.3.1"] steps: - uses: actions/checkout@v1 - - name: Select Xcode ${{ matrix.xcode }} - run: sudo xcode-select -switch /Applications/Xcode_${{ matrix.xcode }}.app + - uses: maxim-lobanov/setup-xcode@v1 + with: + xcode-version: latest-stable - name: Generate project run: swift package generate-xcodeproj - name: Run tests From 02823e5420b2dafb5e719a78accca139e6c8fc21 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20Pi=C3=B1era?= Date: Mon, 26 Jun 2023 20:45:14 +0200 Subject: [PATCH 283/678] Fix pipeline --- .github/workflows/xcodeproj.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/xcodeproj.yml b/.github/workflows/xcodeproj.yml index 4c4457e61..8854e457c 100644 --- a/.github/workflows/xcodeproj.yml +++ b/.github/workflows/xcodeproj.yml @@ -33,10 +33,8 @@ jobs: - uses: maxim-lobanov/setup-xcode@v1 with: xcode-version: latest-stable - - name: Generate project - run: swift package generate-xcodeproj - name: Run tests - run: xcodebuild test -project XcodeProj.xcodeproj -scheme XcodeProj-Package -enableCodeCoverage YES + run: swift test --enable-code-coverage - name: Send test coverage report run: bash <(curl -s https://codecov.io/bash) test-linux: From c1b56d7d82f40f86db8a3b10e624c2074c45ff6e Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 26 Jun 2023 20:45:34 +0200 Subject: [PATCH 284/678] chore(deps): update actions/checkout action to v3 (#776) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .github/workflows/xcodeproj.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/xcodeproj.yml b/.github/workflows/xcodeproj.yml index 8854e457c..3f615a455 100644 --- a/.github/workflows/xcodeproj.yml +++ b/.github/workflows/xcodeproj.yml @@ -12,7 +12,7 @@ jobs: name: Build (macOS) runs-on: macos-latest steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v3 - uses: maxim-lobanov/setup-xcode@v1 with: xcode-version: latest-stable @@ -22,14 +22,14 @@ jobs: name: Build (Linux) runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v3 - name: Build run: swift build -c release test: name: Test (macOS / Xcode) runs-on: macos-11 steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v3 - uses: maxim-lobanov/setup-xcode@v1 with: xcode-version: latest-stable @@ -41,7 +41,7 @@ jobs: name: Test (Linux) runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v3 - name: Set Git config run: | git config --global user.email "xcodeproj@tuist.io" @@ -53,7 +53,7 @@ jobs: name: Swiftlint runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v3 - name: GitHub Action for SwiftLint uses: norio-nomura/action-swiftlint@3.2.1 env: From bc2ed41f18ef13e56aa03aa62a60c68c65974fac Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 26 Jun 2023 21:19:30 +0200 Subject: [PATCH 285/678] chore(deps): update dependency apple/swift-docc-plugin to from: "1.3.0" (#777) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(deps): update dependency apple/swift-docc-plugin to from: "1.3.0" * Fix pipeline * Use Swift 5.7.1 --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Pedro Piñera --- .github/workflows/xcodeproj.yml | 2 +- .swift-version | 2 +- Package.swift | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/xcodeproj.yml b/.github/workflows/xcodeproj.yml index 3f615a455..0ad6989dc 100644 --- a/.github/workflows/xcodeproj.yml +++ b/.github/workflows/xcodeproj.yml @@ -27,7 +27,7 @@ jobs: run: swift build -c release test: name: Test (macOS / Xcode) - runs-on: macos-11 + runs-on: macos-latest steps: - uses: actions/checkout@v3 - uses: maxim-lobanov/setup-xcode@v1 diff --git a/.swift-version b/.swift-version index 1802e771b..64ff7ded7 100644 --- a/.swift-version +++ b/.swift-version @@ -1 +1 @@ -5.8.1 +5.7.1 diff --git a/Package.swift b/Package.swift index 24e6f3dcf..8787f1dd7 100644 --- a/Package.swift +++ b/Package.swift @@ -1,4 +1,4 @@ -// swift-tools-version:5.2.0 +// swift-tools-version:5.7 import PackageDescription @@ -10,7 +10,7 @@ let package = Package( dependencies: [ .package(url: "https://github.com/tadija/AEXML.git", .upToNextMinor(from: "4.6.1")), .package(url: "https://github.com/kylef/PathKit.git", .upToNextMinor(from: "1.0.1")), - .package(url: "https://github.com/apple/swift-docc-plugin", from: "1.1.0") + .package(url: "https://github.com/apple/swift-docc-plugin", from: "1.3.0") ], targets: [ .target(name: "XcodeProj", From 90a742ee3624e93238d14ee26207c437e347e441 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20Pi=C3=B1era=20Buend=C3=ADa?= <663605+pepicrft@users.noreply.github.com> Date: Thu, 6 Jul 2023 16:00:40 +0200 Subject: [PATCH 286/678] Xcode catch up (#781) * Update Xcode.LastKnown.objectVersion to 56 * Update the default values to objectVersion 46 and compatibilityVersion to 14.0 * Add more defaults * Update the upgrade checks for Xcode 15 * Add PBXBuildRule.dependencyFile attribute * Remove .ruby-version * Test the new PBXBuildRule.dependency_file attribute * Add missing files * Update CHANGELOG.md --- .ruby-version | 1 - CHANGELOG.md | 6 + .../project.pbxproj | 332 ++++++++++++++++++ .../contents.xcworkspacedata | 7 + .../xcshareddata/IDEWorkspaceChecks.plist | 8 + .../UserInterfaceState.xcuserstate | Bin 0 -> 10073 bytes .../xcschemes/xcschememanagement.plist | 14 + .../TargetWithCustomBuildRules.h | 12 + .../TargetWithCustomBuildRules.m | 12 + .../Objects/BuildPhase/PBXBuildRule.swift | 10 + Sources/XcodeProj/Project/Xcode.swift | 15 +- .../Objects/Project/PBXProjEncoderTests.swift | 24 ++ Tests/XcodeProjTests/Tests/Fixtures.swift | 6 + 13 files changed, 443 insertions(+), 4 deletions(-) delete mode 100644 .ruby-version create mode 100644 Fixtures/TargetWithCustomBuildRules/TargetWithCustomBuildRules.xcodeproj/project.pbxproj create mode 100644 Fixtures/TargetWithCustomBuildRules/TargetWithCustomBuildRules.xcodeproj/project.xcworkspace/contents.xcworkspacedata create mode 100644 Fixtures/TargetWithCustomBuildRules/TargetWithCustomBuildRules.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist create mode 100644 Fixtures/TargetWithCustomBuildRules/TargetWithCustomBuildRules.xcodeproj/project.xcworkspace/xcuserdata/pepicrft.xcuserdatad/UserInterfaceState.xcuserstate create mode 100644 Fixtures/TargetWithCustomBuildRules/TargetWithCustomBuildRules.xcodeproj/xcuserdata/pepicrft.xcuserdatad/xcschemes/xcschememanagement.plist create mode 100644 Fixtures/TargetWithCustomBuildRules/TargetWithCustomBuildRules/TargetWithCustomBuildRules.h create mode 100644 Fixtures/TargetWithCustomBuildRules/TargetWithCustomBuildRules/TargetWithCustomBuildRules.m diff --git a/.ruby-version b/.ruby-version deleted file mode 100644 index 1f7da99d4..000000000 --- a/.ruby-version +++ /dev/null @@ -1 +0,0 @@ -2.7.7 diff --git a/CHANGELOG.md b/CHANGELOG.md index 3663df328..aa3a96624 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,12 @@ ## Unreleased +### Added + +- `PBXBuildRule.dependencyFile` attribute [#781](https://github.com/tuist/XcodeProj/pull/781) by [@pepicrft](https://github.com/pepicrft). +- Update last known `upgradeCheck` and `swiftUpgradeCheck` constants [#781](https://github.com/tuist/XcodeProj/pull/781) by [@pepicrft](https://github.com/pepicrft). +- Add the defaults `xcschemeFormatVersion`, `lastSwiftUpgradeCheck`, and `lastUpgradeCheck` [#781](https://github.com/tuist/XcodeProj/pull/781) by [@pepicrft](https://github.com/pepicrft). + ## 8.11.0 ### Added diff --git a/Fixtures/TargetWithCustomBuildRules/TargetWithCustomBuildRules.xcodeproj/project.pbxproj b/Fixtures/TargetWithCustomBuildRules/TargetWithCustomBuildRules.xcodeproj/project.pbxproj new file mode 100644 index 000000000..16c682fb8 --- /dev/null +++ b/Fixtures/TargetWithCustomBuildRules/TargetWithCustomBuildRules.xcodeproj/project.pbxproj @@ -0,0 +1,332 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 56; + objects = { + +/* Begin PBXBuildFile section */ + 6CAD68172A56E30800662D8A /* TargetWithCustomBuildRules.h in Headers */ = {isa = PBXBuildFile; fileRef = 6CAD68162A56E30800662D8A /* TargetWithCustomBuildRules.h */; }; + 6CAD68192A56E30800662D8A /* TargetWithCustomBuildRules.m in Sources */ = {isa = PBXBuildFile; fileRef = 6CAD68182A56E30800662D8A /* TargetWithCustomBuildRules.m */; }; +/* End PBXBuildFile section */ + +/* Begin PBXBuildRule section */ + 6CAD681F2A56E30C00662D8A /* PBXBuildRule */ = { + isa = PBXBuildRule; + compilerSpec = com.apple.compilers.proxy.script; + fileType = pattern.proxy; + inputFiles = ( + ); + isEditable = 1; + name = "Custom 1"; + outputFiles = ( + ); + script = "# Type a script or drag a script file from your workspace to insert its path.\n"; + }; + 6CAD68202A56E31400662D8A /* PBXBuildRule */ = { + isa = PBXBuildRule; + compilerSpec = com.apple.compilers.proxy.script; + dependencyFile = "$(DERIVED_FILES_DIR)/$(INPUT_FILE_PATH).d"; + fileType = pattern.proxy; + inputFiles = ( + ); + isEditable = 1; + name = "Custom 2 with dependency file"; + outputFiles = ( + ); + script = "# Type a script or drag a script file from your workspace to insert its path.\n"; + }; + 6CAD68212A56E9CE00662D8A /* PBXBuildRule */ = { + isa = PBXBuildRule; + compilerSpec = com.apple.compilers.proxy.script; + fileType = file.skybox; + inputFiles = ( + ); + isEditable = 1; + outputFiles = ( + ); + script = "# rctool\n"; + }; +/* End PBXBuildRule section */ + +/* Begin PBXFileReference section */ + 6CAD68132A56E30800662D8A /* libTargetWithCustomBuildRules.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libTargetWithCustomBuildRules.a; sourceTree = BUILT_PRODUCTS_DIR; }; + 6CAD68162A56E30800662D8A /* TargetWithCustomBuildRules.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = TargetWithCustomBuildRules.h; sourceTree = ""; }; + 6CAD68182A56E30800662D8A /* TargetWithCustomBuildRules.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = TargetWithCustomBuildRules.m; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 6CAD68112A56E30800662D8A /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 6CAD680A2A56E30800662D8A = { + isa = PBXGroup; + children = ( + 6CAD68152A56E30800662D8A /* TargetWithCustomBuildRules */, + 6CAD68142A56E30800662D8A /* Products */, + ); + sourceTree = ""; + }; + 6CAD68142A56E30800662D8A /* Products */ = { + isa = PBXGroup; + children = ( + 6CAD68132A56E30800662D8A /* libTargetWithCustomBuildRules.a */, + ); + name = Products; + sourceTree = ""; + }; + 6CAD68152A56E30800662D8A /* TargetWithCustomBuildRules */ = { + isa = PBXGroup; + children = ( + 6CAD68162A56E30800662D8A /* TargetWithCustomBuildRules.h */, + 6CAD68182A56E30800662D8A /* TargetWithCustomBuildRules.m */, + ); + path = TargetWithCustomBuildRules; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXHeadersBuildPhase section */ + 6CAD680F2A56E30800662D8A /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + 6CAD68172A56E30800662D8A /* TargetWithCustomBuildRules.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXHeadersBuildPhase section */ + +/* Begin PBXNativeTarget section */ + 6CAD68122A56E30800662D8A /* TargetWithCustomBuildRules */ = { + isa = PBXNativeTarget; + buildConfigurationList = 6CAD681C2A56E30800662D8A /* Build configuration list for PBXNativeTarget "TargetWithCustomBuildRules" */; + buildPhases = ( + 6CAD680F2A56E30800662D8A /* Headers */, + 6CAD68102A56E30800662D8A /* Sources */, + 6CAD68112A56E30800662D8A /* Frameworks */, + ); + buildRules = ( + 6CAD68212A56E9CE00662D8A /* PBXBuildRule */, + 6CAD68202A56E31400662D8A /* PBXBuildRule */, + 6CAD681F2A56E30C00662D8A /* PBXBuildRule */, + ); + dependencies = ( + ); + name = TargetWithCustomBuildRules; + productName = TargetWithCustomBuildRules; + productReference = 6CAD68132A56E30800662D8A /* libTargetWithCustomBuildRules.a */; + productType = "com.apple.product-type.library.static"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 6CAD680B2A56E30800662D8A /* Project object */ = { + isa = PBXProject; + attributes = { + BuildIndependentTargetsInParallel = 1; + LastUpgradeCheck = 1500; + TargetAttributes = { + 6CAD68122A56E30800662D8A = { + CreatedOnToolsVersion = 15.0; + }; + }; + }; + buildConfigurationList = 6CAD680E2A56E30800662D8A /* Build configuration list for PBXProject "TargetWithCustomBuildRules" */; + compatibilityVersion = "Xcode 14.0"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 6CAD680A2A56E30800662D8A; + productRefGroup = 6CAD68142A56E30800662D8A /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 6CAD68122A56E30800662D8A /* TargetWithCustomBuildRules */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXSourcesBuildPhase section */ + 6CAD68102A56E30800662D8A /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 6CAD68192A56E30800662D8A /* TargetWithCustomBuildRules.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin XCBuildConfiguration section */ + 6CAD681A2A56E30800662D8A /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + ENABLE_USER_SCRIPT_SANDBOXING = YES; + GCC_C_LANGUAGE_STANDARD = gnu17; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + LOCALIZATION_PREFERS_STRING_CATALOGS = YES; + MACOSX_DEPLOYMENT_TARGET = 13.4; + MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; + MTL_FAST_MATH = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = macosx; + }; + name = Debug; + }; + 6CAD681B2A56E30800662D8A /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_USER_SCRIPT_SANDBOXING = YES; + GCC_C_LANGUAGE_STANDARD = gnu17; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + LOCALIZATION_PREFERS_STRING_CATALOGS = YES; + MACOSX_DEPLOYMENT_TARGET = 13.4; + MTL_ENABLE_DEBUG_INFO = NO; + MTL_FAST_MATH = YES; + SDKROOT = macosx; + }; + name = Release; + }; + 6CAD681D2A56E30800662D8A /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + CODE_SIGN_STYLE = Automatic; + EXECUTABLE_PREFIX = lib; + PRODUCT_NAME = "$(TARGET_NAME)"; + SKIP_INSTALL = YES; + }; + name = Debug; + }; + 6CAD681E2A56E30800662D8A /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + CODE_SIGN_STYLE = Automatic; + EXECUTABLE_PREFIX = lib; + PRODUCT_NAME = "$(TARGET_NAME)"; + SKIP_INSTALL = YES; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 6CAD680E2A56E30800662D8A /* Build configuration list for PBXProject "TargetWithCustomBuildRules" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 6CAD681A2A56E30800662D8A /* Debug */, + 6CAD681B2A56E30800662D8A /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 6CAD681C2A56E30800662D8A /* Build configuration list for PBXNativeTarget "TargetWithCustomBuildRules" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 6CAD681D2A56E30800662D8A /* Debug */, + 6CAD681E2A56E30800662D8A /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 6CAD680B2A56E30800662D8A /* Project object */; +} diff --git a/Fixtures/TargetWithCustomBuildRules/TargetWithCustomBuildRules.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/Fixtures/TargetWithCustomBuildRules/TargetWithCustomBuildRules.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 000000000..919434a62 --- /dev/null +++ b/Fixtures/TargetWithCustomBuildRules/TargetWithCustomBuildRules.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/Fixtures/TargetWithCustomBuildRules/TargetWithCustomBuildRules.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/Fixtures/TargetWithCustomBuildRules/TargetWithCustomBuildRules.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 000000000..18d981003 --- /dev/null +++ b/Fixtures/TargetWithCustomBuildRules/TargetWithCustomBuildRules.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/Fixtures/TargetWithCustomBuildRules/TargetWithCustomBuildRules.xcodeproj/project.xcworkspace/xcuserdata/pepicrft.xcuserdatad/UserInterfaceState.xcuserstate b/Fixtures/TargetWithCustomBuildRules/TargetWithCustomBuildRules.xcodeproj/project.xcworkspace/xcuserdata/pepicrft.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 0000000000000000000000000000000000000000..34d12db6d8ca27201d218997a0c3bc61e6007985 GIT binary patch literal 10073 zcmc&)d3;mF_Me$1g{E0@mo|_lF}W$!jd2Ip z=Z5$I>4JhFBJLs}0xE7Oi?|>HB8Y&9=nvoXq5jUjw`m($p1;3-&F7PwJ9B2vnKNhk z&Y3p&J?$55fp_aNQ$D-03@51(#8gYZlAX{#T965al>0x3g`1rOYt?#W*fPn z8sWP-oQ$fhasu1VHs$va?Lq@lOm!va;#i8;F+ZVLBu6@=M+P($4MS-t9SuizU0Zl}cP#KzrYEd1Uj+#*ma--R34)UQ8YC|`no6)W4Hgq?-2i=Pv zLJy-y&=csNXc_86U1%fPgf^o$(H8U;+KRTJ?dWav4tf{uK<}aV(FbT3+KoO#htW6a z2>KQsMaR$?^b#+eRVhgt6WIPC8h12i|oQto)WAJ!9 z0Z+!&xCYnZ>DYxE@GLwV&%r(%#Pc!5x8mFI?f60b5Bv~*7(ap+;iY&P?!wRFwfH&w z8h#ybz;ED>@h5l}-i`O*z4%kS4}XR~$6w(?_*;A)|BnB_e-cD6AtZ`Oh?GPVIZ+S| zF%T0OLarjIWGER%?4*bklM*tPj3cFFJefcyl5$c-rjc4QgIq_NNDFb3RuUu}xrNLp zl-x>gBe#>g$-U$sF&A zCCA8jf=oLC|$2{2D~%R6&){rGj5dI>gDO!TjS~!Ab7s0GMx6 zjmr~agCzl9YguIl8{~WeSA&NYOuNX%x$1do+}(H+m31N((P^bu+ZaVtU#FG$bnDwt_Io*eO@l$^LW^RlNrNL6<%p%U%tH{(~+5< zpH^%iVNc5{$a19RlsHP#M&@LV$Sx@wnOQiZz{wc;Wbyet4X!|GSQaOv@9Puf?CpvH z(K52_whTv(&5>od+j25T+U)Rg@bQn#e4p4RmuWkn9sBH1gEpxTGn_Zw@v8nepKft=2 zOdL>Eb8e5DbF;yz?k289BrEj>{Sb$Ifj+X{k^RVc2ED^)!d%5o?wrA$VZD771v zqbaC@>ZySycB3j(jcTZoUPV)RQEk&2eNAjS44>fU(tG)&_wEtMS;=}p9=55s7lPy1 zfG^}1J0O$>!yIQI7fM}$W}iV*`TK z6|_$RDInYew~4MG*UO1-b}|Xo-dPtV){AqnP1U85^MvK`pjMR7(Ls}TBR{$x1yHa~ zbXPAJ_B8P)8=O&AS>y(@^?6-^_Aa2}rj=Dr7P5h8R1xx2`e4g|FwA2vYDWp3XdX@J zL^seuyxa4Jc+oMtA&}gH<|FE45<&62+m-Wqs)F?g*dRE)iB3XSBNq z42+4b^1HZ}T5xZ6-Z;0H>y&{gRjxoY%kj=!7=m!nS`c!3nkqsbHprme3Z*LcV(i#? zewUX|q=G=1`EL*9b}g+w4@}}>yVRP?PJ7wT-SG*!zt6FD7teZr-PSpqyAn-ZMq@JS z`Rg)UlJl+?Uy}3gIwbt+fHWQl!89FR1DUxTyrB*(a~8TC-3j@38G07Ij5a{d{Sy6( z&SMp1%PX-RXX0#pEiQm8StZU#u=s>v9Px*%MN7LK-2rj4c%I)Q2G_|U&g1s7HEwpU z2q^fi@3Go$V0{e9?V+(5>*+n%~eLTQ}GqU?$`?0KQ_p`x~J?xw{mCj5@ zADys$l@O}D&81CXg6>&vh}7aT7NCVrMpITfDa7#t_jyS-TEP3s-v}UKH@OczfKofr z{d8z2s)q0bAz;wOgO3nf(kr<@sF4c=*yKEao}lCKOpl^P{7jG0^iK3R9nQ~`6biC| z@&G%F4FuSxLhy!WU!c8s9>)q6T3Qs`EhOA;_9YM3{NSZ@)=_opyUQMrA zgPuq0(F^EB^b*+BE9h198hRaVpkwH@G>_)f0$N5{8l(@=hv}nqNc|+&Ja?=62DYik z$x{p1S-t>U=xg=60`8#CD+I)9SZq%M7K6SRCRIHlM{vn@4_nv2Gp>kj2sJlDz=fc~ z@pkBB;`>sD&?+zuI+)lHOGd(NHvoJ!okc+KWD=#dHF-hbQXzsY$swg_{GEBF~L?L@!O$$irQivB>UPosaK zf1}^ff6#gKJ1wVEXa%jLRkZqP^e09b!*>+G#2Px4I^nyC2Z@o!BJK=m7SLXgDQd*F zaj+fWTF}@yCpfcbvmr}6GKWs*bvpqvi;&3808m1nCLX4g1B|X`*)ma(iP4VvLuIPzNs)bi`21h{g`MoeSM!4} z-pQL`&(1o#OBeWyN-vYqPFPu)bC{G{=crpgIlM= zO2XFJg}sRD-yp8okFR$!Ltw)r%&u?uBU5G<77)|lrtir}n8WRGsKO!KhUemWl%pZq zM(3`;H{cubP55RykKRJ>rVHqhX%pF5;nWU7_2#_Z^js&VU>+{iR=As61mZB8JMcoD z&7Jrzd^cV|+vyGTMtaiL`ysOc{78r(5oYHBtmw3lVsi&LtXP!6kK-pG z+vCM_ekcAXrI*R}_({n2cscH%x6(U$^Cj-aEB~5<@hX&zSJT^IskhUlUY#cA1v>ht zZ@dn_c)`$@VCXCKP8fO@P3lu|a^Av2!dM1}CEtkOMyadtCcGKHiMQal@K(GHZ>J0C zJ@j6BAHAPGKp&+4SOwbWKTy>XKd=k@hp+31AJ~nd{9cFAauZZrf<6z+qlJm?h5!%a zy!=*$Athf6x+ry3IH*L@r(TM_ytJqa`XVMDb}8aXEaz&1+EOGr?+O=}1@=3V^pav% zh8lwH01;aw>4#rxY6yJ%nVC<-ks~fCd+%`~VyWsLILrH7l~3@dJ@^a!B?Pn$Xb0X8 znZK;EC-8GE6IpMwP~hp;Cin||L<}Vd@YmD(^>yKc5ODf6gze@q{syH&MPo>~;V3?X zQdi?+_&af%C>yguHygkDUjQy^)7{GsKEuWn&A=7ZbJOE0BTHb8fEy5_s&^1AxTJBg~X2 z{^E~f-ewr;6^|LE-dR2<=T-QEEXTPbrx6ZCd_@fkNvbeD?43|A3M7ghX2(n2qe?P> z#6UD518HX`kjl_9?$Vpe+OMClPU;VG4b;ipv5?oJX%pMq^8 zTBIWJ*g?FK-6HE zde}v%!zvFeHw*w^H!nsG2lh6%FBBBfhd6N|UrY~cFO8%}7&~#0Q4lpr2FWB@WCY13 zBS{X)rO(o}^f|hYK2O)v7wC(t$Y^pkxrU4(*OEMvPYUQu^kw=AeU-jOH_$ieMqV}g z?85w_>>PVZM*fKG;!Jyv-JYGDQIwP4+vTudx+~+tF0quFDd@Gos>B+la3<=}@C77A z?qH(_47!PrNd5pC`nqVWGf6!ZQhO>zl`PjyW)dgjz<}W; z%)&()B4=dDEU}^HM*A?E{bq6A*#OPS9J-m-?VJ1OE(kLT5dcixq>aoa^XOZ2E8W&jZXh?3o9K4>HhqTu0~ZOK9@H91Gy)h}^+1=1%%M!LkKFHM%n|wdaiB1czg@au;z)X)L0Ht~q?3=R9rWW)(nUYvUHLNg>)qsO z*nyQ~6(4H(V-s&I+^+lYmC{|J@>i2JPzT@(=v`!WUyxl(pw`z(o}+s@$@6sYe`5no zULr4(S89PxP&o6^Pa){p;V%a~GYy^@4o9xTUYt=-Xm=DlTV0L5;5_l+bOlhmLEu5R)g*&y6X09u0cWLOs)$!1>2P4u%)@+SS97xMqcQqayevP#rS$HJj> zS9tDs$PT#HAn(#IJIQ-=Kh(WopZNGBif~!2hv(QyK1T`9kdMhHWEa^@_K>~gQ?ieI zMi0=h=|Osk9;V;WBlKH(^cj>)zC?q_SL6Wsnj9pD;J_iL#{lGhM~~C*=?Qug-jnLw z!D5fQnZJ4jB*6*S7DbRm8sQqn#X+gG6^;-6n@izl4KgbLJ}6Cy9hF5Bgad{byeVRe zu(w0ONu(4GavWrQI3w5g4u&#Ge-8X%%2Nnm7jOm`)EHnnwnp6RYT@Bzu4roGngp5C zJWwO?q`}GDAA+l}QNnAB4?IRNh&pkcBP-oLb&{*mku@wsjE+A;KtXYE*&IFxkzdKb z!4UYiPVyT)%?B1f^8C)%2YEs$dBb}Y?kRusza@NB0$f7t(LneghAZHI7#wilc`aNP z)}R@vo)p6Udkv|F+jc(*K`3p9`*sR0{EzrB6tgNS8^MOJ9+`FFhjtBRV!(9<7L0MeC!JqlZQ3MvsXe z8{H7?iw;C{(Q~8Qqi>8}6umrpWAx_eEd$#J-ZpT}z!wJYkI9QEjd8}zidh)5DCUWn zB{5INbi{PUydSeC=1|O$n4>YrV@|}Jk})!aEKz2X4U%QaM#~Ci6J@nBzbqi*WNor} zvKwSK$!?KR*=@2rWOvDy$(GAHW!pWtnoSGN9y? zZOXfqOO$Js?^p7Ca7kr+Efcwi&f97wy6%P4y%r+ zj;g*>eXlynn3=)MRm@N(jTyxhGZUCe%w%Q?<7MVDi|E`JG*fgn{k(xYBfu=}Pq8X=|qN&tWYo=;yHPbcinnjw|HM=$YHD77I z)|}Lw)|}D&toa|!ui99xR%_52wPvkVJ4~CY9ibhm&DG{<3$#Vr674wc6m6ZhS?ksM zwE-=sy-|C!cE0vj?d{t8wTrZiwNGhZ(Y~hLpxvn5tlgsBs@<-ANBf!f3+;aG0qsHU zVeJv^QSEoy@8fmxW8=B_?)aVYeaW(1(dX+6^~L)6`up?`>L1cSs$ZmEtbaKZ=7J9Xe={MH_kB5G&+sf8QsR&MvpOMyv?}K_@HsAahdT+V~26A@j2r< z<9g$3#Cb>yziZ|&@29wcbHl>(`n#xQq zraMg!m>x1cVtUNfW$HGqFgGuAcMwbpgkt=8?){g*AymSP)iE4S6z z0=9c?58D>oHrck>cG~vY4%)u4eQP^r``LER_AlFiY`@$7Od6OJo1{omCFzq4Nyem< Xq$`uI66#cl5b+r`KzxS3lZO5;nWM~= literal 0 HcmV?d00001 diff --git a/Fixtures/TargetWithCustomBuildRules/TargetWithCustomBuildRules.xcodeproj/xcuserdata/pepicrft.xcuserdatad/xcschemes/xcschememanagement.plist b/Fixtures/TargetWithCustomBuildRules/TargetWithCustomBuildRules.xcodeproj/xcuserdata/pepicrft.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 000000000..9278c11ca --- /dev/null +++ b/Fixtures/TargetWithCustomBuildRules/TargetWithCustomBuildRules.xcodeproj/xcuserdata/pepicrft.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,14 @@ + + + + + SchemeUserState + + TargetWithCustomBuildRules.xcscheme_^#shared#^_ + + orderHint + 0 + + + + diff --git a/Fixtures/TargetWithCustomBuildRules/TargetWithCustomBuildRules/TargetWithCustomBuildRules.h b/Fixtures/TargetWithCustomBuildRules/TargetWithCustomBuildRules/TargetWithCustomBuildRules.h new file mode 100644 index 000000000..90fcbc85a --- /dev/null +++ b/Fixtures/TargetWithCustomBuildRules/TargetWithCustomBuildRules/TargetWithCustomBuildRules.h @@ -0,0 +1,12 @@ +// +// TargetWithCustomBuildRules.h +// TargetWithCustomBuildRules +// +// Created by Pedro Piñera Buendía on 06.07.23. +// + +#import + +@interface TargetWithCustomBuildRules : NSObject + +@end diff --git a/Fixtures/TargetWithCustomBuildRules/TargetWithCustomBuildRules/TargetWithCustomBuildRules.m b/Fixtures/TargetWithCustomBuildRules/TargetWithCustomBuildRules/TargetWithCustomBuildRules.m new file mode 100644 index 000000000..3728f76f1 --- /dev/null +++ b/Fixtures/TargetWithCustomBuildRules/TargetWithCustomBuildRules/TargetWithCustomBuildRules.m @@ -0,0 +1,12 @@ +// +// TargetWithCustomBuildRules.m +// TargetWithCustomBuildRules +// +// Created by Pedro Piñera Buendía on 06.07.23. +// + +#import "TargetWithCustomBuildRules.h" + +@implementation TargetWithCustomBuildRules + +@end diff --git a/Sources/XcodeProj/Objects/BuildPhase/PBXBuildRule.swift b/Sources/XcodeProj/Objects/BuildPhase/PBXBuildRule.swift index aadf215cc..592cded4a 100644 --- a/Sources/XcodeProj/Objects/BuildPhase/PBXBuildRule.swift +++ b/Sources/XcodeProj/Objects/BuildPhase/PBXBuildRule.swift @@ -18,6 +18,9 @@ public final class PBXBuildRule: PBXObject { /// Element name. public var name: String? + + /// The discovered dependency file to use + public var dependencyFile: String? /// Element output files. public var outputFiles: [String] @@ -41,6 +44,7 @@ public final class PBXBuildRule: PBXObject { isEditable: Bool = true, filePatterns: String? = nil, name: String? = nil, + dependencyFile: String? = nil, outputFiles: [String] = [], inputFiles: [String]? = nil, outputFilesCompilerFlags: [String]? = nil, @@ -51,6 +55,7 @@ public final class PBXBuildRule: PBXObject { self.fileType = fileType self.isEditable = isEditable self.name = name + self.dependencyFile = dependencyFile self.outputFiles = outputFiles self.inputFiles = inputFiles self.outputFilesCompilerFlags = outputFilesCompilerFlags @@ -67,6 +72,7 @@ public final class PBXBuildRule: PBXObject { case fileType case isEditable case name + case dependencyFile case outputFiles case inputFiles case outputFilesCompilerFlags @@ -81,6 +87,7 @@ public final class PBXBuildRule: PBXObject { fileType = try container.decodeIfPresent(.fileType) ?? "" isEditable = try container.decodeIntBool(.isEditable) name = try container.decodeIfPresent(.name) + dependencyFile = try container.decodeIfPresent(.dependencyFile) outputFiles = try container.decodeIfPresent(.outputFiles) ?? [] inputFiles = try container.decodeIfPresent(.inputFiles) outputFilesCompilerFlags = try container.decodeIfPresent(.outputFilesCompilerFlags) @@ -104,6 +111,9 @@ extension PBXBuildRule: PlistSerializable { var dictionary: [CommentedString: PlistValue] = [:] dictionary["isa"] = .string(CommentedString(PBXBuildRule.isa)) dictionary["compilerSpec"] = .string(CommentedString(compilerSpec)) + if let dependencyFile = dependencyFile { + dictionary["dependencyFile"] = .string(CommentedString(dependencyFile)) + } if let filePatterns = filePatterns { dictionary["filePatterns"] = .string(CommentedString(filePatterns)) } diff --git a/Sources/XcodeProj/Project/Xcode.swift b/Sources/XcodeProj/Project/Xcode.swift index 4d8a1d154..2fb2385b5 100644 --- a/Sources/XcodeProj/Project/Xcode.swift +++ b/Sources/XcodeProj/Project/Xcode.swift @@ -29,10 +29,10 @@ public struct Xcode { public static let objectVersion: UInt = 55 /// Last known upgrade check. - public static let upgradeCheck = "1240" + public static let upgradeCheck = "1250" /// Last known Swift upgrade check. - public static let swiftUpgradeCheck = "1240" + public static let swiftUpgradeCheck = "1250" } /// Default values. @@ -41,10 +41,19 @@ public struct Xcode { public static let objectVersion: UInt = 46 /// Default compatibility version. - public static let compatibilityVersion: String = "Xcode 13.0" + public static let compatibilityVersion: String = "Xcode 14.0" /// Default development region. public static let developmentRegion: String = "en" + + /// Default XCScheme format version + public static let xcschemeFormatVersion: String = "1.3" + + /// The last Swift upgrade check version + public static let lastSwiftUpgradeCheck: String = "1300" + + /// The last known Xcode upgrade check version. + public static let lastUpgradeCheck: String = "1300" } /// Inherited keywords used in build settings. diff --git a/Tests/XcodeProjTests/Objects/Project/PBXProjEncoderTests.swift b/Tests/XcodeProjTests/Objects/Project/PBXProjEncoderTests.swift index 9bd31a169..77f7feced 100644 --- a/Tests/XcodeProjTests/Objects/Project/PBXProjEncoderTests.swift +++ b/Tests/XcodeProjTests/Objects/Project/PBXProjEncoderTests.swift @@ -361,6 +361,26 @@ class PBXProjEncoderTests: XCTestCase { line = lines.validate(line: "23766C1B1EAA3484007A9026 /* Main.storyboard in Resources */,", after: line) line = lines.validate(line: "/* End PBXResourcesBuildPhase section */", after: line) } + + func test_build_rules_when_targetWithCustomBuildRulesProject() { + loadTargetWithCustomBuildRulesProject() + + let settings = PBXOutputSettings(projBuildPhaseFileOrder: .byFilename) + let lines = self.lines(fromFile: encodeProject(settings: settings)) + let beginGroup = lines.findLine("6CAD68202A56E31400662D8A /* PBXBuildRule */ = {") + var line = lines.findLine("isa = PBXBuildRule;", after: beginGroup) + line = lines.findLine("compilerSpec = com.apple.compilers.proxy.script;", after: beginGroup) + line = lines.findLine("dependencyFile = \"$(DERIVED_FILES_DIR)/$(INPUT_FILE_PATH).d\";", after: beginGroup) + line = lines.findLine("fileType = pattern.proxy;", after: beginGroup) + line = lines.findLine("inputFiles = (", after: beginGroup) + line = lines.findLine(");", after: beginGroup) + line = lines.findLine("isEditable = 1;", after: beginGroup) + line = lines.findLine("name = \"Custom 2 with dependency file\";", after: beginGroup) + line = lines.findLine("outputFiles = (", after: beginGroup) + line = lines.findLine(");", after: beginGroup) + line = lines.findLine("script = \"# Type a script or drag a script file from your workspace to insert its path.\\n\";", after: beginGroup) + line = lines.findLine("};", after: beginGroup) + } // MARK: - Test internals @@ -395,6 +415,10 @@ class PBXProjEncoderTests: XCTestCase { private func loadFileSharedAcrossTargetsProject() { proj = try! PBXProj(jsonDictionary: fileSharedAcrossTargetsDictionary().1) } + + private func loadTargetWithCustomBuildRulesProject() { + proj = try! PBXProj(jsonDictionary: targetWithCustomBuildRulesDictionary().1) + } } // MARK: - Line validations diff --git a/Tests/XcodeProjTests/Tests/Fixtures.swift b/Tests/XcodeProjTests/Tests/Fixtures.swift index 90b533b97..563fbc8a1 100644 --- a/Tests/XcodeProjTests/Tests/Fixtures.swift +++ b/Tests/XcodeProjTests/Tests/Fixtures.swift @@ -15,3 +15,9 @@ func fileSharedAcrossTargetsDictionary() -> (Path, [String: Any]) { let fileSharedAcrossTargetsProject = fixturesPath() + "FileSharedAcrossTargets/FileSharedAcrossTargets.xcodeproj/project.pbxproj" return (fileSharedAcrossTargetsProject, loadPlist(path: fileSharedAcrossTargetsProject.string)!) } + + +func targetWithCustomBuildRulesDictionary() -> (Path, [String: Any]) { + let targetWithCustomBuildRulesProject = fixturesPath() + "TargetWithCustomBuildRules/TargetWithCustomBuildRules.xcodeproj/project.pbxproj" + return (targetWithCustomBuildRulesProject, loadPlist(path: targetWithCustomBuildRulesProject.string)!) +} From c4d5f9d7f789dd944222be95938810947561e559 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20Pi=C3=B1era?= Date: Thu, 6 Jul 2023 16:03:43 +0200 Subject: [PATCH 287/678] Version 8.12.0 --- CHANGELOG.md | 2 ++ README.md | 2 +- RELEASE.md | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index aa3a96624..cdf58b144 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ ## Unreleased +## 8.12.0 + ### Added - `PBXBuildRule.dependencyFile` attribute [#781](https://github.com/tuist/XcodeProj/pull/781) by [@pepicrft](https://github.com/pepicrft). diff --git a/README.md b/README.md index f4e5460ff..161152e39 100644 --- a/README.md +++ b/README.md @@ -50,7 +50,7 @@ Add the dependency in your `Package.swift` file: let package = Package( name: "myproject", dependencies: [ - .package(url: "https://github.com/tuist/XcodeProj.git", .upToNextMajor(from: "8.11.0")), + .package(url: "https://github.com/tuist/XcodeProj.git", .upToNextMajor(from: "8.12.0")), ], targets: [ .target( diff --git a/RELEASE.md b/RELEASE.md index da533d05f..4318c0ddb 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -4,7 +4,7 @@ In this document you'll find all the necessary steps to release a new version of 1. Make sure you are in the `main` branch. 2. Determine the next version based on the unreleased changes. -3. Add the version section to the `CHANGELOG.md`, update the versions in the `README.md` and the `xcodeproj.podspec` file. +3. Add the version section to the `CHANGELOG.md`, update the versions in the `README.md`. 4. Commit the changes and tag them `git commit -m "Version x.y.z"` & `git tag x.y.z`. 5. Push the changes `git push origin main --tags` 6. Run the release checks by running `bundle exec rake release_check`. From 76fd8c3c19ae31c63fe22c8506278cd633f73751 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20Pi=C3=B1era?= Date: Thu, 6 Jul 2023 16:04:04 +0200 Subject: [PATCH 288/678] Update releasing steps --- RELEASE.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/RELEASE.md b/RELEASE.md index 4318c0ddb..4b8c5c729 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -7,5 +7,4 @@ In this document you'll find all the necessary steps to release a new version of 3. Add the version section to the `CHANGELOG.md`, update the versions in the `README.md`. 4. Commit the changes and tag them `git commit -m "Version x.y.z"` & `git tag x.y.z`. 5. Push the changes `git push origin main --tags` -6. Run the release checks by running `bundle exec rake release_check`. -8. Create the release on GitHub including the release notes from the `CHANGELOG.md`. +6. Create the release on GitHub including the release notes from the `CHANGELOG.md`. From 6e60fb55271c80f83a186c9b1b4982fd991cfc0a Mon Sep 17 00:00:00 2001 From: BarredEwe Date: Thu, 27 Jul 2023 10:01:36 +0300 Subject: [PATCH 289/678] Add `Build Tool Plug-ins` support (#784) - Updated `XCSwiftPackageProductDependency` to support parsing and creating build tool plugins Notes: - This is a continuation of https://github.com/tuist/XcodeProj/pull/733, to support **Build Tool Plug-ins**. (Thanks to @technocidal) --- .../XCSwiftPackageProductDependency.swift | 24 +++++++-- .../XcodeProj/Utils/ReferenceGenerator.swift | 9 ++++ ...XCSwiftPackageProductDependencyTests.swift | 54 +++++++++++++++++++ .../Utils/ReferenceGeneratorTests.swift | 18 ++++++- 4 files changed, 101 insertions(+), 4 deletions(-) diff --git a/Sources/XcodeProj/Objects/SwiftPackage/XCSwiftPackageProductDependency.swift b/Sources/XcodeProj/Objects/SwiftPackage/XCSwiftPackageProductDependency.swift index f7ae0d4c6..238e31f9a 100644 --- a/Sources/XcodeProj/Objects/SwiftPackage/XCSwiftPackageProductDependency.swift +++ b/Sources/XcodeProj/Objects/SwiftPackage/XCSwiftPackageProductDependency.swift @@ -18,12 +18,17 @@ public class XCSwiftPackageProductDependency: PBXContainerItem, PlistSerializabl } } + /// Is it a Plugin. + var isPlugin: Bool + // MARK: - Init public init(productName: String, - package: XCRemoteSwiftPackageReference? = nil) { + package: XCRemoteSwiftPackageReference? = nil, + isPlugin: Bool = false) { self.productName = productName packageReference = package?.reference + self.isPlugin = isPlugin super.init() } @@ -31,7 +36,16 @@ public class XCSwiftPackageProductDependency: PBXContainerItem, PlistSerializabl let objects = decoder.context.objects let repository = decoder.context.objectReferenceRepository let container = try decoder.container(keyedBy: CodingKeys.self) - productName = try container.decode(String.self, forKey: .productName) + let rawProductName = try container.decode(String.self, forKey: .productName) + let pluginPrefix = "plugin:" + if rawProductName.hasPrefix(pluginPrefix) { + productName = String(rawProductName.dropFirst(pluginPrefix.count)) + isPlugin = true + } else { + productName = rawProductName + isPlugin = false + } + if let packageString: String = try container.decodeIfPresent(.package) { packageReference = repository.getOrCreate(reference: packageString, objects: objects) } else { @@ -46,7 +60,11 @@ public class XCSwiftPackageProductDependency: PBXContainerItem, PlistSerializabl if let package = package { dictionary["package"] = .string(.init(package.reference.value, comment: "XCRemoteSwiftPackageReference \"\(package.name ?? "")\"")) } - dictionary["productName"] = .string(.init(productName)) + if isPlugin { + dictionary["productName"] = .string(.init("plugin:" + productName)) + } else { + dictionary["productName"] = .string(.init(productName)) + } return (key: CommentedString(reference, comment: productName), value: .dictionary(dictionary)) diff --git a/Sources/XcodeProj/Utils/ReferenceGenerator.swift b/Sources/XcodeProj/Utils/ReferenceGenerator.swift index 2336d82b6..f3e8946ef 100644 --- a/Sources/XcodeProj/Utils/ReferenceGenerator.swift +++ b/Sources/XcodeProj/Utils/ReferenceGenerator.swift @@ -99,6 +99,15 @@ final class ReferenceGenerator: ReferenceGenerating { fixReference(for: $0, identifiers: identifiers) } + // Build Tool Plug-ins + target.dependencies.forEach { + guard let product = $0.product, product.isPlugin else { return } + + var identifiers = identifiers + identifiers.append(product.productName) + fixReference(for: product, identifiers: identifiers) + } + fixReference(for: target, identifiers: identifiers) } } diff --git a/Tests/XcodeProjTests/Objects/SwiftPackage/XCSwiftPackageProductDependencyTests.swift b/Tests/XcodeProjTests/Objects/SwiftPackage/XCSwiftPackageProductDependencyTests.swift index 475712a2b..a473311a1 100644 --- a/Tests/XcodeProjTests/Objects/SwiftPackage/XCSwiftPackageProductDependencyTests.swift +++ b/Tests/XcodeProjTests/Objects/SwiftPackage/XCSwiftPackageProductDependencyTests.swift @@ -19,6 +19,25 @@ final class XCSwiftPackageProductDependencyTests: XCTestCase { // Then XCTAssertEqual(got.productName, "xcodeproj") XCTAssertEqual(got.packageReference?.value, "packageReference") + XCTAssertEqual(got.isPlugin, false) + } + + func test_initAsPlugin() throws { + // Given + let decoder = XcodeprojPropertyListDecoder() + let encoder = PropertyListEncoder() + let plist = ["reference": "reference", + "productName": "plugin:xcodeproj", + "package": "packageReference"] + let data = try encoder.encode(plist) + + // When + let got = try decoder.decode(XCSwiftPackageProductDependency.self, from: data) + + // Then + XCTAssertEqual(got.productName, "xcodeproj") + XCTAssertEqual(got.packageReference?.value, "packageReference") + XCTAssertEqual(got.isPlugin, true) } func test_plistValues() throws { @@ -39,6 +58,25 @@ final class XCSwiftPackageProductDependencyTests: XCTestCase { ])) } + func test_plistValuesAsPlugin() throws { + // Given + let proj = PBXProj() + let package = XCRemoteSwiftPackageReference(repositoryURL: "repository") + let subject = XCSwiftPackageProductDependency(productName: "product", + package: package, + isPlugin: true) + + // When + let got = try subject.plistKeyAndValue(proj: proj, reference: "reference") + + // Then + XCTAssertEqual(got.value, .dictionary([ + "isa": "XCSwiftPackageProductDependency", + "productName": "plugin:product", + "package": .string(.init(package.reference.value, comment: "XCRemoteSwiftPackageReference \"\(package.name ?? "")\"")), + ])) + } + func test_equal() { // Given let package = XCRemoteSwiftPackageReference(repositoryURL: "repository") @@ -50,4 +88,20 @@ final class XCSwiftPackageProductDependencyTests: XCTestCase { // Then XCTAssertEqual(first, second) } + + func test_isPlugin() { + // Given + let plugin = XCSwiftPackageProductDependency(productName: "product", isPlugin: true) + + // Then + XCTAssertTrue(plugin.isPlugin) + } + + func test_isNotPlugin() { + // Given + let plugin = XCSwiftPackageProductDependency(productName: "product") + + // Then + XCTAssertFalse(plugin.isPlugin) + } } diff --git a/Tests/XcodeProjTests/Utils/ReferenceGeneratorTests.swift b/Tests/XcodeProjTests/Utils/ReferenceGeneratorTests.swift index 988d2f106..08a3f9760 100644 --- a/Tests/XcodeProjTests/Utils/ReferenceGeneratorTests.swift +++ b/Tests/XcodeProjTests/Utils/ReferenceGeneratorTests.swift @@ -11,9 +11,13 @@ class ReferenceGeneratorTests: XCTestCase { let containerItemProxy = project.makeContainerItemProxy(fileReference: remoteProjectFileReference) let productReferenceProxy = project.makeReferenceProxy(containerItemProxy: containerItemProxy) let productsGroup = project.makeProductsGroup(children: [productReferenceProxy]) + let pluginDependency = project.makePluginDependency() + let (target, _) = project.makeTarget(productReferenceProxy: productReferenceProxy) + target.dependencies.append(pluginDependency) pbxProject.projectReferences.append(["ProductGroup": productsGroup.reference, "ProjectRef": remoteProjectFileReference.reference]) + pbxProject.targets.append(target) let referenceGenerator = ReferenceGenerator(outputSettings: PBXOutputSettings()) try referenceGenerator.generateReferences(proj: project) @@ -22,6 +26,7 @@ class ReferenceGeneratorTests: XCTestCase { XCTAssert(!containerItemProxy.reference.temporary) XCTAssert(!productReferenceProxy.reference.temporary) XCTAssert(!remoteProjectFileReference.reference.temporary) + XCTAssert(!pluginDependency.productReference!.temporary) } func test_projectReferencingRemoteXcodeprojBundle_generatesDeterministicIdentifiers() throws { @@ -32,7 +37,9 @@ class ReferenceGeneratorTests: XCTestCase { let containerItemProxy = project.makeContainerItemProxy(fileReference: remoteProjectFileReference) let productReferenceProxy = project.makeReferenceProxy(containerItemProxy: containerItemProxy) let productsGroup = project.makeProductsGroup(children: [productReferenceProxy]) + let pluginDependency = project.makePluginDependency() let (target, buildFile) = project.makeTarget(productReferenceProxy: productReferenceProxy) + target.dependencies.append(pluginDependency) pbxProject.projectReferences.append(["ProductGroup": productsGroup.reference, "ProjectRef": remoteProjectFileReference.reference]) @@ -41,7 +48,7 @@ class ReferenceGeneratorTests: XCTestCase { let referenceGenerator = ReferenceGenerator(outputSettings: PBXOutputSettings()) try referenceGenerator.generateReferences(proj: project) - return [remoteProjectFileReference, containerItemProxy, productReferenceProxy, productsGroup, buildFile] + return [remoteProjectFileReference, containerItemProxy, productReferenceProxy, productsGroup, buildFile, pluginDependency.productReference!.getObject()!] .map { $0.reference.value } } @@ -132,6 +139,15 @@ private extension PBXProj { return productsGroup } + func makePluginDependency() -> PBXTargetDependency { + let packageReference = XCRemoteSwiftPackageReference(repositoryURL: "repository") + let packageDependency = XCSwiftPackageProductDependency(productName: "product", package: packageReference, isPlugin: true) + let targetDependency = PBXTargetDependency(product: packageDependency) + add(object: targetDependency.productReference!.getObject()!) + + return targetDependency + } + func makeTarget(productReferenceProxy: PBXReferenceProxy) -> (target: PBXTarget, buildFile: PBXBuildFile) { let buildFile = PBXBuildFile(file: productReferenceProxy) add(object: buildFile) From f1341719e64cbe9d5ee56356513418600bff2219 Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Wed, 30 Aug 2023 16:40:31 +0200 Subject: [PATCH 290/678] docs: add Ibrahimhass as a contributor for code (#791) * docs: update README.md [skip ci] * docs: update .all-contributorsrc [skip ci] --------- Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com> --- .all-contributorsrc | 9 +++++++++ README.md | 3 ++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/.all-contributorsrc b/.all-contributorsrc index 52b9e73f7..2648eca06 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -292,6 +292,15 @@ "contributions": [ "code" ] + }, + { + "login": "Ibrahimhass", + "name": "Md. Ibrahim Hassan", + "avatar_url": "https://avatars.githubusercontent.com/u/16992520?v=4", + "profile": "https://github.com/Ibrahimhass", + "contributions": [ + "code" + ] } ], "contributorsPerLine": 7, diff --git a/README.md b/README.md index 161152e39..ec5a43e07 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ [![Netlify Status](https://api.netlify.com/api/v1/badges/005ef674-d103-4b05-a4d1-79413ce9d766/deploy-status)](https://app.netlify.com/sites/xcodeproj/deploys) -[![All Contributors](https://img.shields.io/badge/all_contributors-32-orange.svg?style=flat-square)](#contributors-) +[![All Contributors](https://img.shields.io/badge/all_contributors-33-orange.svg?style=flat-square)](#contributors-) [![Swift Package Manager](https://img.shields.io/badge/swift%20package%20manager-compatible-brightgreen.svg)](https://swift.org/package-manager/) @@ -181,6 +181,7 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d Christoffer Winterkvist
Christoffer Winterkvist

💻 Timothy Costa
Timothy Costa

💻 Mary
Mary

💻 + Md. Ibrahim Hassan
Md. Ibrahim Hassan

💻 From 82069394c2171eb3cf640341bf44050daaaa0e4f Mon Sep 17 00:00:00 2001 From: "Md. Ibrahim Hassan" Date: Wed, 30 Aug 2023 20:10:53 +0530 Subject: [PATCH 291/678] Get Data representation for `Writable` (#787) * get string representation of pbxproj * made the outputSettings with `default` value * reverted change to parameter * Refactored code * Added dataRepresentation() to Writable * fixed issue with code --- Sources/XcodeProj/Objects/Project/PBXProj.swift | 15 +++++++++++++-- .../XcodeProj/Project/WorkspaceSettings.swift | 16 +++++++++++++--- .../XcodeProj/Project/XCBreakpointList.swift | 17 +++++++++++++---- Sources/XcodeProj/Protocols/Writable.swift | 7 +++++++ Sources/XcodeProj/Scheme/XCScheme.swift | 17 +++++++++++++---- .../XcodeProj/Scheme/XCSchemeManagement.swift | 14 +++++++++++++- Sources/XcodeProj/Utils/XCConfig.swift | 17 +++++++++++++---- Sources/XcodeProj/Workspace/XCWorkspace.swift | 4 ++++ .../XcodeProj/Workspace/XCWorkspaceData.swift | 4 ++++ 9 files changed, 93 insertions(+), 18 deletions(-) diff --git a/Sources/XcodeProj/Objects/Project/PBXProj.swift b/Sources/XcodeProj/Objects/Project/PBXProj.swift index 1319ac847..71e241bd2 100644 --- a/Sources/XcodeProj/Objects/Project/PBXProj.swift +++ b/Sources/XcodeProj/Objects/Project/PBXProj.swift @@ -284,13 +284,24 @@ extension PBXProj: Equatable { // MARK: - Writable extension PBXProj: Writable { + public func dataRepresentation(outputSettings: PBXOutputSettings) throws -> Data? { + let encoder = PBXProjEncoder(outputSettings: outputSettings) + return try encoder.encode(proj: self).data(using: .utf8) + } + + public func dataRepresentation() throws -> Data? { + let encoder = PBXProjEncoder(outputSettings: PBXOutputSettings()) + return try encoder.encode(proj: self).data(using: .utf8) + } + public func write(path: Path, override: Bool) throws { try write(path: path, override: override, outputSettings: PBXOutputSettings()) } public func write(path: Path, override: Bool, outputSettings: PBXOutputSettings) throws { - let encoder = PBXProjEncoder(outputSettings: outputSettings) - let output = try encoder.encode(proj: self) + guard let output = try dataRepresentation(outputSettings: outputSettings) else { + return + } if override, path.exists { try path.delete() } diff --git a/Sources/XcodeProj/Project/WorkspaceSettings.swift b/Sources/XcodeProj/Project/WorkspaceSettings.swift index c8f775735..5d9b37e73 100644 --- a/Sources/XcodeProj/Project/WorkspaceSettings.swift +++ b/Sources/XcodeProj/Project/WorkspaceSettings.swift @@ -144,14 +144,24 @@ public class WorkspaceSettings: Codable, Equatable, Writable { /// - Parameter override: True if the content should be overriden if it already exists. /// - Throws: writing error if something goes wrong. public func write(path: Path, override: Bool) throws { - let encoder = PropertyListEncoder() - encoder.outputFormat = .xml - let data = try encoder.encode(self) + guard let data = try dataRepresentation() else { + return + } if override, path.exists { try path.delete() } try path.write(data) } + + /// Get the workspace settings. + /// + /// - Throws: reading error if something goes wrong. + public func dataRepresentation() throws -> Data? { + let encoder = PropertyListEncoder() + encoder.outputFormat = .xml + let data = try encoder.encode(self) + return data + } } extension WorkspaceSettings { diff --git a/Sources/XcodeProj/Project/XCBreakpointList.swift b/Sources/XcodeProj/Project/XCBreakpointList.swift index 1b7d8e6c6..361ce3e9f 100644 --- a/Sources/XcodeProj/Project/XCBreakpointList.swift +++ b/Sources/XcodeProj/Project/XCBreakpointList.swift @@ -403,6 +403,15 @@ public final class XCBreakpointList: Equatable, Writable { // MARK: - Writable public func write(path: Path, override: Bool) throws { + let document = getAEXMLDocument() + + if override, path.exists { + try path.delete() + } + try path.write(document.xmlXcodeFormat) + } + + private func getAEXMLDocument() -> AEXMLDocument { let document = AEXMLDocument() var schemeAttributes: [String: String] = [:] schemeAttributes["type"] = type @@ -412,11 +421,11 @@ public final class XCBreakpointList: Equatable, Writable { let breakpoints = AEXMLElement(name: "Breakpoints", value: nil, attributes: [:]) self.breakpoints.map { $0.xmlElement() }.forEach { breakpoints.addChild($0) } bucket.addChild(breakpoints) + return document + } - if override, path.exists { - try path.delete() - } - try path.write(document.xmlXcodeFormat) + public func dataRepresentation() throws -> Data? { + getAEXMLDocument().xmlXcodeFormat.data(using: .utf8) } // MARK: - Equatable diff --git a/Sources/XcodeProj/Protocols/Writable.swift b/Sources/XcodeProj/Protocols/Writable.swift index b41ecfcda..b21456756 100644 --- a/Sources/XcodeProj/Protocols/Writable.swift +++ b/Sources/XcodeProj/Protocols/Writable.swift @@ -16,6 +16,11 @@ public protocol Writable { /// - Parameter override: True if the content should be overridden if it already exists. /// - Throws: writing error if something goes wrong. func write(pathString: String, override: Bool) throws + + /// Gets the data representation of the object that conforms to the protocol. + /// + /// - Throws: error if encoding to Data fails. + func dataRepresentation() throws -> Data? } extension Writable { @@ -23,4 +28,6 @@ extension Writable { let path = Path(pathString) try write(path: path, override: override) } + + public func dataRepresentation() throws -> Data? { nil } } diff --git a/Sources/XcodeProj/Scheme/XCScheme.swift b/Sources/XcodeProj/Scheme/XCScheme.swift index c64a8e0fb..2333d790b 100644 --- a/Sources/XcodeProj/Scheme/XCScheme.swift +++ b/Sources/XcodeProj/Scheme/XCScheme.swift @@ -83,6 +83,18 @@ public final class XCScheme: Writable, Equatable { // MARK: - Writable public func write(path: Path, override: Bool) throws { + let document = getAEXMLDocument() + if override, path.exists { + try path.delete() + } + try path.write(document.xmlXcodeFormat) + } + + public func dataRepresentation() throws -> Data? { + getAEXMLDocument().xmlXcodeFormat.data(using: .utf8) + } + + private func getAEXMLDocument() -> AEXMLDocument { let document = AEXMLDocument() var schemeAttributes: [String: String] = [:] schemeAttributes["LastUpgradeVersion"] = lastUpgradeVersion @@ -109,10 +121,7 @@ public final class XCScheme: Writable, Equatable { if let wasCreatedForAppExtension = wasCreatedForAppExtension { scheme.attributes["wasCreatedForAppExtension"] = wasCreatedForAppExtension.xmlString } - if override, path.exists { - try path.delete() - } - try path.write(document.xmlXcodeFormat) + return document } // MARK: - Equatable diff --git a/Sources/XcodeProj/Scheme/XCSchemeManagement.swift b/Sources/XcodeProj/Scheme/XCSchemeManagement.swift index 09cc01d8a..4c00d95ca 100644 --- a/Sources/XcodeProj/Scheme/XCSchemeManagement.swift +++ b/Sources/XcodeProj/Scheme/XCSchemeManagement.swift @@ -138,9 +138,21 @@ public struct XCSchemeManagement: Codable, Equatable, Writable { try path.delete() } + let encoder = getEncoder() + try encoder.encode(self).write(to: path.url) + } + + /// Gets the data representation of the property list representation of the object. + /// + /// - Throws: Error if encoding fails. + public func dataRepresentation() throws -> Data? { + return try getEncoder().encode(self) + } + + private func getEncoder() -> PropertyListEncoder { let encoder = PropertyListEncoder() encoder.outputFormat = .xml - try encoder.encode(self).write(to: path.url) + return encoder } // MARK: - Codable diff --git a/Sources/XcodeProj/Utils/XCConfig.swift b/Sources/XcodeProj/Utils/XCConfig.swift index 640ad7668..11f25784d 100644 --- a/Sources/XcodeProj/Utils/XCConfig.swift +++ b/Sources/XcodeProj/Utils/XCConfig.swift @@ -143,15 +143,24 @@ extension XCConfig { extension XCConfig: Writable { public func write(path: Path, override: Bool) throws { - var content = "" - content.append(writeIncludes()) - content.append("\n") - content.append(writeBuildSettings()) + let content = getContent() if override, path.exists { try path.delete() } try path.write(content) } + + public func dataRepresentation() throws -> Data? { + getContent().data(using: .utf8) + } + + private func getContent() -> String { + var content = "" + content.append(writeIncludes()) + content.append("\n") + content.append(writeBuildSettings()) + return content + } private func writeIncludes() -> String { var content = "" diff --git a/Sources/XcodeProj/Workspace/XCWorkspace.swift b/Sources/XcodeProj/Workspace/XCWorkspace.swift index a2b549a6d..4707d9305 100644 --- a/Sources/XcodeProj/Workspace/XCWorkspace.swift +++ b/Sources/XcodeProj/Workspace/XCWorkspace.swift @@ -67,6 +67,10 @@ public final class XCWorkspace: Writable, Equatable { try dataPath.mkpath() try data.write(path: dataPath) } + + public func dataRepresentation() throws -> Data? { + self.data.rawContents().data(using: .utf8) + } // MARK: - Equatable diff --git a/Sources/XcodeProj/Workspace/XCWorkspaceData.swift b/Sources/XcodeProj/Workspace/XCWorkspaceData.swift index 2c2ff3a92..9cd95c7c9 100644 --- a/Sources/XcodeProj/Workspace/XCWorkspaceData.swift +++ b/Sources/XcodeProj/Workspace/XCWorkspaceData.swift @@ -55,6 +55,10 @@ extension XCWorkspaceData: Writable { } try path.write(rawXml) } + + public func dataRepresentation() throws -> Data? { + rawContents().data(using: .utf8) + } } // MARK: - XCWorkspaceDataElement AEXMLElement decoding and encoding From 16591987d92be03d6407f5083fab46e0b9cfe271 Mon Sep 17 00:00:00 2001 From: Kas Date: Wed, 30 Aug 2023 15:41:37 +0100 Subject: [PATCH 292/678] Add otf font files to known file types (#788) - The `allExtensions` dictionary is used to map known file type extensions to `lastKnownFileType` in the pbxproj - Adding `otf` font files to the list Test Plan: - Add any otf font file to Xcode manually - Examine the pbxproj and verify `file` is used as the `lastKnonwFileType` - Read and write the project using `XcodeProj` - Verify no diffs --- Sources/XcodeProj/Project/Xcode.swift | 1 + 1 file changed, 1 insertion(+) diff --git a/Sources/XcodeProj/Project/Xcode.swift b/Sources/XcodeProj/Project/Xcode.swift index 2fb2385b5..a6162b58f 100644 --- a/Sources/XcodeProj/Project/Xcode.swift +++ b/Sources/XcodeProj/Project/Xcode.swift @@ -234,6 +234,7 @@ public struct Xcode { "nib~": "wrapper.nib", "nqc": "sourcecode.nqc", "o": "compiled.mach-o.objfile", + "otf": "file", "octest": "wrapper.cfbundle", "p": "sourcecode.pascal", "pas": "sourcecode.pascal", From 39ae0c5b9ee4ec350e158b300de935dea136eec5 Mon Sep 17 00:00:00 2001 From: Pedro Date: Wed, 30 Aug 2023 16:43:12 +0200 Subject: [PATCH 293/678] Version 8.13.0 --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index cdf58b144..b9b72e006 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ ## Unreleased +## 8.13.0 + ## 8.12.0 ### Added From d5c0c2770d62f9aab78be071f13f3364835d5a65 Mon Sep 17 00:00:00 2001 From: Pedro Date: Wed, 30 Aug 2023 16:45:25 +0200 Subject: [PATCH 294/678] Add missing changelog --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index b9b72e006..c388dc47f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,8 +2,14 @@ ## Unreleased +## 8.14.0 + ## 8.13.0 +## Added + +- Added `Build Tool Plug-ins` support [#784](https://github.com/tuist/XcodeProj/pull/784) by [@BarredEwe](https://github.com/BarredEwe) + ## 8.12.0 ### Added From 6ce0af138315b69d8d8ecbf711337037f7cc8d8d Mon Sep 17 00:00:00 2001 From: Pedro Date: Wed, 30 Aug 2023 16:47:17 +0200 Subject: [PATCH 295/678] Update the CHANGELOG --- CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index c388dc47f..94939d594 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,11 @@ ## 8.14.0 +## Added + +- Add otf font files to known file types [#788](https://github.com/tuist/XcodeProj/pull/788) by[@kwridan](https://github.com/kwridan) +- Get Data representation for `Writable` [#787](https://github.com/tuist/XcodeProj/pull/787) by [@Ibrahimhass](https://github.com/Ibrahimhass) + ## 8.13.0 ## Added From 30df77be43bcc95efb691790adfd54d5edb4ced2 Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Fri, 8 Sep 2023 12:54:25 +0200 Subject: [PATCH 296/678] docs: add tatagrigory as a contributor for code (#794) * docs: update README.md [skip ci] * docs: update .all-contributorsrc [skip ci] --------- Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com> --- .all-contributorsrc | 9 +++++++++ README.md | 3 ++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/.all-contributorsrc b/.all-contributorsrc index 2648eca06..92c36d3e7 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -301,6 +301,15 @@ "contributions": [ "code" ] + }, + { + "login": "tatagrigory", + "name": "tatagrigory", + "avatar_url": "https://avatars.githubusercontent.com/u/5187973?v=4", + "profile": "https://github.com/tatagrigory", + "contributions": [ + "code" + ] } ], "contributorsPerLine": 7, diff --git a/README.md b/README.md index ec5a43e07..7ece3df0b 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ [![Netlify Status](https://api.netlify.com/api/v1/badges/005ef674-d103-4b05-a4d1-79413ce9d766/deploy-status)](https://app.netlify.com/sites/xcodeproj/deploys) -[![All Contributors](https://img.shields.io/badge/all_contributors-33-orange.svg?style=flat-square)](#contributors-) +[![All Contributors](https://img.shields.io/badge/all_contributors-34-orange.svg?style=flat-square)](#contributors-) [![Swift Package Manager](https://img.shields.io/badge/swift%20package%20manager-compatible-brightgreen.svg)](https://swift.org/package-manager/) @@ -182,6 +182,7 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d Timothy Costa
Timothy Costa

💻 Mary
Mary

💻 Md. Ibrahim Hassan
Md. Ibrahim Hassan

💻 + tatagrigory
tatagrigory

💻 From 3797181813ee963fe305d939232bc576d23ddbb0 Mon Sep 17 00:00:00 2001 From: tatagrigory Date: Fri, 8 Sep 2023 11:54:39 +0100 Subject: [PATCH 297/678] Add preferredScreenCaptureFormat to XCScheme.TestAcion (#792) --- .../xcshareddata/xcschemes/iOS.xcscheme | 1 + .../Extensions/AEXML+XcodeFormat.swift | 1 + .../XcodeProj/Scheme/XCScheme+TestAction.swift | 18 ++++++++++++++++++ .../XcodeProjTests/Scheme/XCSchemeTests.swift | 1 + 4 files changed, 21 insertions(+) diff --git a/Fixtures/iOS/Project.xcodeproj/xcshareddata/xcschemes/iOS.xcscheme b/Fixtures/iOS/Project.xcodeproj/xcshareddata/xcschemes/iOS.xcscheme index fb8299e4a..5ec735651 100644 --- a/Fixtures/iOS/Project.xcodeproj/xcshareddata/xcschemes/iOS.xcscheme +++ b/Fixtures/iOS/Project.xcodeproj/xcshareddata/xcschemes/iOS.xcscheme @@ -46,6 +46,7 @@ selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" shouldUseLaunchSchemeArgsEnv = "YES" + preferredScreenCaptureFormat = "screenshots" codeCoverageEnabled = "YES" onlyGenerateCoverageForSpecifiedTargets = "YES"> diff --git a/Sources/XcodeProj/Extensions/AEXML+XcodeFormat.swift b/Sources/XcodeProj/Extensions/AEXML+XcodeFormat.swift index 33a5a9b65..7e40ccc49 100644 --- a/Sources/XcodeProj/Extensions/AEXML+XcodeFormat.swift +++ b/Sources/XcodeProj/Extensions/AEXML+XcodeFormat.swift @@ -38,6 +38,7 @@ let attributesOrder: [String: [String]] = [ "shouldUseLaunchSchemeArgsEnv", "disableMainThreadChecker", "region", + "preferredScreenCaptureFormat", "codeCoverageEnabled", "onlyGenerateCoverageForSpecifiedTargets", ], diff --git a/Sources/XcodeProj/Scheme/XCScheme+TestAction.swift b/Sources/XcodeProj/Scheme/XCScheme+TestAction.swift index d95caeb15..0c7c3f706 100644 --- a/Sources/XcodeProj/Scheme/XCScheme+TestAction.swift +++ b/Sources/XcodeProj/Scheme/XCScheme+TestAction.swift @@ -7,6 +7,10 @@ extension XCScheme { public enum AttachmentLifetime: String { case keepAlways, keepNever } + + public enum ScreenCaptureFormat: String { + case screenshots, screenRecording + } // MARK: - Static @@ -35,6 +39,7 @@ extension XCScheme { public var language: String? public var region: String? public var systemAttachmentLifetime: AttachmentLifetime? + public var preferredScreenCaptureFormat: ScreenCaptureFormat? public var userAttachmentLifetime: AttachmentLifetime? public var customLLDBInitFile: String? @@ -63,6 +68,7 @@ extension XCScheme { language: String? = nil, region: String? = nil, systemAttachmentLifetime: AttachmentLifetime? = nil, + preferredScreenCaptureFormat: ScreenCaptureFormat? = nil, userAttachmentLifetime: AttachmentLifetime? = nil, customLLDBInitFile: String? = nil) { self.buildConfiguration = buildConfiguration @@ -86,6 +92,7 @@ extension XCScheme { self.language = language self.region = region self.systemAttachmentLifetime = systemAttachmentLifetime + self.preferredScreenCaptureFormat = preferredScreenCaptureFormat self.userAttachmentLifetime = userAttachmentLifetime self.customLLDBInitFile = customLLDBInitFile super.init(preActions, postActions) @@ -137,6 +144,8 @@ extension XCScheme { systemAttachmentLifetime = element.attributes["systemAttachmentLifetime"] .flatMap(AttachmentLifetime.init(rawValue:)) + preferredScreenCaptureFormat = element.attributes["preferredScreenCaptureFormat"] + .flatMap(ScreenCaptureFormat.init(rawValue:)) userAttachmentLifetime = element.attributes["userAttachmentLifetime"] .flatMap(AttachmentLifetime.init(rawValue:)) customLLDBInitFile = element.attributes["customLLDBInitFile"] @@ -177,6 +186,14 @@ extension XCScheme { attributes["disableMainThreadChecker"] = disableMainThreadChecker.xmlString } attributes["systemAttachmentLifetime"] = systemAttachmentLifetime?.rawValue + + switch preferredScreenCaptureFormat { + case .screenshots: + attributes["preferredScreenCaptureFormat"] = preferredScreenCaptureFormat?.rawValue + case .none, .screenRecording: + break + } + if case .keepAlways? = userAttachmentLifetime { attributes["userAttachmentLifetime"] = userAttachmentLifetime?.rawValue } @@ -253,6 +270,7 @@ extension XCScheme { language == rhs.language && region == rhs.region && systemAttachmentLifetime == rhs.systemAttachmentLifetime && + preferredScreenCaptureFormat == rhs.preferredScreenCaptureFormat && userAttachmentLifetime == rhs.userAttachmentLifetime && codeCoverageTargets == rhs.codeCoverageTargets && customLLDBInitFile == rhs.customLLDBInitFile diff --git a/Tests/XcodeProjTests/Scheme/XCSchemeTests.swift b/Tests/XcodeProjTests/Scheme/XCSchemeTests.swift index 3d1f16112..a7c047469 100644 --- a/Tests/XcodeProjTests/Scheme/XCSchemeTests.swift +++ b/Tests/XcodeProjTests/Scheme/XCSchemeTests.swift @@ -343,6 +343,7 @@ final class XCSchemeIntegrationTests: XCTestCase { XCTAssertEqual(scheme.testAction?.selectedDebuggerIdentifier, "Xcode.DebuggerFoundation.Debugger.LLDB") XCTAssertEqual(scheme.testAction?.selectedDebuggerIdentifier, "Xcode.DebuggerFoundation.Debugger.LLDB") XCTAssertEqual(scheme.testAction?.shouldUseLaunchSchemeArgsEnv, true) + XCTAssertEqual(scheme.testAction?.preferredScreenCaptureFormat, .screenshots) XCTAssertEqual(scheme.testAction?.codeCoverageEnabled, true) XCTAssertEqual(scheme.testAction?.onlyGenerateCoverageForSpecifiedTargets, true) XCTAssertEqual(scheme.testAction?.testables.first?.skipped, false) From e1b2111d47a120f91a10d34467d343245eb75437 Mon Sep 17 00:00:00 2001 From: Pedro Date: Fri, 8 Sep 2023 12:59:04 +0200 Subject: [PATCH 298/678] Update the CHANGELOG --- CHANGELOG.md | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 94939d594..e49e50391 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,16 +2,23 @@ ## Unreleased +## 8.15.0 + +### Added + +- Added preferredScreenCaptureFormat to XCScheme.TestAcion [#792](https://github.com/tuist/XcodeProj/pull/792) by [@tatagrigory](https://github.com/tatagrigory). + + ## 8.14.0 -## Added +### Added - Add otf font files to known file types [#788](https://github.com/tuist/XcodeProj/pull/788) by[@kwridan](https://github.com/kwridan) - Get Data representation for `Writable` [#787](https://github.com/tuist/XcodeProj/pull/787) by [@Ibrahimhass](https://github.com/Ibrahimhass) ## 8.13.0 -## Added +### Added - Added `Build Tool Plug-ins` support [#784](https://github.com/tuist/XcodeProj/pull/784) by [@BarredEwe](https://github.com/BarredEwe) From c3f69fce075037848ced8e3f6110b06d8303adb2 Mon Sep 17 00:00:00 2001 From: "Md. Ibrahim Hassan" Date: Thu, 12 Oct 2023 14:11:33 +0530 Subject: [PATCH 299/678] Create `PBXProj` class from the Data reprentation of a `pbxproj` file (#798) Resolves https://github.com/tuist/XcodeProj/issues/793 - Add the ability to instantiate `PBXProj` from `Data` representation - This complements https://github.com/tuist/XcodeProj/pull/787 where projects can now be serialised to `Data` representation rather than to disk Notes: - `PBXProj.name` isn't serialised as part of the serialised data representation and will need to be manually updated --- Sources/XcodeProj/Errors/Errors.swift | 3 ++ .../XcodeProj/Objects/Project/PBXProj.swift | 42 ++++++++++++++++++- .../Project/XcodeProjTests.swift | 14 +++++++ 3 files changed, 57 insertions(+), 2 deletions(-) diff --git a/Sources/XcodeProj/Errors/Errors.swift b/Sources/XcodeProj/Errors/Errors.swift index 6554f83fa..9dffd2468 100644 --- a/Sources/XcodeProj/Errors/Errors.swift +++ b/Sources/XcodeProj/Errors/Errors.swift @@ -183,6 +183,7 @@ enum PBXProjError: Error, CustomStringConvertible, Equatable { case pathIsAbsolute(Path) case multipleLocalPackages(productName: String) case multipleRemotePackages(productName: String) + case malformed var description: String { switch self { case let .notFound(path): @@ -201,6 +202,8 @@ enum PBXProjError: Error, CustomStringConvertible, Equatable { return "Found multiple top-level packages named \(productName)" case let .multipleRemotePackages(productName: productName): return "Can not resolve dependency \(productName) - conflicting version requirements" + case .malformed: + return "The .pbxproj is malformed." } } } diff --git a/Sources/XcodeProj/Objects/Project/PBXProj.swift b/Sources/XcodeProj/Objects/Project/PBXProj.swift index 71e241bd2..6248aed4e 100644 --- a/Sources/XcodeProj/Objects/Project/PBXProj.swift +++ b/Sources/XcodeProj/Objects/Project/PBXProj.swift @@ -66,6 +66,41 @@ public final class PBXProj: Decodable { objects: pbxproj.objects ) } + + /// Initializes the project with the data representation of pbxproj file. + /// + /// - Parameters: + /// - data: data representation of pbxproj file. + public convenience init(data: Data) throws { + var propertyListFormat = PropertyListSerialization.PropertyListFormat.xml + + let serialized = try PropertyListSerialization.propertyList( + from: data, + options: .mutableContainersAndLeaves, + format: &propertyListFormat + ) + + guard let pbxProjDictionary = serialized as? [String: Any] else { + throw PBXProjError.malformed + } + + let context = ProjectDecodingContext( + pbxProjValueReader: { key in + pbxProjDictionary[key] + } + ) + + let plistDecoder = XcodeprojPropertyListDecoder(context: context) + let pbxproj: PBXProj = try plistDecoder.decode(PBXProj.self, from: data) + + self.init( + rootObject: pbxproj.rootObject, + objectVersion: pbxproj.objectVersion, + archiveVersion: pbxproj.archiveVersion, + classes: pbxproj.classes, + objects: pbxproj.objects + ) + } private init( rootObject: PBXProject? = nil, @@ -146,8 +181,11 @@ public final class PBXProj: Decodable { options: .mutableContainersAndLeaves, format: &propertyListFormat ) - // swiftlint:disable:next force_cast - let pbxProjDictionary = serialized as! [String: Any] + + guard let pbxProjDictionary = serialized as? [String: Any] else { + throw PBXProjError.malformed + } + return (plistXML, pbxProjDictionary) } } diff --git a/Tests/XcodeProjTests/Project/XcodeProjTests.swift b/Tests/XcodeProjTests/Project/XcodeProjTests.swift index dabb8348d..3f4a81948 100644 --- a/Tests/XcodeProjTests/Project/XcodeProjTests.swift +++ b/Tests/XcodeProjTests/Project/XcodeProjTests.swift @@ -25,6 +25,20 @@ final class XcodeProjIntegrationTests: XCTestCase { initModel: XcodeProj.init(path:)) } + func test_initialize_PBXProj_with_data() throws { + // Given + let pbxprojPath = iosProjectPath + "project.pbxproj" + let pbxprojFromDisk = try PBXProj(path: pbxprojPath) + let pbxprojData = try Data(contentsOf: pbxprojPath.url) + + // When + let pbxprojFromData = try PBXProj(data: pbxprojData) + try pbxprojFromData.updateProjectName(path: pbxprojPath) + + // Then + XCTAssertEqual(pbxprojFromData, pbxprojFromDisk) + } + func test_write_includes_workspace_settings() throws { // Define workspace settings that should be written let workspaceSettings = WorkspaceSettings(buildSystem: .new, derivedDataLocationStyle: .default, autoCreateSchemes: false) From 8b5b4cff9d750b087081c569870baa6b451a0b30 Mon Sep 17 00:00:00 2001 From: Ruslan Alikhamov Date: Sun, 15 Oct 2023 12:29:48 +0400 Subject: [PATCH 300/678] Add XCLocalSwiftPackageReference Support (#799) - This implements parsing of new element type named `XCLocalSwiftPackageReference` which seems to be introduced with the release of Xcode 15. - This can be seen when adding a local package via the Package settings editor in the Xcode UI in Xcode 15 - `localPackages` are now exposed on `PBXProject` - To add clarify `remotePackages` was also introduced which is intended to replace the now deprecated `packages` property Test Plan: - Use `XcodeProj` to read and write a project with the new local package element - Verify `XcodeProj` is able to read the project without any issues - Verify the project written to disk is identical to the original one that was read --- CHANGELOG.md | 6 + .../MyOtherLocalPackage/.gitignore | 4 + .../MyOtherLocalPackage/Package.swift | 31 + .../MyOtherLocalPackage/README.md | 3 + .../MyOtherLocalPackage.swift | 3 + .../MyOtherLocalPackage/Tests/LinuxMain.swift | 7 + .../MyLocalPackageTests.swift | 15 + .../XCTestManifests.swift | 9 + .../project.pbxproj | 478 ++++++++++++++ .../project.pbxproj | 596 ++++++++++++++++++ .../project.pbxproj | 588 +++++++++++++++++ .../Objects/Project/PBXObjectParser.swift | 2 + .../Objects/Project/PBXObjects.swift | 6 + .../Objects/Project/PBXProjEncoder.swift | 6 + .../Objects/Project/PBXProject.swift | 57 +- .../Objects/Sourcery/Equality.generated.swift | 2 + .../XCLocalSwiftPackageReference.swift | 46 ++ .../XcodeProj/Utils/ReferenceGenerator.swift | 9 +- .../Objects/Project/PBXProjEncoderTests.swift | 163 +++-- .../Objects/Project/PBXProjectTests.swift | 4 +- .../XCLocalSwiftPackageReferenceTests.swift | 53 ++ Tests/XcodeProjTests/Tests/Fixtures.swift | 15 + 22 files changed, 2038 insertions(+), 65 deletions(-) create mode 100644 Fixtures/iOS/MyOtherLocalPackage/MyOtherLocalPackage/.gitignore create mode 100644 Fixtures/iOS/MyOtherLocalPackage/MyOtherLocalPackage/Package.swift create mode 100644 Fixtures/iOS/MyOtherLocalPackage/MyOtherLocalPackage/README.md create mode 100644 Fixtures/iOS/MyOtherLocalPackage/MyOtherLocalPackage/Sources/MyOtherLocalPackage/MyOtherLocalPackage.swift create mode 100644 Fixtures/iOS/MyOtherLocalPackage/MyOtherLocalPackage/Tests/LinuxMain.swift create mode 100644 Fixtures/iOS/MyOtherLocalPackage/MyOtherLocalPackage/Tests/MyOtherLocalPackageTests/MyLocalPackageTests.swift create mode 100644 Fixtures/iOS/MyOtherLocalPackage/MyOtherLocalPackage/Tests/MyOtherLocalPackageTests/XCTestManifests.swift create mode 100644 Fixtures/iOS/ProjectWithRelativeXCLocalSwiftPackageReference/ProjectWithRelativeXCLocalSwiftPackageReference.xcodeproj/project.pbxproj create mode 100644 Fixtures/iOS/ProjectWithXCLocalSwiftPackageReference.xcodeproj/project.pbxproj create mode 100644 Fixtures/iOS/ProjectWithXCLocalSwiftPackageReferences.xcodeproj/project.pbxproj create mode 100644 Sources/XcodeProj/Objects/SwiftPackage/XCLocalSwiftPackageReference.swift create mode 100644 Tests/XcodeProjTests/Objects/SwiftPackage/XCLocalSwiftPackageReferenceTests.swift diff --git a/CHANGELOG.md b/CHANGELOG.md index e49e50391..7cecbc305 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,12 @@ ## Unreleased +## 8.15.1 + +### Added + +- Added XCLocalSwiftPackageReference Support (#799)[https://github.com/tuist/XcodeProj/pull/799] by [@art-divin](https://github.com/art-divin). + ## 8.15.0 ### Added diff --git a/Fixtures/iOS/MyOtherLocalPackage/MyOtherLocalPackage/.gitignore b/Fixtures/iOS/MyOtherLocalPackage/MyOtherLocalPackage/.gitignore new file mode 100644 index 000000000..02c087533 --- /dev/null +++ b/Fixtures/iOS/MyOtherLocalPackage/MyOtherLocalPackage/.gitignore @@ -0,0 +1,4 @@ +.DS_Store +/.build +/Packages +/*.xcodeproj diff --git a/Fixtures/iOS/MyOtherLocalPackage/MyOtherLocalPackage/Package.swift b/Fixtures/iOS/MyOtherLocalPackage/MyOtherLocalPackage/Package.swift new file mode 100644 index 000000000..d36035345 --- /dev/null +++ b/Fixtures/iOS/MyOtherLocalPackage/MyOtherLocalPackage/Package.swift @@ -0,0 +1,31 @@ +// swift-tools-version:5.1 +// The swift-tools-version declares the minimum version of Swift required to build this package. + +import PackageDescription + +let package = Package( + name: "MyOtherLocalPackage", + products: [ + // Products define the executables and libraries produced by a package, and make them visible to other packages. + .library( + name: "MyOtherLocalPackage", + targets: ["MyOtherLocalPackage"] + ), + ], + dependencies: [ + // Dependencies declare other packages that this package depends on. + // .package(url: /* package url */, from: "1.0.0"), + ], + targets: [ + // Targets are the basic building blocks of a package. A target can define a module or a test suite. + // Targets can depend on other targets in this package, and on products in packages which this package depends on. + .target( + name: "MyOtherLocalPackage", + dependencies: [] + ), + .testTarget( + name: "MyOtherLocalPackageTests", + dependencies: ["MyOtherLocalPackage"] + ), + ] +) diff --git a/Fixtures/iOS/MyOtherLocalPackage/MyOtherLocalPackage/README.md b/Fixtures/iOS/MyOtherLocalPackage/MyOtherLocalPackage/README.md new file mode 100644 index 000000000..08352a959 --- /dev/null +++ b/Fixtures/iOS/MyOtherLocalPackage/MyOtherLocalPackage/README.md @@ -0,0 +1,3 @@ +# MyLocalPackage + +A description of this package. diff --git a/Fixtures/iOS/MyOtherLocalPackage/MyOtherLocalPackage/Sources/MyOtherLocalPackage/MyOtherLocalPackage.swift b/Fixtures/iOS/MyOtherLocalPackage/MyOtherLocalPackage/Sources/MyOtherLocalPackage/MyOtherLocalPackage.swift new file mode 100644 index 000000000..b0980e30e --- /dev/null +++ b/Fixtures/iOS/MyOtherLocalPackage/MyOtherLocalPackage/Sources/MyOtherLocalPackage/MyOtherLocalPackage.swift @@ -0,0 +1,3 @@ +struct MyOtherLocalPackage { + var text = "Hello, World!" +} diff --git a/Fixtures/iOS/MyOtherLocalPackage/MyOtherLocalPackage/Tests/LinuxMain.swift b/Fixtures/iOS/MyOtherLocalPackage/MyOtherLocalPackage/Tests/LinuxMain.swift new file mode 100644 index 000000000..b4283c4b5 --- /dev/null +++ b/Fixtures/iOS/MyOtherLocalPackage/MyOtherLocalPackage/Tests/LinuxMain.swift @@ -0,0 +1,7 @@ +import XCTest + +import MyLocalPackageTests + +var tests = [XCTestCaseEntry]() +tests += MyLocalPackageTests.allTests() +XCTMain(tests) diff --git a/Fixtures/iOS/MyOtherLocalPackage/MyOtherLocalPackage/Tests/MyOtherLocalPackageTests/MyLocalPackageTests.swift b/Fixtures/iOS/MyOtherLocalPackage/MyOtherLocalPackage/Tests/MyOtherLocalPackageTests/MyLocalPackageTests.swift new file mode 100644 index 000000000..e33a4c7c2 --- /dev/null +++ b/Fixtures/iOS/MyOtherLocalPackage/MyOtherLocalPackage/Tests/MyOtherLocalPackageTests/MyLocalPackageTests.swift @@ -0,0 +1,15 @@ +import XCTest +@testable import MyOtherLocalPackage + +final class MyLocalPackageTests: XCTestCase { + func testExample() { + // This is an example of a functional test case. + // Use XCTAssert and related functions to verify your tests produce the correct + // results. + XCTAssertEqual(MyOtherLocalPackage().text, "Hello, World!") + } + + static var allTests = [ + ("testExample", testExample), + ] +} diff --git a/Fixtures/iOS/MyOtherLocalPackage/MyOtherLocalPackage/Tests/MyOtherLocalPackageTests/XCTestManifests.swift b/Fixtures/iOS/MyOtherLocalPackage/MyOtherLocalPackage/Tests/MyOtherLocalPackageTests/XCTestManifests.swift new file mode 100644 index 000000000..513220367 --- /dev/null +++ b/Fixtures/iOS/MyOtherLocalPackage/MyOtherLocalPackage/Tests/MyOtherLocalPackageTests/XCTestManifests.swift @@ -0,0 +1,9 @@ +import XCTest + +#if !canImport(ObjectiveC) + public func allTests() -> [XCTestCaseEntry] { + [ + testCase(MyLocalPackageTests.allTests), + ] + } +#endif diff --git a/Fixtures/iOS/ProjectWithRelativeXCLocalSwiftPackageReference/ProjectWithRelativeXCLocalSwiftPackageReference.xcodeproj/project.pbxproj b/Fixtures/iOS/ProjectWithRelativeXCLocalSwiftPackageReference/ProjectWithRelativeXCLocalSwiftPackageReference.xcodeproj/project.pbxproj new file mode 100644 index 000000000..57ca00488 --- /dev/null +++ b/Fixtures/iOS/ProjectWithRelativeXCLocalSwiftPackageReference/ProjectWithRelativeXCLocalSwiftPackageReference.xcodeproj/project.pbxproj @@ -0,0 +1,478 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 60; + objects = { + +/* Begin PBXBuildFile section */ + 04D5C09F1F153824008A2F98 /* CoreData.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 04D5C09E1F153824008A2F98 /* CoreData.framework */; }; + C9FDF5C42AD603E50096A37A /* MyLocalPackage in Frameworks */ = {isa = PBXBuildFile; productRef = C9FDF5C32AD603E50096A37A /* MyLocalPackage */; }; + C9FDF5C72AD604310096A37A /* MyLocalPackage in Frameworks */ = {isa = PBXBuildFile; productRef = C9FDF5C62AD604310096A37A /* MyLocalPackage */; }; + C9FDF5CA2AD8AE400096A37A /* MyLocalPackage in Frameworks */ = {isa = PBXBuildFile; productRef = C9FDF5C92AD8AE400096A37A /* MyLocalPackage */; }; +/* End PBXBuildFile section */ + +/* Begin PBXBuildRule section */ + 6B7542351FE9CEDE003DFC29 /* PBXBuildRule */ = { + isa = PBXBuildRule; + compilerSpec = com.apple.compilers.proxy.script; + filePatterns = "*.myrule"; + fileType = pattern.proxy; + inputFiles = ( + ); + isEditable = 1; + outputFiles = ( + "$(DERIVED_FILE_DIR)/CompiledRule", + ); + script = $TOOL_PATH/transform; + }; +/* End PBXBuildRule section */ + +/* Begin PBXContainerItemProxy section */ + 23766C271EAA3484007A9026 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 23766C0A1EAA3484007A9026 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 23766C111EAA3484007A9026; + remoteInfo = iOS; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXCopyFilesBuildPhase section */ + 239688B71EBCD3B10014B321 /* CopyFiles */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 0; + dstSubfolderSpec = 0; + runOnlyForDeploymentPostprocessing = 1; + }; +/* End PBXCopyFilesBuildPhase section */ + +/* Begin PBXFileReference section */ + 04D5C09E1F153824008A2F98 /* CoreData.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreData.framework; path = System/Library/Frameworks/CoreData.framework; sourceTree = SDKROOT; }; + 23766C121EAA3484007A9026 /* iOS.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = iOS.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 23766C261EAA3484007A9026 /* iOSTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = iOSTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 23766C0F1EAA3484007A9026 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + C9FDF5CA2AD8AE400096A37A /* MyLocalPackage in Frameworks */, + C9FDF5C42AD603E50096A37A /* MyLocalPackage in Frameworks */, + 04D5C09F1F153824008A2F98 /* CoreData.framework in Frameworks */, + C9FDF5C72AD604310096A37A /* MyLocalPackage in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 23766C231EAA3484007A9026 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 04D5C09D1F153824008A2F98 /* Frameworks */ = { + isa = PBXGroup; + children = ( + 04D5C09E1F153824008A2F98 /* CoreData.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + 23766C091EAA3484007A9026 = { + isa = PBXGroup; + children = ( + 23766C131EAA3484007A9026 /* Products */, + 04D5C09D1F153824008A2F98 /* Frameworks */, + ); + sourceTree = ""; + }; + 23766C131EAA3484007A9026 /* Products */ = { + isa = PBXGroup; + children = ( + 23766C121EAA3484007A9026 /* iOS.app */, + 23766C261EAA3484007A9026 /* iOSTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXHeadersBuildPhase section */ + 23BB67531EE326A800BE9E79 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXHeadersBuildPhase section */ + +/* Begin PBXNativeTarget section */ + 23766C111EAA3484007A9026 /* iOS */ = { + isa = PBXNativeTarget; + buildConfigurationList = 23766C2F1EAA3484007A9026 /* Build configuration list for PBXNativeTarget "iOS" */; + buildPhases = ( + 23766C0E1EAA3484007A9026 /* Sources */, + 23766C0F1EAA3484007A9026 /* Frameworks */, + 23766C101EAA3484007A9026 /* Resources */, + 239688B71EBCD3B10014B321 /* CopyFiles */, + 23BB67521EE325E600BE9E79 /* Run Script */, + 23BB67531EE326A800BE9E79 /* Headers */, + ); + buildRules = ( + 6B7542351FE9CEDE003DFC29 /* PBXBuildRule */, + ); + dependencies = ( + ); + name = iOS; + packageProductDependencies = ( + C9FDF5C32AD603E50096A37A /* MyLocalPackage */, + C9FDF5C62AD604310096A37A /* MyLocalPackage */, + C9FDF5C92AD8AE400096A37A /* MyLocalPackage */, + ); + productName = iOS; + productReference = 23766C121EAA3484007A9026 /* iOS.app */; + productType = "com.apple.product-type.application"; + }; + 23766C251EAA3484007A9026 /* iOSTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 23766C321EAA3484007A9026 /* Build configuration list for PBXNativeTarget "iOSTests" */; + buildPhases = ( + 23766C221EAA3484007A9026 /* Sources */, + 23766C231EAA3484007A9026 /* Frameworks */, + 23766C241EAA3484007A9026 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 23766C281EAA3484007A9026 /* PBXTargetDependency */, + ); + name = iOSTests; + productName = iOSTests; + productReference = 23766C261EAA3484007A9026 /* iOSTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 23766C0A1EAA3484007A9026 /* Project object */ = { + isa = PBXProject; + attributes = { + LastSwiftUpdateCheck = 0830; + LastUpgradeCheck = 0830; + ORGANIZATIONNAME = es.ppinera; + TargetAttributes = { + 23766C111EAA3484007A9026 = { + CreatedOnToolsVersion = 8.3.1; + ProvisioningStyle = Automatic; + }; + 23766C251EAA3484007A9026 = { + CreatedOnToolsVersion = 8.3.1; + ProvisioningStyle = Automatic; + TestTargetID = 23766C111EAA3484007A9026; + }; + }; + }; + buildConfigurationList = 23766C0D1EAA3484007A9026 /* Build configuration list for PBXProject "ProjectWithXCLocalSwiftPackageReferences" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + English, + en, + Base, + ); + mainGroup = 23766C091EAA3484007A9026; + packageReferences = ( + C9FDF5C82AD8AE400096A37A /* XCLocalSwiftPackageReference "../MyLocalPackage" */, + ); + productRefGroup = 23766C131EAA3484007A9026 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 23766C111EAA3484007A9026 /* iOS */, + 23766C251EAA3484007A9026 /* iOSTests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 23766C101EAA3484007A9026 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 23766C241EAA3484007A9026 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXShellScriptBuildPhase section */ + 23BB67521EE325E600BE9E79 /* Run Script */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + "$(SRCROOT)/myfile", + ); + name = "Run Script"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "echo \"/test\"\n"; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 23766C0E1EAA3484007A9026 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 23766C221EAA3484007A9026 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 23766C281EAA3484007A9026 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 23766C111EAA3484007A9026 /* iOS */; + targetProxy = 23766C271EAA3484007A9026 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin XCBuildConfiguration section */ + 23766C2D1EAA3484007A9026 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 10.3; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + }; + name = Debug; + }; + 23766C2E1EAA3484007A9026 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 10.3; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = iphoneos; + SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 23766C301EAA3484007A9026 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + INFOPLIST_FILE = iOS/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = es.ppinera.iOS; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + }; + name = Debug; + }; + 23766C311EAA3484007A9026 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + INFOPLIST_FILE = iOS/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = es.ppinera.iOS; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + }; + name = Release; + }; + 23766C331EAA3484007A9026 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + INFOPLIST_FILE = iOSTests/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = es.ppinera.iOSTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/iOS.app/iOS"; + }; + name = Debug; + }; + 23766C341EAA3484007A9026 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + INFOPLIST_FILE = iOSTests/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = es.ppinera.iOSTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/iOS.app/iOS"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 23766C0D1EAA3484007A9026 /* Build configuration list for PBXProject "ProjectWithXCLocalSwiftPackageReferences" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 23766C2D1EAA3484007A9026 /* Debug */, + 23766C2E1EAA3484007A9026 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 23766C2F1EAA3484007A9026 /* Build configuration list for PBXNativeTarget "iOS" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 23766C301EAA3484007A9026 /* Debug */, + 23766C311EAA3484007A9026 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 23766C321EAA3484007A9026 /* Build configuration list for PBXNativeTarget "iOSTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 23766C331EAA3484007A9026 /* Debug */, + 23766C341EAA3484007A9026 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + +/* Begin XCLocalSwiftPackageReference section */ + C9FDF5C82AD8AE400096A37A /* XCLocalSwiftPackageReference "../MyLocalPackage" */ = { + isa = XCLocalSwiftPackageReference; + relativePath = ../MyLocalPackage; + }; +/* End XCLocalSwiftPackageReference section */ + +/* Begin XCSwiftPackageProductDependency section */ + C9FDF5C32AD603E50096A37A /* MyLocalPackage */ = { + isa = XCSwiftPackageProductDependency; + productName = MyLocalPackage; + }; + C9FDF5C62AD604310096A37A /* MyLocalPackage */ = { + isa = XCSwiftPackageProductDependency; + productName = MyLocalPackage; + }; + C9FDF5C92AD8AE400096A37A /* MyLocalPackage */ = { + isa = XCSwiftPackageProductDependency; + productName = MyLocalPackage; + }; +/* End XCSwiftPackageProductDependency section */ + }; + rootObject = 23766C0A1EAA3484007A9026 /* Project object */; +} diff --git a/Fixtures/iOS/ProjectWithXCLocalSwiftPackageReference.xcodeproj/project.pbxproj b/Fixtures/iOS/ProjectWithXCLocalSwiftPackageReference.xcodeproj/project.pbxproj new file mode 100644 index 000000000..a101d05e0 --- /dev/null +++ b/Fixtures/iOS/ProjectWithXCLocalSwiftPackageReference.xcodeproj/project.pbxproj @@ -0,0 +1,596 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 60; + objects = { + +/* Begin PBXBuildFile section */ + 04D5C09F1F153824008A2F98 /* CoreData.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 04D5C09E1F153824008A2F98 /* CoreData.framework */; }; + 04D5C0A31F153924008A2F98 /* Public.h in Headers */ = {isa = PBXBuildFile; fileRef = 04D5C0A01F153915008A2F98 /* Public.h */; }; + 04D5C0A41F153924008A2F98 /* Protected.h in Headers */ = {isa = PBXBuildFile; fileRef = 04D5C0A11F15391B008A2F98 /* Protected.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 04D5C0A51F153924008A2F98 /* Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 04D5C0A21F153921008A2F98 /* Private.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 23766C161EAA3484007A9026 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 23766C151EAA3484007A9026 /* AppDelegate.swift */; }; + 23766C181EAA3484007A9026 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 23766C171EAA3484007A9026 /* ViewController.swift */; }; + 23766C1B1EAA3484007A9026 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 23766C191EAA3484007A9026 /* Main.storyboard */; }; + 23766C1D1EAA3484007A9026 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 23766C1C1EAA3484007A9026 /* Assets.xcassets */; }; + 23766C201EAA3484007A9026 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 23766C1E1EAA3484007A9026 /* LaunchScreen.storyboard */; }; + 23766C2B1EAA3484007A9026 /* iOSTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 23766C2A1EAA3484007A9026 /* iOSTests.swift */; }; + 3CD1EADD205763E400DAEECB /* Model.xcdatamodeld in Sources */ = {isa = PBXBuildFile; fileRef = 3CD1EADB205763E400DAEECB /* Model.xcdatamodeld */; }; + 42AA1A1C22AAF48100428760 /* RxSwift in Frameworks */ = {isa = PBXBuildFile; productRef = 42AA1A1B22AAF48100428760 /* RxSwift */; }; + C9FDF5C42AD603E50096A37A /* MyLocalPackage in Frameworks */ = {isa = PBXBuildFile; productRef = C9FDF5C32AD603E50096A37A /* MyLocalPackage */; }; + C9FDF5C72AD604310096A37A /* MyLocalPackage in Frameworks */ = {isa = PBXBuildFile; productRef = C9FDF5C62AD604310096A37A /* MyLocalPackage */; }; +/* End PBXBuildFile section */ + +/* Begin PBXBuildRule section */ + 6B7542351FE9CEDE003DFC29 /* PBXBuildRule */ = { + isa = PBXBuildRule; + compilerSpec = com.apple.compilers.proxy.script; + filePatterns = "*.myrule"; + fileType = pattern.proxy; + inputFiles = ( + ); + isEditable = 1; + outputFiles = ( + "$(DERIVED_FILE_DIR)/CompiledRule", + ); + script = $TOOL_PATH/transform; + }; +/* End PBXBuildRule section */ + +/* Begin PBXContainerItemProxy section */ + 23766C271EAA3484007A9026 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 23766C0A1EAA3484007A9026 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 23766C111EAA3484007A9026; + remoteInfo = iOS; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXCopyFilesBuildPhase section */ + 239688B71EBCD3B10014B321 /* CopyFiles */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 0; + dstSubfolderSpec = 0; + runOnlyForDeploymentPostprocessing = 1; + }; +/* End PBXCopyFilesBuildPhase section */ + +/* Begin PBXFileReference section */ + 04D5C09E1F153824008A2F98 /* CoreData.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreData.framework; path = System/Library/Frameworks/CoreData.framework; sourceTree = SDKROOT; }; + 04D5C0A01F153915008A2F98 /* Public.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Public.h; sourceTree = ""; }; + 04D5C0A11F15391B008A2F98 /* Protected.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Protected.h; sourceTree = ""; }; + 04D5C0A21F153921008A2F98 /* Private.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Private.h; sourceTree = ""; }; + 23766C121EAA3484007A9026 /* iOS.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = iOS.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 23766C151EAA3484007A9026 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + 23766C171EAA3484007A9026 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; + 23766C1A1EAA3484007A9026 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 23766C1C1EAA3484007A9026 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + 23766C1F1EAA3484007A9026 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + 23766C211EAA3484007A9026 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 23766C261EAA3484007A9026 /* iOSTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = iOSTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + 23766C2A1EAA3484007A9026 /* iOSTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = iOSTests.swift; sourceTree = ""; }; + 23766C2C1EAA3484007A9026 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 23C1E0AF23657FB500B8D1EF /* iOS.xctestplan */ = {isa = PBXFileReference; lastKnownFileType = text; path = iOS.xctestplan; sourceTree = ""; }; + 3CD1EADC205763E400DAEECB /* Model.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = Model.xcdatamodel; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 23766C0F1EAA3484007A9026 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 42AA1A1C22AAF48100428760 /* RxSwift in Frameworks */, + C9FDF5C42AD603E50096A37A /* MyLocalPackage in Frameworks */, + 04D5C09F1F153824008A2F98 /* CoreData.framework in Frameworks */, + C9FDF5C72AD604310096A37A /* MyLocalPackage in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 23766C231EAA3484007A9026 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 04D5C09D1F153824008A2F98 /* Frameworks */ = { + isa = PBXGroup; + children = ( + 04D5C09E1F153824008A2F98 /* CoreData.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + 23766C091EAA3484007A9026 = { + isa = PBXGroup; + children = ( + 23C1E0AF23657FB500B8D1EF /* iOS.xctestplan */, + 23766C141EAA3484007A9026 /* iOS */, + 23766C291EAA3484007A9026 /* iOSTests */, + 23766C131EAA3484007A9026 /* Products */, + 04D5C09D1F153824008A2F98 /* Frameworks */, + ); + sourceTree = ""; + }; + 23766C131EAA3484007A9026 /* Products */ = { + isa = PBXGroup; + children = ( + 23766C121EAA3484007A9026 /* iOS.app */, + 23766C261EAA3484007A9026 /* iOSTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 23766C141EAA3484007A9026 /* iOS */ = { + isa = PBXGroup; + children = ( + 3CD1EADB205763E400DAEECB /* Model.xcdatamodeld */, + 3CD1EAD92057638200DAEECB /* GroupWithoutFolder */, + 23766C151EAA3484007A9026 /* AppDelegate.swift */, + 23766C171EAA3484007A9026 /* ViewController.swift */, + 23766C191EAA3484007A9026 /* Main.storyboard */, + 23766C1C1EAA3484007A9026 /* Assets.xcassets */, + 23766C1E1EAA3484007A9026 /* LaunchScreen.storyboard */, + 23766C211EAA3484007A9026 /* Info.plist */, + 04D5C0A01F153915008A2F98 /* Public.h */, + 04D5C0A11F15391B008A2F98 /* Protected.h */, + 04D5C0A21F153921008A2F98 /* Private.h */, + ); + path = iOS; + sourceTree = ""; + }; + 23766C291EAA3484007A9026 /* iOSTests */ = { + isa = PBXGroup; + children = ( + 23766C2A1EAA3484007A9026 /* iOSTests.swift */, + 23766C2C1EAA3484007A9026 /* Info.plist */, + ); + path = iOSTests; + sourceTree = ""; + }; + 3CD1EAD92057638200DAEECB /* GroupWithoutFolder */ = { + isa = PBXGroup; + children = ( + ); + name = GroupWithoutFolder; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXHeadersBuildPhase section */ + 23BB67531EE326A800BE9E79 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + 04D5C0A41F153924008A2F98 /* Protected.h in Headers */, + 04D5C0A51F153924008A2F98 /* Private.h in Headers */, + 04D5C0A31F153924008A2F98 /* Public.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXHeadersBuildPhase section */ + +/* Begin PBXNativeTarget section */ + 23766C111EAA3484007A9026 /* iOS */ = { + isa = PBXNativeTarget; + buildConfigurationList = 23766C2F1EAA3484007A9026 /* Build configuration list for PBXNativeTarget "iOS" */; + buildPhases = ( + 23766C0E1EAA3484007A9026 /* Sources */, + 23766C0F1EAA3484007A9026 /* Frameworks */, + 23766C101EAA3484007A9026 /* Resources */, + 239688B71EBCD3B10014B321 /* CopyFiles */, + 23BB67521EE325E600BE9E79 /* Run Script */, + 23BB67531EE326A800BE9E79 /* Headers */, + ); + buildRules = ( + 6B7542351FE9CEDE003DFC29 /* PBXBuildRule */, + ); + dependencies = ( + ); + name = iOS; + packageProductDependencies = ( + 42AA1A1B22AAF48100428760 /* RxSwift */, + C9FDF5C32AD603E50096A37A /* MyLocalPackage */, + C9FDF5C62AD604310096A37A /* MyLocalPackage */, + ); + productName = iOS; + productReference = 23766C121EAA3484007A9026 /* iOS.app */; + productType = "com.apple.product-type.application"; + }; + 23766C251EAA3484007A9026 /* iOSTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 23766C321EAA3484007A9026 /* Build configuration list for PBXNativeTarget "iOSTests" */; + buildPhases = ( + 23766C221EAA3484007A9026 /* Sources */, + 23766C231EAA3484007A9026 /* Frameworks */, + 23766C241EAA3484007A9026 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 23766C281EAA3484007A9026 /* PBXTargetDependency */, + ); + name = iOSTests; + productName = iOSTests; + productReference = 23766C261EAA3484007A9026 /* iOSTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 23766C0A1EAA3484007A9026 /* Project object */ = { + isa = PBXProject; + attributes = { + LastSwiftUpdateCheck = 0830; + LastUpgradeCheck = 0830; + ORGANIZATIONNAME = es.ppinera; + TargetAttributes = { + 23766C111EAA3484007A9026 = { + CreatedOnToolsVersion = 8.3.1; + ProvisioningStyle = Automatic; + }; + 23766C251EAA3484007A9026 = { + CreatedOnToolsVersion = 8.3.1; + ProvisioningStyle = Automatic; + TestTargetID = 23766C111EAA3484007A9026; + }; + }; + }; + buildConfigurationList = 23766C0D1EAA3484007A9026 /* Build configuration list for PBXProject "ProjectWithXCLocalSwiftPackageReference" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + English, + en, + Base, + ); + mainGroup = 23766C091EAA3484007A9026; + packageReferences = ( + 42AA19FF22AAF0D600428760 /* XCRemoteSwiftPackageReference "RxSwift" */, + C9FDF5C52AD604310096A37A /* XCLocalSwiftPackageReference "MyLocalPackage" */, + ); + productRefGroup = 23766C131EAA3484007A9026 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 23766C111EAA3484007A9026 /* iOS */, + 23766C251EAA3484007A9026 /* iOSTests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 23766C101EAA3484007A9026 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 23766C201EAA3484007A9026 /* LaunchScreen.storyboard in Resources */, + 23766C1D1EAA3484007A9026 /* Assets.xcassets in Resources */, + 23766C1B1EAA3484007A9026 /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 23766C241EAA3484007A9026 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXShellScriptBuildPhase section */ + 23BB67521EE325E600BE9E79 /* Run Script */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + "$(SRCROOT)/myfile", + ); + name = "Run Script"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "echo \"/test\"\n"; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 23766C0E1EAA3484007A9026 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 23766C181EAA3484007A9026 /* ViewController.swift in Sources */, + 23766C181EAA3484007A9026 /* ViewController.swift in Sources */, + 23766C161EAA3484007A9026 /* AppDelegate.swift in Sources */, + 3CD1EADD205763E400DAEECB /* Model.xcdatamodeld in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 23766C221EAA3484007A9026 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 23766C2B1EAA3484007A9026 /* iOSTests.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 23766C281EAA3484007A9026 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 23766C111EAA3484007A9026 /* iOS */; + targetProxy = 23766C271EAA3484007A9026 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + 23766C191EAA3484007A9026 /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 23766C1A1EAA3484007A9026 /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + 23766C1E1EAA3484007A9026 /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 23766C1F1EAA3484007A9026 /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 23766C2D1EAA3484007A9026 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 10.3; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + }; + name = Debug; + }; + 23766C2E1EAA3484007A9026 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 10.3; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = iphoneos; + SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 23766C301EAA3484007A9026 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + INFOPLIST_FILE = iOS/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = es.ppinera.iOS; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + }; + name = Debug; + }; + 23766C311EAA3484007A9026 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + INFOPLIST_FILE = iOS/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = es.ppinera.iOS; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + }; + name = Release; + }; + 23766C331EAA3484007A9026 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + BUNDLE_LOADER = "$(TEST_HOST)"; + INFOPLIST_FILE = iOSTests/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = es.ppinera.iOSTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/iOS.app/iOS"; + }; + name = Debug; + }; + 23766C341EAA3484007A9026 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + BUNDLE_LOADER = "$(TEST_HOST)"; + INFOPLIST_FILE = iOSTests/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = es.ppinera.iOSTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/iOS.app/iOS"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 23766C0D1EAA3484007A9026 /* Build configuration list for PBXProject "ProjectWithXCLocalSwiftPackageReference" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 23766C2D1EAA3484007A9026 /* Debug */, + 23766C2E1EAA3484007A9026 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 23766C2F1EAA3484007A9026 /* Build configuration list for PBXNativeTarget "iOS" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 23766C301EAA3484007A9026 /* Debug */, + 23766C311EAA3484007A9026 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 23766C321EAA3484007A9026 /* Build configuration list for PBXNativeTarget "iOSTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 23766C331EAA3484007A9026 /* Debug */, + 23766C341EAA3484007A9026 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + +/* Begin XCLocalSwiftPackageReference section */ + C9FDF5C52AD604310096A37A /* XCLocalSwiftPackageReference "MyLocalPackage" */ = { + isa = XCLocalSwiftPackageReference; + relativePath = MyLocalPackage; + }; +/* End XCLocalSwiftPackageReference section */ + +/* Begin XCRemoteSwiftPackageReference section */ + 42AA19FF22AAF0D600428760 /* XCRemoteSwiftPackageReference "RxSwift" */ = { + isa = XCRemoteSwiftPackageReference; + repositoryURL = "https://github.com/ReactiveX/RxSwift"; + requirement = { + kind = upToNextMajorVersion; + minimumVersion = 5.0.1; + }; + }; +/* End XCRemoteSwiftPackageReference section */ + +/* Begin XCSwiftPackageProductDependency section */ + 42AA1A1B22AAF48100428760 /* RxSwift */ = { + isa = XCSwiftPackageProductDependency; + package = 42AA19FF22AAF0D600428760 /* XCRemoteSwiftPackageReference "RxSwift" */; + productName = RxSwift; + }; + C9FDF5C32AD603E50096A37A /* MyLocalPackage */ = { + isa = XCSwiftPackageProductDependency; + productName = MyLocalPackage; + }; + C9FDF5C62AD604310096A37A /* MyLocalPackage */ = { + isa = XCSwiftPackageProductDependency; + productName = MyLocalPackage; + }; +/* End XCSwiftPackageProductDependency section */ + +/* Begin XCVersionGroup section */ + 3CD1EADB205763E400DAEECB /* Model.xcdatamodeld */ = { + isa = XCVersionGroup; + children = ( + 3CD1EADC205763E400DAEECB /* Model.xcdatamodel */, + ); + currentVersion = 3CD1EADC205763E400DAEECB /* Model.xcdatamodel */; + path = Model.xcdatamodeld; + sourceTree = ""; + versionGroupType = wrapper.xcdatamodel; + }; +/* End XCVersionGroup section */ + }; + rootObject = 23766C0A1EAA3484007A9026 /* Project object */; +} diff --git a/Fixtures/iOS/ProjectWithXCLocalSwiftPackageReferences.xcodeproj/project.pbxproj b/Fixtures/iOS/ProjectWithXCLocalSwiftPackageReferences.xcodeproj/project.pbxproj new file mode 100644 index 000000000..d0be14065 --- /dev/null +++ b/Fixtures/iOS/ProjectWithXCLocalSwiftPackageReferences.xcodeproj/project.pbxproj @@ -0,0 +1,588 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 60; + objects = { + +/* Begin PBXBuildFile section */ + 04D5C09F1F153824008A2F98 /* CoreData.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 04D5C09E1F153824008A2F98 /* CoreData.framework */; }; + 04D5C0A31F153924008A2F98 /* Public.h in Headers */ = {isa = PBXBuildFile; fileRef = 04D5C0A01F153915008A2F98 /* Public.h */; }; + 04D5C0A41F153924008A2F98 /* Protected.h in Headers */ = {isa = PBXBuildFile; fileRef = 04D5C0A11F15391B008A2F98 /* Protected.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 04D5C0A51F153924008A2F98 /* Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 04D5C0A21F153921008A2F98 /* Private.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 23766C161EAA3484007A9026 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 23766C151EAA3484007A9026 /* AppDelegate.swift */; }; + 23766C181EAA3484007A9026 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 23766C171EAA3484007A9026 /* ViewController.swift */; }; + 23766C1B1EAA3484007A9026 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 23766C191EAA3484007A9026 /* Main.storyboard */; }; + 23766C1D1EAA3484007A9026 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 23766C1C1EAA3484007A9026 /* Assets.xcassets */; }; + 23766C201EAA3484007A9026 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 23766C1E1EAA3484007A9026 /* LaunchScreen.storyboard */; }; + 23766C2B1EAA3484007A9026 /* iOSTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 23766C2A1EAA3484007A9026 /* iOSTests.swift */; }; + 3CD1EADD205763E400DAEECB /* Model.xcdatamodeld in Sources */ = {isa = PBXBuildFile; fileRef = 3CD1EADB205763E400DAEECB /* Model.xcdatamodeld */; }; + C9FDF5C42AD603E50096A37A /* MyLocalPackage in Frameworks */ = {isa = PBXBuildFile; productRef = C9FDF5C32AD603E50096A37A /* MyLocalPackage */; }; + C9FDF5C72AD604310096A37A /* MyLocalPackage in Frameworks */ = {isa = PBXBuildFile; productRef = C9FDF5C62AD604310096A37A /* MyLocalPackage */; }; + C9FDF5CD2AD8B3B50096A37A /* MyOtherLocalPackage in Frameworks */ = {isa = PBXBuildFile; productRef = C9FDF5CC2AD8B3B50096A37A /* MyOtherLocalPackage */; }; +/* End PBXBuildFile section */ + +/* Begin PBXBuildRule section */ + 6B7542351FE9CEDE003DFC29 /* PBXBuildRule */ = { + isa = PBXBuildRule; + compilerSpec = com.apple.compilers.proxy.script; + filePatterns = "*.myrule"; + fileType = pattern.proxy; + inputFiles = ( + ); + isEditable = 1; + outputFiles = ( + "$(DERIVED_FILE_DIR)/CompiledRule", + ); + script = $TOOL_PATH/transform; + }; +/* End PBXBuildRule section */ + +/* Begin PBXContainerItemProxy section */ + 23766C271EAA3484007A9026 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 23766C0A1EAA3484007A9026 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 23766C111EAA3484007A9026; + remoteInfo = iOS; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXCopyFilesBuildPhase section */ + 239688B71EBCD3B10014B321 /* CopyFiles */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 0; + dstSubfolderSpec = 0; + runOnlyForDeploymentPostprocessing = 1; + }; +/* End PBXCopyFilesBuildPhase section */ + +/* Begin PBXFileReference section */ + 04D5C09E1F153824008A2F98 /* CoreData.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreData.framework; path = System/Library/Frameworks/CoreData.framework; sourceTree = SDKROOT; }; + 04D5C0A01F153915008A2F98 /* Public.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Public.h; sourceTree = ""; }; + 04D5C0A11F15391B008A2F98 /* Protected.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Protected.h; sourceTree = ""; }; + 04D5C0A21F153921008A2F98 /* Private.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Private.h; sourceTree = ""; }; + 23766C121EAA3484007A9026 /* iOS.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = iOS.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 23766C151EAA3484007A9026 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + 23766C171EAA3484007A9026 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; + 23766C1A1EAA3484007A9026 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 23766C1C1EAA3484007A9026 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + 23766C1F1EAA3484007A9026 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + 23766C211EAA3484007A9026 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 23766C261EAA3484007A9026 /* iOSTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = iOSTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + 23766C2A1EAA3484007A9026 /* iOSTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = iOSTests.swift; sourceTree = ""; }; + 23766C2C1EAA3484007A9026 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 23C1E0AF23657FB500B8D1EF /* iOS.xctestplan */ = {isa = PBXFileReference; lastKnownFileType = text; path = iOS.xctestplan; sourceTree = ""; }; + 3CD1EADC205763E400DAEECB /* Model.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = Model.xcdatamodel; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 23766C0F1EAA3484007A9026 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + C9FDF5C42AD603E50096A37A /* MyLocalPackage in Frameworks */, + 04D5C09F1F153824008A2F98 /* CoreData.framework in Frameworks */, + C9FDF5CD2AD8B3B50096A37A /* MyOtherLocalPackage in Frameworks */, + C9FDF5C72AD604310096A37A /* MyLocalPackage in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 23766C231EAA3484007A9026 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 04D5C09D1F153824008A2F98 /* Frameworks */ = { + isa = PBXGroup; + children = ( + 04D5C09E1F153824008A2F98 /* CoreData.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + 23766C091EAA3484007A9026 = { + isa = PBXGroup; + children = ( + 23C1E0AF23657FB500B8D1EF /* iOS.xctestplan */, + 23766C141EAA3484007A9026 /* iOS */, + 23766C291EAA3484007A9026 /* iOSTests */, + 23766C131EAA3484007A9026 /* Products */, + 04D5C09D1F153824008A2F98 /* Frameworks */, + ); + sourceTree = ""; + }; + 23766C131EAA3484007A9026 /* Products */ = { + isa = PBXGroup; + children = ( + 23766C121EAA3484007A9026 /* iOS.app */, + 23766C261EAA3484007A9026 /* iOSTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 23766C141EAA3484007A9026 /* iOS */ = { + isa = PBXGroup; + children = ( + 3CD1EADB205763E400DAEECB /* Model.xcdatamodeld */, + 3CD1EAD92057638200DAEECB /* GroupWithoutFolder */, + 23766C151EAA3484007A9026 /* AppDelegate.swift */, + 23766C171EAA3484007A9026 /* ViewController.swift */, + 23766C191EAA3484007A9026 /* Main.storyboard */, + 23766C1C1EAA3484007A9026 /* Assets.xcassets */, + 23766C1E1EAA3484007A9026 /* LaunchScreen.storyboard */, + 23766C211EAA3484007A9026 /* Info.plist */, + 04D5C0A01F153915008A2F98 /* Public.h */, + 04D5C0A11F15391B008A2F98 /* Protected.h */, + 04D5C0A21F153921008A2F98 /* Private.h */, + ); + path = iOS; + sourceTree = ""; + }; + 23766C291EAA3484007A9026 /* iOSTests */ = { + isa = PBXGroup; + children = ( + 23766C2A1EAA3484007A9026 /* iOSTests.swift */, + 23766C2C1EAA3484007A9026 /* Info.plist */, + ); + path = iOSTests; + sourceTree = ""; + }; + 3CD1EAD92057638200DAEECB /* GroupWithoutFolder */ = { + isa = PBXGroup; + children = ( + ); + name = GroupWithoutFolder; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXHeadersBuildPhase section */ + 23BB67531EE326A800BE9E79 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + 04D5C0A41F153924008A2F98 /* Protected.h in Headers */, + 04D5C0A51F153924008A2F98 /* Private.h in Headers */, + 04D5C0A31F153924008A2F98 /* Public.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXHeadersBuildPhase section */ + +/* Begin PBXNativeTarget section */ + 23766C111EAA3484007A9026 /* iOS */ = { + isa = PBXNativeTarget; + buildConfigurationList = 23766C2F1EAA3484007A9026 /* Build configuration list for PBXNativeTarget "iOS" */; + buildPhases = ( + 23766C0E1EAA3484007A9026 /* Sources */, + 23766C0F1EAA3484007A9026 /* Frameworks */, + 23766C101EAA3484007A9026 /* Resources */, + 239688B71EBCD3B10014B321 /* CopyFiles */, + 23BB67521EE325E600BE9E79 /* Run Script */, + 23BB67531EE326A800BE9E79 /* Headers */, + ); + buildRules = ( + 6B7542351FE9CEDE003DFC29 /* PBXBuildRule */, + ); + dependencies = ( + ); + name = iOS; + packageProductDependencies = ( + C9FDF5C32AD603E50096A37A /* MyLocalPackage */, + C9FDF5C62AD604310096A37A /* MyLocalPackage */, + C9FDF5CC2AD8B3B50096A37A /* MyOtherLocalPackage */, + ); + productName = iOS; + productReference = 23766C121EAA3484007A9026 /* iOS.app */; + productType = "com.apple.product-type.application"; + }; + 23766C251EAA3484007A9026 /* iOSTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 23766C321EAA3484007A9026 /* Build configuration list for PBXNativeTarget "iOSTests" */; + buildPhases = ( + 23766C221EAA3484007A9026 /* Sources */, + 23766C231EAA3484007A9026 /* Frameworks */, + 23766C241EAA3484007A9026 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 23766C281EAA3484007A9026 /* PBXTargetDependency */, + ); + name = iOSTests; + productName = iOSTests; + productReference = 23766C261EAA3484007A9026 /* iOSTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 23766C0A1EAA3484007A9026 /* Project object */ = { + isa = PBXProject; + attributes = { + LastSwiftUpdateCheck = 0830; + LastUpgradeCheck = 0830; + ORGANIZATIONNAME = es.ppinera; + TargetAttributes = { + 23766C111EAA3484007A9026 = { + CreatedOnToolsVersion = 8.3.1; + ProvisioningStyle = Automatic; + }; + 23766C251EAA3484007A9026 = { + CreatedOnToolsVersion = 8.3.1; + ProvisioningStyle = Automatic; + TestTargetID = 23766C111EAA3484007A9026; + }; + }; + }; + buildConfigurationList = 23766C0D1EAA3484007A9026 /* Build configuration list for PBXProject "ProjectWithXCLocalSwiftPackageReferences" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + English, + en, + Base, + ); + mainGroup = 23766C091EAA3484007A9026; + packageReferences = ( + C9FDF5C52AD604310096A37A /* XCLocalSwiftPackageReference "MyLocalPackage" */, + C9FDF5CB2AD8B3B50096A37A /* XCLocalSwiftPackageReference "MyOtherLocalPackage/MyOtherLocalPackage" */, + ); + productRefGroup = 23766C131EAA3484007A9026 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 23766C111EAA3484007A9026 /* iOS */, + 23766C251EAA3484007A9026 /* iOSTests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 23766C101EAA3484007A9026 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 23766C201EAA3484007A9026 /* LaunchScreen.storyboard in Resources */, + 23766C1D1EAA3484007A9026 /* Assets.xcassets in Resources */, + 23766C1B1EAA3484007A9026 /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 23766C241EAA3484007A9026 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXShellScriptBuildPhase section */ + 23BB67521EE325E600BE9E79 /* Run Script */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + "$(SRCROOT)/myfile", + ); + name = "Run Script"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "echo \"/test\"\n"; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 23766C0E1EAA3484007A9026 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 23766C181EAA3484007A9026 /* ViewController.swift in Sources */, + 23766C181EAA3484007A9026 /* ViewController.swift in Sources */, + 23766C161EAA3484007A9026 /* AppDelegate.swift in Sources */, + 3CD1EADD205763E400DAEECB /* Model.xcdatamodeld in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 23766C221EAA3484007A9026 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 23766C2B1EAA3484007A9026 /* iOSTests.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 23766C281EAA3484007A9026 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 23766C111EAA3484007A9026 /* iOS */; + targetProxy = 23766C271EAA3484007A9026 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + 23766C191EAA3484007A9026 /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 23766C1A1EAA3484007A9026 /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + 23766C1E1EAA3484007A9026 /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 23766C1F1EAA3484007A9026 /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 23766C2D1EAA3484007A9026 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 10.3; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + }; + name = Debug; + }; + 23766C2E1EAA3484007A9026 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 10.3; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = iphoneos; + SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 23766C301EAA3484007A9026 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + INFOPLIST_FILE = iOS/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = es.ppinera.iOS; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + }; + name = Debug; + }; + 23766C311EAA3484007A9026 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + INFOPLIST_FILE = iOS/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = es.ppinera.iOS; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + }; + name = Release; + }; + 23766C331EAA3484007A9026 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + BUNDLE_LOADER = "$(TEST_HOST)"; + INFOPLIST_FILE = iOSTests/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = es.ppinera.iOSTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/iOS.app/iOS"; + }; + name = Debug; + }; + 23766C341EAA3484007A9026 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + BUNDLE_LOADER = "$(TEST_HOST)"; + INFOPLIST_FILE = iOSTests/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = es.ppinera.iOSTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/iOS.app/iOS"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 23766C0D1EAA3484007A9026 /* Build configuration list for PBXProject "ProjectWithXCLocalSwiftPackageReferences" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 23766C2D1EAA3484007A9026 /* Debug */, + 23766C2E1EAA3484007A9026 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 23766C2F1EAA3484007A9026 /* Build configuration list for PBXNativeTarget "iOS" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 23766C301EAA3484007A9026 /* Debug */, + 23766C311EAA3484007A9026 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 23766C321EAA3484007A9026 /* Build configuration list for PBXNativeTarget "iOSTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 23766C331EAA3484007A9026 /* Debug */, + 23766C341EAA3484007A9026 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + +/* Begin XCLocalSwiftPackageReference section */ + C9FDF5C52AD604310096A37A /* XCLocalSwiftPackageReference "MyLocalPackage" */ = { + isa = XCLocalSwiftPackageReference; + relativePath = MyLocalPackage; + }; + C9FDF5CB2AD8B3B50096A37A /* XCLocalSwiftPackageReference "MyOtherLocalPackage/MyOtherLocalPackage" */ = { + isa = XCLocalSwiftPackageReference; + relativePath = MyOtherLocalPackage/MyOtherLocalPackage; + }; +/* End XCLocalSwiftPackageReference section */ + +/* Begin XCSwiftPackageProductDependency section */ + C9FDF5C32AD603E50096A37A /* MyLocalPackage */ = { + isa = XCSwiftPackageProductDependency; + productName = MyLocalPackage; + }; + C9FDF5C62AD604310096A37A /* MyLocalPackage */ = { + isa = XCSwiftPackageProductDependency; + productName = MyLocalPackage; + }; + C9FDF5CC2AD8B3B50096A37A /* MyOtherLocalPackage */ = { + isa = XCSwiftPackageProductDependency; + productName = MyOtherLocalPackage; + }; +/* End XCSwiftPackageProductDependency section */ + +/* Begin XCVersionGroup section */ + 3CD1EADB205763E400DAEECB /* Model.xcdatamodeld */ = { + isa = XCVersionGroup; + children = ( + 3CD1EADC205763E400DAEECB /* Model.xcdatamodel */, + ); + currentVersion = 3CD1EADC205763E400DAEECB /* Model.xcdatamodel */; + path = Model.xcdatamodeld; + sourceTree = ""; + versionGroupType = wrapper.xcdatamodel; + }; +/* End XCVersionGroup section */ + }; + rootObject = 23766C0A1EAA3484007A9026 /* Project object */; +} diff --git a/Sources/XcodeProj/Objects/Project/PBXObjectParser.swift b/Sources/XcodeProj/Objects/Project/PBXObjectParser.swift index 5e868b364..ef80d0466 100644 --- a/Sources/XcodeProj/Objects/Project/PBXObjectParser.swift +++ b/Sources/XcodeProj/Objects/Project/PBXObjectParser.swift @@ -64,6 +64,8 @@ final class PBXObjectParser { return try decoder.decode(PBXBuildRule.self, from: data) case XCRemoteSwiftPackageReference.isa: return try decoder.decode(XCRemoteSwiftPackageReference.self, from: data) + case XCLocalSwiftPackageReference.isa: + return try decoder.decode(XCLocalSwiftPackageReference.self, from: data) case XCSwiftPackageProductDependency.isa: return try decoder.decode(XCSwiftPackageProductDependency.self, from: data) default: diff --git a/Sources/XcodeProj/Objects/Project/PBXObjects.swift b/Sources/XcodeProj/Objects/Project/PBXObjects.swift index 8262d8027..5f8a568f4 100644 --- a/Sources/XcodeProj/Objects/Project/PBXObjects.swift +++ b/Sources/XcodeProj/Objects/Project/PBXObjects.swift @@ -125,6 +125,11 @@ class PBXObjects: Equatable { lock.whileLocked { _remoteSwiftPackageReferences } } + private var _localSwiftPackageReferences: [PBXObjectReference: XCLocalSwiftPackageReference] = [:] + var localSwiftPackageReferences: [PBXObjectReference: XCLocalSwiftPackageReference] { + lock.whileLocked { _localSwiftPackageReferences } + } + private var _swiftPackageProductDependencies: [PBXObjectReference: XCSwiftPackageProductDependency] = [:] var swiftPackageProductDependencies: [PBXObjectReference: XCSwiftPackageProductDependency] { lock.whileLocked { _swiftPackageProductDependencies } @@ -212,6 +217,7 @@ class PBXObjects: Equatable { case let object as PBXRezBuildPhase: _carbonResourcesBuildPhases[objectReference] = object case let object as PBXBuildRule: _buildRules[objectReference] = object case let object as XCRemoteSwiftPackageReference: _remoteSwiftPackageReferences[objectReference] = object + case let object as XCLocalSwiftPackageReference: _localSwiftPackageReferences[objectReference] = object case let object as XCSwiftPackageProductDependency: _swiftPackageProductDependencies[objectReference] = object default: fatalError("Unhandled PBXObject type for \(object), this is likely a bug / todo") diff --git a/Sources/XcodeProj/Objects/Project/PBXProjEncoder.swift b/Sources/XcodeProj/Objects/Project/PBXProjEncoder.swift index bbe1c2533..771e38973 100644 --- a/Sources/XcodeProj/Objects/Project/PBXProjEncoder.swift +++ b/Sources/XcodeProj/Objects/Project/PBXProjEncoder.swift @@ -209,6 +209,12 @@ final class PBXProjEncoder { outputSettings: outputSettings, stateHolder: &stateHolder, to: &output) + try write(section: "XCLocalSwiftPackageReference", + proj: proj, + objects: proj.objects.localSwiftPackageReferences, + outputSettings: outputSettings, + stateHolder: &stateHolder, + to: &output) try write(section: "XCSwiftPackageProductDependency", proj: proj, objects: proj.objects.swiftPackageProductDependencies, diff --git a/Sources/XcodeProj/Objects/Project/PBXProject.swift b/Sources/XcodeProj/Objects/Project/PBXProject.swift index 86e3afaae..508ab3dcc 100644 --- a/Sources/XcodeProj/Objects/Project/PBXProject.swift +++ b/Sources/XcodeProj/Objects/Project/PBXProject.swift @@ -125,13 +125,43 @@ public final class PBXProject: PBXObject { } } - /// Package references. + /// Remote (`XCRemoteSwiftPackageReference`) and Local (`XCLocalSwiftPackageReference`) Package references. var packageReferences: [PBXObjectReference]? - /// Swift packages. + /// Remote Swift packages. + @available(*, deprecated, message: "use remotePackages or localPackages.") public var packages: [XCRemoteSwiftPackageReference] { + remotePackages + } + + /// Remote Swift packages. + public var remotePackages: [XCRemoteSwiftPackageReference] { + set { + var finalReferences: [PBXObjectReference] = packageReferences ?? [] + let newReferences = newValue.references() + for reference in newReferences { + if !finalReferences.contains(reference) { + finalReferences.append(reference) + } + } + packageReferences = finalReferences + } + get { + packageReferences?.objects() ?? [] + } + } + + /// Local Swift packages. + public var localPackages: [XCLocalSwiftPackageReference] { set { - packageReferences = newValue.references() + var finalReferences: [PBXObjectReference] = packageReferences ?? [] + let newReferences = newValue.references() + for reference in newReferences { + if !finalReferences.contains(reference) { + finalReferences.append(reference) + } + } + packageReferences = finalReferences } get { packageReferences?.objects() ?? [] @@ -268,6 +298,9 @@ public final class PBXProject: PBXObject { /// - projects: projects. /// - projectRoots: project roots. /// - targets: project targets. + /// - packages: project's remote packages. + /// - attributes: project's attributes. + /// - targetAttributes: project target's attributes. public init(name: String, buildConfigurationList: XCConfigurationList, compatibilityVersion: String, @@ -385,7 +418,7 @@ extension PBXProject { productName: String, versionRequirement: XCRemoteSwiftPackageReference.VersionRequirement) throws -> XCRemoteSwiftPackageReference { let reference: XCRemoteSwiftPackageReference - if let package = packages.first(where: { $0.repositoryURL == repositoryURL }) { + if let package = remotePackages.first(where: { $0.repositoryURL == repositoryURL }) { guard package.versionRequirement == versionRequirement else { throw PBXProjError.multipleRemotePackages(productName: productName) } @@ -393,7 +426,7 @@ extension PBXProject { } else { reference = XCRemoteSwiftPackageReference(repositoryURL: repositoryURL, versionRequirement: versionRequirement) try objects().add(object: reference) - packages.append(reference) + remotePackages.append(reference) } return reference @@ -484,10 +517,16 @@ extension PBXProject: PlistSerializable { return .string(CommentedString(targetReference.value, comment: target?.name)) }) - if !packages.isEmpty { - dictionary["packageReferences"] = PlistValue.array(packages.map { - .string(CommentedString($0.reference.value, comment: "XCRemoteSwiftPackageReference \"\($0.name ?? "")\"")) - }) + if !remotePackages.isEmpty || !localPackages.isEmpty { + let remotePackageReferences = remotePackages.map { + PlistValue.string(CommentedString($0.reference.value, comment: "XCRemoteSwiftPackageReference \"\($0.name ?? "")\"")) + } + let localPackageReferences = localPackages.map { + PlistValue.string(CommentedString($0.reference.value, comment: "XCLocalSwiftPackageReference \"\($0.name ?? "")\"")) + } + var finalPackageReferences = remotePackageReferences + finalPackageReferences.append(contentsOf: localPackageReferences) + dictionary["packageReferences"] = PlistValue.array(finalPackageReferences) } var plistAttributes: [String: Any] = attributes diff --git a/Sources/XcodeProj/Objects/Sourcery/Equality.generated.swift b/Sources/XcodeProj/Objects/Sourcery/Equality.generated.swift index 7b9c985e4..5d2a1943f 100644 --- a/Sources/XcodeProj/Objects/Sourcery/Equality.generated.swift +++ b/Sources/XcodeProj/Objects/Sourcery/Equality.generated.swift @@ -169,6 +169,8 @@ extension PBXProject { if !NSDictionary(dictionary: attributes).isEqual(NSDictionary(dictionary: rhs.attributes)) { return false } if !NSDictionary(dictionary: targetAttributeReferences).isEqual(NSDictionary(dictionary: rhs.targetAttributeReferences)) { return false } if packageReferences != rhs.packageReferences { return false } + if remotePackages != rhs.remotePackages { return false } + if localPackages != rhs.localPackages { return false } return super.isEqual(to: rhs) } } diff --git a/Sources/XcodeProj/Objects/SwiftPackage/XCLocalSwiftPackageReference.swift b/Sources/XcodeProj/Objects/SwiftPackage/XCLocalSwiftPackageReference.swift new file mode 100644 index 000000000..71566b5bc --- /dev/null +++ b/Sources/XcodeProj/Objects/SwiftPackage/XCLocalSwiftPackageReference.swift @@ -0,0 +1,46 @@ +import Foundation + +/// This element is an abstract parent for specialized targets. +public class XCLocalSwiftPackageReference: PBXContainerItem, PlistSerializable { + /// Repository url. + public var relativePath: String + + /// Initializes the local swift package reference with its attributes. + /// + /// - Parameters: + /// - repositoryPath: Package repository path. + public init(relativePath: String) { + self.relativePath = relativePath + super.init() + } + + enum CodingKeys: String, CodingKey { + case relativePath + } + + public required init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + relativePath = try container.decode(String.self, forKey: .relativePath) + + try super.init(from: decoder) + } + + /// It returns the name of the package reference. + public var name: String? { + relativePath + } + + func plistKeyAndValue(proj: PBXProj, reference: String) throws -> (key: CommentedString, value: PlistValue) { + var dictionary = try super.plistValues(proj: proj, reference: reference) + dictionary["isa"] = .string(CommentedString(XCLocalSwiftPackageReference.isa)) + dictionary["relativePath"] = .string(.init(relativePath)) + return (key: CommentedString(reference, comment: "XCLocalSwiftPackageReference \"\(name ?? "")\""), + value: .dictionary(dictionary)) + } + + override func isEqual(to object: Any?) -> Bool { + guard let rhs = object as? XCLocalSwiftPackageReference else { return false } + return isEqual(to: rhs) + } +} diff --git a/Sources/XcodeProj/Utils/ReferenceGenerator.swift b/Sources/XcodeProj/Utils/ReferenceGenerator.swift index f3e8946ef..e4a5f3da9 100644 --- a/Sources/XcodeProj/Utils/ReferenceGenerator.swift +++ b/Sources/XcodeProj/Utils/ReferenceGenerator.swift @@ -79,12 +79,19 @@ final class ReferenceGenerator: ReferenceGenerating { fixReference(for: project, identifiers: identifiers) // Packages - project.packages.forEach { + project.remotePackages.forEach { var identifiers = identifiers identifiers.append($0.repositoryURL ?? $0.name ?? "") fixReference(for: $0, identifiers: identifiers) } + // Packages + project.localPackages.forEach { + var identifiers = identifiers + identifiers.append($0.relativePath) + fixReference(for: $0, identifiers: identifiers) + } + // Targets let targets: [PBXTarget] = project.targetReferences.objects() targets.forEach { target in diff --git a/Tests/XcodeProjTests/Objects/Project/PBXProjEncoderTests.swift b/Tests/XcodeProjTests/Objects/Project/PBXProjEncoderTests.swift index 77f7feced..e7ebb6296 100644 --- a/Tests/XcodeProjTests/Objects/Project/PBXProjEncoderTests.swift +++ b/Tests/XcodeProjTests/Objects/Project/PBXProjEncoderTests.swift @@ -9,7 +9,7 @@ class PBXProjEncoderTests: XCTestCase { // MARK: - Header func test_writeHeaders_when_iOSProject() throws { - loadiOSProject() + try loadiOSProject() let lines = self.lines(fromFile: encodeProject()) XCTAssertEqual(583, lines.count) @@ -18,8 +18,8 @@ class PBXProjEncoderTests: XCTestCase { // MARK: - Internal file lists - func test_buildFiles_in_default_uuid_order_when_iOSProject() { - loadiOSProject() + func test_buildFiles_in_default_uuid_order_when_iOSProject() throws { + try loadiOSProject() let lines = self.lines(fromFile: encodeProject()) var line = lines.validate(line: "/* Begin PBXBuildFile section */") @@ -39,8 +39,8 @@ class PBXProjEncoderTests: XCTestCase { lines.validate(line: "/* End PBXBuildFile section */", onLineAfter: line) } - func test_buildFiles_in_filename_order_when_iOSProject() { - loadiOSProject() + func test_buildFiles_in_filename_order_when_iOSProject() throws { + try loadiOSProject() let settings = PBXOutputSettings(projFileListOrder: .byFilename) let lines = self.lines(fromFile: encodeProject(settings: settings)) @@ -61,8 +61,8 @@ class PBXProjEncoderTests: XCTestCase { lines.validate(line: "/* End PBXBuildFile section */", onLineAfter: line) } - func test_buildFiles_in_filename_order_when_fileSharedAcrossTargetsProject() { - loadFileSharedAcrossTargetsProject() + func test_buildFiles_in_filename_order_when_fileSharedAcrossTargetsProject() throws { + try loadFileSharedAcrossTargetsProject() let settings = PBXOutputSettings(projFileListOrder: .byFilename) let lines = self.lines(fromFile: encodeProject(settings: settings)) @@ -76,8 +76,8 @@ class PBXProjEncoderTests: XCTestCase { lines.validate(line: "/* End PBXBuildFile section */", onLineAfter: line) } - func test_file_references_in_default_uuid_order_when_iOSProject() { - loadiOSProject() + func test_file_references_in_default_uuid_order_when_iOSProject() throws { + try loadiOSProject() let lines = self.lines(fromFile: encodeProject()) var line = lines.validate(line: "/* Begin PBXFileReference section */") @@ -102,8 +102,8 @@ class PBXProjEncoderTests: XCTestCase { lines.validate(line: "/* End PBXFileReference section */", onLineAfter: line) } - func test_file_references_in_default_uuid_order_when_fileSharedAcrossTargetsProject() { - loadFileSharedAcrossTargetsProject() + func test_file_references_in_default_uuid_order_when_fileSharedAcrossTargetsProject() throws { + try loadFileSharedAcrossTargetsProject() let lines = self.lines(fromFile: encodeProject()) var line = lines.validate(line: "/* Begin PBXFileReference section */") @@ -117,8 +117,8 @@ class PBXProjEncoderTests: XCTestCase { lines.validate(line: "/* End PBXFileReference section */", onLineAfter: line) } - func test_file_references_in_filename_order_when_iOSProject() { - loadiOSProject() + func test_file_references_in_filename_order_when_iOSProject() throws { + try loadiOSProject() let settings = PBXOutputSettings(projFileListOrder: .byFilename) let lines = self.lines(fromFile: encodeProject(settings: settings)) @@ -143,8 +143,8 @@ class PBXProjEncoderTests: XCTestCase { lines.validate(line: "/* End PBXFileReference section */", onLineAfter: line) } - func test_file_references_in_filename_order_when_fileSharedAcrossTargetsProject() { - loadFileSharedAcrossTargetsProject() + func test_file_references_in_filename_order_when_fileSharedAcrossTargetsProject() throws { + try loadFileSharedAcrossTargetsProject() let settings = PBXOutputSettings(projFileListOrder: .byFilename) let lines = self.lines(fromFile: encodeProject(settings: settings)) @@ -160,8 +160,8 @@ class PBXProjEncoderTests: XCTestCase { // MARK: - Navigator - func test_navigator_groups_in_default_order_when_iOSProject() { - loadiOSProject() + func test_navigator_groups_in_default_order_when_iOSProject() throws { + try loadiOSProject() let lines = self.lines(fromFile: encodeProject()) @@ -203,8 +203,8 @@ class PBXProjEncoderTests: XCTestCase { lines.validate(line: "23766C2C1EAA3484007A9026 /* Info.plist */,", betweenLine: iosTestsChildrenStart, andLine: iosTestsChildrenEnd) } - func test_navigator_groups_in_filename_order_when_iOSProject() { - loadiOSProject() + func test_navigator_groups_in_filename_order_when_iOSProject() throws { + try loadiOSProject() let settings = PBXOutputSettings(projNavigatorFileOrder: .byFilename) let lines = self.lines(fromFile: encodeProject(settings: settings)) @@ -244,8 +244,8 @@ class PBXProjEncoderTests: XCTestCase { lines.validate(line: ");", after: line) } - func test_navigator_groups_in_filename_groups_first_order_when_iOSProject() { - loadiOSProject() + func test_navigator_groups_in_filename_groups_first_order_when_iOSProject() throws { + try loadiOSProject() let settings = PBXOutputSettings(projNavigatorFileOrder: .byFilenameGroupsFirst) let lines = self.lines(fromFile: encodeProject(settings: settings)) @@ -287,8 +287,8 @@ class PBXProjEncoderTests: XCTestCase { // MARK: - Build phases - func test_build_phase_sources_unsorted_when_iOSProject() { - loadiOSProject() + func test_build_phase_sources_unsorted_when_iOSProject() throws { + try loadiOSProject() let lines = self.lines(fromFile: encodeProject()) let beginGroup = lines.findLine("/* Begin PBXSourcesBuildPhase section */") @@ -299,8 +299,8 @@ class PBXProjEncoderTests: XCTestCase { lines.validate(line: "3CD1EADD205763E400DAEECB /* Model.xcdatamodeld in Sources */,", betweenLine: files, andLine: endGroup) } - func test_build_phase_sources_sorted_when_iOSProject() { - loadiOSProject() + func test_build_phase_sources_sorted_when_iOSProject() throws { + try loadiOSProject() let settings = PBXOutputSettings(projBuildPhaseFileOrder: .byFilename) let lines = self.lines(fromFile: encodeProject(settings: settings)) @@ -312,8 +312,8 @@ class PBXProjEncoderTests: XCTestCase { line = lines.validate(line: "/* End PBXSourcesBuildPhase section */", after: line) } - func test_build_phase_headers_unsorted_when_iOSProject() { - loadiOSProject() + func test_build_phase_headers_unsorted_when_iOSProject() throws { + try loadiOSProject() let lines = self.lines(fromFile: encodeProject()) let beginGroup = lines.findLine("/* Begin PBXHeadersBuildPhase section */") @@ -324,8 +324,8 @@ class PBXProjEncoderTests: XCTestCase { lines.validate(line: "04D5C0A31F153924008A2F98 /* Public.h in Headers */,", betweenLine: files, andLine: endGroup) } - func test_build_phase_headers_sorted_when_iOSProject() { - loadiOSProject() + func test_build_phase_headers_sorted_when_iOSProject() throws { + try loadiOSProject() let settings = PBXOutputSettings(projBuildPhaseFileOrder: .byFilename) let lines = self.lines(fromFile: encodeProject(settings: settings)) @@ -337,8 +337,8 @@ class PBXProjEncoderTests: XCTestCase { line = lines.validate(line: "/* End PBXHeadersBuildPhase section */", after: line) } - func test_build_phase_resources_unsorted_when_iOSProject() { - loadiOSProject() + func test_build_phase_resources_unsorted_when_iOSProject() throws { + try loadiOSProject() let lines = self.lines(fromFile: encodeProject()) let beginGroup = lines.findLine("/* Begin PBXResourcesBuildPhase section */") @@ -349,8 +349,8 @@ class PBXProjEncoderTests: XCTestCase { lines.validate(line: "23766C201EAA3484007A9026 /* LaunchScreen.storyboard in Resources */,", betweenLine: files, andLine: endGroup) } - func test_build_phase_resources_sorted_when_iOSProject() { - loadiOSProject() + func test_build_phase_resources_sorted_when_iOSProject() throws { + try loadiOSProject() let settings = PBXOutputSettings(projBuildPhaseFileOrder: .byFilename) let lines = self.lines(fromFile: encodeProject(settings: settings)) @@ -362,24 +362,69 @@ class PBXProjEncoderTests: XCTestCase { line = lines.validate(line: "/* End PBXResourcesBuildPhase section */", after: line) } - func test_build_rules_when_targetWithCustomBuildRulesProject() { - loadTargetWithCustomBuildRulesProject() + func test_build_rules_when_targetWithCustomBuildRulesProject() throws { + try loadTargetWithCustomBuildRulesProject() let settings = PBXOutputSettings(projBuildPhaseFileOrder: .byFilename) let lines = self.lines(fromFile: encodeProject(settings: settings)) let beginGroup = lines.findLine("6CAD68202A56E31400662D8A /* PBXBuildRule */ = {") - var line = lines.findLine("isa = PBXBuildRule;", after: beginGroup) - line = lines.findLine("compilerSpec = com.apple.compilers.proxy.script;", after: beginGroup) - line = lines.findLine("dependencyFile = \"$(DERIVED_FILES_DIR)/$(INPUT_FILE_PATH).d\";", after: beginGroup) - line = lines.findLine("fileType = pattern.proxy;", after: beginGroup) - line = lines.findLine("inputFiles = (", after: beginGroup) - line = lines.findLine(");", after: beginGroup) - line = lines.findLine("isEditable = 1;", after: beginGroup) - line = lines.findLine("name = \"Custom 2 with dependency file\";", after: beginGroup) - line = lines.findLine("outputFiles = (", after: beginGroup) - line = lines.findLine(");", after: beginGroup) - line = lines.findLine("script = \"# Type a script or drag a script file from your workspace to insert its path.\\n\";", after: beginGroup) - line = lines.findLine("};", after: beginGroup) + var line = lines.validate(line: "isa = PBXBuildRule;", after: beginGroup) + line = lines.validate(line: "compilerSpec = com.apple.compilers.proxy.script;", after: line) + line = lines.validate(line: "dependencyFile = \"$(DERIVED_FILES_DIR)/$(INPUT_FILE_PATH).d\";", after: line) + line = lines.validate(line: "fileType = pattern.proxy;", after: line) + line = lines.validate(line: "inputFiles = (", after: line) + line = lines.validate(line: ");", after: line) + line = lines.validate(line: "isEditable = 1;", after: line) + line = lines.validate(line: "name = \"Custom 2 with dependency file\";", after: line) + line = lines.validate(line: "outputFiles = (", after: line) + line = lines.validate(line: ");", after: line) + line = lines.validate(line: "script = \"# Type a script or drag a script file from your workspace to insert its path.\\n\";", after: line) + line = lines.validate(line: "};", after: line) + } + + func test_package_section_when_projectWithXCLocalSwiftPackageReference() throws { + try loadProjectWithXCLocalSwiftPackageReference() + + let settings = PBXOutputSettings(projBuildPhaseFileOrder: .byFilename) + let lines = self.lines(fromFile: encodeProject(settings: settings)) + let beginGroup = lines.findLine("/* Begin XCLocalSwiftPackageReference section */") + var line = lines.validate(line: "C9FDF5C52AD604310096A37A /* XCLocalSwiftPackageReference \"MyLocalPackage\" */ = {", after: beginGroup) + line = lines.validate(line: "isa = XCLocalSwiftPackageReference;", after: line) + line = lines.validate(line: "relativePath = MyLocalPackage;", after: line) + line = lines.validate(line: "};", after: line) + line = lines.validate(line: "/* End XCLocalSwiftPackageReference section */", after: line) + } + + func test_package_references_when_projectWithXCLocalSwiftPackageReference() throws { + try loadProjectWithXCLocalSwiftPackageReference() + + let settings = PBXOutputSettings(projBuildPhaseFileOrder: .byFilename) + let lines = self.lines(fromFile: encodeProject(settings: settings)) + let beginGroup = lines.findLine("packageReferences = (") + var line = lines.validate(line: "42AA19FF22AAF0D600428760 /* XCRemoteSwiftPackageReference \"RxSwift\" */,", after: beginGroup) + line = lines.validate(line: "C9FDF5C52AD604310096A37A /* XCLocalSwiftPackageReference \"MyLocalPackage\" */,", after: line) + line = lines.validate(line: ");", after: line) + } + + func test_package_references_when_projectWithRelativePathForXCLocalSwiftPackageReference() throws { + try loadProjectWithRelativeXCLocalSwiftPackageReference() + + let settings = PBXOutputSettings(projBuildPhaseFileOrder: .byFilename) + let lines = self.lines(fromFile: encodeProject(settings: settings)) + let beginGroup = lines.findLine("packageReferences = (") + var line = lines.validate(line: "C9FDF5C82AD8AE400096A37A /* XCLocalSwiftPackageReference \"../MyLocalPackage\" */,", after: beginGroup) + line = lines.validate(line: ");", after: line) + } + + func test_package_references_when_projectWithXCLocalSwiftPackageReferences() throws { + try loadProjectWithXCLocalSwiftPackageReferences() + + let settings = PBXOutputSettings(projBuildPhaseFileOrder: .byFilename) + let lines = self.lines(fromFile: encodeProject(settings: settings)) + let beginGroup = lines.findLine("packageReferences = (") + var line = lines.validate(line: "C9FDF5C52AD604310096A37A /* XCLocalSwiftPackageReference \"MyLocalPackage\" */,", after: beginGroup) + line = lines.validate(line: "C9FDF5CB2AD8B3B50096A37A /* XCLocalSwiftPackageReference \"MyOtherLocalPackage/MyOtherLocalPackage\" */,", after: line) + line = lines.validate(line: ");", after: line) } // MARK: - Test internals @@ -408,16 +453,28 @@ class PBXProjEncoderTests: XCTestCase { file.replacingOccurrences(of: "\t", with: "").components(separatedBy: "\n") } - private func loadiOSProject() { - proj = try! PBXProj(jsonDictionary: iosProjectDictionary().1) + private func loadiOSProject() throws { + proj = try PBXProj(jsonDictionary: iosProjectDictionary().1) } - private func loadFileSharedAcrossTargetsProject() { - proj = try! PBXProj(jsonDictionary: fileSharedAcrossTargetsDictionary().1) + private func loadFileSharedAcrossTargetsProject() throws { + proj = try PBXProj(jsonDictionary: fileSharedAcrossTargetsDictionary().1) } - private func loadTargetWithCustomBuildRulesProject() { - proj = try! PBXProj(jsonDictionary: targetWithCustomBuildRulesDictionary().1) + private func loadTargetWithCustomBuildRulesProject() throws { + proj = try PBXProj(jsonDictionary: targetWithCustomBuildRulesDictionary().1) + } + + private func loadProjectWithXCLocalSwiftPackageReference() throws { + proj = try PBXProj(jsonDictionary: iosProjectWithXCLocalSwiftPackageReference().1) + } + + private func loadProjectWithXCLocalSwiftPackageReferences() throws { + proj = try PBXProj(jsonDictionary: iosProjectWithXCLocalSwiftPackageReferences().1) + } + + private func loadProjectWithRelativeXCLocalSwiftPackageReference() throws { + proj = try PBXProj(jsonDictionary: iosProjectWithRelativeXCLocalSwiftPackageReferences().1) } } diff --git a/Tests/XcodeProjTests/Objects/Project/PBXProjectTests.swift b/Tests/XcodeProjTests/Objects/Project/PBXProjectTests.swift index 2fce790ca..d39befd18 100644 --- a/Tests/XcodeProjTests/Objects/Project/PBXProjectTests.swift +++ b/Tests/XcodeProjTests/Objects/Project/PBXProjectTests.swift @@ -137,7 +137,7 @@ final class PBXProjectTests: XCTestCase { targetName: "Target") // Then - XCTAssertEqual(remoteReference, project.packages.first) + XCTAssertEqual(remoteReference, project.remotePackages.first) XCTAssertEqual(remoteReference, objects.remoteSwiftPackageReferences.first?.value) XCTAssertEqual(remoteReference, objects.buildFiles.first?.value.product?.package) @@ -195,7 +195,7 @@ final class PBXProjectTests: XCTestCase { // Then XCTAssertEqual(packageProduct, secondPackageProduct) - XCTAssertEqual(project.packages.count, 1) + XCTAssertEqual(project.remotePackages.count, 1) XCTAssertEqual(target.packageProductDependencies, secondTarget.packageProductDependencies) XCTAssertNotEqual(buildPhase.files?.first?.hashValue, secondBuildPhase.files?.first?.hashValue) XCTAssertEqual(objects.swiftPackageProductDependencies.count, 1) diff --git a/Tests/XcodeProjTests/Objects/SwiftPackage/XCLocalSwiftPackageReferenceTests.swift b/Tests/XcodeProjTests/Objects/SwiftPackage/XCLocalSwiftPackageReferenceTests.swift new file mode 100644 index 000000000..9586ae352 --- /dev/null +++ b/Tests/XcodeProjTests/Objects/SwiftPackage/XCLocalSwiftPackageReferenceTests.swift @@ -0,0 +1,53 @@ +import Foundation +import XCTest + +@testable import XcodeProj + +final class XCLocalSwiftPackageReferenceTests: XCTestCase { + func test_init() throws { + // Given + let decoder = XcodeprojPropertyListDecoder() + let plist: [String: Any] = ["reference": "ref", + "relativePath": "path"] + let data = try PropertyListSerialization.data(fromPropertyList: plist, format: .xml, options: 0) + + // When + let got = try decoder.decode(XCLocalSwiftPackageReference.self, from: data) + + // Then + XCTAssertEqual(got.reference.value, "ref") + XCTAssertEqual(got.relativePath, "path") + } + + func test_plistValues() throws { + // When + let proj = PBXProj() + let subject = XCLocalSwiftPackageReference(relativePath: "repository") + + // Given + let got = try subject.plistKeyAndValue(proj: proj, reference: "ref") + + // Then + XCTAssertEqual(got.value, .dictionary([ + "isa": "XCLocalSwiftPackageReference", + "relativePath": "repository" + ])) + } + + func test_equal() { + // When + let first = XCLocalSwiftPackageReference(relativePath: "repository") + let second = XCLocalSwiftPackageReference(relativePath: "repository") + + // Then + XCTAssertEqual(first, second) + } + + func test_name() { + // When + let subject = XCLocalSwiftPackageReference(relativePath: "tuist/xcodeproj") + + // Then + XCTAssertEqual(subject.name, "tuist/xcodeproj") + } +} diff --git a/Tests/XcodeProjTests/Tests/Fixtures.swift b/Tests/XcodeProjTests/Tests/Fixtures.swift index 563fbc8a1..b90f5d149 100644 --- a/Tests/XcodeProjTests/Tests/Fixtures.swift +++ b/Tests/XcodeProjTests/Tests/Fixtures.swift @@ -21,3 +21,18 @@ func targetWithCustomBuildRulesDictionary() -> (Path, [String: Any]) { let targetWithCustomBuildRulesProject = fixturesPath() + "TargetWithCustomBuildRules/TargetWithCustomBuildRules.xcodeproj/project.pbxproj" return (targetWithCustomBuildRulesProject, loadPlist(path: targetWithCustomBuildRulesProject.string)!) } + +func iosProjectWithXCLocalSwiftPackageReference() -> (Path, [String: Any]) { + let iosProjectWithXCLocalSwiftPackageReference = fixturesPath() + "iOS/ProjectWithXCLocalSwiftPackageReference.xcodeproj/project.pbxproj" + return (iosProjectWithXCLocalSwiftPackageReference, loadPlist(path: iosProjectWithXCLocalSwiftPackageReference.string)!) +} + +func iosProjectWithRelativeXCLocalSwiftPackageReferences() -> (Path, [String: Any]) { + let iosProjectWithXCLocalSwiftPackageReference = fixturesPath() + "iOS/ProjectWithRelativeXCLocalSwiftPackageReference/ProjectWithRelativeXCLocalSwiftPackageReference.xcodeproj/project.pbxproj" + return (iosProjectWithXCLocalSwiftPackageReference, loadPlist(path: iosProjectWithXCLocalSwiftPackageReference.string)!) +} + +func iosProjectWithXCLocalSwiftPackageReferences() -> (Path, [String: Any]) { + let iosProjectWithXCLocalSwiftPackageReference = fixturesPath() + "iOS/ProjectWithXCLocalSwiftPackageReferences.xcodeproj/project.pbxproj" + return (iosProjectWithXCLocalSwiftPackageReference, loadPlist(path: iosProjectWithXCLocalSwiftPackageReference.string)!) +} From 069cdafc08cd8519104a7ae2db6ac1916e17ca0d Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Sun, 15 Oct 2023 09:30:13 +0100 Subject: [PATCH 301/678] docs: add art-divin as a contributor for code (#800) --------- Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com> --- .all-contributorsrc | 9 +++++++++ README.md | 3 ++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/.all-contributorsrc b/.all-contributorsrc index 92c36d3e7..b655062f2 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -310,6 +310,15 @@ "contributions": [ "code" ] + }, + { + "login": "art-divin", + "name": "Ruslan Alikhamov", + "avatar_url": "https://avatars.githubusercontent.com/u/1614869?v=4", + "profile": "https://github.com/art-divin", + "contributions": [ + "code" + ] } ], "contributorsPerLine": 7, diff --git a/README.md b/README.md index 7ece3df0b..7aaa461ea 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ [![Netlify Status](https://api.netlify.com/api/v1/badges/005ef674-d103-4b05-a4d1-79413ce9d766/deploy-status)](https://app.netlify.com/sites/xcodeproj/deploys) -[![All Contributors](https://img.shields.io/badge/all_contributors-34-orange.svg?style=flat-square)](#contributors-) +[![All Contributors](https://img.shields.io/badge/all_contributors-35-orange.svg?style=flat-square)](#contributors-) [![Swift Package Manager](https://img.shields.io/badge/swift%20package%20manager-compatible-brightgreen.svg)](https://swift.org/package-manager/) @@ -183,6 +183,7 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d Mary
Mary

💻 Md. Ibrahim Hassan
Md. Ibrahim Hassan

💻 tatagrigory
tatagrigory

💻 + Ruslan Alikhamov
Ruslan Alikhamov

💻 From 447c159b0c5fb047a024fd8d942d4a76cf47dde0 Mon Sep 17 00:00:00 2001 From: Kevin Pittevils Date: Tue, 21 Nov 2023 19:19:33 +0100 Subject: [PATCH 302/678] Fix issue that multiple products of the same package cannot be added (#801) * - Also check for productName when trying to avoid duplicate swift packages * Add equality checks in the unit test when adding a new swift package --------- Co-authored-by: Kevin Pittevils --- .../XcodeProj/Objects/Project/PBXProject.swift | 2 +- .../Objects/Project/PBXProjectTests.swift | 17 ++++++++++++++--- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/Sources/XcodeProj/Objects/Project/PBXProject.swift b/Sources/XcodeProj/Objects/Project/PBXProject.swift index 508ab3dcc..6346307c5 100644 --- a/Sources/XcodeProj/Objects/Project/PBXProject.swift +++ b/Sources/XcodeProj/Objects/Project/PBXProject.swift @@ -440,7 +440,7 @@ extension PBXProject { let productDependency: XCSwiftPackageProductDependency // Avoid duplication - if let product = objects.swiftPackageProductDependencies.first(where: { $0.value.package == reference })?.value { + if let product = objects.swiftPackageProductDependencies.first(where: { $0.value.package == reference && $0.value.productName == productName })?.value { productDependency = product } else { productDependency = XCSwiftPackageProductDependency(productName: productName, package: reference) diff --git a/Tests/XcodeProjTests/Objects/Project/PBXProjectTests.swift b/Tests/XcodeProjTests/Objects/Project/PBXProjectTests.swift index d39befd18..585a535a7 100644 --- a/Tests/XcodeProjTests/Objects/Project/PBXProjectTests.swift +++ b/Tests/XcodeProjTests/Objects/Project/PBXProjectTests.swift @@ -192,19 +192,30 @@ final class PBXProjectTests: XCTestCase { productName: "Product", versionRequirement: .branch("main"), targetName: secondTarget.name) - + let thirdPackageProduct = try project.addSwiftPackage(repositoryURL: "url", + productName: "Product2", + versionRequirement: .branch("main"), + targetName: target.name) // Then XCTAssertEqual(packageProduct, secondPackageProduct) + XCTAssertEqual(packageProduct, thirdPackageProduct) XCTAssertEqual(project.remotePackages.count, 1) - XCTAssertEqual(target.packageProductDependencies, secondTarget.packageProductDependencies) + XCTAssertEqual(target.packageProductDependencies.count, 2) + XCTAssertEqual(secondTarget.packageProductDependencies.count, 1) XCTAssertNotEqual(buildPhase.files?.first?.hashValue, secondBuildPhase.files?.first?.hashValue) - XCTAssertEqual(objects.swiftPackageProductDependencies.count, 1) + XCTAssertEqual(objects.swiftPackageProductDependencies.count, 2) XCTAssertThrowsSpecificError(try project.addSwiftPackage(repositoryURL: "url", productName: "Product", versionRequirement: .branch("second-main"), targetName: secondTarget.name), PBXProjError.multipleRemotePackages(productName: "Product")) + + XCTAssertThrowsSpecificError(try project.addSwiftPackage(repositoryURL: "url", + productName: "Product2", + versionRequirement: .branch("second-main"), + targetName: target.name), + PBXProjError.multipleRemotePackages(productName: "Product2")) } func test_addLocalSwiftPackage_duplication() throws { From 338e9838d28306ce705c6afde4cd84939f4da125 Mon Sep 17 00:00:00 2001 From: Kevin Pittevils Date: Mon, 27 Nov 2023 19:42:58 +0100 Subject: [PATCH 303/678] Fix issue that it is not possible to remove a remote package (#803) Resolves https://github.com/tuist/XcodeProj/issues/802 Issue: - Package references's setter implementation only allowed appending new elements and didn't support removing them as the `packageReferences` array is shared between both `localPackages` and `remotePackages`. Changes: - It checks that only the references are kept that are not part of the current type. - This is done by getting the object of the reference and checking the type of this reference. - Unit test was added to verify removal case Notes: - To correctly remove a package, there's a few other objects and references that need to be removed _(not just the element from `packageReferences`)_ --- .../Objects/Project/PBXProject.swift | 29 ++++++-------- .../Objects/Project/PBXProjectTests.swift | 40 +++++++++++++++++++ 2 files changed, 53 insertions(+), 16 deletions(-) diff --git a/Sources/XcodeProj/Objects/Project/PBXProject.swift b/Sources/XcodeProj/Objects/Project/PBXProject.swift index 6346307c5..9a2ccd661 100644 --- a/Sources/XcodeProj/Objects/Project/PBXProject.swift +++ b/Sources/XcodeProj/Objects/Project/PBXProject.swift @@ -137,14 +137,7 @@ public final class PBXProject: PBXObject { /// Remote Swift packages. public var remotePackages: [XCRemoteSwiftPackageReference] { set { - var finalReferences: [PBXObjectReference] = packageReferences ?? [] - let newReferences = newValue.references() - for reference in newReferences { - if !finalReferences.contains(reference) { - finalReferences.append(reference) - } - } - packageReferences = finalReferences + setPackageReferences(newValue) } get { packageReferences?.objects() ?? [] @@ -154,20 +147,24 @@ public final class PBXProject: PBXObject { /// Local Swift packages. public var localPackages: [XCLocalSwiftPackageReference] { set { - var finalReferences: [PBXObjectReference] = packageReferences ?? [] - let newReferences = newValue.references() - for reference in newReferences { - if !finalReferences.contains(reference) { - finalReferences.append(reference) - } - } - packageReferences = finalReferences + setPackageReferences(newValue) } get { packageReferences?.objects() ?? [] } } + private func setPackageReferences(_ packages: [T]) { + let newReferences = packages.references() + var finalReferences: [PBXObjectReference] = packageReferences?.filter { !($0.getObject() is T) } ?? [] + for reference in newReferences { + if !finalReferences.contains(reference) { + finalReferences.append(reference) + } + } + packageReferences = finalReferences + } + /// Sets the attributes for the given target. /// /// - Parameters: diff --git a/Tests/XcodeProjTests/Objects/Project/PBXProjectTests.swift b/Tests/XcodeProjTests/Objects/Project/PBXProjectTests.swift index 585a535a7..f2b9e0912 100644 --- a/Tests/XcodeProjTests/Objects/Project/PBXProjectTests.swift +++ b/Tests/XcodeProjTests/Objects/Project/PBXProjectTests.swift @@ -102,6 +102,46 @@ final class PBXProjectTests: XCTestCase { PBXProjError.frameworksBuildPhaseNotFound(targetName: target.name)) } + func test_removeRemotePackage() throws { + // Given + let objects = PBXObjects(objects: []) + + let buildPhase = PBXFrameworksBuildPhase( + files: [], + inputFileListPaths: nil, + outputFileListPaths: nil, buildActionMask: PBXBuildPhase.defaultBuildActionMask, + runOnlyForDeploymentPostprocessing: true + ) + let target = PBXNativeTarget(name: "Target", + buildConfigurationList: nil, + buildPhases: [buildPhase]) + objects.add(object: target) + + let configurationList = XCConfigurationList.fixture() + let mainGroup = PBXGroup.fixture() + objects.add(object: configurationList) + objects.add(object: mainGroup) + + let project = PBXProject(name: "Project", + buildConfigurationList: configurationList, + compatibilityVersion: "0", + mainGroup: mainGroup, + targets: [target]) + + objects.add(object: project) + + let _ = try project.addSwiftPackage(repositoryURL: "url", + productName: "Product", + versionRequirement: .branch("main"), + targetName: "Target") + + // When + project.remotePackages.removeFirst() + + // Then + XCTAssert(project.remotePackages.isEmpty) + } + func test_addSwiftPackage() throws { // Given let objects = PBXObjects(objects: []) From c748d8b6b459e868d819f6e2a5dca1f1ff0f44f0 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 5 Jan 2024 16:39:03 +0100 Subject: [PATCH 304/678] chore(deps): update actions/stale action to v9 (#805) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .github/workflows/stale.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml index 553433e49..8663ed48b 100644 --- a/.github/workflows/stale.yml +++ b/.github/workflows/stale.yml @@ -7,7 +7,7 @@ jobs: stale: runs-on: ubuntu-latest steps: - - uses: actions/stale@v8 + - uses: actions/stale@v9 with: stale-issue-message: | Hola 👋, From 30977d0543b3815aaa761789ad74b3ba6733f861 Mon Sep 17 00:00:00 2001 From: Pedro Date: Mon, 8 Jan 2024 13:09:02 +0100 Subject: [PATCH 305/678] Continuously deploy xcodeproj docs --- .github/workflows/deploy-docs.yml | 51 +++++++++++++++++++++++++++++++ .xcode-version | 1 + 2 files changed, 52 insertions(+) create mode 100644 .github/workflows/deploy-docs.yml create mode 100644 .xcode-version diff --git a/.github/workflows/deploy-docs.yml b/.github/workflows/deploy-docs.yml new file mode 100644 index 000000000..beddff57c --- /dev/null +++ b/.github/workflows/deploy-docs.yml @@ -0,0 +1,51 @@ +name: Deploy Docs + +on: + workflow_dispatch: {} + push: + branches: + - main + +concurrency: + group: deploy-docs-${{ github.head_ref }} + cancel-in-progress: true + +jobs: + deploy: + name: Deploy Documentation + runs-on: macos-13 + steps: + - name: Start deployment + uses: bobheadxi/deployments@v1 + id: deployment + with: + env: production + step: start + - name: Checkout Package + uses: actions/checkout@v3 + with: + fetch-depth: 0 + - name: Select Xcode + run: sudo xcode-select -switch /Applications/Xcode_$(cat .xcode-version).app + - name: Build documentation + run: swift package --allow-writing-to-directory ./docs generate-documentation --target XcodeProj --output-path ./docs --transform-for-static-hosting --hosting-base-path / --disable-indexing + - name: Fix permissions + run: 'sudo chown -R $USER .build/documentation' + - name: Publish to Cloudflare Pages + uses: cloudflare/pages-action@v1 + with: + apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} + accountId: cc0237353f2f825680b0463629cd4a86 + projectName: xcodeproj-docs + directory: docs/ + gitHubToken: ${{ secrets.GITHUB_TOKEN }} + wranglerVersion: '3' + - name: Finish deployment + uses: bobheadxi/deployments@v1 + if: always() + with: + env: ${{ steps.deployment.outputs.env }} + step: finish + status: ${{ job.status }} + deployment_id: ${{ steps.deployment.outputs.deployment_id }} + env_url: "https://xcodeproj.tuist.io" diff --git a/.xcode-version b/.xcode-version new file mode 100644 index 000000000..2bbd2b4b4 --- /dev/null +++ b/.xcode-version @@ -0,0 +1 @@ +15.0.1 From a746a5c58f6dfcfe945e13f7cc7d6a2afa2f2ec3 Mon Sep 17 00:00:00 2001 From: Pedro Date: Mon, 8 Jan 2024 13:11:40 +0100 Subject: [PATCH 306/678] Not fix permissions --- .github/workflows/deploy-docs.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/deploy-docs.yml b/.github/workflows/deploy-docs.yml index beddff57c..8008f2bb0 100644 --- a/.github/workflows/deploy-docs.yml +++ b/.github/workflows/deploy-docs.yml @@ -29,8 +29,6 @@ jobs: run: sudo xcode-select -switch /Applications/Xcode_$(cat .xcode-version).app - name: Build documentation run: swift package --allow-writing-to-directory ./docs generate-documentation --target XcodeProj --output-path ./docs --transform-for-static-hosting --hosting-base-path / --disable-indexing - - name: Fix permissions - run: 'sudo chown -R $USER .build/documentation' - name: Publish to Cloudflare Pages uses: cloudflare/pages-action@v1 with: From 32626412d1a6facfd99457812edacaba2e08a487 Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Fri, 12 Jan 2024 16:34:53 +0100 Subject: [PATCH 307/678] docs: add ladislas as a contributor for code (#807) * docs: update README.md [skip ci] * docs: update .all-contributorsrc [skip ci] --------- Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com> --- .all-contributorsrc | 9 +++++++++ README.md | 5 ++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/.all-contributorsrc b/.all-contributorsrc index b655062f2..8aeb90eb9 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -319,6 +319,15 @@ "contributions": [ "code" ] + }, + { + "login": "ladislas", + "name": "Ladislas de Toldi", + "avatar_url": "https://avatars.githubusercontent.com/u/2206544?v=4", + "profile": "https://ladislas.detoldi.me", + "contributions": [ + "code" + ] } ], "contributorsPerLine": 7, diff --git a/README.md b/README.md index 7aaa461ea..4dcaff855 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ [![Netlify Status](https://api.netlify.com/api/v1/badges/005ef674-d103-4b05-a4d1-79413ce9d766/deploy-status)](https://app.netlify.com/sites/xcodeproj/deploys) -[![All Contributors](https://img.shields.io/badge/all_contributors-35-orange.svg?style=flat-square)](#contributors-) +[![All Contributors](https://img.shields.io/badge/all_contributors-36-orange.svg?style=flat-square)](#contributors-) [![Swift Package Manager](https://img.shields.io/badge/swift%20package%20manager-compatible-brightgreen.svg)](https://swift.org/package-manager/) @@ -185,6 +185,9 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d tatagrigory
tatagrigory

💻 Ruslan Alikhamov
Ruslan Alikhamov

💻 + + Ladislas de Toldi
Ladislas de Toldi

💻 + From 2b9c2acfbabc87649d65486b8171c83cbccc18b7 Mon Sep 17 00:00:00 2001 From: Ladislas de Toldi Date: Fri, 12 Jan 2024 16:35:32 +0100 Subject: [PATCH 308/678] Add `showNonLocalizedStrings` option to XCScheme+LaunchAction (#806) * LaunchAction - Add showNonLocalizedStrings option * LaunchAction - add test for showNonLocalizedStrings --- .../Scheme/XCScheme+LaunchAction.swift | 9 +++++++++ .../XcodeProjTests/Scheme/XCSchemeTests.swift | 19 +++++++++++++++++++ 2 files changed, 28 insertions(+) diff --git a/Sources/XcodeProj/Scheme/XCScheme+LaunchAction.swift b/Sources/XcodeProj/Scheme/XCScheme+LaunchAction.swift index 6f3461ee1..304599b6a 100644 --- a/Sources/XcodeProj/Scheme/XCScheme+LaunchAction.swift +++ b/Sources/XcodeProj/Scheme/XCScheme+LaunchAction.swift @@ -65,6 +65,7 @@ extension XCScheme { public var environmentVariables: [EnvironmentVariable]? public var language: String? public var region: String? + public var showNonLocalizedStrings: Bool public var launchAutomaticallySubstyle: String? public var storeKitConfigurationFileReference: StoreKitConfigurationFileReference? // To enable the option in Xcode: defaults write com.apple.dt.Xcode IDEDebuggerFeatureSetting 12 @@ -106,6 +107,7 @@ extension XCScheme { environmentVariables: [EnvironmentVariable]? = nil, language: String? = nil, region: String? = nil, + showNonLocalizedStrings: Bool = false, launchAutomaticallySubstyle: String? = nil, storeKitConfigurationFileReference: StoreKitConfigurationFileReference? = nil, customLaunchCommand: String? = nil, @@ -141,6 +143,7 @@ extension XCScheme { self.environmentVariables = environmentVariables self.language = language self.region = region + self.showNonLocalizedStrings = showNonLocalizedStrings self.launchAutomaticallySubstyle = launchAutomaticallySubstyle self.storeKitConfigurationFileReference = storeKitConfigurationFileReference self.customLaunchCommand = customLaunchCommand @@ -216,6 +219,7 @@ extension XCScheme { language = element.attributes["language"] region = element.attributes["region"] + showNonLocalizedStrings = element.attributes["showNonLocalizedStrings"] == "YES" launchAutomaticallySubstyle = element.attributes["launchAutomaticallySubstyle"] if element["StoreKitConfigurationFileReference"].all?.first != nil { @@ -327,6 +331,11 @@ extension XCScheme { if let region = region { element.attributes["region"] = region } + + if showNonLocalizedStrings { + element.attributes["showNonLocalizedStrings"] = showNonLocalizedStrings.xmlString + } + if let launchAutomaticallySubstyle = launchAutomaticallySubstyle { element.attributes["launchAutomaticallySubstyle"] = launchAutomaticallySubstyle } diff --git a/Tests/XcodeProjTests/Scheme/XCSchemeTests.swift b/Tests/XcodeProjTests/Scheme/XCSchemeTests.swift index a7c047469..d5ca6f416 100644 --- a/Tests/XcodeProjTests/Scheme/XCSchemeTests.swift +++ b/Tests/XcodeProjTests/Scheme/XCSchemeTests.swift @@ -236,6 +236,25 @@ final class XCSchemeIntegrationTests: XCTestCase { XCTAssertEqual(reconstructedSubject, subject) } + func test_launchAction_remoteRunnable_showNonLocalizedStrings() throws { + // Given + let buildableReference = try buildableReferenceWithStringBluePrint() + let remoteRunnable = XCScheme.RemoteRunnable(buildableReference: buildableReference, + bundleIdentifier: "io.tuist", + remotePath: "/Some/Path") + let subject = XCScheme.LaunchAction(runnable: remoteRunnable, + buildConfiguration: "Debug", + showNonLocalizedStrings: true) + + // When + let element = subject.xmlElement() + let reconstructedSubject = try XCScheme.LaunchAction(element: element) + + // Then + XCTAssertEqual(reconstructedSubject, subject) + XCTAssertEqual(reconstructedSubject.showNonLocalizedStrings, true) + } + func test_runnable_equtable() throws { // Given let buildableReferenceA = try buildableReferenceWithStringBluePrint(name: "A") From 59f05de78a45e557d84012ad0fe25e40ab962eb8 Mon Sep 17 00:00:00 2001 From: Pedro Date: Fri, 12 Jan 2024 16:37:24 +0100 Subject: [PATCH 309/678] Add missing changelog entry --- CHANGELOG.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7cecbc305..37f709d43 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,17 @@ ## Unreleased +## 8.16.0 + +### Added + +* Create `PBXProj` class from the Data reprentation of a `pbxproj` file by @Ibrahimhass in https://github.com/tuist/XcodeProj/pull/798 +* Add XCLocalSwiftPackageReference Support by @art-divin in https://github.com/tuist/XcodeProj/pull/799 + +### Fixed + +* Fix issue that multiple products of the same package cannot be added by @kevin-kp in https://github.com/tuist/XcodeProj/pull/801 + ## 8.15.1 ### Added From cfe5d9d2ea3e1a0b15ffc87b825e30c79733f471 Mon Sep 17 00:00:00 2001 From: Pedro Date: Fri, 12 Jan 2024 16:37:37 +0100 Subject: [PATCH 310/678] Version 8.17.0 From aff3aeec87ab13425c8eeffc85b9e69cf295322a Mon Sep 17 00:00:00 2001 From: Pedro Date: Fri, 12 Jan 2024 16:38:56 +0100 Subject: [PATCH 311/678] Update CHANGELOG --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 37f709d43..01fdfab32 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,12 @@ ## Unreleased +## 8.17.0 + +### Added + +* Fix issue that it is not possible to remove a remote package by @kevin-kp in https://github.com/tuist/XcodeProj/pull/803 + ## 8.16.0 ### Added From 3c518f87cd4b4622ffed39199a45734493fc37a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20Pi=C3=B1era=20Buend=C3=ADa?= <663605+pepicrft@users.noreply.github.com> Date: Wed, 31 Jan 2024 18:36:53 +0100 Subject: [PATCH 312/678] Inherit values in the default `SWIFT_ACTIVE_COMPILATION_CONDITIONS` value (#811) * Inherit values in the default SWIFT_ACTIVE_COMPILATION_CONDITIONS value * Use an array instead --- Sources/XcodeProj/Utils/BuildSettingsProvider.swift | 2 +- .../XcodeProjTests/Utils/BuildSettingsProviderTests.swift | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Sources/XcodeProj/Utils/BuildSettingsProvider.swift b/Sources/XcodeProj/Utils/BuildSettingsProvider.swift index 8f22c6781..574f50ca2 100644 --- a/Sources/XcodeProj/Utils/BuildSettingsProvider.swift +++ b/Sources/XcodeProj/Utils/BuildSettingsProvider.swift @@ -347,7 +347,7 @@ public class BuildSettingsProvider { case .debug: return [ "SWIFT_OPTIMIZATION_LEVEL": "-Onone", - "SWIFT_ACTIVE_COMPILATION_CONDITIONS": "DEBUG", + "SWIFT_ACTIVE_COMPILATION_CONDITIONS": ["$(inherited)", "DEBUG"], "SWIFT_COMPILATION_MODE": "singlefile", ] case .release: diff --git a/Tests/XcodeProjTests/Utils/BuildSettingsProviderTests.swift b/Tests/XcodeProjTests/Utils/BuildSettingsProviderTests.swift index b7cad6cde..4b65f3e19 100644 --- a/Tests/XcodeProjTests/Utils/BuildSettingsProviderTests.swift +++ b/Tests/XcodeProjTests/Utils/BuildSettingsProviderTests.swift @@ -163,7 +163,7 @@ class BuildSettingProviderTests: XCTestCase { "@executable_path/Frameworks", "@loader_path/Frameworks", ], - "SWIFT_ACTIVE_COMPILATION_CONDITIONS": "DEBUG", + "SWIFT_ACTIVE_COMPILATION_CONDITIONS": ["$(inherited)", "DEBUG"], "SWIFT_COMPILATION_MODE": "singlefile", "SWIFT_OPTIMIZATION_LEVEL": "-Onone", "TARGETED_DEVICE_FAMILY": "1,2", @@ -186,7 +186,7 @@ class BuildSettingProviderTests: XCTestCase { "@executable_path/Frameworks", "@loader_path/Frameworks", ], - "SWIFT_ACTIVE_COMPILATION_CONDITIONS": "DEBUG", + "SWIFT_ACTIVE_COMPILATION_CONDITIONS": ["$(inherited)", "DEBUG"], "SWIFT_COMPILATION_MODE": "singlefile", "SWIFT_OPTIMIZATION_LEVEL": "-Onone", "TARGETED_DEVICE_FAMILY": "1,2", @@ -209,7 +209,7 @@ class BuildSettingProviderTests: XCTestCase { "@executable_path/../Frameworks", "@loader_path/../Frameworks", ], - "SWIFT_ACTIVE_COMPILATION_CONDITIONS": "DEBUG", + "SWIFT_ACTIVE_COMPILATION_CONDITIONS": ["$(inherited)", "DEBUG"], "SWIFT_COMPILATION_MODE": "singlefile", "SWIFT_OPTIMIZATION_LEVEL": "-Onone", ]) @@ -230,7 +230,7 @@ class BuildSettingProviderTests: XCTestCase { "@executable_path/Frameworks", "@loader_path/Frameworks", ], - "SWIFT_ACTIVE_COMPILATION_CONDITIONS": "DEBUG", + "SWIFT_ACTIVE_COMPILATION_CONDITIONS": ["$(inherited)", "DEBUG"], "SWIFT_COMPILATION_MODE": "singlefile", "SWIFT_OPTIMIZATION_LEVEL": "-Onone", "TARGETED_DEVICE_FAMILY": "3", From fe3544b055d82106884a73328fedd35b3f6ee238 Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Wed, 31 Jan 2024 18:37:02 +0100 Subject: [PATCH 313/678] docs: add mattmassicotte as a contributor for code (#810) * docs: update README.md [skip ci] * docs: update .all-contributorsrc [skip ci] --------- Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com> --- .all-contributorsrc | 9 +++++++++ README.md | 3 ++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/.all-contributorsrc b/.all-contributorsrc index 8aeb90eb9..712950064 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -328,6 +328,15 @@ "contributions": [ "code" ] + }, + { + "login": "mattmassicotte", + "name": "Matt Massicotte", + "avatar_url": "https://avatars.githubusercontent.com/u/85322?v=4", + "profile": "https://www.massicotte.org", + "contributions": [ + "code" + ] } ], "contributorsPerLine": 7, diff --git a/README.md b/README.md index 4dcaff855..4815131ac 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ [![Netlify Status](https://api.netlify.com/api/v1/badges/005ef674-d103-4b05-a4d1-79413ce9d766/deploy-status)](https://app.netlify.com/sites/xcodeproj/deploys) -[![All Contributors](https://img.shields.io/badge/all_contributors-36-orange.svg?style=flat-square)](#contributors-) +[![All Contributors](https://img.shields.io/badge/all_contributors-37-orange.svg?style=flat-square)](#contributors-) [![Swift Package Manager](https://img.shields.io/badge/swift%20package%20manager-compatible-brightgreen.svg)](https://swift.org/package-manager/) @@ -187,6 +187,7 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d Ladislas de Toldi
Ladislas de Toldi

💻 + Matt Massicotte
Matt Massicotte

💻 From 7328a2195061a8f4d077dce17a6ca2f3a37edc41 Mon Sep 17 00:00:00 2001 From: Matt Massicotte <85322+mattmassicotte@users.noreply.github.com> Date: Wed, 31 Jan 2024 12:37:32 -0500 Subject: [PATCH 314/678] XCScheme string initializer (#809) --- Sources/XcodeProj/Scheme/XCScheme.swift | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Sources/XcodeProj/Scheme/XCScheme.swift b/Sources/XcodeProj/Scheme/XCScheme.swift index 2333d790b..06c8d0155 100644 --- a/Sources/XcodeProj/Scheme/XCScheme.swift +++ b/Sources/XcodeProj/Scheme/XCScheme.swift @@ -80,6 +80,10 @@ public final class XCScheme: Writable, Equatable { self.wasCreatedForAppExtension = wasCreatedForAppExtension } + public convenience init(pathString: String) throws { + try self.init(path: Path(pathString)) + } + // MARK: - Writable public func write(path: Path, override: Bool) throws { From e29e0db843062f5157f77d5b68f237eb5aa43f12 Mon Sep 17 00:00:00 2001 From: Pedro Date: Wed, 31 Jan 2024 18:38:23 +0100 Subject: [PATCH 315/678] Version 8.18.0 From 41d52ce7424906980fd1b133454b444f5bb5f21b Mon Sep 17 00:00:00 2001 From: Pedro Date: Wed, 31 Jan 2024 18:39:29 +0100 Subject: [PATCH 316/678] Update the changelog --- CHANGELOG.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 01fdfab32..040ef5364 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,16 @@ ## Unreleased +## 8.18.0 + +## Added +* Add `showNonLocalizedStrings` option to XCScheme+LaunchAction by @ladislas in https://github.com/tuist/XcodeProj/pull/806 +* Fix issue that it is not possible to remove a remote package by @kevin-kp in https://github.com/tuist/XcodeProj/pull/803 +* XCScheme string initializer by @mattmassicotte in https://github.com/tuist/XcodeProj/pull/809 + +## Changed +* Inherit values in the default `SWIFT_ACTIVE_COMPILATION_CONDITIONS` value by @pepicrft in https://github.com/tuist/XcodeProj/pull/811 + ## 8.17.0 ### Added From 7913b3aa2d037871ecf1d2182f536db44c47ac61 Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Wed, 21 Feb 2024 13:52:26 +0100 Subject: [PATCH 317/678] docs: add VorkhlikArtem as a contributor for code (#813) * docs: update README.md [skip ci] * docs: update .all-contributorsrc [skip ci] --------- Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com> --- .all-contributorsrc | 9 +++++++++ README.md | 3 ++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/.all-contributorsrc b/.all-contributorsrc index 712950064..c64cb272b 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -337,6 +337,15 @@ "contributions": [ "code" ] + }, + { + "login": "VorkhlikArtem", + "name": "Артем Ворхлик", + "avatar_url": "https://avatars.githubusercontent.com/u/115653999?v=4", + "profile": "https://github.com/VorkhlikArtem", + "contributions": [ + "code" + ] } ], "contributorsPerLine": 7, diff --git a/README.md b/README.md index 4815131ac..9771a1c92 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ [![Netlify Status](https://api.netlify.com/api/v1/badges/005ef674-d103-4b05-a4d1-79413ce9d766/deploy-status)](https://app.netlify.com/sites/xcodeproj/deploys) -[![All Contributors](https://img.shields.io/badge/all_contributors-37-orange.svg?style=flat-square)](#contributors-) +[![All Contributors](https://img.shields.io/badge/all_contributors-38-orange.svg?style=flat-square)](#contributors-) [![Swift Package Manager](https://img.shields.io/badge/swift%20package%20manager-compatible-brightgreen.svg)](https://swift.org/package-manager/) @@ -188,6 +188,7 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d Ladislas de Toldi
Ladislas de Toldi

💻 Matt Massicotte
Matt Massicotte

💻 + Артем Ворхлик
Артем Ворхлик

💻 From 75e787fb3eb5a8397c3d06d5a71e667ac2d20ac1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D1=80=D1=82=D0=B5=D0=BC=20=D0=92=D0=BE=D1=80=D1=85?= =?UTF-8?q?=D0=BB=D0=B8=D0=BA?= <115653999+VorkhlikArtem@users.noreply.github.com> Date: Wed, 21 Feb 2024 16:01:19 +0300 Subject: [PATCH 318/678] add precompiled header extension to headersExtensions for adding .pch to public header section by tuist (#812) --- Sources/XcodeProj/Project/Xcode.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/XcodeProj/Project/Xcode.swift b/Sources/XcodeProj/Project/Xcode.swift index a6162b58f..5b2b17477 100644 --- a/Sources/XcodeProj/Project/Xcode.swift +++ b/Sources/XcodeProj/Project/Xcode.swift @@ -60,7 +60,7 @@ public struct Xcode { public static let inheritedKeywords = ["${inherited}", "$(inherited)"] /// Header files extensions. - public static let headersExtensions = [".h", ".hh", ".hpp", ".ipp", ".tpp", ".hxx", ".def", ".inl", ".inc"] + public static let headersExtensions = [".h", ".hh", ".hpp", ".ipp", ".tpp", ".hxx", ".def", ".inl", ".inc", ".pch"] /// Supported values. public struct Supported { From 2685cdf8a264d5008b88448330674e5d839845ae Mon Sep 17 00:00:00 2001 From: Pedro Date: Wed, 21 Feb 2024 14:03:02 +0100 Subject: [PATCH 319/678] Update changelog --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 040ef5364..5cb3e55ee 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,12 @@ ## Unreleased +## 8.19.0 + +## Added + +* Add precompiled header extension to headersExtensions for adding .pch… by @VorkhlikArtem in https://github.com/tuist/XcodeProj/pull/812 + ## 8.18.0 ## Added From 313aaf1ad612135b7b0ccf731c86b5c07bf149b5 Mon Sep 17 00:00:00 2001 From: John Szumski <784312+jszumski@users.noreply.github.com> Date: Fri, 8 Mar 2024 12:31:18 -0500 Subject: [PATCH 320/678] Fix deprecation warning when targeting macOS 13 (#814) Another attempt at https://github.com/tuist/XcodeProj/pull/710 Short description: Fixes this deprecation warning when targeting macOS 13: ``` Sources/XcodeProj/Extensions/String+md5.swift:63:16: warning: 'init(bytesNoCopy:length:encoding:freeWhenDone:)' was deprecated in macOS 13: String does not support no-copy initialization return String(bytesNoCopy: ptr, length: hexLen, encoding: .utf8, freeWhenDone: true)! ``` Solution: * cherry-picked an [updated version from swift-crypto](https://github.com/apple/swift-crypto/blob/606608da0875e3dee07cb37da3b38585420db111/Sources/Crypto/Util/PrettyBytes.swift#L40-L54) --- Sources/XcodeProj/Extensions/String+md5.swift | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Sources/XcodeProj/Extensions/String+md5.swift b/Sources/XcodeProj/Extensions/String+md5.swift index 5abdf59a7..8ffa9d1f5 100644 --- a/Sources/XcodeProj/Extensions/String+md5.swift +++ b/Sources/XcodeProj/Extensions/String+md5.swift @@ -49,18 +49,18 @@ private let char0 = UInt8(UnicodeScalar("0").value) private extension DataProtocol { var hexString: String { let hexLen = self.count * 2 - let ptr = UnsafeMutablePointer.allocate(capacity: hexLen) + var hexChars = [UInt8](repeating: 0, count: hexLen) var offset = 0 self.regions.forEach { (_) in for i in self { - ptr[Int(offset * 2)] = itoh((i >> 4) & 0xF) - ptr[Int(offset * 2 + 1)] = itoh(i & 0xF) + hexChars[Int(offset * 2)] = itoh((i >> 4) & 0xF) + hexChars[Int(offset * 2 + 1)] = itoh(i & 0xF) offset += 1 } } - return String(bytesNoCopy: ptr, length: hexLen, encoding: .utf8, freeWhenDone: true)! + return String(bytes: hexChars, encoding: .utf8)! } func itoh(_ value: UInt8) -> UInt8 { From e061707962a05998ee6ed4a5ca6d65af1f557305 Mon Sep 17 00:00:00 2001 From: Alexandr Goncharov Date: Mon, 25 Mar 2024 20:55:31 +0300 Subject: [PATCH 321/678] Fix package manifest (#816) Resolves https://github.com/tuist/XcodeProj/issues/815 - Add explicit dependencies declaration in package manifest --- Package.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Package.swift b/Package.swift index 8787f1dd7..9bc263729 100644 --- a/Package.swift +++ b/Package.swift @@ -15,8 +15,8 @@ let package = Package( targets: [ .target(name: "XcodeProj", dependencies: [ - "PathKit", - "AEXML", + .product(name: "PathKit", package: "PathKit"), + .product(name: "AEXML", package: "AEXML"), ]), .testTarget(name: "XcodeProjTests", dependencies: ["XcodeProj"]), ] From 2f17e9efe2fbefbb2d56f03f5b60511d33120f75 Mon Sep 17 00:00:00 2001 From: Stelios Petrakis Date: Sat, 25 May 2024 09:15:21 +0200 Subject: [PATCH 322/678] Add Privacy Manifest in 'Projects Using' README table (#819) Adds my Privacy Manifest CLI tool [^1] in the list of open-source projects using the XcodeProj library. [^1]: https://github.com/stelabouras/privacy-manifest --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 9771a1c92..da02ad629 100644 --- a/README.md +++ b/README.md @@ -37,6 +37,7 @@ XcodeProj is a library written in Swift for parsing and working with Xcode proje | Tuist | [github.com/tuist/tuist](https://github.com/tuist/tuist) | | XcodeGen | [github.com/yonaskolb/XcodeGen](https://github.com/yonaskolb/XcodeGen) | | xspm | [gitlab.com/Pyroh/xspm](https://gitlab.com/Pyroh/xspm) | +| Privacy Manifest| [github.com/stelabouras/privacy-manifest](https://github.com/stelabouras/privacy-manifest) | If you are also leveraging XcodeProj in your project, feel free to open a PR to include it in the list above. From 0aa43b732860d4b4ead7942d175ab8acd75f05a4 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 25 May 2024 09:15:33 +0200 Subject: [PATCH 323/678] chore(deps): update dependency macos to v14 (#818) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .github/workflows/deploy-docs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy-docs.yml b/.github/workflows/deploy-docs.yml index 8008f2bb0..82cb9d5db 100644 --- a/.github/workflows/deploy-docs.yml +++ b/.github/workflows/deploy-docs.yml @@ -13,7 +13,7 @@ concurrency: jobs: deploy: name: Deploy Documentation - runs-on: macos-13 + runs-on: macos-14 steps: - name: Start deployment uses: bobheadxi/deployments@v1 From 19f5029534f1d5f9930355837daebd13286f2525 Mon Sep 17 00:00:00 2001 From: Mike Simons Date: Tue, 28 May 2024 10:34:17 -0400 Subject: [PATCH 324/678] Adopt Strict Concurrency checking (#821) * Convert `var` to `let` for structured concurrency * Add Sendable conformance to types triggering warnings * Add strict concurrency checking to package * Annotation `PathKit` imports with `@preconcurrency` * Convert to a global funciton to avoid shared global state. Darwin.glob and Glibc.glob would likely need to be marked as `@Sendable` to be able to be referenced from global scope --- Package.swift | 5 ++++- Sources/XcodeProj/Errors/Errors.swift | 4 ++-- Sources/XcodeProj/Extensions/Path+Extras.swift | 8 ++++++-- Sources/XcodeProj/Objects/Files/PBXGroup.swift | 2 +- Sources/XcodeProj/Project/WorkspaceSettings.swift | 4 ++-- Sources/XcodeProj/Scheme/XCScheme+BuildAction.swift | 8 ++++---- Sources/XcodeProj/Scheme/XCScheme+LaunchAction.swift | 6 +++--- Sources/XcodeProj/Scheme/XCScheme.swift | 4 ++-- Sources/XcodeProj/Scheme/XCSchemeManagement.swift | 4 ++-- Sources/XcodeProj/Utils/CommentedString.swift | 4 ++-- Sources/XcodeProj/Utils/Decoders.swift | 2 +- Sources/XcodeProj/Utils/XCConfig.swift | 4 ++-- 12 files changed, 31 insertions(+), 24 deletions(-) diff --git a/Package.swift b/Package.swift index 9bc263729..ce7949461 100644 --- a/Package.swift +++ b/Package.swift @@ -1,4 +1,4 @@ -// swift-tools-version:5.7 +// swift-tools-version:5.9 import PackageDescription @@ -17,6 +17,9 @@ let package = Package( dependencies: [ .product(name: "PathKit", package: "PathKit"), .product(name: "AEXML", package: "AEXML"), + ], + swiftSettings: [ + .enableExperimentalFeature("StrictConcurrency") ]), .testTarget(name: "XcodeProjTests", dependencies: ["XcodeProj"]), ] diff --git a/Sources/XcodeProj/Errors/Errors.swift b/Sources/XcodeProj/Errors/Errors.swift index 9dffd2468..8d563abac 100644 --- a/Sources/XcodeProj/Errors/Errors.swift +++ b/Sources/XcodeProj/Errors/Errors.swift @@ -1,5 +1,5 @@ import Foundation -import PathKit +@preconcurrency import PathKit // MARK: - Xcodeproj @@ -8,7 +8,7 @@ import PathKit /// - notFound: the project cannot be found. /// - pbxProjNotFound: the .pbxproj file couldn't be found inside the project folder. /// - xcworkspaceNotFound: the workspace cannot be found at the given path. -public enum XCodeProjError: Error, CustomStringConvertible { +public enum XCodeProjError: Error, CustomStringConvertible, Sendable { case notFound(path: Path) case pbxprojNotFound(path: Path) case xcworkspaceNotFound(path: Path) diff --git a/Sources/XcodeProj/Extensions/Path+Extras.swift b/Sources/XcodeProj/Extensions/Path+Extras.swift index b26a48976..5279f9d0d 100644 --- a/Sources/XcodeProj/Extensions/Path+Extras.swift +++ b/Sources/XcodeProj/Extensions/Path+Extras.swift @@ -4,11 +4,15 @@ import PathKit // MARK: - Path extras. + + +func systemGlob(_ pattern: UnsafePointer!, _ flags: Int32, _ errfunc: (@convention(c) (UnsafePointer?, Int32) -> Int32)!, _ vector_ptr: UnsafeMutablePointer!) -> Int32 { #if os(macOS) -let systemGlob = Darwin.glob + return Darwin.glob(pattern, flags, errfunc, vector_ptr) #else -let systemGlob = Glibc.glob + return Glibc.glob(pattern, flags, errfunc, vector_ptr) #endif +} extension Path { /// Creates a directory diff --git a/Sources/XcodeProj/Objects/Files/PBXGroup.swift b/Sources/XcodeProj/Objects/Files/PBXGroup.swift index c2bded056..34add940c 100644 --- a/Sources/XcodeProj/Objects/Files/PBXGroup.swift +++ b/Sources/XcodeProj/Objects/Files/PBXGroup.swift @@ -90,7 +90,7 @@ public class PBXGroup: PBXFileElement { // MARK: - Helpers /// Options passed when adding new groups. -public struct GroupAddingOptions: OptionSet { +public struct GroupAddingOptions: OptionSet, Sendable { /// Raw value. public let rawValue: Int diff --git a/Sources/XcodeProj/Project/WorkspaceSettings.swift b/Sources/XcodeProj/Project/WorkspaceSettings.swift index 5d9b37e73..343090fb9 100644 --- a/Sources/XcodeProj/Project/WorkspaceSettings.swift +++ b/Sources/XcodeProj/Project/WorkspaceSettings.swift @@ -1,7 +1,7 @@ import Foundation -import PathKit +@preconcurrency import PathKit -public enum WorkspaceSettingsError: Error { +public enum WorkspaceSettingsError: Error, Sendable { /// thrown when the settings file was not found. case notFound(path: Path) } diff --git a/Sources/XcodeProj/Scheme/XCScheme+BuildAction.swift b/Sources/XcodeProj/Scheme/XCScheme+BuildAction.swift index 147d7cf1a..cd599ca4d 100644 --- a/Sources/XcodeProj/Scheme/XCScheme+BuildAction.swift +++ b/Sources/XcodeProj/Scheme/XCScheme+BuildAction.swift @@ -5,11 +5,11 @@ import PathKit extension XCScheme { public final class BuildAction: SerialAction { public final class Entry: Equatable { - public enum BuildFor { + public enum BuildFor: Sendable { case running, testing, profiling, archiving, analyzing - public static var `default`: [BuildFor] = [.running, .testing, .archiving, .analyzing] - public static var indexing: [BuildFor] = [.testing, .analyzing, .archiving] - public static var testOnly: [BuildFor] = [.testing, .analyzing] + public static let `default`: [BuildFor] = [.running, .testing, .archiving, .analyzing] + public static let indexing: [BuildFor] = [.testing, .analyzing, .archiving] + public static let testOnly: [BuildFor] = [.testing, .analyzing] } // MARK: - Attributes diff --git a/Sources/XcodeProj/Scheme/XCScheme+LaunchAction.swift b/Sources/XcodeProj/Scheme/XCScheme+LaunchAction.swift index 304599b6a..c75be7310 100644 --- a/Sources/XcodeProj/Scheme/XCScheme+LaunchAction.swift +++ b/Sources/XcodeProj/Scheme/XCScheme+LaunchAction.swift @@ -5,20 +5,20 @@ import PathKit extension XCScheme { // swiftlint:disable:next type_body_length public final class LaunchAction: SerialAction { - public enum Style: String { + public enum Style: String, Sendable { case auto = "0" case wait = "1" case custom = "2" } - public enum GPUFrameCaptureMode: String { + public enum GPUFrameCaptureMode: String, Sendable { case autoEnabled = "0" case metal = "1" case openGL = "2" case disabled = "3" } - public enum GPUValidationMode: String { + public enum GPUValidationMode: String, Sendable { case enabled = "0" case disabled = "1" case extended = "2" diff --git a/Sources/XcodeProj/Scheme/XCScheme.swift b/Sources/XcodeProj/Scheme/XCScheme.swift index 06c8d0155..7a805c25a 100644 --- a/Sources/XcodeProj/Scheme/XCScheme.swift +++ b/Sources/XcodeProj/Scheme/XCScheme.swift @@ -1,8 +1,8 @@ import AEXML import Foundation -import PathKit +@preconcurrency import PathKit -public enum XCSchemeError: Error, CustomStringConvertible { +public enum XCSchemeError: Error, CustomStringConvertible, Sendable { case notFound(path: Path) case missing(property: String) diff --git a/Sources/XcodeProj/Scheme/XCSchemeManagement.swift b/Sources/XcodeProj/Scheme/XCSchemeManagement.swift index 4c00d95ca..d9c068831 100644 --- a/Sources/XcodeProj/Scheme/XCSchemeManagement.swift +++ b/Sources/XcodeProj/Scheme/XCSchemeManagement.swift @@ -1,7 +1,7 @@ import Foundation -import PathKit +@preconcurrency import PathKit -public enum XCSchemeManagementError: Error, Equatable, LocalizedError, CustomStringConvertible { +public enum XCSchemeManagementError: Error, Equatable, LocalizedError, CustomStringConvertible, Sendable { /// Thrown when the user tries to initialize a XCSchemeManagement instace passing a path to a file that doesn't exist. case notFound(path: Path) diff --git a/Sources/XcodeProj/Utils/CommentedString.swift b/Sources/XcodeProj/Utils/CommentedString.swift index a3663eec8..d543d975e 100644 --- a/Sources/XcodeProj/Utils/CommentedString.swift +++ b/Sources/XcodeProj/Utils/CommentedString.swift @@ -19,7 +19,7 @@ struct CommentedString { } /// Set of characters that are invalid. - private static var invalidCharacters: CharacterSet = { + private static let invalidCharacters: CharacterSet = { var invalidSet = CharacterSet(charactersIn: "_$") invalidSet.insert(charactersIn: UnicodeScalar(".") ... UnicodeScalar("9")) invalidSet.insert(charactersIn: UnicodeScalar("A") ... UnicodeScalar("Z")) @@ -29,7 +29,7 @@ struct CommentedString { }() /// Set of characters that are invalid. - private static var specialCheckCharacters = CharacterSet(charactersIn: "_/") + private static let specialCheckCharacters = CharacterSet(charactersIn: "_/") /// Returns a valid string for Xcode projects. var validString: String { diff --git a/Sources/XcodeProj/Utils/Decoders.swift b/Sources/XcodeProj/Utils/Decoders.swift index 3aa82a07d..f298d1d5b 100644 --- a/Sources/XcodeProj/Utils/Decoders.swift +++ b/Sources/XcodeProj/Utils/Decoders.swift @@ -44,7 +44,7 @@ class ProjectDecodingContext { extension CodingUserInfoKey { /// Context user info key. - static var context: CodingUserInfoKey = CodingUserInfoKey(rawValue: "context")! + static let context: CodingUserInfoKey = CodingUserInfoKey(rawValue: "context")! } /// Xcodeproj JSON decoder. diff --git a/Sources/XcodeProj/Utils/XCConfig.swift b/Sources/XcodeProj/Utils/XCConfig.swift index 11f25784d..7f7a119a1 100644 --- a/Sources/XcodeProj/Utils/XCConfig.swift +++ b/Sources/XcodeProj/Utils/XCConfig.swift @@ -97,9 +97,9 @@ final class XCConfigParser { } // swiftlint:disable:next force_try - private static var includeRegex = try! NSRegularExpression(pattern: "#include\\s+\"(.+\\.xcconfig)\"", options: .caseInsensitive) + private static let includeRegex = try! NSRegularExpression(pattern: "#include\\s+\"(.+\\.xcconfig)\"", options: .caseInsensitive) // swiftlint:disable:next force_try - private static var settingRegex = try! NSRegularExpression(pattern: "^([a-zA-Z0-9_\\[\\]=\\*~]+)\\s*=\\s*(\"?.*?\"?)\\s*(?:;\\s*)?(?=$|\\/\\/)", options: []) + private static let settingRegex = try! NSRegularExpression(pattern: "^([a-zA-Z0-9_\\[\\]=\\*~]+)\\s*=\\s*(\"?.*?\"?)\\s*(?:;\\s*)?(?=$|\\/\\/)", options: []) } // MARK: - XCConfig Extension (Equatable) From 20d5803c70e4ac5d67151ea6f5624a8136ab8fe0 Mon Sep 17 00:00:00 2001 From: Mike Simons Date: Tue, 28 May 2024 10:49:11 -0400 Subject: [PATCH 325/678] Set minimum swift version to 5.8 (#822) --- Package.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Package.swift b/Package.swift index ce7949461..dcd5cc927 100644 --- a/Package.swift +++ b/Package.swift @@ -1,4 +1,4 @@ -// swift-tools-version:5.9 +// swift-tools-version:5.8 import PackageDescription From 4f2476ea676d173c222e22e6fe1a2ba870f8a8c3 Mon Sep 17 00:00:00 2001 From: Pedro Date: Tue, 28 May 2024 16:51:43 +0200 Subject: [PATCH 326/678] Update CHANGELOG.md --- CHANGELOG.md | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5cb3e55ee..74e061fb7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,20 +2,37 @@ ## Unreleased +## 8.21.0 + +### Fixed +* Fix package manifest by @0111b in https://github.com/tuist/XcodeProj/pull/816 + +### Added +* Add Privacy Manifest in 'Projects Using' README table by @stelabouras in https://github.com/tuist/XcodeProj/pull/819 + +### Changed +* Adopt Strict Concurrency checking by @waltflanagan in https://github.com/tuist/XcodeProj/pull/821 +* Set minimum swift version to 5.8 by @waltflanagan in https://github.com/tuist/XcodeProj/pull/822 + +## 8.20.0 + +### Fixed +* Fix deprecation warning when targeting macOS 13 by @jszumski in https://github.com/tuist/XcodeProj/pull/814 + ## 8.19.0 -## Added +### Added * Add precompiled header extension to headersExtensions for adding .pch… by @VorkhlikArtem in https://github.com/tuist/XcodeProj/pull/812 ## 8.18.0 -## Added +### Added * Add `showNonLocalizedStrings` option to XCScheme+LaunchAction by @ladislas in https://github.com/tuist/XcodeProj/pull/806 * Fix issue that it is not possible to remove a remote package by @kevin-kp in https://github.com/tuist/XcodeProj/pull/803 * XCScheme string initializer by @mattmassicotte in https://github.com/tuist/XcodeProj/pull/809 -## Changed +### Changed * Inherit values in the default `SWIFT_ACTIVE_COMPILATION_CONDITIONS` value by @pepicrft in https://github.com/tuist/XcodeProj/pull/811 ## 8.17.0 From 7c9490900736f9f407eae0b217b3c8b5217cfb39 Mon Sep 17 00:00:00 2001 From: Jaewon-Yun Date: Mon, 8 Jul 2024 21:17:38 +0900 Subject: [PATCH 327/678] Add `buildArchitectures` to XCScheme+BuildAction (#824) * Add `buildArchitectures` to XCScheme+BuildAction * Remove unneeded comment * Remove inappropriate comment * Rename enum * Change default value of `buildArchitectures` --- Fixtures/Schemes/BuildArchitectures.xcscheme | 89 +++++++++++++++++++ .../Extensions/AEXML+XcodeFormat.swift | 1 + .../Scheme/XCScheme+BuildAction.swift | 44 ++++++++- .../Extensions/AEXML+XcodeFormatTests.swift | 5 +- .../XcodeProjTests/Scheme/XCSchemeTests.swift | 36 ++++++++ 5 files changed, 172 insertions(+), 3 deletions(-) create mode 100644 Fixtures/Schemes/BuildArchitectures.xcscheme diff --git a/Fixtures/Schemes/BuildArchitectures.xcscheme b/Fixtures/Schemes/BuildArchitectures.xcscheme new file mode 100644 index 000000000..675e26d27 --- /dev/null +++ b/Fixtures/Schemes/BuildArchitectures.xcscheme @@ -0,0 +1,89 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Sources/XcodeProj/Extensions/AEXML+XcodeFormat.swift b/Sources/XcodeProj/Extensions/AEXML+XcodeFormat.swift index 7e40ccc49..d8c4ec157 100644 --- a/Sources/XcodeProj/Extensions/AEXML+XcodeFormat.swift +++ b/Sources/XcodeProj/Extensions/AEXML+XcodeFormat.swift @@ -13,6 +13,7 @@ let attributesOrder: [String: [String]] = [ "BuildAction": [ "parallelizeBuildables", "buildImplicitDependencies", + "buildArchitectures", "runPostActionsOnFailure", ], "BuildActionEntry": [ diff --git a/Sources/XcodeProj/Scheme/XCScheme+BuildAction.swift b/Sources/XcodeProj/Scheme/XCScheme+BuildAction.swift index cd599ca4d..f6e81bfd4 100644 --- a/Sources/XcodeProj/Scheme/XCScheme+BuildAction.swift +++ b/Sources/XcodeProj/Scheme/XCScheme+BuildAction.swift @@ -70,12 +70,44 @@ extension XCScheme { } } + public enum Architectures { + case matchRunDestination + case universal + case useTargetSettings + + fileprivate var xmlString: String? { + switch self { + case .matchRunDestination: + "Automatic" + case .universal: + "All" + case .useTargetSettings: + nil + } + } + + /// Creates a new instance from the given xml string. + /// + /// For undefined value, initialized as `useTargetSettings` since the XML element is removed. + fileprivate init(_ xmlString: String) { + switch xmlString { + case "Automatic": + self = .matchRunDestination + case "All": + self = .universal + default: + self = .useTargetSettings + } + } + } + // MARK: - Attributes public var buildActionEntries: [Entry] public var parallelizeBuild: Bool public var buildImplicitDependencies: Bool public var runPostActionsOnFailure: Bool? + public var buildArchitectures: Architectures // MARK: - Init @@ -84,11 +116,13 @@ extension XCScheme { postActions: [ExecutionAction] = [], parallelizeBuild: Bool = false, buildImplicitDependencies: Bool = false, - runPostActionsOnFailure: Bool? = nil) { + runPostActionsOnFailure: Bool? = nil, + buildArchitectures: Architectures = .useTargetSettings) { self.buildActionEntries = buildActionEntries self.parallelizeBuild = parallelizeBuild self.buildImplicitDependencies = buildImplicitDependencies self.runPostActionsOnFailure = runPostActionsOnFailure + self.buildArchitectures = buildArchitectures super.init(preActions, postActions) } @@ -99,6 +133,7 @@ extension XCScheme { buildActionEntries = try element["BuildActionEntries"]["BuildActionEntry"] .all? .map(Entry.init) ?? [] + buildArchitectures = element.attributes["buildArchitectures"].map { Architectures($0) } ?? .useTargetSettings try super.init(element: element) } @@ -119,6 +154,10 @@ extension XCScheme { "buildImplicitDependencies": buildImplicitDependencies.xmlString, ] + if let buildArchitecturesXMLString = buildArchitectures.xmlString { + attributes["buildArchitectures"] = buildArchitecturesXMLString + } + if let runPostActionsOnFailure = runPostActionsOnFailure { attributes["runPostActionsOnFailure"] = runPostActionsOnFailure.xmlString } @@ -142,7 +181,8 @@ extension XCScheme { buildActionEntries == rhs.buildActionEntries && parallelizeBuild == rhs.parallelizeBuild && buildImplicitDependencies == rhs.buildImplicitDependencies && - runPostActionsOnFailure == rhs.runPostActionsOnFailure + runPostActionsOnFailure == rhs.runPostActionsOnFailure && + buildArchitectures == rhs.buildArchitectures } } } diff --git a/Tests/XcodeProjTests/Extensions/AEXML+XcodeFormatTests.swift b/Tests/XcodeProjTests/Extensions/AEXML+XcodeFormatTests.swift index d56389809..bbae0766e 100644 --- a/Tests/XcodeProjTests/Extensions/AEXML+XcodeFormatTests.swift +++ b/Tests/XcodeProjTests/Extensions/AEXML+XcodeFormatTests.swift @@ -16,6 +16,7 @@ class AEXML_XcodeFormatTests: XCTestCase { """ @@ -73,8 +74,9 @@ class AEXML_XcodeFormatTests: XCTestCase { childName: "BuildAction", attributes: [ "parallelizeBuildables": "YES", - "runPostActionsOnFailure": "YES", "buildImplicitDependencies": "NO", + "buildArchitectures": "Automatic", + "runPostActionsOnFailure": "YES", ] ) } @@ -87,6 +89,7 @@ class AEXML_XcodeFormatTests: XCTestCase { "buildImplicitDependencies": "NO", "parallelizeBuildables": "YES", "runPostActionsOnFailure": "YES", + "buildArchitectures": "Automatic", ] ) } diff --git a/Tests/XcodeProjTests/Scheme/XCSchemeTests.swift b/Tests/XcodeProjTests/Scheme/XCSchemeTests.swift index d5ca6f416..1c79171d5 100644 --- a/Tests/XcodeProjTests/Scheme/XCSchemeTests.swift +++ b/Tests/XcodeProjTests/Scheme/XCSchemeTests.swift @@ -331,6 +331,37 @@ final class XCSchemeIntegrationTests: XCTestCase { // Then XCTAssertEqual(reconstructedSubject, subject) } + + func test_buildAction_buildArchitectures() throws { + // Given / When + let subject = try XCScheme(path: buildArchitecturesSchemePath) + + // Then + let buildAction = try XCTUnwrap(subject.buildAction) + XCTAssertTrue(buildAction.buildArchitectures == .matchRunDestination) + } + + func test_buildAction_buildArchitectures_whenXMLElementDoesNotExist() throws { + // Given / When + let subject = try XCScheme(path: minimalSchemePath) + + // Then + let buildAction = try XCTUnwrap(subject.buildAction) + XCTAssertTrue(buildAction.buildArchitectures == .useTargetSettings) + } + + func test_buildAction_buildArchitectures_serializingAndDeserializing() throws { + // Given + let scheme = try XCScheme(path: buildArchitecturesSchemePath) + let subject = try XCTUnwrap(scheme.buildAction) + + // When + let xml = subject.xmlElement() + let reconstructedSubject = try XCScheme.BuildAction(element: xml) + + // Then + XCTAssertEqual(reconstructedSubject, subject) + } // MARK: - Private @@ -743,4 +774,9 @@ final class XCSchemeIntegrationTests: XCTestCase { // A scheme with the `runPostActionsOnFailure` enabled fixturesPath() + "Schemes/RunPostActionsOnFailure.xcscheme" } + + /// A scheme that `buildArchitectures` is specified "Automatic". + private var buildArchitecturesSchemePath: Path { + fixturesPath() + "Schemes/BuildArchitectures.xcscheme" + } } From 2f6153c18eaece9f1af27aae534e384e5525ced1 Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Mon, 8 Jul 2024 14:17:48 +0200 Subject: [PATCH 328/678] docs: add woin2ee as a contributor for code (#825) * docs: update README.md [skip ci] * docs: update .all-contributorsrc [skip ci] --------- Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com> --- .all-contributorsrc | 9 +++++++++ README.md | 3 ++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/.all-contributorsrc b/.all-contributorsrc index c64cb272b..58bdd7513 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -346,6 +346,15 @@ "contributions": [ "code" ] + }, + { + "login": "woin2ee", + "name": "Jaewon-Yun", + "avatar_url": "https://avatars.githubusercontent.com/u/81426024?v=4", + "profile": "https://github.com/woin2ee", + "contributions": [ + "code" + ] } ], "contributorsPerLine": 7, diff --git a/README.md b/README.md index da02ad629..023a3edbc 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ [![Netlify Status](https://api.netlify.com/api/v1/badges/005ef674-d103-4b05-a4d1-79413ce9d766/deploy-status)](https://app.netlify.com/sites/xcodeproj/deploys) -[![All Contributors](https://img.shields.io/badge/all_contributors-38-orange.svg?style=flat-square)](#contributors-) +[![All Contributors](https://img.shields.io/badge/all_contributors-39-orange.svg?style=flat-square)](#contributors-) [![Swift Package Manager](https://img.shields.io/badge/swift%20package%20manager-compatible-brightgreen.svg)](https://swift.org/package-manager/) @@ -190,6 +190,7 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d Ladislas de Toldi
Ladislas de Toldi

💻 Matt Massicotte
Matt Massicotte

💻 Артем Ворхлик
Артем Ворхлик

💻 + Jaewon-Yun
Jaewon-Yun

💻 From f3eb906ab1210e6b786d8beb71d02be662fa4432 Mon Sep 17 00:00:00 2001 From: Mike Gerasymenko Date: Mon, 8 Jul 2024 14:18:25 +0200 Subject: [PATCH 329/678] Update comment to reflect productNameWithExtension() and others (#823) * fix(820): Update comment to reflect productNameWithExtension() and other property values might differ from Xcode * Update Sources/XcodeProj/Objects/Targets/PBXTarget.swift Co-authored-by: Kas --------- Co-authored-by: Kas --- Sources/XcodeProj/Objects/Targets/PBXTarget.swift | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Sources/XcodeProj/Objects/Targets/PBXTarget.swift b/Sources/XcodeProj/Objects/Targets/PBXTarget.swift index b5440059f..07d255493 100644 --- a/Sources/XcodeProj/Objects/Targets/PBXTarget.swift +++ b/Sources/XcodeProj/Objects/Targets/PBXTarget.swift @@ -58,6 +58,8 @@ public class PBXTarget: PBXContainerItem { public var name: String /// Target product name. + /// + /// This property's value may differ from the value displayed in Xcode if the product name is specified through build settings. public var productName: String? /// Target product reference. @@ -219,6 +221,8 @@ public class PBXTarget: PBXContainerItem { public extension PBXTarget { /// Returns the product name with the extension joined with a period. /// + /// This property's value may differ from the value displayed in Xcode if the product name is specified through build settings. + /// /// - Returns: product name with extension. func productNameWithExtension() -> String? { guard let productName = self.productName else { return nil } From 7713589d4d1bceedd02899d9c44b8e57be05ea35 Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Mon, 8 Jul 2024 14:18:46 +0200 Subject: [PATCH 330/678] docs: add mikeger as a contributor for code (#826) * docs: update README.md [skip ci] * docs: update .all-contributorsrc [skip ci] --------- Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com> --- .all-contributorsrc | 9 +++++++++ README.md | 3 ++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/.all-contributorsrc b/.all-contributorsrc index 58bdd7513..631e7f0a2 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -355,6 +355,15 @@ "contributions": [ "code" ] + }, + { + "login": "mikeger", + "name": "Mike Gerasymenko", + "avatar_url": "https://avatars.githubusercontent.com/u/715129?v=4", + "profile": "https://gera.cx", + "contributions": [ + "code" + ] } ], "contributorsPerLine": 7, diff --git a/README.md b/README.md index 023a3edbc..7dd64e127 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ [![Netlify Status](https://api.netlify.com/api/v1/badges/005ef674-d103-4b05-a4d1-79413ce9d766/deploy-status)](https://app.netlify.com/sites/xcodeproj/deploys) -[![All Contributors](https://img.shields.io/badge/all_contributors-39-orange.svg?style=flat-square)](#contributors-) +[![All Contributors](https://img.shields.io/badge/all_contributors-40-orange.svg?style=flat-square)](#contributors-) [![Swift Package Manager](https://img.shields.io/badge/swift%20package%20manager-compatible-brightgreen.svg)](https://swift.org/package-manager/) @@ -191,6 +191,7 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d Matt Massicotte
Matt Massicotte

💻 Артем Ворхлик
Артем Ворхлик

💻 Jaewon-Yun
Jaewon-Yun

💻 + Mike Gerasymenko
Mike Gerasymenko

💻 From 8a616e132a372bd20ddc79903f88f9183fee4285 Mon Sep 17 00:00:00 2001 From: Pedro Date: Mon, 8 Jul 2024 14:20:44 +0200 Subject: [PATCH 331/678] Update CHANGELOG --- CHANGELOG.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 74e061fb7..e7d2ecced 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,14 @@ ## Unreleased +## 8.22.0 + +### Added +* Add `buildArchitectures` to XCScheme+BuildAction by @woin2ee in https://github.com/tuist/XcodeProj/pull/824 + +### Changed +* Update comment to reflect productNameWithExtension() and others by @mikeger in https://github.com/tuist/XcodeProj/pull/823 + ## 8.21.0 ### Fixed From a5120dc37b6b526534c72f215e99147b3cb1cf25 Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Sat, 20 Jul 2024 20:32:45 +0200 Subject: [PATCH 332/678] docs: add filipracki as a contributor for code (#832) * docs: update README.md [skip ci] * docs: update .all-contributorsrc [skip ci] --------- Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com> --- .all-contributorsrc | 9 +++++++++ README.md | 3 ++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/.all-contributorsrc b/.all-contributorsrc index 631e7f0a2..eb0f72aef 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -364,6 +364,15 @@ "contributions": [ "code" ] + }, + { + "login": "filipracki", + "name": "Filip Racki", + "avatar_url": "https://avatars.githubusercontent.com/u/27164368?v=4", + "profile": "https://github.com/filipracki", + "contributions": [ + "code" + ] } ], "contributorsPerLine": 7, diff --git a/README.md b/README.md index 7dd64e127..2f504e865 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ [![Netlify Status](https://api.netlify.com/api/v1/badges/005ef674-d103-4b05-a4d1-79413ce9d766/deploy-status)](https://app.netlify.com/sites/xcodeproj/deploys) -[![All Contributors](https://img.shields.io/badge/all_contributors-40-orange.svg?style=flat-square)](#contributors-) +[![All Contributors](https://img.shields.io/badge/all_contributors-41-orange.svg?style=flat-square)](#contributors-) [![Swift Package Manager](https://img.shields.io/badge/swift%20package%20manager-compatible-brightgreen.svg)](https://swift.org/package-manager/) @@ -192,6 +192,7 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d Артем Ворхлик
Артем Ворхлик

💻 Jaewon-Yun
Jaewon-Yun

💻 Mike Gerasymenko
Mike Gerasymenko

💻 + Filip Racki
Filip Racki

💻 From 5f77765965507c23b5b2361144f5e051316ad6f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20Pi=C3=B1era=20Buend=C3=ADa?= <663605+pepicrft@users.noreply.github.com> Date: Tue, 23 Jul 2024 12:35:56 +0200 Subject: [PATCH 333/678] Update CODE_OF_CONDUCT.md --- CODE_OF_CONDUCT.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index 872148ab7..c8d974ca1 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -1 +1,3 @@ -Check out the organization [CODE OF CONDUCT](https://github.com/tuist/tuist/blob/main/docs/contribution/code-of-conduct.md) +# Code of conduct + +The code of conduct is available in [Tuist's handbook](https://handbook.tuist.io/people/code-of-conduct.html). From b468717a8409b83f90c2b9a4400068c2088fc491 Mon Sep 17 00:00:00 2001 From: Filip Racki Date: Fri, 26 Jul 2024 17:12:52 +0200 Subject: [PATCH 334/678] Add Metal Diagnostics Options to LaunchAction (#828) --- .../Scheme/XCScheme+LaunchAction.swift | 52 ++++++++++++++----- 1 file changed, 38 insertions(+), 14 deletions(-) diff --git a/Sources/XcodeProj/Scheme/XCScheme+LaunchAction.swift b/Sources/XcodeProj/Scheme/XCScheme+LaunchAction.swift index c75be7310..00724d8ad 100644 --- a/Sources/XcodeProj/Scheme/XCScheme+LaunchAction.swift +++ b/Sources/XcodeProj/Scheme/XCScheme+LaunchAction.swift @@ -18,11 +18,13 @@ extension XCScheme { case disabled = "3" } - public enum GPUValidationMode: String, Sendable { - case enabled = "0" - case disabled = "1" - case extended = "2" - } + // The value used to disable 'API Validation'. + // If this feature is not being disabled, this value will not be present. + public let gpuValidationModeDisableValue = "1" + + // The value used to enable 'Shader Validation'. + // If this feature is not being enabled, this value will not be present. + public let gpuShaderValidationModeEnableValue = "2" // MARK: - Static @@ -30,7 +32,6 @@ extension XCScheme { public static let defaultDebugServiceExtension = "internal" private static let defaultLaunchStyle = Style.auto public static let defaultGPUFrameCaptureMode = GPUFrameCaptureMode.autoEnabled - public static let defaultGPUValidationMode = GPUValidationMode.enabled // MARK: - Attributes @@ -50,7 +51,10 @@ extension XCScheme { public var allowLocationSimulation: Bool public var locationScenarioReference: LocationScenarioReference? public var enableGPUFrameCaptureMode: GPUFrameCaptureMode - public var enableGPUValidationMode: GPUValidationMode + public var disableGPUValidationMode: Bool + public var enableGPUShaderValidationMode: Bool + public var showGraphicsOverview: Bool + public var logGraphicsOverview: Bool public var enableAddressSanitizer: Bool public var enableASanStackUseAfterReturn: Bool public var enableThreadSanitizer: Bool @@ -92,7 +96,10 @@ extension XCScheme { allowLocationSimulation: Bool = true, locationScenarioReference: LocationScenarioReference? = nil, enableGPUFrameCaptureMode: GPUFrameCaptureMode = LaunchAction.defaultGPUFrameCaptureMode, - enableGPUValidationMode: GPUValidationMode = LaunchAction.defaultGPUValidationMode, + disableGPUValidationMode: Bool = false, + enableGPUShaderValidationMode: Bool = false, + showGraphicsOverview: Bool = false, + logGraphicsOverview: Bool = false, enableAddressSanitizer: Bool = false, enableASanStackUseAfterReturn: Bool = false, enableThreadSanitizer: Bool = false, @@ -128,7 +135,10 @@ extension XCScheme { self.allowLocationSimulation = allowLocationSimulation self.locationScenarioReference = locationScenarioReference self.enableGPUFrameCaptureMode = enableGPUFrameCaptureMode - self.enableGPUValidationMode = enableGPUValidationMode + self.disableGPUValidationMode = disableGPUValidationMode + self.enableGPUShaderValidationMode = enableGPUShaderValidationMode + self.showGraphicsOverview = showGraphicsOverview + self.logGraphicsOverview = logGraphicsOverview self.enableAddressSanitizer = enableAddressSanitizer self.enableASanStackUseAfterReturn = enableASanStackUseAfterReturn self.enableThreadSanitizer = enableThreadSanitizer @@ -191,8 +201,10 @@ extension XCScheme { enableGPUFrameCaptureMode = element.attributes["enableGPUFrameCaptureMode"] .flatMap { GPUFrameCaptureMode(rawValue: $0) } ?? LaunchAction.defaultGPUFrameCaptureMode - enableGPUValidationMode = element.attributes["enableGPUValidationMode"] - .flatMap { GPUValidationMode(rawValue: $0) } ?? LaunchAction.defaultGPUValidationMode + disableGPUValidationMode = element.attributes["enableGPUValidationMode"] == gpuValidationModeDisableValue + enableGPUShaderValidationMode = element.attributes["enableGPUShaderValidationMode"] == gpuShaderValidationModeEnableValue + showGraphicsOverview = element.attributes["showGraphicsOverview"] == "Yes" + logGraphicsOverview = element.attributes["logGraphicsOverview"] == "Yes" enableAddressSanitizer = element.attributes["enableAddressSanitizer"] == "YES" enableASanStackUseAfterReturn = element.attributes["enableASanStackUseAfterReturn"] == "YES" enableThreadSanitizer = element.attributes["enableThreadSanitizer"] == "YES" @@ -257,8 +269,17 @@ extension XCScheme { if enableGPUFrameCaptureMode != LaunchAction.defaultGPUFrameCaptureMode { attributes["enableGPUFrameCaptureMode"] = enableGPUFrameCaptureMode.rawValue } - if enableGPUValidationMode != LaunchAction.defaultGPUValidationMode { - attributes["enableGPUValidationMode"] = enableGPUValidationMode.rawValue + if disableGPUValidationMode { + attributes["enableGPUValidationMode"] = gpuValidationModeDisableValue + } + if enableGPUShaderValidationMode { + attributes["enableGPUShaderValidationMode"] = gpuShaderValidationModeEnableValue + } + if showGraphicsOverview { + attributes["showGraphicsOverview"] = showGraphicsOverview.xmlString + } + if logGraphicsOverview { + attributes["logGraphicsOverview"] = showGraphicsOverview.xmlString } if enableAddressSanitizer { attributes["enableAddressSanitizer"] = enableAddressSanitizer.xmlString @@ -383,7 +404,10 @@ extension XCScheme { allowLocationSimulation == rhs.allowLocationSimulation && locationScenarioReference == rhs.locationScenarioReference && enableGPUFrameCaptureMode == rhs.enableGPUFrameCaptureMode && - enableGPUValidationMode == rhs.enableGPUValidationMode && + disableGPUValidationMode == rhs.disableGPUValidationMode && + enableGPUShaderValidationMode == rhs.enableGPUShaderValidationMode && + showGraphicsOverview == rhs.showGraphicsOverview && + logGraphicsOverview == rhs.logGraphicsOverview && enableAddressSanitizer == rhs.enableAddressSanitizer && enableASanStackUseAfterReturn == rhs.enableASanStackUseAfterReturn && enableThreadSanitizer == rhs.enableThreadSanitizer && From 951e9397e59dd1cabb369c1e8894643f7be22019 Mon Sep 17 00:00:00 2001 From: Filip Racki Date: Tue, 30 Jul 2024 17:33:58 +0200 Subject: [PATCH 335/678] Fix incorrect way of setting "yes" attributes of "showGraphicsOverview" and "logGraphicsOverview" (#834) --- Sources/XcodeProj/Scheme/XCScheme+LaunchAction.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Sources/XcodeProj/Scheme/XCScheme+LaunchAction.swift b/Sources/XcodeProj/Scheme/XCScheme+LaunchAction.swift index 00724d8ad..a8770502f 100644 --- a/Sources/XcodeProj/Scheme/XCScheme+LaunchAction.swift +++ b/Sources/XcodeProj/Scheme/XCScheme+LaunchAction.swift @@ -276,10 +276,10 @@ extension XCScheme { attributes["enableGPUShaderValidationMode"] = gpuShaderValidationModeEnableValue } if showGraphicsOverview { - attributes["showGraphicsOverview"] = showGraphicsOverview.xmlString + attributes["showGraphicsOverview"] = "Yes" } if logGraphicsOverview { - attributes["logGraphicsOverview"] = showGraphicsOverview.xmlString + attributes["logGraphicsOverview"] = "Yes" } if enableAddressSanitizer { attributes["enableAddressSanitizer"] = enableAddressSanitizer.xmlString From 0a327c67a4158a756dc60d74e01ed8e1699ca53b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20Pi=C3=B1era=20Buend=C3=ADa?= <663605+pepicrft@users.noreply.github.com> Date: Thu, 8 Aug 2024 15:06:27 +0200 Subject: [PATCH 336/678] chore: set up SwiftLint and SwiftFormat, run them against the project, and run them as part of the CI workflows (#836) * chore: run SwiftLint and SwiftFormat against the project * chore: lint on CI * Fix compilation issue * Lint on macOS because swiftformat can't run on Ubuntu --- .github/workflows/xcodeproj.yml | 15 ++- .gitignore | 4 + .mise.toml | 3 + .mise/tasks/lint | 6 + .mise/tasks/lint-fix | 6 + .swiftformat | 4 +- .../FileSharedAcrossTargetsTests.swift | 4 +- .../AppWithExtensions/AppDelegate.swift | 2 +- Fixtures/iOS/iOS/AppDelegate.swift | 2 +- Package.swift | 4 +- .../Extensions/AEXML+XcodeFormat.swift | 8 +- .../XcodeProj/Extensions/Array+Extras.swift | 4 +- .../XcodeProj/Extensions/Path+Extras.swift | 17 ++- .../XcodeProj/Extensions/String+Utils.swift | 12 +- Sources/XcodeProj/Extensions/String+md5.swift | 32 ++--- .../Objects/BuildPhase/PBXBuildFile.swift | 16 +-- .../Objects/BuildPhase/PBXBuildPhase.swift | 6 +- .../Objects/BuildPhase/PBXBuildRule.swift | 16 +-- .../BuildPhase/PBXCopyFilesBuildPhase.swift | 6 +- .../BuildPhase/PBXShellScriptBuildPhase.swift | 12 +- .../Configuration/XCBuildConfiguration.swift | 4 +- .../Configuration/XCConfigurationList.swift | 14 +- .../Objects/Files/PBXContainerItem.swift | 2 +- .../Objects/Files/PBXContainerItemProxy.swift | 6 +- .../Objects/Files/PBXFileElement.swift | 18 +-- .../Objects/Files/PBXFileReference.swift | 14 +- .../XcodeProj/Objects/Files/PBXGroup.swift | 8 +- .../Objects/Files/XCVersionGroup.swift | 4 +- .../Objects/Project/PBXObjectReference.swift | 8 +- .../Objects/Project/PBXObjects.swift | 6 +- .../Objects/Project/PBXOutputSettings.swift | 12 +- .../XcodeProj/Objects/Project/PBXProj.swift | 4 +- .../Objects/Project/PBXProjEncoder.swift | 22 ++-- .../Objects/Project/PBXProject.swift | 35 ++--- .../Objects/Sourcery/Equality.generated.swift | 14 +- .../XCRemoteSwiftPackageReference.swift | 4 +- .../XCSwiftPackageProductDependency.swift | 2 +- .../Objects/Targets/PBXAggregateTarget.swift | 2 +- .../Objects/Targets/PBXLegacyTarget.swift | 8 +- .../Objects/Targets/PBXNativeTarget.swift | 4 +- .../Objects/Targets/PBXProductType.swift | 2 +- .../Objects/Targets/PBXReferenceProxy.swift | 4 +- .../XcodeProj/Objects/Targets/PBXTarget.swift | 10 +- .../Objects/Targets/PBXTargetDependency.swift | 12 +- .../XcodeProj/Project/WorkspaceSettings.swift | 17 +-- .../XcodeProj/Project/XCBreakpointList.swift | 18 +-- Sources/XcodeProj/Project/XCSharedData.swift | 10 +- Sources/XcodeProj/Project/XCUserData.swift | 12 +- Sources/XcodeProj/Project/Xcode.swift | 18 +-- Sources/XcodeProj/Protocols/Writable.swift | 6 +- .../Scheme/XCScheme+AditionalOption.swift | 4 +- .../Scheme/XCScheme+AnalyzeAction.swift | 4 +- .../Scheme/XCScheme+ArchiveAction.swift | 4 +- .../Scheme/XCScheme+BuildAction.swift | 10 +- .../XCScheme+BuildableProductRunnable.swift | 4 +- .../Scheme/XCScheme+BuildableReference.swift | 8 +- .../XCScheme+CommandLineArguments.swift | 10 +- .../Scheme/XCScheme+EnvironmentVariable.swift | 6 +- .../Scheme/XCScheme+ExecutionAction.swift | 8 +- .../Scheme/XCScheme+LaunchAction.swift | 36 ++--- .../XCScheme+LocationScenarioReference.swift | 4 +- .../Scheme/XCScheme+PathRunnable.swift | 4 +- .../Scheme/XCScheme+ProfileAction.swift | 26 ++-- .../Scheme/XCScheme+RemoteRunnable.swift | 4 +- .../XcodeProj/Scheme/XCScheme+Runnable.swift | 6 +- .../Scheme/XCScheme+SerialAction.swift | 8 +- ...e+StoreKitConfigurationFileReference.swift | 4 +- .../Scheme/XCScheme+TestAction.swift | 32 ++--- .../XcodeProj/Scheme/XCScheme+TestItem.swift | 4 +- .../Scheme/XCScheme+TestPlanReference.swift | 4 +- .../Scheme/XCScheme+TestableReference.swift | 16 +-- Sources/XcodeProj/Scheme/XCScheme.swift | 20 +-- .../XcodeProj/Scheme/XCSchemeManagement.swift | 101 +++++++------- .../Utils/BuildSettingsProvider.swift | 14 +- Sources/XcodeProj/Utils/CommentedString.swift | 2 +- Sources/XcodeProj/Utils/Decoders.swift | 2 +- Sources/XcodeProj/Utils/JSONDecoding.swift | 6 +- Sources/XcodeProj/Utils/PBXBatchUpdater.swift | 124 +++++++++--------- Sources/XcodeProj/Utils/PlistValue.swift | 2 +- .../XcodeProj/Utils/ReferenceGenerator.swift | 36 ++--- Sources/XcodeProj/Utils/XCConfig.swift | 36 ++--- Sources/XcodeProj/Workspace/XCWorkspace.swift | 4 +- .../XcodeProj/Workspace/XCWorkspaceData.swift | 8 +- .../Extensions/AEXML+XcodeFormatTests.swift | 10 +- .../Extensions/XCTestCase+Assertions.swift | 4 +- .../BuildPhase/PBXBuildFileTests.swift | 2 +- .../PBXShellScriptBuildPhaseTests.swift | 8 +- .../XCConfigurationList+Fixtures.swift | 3 +- .../XCConfigurationListTests.swift | 2 +- .../Files/PBXFileReference+Fixtures.swift | 3 +- .../Objects/Files/PBXGroup+Fixtures.swift | 3 +- .../Objects/Files/PBXGroupTests.swift | 2 +- .../Files/XCVersionGroup+Fixtures.swift | 5 +- .../Project/PBXOutputSettingsTests.swift | 32 ++--- .../Objects/Project/PBXProj+Fixtures.swift | 3 +- .../Objects/Project/PBXProjEncoderTests.swift | 52 ++++---- .../Project/PBXProjIntegrationTests.swift | 6 +- .../Objects/Project/PBXProject+Fixtures.swift | 3 +- .../XCLocalSwiftPackageReferenceTests.swift | 2 +- .../Objects/Targets/PBXTarget+Fixtures.swift | 3 +- .../Project/XCBreakpointListTests.swift | 2 +- .../Project/XCUserDataTests.swift | 4 +- .../Project/XcodeProjTests.swift | 4 +- .../XCScheme+BuildableReferenceTests.swift | 2 +- .../Scheme/XCSchemeManagementTests.swift | 16 +-- .../XcodeProjTests/Scheme/XCSchemeTests.swift | 12 +- Tests/XcodeProjTests/Tests/Fixtures.swift | 1 - Tests/XcodeProjTests/Tests/testWrite.swift | 23 ++-- .../Utils/ReferenceGeneratorTests.swift | 2 +- .../XcodeProjTests/Utils/XCConfigTests.swift | 6 +- 110 files changed, 642 insertions(+), 613 deletions(-) create mode 100644 .mise.toml create mode 100755 .mise/tasks/lint create mode 100755 .mise/tasks/lint-fix diff --git a/.github/workflows/xcodeproj.yml b/.github/workflows/xcodeproj.yml index 0ad6989dc..7d921922f 100644 --- a/.github/workflows/xcodeproj.yml +++ b/.github/workflows/xcodeproj.yml @@ -7,6 +7,9 @@ concurrency: group: xcodeproj-${{ github.head_ref }} cancel-in-progress: true +env: + MISE_EXPERIMENTAL: 1 + jobs: build: name: Build (macOS) @@ -49,12 +52,10 @@ jobs: git config --global init.defaultBranch main - name: Build and run tests run: swift test --enable-test-discovery - swiftlint: - name: Swiftlint - runs-on: ubuntu-latest + lint: + name: Lint + runs-on: macos-latest steps: - uses: actions/checkout@v3 - - name: GitHub Action for SwiftLint - uses: norio-nomura/action-swiftlint@3.2.1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - uses: jdx/mise-action@v2 + - run: mise run lint diff --git a/.gitignore b/.gitignore index 0dac9e3e9..97f05bc98 100644 --- a/.gitignore +++ b/.gitignore @@ -186,3 +186,7 @@ tmp/ XcodeProj.framework.zip !Fixtures/**/xcuserdata/ + +Derived/ +*.xcworkspace/ +*.xcodeproj/ diff --git a/.mise.toml b/.mise.toml new file mode 100644 index 000000000..317af7dd7 --- /dev/null +++ b/.mise.toml @@ -0,0 +1,3 @@ +[tools] +swiftlint = "0.54.0" +swiftformat = "0.54.3" diff --git a/.mise/tasks/lint b/.mise/tasks/lint new file mode 100755 index 000000000..d1a523f1d --- /dev/null +++ b/.mise/tasks/lint @@ -0,0 +1,6 @@ +#!/bin/bash +# mise description="Lint the workspace" +set -euo pipefail + +swiftformat $MISE_PROJECT_ROOT --lint +swiftlint lint --quiet --config $MISE_PROJECT_ROOT/.swiftlint.yml $MISE_PROJECT_ROOT/Sources diff --git a/.mise/tasks/lint-fix b/.mise/tasks/lint-fix new file mode 100755 index 000000000..cfc035959 --- /dev/null +++ b/.mise/tasks/lint-fix @@ -0,0 +1,6 @@ +#!/bin/bash +# mise description="Lint the workspace fixing issues" +set -euo pipefail + +swiftformat $MISE_PROJECT_ROOT +swiftlint lint --fix --quiet --config $MISE_PROJECT_ROOT/.swiftlint.yml $MISE_PROJECT_ROOT/Sources diff --git a/.swiftformat b/.swiftformat index cce74ebea..d9bc86bea 100644 --- a/.swiftformat +++ b/.swiftformat @@ -5,6 +5,8 @@ # format options +--disable wrapMultilineStatementBraces +--disable braces --allman false --binarygrouping 4,8 --commas always @@ -32,4 +34,4 @@ --stripunusedargs always --trimwhitespace always --wraparguments preserve ---wrapcollections preserve \ No newline at end of file +--wrapcollections preserve diff --git a/Fixtures/FileSharedAcrossTargets/FileSharedAcrossTargetsTests/FileSharedAcrossTargetsTests.swift b/Fixtures/FileSharedAcrossTargets/FileSharedAcrossTargetsTests/FileSharedAcrossTargetsTests.swift index 62976e867..5b957f983 100644 --- a/Fixtures/FileSharedAcrossTargets/FileSharedAcrossTargetsTests/FileSharedAcrossTargetsTests.swift +++ b/Fixtures/FileSharedAcrossTargets/FileSharedAcrossTargetsTests/FileSharedAcrossTargetsTests.swift @@ -2,7 +2,6 @@ import XCTest @testable import FileSharedAcrossTargets final class FileSharedAcrossTargetsTests: XCTestCase { - override func setUpWithError() throws { // Put setup code here. This method is called before the invocation of each test method in the class. } @@ -21,9 +20,8 @@ final class FileSharedAcrossTargetsTests: XCTestCase { func testPerformanceExample() throws { // This is an example of a performance test case. - self.measure { + measure { // Put the code you want to measure the time of here. } } - } diff --git a/Fixtures/iOS/AppWithExtensions/AppWithExtensions/AppDelegate.swift b/Fixtures/iOS/AppWithExtensions/AppWithExtensions/AppDelegate.swift index ec501c432..5d0695c4a 100644 --- a/Fixtures/iOS/AppWithExtensions/AppWithExtensions/AppDelegate.swift +++ b/Fixtures/iOS/AppWithExtensions/AppWithExtensions/AppDelegate.swift @@ -1,6 +1,6 @@ import UIKit -@UIApplicationMain +@main class AppDelegate: UIResponder, UIApplicationDelegate { func application(_: UIApplication, didFinishLaunchingWithOptions _: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { // Override point for customization after application launch. diff --git a/Fixtures/iOS/iOS/AppDelegate.swift b/Fixtures/iOS/iOS/AppDelegate.swift index 843ae1f67..22f27cb41 100644 --- a/Fixtures/iOS/iOS/AppDelegate.swift +++ b/Fixtures/iOS/iOS/AppDelegate.swift @@ -8,7 +8,7 @@ import UIKit -@UIApplicationMain +@main class AppDelegate: UIResponder, UIApplicationDelegate { var window: UIWindow? diff --git a/Package.swift b/Package.swift index dcd5cc927..4e4b66835 100644 --- a/Package.swift +++ b/Package.swift @@ -10,7 +10,7 @@ let package = Package( dependencies: [ .package(url: "https://github.com/tadija/AEXML.git", .upToNextMinor(from: "4.6.1")), .package(url: "https://github.com/kylef/PathKit.git", .upToNextMinor(from: "1.0.1")), - .package(url: "https://github.com/apple/swift-docc-plugin", from: "1.3.0") + .package(url: "https://github.com/apple/swift-docc-plugin", from: "1.3.0"), ], targets: [ .target(name: "XcodeProj", @@ -19,7 +19,7 @@ let package = Package( .product(name: "AEXML", package: "AEXML"), ], swiftSettings: [ - .enableExperimentalFeature("StrictConcurrency") + .enableExperimentalFeature("StrictConcurrency"), ]), .testTarget(name: "XcodeProjTests", dependencies: ["XcodeProj"]), ] diff --git a/Sources/XcodeProj/Extensions/AEXML+XcodeFormat.swift b/Sources/XcodeProj/Extensions/AEXML+XcodeFormat.swift index d8c4ec157..810170332 100644 --- a/Sources/XcodeProj/Extensions/AEXML+XcodeFormat.swift +++ b/Sources/XcodeProj/Extensions/AEXML+XcodeFormat.swift @@ -103,13 +103,13 @@ let attributesOrder: [String: [String]] = [ "RemoteRunnable": [ "runnableDebuggingMode", "BundleIdentifier", - "RemotePath" + "RemotePath", ], "Scheme": [ "LastUpgradeVersion", "wasCreatedForAppExtension", - "version" - ] + "version", + ], ] extension AEXMLElement { @@ -128,7 +128,7 @@ extension AEXMLElement { if !attributes.isEmpty { // insert known attributes in the specified order. - var attributes = self.attributes + var attributes = attributes for key in attributesOrder[name] ?? [] { if let value = attributes.removeValue(forKey: key) { print(key: key, value: value) diff --git a/Sources/XcodeProj/Extensions/Array+Extras.swift b/Sources/XcodeProj/Extensions/Array+Extras.swift index 310fc3e92..851c00554 100644 --- a/Sources/XcodeProj/Extensions/Array+Extras.swift +++ b/Sources/XcodeProj/Extensions/Array+Extras.swift @@ -1,13 +1,13 @@ import Foundation -extension Array where Element: Hashable { +public extension Array where Element: Hashable { /// Return the array with all duplicates removed. /// /// i.e. `[ 1, 2, 3, 1, 2 ].uniqued() == [ 1, 2, 3 ]` /// /// - note: Taken from stackoverflow.com/a/46354989/3141234, as /// per @Alexander's comment. - public func uniqued() -> [Element] { + func uniqued() -> [Element] { var seen = Set() return filter { seen.insert($0).inserted } } diff --git a/Sources/XcodeProj/Extensions/Path+Extras.swift b/Sources/XcodeProj/Extensions/Path+Extras.swift index 5279f9d0d..75d0f1547 100644 --- a/Sources/XcodeProj/Extensions/Path+Extras.swift +++ b/Sources/XcodeProj/Extensions/Path+Extras.swift @@ -1,17 +1,16 @@ import Foundation + // swiftlint:disable all import PathKit // MARK: - Path extras. - - func systemGlob(_ pattern: UnsafePointer!, _ flags: Int32, _ errfunc: (@convention(c) (UnsafePointer?, Int32) -> Int32)!, _ vector_ptr: UnsafeMutablePointer!) -> Int32 { -#if os(macOS) - return Darwin.glob(pattern, flags, errfunc, vector_ptr) -#else - return Glibc.glob(pattern, flags, errfunc, vector_ptr) -#endif + #if os(macOS) + return Darwin.glob(pattern, flags, errfunc, vector_ptr) + #else + return Glibc.glob(pattern, flags, errfunc, vector_ptr) + #endif } extension Path { @@ -39,9 +38,9 @@ extension Path { let flags = GLOB_TILDE | GLOB_BRACE | GLOB_MARK if systemGlob(cPattern, flags, nil, >) == 0 { #if os(macOS) - let matchc = gt.gl_matchc + let matchc = gt.gl_matchc #else - let matchc = gt.gl_pathc + let matchc = gt.gl_pathc #endif return (0 ..< Int(matchc)).compactMap { index in if let path = String(validatingUTF8: gt.gl_pathv[index]!) { diff --git a/Sources/XcodeProj/Extensions/String+Utils.swift b/Sources/XcodeProj/Extensions/String+Utils.swift index a9ac1a05e..51fc0bf35 100644 --- a/Sources/XcodeProj/Extensions/String+Utils.swift +++ b/Sources/XcodeProj/Extensions/String+Utils.swift @@ -4,22 +4,22 @@ import Foundation import SwiftGlibc public func arc4random_uniform(_ max: UInt32) -> Int32 { - (SwiftGlibc.rand() % Int32(max - 1)) + SwiftGlibc.rand() % Int32(max - 1) } #endif -extension String { - public var quoted: String { +public extension String { + var quoted: String { "\"\(self)\"" } - public var isQuoted: Bool { + var isQuoted: Bool { hasPrefix("\"") && hasSuffix("\"") } - public static func random(length: Int = 20) -> String { + static func random(length: Int = 20) -> String { let base = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789" - var randomString: String = "" + var randomString = "" for _ in 0 ..< length { let randomValue = arc4random_uniform(UInt32(base.count)) diff --git a/Sources/XcodeProj/Extensions/String+md5.swift b/Sources/XcodeProj/Extensions/String+md5.swift index 8ffa9d1f5..1c0afa871 100644 --- a/Sources/XcodeProj/Extensions/String+md5.swift +++ b/Sources/XcodeProj/Extensions/String+md5.swift @@ -1,6 +1,6 @@ // swiftlint:disable all // -// String+MD5.swift +// String+md5.swift // Kingfisher // // To date, adding CommonCrypto to a Swift framework is problematic. See: @@ -22,7 +22,7 @@ import Foundation #if canImport(CryptoKit) -import CryptoKit + import CryptoKit #endif extension String { @@ -31,14 +31,14 @@ extension String { return self } #if canImport(CryptoKit) - if #available(OSX 10.15, *) { - return Insecure.MD5.hash(data: data) - .withUnsafeBytes { Array($0) }.hexString - } else { - return data.slowMD5 - } + if #available(OSX 10.15, *) { + return Insecure.MD5.hash(data: data) + .withUnsafeBytes { Array($0) }.hexString + } else { + return data.slowMD5 + } #else - return data.slowMD5 + return data.slowMD5 #endif } } @@ -48,11 +48,11 @@ private let char0 = UInt8(UnicodeScalar("0").value) private extension DataProtocol { var hexString: String { - let hexLen = self.count * 2 + let hexLen = count * 2 var hexChars = [UInt8](repeating: 0, count: hexLen) var offset = 0 - self.regions.forEach { (_) in + for _ in regions { for i in self { hexChars[Int(offset * 2)] = itoh((i >> 4) & 0xF) hexChars[Int(offset * 2 + 1)] = itoh(i & 0xF) @@ -64,7 +64,7 @@ private extension DataProtocol { } func itoh(_ value: UInt8) -> UInt8 { - return (value > 9) ? (charA + value - 10) : (char0 + value) + (value > 9) ? (charA + value - 10) : (char0 + value) } } @@ -91,7 +91,7 @@ func arrayOfBytes(_ value: T, length: Int? = nil) -> [UInt8] { let valuePointer = UnsafeMutablePointer.allocate(capacity: 1) valuePointer.pointee = value - let bytes = valuePointer.withMemoryRebound(to: UInt8.self, capacity: totalBytes) { (bytesPointer) -> [UInt8] in + let bytes = valuePointer.withMemoryRebound(to: UInt8.self, capacity: totalBytes) { bytesPointer -> [UInt8] in var bytes = [UInt8](repeating: 0, count: totalBytes) for j in 0 ..< min(MemoryLayout.size, totalBytes) { bytes[totalBytes - 1 - j] = (bytesPointer + j).pointee @@ -282,7 +282,7 @@ class MD5: HashProtocol { F = B ^ C ^ D g = (3 * j + 5) % 16 case 48 ... 63: - F = C ^ (B | (~D)) + F = C ^ (B | ~D) g = (7 * j) % 16 default: break @@ -303,8 +303,8 @@ class MD5: HashProtocol { var result = [UInt8]() result.reserveCapacity(hh.count / 4) - hh.forEach { - let itemLE = $0.littleEndian + for item in hh { + let itemLE = item.littleEndian let r1 = UInt8(itemLE & 0xFF) let r2 = UInt8((itemLE >> 8) & 0xFF) let r3 = UInt8((itemLE >> 16) & 0xFF) diff --git a/Sources/XcodeProj/Objects/BuildPhase/PBXBuildFile.swift b/Sources/XcodeProj/Objects/BuildPhase/PBXBuildFile.swift index 99e8c8445..5bf89bc25 100644 --- a/Sources/XcodeProj/Objects/BuildPhase/PBXBuildFile.swift +++ b/Sources/XcodeProj/Objects/BuildPhase/PBXBuildFile.swift @@ -114,28 +114,28 @@ extension PBXBuildFile { /// - Returns: build phase type. /// - Throws: an error if this method is called before the build file is added to any project. func getBuildPhase() throws -> PBXBuildPhase? { - if let buildPhase = buildPhase { + if let buildPhase { return buildPhase } let projectObjects = try objects() if let buildPhase = projectObjects.sourcesBuildPhases.values - .first(where: { $0.fileReferences?.map { $0.value }.contains(reference.value) == true }) { + .first(where: { $0.fileReferences?.map(\.value).contains(reference.value) == true }) { return buildPhase } else if let buildPhase = projectObjects.frameworksBuildPhases - .values.first(where: { $0.fileReferences?.map { $0.value }.contains(reference.value) == true }) { + .values.first(where: { $0.fileReferences?.map(\.value).contains(reference.value) == true }) { return buildPhase } else if let buildPhase = projectObjects .resourcesBuildPhases.values - .first(where: { $0.fileReferences?.map { $0.value }.contains(reference.value) == true }) { + .first(where: { $0.fileReferences?.map(\.value).contains(reference.value) == true }) { return buildPhase } else if let buildPhase = projectObjects.copyFilesBuildPhases - .values.first(where: { $0.fileReferences?.map { $0.value }.contains(reference.value) == true }) { + .values.first(where: { $0.fileReferences?.map(\.value).contains(reference.value) == true }) { return buildPhase } else if let buildPhase = projectObjects.headersBuildPhases - .values.first(where: { $0.fileReferences?.map { $0.value }.contains(reference.value) == true }) { + .values.first(where: { $0.fileReferences?.map(\.value).contains(reference.value) == true }) { return buildPhase } else if let buildPhase = projectObjects.carbonResourcesBuildPhases - .values.first(where: { $0.fileReferences?.map { $0.value }.contains(reference.value) == true }) { + .values.first(where: { $0.fileReferences?.map(\.value).contains(reference.value) == true }) { return buildPhase } return nil @@ -186,7 +186,7 @@ final class PBXBuildPhaseFile: PlistSerializable, Equatable { if let platformFilters = buildFile.platformFilters { dictionary["platformFilters"] = .array(platformFilters.map { .string(.init($0)) }) } - let comment = try buildPhase.name().flatMap { "\(try buildFile.fileName() ?? "(null)") in \($0)" } + let comment = try buildPhase.name().flatMap { try "\(buildFile.fileName() ?? "(null)") in \($0)" } return (key: CommentedString(reference, comment: comment), value: .dictionary(dictionary)) } diff --git a/Sources/XcodeProj/Objects/BuildPhase/PBXBuildPhase.swift b/Sources/XcodeProj/Objects/BuildPhase/PBXBuildPhase.swift index b6f261a19..953be5c8b 100644 --- a/Sources/XcodeProj/Objects/BuildPhase/PBXBuildPhase.swift +++ b/Sources/XcodeProj/Objects/BuildPhase/PBXBuildPhase.swift @@ -86,7 +86,7 @@ public class PBXBuildPhase: PBXContainerItem { override func plistValues(proj: PBXProj, reference: String) throws -> [CommentedString: PlistValue] { var dictionary = try super.plistValues(proj: proj, reference: reference) dictionary["buildActionMask"] = .string(CommentedString("\(buildActionMask)")) - if let fileReferences = fileReferences { + if let fileReferences { let files: PlistValue = .array(fileReferences.map { fileReference in let buildFile: PBXBuildFile? = fileReference.getObject() let name = buildFile.flatMap { try? $0.fileName() } ?? nil @@ -97,10 +97,10 @@ public class PBXBuildPhase: PBXContainerItem { }) dictionary["files"] = files } - if let inputFileListPaths = inputFileListPaths { + if let inputFileListPaths { dictionary["inputFileListPaths"] = .array(inputFileListPaths.map { .string(CommentedString($0)) }) } - if let outputFileListPaths = outputFileListPaths { + if let outputFileListPaths { dictionary["outputFileListPaths"] = .array(outputFileListPaths.map { .string(CommentedString($0)) }) } dictionary["runOnlyForDeploymentPostprocessing"] = .string(CommentedString("\(runOnlyForDeploymentPostprocessing.int)")) diff --git a/Sources/XcodeProj/Objects/BuildPhase/PBXBuildRule.swift b/Sources/XcodeProj/Objects/BuildPhase/PBXBuildRule.swift index 592cded4a..45b498078 100644 --- a/Sources/XcodeProj/Objects/BuildPhase/PBXBuildRule.swift +++ b/Sources/XcodeProj/Objects/BuildPhase/PBXBuildRule.swift @@ -18,7 +18,7 @@ public final class PBXBuildRule: PBXObject { /// Element name. public var name: String? - + /// The discovered dependency file to use public var dependencyFile: String? @@ -111,28 +111,28 @@ extension PBXBuildRule: PlistSerializable { var dictionary: [CommentedString: PlistValue] = [:] dictionary["isa"] = .string(CommentedString(PBXBuildRule.isa)) dictionary["compilerSpec"] = .string(CommentedString(compilerSpec)) - if let dependencyFile = dependencyFile { + if let dependencyFile { dictionary["dependencyFile"] = .string(CommentedString(dependencyFile)) } - if let filePatterns = filePatterns { + if let filePatterns { dictionary["filePatterns"] = .string(CommentedString(filePatterns)) } dictionary["fileType"] = .string(CommentedString(fileType)) dictionary["isEditable"] = .string(CommentedString("\(isEditable.int)")) - if let name = name { + if let name { dictionary["name"] = .string(CommentedString(name)) } dictionary["outputFiles"] = .array(outputFiles.map { .string(CommentedString($0)) }) - if let inputFiles = inputFiles { + if let inputFiles { dictionary["inputFiles"] = .array(inputFiles.map { .string(CommentedString($0)) }) } - if let outputFilesCompilerFlags = outputFilesCompilerFlags { + if let outputFilesCompilerFlags { dictionary["outputFilesCompilerFlags"] = .array(outputFilesCompilerFlags.map { PlistValue.string(CommentedString($0)) }) } - if let script = script { + if let script { dictionary["script"] = .string(CommentedString(script)) } - if let runOncePerArchitecture = runOncePerArchitecture { + if let runOncePerArchitecture { dictionary["runOncePerArchitecture"] = .string(CommentedString("\(runOncePerArchitecture.int)")) } return (key: CommentedString(reference, comment: PBXBuildRule.isa), diff --git a/Sources/XcodeProj/Objects/BuildPhase/PBXCopyFilesBuildPhase.swift b/Sources/XcodeProj/Objects/BuildPhase/PBXCopyFilesBuildPhase.swift index 2c30cc9ae..0fa51e1cf 100644 --- a/Sources/XcodeProj/Objects/BuildPhase/PBXCopyFilesBuildPhase.swift +++ b/Sources/XcodeProj/Objects/BuildPhase/PBXCopyFilesBuildPhase.swift @@ -84,13 +84,13 @@ extension PBXCopyFilesBuildPhase: PlistSerializable { func plistKeyAndValue(proj: PBXProj, reference: String) throws -> (key: CommentedString, value: PlistValue) { var dictionary: [CommentedString: PlistValue] = try plistValues(proj: proj, reference: reference) dictionary["isa"] = .string(CommentedString(PBXCopyFilesBuildPhase.isa)) - if let dstPath = dstPath { + if let dstPath { dictionary["dstPath"] = .string(CommentedString(dstPath)) } - if let name = name { + if let name { dictionary["name"] = .string(CommentedString(name)) } - if let dstSubfolderSpec = dstSubfolderSpec { + if let dstSubfolderSpec { dictionary["dstSubfolderSpec"] = .string(CommentedString("\(dstSubfolderSpec.rawValue)")) } return (key: CommentedString(reference, comment: name ?? "CopyFiles"), value: .dictionary(dictionary)) diff --git a/Sources/XcodeProj/Objects/BuildPhase/PBXShellScriptBuildPhase.swift b/Sources/XcodeProj/Objects/BuildPhase/PBXShellScriptBuildPhase.swift index 6cfc30fc7..4790dc45f 100644 --- a/Sources/XcodeProj/Objects/BuildPhase/PBXShellScriptBuildPhase.swift +++ b/Sources/XcodeProj/Objects/BuildPhase/PBXShellScriptBuildPhase.swift @@ -91,8 +91,8 @@ public final class PBXShellScriptBuildPhase: PBXBuildPhase { public required init(from decoder: Decoder) throws { let container = try decoder.container(keyedBy: CodingKeys.self) name = try container.decodeIfPresent(.name) - inputPaths = (try container.decodeIfPresent(.inputPaths)) ?? [] - outputPaths = (try container.decodeIfPresent(.outputPaths)) ?? [] + inputPaths = try (container.decodeIfPresent(.inputPaths)) ?? [] + outputPaths = try (container.decodeIfPresent(.outputPaths)) ?? [] shellPath = try container.decodeIfPresent(.shellPath) shellScript = try container.decodeIfPresent(.shellScript) showEnvVarsInLog = try container.decodeIntBoolIfPresent(.showEnvVarsInLog) ?? true @@ -113,18 +113,18 @@ extension PBXShellScriptBuildPhase: PlistSerializable { func plistKeyAndValue(proj: PBXProj, reference: String) throws -> (key: CommentedString, value: PlistValue) { var dictionary: [CommentedString: PlistValue] = try plistValues(proj: proj, reference: reference) dictionary["isa"] = .string(CommentedString(PBXShellScriptBuildPhase.isa)) - if let shellPath = shellPath { + if let shellPath { dictionary["shellPath"] = .string(CommentedString(shellPath)) } dictionary["inputPaths"] = .array(inputPaths.map { .string(CommentedString($0)) }) - if let name = name { + if let name { dictionary["name"] = .string(CommentedString(name)) } dictionary["outputPaths"] = .array(outputPaths.map { .string(CommentedString($0)) }) - if let shellScript = shellScript { + if let shellScript { dictionary["shellScript"] = .string(CommentedString(shellScript)) } - if let dependencyFile = dependencyFile { + if let dependencyFile { dictionary["dependencyFile"] = .string(CommentedString(dependencyFile)) } if !showEnvVarsInLog { diff --git a/Sources/XcodeProj/Objects/Configuration/XCBuildConfiguration.swift b/Sources/XcodeProj/Objects/Configuration/XCBuildConfiguration.swift index 468984cc4..71e05c3dc 100644 --- a/Sources/XcodeProj/Objects/Configuration/XCBuildConfiguration.swift +++ b/Sources/XcodeProj/Objects/Configuration/XCBuildConfiguration.swift @@ -13,7 +13,7 @@ public final class XCBuildConfiguration: PBXObject { baseConfigurationReference?.getObject() } set { - if let newValue = newValue { + if let newValue { baseConfigurationReference = newValue.reference } } @@ -104,7 +104,7 @@ extension XCBuildConfiguration: PlistSerializable { dictionary["isa"] = .string(CommentedString(XCBuildConfiguration.isa)) dictionary["name"] = .string(CommentedString(name)) dictionary["buildSettings"] = buildSettings.plist() - if let baseConfigurationReference = baseConfigurationReference { + if let baseConfigurationReference { let fileElement: PBXFileElement? = baseConfigurationReference.getObject() dictionary["baseConfigurationReference"] = .string(CommentedString(baseConfigurationReference.value, comment: fileElement?.fileName())) } diff --git a/Sources/XcodeProj/Objects/Configuration/XCConfigurationList.swift b/Sources/XcodeProj/Objects/Configuration/XCConfigurationList.swift index 0bf2cfe35..8cf06af86 100644 --- a/Sources/XcodeProj/Objects/Configuration/XCConfigurationList.swift +++ b/Sources/XcodeProj/Objects/Configuration/XCConfigurationList.swift @@ -68,19 +68,19 @@ public final class XCConfigurationList: PBXObject { // MARK: - Helpers -extension XCConfigurationList { +public extension XCConfigurationList { /// Returns the build configuration with the given name (if it exists) /// /// - Parameter name: configuration name. /// - Returns: build configuration if it exists. - public func configuration(name: String) -> XCBuildConfiguration? { + func configuration(name: String) -> XCBuildConfiguration? { buildConfigurations.first(where: { $0.name == name }) } /// Adds the default configurations, debug and release /// /// - Returns: the created configurations. - public func addDefaultConfigurations() throws -> [XCBuildConfiguration] { + func addDefaultConfigurations() throws -> [XCBuildConfiguration] { var configurations: [XCBuildConfiguration] = [] let debug = XCBuildConfiguration(name: "Debug") @@ -99,7 +99,7 @@ extension XCConfigurationList { /// /// - Parameter reference: configuration list reference. /// - Returns: target or project with the given configuration list. - public func objectWithConfigurationList() throws -> PBXObject? { + func objectWithConfigurationList() throws -> PBXObject? { let projectObjects = try objects() return projectObjects.projects.first(where: { $0.value.buildConfigurationListReference == reference })?.value ?? projectObjects.nativeTargets.first(where: { $0.value.buildConfigurationListReference == reference })?.value ?? @@ -120,11 +120,11 @@ extension XCConfigurationList: PlistSerializable { return .string(CommentedString(configReference.value, comment: config?.name)) }) dictionary["defaultConfigurationIsVisible"] = .string(CommentedString("\(defaultConfigurationIsVisible.int)")) - if let defaultConfigurationName = defaultConfigurationName { + if let defaultConfigurationName { dictionary["defaultConfigurationName"] = .string(CommentedString(defaultConfigurationName)) } - return (key: CommentedString(reference, comment: try plistComment()), - value: .dictionary(dictionary)) + return try (key: CommentedString(reference, comment: plistComment()), + value: .dictionary(dictionary)) } private func plistComment() throws -> String? { diff --git a/Sources/XcodeProj/Objects/Files/PBXContainerItem.swift b/Sources/XcodeProj/Objects/Files/PBXContainerItem.swift index 2e11f9039..dfc68661e 100644 --- a/Sources/XcodeProj/Objects/Files/PBXContainerItem.swift +++ b/Sources/XcodeProj/Objects/Files/PBXContainerItem.swift @@ -26,7 +26,7 @@ public class PBXContainerItem: PBXObject { func plistValues(proj _: PBXProj, reference _: String) throws -> [CommentedString: PlistValue] { var dictionary = [CommentedString: PlistValue]() - if let comments = comments { + if let comments { dictionary["comments"] = .string(CommentedString(comments)) } return dictionary diff --git a/Sources/XcodeProj/Objects/Files/PBXContainerItemProxy.swift b/Sources/XcodeProj/Objects/Files/PBXContainerItemProxy.swift index f244aeada..014bc3eea 100644 --- a/Sources/XcodeProj/Objects/Files/PBXContainerItemProxy.swift +++ b/Sources/XcodeProj/Objects/Files/PBXContainerItemProxy.swift @@ -156,13 +156,13 @@ extension PBXContainerItemProxy: PlistSerializable { var dictionary: [CommentedString: PlistValue] = [:] dictionary["isa"] = .string(CommentedString(PBXContainerItemProxy.isa)) dictionary["containerPortal"] = .string(CommentedString(containerPortalReference.value, comment: containerPortal.comment)) - if let proxyType = proxyType { + if let proxyType { dictionary["proxyType"] = .string(CommentedString("\(proxyType.rawValue)")) } - if let remoteGlobalID = remoteGlobalID { + if let remoteGlobalID { dictionary["remoteGlobalIDString"] = .string(CommentedString(remoteGlobalID.uuid)) } - if let remoteInfo = remoteInfo { + if let remoteInfo { dictionary["remoteInfo"] = .string(CommentedString(remoteInfo)) } return (key: CommentedString(reference, diff --git a/Sources/XcodeProj/Objects/Files/PBXFileElement.swift b/Sources/XcodeProj/Objects/Files/PBXFileElement.swift index 573e8ee8e..5f3e80dca 100644 --- a/Sources/XcodeProj/Objects/Files/PBXFileElement.swift +++ b/Sources/XcodeProj/Objects/Files/PBXFileElement.swift @@ -98,29 +98,29 @@ public class PBXFileElement: PBXContainerItem, PlistSerializable { func plistKeyAndValue(proj _: PBXProj, reference: String) throws -> (key: CommentedString, value: PlistValue) { var dictionary: [CommentedString: PlistValue] = [:] dictionary["isa"] = .string(CommentedString(PBXFileElement.isa)) - if let name = name { + if let name { dictionary["name"] = .string(CommentedString(name)) } - if let path = path { + if let path { dictionary["path"] = .string(CommentedString(path)) } - if let sourceTree = sourceTree { + if let sourceTree { dictionary["sourceTree"] = sourceTree.plist() } - if let includeInIndex = includeInIndex { + if let includeInIndex { dictionary["includeInIndex"] = .string(CommentedString("\(includeInIndex.int)")) } - if let usesTabs = usesTabs { + if let usesTabs { dictionary["usesTabs"] = .string(CommentedString("\(usesTabs.int)")) } - if let indentWidth = indentWidth { + if let indentWidth { dictionary["indentWidth"] = .string(CommentedString("\(indentWidth)")) } - if let tabWidth = tabWidth { + if let tabWidth { dictionary["tabWidth"] = .string(CommentedString("\(tabWidth)")) } - if let wrapsLines = wrapsLines { + if let wrapsLines { dictionary["wrapsLines"] = .string(CommentedString("\(wrapsLines.int)")) } return (key: CommentedString(reference, @@ -173,7 +173,7 @@ public extension PBXFileElement { let projectObjects = try objects() let isThisElementRoot = projectObjects.projects.values.first(where: { $0.mainGroup == self }) != nil if isThisElementRoot { - if let path = path { + if let path { return sourceRoot + Path(path) } return sourceRoot diff --git a/Sources/XcodeProj/Objects/Files/PBXFileReference.swift b/Sources/XcodeProj/Objects/Files/PBXFileReference.swift index a1a0ff35f..9595e2536 100644 --- a/Sources/XcodeProj/Objects/Files/PBXFileReference.swift +++ b/Sources/XcodeProj/Objects/Files/PBXFileReference.swift @@ -110,25 +110,25 @@ public final class PBXFileReference: PBXFileElement { override func plistKeyAndValue(proj: PBXProj, reference: String) throws -> (key: CommentedString, value: PlistValue) { var dictionary: [CommentedString: PlistValue] = try super.plistKeyAndValue(proj: proj, reference: reference).value.dictionary ?? [:] dictionary["isa"] = .string(CommentedString(PBXFileReference.isa)) - if let lastKnownFileType = lastKnownFileType { + if let lastKnownFileType { dictionary["lastKnownFileType"] = .string(CommentedString(lastKnownFileType)) } - if let fileEncoding = fileEncoding { + if let fileEncoding { dictionary["fileEncoding"] = .string(CommentedString("\(fileEncoding)")) } - if let explicitFileType = self.explicitFileType { + if let explicitFileType { dictionary["explicitFileType"] = .string(CommentedString(explicitFileType)) } - if let lineEnding = lineEnding { + if let lineEnding { dictionary["lineEnding"] = .string(CommentedString("\(lineEnding)")) } - if let languageSpecificationIdentifier = languageSpecificationIdentifier { + if let languageSpecificationIdentifier { dictionary["languageSpecificationIdentifier"] = .string(CommentedString(languageSpecificationIdentifier)) } - if let xcLanguageSpecificationIdentifier = xcLanguageSpecificationIdentifier { + if let xcLanguageSpecificationIdentifier { dictionary["xcLanguageSpecificationIdentifier"] = .string(CommentedString(xcLanguageSpecificationIdentifier)) } - if let plistStructureDefinitionIdentifier = plistStructureDefinitionIdentifier { + if let plistStructureDefinitionIdentifier { dictionary["plistStructureDefinitionIdentifier"] = .string(CommentedString(plistStructureDefinitionIdentifier)) } return (key: CommentedString(reference, comment: name ?? path), diff --git a/Sources/XcodeProj/Objects/Files/PBXGroup.swift b/Sources/XcodeProj/Objects/Files/PBXGroup.swift index 34add940c..05cece653 100644 --- a/Sources/XcodeProj/Objects/Files/PBXGroup.swift +++ b/Sources/XcodeProj/Objects/Files/PBXGroup.swift @@ -61,7 +61,7 @@ public class PBXGroup: PBXFileElement { let objects = decoder.context.objects let objectReferenceRepository = decoder.context.objectReferenceRepository let container = try decoder.container(keyedBy: CodingKeys.self) - let childrenReferences: [String] = (try container.decodeIfPresent(.children)) ?? [] + let childrenReferences: [String] = try (container.decodeIfPresent(.children)) ?? [] self.childrenReferences = childrenReferences.map { objectReferenceRepository.getOrCreate(reference: $0, objects: objects) } try super.init(from: decoder) } @@ -71,7 +71,7 @@ public class PBXGroup: PBXFileElement { override func plistKeyAndValue(proj: PBXProj, reference: String) throws -> (key: CommentedString, value: PlistValue) { var dictionary: [CommentedString: PlistValue] = try super.plistKeyAndValue(proj: proj, reference: reference).value.dictionary ?? [:] dictionary["isa"] = .string(CommentedString(type(of: self).isa)) - dictionary["children"] = .array(childrenReferences.map { (fileReference) -> PlistValue in + dictionary["children"] = .array(childrenReferences.map { fileReference -> PlistValue in let fileElement: PBXFileElement? = fileReference.getObject() return .string(CommentedString(fileReference.value, comment: fileElement?.fileName())) }) @@ -134,7 +134,7 @@ public extension PBXGroup { /// - Returns: created groups. @discardableResult func addGroup(named groupName: String, options: GroupAddingOptions = []) throws -> [PBXGroup] { - let objects = try self.objects() + let objects = try objects() return groupName.components(separatedBy: "/").reduce(into: [PBXGroup]()) { groups, name in let group = groups.last ?? self let newGroup = PBXGroup(children: [], sourceTree: .group, name: name, path: options.contains(.withoutFolder) ? nil : name) @@ -152,7 +152,7 @@ public extension PBXGroup { /// - Returns: created groups. @discardableResult func addVariantGroup(named groupName: String) throws -> [PBXVariantGroup] { - let objects = try self.objects() + let objects = try objects() return groupName.components(separatedBy: "/").reduce(into: [PBXVariantGroup]()) { groups, name in let group = groups.last ?? self diff --git a/Sources/XcodeProj/Objects/Files/XCVersionGroup.swift b/Sources/XcodeProj/Objects/Files/XCVersionGroup.swift index 3087294f2..d548a01ec 100644 --- a/Sources/XcodeProj/Objects/Files/XCVersionGroup.swift +++ b/Sources/XcodeProj/Objects/Files/XCVersionGroup.swift @@ -87,10 +87,10 @@ public final class XCVersionGroup: PBXGroup { override func plistKeyAndValue(proj: PBXProj, reference: String) throws -> (key: CommentedString, value: PlistValue) { var dictionary: [CommentedString: PlistValue] = try super.plistKeyAndValue(proj: proj, reference: reference).value.dictionary ?? [:] dictionary["isa"] = .string(CommentedString(XCVersionGroup.isa)) - if let versionGroupType = versionGroupType { + if let versionGroupType { dictionary["versionGroupType"] = .string(CommentedString(versionGroupType)) } - if let currentVersionReference = currentVersionReference { + if let currentVersionReference { let fileElement: PBXFileElement? = currentVersionReference.getObject() dictionary["currentVersion"] = .string(CommentedString(currentVersionReference.value, comment: fileElement?.fileName())) } diff --git a/Sources/XcodeProj/Objects/Project/PBXObjectReference.swift b/Sources/XcodeProj/Objects/Project/PBXObjectReference.swift index c72a943af..3f544af26 100644 --- a/Sources/XcodeProj/Objects/Project/PBXObjectReference.swift +++ b/Sources/XcodeProj/Objects/Project/PBXObjectReference.swift @@ -54,7 +54,7 @@ class PBXObjectReference: NSObject, Comparable, NSCopying { let object = objects?.delete(reference: self) self.value = value temporary = false - if let object = object { + if let object { objects?.add(object: object) } } @@ -64,7 +64,7 @@ class PBXObjectReference: NSObject, Comparable, NSCopying { let object = objects?.delete(reference: self) value = "TEMP_\(UUID().uuidString)" temporary = true - if let object = object { + if let object { objects?.add(object: object) } } @@ -130,7 +130,7 @@ class PBXObjectReference: NSObject, Comparable, NSCopying { if let object = object as? T { return object } - guard let objects = objects else { + guard let objects else { throw PBXObjectError.objectsReleased } guard let object = objects.get(reference: self) as? T else { @@ -143,7 +143,7 @@ class PBXObjectReference: NSObject, Comparable, NSCopying { extension Array where Element: PBXObject { func references() -> [PBXObjectReference] { - map { $0.reference } + map(\.reference) } } diff --git a/Sources/XcodeProj/Objects/Project/PBXObjects.swift b/Sources/XcodeProj/Objects/Project/PBXObjects.swift index 5f8a568f4..5fbf74e1a 100644 --- a/Sources/XcodeProj/Objects/Project/PBXObjects.swift +++ b/Sources/XcodeProj/Objects/Project/PBXObjects.swift @@ -142,8 +142,8 @@ class PBXObjects: Equatable { /// - Parameters: /// - objects: project objects init(objects: [PBXObject] = []) { - objects.forEach { - self.add(object: $0) + for item in objects { + add(object: item) } } @@ -194,7 +194,6 @@ class PBXObjects: Equatable { // subclasses of PBXGroup; must be tested before PBXGroup case let object as PBXVariantGroup: _variantGroups[objectReference] = object case let object as XCVersionGroup: _versionGroups[objectReference] = object - // everything else case let object as PBXBuildFile: _buildFiles[objectReference] = object case let object as PBXAggregateTarget: _aggregateTargets[objectReference] = object @@ -219,7 +218,6 @@ class PBXObjects: Equatable { case let object as XCRemoteSwiftPackageReference: _remoteSwiftPackageReferences[objectReference] = object case let object as XCLocalSwiftPackageReference: _localSwiftPackageReferences[objectReference] = object case let object as XCSwiftPackageProductDependency: _swiftPackageProductDependencies[objectReference] = object - default: fatalError("Unhandled PBXObject type for \(object), this is likely a bug / todo") } } diff --git a/Sources/XcodeProj/Objects/Project/PBXOutputSettings.swift b/Sources/XcodeProj/Objects/Project/PBXOutputSettings.swift index 77bf7b7ec..0d82fb228 100644 --- a/Sources/XcodeProj/Objects/Project/PBXOutputSettings.swift +++ b/Sources/XcodeProj/Objects/Project/PBXOutputSettings.swift @@ -39,12 +39,12 @@ public enum PBXFileOrder { /// Sort files by their file name. This is a case sensistive sort with lower case names coming after uppercase names. case byFilename - internal func sort(lhs: (PBXObjectReference, Object), rhs: (PBXObjectReference, Object)) -> Bool + func sort(lhs: (PBXObjectReference, Object), rhs: (PBXObjectReference, Object)) -> Bool where Object: PlistSerializable & Equatable { lhs.0 < rhs.0 } - internal func sort(lhs: (PBXObjectReference, PBXBuildFile), rhs: (PBXObjectReference, PBXBuildFile)) -> Bool { + func sort(lhs: (PBXObjectReference, PBXBuildFile), rhs: (PBXObjectReference, PBXBuildFile)) -> Bool { switch self { case .byFilename: return sortBuildFilesByName(lhs.1, rhs.1) @@ -53,7 +53,7 @@ public enum PBXFileOrder { } } - internal func sort(lhs: (PBXObjectReference, PBXBuildPhaseFile), rhs: (PBXObjectReference, PBXBuildPhaseFile)) -> Bool { + func sort(lhs: (PBXObjectReference, PBXBuildPhaseFile), rhs: (PBXObjectReference, PBXBuildPhaseFile)) -> Bool { switch self { case .byFilename: return sortBuildFilesByName(lhs.1.buildFile, rhs.1.buildFile) @@ -62,7 +62,7 @@ public enum PBXFileOrder { } } - internal func sort(lhs: (PBXObjectReference, PBXFileReference), rhs: (PBXObjectReference, PBXFileReference)) -> Bool { + func sort(lhs: (PBXObjectReference, PBXFileReference), rhs: (PBXObjectReference, PBXFileReference)) -> Bool { switch self { case .byFilename: return sortFileElementsByName(lhs.1, rhs.1) @@ -94,7 +94,7 @@ public enum PBXNavigatorFileOrder { /// Sorts the files by their file names with all groups appear at the top of the list. case byFilenameGroupsFirst - internal var sort: ((PBXFileElement, PBXFileElement) -> Bool)? { + var sort: ((PBXFileElement, PBXFileElement) -> Bool)? { switch self { case .byFilename: return { sortFileElementsByName($0, $1) } @@ -122,7 +122,7 @@ public enum PBXBuildPhaseFileOrder { /// Sort the files by their file name. This is a case sensitive sort with uppercase names appearing before lowercase names. case byFilename - internal var sort: ((PBXBuildFile, PBXBuildFile) -> Bool)? { + var sort: ((PBXBuildFile, PBXBuildFile) -> Bool)? { switch self { case .byFilename: return { lhs, rhs in diff --git a/Sources/XcodeProj/Objects/Project/PBXProj.swift b/Sources/XcodeProj/Objects/Project/PBXProj.swift index 6248aed4e..48a6ee367 100644 --- a/Sources/XcodeProj/Objects/Project/PBXProj.swift +++ b/Sources/XcodeProj/Objects/Project/PBXProj.swift @@ -66,7 +66,7 @@ public final class PBXProj: Decodable { objects: pbxproj.objects ) } - + /// Initializes the project with the data representation of pbxproj file. /// /// - Parameters: @@ -331,7 +331,7 @@ extension PBXProj: Writable { let encoder = PBXProjEncoder(outputSettings: PBXOutputSettings()) return try encoder.encode(proj: self).data(using: .utf8) } - + public func write(path: Path, override: Bool) throws { try write(path: path, override: override, outputSettings: PBXOutputSettings()) } diff --git a/Sources/XcodeProj/Objects/Project/PBXProjEncoder.swift b/Sources/XcodeProj/Objects/Project/PBXProjEncoder.swift index 771e38973..9b0dd2f26 100644 --- a/Sources/XcodeProj/Objects/Project/PBXProjEncoder.swift +++ b/Sources/XcodeProj/Objects/Project/PBXProjEncoder.swift @@ -238,7 +238,7 @@ final class PBXProjEncoder { rootObject.value, comment: "Project object" ) - ), stateHolder: &stateHolder, to: &output) + ), stateHolder: &stateHolder, to: &output) writeDictionaryEnd(stateHolder: &stateHolder, to: &output) writeNewLine(stateHolder: &stateHolder, to: &output) @@ -287,12 +287,12 @@ final class PBXProjEncoder { output.append("/* \(comment) */") } - private func write(section: String, - proj: PBXProj, - objects: [PBXObjectReference: T], - outputSettings: PBXOutputSettings, - stateHolder: inout StateHolder, - to output: inout [String]) throws where T: PlistSerializable & Equatable { + private func write(section: String, + proj: PBXProj, + objects: [PBXObjectReference: some PlistSerializable & Equatable], + outputSettings: PBXOutputSettings, + stateHolder: inout StateHolder, + to output: inout [String]) throws { try write(section: section, proj: proj, objects: objects, sort: outputSettings.projFileListOrder.sort, stateHolder: &stateHolder, to: &output) } @@ -367,7 +367,7 @@ final class PBXProjEncoder { stateHolder: inout StateHolder, to output: inout [String]) { writeDictionaryStart(stateHolder: &stateHolder, to: &output) - let sorted = dictionary.sorted(by: { (left, right) -> Bool in + let sorted = dictionary.sorted(by: { left, right -> Bool in if left.key == "isa" { return true } else if right.key == "isa" { @@ -376,9 +376,9 @@ final class PBXProjEncoder { return left.key.string < right.key.string } }) - sorted.forEach { - write(dictionaryKey: $0.key, - dictionaryValue: $0.value, + for item in sorted { + write(dictionaryKey: item.key, + dictionaryValue: item.value, multiline: stateHolder.multiline, stateHolder: &stateHolder, to: &output) diff --git a/Sources/XcodeProj/Objects/Project/PBXProject.swift b/Sources/XcodeProj/Objects/Project/PBXProject.swift index 9a2ccd661..79a3e1485 100644 --- a/Sources/XcodeProj/Objects/Project/PBXProject.swift +++ b/Sources/XcodeProj/Objects/Project/PBXProject.swift @@ -111,14 +111,14 @@ public final class PBXProject: PBXObject { public var targetAttributes: [PBXTarget: [String: Any]] { set { targetAttributeReferences = [:] - newValue.forEach { - targetAttributeReferences[$0.key.reference] = $0.value + for item in newValue { + targetAttributeReferences[item.key.reference] = item.value } } get { var attributes: [PBXTarget: [String: Any]] = [:] - targetAttributeReferences.forEach { - if let object: PBXTarget = $0.key.getObject() { - attributes[object] = $0.value + for targetAttributeReference in targetAttributeReferences { + if let object: PBXTarget = targetAttributeReference.key.getObject() { + attributes[object] = targetAttributeReference.value } } return attributes @@ -205,7 +205,7 @@ public final class PBXProject: PBXObject { productName: String, versionRequirement: XCRemoteSwiftPackageReference.VersionRequirement, targetName: String) throws -> XCRemoteSwiftPackageReference { - let objects = try self.objects() + let objects = try objects() guard let target = targets.first(where: { $0.name == targetName }) else { throw PBXProjError.targetNotFound(targetName: targetName) } @@ -243,7 +243,7 @@ public final class PBXProject: PBXObject { addFileReference: Bool = true) throws -> XCSwiftPackageProductDependency { guard path.isRelative else { throw PBXProjError.pathIsAbsolute(path) } - let objects = try self.objects() + let objects = try objects() guard let target = targets.first(where: { $0.name == targetName }) else { throw PBXProjError.targetNotFound(targetName: targetName) } @@ -356,14 +356,14 @@ public final class PBXProject: PBXObject { let container = try decoder.container(keyedBy: CodingKeys.self) let referenceRepository = decoder.context.objectReferenceRepository let objects = decoder.context.objects - name = (try container.decodeIfPresent(.name)) ?? "" + name = try (container.decodeIfPresent(.name)) ?? "" let buildConfigurationListReference: String = try container.decode(.buildConfigurationList) self.buildConfigurationListReference = referenceRepository.getOrCreate(reference: buildConfigurationListReference, objects: objects) compatibilityVersion = try container.decode(.compatibilityVersion) developmentRegion = try container.decodeIfPresent(.developmentRegion) let hasScannedForEncodingsString: String? = try container.decodeIfPresent(.hasScannedForEncodings) hasScannedForEncodings = hasScannedForEncodingsString.flatMap { Int($0) } ?? 0 - knownRegions = (try container.decodeIfPresent(.knownRegions)) ?? [] + knownRegions = try (container.decodeIfPresent(.knownRegions)) ?? [] let mainGroupReference: String = try container.decode(.mainGroup) self.mainGroupReference = referenceRepository.getOrCreate(reference: mainGroupReference, objects: objects) if let productRefGroupReference: String = try container.decodeIfPresent(.productRefGroup) { @@ -372,7 +372,7 @@ public final class PBXProject: PBXObject { productsGroupReference = nil } projectDirPath = try container.decodeIfPresent(.projectDirPath) ?? "" - let projectReferences: [[String: String]] = (try container.decodeIfPresent(.projectReferences)) ?? [] + let projectReferences: [[String: String]] = try (container.decodeIfPresent(.projectReferences)) ?? [] self.projectReferences = projectReferences.map { references in references.mapValues { referenceRepository.getOrCreate(reference: $0, objects: objects) } } @@ -383,13 +383,13 @@ public final class PBXProject: PBXObject { } else { projectRoots = [] } - let targetReferences: [String] = (try container.decodeIfPresent(.targets)) ?? [] + let targetReferences: [String] = try (container.decodeIfPresent(.targets)) ?? [] self.targetReferences = targetReferences.map { referenceRepository.getOrCreate(reference: $0, objects: objects) } let packageRefeferenceStrings: [String] = try container.decodeIfPresent(.packageReferences) ?? [] packageReferences = packageRefeferenceStrings.map { referenceRepository.getOrCreate(reference: $0, objects: objects) } - var attributes = (try container.decodeIfPresent([String: Any].self, forKey: .attributes) ?? [:]) + var attributes = try (container.decodeIfPresent([String: Any].self, forKey: .attributes) ?? [:]) var targetAttributeReferences: [PBXObjectReference: [String: Any]] = [:] if let targetAttributes = attributes[PBXProject.targetAttributesKey] as? [String: [String: Any]] { targetAttributes.forEach { targetAttributeReferences[referenceRepository.getOrCreate(reference: $0.key, objects: objects)] = $0.value } @@ -433,7 +433,7 @@ extension PBXProject { private func addSwiftPackageProduct(reference: XCRemoteSwiftPackageReference, productName: String, target: PBXTarget) throws -> XCSwiftPackageProductDependency { - let objects = try self.objects() + let objects = try objects() let productDependency: XCSwiftPackageProductDependency // Avoid duplication @@ -452,7 +452,7 @@ extension PBXProject { private func addLocalSwiftPackageProduct(path: Path, productName: String, target: PBXTarget) throws -> XCSwiftPackageProductDependency { - let objects = try self.objects() + let objects = try objects() let productDependency: XCSwiftPackageProductDependency // Avoid duplication @@ -483,7 +483,7 @@ extension PBXProject: PlistSerializable { comment: buildConfigurationListComment) dictionary["buildConfigurationList"] = .string(buildConfigurationListCommentedString) dictionary["compatibilityVersion"] = .string(CommentedString(compatibilityVersion)) - if let developmentRegion = developmentRegion { + if let developmentRegion { dictionary["developmentRegion"] = .string(CommentedString(developmentRegion)) } dictionary["hasScannedForEncodings"] = .string(CommentedString("\(hasScannedForEncodings)")) @@ -494,7 +494,7 @@ extension PBXProject: PlistSerializable { } let mainGroupObject: PBXGroup? = mainGroupReference.getObject() dictionary["mainGroup"] = .string(CommentedString(mainGroupReference.value, comment: mainGroupObject?.fileName())) - if let productsGroupReference = productsGroupReference { + if let productsGroupReference { let productRefGroupObject: PBXGroup? = productsGroupReference.getObject() dictionary["productRefGroup"] = .string(CommentedString(productsGroupReference.value, comment: productRefGroupObject?.fileName())) @@ -550,7 +550,8 @@ extension PBXProject: PlistSerializable { } return .array(projectReferences.compactMap { reference in guard let productGroupReference = reference[Xcode.ProjectReference.productGroupKey], - let projectRef = reference[Xcode.ProjectReference.projectReferenceKey] else { + let projectRef = reference[Xcode.ProjectReference.projectReferenceKey] + else { return nil } let producGroup: PBXGroup? = productGroupReference.getObject() diff --git a/Sources/XcodeProj/Objects/Sourcery/Equality.generated.swift b/Sources/XcodeProj/Objects/Sourcery/Equality.generated.swift index 5d2a1943f..c20d93c20 100644 --- a/Sources/XcodeProj/Objects/Sourcery/Equality.generated.swift +++ b/Sources/XcodeProj/Objects/Sourcery/Equality.generated.swift @@ -6,7 +6,7 @@ import Foundation extension PBXAggregateTarget { /// :nodoc: func isEqual(to rhs: PBXAggregateTarget) -> Bool { - return super.isEqual(to: rhs) + super.isEqual(to: rhs) } } @@ -113,7 +113,7 @@ extension PBXFileReference { extension PBXFrameworksBuildPhase { /// :nodoc: func isEqual(to rhs: PBXFrameworksBuildPhase) -> Bool { - return super.isEqual(to: rhs) + super.isEqual(to: rhs) } } @@ -128,7 +128,7 @@ extension PBXGroup { extension PBXHeadersBuildPhase { /// :nodoc: func isEqual(to rhs: PBXHeadersBuildPhase) -> Bool { - return super.isEqual(to: rhs) + super.isEqual(to: rhs) } } @@ -187,14 +187,14 @@ extension PBXReferenceProxy { extension PBXResourcesBuildPhase { /// :nodoc: func isEqual(to rhs: PBXResourcesBuildPhase) -> Bool { - return super.isEqual(to: rhs) + super.isEqual(to: rhs) } } extension PBXRezBuildPhase { /// :nodoc: func isEqual(to rhs: PBXRezBuildPhase) -> Bool { - return super.isEqual(to: rhs) + super.isEqual(to: rhs) } } @@ -216,7 +216,7 @@ extension PBXShellScriptBuildPhase { extension PBXSourcesBuildPhase { /// :nodoc: func isEqual(to rhs: PBXSourcesBuildPhase) -> Bool { - return super.isEqual(to: rhs) + super.isEqual(to: rhs) } } @@ -251,7 +251,7 @@ extension PBXTargetDependency { extension PBXVariantGroup { /// :nodoc: func isEqual(to rhs: PBXVariantGroup) -> Bool { - return super.isEqual(to: rhs) + super.isEqual(to: rhs) } } diff --git a/Sources/XcodeProj/Objects/SwiftPackage/XCRemoteSwiftPackageReference.swift b/Sources/XcodeProj/Objects/SwiftPackage/XCRemoteSwiftPackageReference.swift index 78b4a86f3..3f8a40001 100644 --- a/Sources/XcodeProj/Objects/SwiftPackage/XCRemoteSwiftPackageReference.swift +++ b/Sources/XcodeProj/Objects/SwiftPackage/XCRemoteSwiftPackageReference.swift @@ -131,10 +131,10 @@ public class XCRemoteSwiftPackageReference: PBXContainerItem, PlistSerializable func plistKeyAndValue(proj: PBXProj, reference: String) throws -> (key: CommentedString, value: PlistValue) { var dictionary = try super.plistValues(proj: proj, reference: reference) dictionary["isa"] = .string(CommentedString(XCRemoteSwiftPackageReference.isa)) - if let repositoryURL = repositoryURL { + if let repositoryURL { dictionary["repositoryURL"] = .string(.init(repositoryURL)) } - if let versionRequirement = versionRequirement { + if let versionRequirement { dictionary["requirement"] = PlistValue.dictionary(versionRequirement.plistValues()) } return (key: CommentedString(reference, comment: "XCRemoteSwiftPackageReference \"\(name ?? "")\""), diff --git a/Sources/XcodeProj/Objects/SwiftPackage/XCSwiftPackageProductDependency.swift b/Sources/XcodeProj/Objects/SwiftPackage/XCSwiftPackageProductDependency.swift index 238e31f9a..cb0abc3d9 100644 --- a/Sources/XcodeProj/Objects/SwiftPackage/XCSwiftPackageProductDependency.swift +++ b/Sources/XcodeProj/Objects/SwiftPackage/XCSwiftPackageProductDependency.swift @@ -57,7 +57,7 @@ public class XCSwiftPackageProductDependency: PBXContainerItem, PlistSerializabl func plistKeyAndValue(proj: PBXProj, reference: String) throws -> (key: CommentedString, value: PlistValue) { var dictionary = try super.plistValues(proj: proj, reference: reference) dictionary["isa"] = .string(CommentedString(XCSwiftPackageProductDependency.isa)) - if let package = package { + if let package { dictionary["package"] = .string(.init(package.reference.value, comment: "XCRemoteSwiftPackageReference \"\(package.name ?? "")\"")) } if isPlugin { diff --git a/Sources/XcodeProj/Objects/Targets/PBXAggregateTarget.swift b/Sources/XcodeProj/Objects/Targets/PBXAggregateTarget.swift index ec87371fe..9bfd5674c 100644 --- a/Sources/XcodeProj/Objects/Targets/PBXAggregateTarget.swift +++ b/Sources/XcodeProj/Objects/Targets/PBXAggregateTarget.swift @@ -12,7 +12,7 @@ public final class PBXAggregateTarget: PBXTarget { extension PBXAggregateTarget: PlistSerializable { func plistKeyAndValue(proj: PBXProj, reference: String) throws -> (key: CommentedString, value: PlistValue) { - return try plistValues(proj: proj, isa: PBXAggregateTarget.isa, reference: reference) + try plistValues(proj: proj, isa: PBXAggregateTarget.isa, reference: reference) } } diff --git a/Sources/XcodeProj/Objects/Targets/PBXLegacyTarget.swift b/Sources/XcodeProj/Objects/Targets/PBXLegacyTarget.swift index 1b858e8ca..6d9a5e566 100644 --- a/Sources/XcodeProj/Objects/Targets/PBXLegacyTarget.swift +++ b/Sources/XcodeProj/Objects/Targets/PBXLegacyTarget.swift @@ -79,16 +79,16 @@ public final class PBXLegacyTarget: PBXTarget { switch value { case let .dictionary(dictValue): dict = dictValue - if let buildToolPath = buildToolPath { + if let buildToolPath { dict["buildToolPath"] = PlistValue.string(CommentedString(buildToolPath)) } - if let buildArgumentsString = buildArgumentsString { + if let buildArgumentsString { dict["buildArgumentsString"] = PlistValue.string(CommentedString(buildArgumentsString)) } dict["passBuildSettingsInEnvironment"] = PlistValue.string(CommentedString(passBuildSettingsInEnvironment.int.description)) - if let buildWorkingDirectory = buildWorkingDirectory { + if let buildWorkingDirectory { dict["buildWorkingDirectory"] = PlistValue.string(CommentedString(buildWorkingDirectory)) } @@ -108,6 +108,6 @@ public final class PBXLegacyTarget: PBXTarget { extension PBXLegacyTarget: PlistSerializable { func plistKeyAndValue(proj: PBXProj, reference: String) throws -> (key: CommentedString, value: PlistValue) { - return try plistValues(proj: proj, isa: PBXLegacyTarget.isa, reference: reference) + try plistValues(proj: proj, isa: PBXLegacyTarget.isa, reference: reference) } } diff --git a/Sources/XcodeProj/Objects/Targets/PBXNativeTarget.swift b/Sources/XcodeProj/Objects/Targets/PBXNativeTarget.swift index 45c4bbcb3..c3705422e 100644 --- a/Sources/XcodeProj/Objects/Targets/PBXNativeTarget.swift +++ b/Sources/XcodeProj/Objects/Targets/PBXNativeTarget.swift @@ -54,7 +54,7 @@ public final class PBXNativeTarget: PBXTarget { guard case var PlistValue.dictionary(dict) = value else { throw XcodeprojWritingError.invalidType(class: String(describing: type(of: self)), expected: "Dictionary") } - if let productInstallPath = productInstallPath { + if let productInstallPath { dict["productInstallPath"] = .string(CommentedString(productInstallPath)) } return (key: key, value: .dictionary(dict)) @@ -70,7 +70,7 @@ public final class PBXNativeTarget: PBXTarget { extension PBXNativeTarget: PlistSerializable { func plistKeyAndValue(proj: PBXProj, reference: String) throws -> (key: CommentedString, value: PlistValue) { - return try plistValues(proj: proj, isa: PBXNativeTarget.isa, reference: reference) + try plistValues(proj: proj, isa: PBXNativeTarget.isa, reference: reference) } } diff --git a/Sources/XcodeProj/Objects/Targets/PBXProductType.swift b/Sources/XcodeProj/Objects/Targets/PBXProductType.swift index 21dbf8b78..785d1ec1c 100644 --- a/Sources/XcodeProj/Objects/Targets/PBXProductType.swift +++ b/Sources/XcodeProj/Objects/Targets/PBXProductType.swift @@ -49,7 +49,7 @@ public enum PBXProductType: String, Decodable { case .unitTestBundle, .uiTestBundle: return "xctest" case .appExtension, .extensionKitExtension, .tvExtension, .watchExtension, .watch2Extension, .messagesExtension, .stickerPack, .xcodeExtension, - .intentsServiceExtension: + .intentsServiceExtension: return "appex" case .commandLineTool: return nil diff --git a/Sources/XcodeProj/Objects/Targets/PBXReferenceProxy.swift b/Sources/XcodeProj/Objects/Targets/PBXReferenceProxy.swift index 67363c585..9c34421ed 100644 --- a/Sources/XcodeProj/Objects/Targets/PBXReferenceProxy.swift +++ b/Sources/XcodeProj/Objects/Targets/PBXReferenceProxy.swift @@ -64,10 +64,10 @@ public final class PBXReferenceProxy: PBXFileElement { fatalError("super implementation changed and we didn’t realise!") } dictionary["isa"] = .string(CommentedString(PBXReferenceProxy.isa)) - if let fileType = fileType { + if let fileType { dictionary["fileType"] = .string(CommentedString(fileType)) } - if let remoteReference = remoteReference { + if let remoteReference { dictionary["remoteRef"] = .string(CommentedString(remoteReference.value, comment: "PBXContainerItemProxy")) } return (key: CommentedString(reference, comment: path), diff --git a/Sources/XcodeProj/Objects/Targets/PBXTarget.swift b/Sources/XcodeProj/Objects/Targets/PBXTarget.swift index 07d255493..86646cfd8 100644 --- a/Sources/XcodeProj/Objects/Targets/PBXTarget.swift +++ b/Sources/XcodeProj/Objects/Targets/PBXTarget.swift @@ -174,7 +174,7 @@ public class PBXTarget: PBXContainerItem { var dictionary = try super.plistValues(proj: proj, reference: reference) dictionary["isa"] = .string(CommentedString(isa)) let buildConfigurationListComment = "Build configuration list for \(isa) \"\(name)\"" - if let buildConfigurationListReference = buildConfigurationListReference { + if let buildConfigurationListReference { dictionary["buildConfigurationList"] = .string(CommentedString(buildConfigurationListReference.value, comment: buildConfigurationListComment)) } @@ -191,13 +191,13 @@ public class PBXTarget: PBXContainerItem { dictionary["dependencies"] = .array(dependencyReferences.map { .string(CommentedString($0.value, comment: PBXTargetDependency.isa)) }) dictionary["name"] = .string(CommentedString(name)) - if let productName = productName { + if let productName { dictionary["productName"] = .string(CommentedString(productName)) } - if let productType = productType { + if let productType { dictionary["productType"] = .string(CommentedString(productType.rawValue)) } - if let productReference = productReference { + if let productReference { let fileElement: PBXFileElement? = productReference.getObject() dictionary["productReference"] = .string(CommentedString(productReference.value, comment: fileElement?.fileName())) } @@ -225,7 +225,7 @@ public extension PBXTarget { /// /// - Returns: product name with extension. func productNameWithExtension() -> String? { - guard let productName = self.productName else { return nil } + guard let productName else { return nil } guard let fileExtension = productType?.fileExtension else { return nil } return "\(productName).\(fileExtension)" } diff --git a/Sources/XcodeProj/Objects/Targets/PBXTargetDependency.swift b/Sources/XcodeProj/Objects/Targets/PBXTargetDependency.swift index 22603e5b3..6da6ba0aa 100644 --- a/Sources/XcodeProj/Objects/Targets/PBXTargetDependency.swift +++ b/Sources/XcodeProj/Objects/Targets/PBXTargetDependency.swift @@ -120,23 +120,23 @@ extension PBXTargetDependency: PlistSerializable { func plistKeyAndValue(proj _: PBXProj, reference: String) throws -> (key: CommentedString, value: PlistValue) { var dictionary: [CommentedString: PlistValue] = [:] dictionary["isa"] = .string(CommentedString(PBXTargetDependency.isa)) - if let name = name { + if let name { dictionary["name"] = .string(CommentedString(name)) } - if let platformFilter = platformFilter { + if let platformFilter { dictionary["platformFilter"] = .string(CommentedString(platformFilter)) } - if let platformFilters = platformFilters { + if let platformFilters { dictionary["platformFilters"] = .array(platformFilters.map { .string(.init($0)) }) } - if let targetReference = targetReference { + if let targetReference { let targetObject: PBXTarget? = targetReference.getObject() dictionary["target"] = .string(CommentedString(targetReference.value, comment: targetObject?.name)) } - if let targetProxyReference = targetProxyReference { + if let targetProxyReference { dictionary["targetProxy"] = .string(CommentedString(targetProxyReference.value, comment: "PBXContainerItemProxy")) } - if let productReference = productReference { + if let productReference { dictionary["productRef"] = .string(CommentedString(productReference.value, comment: product?.productName)) } return (key: CommentedString(reference, diff --git a/Sources/XcodeProj/Project/WorkspaceSettings.swift b/Sources/XcodeProj/Project/WorkspaceSettings.swift index 343090fb9..25eee3029 100644 --- a/Sources/XcodeProj/Project/WorkspaceSettings.swift +++ b/Sources/XcodeProj/Project/WorkspaceSettings.swift @@ -59,8 +59,7 @@ public class WorkspaceSettings: Codable, Equatable, Writable { public init(buildSystem: BuildSystem = .new, derivedDataLocationStyle: DerivedDataLocationStyle? = nil, derivedDataCustomLocation: String? = nil, - autoCreateSchemes: Bool? = nil) - { + autoCreateSchemes: Bool? = nil) { self.buildSystem = buildSystem self.derivedDataLocationStyle = derivedDataLocationStyle self.derivedDataCustomLocation = derivedDataCustomLocation @@ -74,15 +73,13 @@ public class WorkspaceSettings: Codable, Equatable, Writable { public required init(from decoder: Decoder) throws { let container = try decoder.container(keyedBy: CodingKeys.self) if let buildSystemString: String = try container.decodeIfPresent(.buildSystem), - let buildSystem = BuildSystem(rawValue: buildSystemString) - { + let buildSystem = BuildSystem(rawValue: buildSystemString) { self.buildSystem = buildSystem } else { buildSystem = .new } if let derivedDataLocationStyleString: String = try container.decodeIfPresent(.derivedDataLocationStyle), - let derivedDataLocationStyle = DerivedDataLocationStyle(rawValue: derivedDataLocationStyleString) - { + let derivedDataLocationStyle = DerivedDataLocationStyle(rawValue: derivedDataLocationStyleString) { self.derivedDataLocationStyle = derivedDataLocationStyle } else { derivedDataLocationStyle = .default @@ -100,13 +97,13 @@ public class WorkspaceSettings: Codable, Equatable, Writable { if buildSystem == .original { try container.encode(buildSystem.rawValue, forKey: .buildSystem) } - if let derivedDataLocationStyle = derivedDataLocationStyle { + if let derivedDataLocationStyle { try container.encode(derivedDataLocationStyle.rawValue, forKey: .derivedDataLocationStyle) } - if let derivedDataCustomLocation = derivedDataCustomLocation { + if let derivedDataCustomLocation { try container.encode(derivedDataCustomLocation, forKey: .derivedDataCustomLocation) } - if let autoCreateSchemes = autoCreateSchemes { + if let autoCreateSchemes { try container.encode(autoCreateSchemes, forKey: .autoCreateSchemes) } } @@ -152,7 +149,7 @@ public class WorkspaceSettings: Codable, Equatable, Writable { } try path.write(data) } - + /// Get the workspace settings. /// /// - Throws: reading error if something goes wrong. diff --git a/Sources/XcodeProj/Project/XCBreakpointList.swift b/Sources/XcodeProj/Project/XCBreakpointList.swift index 361ce3e9f..d253b5336 100644 --- a/Sources/XcodeProj/Project/XCBreakpointList.swift +++ b/Sources/XcodeProj/Project/XCBreakpointList.swift @@ -70,7 +70,7 @@ public final class XCBreakpointList: Equatable, Writable { attributes["conveyanceType"] = conveyanceType attributes["command"] = command attributes["arguments"] = arguments - if let waitUntilDone = waitUntilDone { + if let waitUntilDone { attributes["waitUntilDone"] = waitUntilDone ? "YES" : "NO" } attributes["script"] = script @@ -123,7 +123,8 @@ public final class XCBreakpointList: Equatable, Writable { init(element: AEXMLElement) throws { guard let actionExtensionIDString = element.attributes["ActionExtensionID"], - let actionExtensionID = ActionExtensionID(rawValue: actionExtensionIDString) else { + let actionExtensionID = ActionExtensionID(rawValue: actionExtensionIDString) + else { throw XCBreakpointListError.missing(property: "ActionExtensionID") } self.actionExtensionID = actionExtensionID @@ -334,7 +335,8 @@ public final class XCBreakpointList: Equatable, Writable { init(element: AEXMLElement) throws { guard let breakpointExtensionIDString = element.attributes["BreakpointExtensionID"], - let breakpointExtensionID = BreakpointExtensionID(rawValue: breakpointExtensionIDString) else { + let breakpointExtensionID = BreakpointExtensionID(rawValue: breakpointExtensionIDString) + else { throw XCBreakpointListError.missing(property: "BreakpointExtensionID") } self.breakpointExtensionID = breakpointExtensionID @@ -375,7 +377,7 @@ public final class XCBreakpointList: Equatable, Writable { if !path.exists { throw XCBreakpointListError.notFound(path: path) } - let document = try AEXMLDocument(xml: try path.read()) + let document = try AEXMLDocument(xml: path.read()) let bucket = document["Bucket"] type = bucket.attributes["type"] version = bucket.attributes["version"] @@ -395,7 +397,7 @@ public final class XCBreakpointList: Equatable, Writable { // MARK: - Helpers public func add(breakpointProxy: BreakpointProxy) -> XCBreakpointList { - var breakpoints = self.breakpoints + var breakpoints = breakpoints breakpoints.append(breakpointProxy) return XCBreakpointList(type: type, version: version, breakpoints: breakpoints) } @@ -404,7 +406,7 @@ public final class XCBreakpointList: Equatable, Writable { public func write(path: Path, override: Bool) throws { let document = getAEXMLDocument() - + if override, path.exists { try path.delete() } @@ -437,12 +439,12 @@ public final class XCBreakpointList: Equatable, Writable { } } -extension XCBreakpointList { +public extension XCBreakpointList { /// Returns breakpoints plist path relative to the given path. /// /// - Parameter path: debugger folder /// - Returns: breakpoints plist path relative to the given path. - public static func path(_ path: Path) -> Path { + static func path(_ path: Path) -> Path { path + "Breakpoints_v2.xcbkptlist" } } diff --git a/Sources/XcodeProj/Project/XCSharedData.swift b/Sources/XcodeProj/Project/XCSharedData.swift index 9469970c9..312a3913c 100644 --- a/Sources/XcodeProj/Project/XCSharedData.swift +++ b/Sources/XcodeProj/Project/XCSharedData.swift @@ -87,12 +87,12 @@ public final class XCSharedData: Equatable, Writable { try debuggerPath.delete() } - guard let breakpoints = breakpoints else { return } + guard let breakpoints else { return } try debuggerPath.mkpath() try breakpoints.write(path: XCBreakpointList.path(debuggerPath), override: override) } - + func writeWorkspaceSettings(path: Path, override: Bool) throws { /** * We don't want to delete this path when `override` is `true` because @@ -103,17 +103,17 @@ public final class XCSharedData: Equatable, Writable { if !path.exists { try path.mkpath() } - + try workspaceSettings?.write(path: WorkspaceSettings.path(path), override: override) } } -extension XCSharedData { +public extension XCSharedData { /// Returns shared data path relative to the given path. /// /// - Parameter path: `.xcodeproj` file path /// - Returns: shared data path relative to the given path. - public static func path(_ path: Path) -> Path { + static func path(_ path: Path) -> Path { path + "xcshareddata" } } diff --git a/Sources/XcodeProj/Project/XCUserData.swift b/Sources/XcodeProj/Project/XCUserData.swift index 1d3bf328d..272152b54 100644 --- a/Sources/XcodeProj/Project/XCUserData.swift +++ b/Sources/XcodeProj/Project/XCUserData.swift @@ -1,6 +1,6 @@ +import AEXML import Foundation import PathKit -import AEXML public final class XCUserData: Equatable, Writable { // MARK: - Attributes @@ -82,7 +82,7 @@ public final class XCUserData: Equatable, Writable { } func writeSchemeManagement(path: Path, override: Bool) throws { - guard let schemeManagement = schemeManagement else { return } + guard let schemeManagement else { return } let schemesPath = XCScheme.schemesPath(path) try schemesPath.mkpath() @@ -90,7 +90,7 @@ public final class XCUserData: Equatable, Writable { } func writeBreakpoints(path: Path, override: Bool) throws { - guard let breakpoints = breakpoints else { return } + guard let breakpoints else { return } let debuggerPath = XCDebugger.path(path) try debuggerPath.mkpath() @@ -98,12 +98,12 @@ public final class XCUserData: Equatable, Writable { } } -extension XCUserData { +public extension XCUserData { /// Returns user data path relative to the given path. /// /// - Parameter path: `.xcodeproj` file path /// - Returns: user data path relative to the given path. - public static func path(_ path: Path) -> Path { + static func path(_ path: Path) -> Path { path + "xcuserdata" } @@ -111,7 +111,7 @@ extension XCUserData { /// /// - Parameter path: `.xcodeproj` file path /// - Returns: user data path relative to the given path. - public static func path(_ path: Path, userName: String) -> Path { + static func path(_ path: Path, userName: String) -> Path { XCUserData.path(path) + "\(userName).xcuserdatad" } } diff --git a/Sources/XcodeProj/Project/Xcode.swift b/Sources/XcodeProj/Project/Xcode.swift index 5b2b17477..907fc5a00 100644 --- a/Sources/XcodeProj/Project/Xcode.swift +++ b/Sources/XcodeProj/Project/Xcode.swift @@ -1,11 +1,11 @@ import Foundation /// Class that contains Xcode constants. -public struct Xcode { +public enum Xcode { /// Last known constants. - public struct LastKnown { + public enum LastKnown { /// Last known SDKs. - public struct SDK { + public enum SDK { /// Last known SDK for iOS. public static let ios: String = "14.0" @@ -36,7 +36,7 @@ public struct Xcode { } /// Default values. - public struct Default { + public enum Default { /// The default object version for Xcodeproj. public static let objectVersion: UInt = 46 @@ -45,13 +45,13 @@ public struct Xcode { /// Default development region. public static let developmentRegion: String = "en" - + /// Default XCScheme format version public static let xcschemeFormatVersion: String = "1.3" - + /// The last Swift upgrade check version public static let lastSwiftUpgradeCheck: String = "1300" - + /// The last known Xcode upgrade check version. public static let lastUpgradeCheck: String = "1300" } @@ -63,7 +63,7 @@ public struct Xcode { public static let headersExtensions = [".h", ".hh", ".hpp", ".ipp", ".tpp", ".hxx", ".def", ".inl", ".inc", ".pch"] /// Supported values. - public struct Supported { + public enum Supported { /// The version of `.xcscheme` files supported by Xcodeproj public static let xcschemeFormatVersion = "1.3" } @@ -350,7 +350,7 @@ public struct Xcode { ] /// Remote project reference dictionary keys. - public struct ProjectReference { + public enum ProjectReference { public static let projectReferenceKey = "ProjectRef" public static let productGroupKey = "ProductGroup" } diff --git a/Sources/XcodeProj/Protocols/Writable.swift b/Sources/XcodeProj/Protocols/Writable.swift index b21456756..f4a7016d3 100644 --- a/Sources/XcodeProj/Protocols/Writable.swift +++ b/Sources/XcodeProj/Protocols/Writable.swift @@ -23,11 +23,11 @@ public protocol Writable { func dataRepresentation() throws -> Data? } -extension Writable { - public func write(pathString: String, override: Bool) throws { +public extension Writable { + func write(pathString: String, override: Bool) throws { let path = Path(pathString) try write(path: path, override: override) } - public func dataRepresentation() throws -> Data? { nil } + func dataRepresentation() throws -> Data? { nil } } diff --git a/Sources/XcodeProj/Scheme/XCScheme+AditionalOption.swift b/Sources/XcodeProj/Scheme/XCScheme+AditionalOption.swift index 5e643047a..3f4122099 100644 --- a/Sources/XcodeProj/Scheme/XCScheme+AditionalOption.swift +++ b/Sources/XcodeProj/Scheme/XCScheme+AditionalOption.swift @@ -2,8 +2,8 @@ import AEXML import Foundation import PathKit -extension XCScheme { - public final class AdditionalOption: Equatable { +public extension XCScheme { + final class AdditionalOption: Equatable { // MARK: - Attributes public var key: String diff --git a/Sources/XcodeProj/Scheme/XCScheme+AnalyzeAction.swift b/Sources/XcodeProj/Scheme/XCScheme+AnalyzeAction.swift index 2a295e7e3..6dd25fb99 100644 --- a/Sources/XcodeProj/Scheme/XCScheme+AnalyzeAction.swift +++ b/Sources/XcodeProj/Scheme/XCScheme+AnalyzeAction.swift @@ -2,8 +2,8 @@ import AEXML import Foundation import PathKit -extension XCScheme { - public final class AnalyzeAction: Equatable { +public extension XCScheme { + final class AnalyzeAction: Equatable { // MARK: - Static // Xcode disables PreActions and PostActions for Analyze actions, so this Action diff --git a/Sources/XcodeProj/Scheme/XCScheme+ArchiveAction.swift b/Sources/XcodeProj/Scheme/XCScheme+ArchiveAction.swift index 92ddab9c6..73cbae330 100644 --- a/Sources/XcodeProj/Scheme/XCScheme+ArchiveAction.swift +++ b/Sources/XcodeProj/Scheme/XCScheme+ArchiveAction.swift @@ -2,8 +2,8 @@ import AEXML import Foundation import PathKit -extension XCScheme { - public final class ArchiveAction: SerialAction { +public extension XCScheme { + final class ArchiveAction: SerialAction { // MARK: - Static private static let defaultBuildConfiguration = "Release" diff --git a/Sources/XcodeProj/Scheme/XCScheme+BuildAction.swift b/Sources/XcodeProj/Scheme/XCScheme+BuildAction.swift index f6e81bfd4..8cc9ed15a 100644 --- a/Sources/XcodeProj/Scheme/XCScheme+BuildAction.swift +++ b/Sources/XcodeProj/Scheme/XCScheme+BuildAction.swift @@ -2,8 +2,8 @@ import AEXML import Foundation import PathKit -extension XCScheme { - public final class BuildAction: SerialAction { +public extension XCScheme { + final class BuildAction: SerialAction { public final class Entry: Equatable { public enum BuildFor: Sendable { case running, testing, profiling, archiving, analyzing @@ -140,7 +140,7 @@ extension XCScheme { // MARK: - Helpers public func add(buildActionEntry: Entry) -> BuildAction { - var buildActionEntries = self.buildActionEntries + var buildActionEntries = buildActionEntries buildActionEntries.append(buildActionEntry) return BuildAction(buildActionEntries: buildActionEntries, parallelizeBuild: parallelizeBuild) @@ -158,7 +158,7 @@ extension XCScheme { attributes["buildArchitectures"] = buildArchitecturesXMLString } - if let runPostActionsOnFailure = runPostActionsOnFailure { + if let runPostActionsOnFailure { attributes["runPostActionsOnFailure"] = runPostActionsOnFailure.xmlString } @@ -167,7 +167,7 @@ extension XCScheme { attributes: attributes) super.writeXML(parent: element) let entries = element.addChild(name: "BuildActionEntries") - buildActionEntries.forEach { entry in + for entry in buildActionEntries { entries.addChild(entry.xmlElement()) } return element diff --git a/Sources/XcodeProj/Scheme/XCScheme+BuildableProductRunnable.swift b/Sources/XcodeProj/Scheme/XCScheme+BuildableProductRunnable.swift index 2dffa070b..e590e8f37 100644 --- a/Sources/XcodeProj/Scheme/XCScheme+BuildableProductRunnable.swift +++ b/Sources/XcodeProj/Scheme/XCScheme+BuildableProductRunnable.swift @@ -1,8 +1,8 @@ import AEXML import Foundation -extension XCScheme { - public final class BuildableProductRunnable: Runnable { +public extension XCScheme { + final class BuildableProductRunnable: Runnable { // MARK: - XML override func xmlElement() -> AEXMLElement { diff --git a/Sources/XcodeProj/Scheme/XCScheme+BuildableReference.swift b/Sources/XcodeProj/Scheme/XCScheme+BuildableReference.swift index f35011ed7..5ded8df2f 100644 --- a/Sources/XcodeProj/Scheme/XCScheme+BuildableReference.swift +++ b/Sources/XcodeProj/Scheme/XCScheme+BuildableReference.swift @@ -1,8 +1,8 @@ import AEXML import Foundation -extension XCScheme { - public final class BuildableReference: Equatable, Hashable { +public extension XCScheme { + final class BuildableReference: Equatable, Hashable { // MARK: - Attributes public var referencedContainer: String @@ -52,7 +52,7 @@ extension XCScheme { blueprintName: String, buildableIdentifier: String = "primary") { self.referencedContainer = referencedContainer - self.blueprint = blueprintIdentifier.map(Blueprint.string) + blueprint = blueprintIdentifier.map(Blueprint.string) self.buildableName = buildableName self.buildableIdentifier = buildableIdentifier self.blueprintName = blueprintName @@ -75,7 +75,7 @@ extension XCScheme { } self.buildableIdentifier = buildableIdentifier let blueprintIdentifier = element.attributes["BlueprintIdentifier"] - self.blueprint = blueprintIdentifier.map(Blueprint.string) + blueprint = blueprintIdentifier.map(Blueprint.string) self.buildableName = buildableName self.blueprintName = blueprintName self.referencedContainer = referencedContainer diff --git a/Sources/XcodeProj/Scheme/XCScheme+CommandLineArguments.swift b/Sources/XcodeProj/Scheme/XCScheme+CommandLineArguments.swift index 80330a24a..862299b33 100644 --- a/Sources/XcodeProj/Scheme/XCScheme+CommandLineArguments.swift +++ b/Sources/XcodeProj/Scheme/XCScheme+CommandLineArguments.swift @@ -1,8 +1,8 @@ import AEXML import Foundation -extension XCScheme { - public final class CommandLineArguments: Equatable { +public extension XCScheme { + final class CommandLineArguments: Equatable { // MARK: - Attributes public let arguments: [CommandLineArgument] @@ -30,7 +30,7 @@ extension XCScheme { func xmlElement() -> AEXMLElement { let element = AEXMLElement(name: "CommandLineArguments", value: nil) - arguments.forEach { arg in + for arg in arguments { element.addChild(arg.xmlElement()) } return element @@ -44,8 +44,8 @@ extension XCScheme { } } -extension XCScheme.CommandLineArguments { - public struct CommandLineArgument: Equatable { +public extension XCScheme.CommandLineArguments { + struct CommandLineArgument: Equatable { // MARK: - Attributes public let name: String diff --git a/Sources/XcodeProj/Scheme/XCScheme+EnvironmentVariable.swift b/Sources/XcodeProj/Scheme/XCScheme+EnvironmentVariable.swift index 2f6251063..7fe613ee0 100644 --- a/Sources/XcodeProj/Scheme/XCScheme+EnvironmentVariable.swift +++ b/Sources/XcodeProj/Scheme/XCScheme+EnvironmentVariable.swift @@ -1,8 +1,8 @@ import AEXML import Foundation -extension XCScheme { - public struct EnvironmentVariable: Equatable { +public extension XCScheme { + struct EnvironmentVariable: Equatable { // MARK: - Attributes public let variable: String @@ -44,7 +44,7 @@ extension XCScheme { static func xmlElement(from variables: [EnvironmentVariable]) -> AEXMLElement { let element = AEXMLElement(name: "EnvironmentVariables", value: nil) - variables.forEach { arg in + for arg in variables { element.addChild(arg.xmlElement()) } diff --git a/Sources/XcodeProj/Scheme/XCScheme+ExecutionAction.swift b/Sources/XcodeProj/Scheme/XCScheme+ExecutionAction.swift index 484e99aaa..2a9aed87b 100644 --- a/Sources/XcodeProj/Scheme/XCScheme+ExecutionAction.swift +++ b/Sources/XcodeProj/Scheme/XCScheme+ExecutionAction.swift @@ -1,8 +1,8 @@ import AEXML import Foundation -extension XCScheme { - public final class ExecutionAction: Equatable { +public extension XCScheme { + final class ExecutionAction: Equatable { private static let ActionType = "Xcode.IDEStandardExecutionActionsCore.ExecutionActionType.ShellScriptAction" // MARK: - Attributes @@ -45,14 +45,14 @@ extension XCScheme { "title": title, "scriptText": scriptText, ] - if let shellToInvoke = shellToInvoke { + if let shellToInvoke { attributes["shellToInvoke"] = shellToInvoke } let content = AEXMLElement(name: "ActionContent", value: nil, attributes: attributes) element.addChild(content) - if let environmentBuildable = environmentBuildable { + if let environmentBuildable { let environment = content.addChild(name: "EnvironmentBuildable") environment.addChild(environmentBuildable.xmlElement()) } diff --git a/Sources/XcodeProj/Scheme/XCScheme+LaunchAction.swift b/Sources/XcodeProj/Scheme/XCScheme+LaunchAction.swift index a8770502f..4edd89770 100644 --- a/Sources/XcodeProj/Scheme/XCScheme+LaunchAction.swift +++ b/Sources/XcodeProj/Scheme/XCScheme+LaunchAction.swift @@ -2,9 +2,9 @@ import AEXML import Foundation import PathKit -extension XCScheme { +public extension XCScheme { // swiftlint:disable:next type_body_length - public final class LaunchAction: SerialAction { + final class LaunchAction: SerialAction { public enum Style: String, Sendable { case auto = "0" case wait = "1" @@ -18,7 +18,7 @@ extension XCScheme { case disabled = "3" } - // The value used to disable 'API Validation'. + // The value used to disable 'API Validation'. // If this feature is not being disabled, this value will not be present. public let gpuValidationModeDisableValue = "1" @@ -263,7 +263,7 @@ extension XCScheme { "allowLocationSimulation": allowLocationSimulation.xmlString, ] - if let askForAppToLaunch = askForAppToLaunch { + if let askForAppToLaunch { attributes["askForAppToLaunch"] = askForAppToLaunch.xmlString } if enableGPUFrameCaptureMode != LaunchAction.defaultGPUFrameCaptureMode { @@ -308,7 +308,7 @@ extension XCScheme { if stopOnEveryMainThreadCheckerIssue { attributes["stopOnEveryMainThreadCheckerIssue"] = stopOnEveryMainThreadCheckerIssue.xmlString } - if let customWorkingDirectory = customWorkingDirectory { + if let customWorkingDirectory { attributes["customWorkingDirectory"] = customWorkingDirectory } @@ -320,36 +320,36 @@ extension XCScheme { value: nil, attributes: xmlAttributes) super.writeXML(parent: element) - if let runnable = runnable { + if let runnable { element.addChild(runnable.xmlElement()) } - if let pathRunnable = pathRunnable { + if let pathRunnable { element.addChild(pathRunnable.xmlElement()) } - if let locationScenarioReference = locationScenarioReference { + if let locationScenarioReference { element.addChild(locationScenarioReference.xmlElement()) } - if let macroExpansion = macroExpansion { + if let macroExpansion { let macro = element.addChild(name: "MacroExpansion") macro.addChild(macroExpansion.xmlElement()) } - if let commandlineArguments = commandlineArguments { + if let commandlineArguments { element.addChild(commandlineArguments.xmlElement()) } - if let environmentVariables = environmentVariables { + if let environmentVariables { element.addChild(EnvironmentVariable.xmlElement(from: environmentVariables)) } - if let language = language { + if let language { element.attributes["language"] = language } - if let region = region { + if let region { element.attributes["region"] = region } @@ -357,25 +357,25 @@ extension XCScheme { element.attributes["showNonLocalizedStrings"] = showNonLocalizedStrings.xmlString } - if let launchAutomaticallySubstyle = launchAutomaticallySubstyle { + if let launchAutomaticallySubstyle { element.attributes["launchAutomaticallySubstyle"] = launchAutomaticallySubstyle } - if let storeKitConfigurationFileReference = storeKitConfigurationFileReference { + if let storeKitConfigurationFileReference { element.addChild(storeKitConfigurationFileReference.xmlElement()) } - if let customLaunchCommand = customLaunchCommand { + if let customLaunchCommand { element.attributes["customLaunchCommand"] = customLaunchCommand } - if let customLLDBInitFile = customLLDBInitFile { + if let customLLDBInitFile { element.attributes["customLLDBInitFile"] = customLLDBInitFile } if !additionalOptions.isEmpty { let additionalOptionsElement = element.addChild(AEXMLElement(name: "AdditionalOptions")) - additionalOptions.forEach { additionalOption in + for additionalOption in additionalOptions { additionalOptionsElement.addChild(additionalOption.xmlElement()) } } diff --git a/Sources/XcodeProj/Scheme/XCScheme+LocationScenarioReference.swift b/Sources/XcodeProj/Scheme/XCScheme+LocationScenarioReference.swift index 23e13bb83..64bb69dbd 100644 --- a/Sources/XcodeProj/Scheme/XCScheme+LocationScenarioReference.swift +++ b/Sources/XcodeProj/Scheme/XCScheme+LocationScenarioReference.swift @@ -1,8 +1,8 @@ import AEXML import Foundation -extension XCScheme { - public final class LocationScenarioReference: Equatable { +public extension XCScheme { + final class LocationScenarioReference: Equatable { // MARK: - Attributes public var identifier: String diff --git a/Sources/XcodeProj/Scheme/XCScheme+PathRunnable.swift b/Sources/XcodeProj/Scheme/XCScheme+PathRunnable.swift index d47a19252..220de342d 100644 --- a/Sources/XcodeProj/Scheme/XCScheme+PathRunnable.swift +++ b/Sources/XcodeProj/Scheme/XCScheme+PathRunnable.swift @@ -2,8 +2,8 @@ import AEXML import Foundation import PathKit -extension XCScheme { - public class PathRunnable: Equatable { +public extension XCScheme { + class PathRunnable: Equatable { // MARK: - Attributes public var runnableDebuggingMode: String diff --git a/Sources/XcodeProj/Scheme/XCScheme+ProfileAction.swift b/Sources/XcodeProj/Scheme/XCScheme+ProfileAction.swift index 023b79576..6c4864996 100644 --- a/Sources/XcodeProj/Scheme/XCScheme+ProfileAction.swift +++ b/Sources/XcodeProj/Scheme/XCScheme+ProfileAction.swift @@ -2,8 +2,8 @@ import AEXML import Foundation import PathKit -extension XCScheme { - public final class ProfileAction: SerialAction { +public extension XCScheme { + final class ProfileAction: SerialAction { // MARK: - Static private static let defaultBuildConfiguration = "Release" @@ -15,6 +15,7 @@ extension XCScheme { // For backwards compatibility - can be removed in the next major version runnable as? BuildableProductRunnable } + public var buildConfiguration: String public var shouldUseLaunchSchemeArgsEnv: Bool public var savedToolIdentifier: String @@ -80,8 +81,8 @@ extension XCScheme { commandlineArguments: CommandLineArguments? = nil, environmentVariables: [EnvironmentVariable]? = nil, enableTestabilityWhenProfilingTests: Bool = true, - launchAutomaticallySubstyle: String? = nil) - { + launchAutomaticallySubstyle: String? = nil + ) { self.init( runnable: buildableProductRunnable, buildConfiguration: buildConfiguration, @@ -98,7 +99,8 @@ extension XCScheme { commandlineArguments: commandlineArguments, environmentVariables: environmentVariables, enableTestabilityWhenProfilingTests: enableTestabilityWhenProfilingTests, - launchAutomaticallySubstyle: launchAutomaticallySubstyle) + launchAutomaticallySubstyle: launchAutomaticallySubstyle + ) } override init(element: AEXMLElement) throws { @@ -152,10 +154,10 @@ extension XCScheme { "debugDocumentVersioning": debugDocumentVersioning.xmlString, ]) super.writeXML(parent: element) - if let runnable = runnable { + if let runnable { element.addChild(runnable.xmlElement()) } - if let askForAppToLaunch = askForAppToLaunch { + if let askForAppToLaunch { element.attributes["askForAppToLaunch"] = askForAppToLaunch.xmlString } if ignoresPersistentStateOnLaunch { @@ -164,20 +166,20 @@ extension XCScheme { if !enableTestabilityWhenProfilingTests { element.attributes["enableTestabilityWhenProfilingTests"] = "No" } - if let commandlineArguments = commandlineArguments { + if let commandlineArguments { element.addChild(commandlineArguments.xmlElement()) } - if let environmentVariables = environmentVariables { + if let environmentVariables { element.addChild(EnvironmentVariable.xmlElement(from: environmentVariables)) } - if let launchAutomaticallySubstyle = launchAutomaticallySubstyle { + if let launchAutomaticallySubstyle { element.attributes["launchAutomaticallySubstyle"] = launchAutomaticallySubstyle } - if let customWorkingDirectory = customWorkingDirectory { + if let customWorkingDirectory { element.attributes["customWorkingDirectory"] = customWorkingDirectory } - if let macroExpansion = macroExpansion { + if let macroExpansion { let macro = element.addChild(name: "MacroExpansion") macro.addChild(macroExpansion.xmlElement()) } diff --git a/Sources/XcodeProj/Scheme/XCScheme+RemoteRunnable.swift b/Sources/XcodeProj/Scheme/XCScheme+RemoteRunnable.swift index 67413e5c7..b66cadd64 100644 --- a/Sources/XcodeProj/Scheme/XCScheme+RemoteRunnable.swift +++ b/Sources/XcodeProj/Scheme/XCScheme+RemoteRunnable.swift @@ -1,8 +1,8 @@ import AEXML import Foundation -extension XCScheme { - public final class RemoteRunnable: Runnable { +public extension XCScheme { + final class RemoteRunnable: Runnable { // MARK: - Attributes public var bundleIdentifier: String diff --git a/Sources/XcodeProj/Scheme/XCScheme+Runnable.swift b/Sources/XcodeProj/Scheme/XCScheme+Runnable.swift index b7173dc2c..27471e9f3 100644 --- a/Sources/XcodeProj/Scheme/XCScheme+Runnable.swift +++ b/Sources/XcodeProj/Scheme/XCScheme+Runnable.swift @@ -1,8 +1,8 @@ import AEXML import Foundation -extension XCScheme { - public class Runnable: Equatable { +public extension XCScheme { + class Runnable: Equatable { // MARK: - Attributes public var runnableDebuggingMode: String @@ -27,7 +27,7 @@ extension XCScheme { let element = AEXMLElement(name: "Runnable", value: nil, attributes: ["runnableDebuggingMode": runnableDebuggingMode]) - if let buildableReference = buildableReference { + if let buildableReference { element.addChild(buildableReference.xmlElement()) } return element diff --git a/Sources/XcodeProj/Scheme/XCScheme+SerialAction.swift b/Sources/XcodeProj/Scheme/XCScheme+SerialAction.swift index 4a02b06b3..fb842834b 100644 --- a/Sources/XcodeProj/Scheme/XCScheme+SerialAction.swift +++ b/Sources/XcodeProj/Scheme/XCScheme+SerialAction.swift @@ -1,8 +1,8 @@ import AEXML import Foundation -extension XCScheme { - public class SerialAction: Equatable { +public extension XCScheme { + class SerialAction: Equatable { // MARK: - Attributes public var preActions: [ExecutionAction] @@ -25,13 +25,13 @@ extension XCScheme { func writeXML(parent element: AEXMLElement) { if !preActions.isEmpty { let preActions = element.addChild(name: "PreActions") - self.preActions.forEach { preAction in + for preAction in self.preActions { preActions.addChild(preAction.xmlElement()) } } if !postActions.isEmpty { let postActions = element.addChild(name: "PostActions") - self.postActions.forEach { postAction in + for postAction in self.postActions { postActions.addChild(postAction.xmlElement()) } } diff --git a/Sources/XcodeProj/Scheme/XCScheme+StoreKitConfigurationFileReference.swift b/Sources/XcodeProj/Scheme/XCScheme+StoreKitConfigurationFileReference.swift index ab42e2af5..4edc620d1 100644 --- a/Sources/XcodeProj/Scheme/XCScheme+StoreKitConfigurationFileReference.swift +++ b/Sources/XcodeProj/Scheme/XCScheme+StoreKitConfigurationFileReference.swift @@ -1,8 +1,8 @@ import AEXML import Foundation -extension XCScheme { - public final class StoreKitConfigurationFileReference: Equatable { +public extension XCScheme { + final class StoreKitConfigurationFileReference: Equatable { // MARK: - Attributes public var identifier: String diff --git a/Sources/XcodeProj/Scheme/XCScheme+TestAction.swift b/Sources/XcodeProj/Scheme/XCScheme+TestAction.swift index 0c7c3f706..735e699b1 100644 --- a/Sources/XcodeProj/Scheme/XCScheme+TestAction.swift +++ b/Sources/XcodeProj/Scheme/XCScheme+TestAction.swift @@ -2,12 +2,12 @@ import AEXML import Foundation import PathKit -extension XCScheme { - public final class TestAction: SerialAction { +public extension XCScheme { + final class TestAction: SerialAction { public enum AttachmentLifetime: String { case keepAlways, keepNever } - + public enum ScreenCaptureFormat: String { case screenshots, screenRecording } @@ -159,7 +159,7 @@ extension XCScheme { attributes["buildConfiguration"] = buildConfiguration attributes["selectedDebuggerIdentifier"] = selectedDebuggerIdentifier attributes["selectedLauncherIdentifier"] = selectedLauncherIdentifier - if let language = language { + if let language { attributes["language"] = language } attributes["region"] = region @@ -167,7 +167,7 @@ extension XCScheme { if codeCoverageEnabled { attributes["codeCoverageEnabled"] = codeCoverageEnabled.xmlString } - if let onlyGenerateCoverageForSpecifiedTargets = onlyGenerateCoverageForSpecifiedTargets { + if let onlyGenerateCoverageForSpecifiedTargets { attributes["onlyGenerateCoverageForSpecifiedTargets"] = onlyGenerateCoverageForSpecifiedTargets.xmlString } if enableAddressSanitizer { @@ -186,59 +186,59 @@ extension XCScheme { attributes["disableMainThreadChecker"] = disableMainThreadChecker.xmlString } attributes["systemAttachmentLifetime"] = systemAttachmentLifetime?.rawValue - + switch preferredScreenCaptureFormat { case .screenshots: attributes["preferredScreenCaptureFormat"] = preferredScreenCaptureFormat?.rawValue case .none, .screenRecording: break } - + if case .keepAlways? = userAttachmentLifetime { attributes["userAttachmentLifetime"] = userAttachmentLifetime?.rawValue } - if let customLLDBInitFile = customLLDBInitFile { + if let customLLDBInitFile { attributes["customLLDBInitFile"] = customLLDBInitFile } let element = AEXMLElement(name: "TestAction", value: nil, attributes: attributes) super.writeXML(parent: element) - if let testPlans = testPlans { + if let testPlans { let testPlansElement = element.addChild(name: "TestPlans") - testPlans.forEach { testPlan in + for testPlan in testPlans { testPlansElement.addChild(testPlan.xmlElement()) } } - if let macroExpansion = macroExpansion { + if let macroExpansion { let macro = element.addChild(name: "MacroExpansion") macro.addChild(macroExpansion.xmlElement()) } let testablesElement = element.addChild(name: "Testables") - testables.forEach { testable in + for testable in testables { testablesElement.addChild(testable.xmlElement()) } - if let commandlineArguments = commandlineArguments { + if let commandlineArguments { element.addChild(commandlineArguments.xmlElement()) } - if let environmentVariables = environmentVariables { + if let environmentVariables { element.addChild(EnvironmentVariable.xmlElement(from: environmentVariables)) } if !additionalOptions.isEmpty { let additionalOptionsElement = element.addChild(AEXMLElement(name: "AdditionalOptions")) - additionalOptions.forEach { additionalOption in + for additionalOption in additionalOptions { additionalOptionsElement.addChild(additionalOption.xmlElement()) } } if !codeCoverageTargets.isEmpty { let codeCoverageTargetsElement = element.addChild(AEXMLElement(name: "CodeCoverageTargets")) - codeCoverageTargets.forEach { target in + for target in codeCoverageTargets { codeCoverageTargetsElement.addChild(target.xmlElement()) } } diff --git a/Sources/XcodeProj/Scheme/XCScheme+TestItem.swift b/Sources/XcodeProj/Scheme/XCScheme+TestItem.swift index 02934909e..9ede59f03 100644 --- a/Sources/XcodeProj/Scheme/XCScheme+TestItem.swift +++ b/Sources/XcodeProj/Scheme/XCScheme+TestItem.swift @@ -1,8 +1,8 @@ import AEXML import Foundation -extension XCScheme { - public final class TestItem: Equatable { +public extension XCScheme { + final class TestItem: Equatable { // MARK: - Attributes public var identifier: String diff --git a/Sources/XcodeProj/Scheme/XCScheme+TestPlanReference.swift b/Sources/XcodeProj/Scheme/XCScheme+TestPlanReference.swift index 1397391f4..0c8e3f19f 100644 --- a/Sources/XcodeProj/Scheme/XCScheme+TestPlanReference.swift +++ b/Sources/XcodeProj/Scheme/XCScheme+TestPlanReference.swift @@ -1,8 +1,8 @@ import AEXML import Foundation -extension XCScheme { - public final class TestPlanReference: Equatable { +public extension XCScheme { + final class TestPlanReference: Equatable { // MARK: - Attributes public var reference: String diff --git a/Sources/XcodeProj/Scheme/XCScheme+TestableReference.swift b/Sources/XcodeProj/Scheme/XCScheme+TestableReference.swift index ac73ba3ac..88b5bd1b3 100644 --- a/Sources/XcodeProj/Scheme/XCScheme+TestableReference.swift +++ b/Sources/XcodeProj/Scheme/XCScheme+TestableReference.swift @@ -1,8 +1,8 @@ import AEXML import Foundation -extension XCScheme { - public final class TestableReference: Equatable { +public extension XCScheme { + final class TestableReference: Equatable { // MARK: - Attributes public var skipped: Bool @@ -40,7 +40,7 @@ extension XCScheme { useTestSelectionWhitelist = element.attributes["useTestSelectionWhitelist"] == "YES" randomExecutionOrdering = element.attributes["testExecutionOrdering"] == "random" buildableReference = try BuildableReference(element: element["BuildableReference"]) - + if element["LocationScenarioReference"].all?.first != nil { locationScenarioReference = try LocationScenarioReference(element: element["LocationScenarioReference"]) } else { @@ -64,7 +64,7 @@ extension XCScheme { func xmlElement() -> AEXMLElement { var attributes: [String: String] = ["skipped": skipped.xmlString] attributes["parallelizable"] = parallelizable ? parallelizable.xmlString : nil - if let useTestSelectionWhitelist = useTestSelectionWhitelist { + if let useTestSelectionWhitelist { attributes["useTestSelectionWhitelist"] = useTestSelectionWhitelist.xmlString } attributes["testExecutionOrdering"] = randomExecutionOrdering ? "random" : nil @@ -73,21 +73,21 @@ extension XCScheme { attributes: attributes) element.addChild(buildableReference.xmlElement()) - if let locationScenarioReference = locationScenarioReference { + if let locationScenarioReference { element.addChild(locationScenarioReference.xmlElement()) } - + if useTestSelectionWhitelist == true { if !selectedTests.isEmpty { let selectedTestsElement = element.addChild(name: "SelectedTests") - selectedTests.forEach { selectedTest in + for selectedTest in selectedTests { selectedTestsElement.addChild(selectedTest.xmlElement()) } } } else { if !skippedTests.isEmpty { let skippedTestsElement = element.addChild(name: "SkippedTests") - skippedTests.forEach { skippedTest in + for skippedTest in skippedTests { skippedTestsElement.addChild(skippedTest.xmlElement()) } } diff --git a/Sources/XcodeProj/Scheme/XCScheme.swift b/Sources/XcodeProj/Scheme/XCScheme.swift index 7a805c25a..33130c9fe 100644 --- a/Sources/XcodeProj/Scheme/XCScheme.swift +++ b/Sources/XcodeProj/Scheme/XCScheme.swift @@ -42,7 +42,7 @@ public final class XCScheme: Writable, Equatable { throw XCSchemeError.notFound(path: path) } name = path.lastComponentWithoutExtension - let document = try AEXMLDocument(xml: try path.read()) + let document = try AEXMLDocument(xml: path.read()) let scheme = document["Scheme"] lastUpgradeVersion = scheme.attributes["LastUpgradeVersion"] version = scheme.attributes["version"] @@ -93,36 +93,36 @@ public final class XCScheme: Writable, Equatable { } try path.write(document.xmlXcodeFormat) } - + public func dataRepresentation() throws -> Data? { getAEXMLDocument().xmlXcodeFormat.data(using: .utf8) } - + private func getAEXMLDocument() -> AEXMLDocument { let document = AEXMLDocument() var schemeAttributes: [String: String] = [:] schemeAttributes["LastUpgradeVersion"] = lastUpgradeVersion schemeAttributes["version"] = version let scheme = document.addChild(name: "Scheme", value: nil, attributes: schemeAttributes) - if let buildAction = buildAction { + if let buildAction { scheme.addChild(buildAction.xmlElement()) } - if let testAction = testAction { + if let testAction { scheme.addChild(testAction.xmlElement()) } - if let launchAction = launchAction { + if let launchAction { scheme.addChild(launchAction.xmlElement()) } - if let profileAction = profileAction { + if let profileAction { scheme.addChild(profileAction.xmlElement()) } - if let analyzeAction = analyzeAction { + if let analyzeAction { scheme.addChild(analyzeAction.xmlElement()) } - if let archiveAction = archiveAction { + if let archiveAction { scheme.addChild(archiveAction.xmlElement()) } - if let wasCreatedForAppExtension = wasCreatedForAppExtension { + if let wasCreatedForAppExtension { scheme.attributes["wasCreatedForAppExtension"] = wasCreatedForAppExtension.xmlString } return document diff --git a/Sources/XcodeProj/Scheme/XCSchemeManagement.swift b/Sources/XcodeProj/Scheme/XCSchemeManagement.swift index d9c068831..992c8f7d9 100644 --- a/Sources/XcodeProj/Scheme/XCSchemeManagement.swift +++ b/Sources/XcodeProj/Scheme/XCSchemeManagement.swift @@ -4,16 +4,16 @@ import Foundation public enum XCSchemeManagementError: Error, Equatable, LocalizedError, CustomStringConvertible, Sendable { /// Thrown when the user tries to initialize a XCSchemeManagement instace passing a path to a file that doesn't exist. case notFound(path: Path) - + public var description: String { switch self { case let .notFound(path): return "Couldn't initialize XCSchemeManagement because the file at path \(path.string) was not found." } } - + public var errorDescription: String? { - return description + description } } @@ -24,10 +24,9 @@ public struct XCSchemeManagement: Codable, Equatable, Writable { public struct AutocreationBuildable: Equatable, Codable { var primary: Bool } - + /// Scheme configuration object. public struct UserStateScheme: Equatable, Codable { - /// Coding keys public enum CodingKeys: String, CodingKey { case shared @@ -38,25 +37,25 @@ public struct XCSchemeManagement: Codable, Equatable, Writable { /// Name of the scheme (with the .xcscheme extension) public var name: String - + /// True if the scheme should be shared. public var shared: Bool - + /// Attribute used by Xcode to sort the schemes. public var orderHint: Int? - + /// True if the scheme should be shown in the list of schemes. public var isShown: Bool? - + /// The key that should be used when encoding the scheme configuration. var key: String { - var key = name - if shared { - key.append("_^#shared#^_") - } - return key - } - + var key = name + if shared { + key.append("_^#shared#^_") + } + return key + } + /// It initializes the scheme configuration with its attributes. /// - Parameters: /// - name: Name of the scheme (with the .xcscheme extension) @@ -72,23 +71,23 @@ public struct XCSchemeManagement: Codable, Equatable, Writable { self.orderHint = orderHint self.isShown = isShown } - + // MARK: - Codable - + public init(from decoder: Decoder) throws { let container = try decoder.container(keyedBy: CodingKeys.self) - self.orderHint = try container.decodeIfPresent(.orderHint) - self.isShown = try container.decodeIfPresent(.isShown) - self.shared = try container.decodeIfPresent(.shared) ?? false - self.name = try container.decode(.name) + orderHint = try container.decodeIfPresent(.orderHint) + isShown = try container.decodeIfPresent(.isShown) + shared = try container.decodeIfPresent(.shared) ?? false + name = try container.decode(.name) } - + public func encode(to encoder: Encoder) throws { var container = encoder.container(keyedBy: CodingKeys.self) - if let orderHint = orderHint { + if let orderHint { try container.encode(orderHint, forKey: .orderHint) } - if let isShown = isShown { + if let isShown { try container.encode(isShown, forKey: .isShown) } } @@ -99,10 +98,10 @@ public struct XCSchemeManagement: Codable, Equatable, Writable { case schemeUserState = "SchemeUserState" case suppressBuildableAutocreation = "SuppressBuildableAutocreation" } - + /// An array that contains the configuration of the schemes. public var schemeUserState: [XCSchemeManagement.UserStateScheme]? - + /// A dictionary where the key is the object reference of the target, and the value the configuration for auto-creating schemes. public var suppressBuildableAutocreation: [String: XCSchemeManagement.AutocreationBuildable]? @@ -115,7 +114,7 @@ public struct XCSchemeManagement: Codable, Equatable, Writable { self.schemeUserState = schemeUserState self.suppressBuildableAutocreation = suppressBuildableAutocreation } - + /// Initializes the XCSchemeManagement instance by parsing an existing xcschememanagement.plist /// - Parameter path: Path to the xcschememanagement.plist file. /// - Throws: An error if the file is malformated. @@ -124,9 +123,9 @@ public struct XCSchemeManagement: Codable, Equatable, Writable { throw XCSchemeManagementError.notFound(path: path) } let decoder = XcodeprojPropertyListDecoder() - self = try decoder.decode(XCSchemeManagement.self, from: try path.read()) + self = try decoder.decode(XCSchemeManagement.self, from: path.read()) } - + /// Converts the object into a property list and writes it at the given path. /// - Parameter path: Path to the file where it should be written. /// - Parameter override: if project should be overridden. Default is false. @@ -141,12 +140,12 @@ public struct XCSchemeManagement: Codable, Equatable, Writable { let encoder = getEncoder() try encoder.encode(self).write(to: path.url) } - + /// Gets the data representation of the property list representation of the object. /// /// - Throws: Error if encoding fails. public func dataRepresentation() throws -> Data? { - return try getEncoder().encode(self) + try getEncoder().encode(self) } private func getEncoder() -> PropertyListEncoder { @@ -160,35 +159,35 @@ public struct XCSchemeManagement: Codable, Equatable, Writable { public init(from decoder: Decoder) throws { let plistDecoder = XcodeprojPropertyListDecoder() let container = try decoder.container(keyedBy: CodingKeys.self) - self.suppressBuildableAutocreation = try container.decodeIfPresent(.suppressBuildableAutocreation) + suppressBuildableAutocreation = try container.decodeIfPresent(.suppressBuildableAutocreation) if let schemeUserStateDictionary = try container.decodeIfPresent([String: Any].self, forKey: .schemeUserState) { - self.schemeUserState = try schemeUserStateDictionary + schemeUserState = try schemeUserStateDictionary .sorted(by: { $0.key < $1.key }) - .compactMap({ (key, value) -> XCSchemeManagement.UserStateScheme? in - var name = key - guard var valueDictionary = value as? [String: Any] else { return nil } - if key.contains("_^#shared#^_") { - valueDictionary["shared"] = true - name = key.replacingOccurrences(of: "_^#shared#^_", with: "") + .compactMap { key, value -> XCSchemeManagement.UserStateScheme? in + var name = key + guard var valueDictionary = value as? [String: Any] else { return nil } + if key.contains("_^#shared#^_") { + valueDictionary["shared"] = true + name = key.replacingOccurrences(of: "_^#shared#^_", with: "") + } + valueDictionary["name"] = name + + let data = try PropertyListSerialization.data(fromPropertyList: valueDictionary, format: .xml, options: 0) + return try plistDecoder.decode(XCSchemeManagement.UserStateScheme.self, from: data) } - valueDictionary["name"] = name - - let data = try PropertyListSerialization.data(fromPropertyList: valueDictionary, format: .xml, options: 0) - return try plistDecoder.decode(XCSchemeManagement.UserStateScheme.self, from: data) - }) } else { - self.suppressBuildableAutocreation = nil + suppressBuildableAutocreation = nil } } - + public func encode(to encoder: Encoder) throws { var container = encoder.container(keyedBy: CodingKeys.self) - - if let suppressBuildableAutocreation = suppressBuildableAutocreation { + + if let suppressBuildableAutocreation { try container.encode(suppressBuildableAutocreation, forKey: .suppressBuildableAutocreation) } - - if let schemeUserState = schemeUserState { + + if let schemeUserState { let encodableSchemeUserState = schemeUserState .reduce(into: [String: XCSchemeManagement.UserStateScheme]()) { $0[$1.key] = $1 } try container.encode(encodableSchemeUserState, forKey: .schemeUserState) diff --git a/Sources/XcodeProj/Utils/BuildSettingsProvider.swift b/Sources/XcodeProj/Utils/BuildSettingsProvider.swift index 574f50ca2..82a845c36 100644 --- a/Sources/XcodeProj/Utils/BuildSettingsProvider.swift +++ b/Sources/XcodeProj/Utils/BuildSettingsProvider.swift @@ -48,31 +48,31 @@ public class BuildSettingsProvider { public static func targetDefault(variant: Variant? = nil, platform: Platform?, product: Product?, swift: Bool? = nil) -> BuildSettings { var buildSettings: [String: Any] = [:] - if let platform = platform { + if let platform { buildSettings.merge(targetSettings(platform: platform), uniquingKeysWith: { $1 }) } - if let product = product { + if let product { buildSettings.merge(targetSettings(product: product), uniquingKeysWith: { $1 }) } - if let platform = platform, let product = product { + if let platform, let product { buildSettings.merge(targetSettings(platform: platform, product: product), uniquingKeysWith: { $1 }) } - if let platform = platform, let variant = variant { + if let platform, let variant { buildSettings.merge(targetSettings(variant: variant, platform: platform), uniquingKeysWith: { $1 }) } - if let variant = variant, let swift = swift, swift == true { + if let variant, let swift, swift == true { buildSettings.merge(targetSwiftSettings(variant: variant), uniquingKeysWith: { $1 }) } - if let product = product, let swift = swift, swift == true { + if let product, let swift, swift == true { buildSettings.merge(targetSwiftSettings(product: product), uniquingKeysWith: { $1 }) } - if let platform = platform, let product = product, let swift = swift, swift == true { + if let platform, let product, let swift, swift == true { buildSettings.merge(targetSwiftSettings(platform: platform, product: product), uniquingKeysWith: { $1 }) } diff --git a/Sources/XcodeProj/Utils/CommentedString.swift b/Sources/XcodeProj/Utils/CommentedString.swift index d543d975e..2420f8e05 100644 --- a/Sources/XcodeProj/Utils/CommentedString.swift +++ b/Sources/XcodeProj/Utils/CommentedString.swift @@ -43,7 +43,7 @@ struct CommentedString { if string.rangeOfCharacter(from: CommentedString.invalidCharacters) == nil { if string.rangeOfCharacter(from: CommentedString.specialCheckCharacters) == nil { return string - } else if !string.contains("//") && !string.contains("___") { + } else if !string.contains("//"), !string.contains("___") { return string } } diff --git a/Sources/XcodeProj/Utils/Decoders.swift b/Sources/XcodeProj/Utils/Decoders.swift index f298d1d5b..1bf6522cd 100644 --- a/Sources/XcodeProj/Utils/Decoders.swift +++ b/Sources/XcodeProj/Utils/Decoders.swift @@ -44,7 +44,7 @@ class ProjectDecodingContext { extension CodingUserInfoKey { /// Context user info key. - static let context: CodingUserInfoKey = CodingUserInfoKey(rawValue: "context")! + static let context: CodingUserInfoKey = .init(rawValue: "context")! } /// Xcodeproj JSON decoder. diff --git a/Sources/XcodeProj/Utils/JSONDecoding.swift b/Sources/XcodeProj/Utils/JSONDecoding.swift index ac3311694..2e80a6074 100644 --- a/Sources/XcodeProj/Utils/JSONDecoding.swift +++ b/Sources/XcodeProj/Utils/JSONDecoding.swift @@ -21,8 +21,8 @@ extension KeyedDecodingContainer { func decode(_ type: [String: Any].Type, forKey key: K) throws -> [String: Any] { // Optimization for root dictionary decoding if let decoder = try? superDecoder().context, - let pbxProjValueReader = decoder.pbxProjValueReader, - let result = pbxProjValueReader(key.stringValue) as? [String: Any] { + let pbxProjValueReader = decoder.pbxProjValueReader, + let result = pbxProjValueReader(key.stringValue) as? [String: Any] { return result } let container = try nestedContainer(keyedBy: JSONCodingKeys.self, forKey: key) @@ -95,7 +95,7 @@ extension UnkeyedDecodingContainer { } mutating func decode(_ type: [String: Any].Type) throws -> [String: Any] { - let nestedContainer = try self.nestedContainer(keyedBy: JSONCodingKeys.self) + let nestedContainer = try nestedContainer(keyedBy: JSONCodingKeys.self) return try nestedContainer.decode(type) } } diff --git a/Sources/XcodeProj/Utils/PBXBatchUpdater.swift b/Sources/XcodeProj/Utils/PBXBatchUpdater.swift index a00d30c5a..d23a49262 100644 --- a/Sources/XcodeProj/Utils/PBXBatchUpdater.swift +++ b/Sources/XcodeProj/Utils/PBXBatchUpdater.swift @@ -28,17 +28,17 @@ public final class PBXBatchUpdater { sourceTree: PBXSourceTree = .group ) throws -> PBXFileReference { - let (group, groupPath) = try groupAndGroupPathForFile( - at: filePath, - project: project - ) - return try addFile( - to: group, - groupPath: groupPath, - filePath: filePath, - sourceTree: sourceTree - ) - } + let (group, groupPath) = try groupAndGroupPathForFile( + at: filePath, + project: project + ) + return try addFile( + to: group, + groupPath: groupPath, + filePath: filePath, + sourceTree: sourceTree + ) + } /// Adds file at the give path to the project or returns existing file and its reference. /// @@ -54,15 +54,15 @@ public final class PBXBatchUpdater { sourceTree: PBXSourceTree = .group ) throws -> PBXFileReference { - let groupPath = try group.fullPath(sourceRoot: sourceRoot)! - let filePath = groupPath + Path(fileName) - return try addFile( - to: group, - groupPath: groupPath, - filePath: filePath, - sourceTree: sourceTree - ) - } + let groupPath = try group.fullPath(sourceRoot: sourceRoot)! + let filePath = groupPath + Path(fileName) + return try addFile( + to: group, + groupPath: groupPath, + filePath: filePath, + sourceTree: sourceTree + ) + } private func addFile( to group: PBXGroup, @@ -71,41 +71,41 @@ public final class PBXBatchUpdater { sourceTree: PBXSourceTree = .group ) throws -> PBXFileReference { - if let existing = try existingFileReference(at: filePath, in: group) { - return existing - } + if let existing = try existingFileReference(at: filePath, in: group) { + return existing + } - let path: String? - switch sourceTree { - case .group: - path = filePath.relative(to: groupPath).string - case .sourceRoot: - path = filePath.relative(to: sourceRoot).string - case .absolute: - path = filePath.string - default: - path = nil - } - let fileReference = PBXFileReference( - sourceTree: sourceTree, - name: filePath.lastComponent, - explicitFileType: filePath.extension.flatMap(Xcode.filetype), - lastKnownFileType: filePath.extension.flatMap(Xcode.filetype), - path: path - ) - objects.add(object: fileReference) - fileReference.parent = group - references?[filePath] = fileReference.reference - if !group.childrenReferences.contains(fileReference.reference) { - group.childrenReferences.append(fileReference.reference) - } - return fileReference + let path: String? + switch sourceTree { + case .group: + path = filePath.relative(to: groupPath).string + case .sourceRoot: + path = filePath.relative(to: sourceRoot).string + case .absolute: + path = filePath.string + default: + path = nil + } + let fileReference = PBXFileReference( + sourceTree: sourceTree, + name: filePath.lastComponent, + explicitFileType: filePath.extension.flatMap(Xcode.filetype), + lastKnownFileType: filePath.extension.flatMap(Xcode.filetype), + path: path + ) + objects.add(object: fileReference) + fileReference.parent = group + references?[filePath] = fileReference.reference + if !group.childrenReferences.contains(fileReference.reference) { + group.childrenReferences.append(fileReference.reference) } + return fileReference + } private func existingFileReference(at filePath: Path, in group: PBXGroup) throws -> PBXFileReference? { let objectReferences = try lazilyInstantiateObjectReferences() if let existingObjectReference = objectReferences[filePath], - let existingFileReference = objects.fileReferences[existingObjectReference] { + let existingFileReference = objects.fileReferences[existingObjectReference] { if !group.childrenReferences.contains(existingObjectReference) { group.childrenReferences.append(existingObjectReference) } @@ -155,23 +155,23 @@ public final class PBXBatchUpdater { with names: [String] ) throws -> PBXGroup { - var parent = group - for (index, name) in names.enumerated() { - let path = groupPath + Path(components: names[0 ... index]) - parent = try parent.addGroup(named: name).last! - groups?[path] = parent - } - return parent + var parent = group + for (index, name) in names.enumerated() { + let path = groupPath + Path(components: names[0 ... index]) + parent = try parent.addGroup(named: name).last! + groups?[path] = parent } + return parent + } private func lazilyInstantiateObjectReferences() throws -> [Path: PBXObjectReference] { let objectReferences: [Path: PBXObjectReference] - if let references = self.references { + if let references { objectReferences = references } else { - objectReferences = Dictionary(uniqueKeysWithValues: - try objects.fileReferences.compactMap { + objectReferences = try Dictionary(uniqueKeysWithValues: + objects.fileReferences.compactMap { let fullPath = try $0.value.fullPath(sourceRoot: sourceRoot)! return (fullPath, $0.key) }) @@ -182,11 +182,11 @@ public final class PBXBatchUpdater { private func lazilyInstantiateGroups() throws -> [Path: PBXGroup] { let unwrappedGroups: [Path: PBXGroup] - if let groups = self.groups { + if let groups { unwrappedGroups = groups } else { - unwrappedGroups = Dictionary(uniqueKeysWithValues: - try objects.groups.compactMap { + unwrappedGroups = try Dictionary(uniqueKeysWithValues: + objects.groups.compactMap { let fullPath = try $0.value.fullPath(sourceRoot: sourceRoot)! return (fullPath, $0.value) }) diff --git a/Sources/XcodeProj/Utils/PlistValue.swift b/Sources/XcodeProj/Utils/PlistValue.swift index abd99a51b..d36496c50 100644 --- a/Sources/XcodeProj/Utils/PlistValue.swift +++ b/Sources/XcodeProj/Utils/PlistValue.swift @@ -105,7 +105,7 @@ extension Dictionary where Key == String { extension Array { func plist() -> PlistValue { - .array(compactMap { (element) -> PlistValue? in + .array(compactMap { element -> PlistValue? in if let array = element as? [Any] { return array.plist() } else if let dictionary = element as? [String: Any] { diff --git a/Sources/XcodeProj/Utils/ReferenceGenerator.swift b/Sources/XcodeProj/Utils/ReferenceGenerator.swift index e4a5f3da9..823c582bd 100644 --- a/Sources/XcodeProj/Utils/ReferenceGenerator.swift +++ b/Sources/XcodeProj/Utils/ReferenceGenerator.swift @@ -31,6 +31,7 @@ final class ReferenceGenerator: ReferenceGenerating { // cache current reference values var references: Set = [] + // swiftformat:disable:next preferForLoop proj.objects.forEach { object in if !object.reference.temporary { references.insert(object.reference.value) @@ -53,7 +54,7 @@ final class ReferenceGenerator: ReferenceGenerating { // Project references try project.projectReferences.forEach { objectReferenceDict in guard let projectReference = objectReferenceDict[Xcode.ProjectReference.projectReferenceKey]?.getObject() as? PBXFileReference, - let productsGroup = objectReferenceDict[Xcode.ProjectReference.productGroupKey]?.getObject() as? PBXGroup else { return } + let productsGroup = objectReferenceDict[Xcode.ProjectReference.productGroupKey]?.getObject() as? PBXGroup else { return } try generateFileReference(projectReference, identifiers: identifiers) try generateGroupReferences(productsGroup, identifiers: identifiers + [projectReference.name ?? projectReference.path ?? ""]) } @@ -79,31 +80,30 @@ final class ReferenceGenerator: ReferenceGenerating { fixReference(for: project, identifiers: identifiers) // Packages - project.remotePackages.forEach { + for remotePackage in project.remotePackages { var identifiers = identifiers - identifiers.append($0.repositoryURL ?? $0.name ?? "") - fixReference(for: $0, identifiers: identifiers) + identifiers.append(remotePackage.repositoryURL ?? remotePackage.name ?? "") + fixReference(for: remotePackage, identifiers: identifiers) } // Packages - project.localPackages.forEach { + for localPackage in project.localPackages { var identifiers = identifiers - identifiers.append($0.relativePath) - fixReference(for: $0, identifiers: identifiers) + identifiers.append(localPackage.relativePath) + fixReference(for: localPackage, identifiers: identifiers) } // Targets let targets: [PBXTarget] = project.targetReferences.objects() - targets.forEach { target in - + for target in targets { var identifiers = identifiers identifiers.append(target.name) // Packages - target.packageProductDependencies.forEach { + for packageProductDependency in target.packageProductDependencies { var identifiers = identifiers - identifiers.append($0.productName) - fixReference(for: $0, identifiers: identifiers) + identifiers.append(packageProductDependency.productName) + fixReference(for: packageProductDependency, identifiers: identifiers) } // Build Tool Plug-ins @@ -223,9 +223,9 @@ final class ReferenceGenerator: ReferenceGenerating { // Target proxy if let targetProxyReference = targetDependency.targetProxyReference, - targetProxyReference.temporary, - let targetProxy = targetDependency.targetProxy, - let remoteGlobalIDString = targetProxy.remoteGlobalID?.uuid { + targetProxyReference.temporary, + let targetProxy = targetDependency.targetProxy, + let remoteGlobalIDString = targetProxy.remoteGlobalID?.uuid { var identifiers = identifiers identifiers.append(remoteGlobalIDString) fixReference(for: targetProxy, identifiers: identifiers) @@ -302,7 +302,7 @@ final class ReferenceGenerator: ReferenceGenerating { var identifiers = identifiers if let fileReference = buildFile.fileReference, - let fileReferenceObject: PBXObject = fileReference.getObject() { + let fileReferenceObject: PBXObject = fileReference.getObject() { identifiers.append(fileReferenceObject.reference.value) } @@ -333,8 +333,8 @@ extension ReferenceGenerator { /// - Parameters: /// - object: The object to generate a reference for /// - identifiers: list of identifiers used to generate the reference of the object. - func fixReference(for object: T, - identifiers: [String]) { + func fixReference(for object: some PBXObject, + identifiers: [String]) { if object.reference.temporary { var identifiers = identifiers if let context = object.context { diff --git a/Sources/XcodeProj/Utils/XCConfig.swift b/Sources/XcodeProj/Utils/XCConfig.swift index 7f7a119a1..e1e585ea6 100644 --- a/Sources/XcodeProj/Utils/XCConfig.swift +++ b/Sources/XcodeProj/Utils/XCConfig.swift @@ -43,7 +43,7 @@ public final class XCConfig { } } -final class XCConfigParser { +enum XCConfigParser { /// Given the path the line is being parsed from, it returns a function that parses a line, /// and returns the include path and the config that the include is pointing to. /// @@ -56,19 +56,19 @@ final class XCConfigParser { options: [], range: NSRange(location: 0, length: line.count)) - .compactMap { (match) -> String? in + .compactMap { match -> String? in if match.numberOfRanges == 2 { return NSString(string: line).substring(with: match.range(at: 1)) } return nil } .compactMap { pathString in - let includePath: Path = Path(pathString) + let includePath: Path = .init(pathString) var config: XCConfig? do { // first try to load the included xcconfig relative to the current xcconfig config = try XCConfig(path: path.parent() + includePath, projectPath: projectPath) - } catch (XCConfigError.notFound(_)) where projectPath != nil { + } catch XCConfigError.notFound(_) where projectPath != nil { // if that fails, try to load the included xcconfig relative to the project config = try? XCConfig(path: projectPath!.parent() + includePath, projectPath: projectPath) } catch { @@ -85,7 +85,7 @@ final class XCConfigParser { options: [], range: NSRange(location: 0, length: line.count)) - .compactMap { (match) -> (key: String, value: String)? in + .compactMap { match -> (key: String, value: String)? in if match.numberOfRanges == 3 { let key: String = NSString(string: line).substring(with: match.range(at: 1)) let value: String = NSString(string: line).substring(with: match.range(at: 2)) @@ -120,18 +120,18 @@ extension XCConfig: Equatable { // MARK: - XCConfig Extension (Helpers) -extension XCConfig { +public extension XCConfig { /// It returns the build settings after flattening all the includes. /// /// - Returns: build settings flattening all the includes. - public func flattenedBuildSettings() -> [String: Any] { + func flattenedBuildSettings() -> [String: Any] { var content: [String: Any] = buildSettings includes - .map { $0.1 } + .map(\.1) .flattened() - .map { $0.buildSettings } + .map(\.buildSettings) .forEach { configDictionary in - configDictionary.forEach { key, value in + for (key, value) in configDictionary { if content[key] == nil { content[key] = value } } } @@ -149,11 +149,11 @@ extension XCConfig: Writable { } try path.write(content) } - + public func dataRepresentation() throws -> Data? { getContent().data(using: .utf8) } - + private func getContent() -> String { var content = "" content.append(writeIncludes()) @@ -164,7 +164,7 @@ extension XCConfig: Writable { private func writeIncludes() -> String { var content = "" - includes.forEach { include in + for include in includes { content.append("#include \"\(include.0.string)\"\n") } content.append("\n") @@ -173,7 +173,7 @@ extension XCConfig: Writable { private func writeBuildSettings() -> String { var content = "" - buildSettings.forEach { key, value in + for (key, value) in buildSettings { content.append("\(key) = \(value)\n") } content.append("\n") @@ -183,15 +183,15 @@ extension XCConfig: Writable { // MARK: - Array Extension (XCConfig) -extension Array where Element == XCConfig { +extension [XCConfig] { /// It returns an array with the XCConfig reversely flattened. It's useful for resolving the build settings. /// /// - Returns: flattened configurations array. func flattened() -> [XCConfig] { - let reversed = self.reversed() - .flatMap { (config) -> [XCConfig] in + let reversed = reversed() + .flatMap { config -> [XCConfig] in var configs = [XCConfig(includes: [], buildSettings: config.buildSettings)] - configs.append(contentsOf: config.includes.map { $0.1 }.flattened()) + configs.append(contentsOf: config.includes.map(\.1).flattened()) return configs } return reversed diff --git a/Sources/XcodeProj/Workspace/XCWorkspace.swift b/Sources/XcodeProj/Workspace/XCWorkspace.swift index 4707d9305..7f99f6c0a 100644 --- a/Sources/XcodeProj/Workspace/XCWorkspace.swift +++ b/Sources/XcodeProj/Workspace/XCWorkspace.swift @@ -67,9 +67,9 @@ public final class XCWorkspace: Writable, Equatable { try dataPath.mkpath() try data.write(path: dataPath) } - + public func dataRepresentation() throws -> Data? { - self.data.rawContents().data(using: .utf8) + data.rawContents().data(using: .utf8) } // MARK: - Equatable diff --git a/Sources/XcodeProj/Workspace/XCWorkspaceData.swift b/Sources/XcodeProj/Workspace/XCWorkspaceData.swift index 9cd95c7c9..13c413bbe 100644 --- a/Sources/XcodeProj/Workspace/XCWorkspaceData.swift +++ b/Sources/XcodeProj/Workspace/XCWorkspaceData.swift @@ -36,7 +36,7 @@ extension XCWorkspaceData: Writable { self.init(children: children) } - + func rawContents() -> String { let document = AEXMLDocument() let workspace = document.addChild(name: "Workspace", value: nil, attributes: ["version": "1.0"]) @@ -47,7 +47,7 @@ extension XCWorkspaceData: Writable { } // MARK: - - + public func write(path: Path, override: Bool = true) throws { let rawXml = rawContents() if override, path.exists { @@ -55,7 +55,7 @@ extension XCWorkspaceData: Writable { } try path.write(rawXml) } - + public func dataRepresentation() throws -> Data? { rawContents().data(using: .utf8) } @@ -134,7 +134,7 @@ private extension XCWorkspaceDataFileRef { guard let location = element.attributes["location"] else { throw Error.missingLocationAttribute } - self.init(location: try XCWorkspaceDataElementLocationType(string: location)) + try self.init(location: XCWorkspaceDataElementLocationType(string: location)) } func xmlElement() -> AEXMLElement { diff --git a/Tests/XcodeProjTests/Extensions/AEXML+XcodeFormatTests.swift b/Tests/XcodeProjTests/Extensions/AEXML+XcodeFormatTests.swift index bbae0766e..d7836dffc 100644 --- a/Tests/XcodeProjTests/Extensions/AEXML+XcodeFormatTests.swift +++ b/Tests/XcodeProjTests/Extensions/AEXML+XcodeFormatTests.swift @@ -123,7 +123,7 @@ class AEXML_XcodeFormatTests: XCTestCase { "buildConfiguration": "Debug", "selectedLauncherIdentifier": "Xcode.DebuggerFoundation.Launcher.LLDB", "launchStyle": "0", - "askForAppToLaunch": "YES" + "askForAppToLaunch": "YES", ] ) } @@ -151,7 +151,7 @@ class AEXML_XcodeFormatTests: XCTestCase { "shouldUseLaunchSchemeArgsEnv": "YES", "buildConfiguration": "Debug", "customLLDBInitFile": "$(BAZEL_LLDB_INIT)", - "selectedLauncherIdentifier": "Xcode.DebuggerFoundation.Launcher.LLDB" + "selectedLauncherIdentifier": "Xcode.DebuggerFoundation.Launcher.LLDB", ] ) } @@ -163,7 +163,7 @@ class AEXML_XcodeFormatTests: XCTestCase { attributes: [ "LastUpgradeVersion": "1320", "wasCreatedForAppExtension": "YES", - "version": "1.7" + "version": "1.7", ] ) } @@ -175,7 +175,7 @@ class AEXML_XcodeFormatTests: XCTestCase { attributes: [ "wasCreatedForAppExtension": "YES", "LastUpgradeVersion": "1320", - "version": "1.7" + "version": "1.7", ] ) } @@ -187,7 +187,7 @@ class AEXML_XcodeFormatTests: XCTestCase { attributes: [ "BundleIdentifier": "BundleID", "RemotePath": "REMOTE_PATH", - "runnableDebuggingMode": "2" + "runnableDebuggingMode": "2", ] ) } diff --git a/Tests/XcodeProjTests/Extensions/XCTestCase+Assertions.swift b/Tests/XcodeProjTests/Extensions/XCTestCase+Assertions.swift index 67df9c183..9d1330dd1 100644 --- a/Tests/XcodeProjTests/Extensions/XCTestCase+Assertions.swift +++ b/Tests/XcodeProjTests/Extensions/XCTestCase+Assertions.swift @@ -2,7 +2,7 @@ import Foundation import XCTest extension XCTestCase { - typealias EquatableError = Error & Equatable + typealias EquatableError = Equatable & Error func XCTAssertNotNilAndUnwrap(_ obj: T?, message: String = "") -> T { guard let unwrappedObj = obj else { @@ -12,7 +12,7 @@ extension XCTestCase { return unwrappedObj } - func XCTAssertThrowsSpecificError(_ expression: @autoclosure () throws -> T, _ error: E, _ message: @autoclosure () -> String = "", file: StaticString = #file, line: UInt = #line) { + func XCTAssertThrowsSpecificError(_ expression: @autoclosure () throws -> some Any, _ error: E, _ message: @autoclosure () -> String = "", file: StaticString = #file, line: UInt = #line) { XCTAssertThrowsError(try expression(), message(), file: file, line: line) { actualError in let message = "Expected \(error) got \(actualError)" diff --git a/Tests/XcodeProjTests/Objects/BuildPhase/PBXBuildFileTests.swift b/Tests/XcodeProjTests/Objects/BuildPhase/PBXBuildFileTests.swift index 517dad192..5dbd1cd22 100644 --- a/Tests/XcodeProjTests/Objects/BuildPhase/PBXBuildFileTests.swift +++ b/Tests/XcodeProjTests/Objects/BuildPhase/PBXBuildFileTests.swift @@ -8,7 +8,7 @@ final class PBXBuildFileTests: XCTestCase { } func test_platformFilterIsSet() { - let pbxBuildFile: PBXBuildFile = PBXBuildFile( + let pbxBuildFile = PBXBuildFile( platformFilter: "platformFilter" ) XCTAssertEqual(pbxBuildFile.platformFilter, "platformFilter") diff --git a/Tests/XcodeProjTests/Objects/BuildPhase/PBXShellScriptBuildPhaseTests.swift b/Tests/XcodeProjTests/Objects/BuildPhase/PBXShellScriptBuildPhaseTests.swift index 86692b49a..18de54b2c 100644 --- a/Tests/XcodeProjTests/Objects/BuildPhase/PBXShellScriptBuildPhaseTests.swift +++ b/Tests/XcodeProjTests/Objects/BuildPhase/PBXShellScriptBuildPhaseTests.swift @@ -16,7 +16,8 @@ final class PBXShellScriptBuildPhaseTests: XCTestCase { let (_, doNotShowPlistValue) = try doNotShow.plistKeyAndValue(proj: proj, reference: "ref") if case let PlistValue.dictionary(showDictionary) = showPlistValue, - case let PlistValue.dictionary(doNotShowDictionary) = doNotShowPlistValue { + case let PlistValue.dictionary(doNotShowDictionary) = doNotShowPlistValue + { XCTAssertNil(showDictionary["showEnvVarsInLog"]) XCTAssertEqual(doNotShowDictionary["showEnvVarsInLog"]?.string, "0") } else { @@ -35,7 +36,8 @@ final class PBXShellScriptBuildPhaseTests: XCTestCase { guard case let .dictionary(valuesWhenNotPresent) = try alwaysOutOfDateNotPresent.plistKeyAndValue(proj: proj, reference: "ref").value, case let .dictionary(valuesWhenFalse) = try alwaysOutOfDateFalse.plistKeyAndValue(proj: proj, reference: "ref").value, - case let .dictionary(valuesWhenTrue) = try alwaysOutOfDateTrue.plistKeyAndValue(proj: proj, reference: "ref").value else { + case let .dictionary(valuesWhenTrue) = try alwaysOutOfDateTrue.plistKeyAndValue(proj: proj, reference: "ref").value + else { XCTFail("Plist should contain dictionary") return } @@ -45,7 +47,7 @@ final class PBXShellScriptBuildPhaseTests: XCTestCase { XCTAssertFalse(valuesWhenFalse.keys.contains("alwaysOutOfDate")) XCTAssertEqual(valuesWhenTrue["alwaysOutOfDate"], "1") } - + func test_write_dependencyFile() throws { let discoveryPath = "$(DERIVED_FILE_DIR)/target.d" let discovery = PBXShellScriptBuildPhase(dependencyFile: discoveryPath) diff --git a/Tests/XcodeProjTests/Objects/Configuration/XCConfigurationList+Fixtures.swift b/Tests/XcodeProjTests/Objects/Configuration/XCConfigurationList+Fixtures.swift index f3b6e28ee..975838b02 100644 --- a/Tests/XcodeProjTests/Objects/Configuration/XCConfigurationList+Fixtures.swift +++ b/Tests/XcodeProjTests/Objects/Configuration/XCConfigurationList+Fixtures.swift @@ -5,7 +5,8 @@ extension XCConfigurationList { static func fixture(buildConfigurations: [XCBuildConfiguration] = [XCBuildConfiguration.fixture(name: "Debug"), XCBuildConfiguration.fixture(name: "Release")], defaultConfigurationName: String? = "Debug", - defaultConfigurationIsVisible _: Bool = true) -> XCConfigurationList { + defaultConfigurationIsVisible _: Bool = true) -> XCConfigurationList + { XCConfigurationList(buildConfigurations: buildConfigurations, defaultConfigurationName: defaultConfigurationName) } diff --git a/Tests/XcodeProjTests/Objects/Configuration/XCConfigurationListTests.swift b/Tests/XcodeProjTests/Objects/Configuration/XCConfigurationListTests.swift index 447ed7e5d..1a3824506 100644 --- a/Tests/XcodeProjTests/Objects/Configuration/XCConfigurationListTests.swift +++ b/Tests/XcodeProjTests/Objects/Configuration/XCConfigurationListTests.swift @@ -12,7 +12,7 @@ final class XCConfigurationListTests: XCTestCase { let configurationList = XCConfigurationList(buildConfigurations: []) objects.add(object: configurationList) let configurations = try configurationList.addDefaultConfigurations() - let names = configurations.map { $0.name } + let names = configurations.map(\.name) XCTAssertEqual(configurations.count, 2) XCTAssertTrue(names.contains("Debug")) diff --git a/Tests/XcodeProjTests/Objects/Files/PBXFileReference+Fixtures.swift b/Tests/XcodeProjTests/Objects/Files/PBXFileReference+Fixtures.swift index 042d56e11..58c650873 100644 --- a/Tests/XcodeProjTests/Objects/Files/PBXFileReference+Fixtures.swift +++ b/Tests/XcodeProjTests/Objects/Files/PBXFileReference+Fixtures.swift @@ -4,7 +4,8 @@ import Foundation extension PBXFileReference { static func fixture(sourceTree _: PBXSourceTree = .group, - name: String? = "Test") -> PBXFileReference { + name: String? = "Test") -> PBXFileReference + { PBXFileReference(sourceTree: .group, name: name) } } diff --git a/Tests/XcodeProjTests/Objects/Files/PBXGroup+Fixtures.swift b/Tests/XcodeProjTests/Objects/Files/PBXGroup+Fixtures.swift index 0f95e2b45..fb617bd00 100644 --- a/Tests/XcodeProjTests/Objects/Files/PBXGroup+Fixtures.swift +++ b/Tests/XcodeProjTests/Objects/Files/PBXGroup+Fixtures.swift @@ -4,7 +4,8 @@ import Foundation extension PBXGroup { static func fixture(children _: [PBXFileElement] = [], sourceTree: PBXSourceTree = .group, - name: String = "test") -> PBXGroup { + name: String = "test") -> PBXGroup + { PBXGroup(children: [], sourceTree: sourceTree, name: name) diff --git a/Tests/XcodeProjTests/Objects/Files/PBXGroupTests.swift b/Tests/XcodeProjTests/Objects/Files/PBXGroupTests.swift index 6fd5360d5..915a714da 100644 --- a/Tests/XcodeProjTests/Objects/Files/PBXGroupTests.swift +++ b/Tests/XcodeProjTests/Objects/Files/PBXGroupTests.swift @@ -71,7 +71,7 @@ final class PBXGroupTests: XCTestCase { XCTAssertEqual(childVariantGroups.count, expectedGroupNames.count) - childVariantGroups.enumerated().forEach { index, variantGroup in + for (index, variantGroup) in childVariantGroups.enumerated() { let parentGroup = (index == 0) ? group : childVariantGroups[index - 1] if index == childVariantGroups.count - 1 { diff --git a/Tests/XcodeProjTests/Objects/Files/XCVersionGroup+Fixtures.swift b/Tests/XcodeProjTests/Objects/Files/XCVersionGroup+Fixtures.swift index 604c1a277..310a5da4f 100644 --- a/Tests/XcodeProjTests/Objects/Files/XCVersionGroup+Fixtures.swift +++ b/Tests/XcodeProjTests/Objects/Files/XCVersionGroup+Fixtures.swift @@ -8,14 +8,15 @@ extension XCVersionGroup { name: String? = "name", sourceTree: PBXSourceTree = .group, versionGroupType: String = "versionGroupType", - children: [PBXFileReference] = [PBXFileReference(name: "currentVersion")]) -> XCVersionGroup { + children: [PBXFileReference] = [PBXFileReference(name: "currentVersion")]) -> XCVersionGroup + { let group = XCVersionGroup(currentVersion: currentVersion, path: path, name: name, sourceTree: sourceTree, versionGroupType: versionGroupType, children: children) - if let currentVersion = currentVersion { + if let currentVersion { objects.add(object: currentVersion) } children.forEach { objects.add(object: $0) } diff --git a/Tests/XcodeProjTests/Objects/Project/PBXOutputSettingsTests.swift b/Tests/XcodeProjTests/Objects/Project/PBXOutputSettingsTests.swift index 33c5fc8f3..03fbc0222 100644 --- a/Tests/XcodeProjTests/Objects/Project/PBXOutputSettingsTests.swift +++ b/Tests/XcodeProjTests/Objects/Project/PBXOutputSettingsTests.swift @@ -6,28 +6,28 @@ class PBXOutputSettingsTests: XCTestCase { // MARK: - PBXFileOrder - PBXBuldFile func test_PBXFileOrder_PBXBuildFile_by_uuid_when_iosProject() { - let iosProject = self.iosProject() + let iosProject = iosProject() XCTAssertFalse(PBXFileOrder.byUUID.sort(lhs: iosProject.objectBuildFileAssets, rhs: iosProject.objectBuildFileMain)) XCTAssertTrue(PBXFileOrder.byUUID.sort(lhs: iosProject.objectBuildFileMain, rhs: iosProject.objectBuildFileAssets)) } func test_PBXFileOrder_PBXBuildFile_by_filename_when_iosProject() { - let iosProject = self.iosProject() + let iosProject = iosProject() XCTAssertTrue(PBXFileOrder.byFilename.sort(lhs: iosProject.objectBuildFileAssets, rhs: iosProject.objectBuildFileMain)) XCTAssertFalse(PBXFileOrder.byFilename.sort(lhs: iosProject.objectBuildFileMain, rhs: iosProject.objectBuildFileAssets)) } func test_PBXFileOrder_PBXBuildFile_by_filename_when_fileSharedAcrossTargetsProject() { - let fileSharedAcrossTargetsProject = self.fileSharedAcrossTargetsProject() + let fileSharedAcrossTargetsProject = fileSharedAcrossTargetsProject() let sameNameByFilename = fileSharedAcrossTargetsProject.objectBuildFileSameName.sorted(by: PBXFileOrder.byFilename.sort) XCTAssertLessThan(sameNameByFilename.first!.1.uuid, sameNameByFilename.last!.1.uuid) } func test_PBXFileOrder_PBXBuildFile_by_filename_when_nil_name_and_path_when_iosProject() { - let iosProject = self.iosProject() + let iosProject = iosProject() iosProject.buildFileAssets.file?.name = nil iosProject.buildFileMain.file?.name = nil @@ -38,7 +38,7 @@ class PBXOutputSettingsTests: XCTestCase { } func test_PBXFileOrder_PBXBuildFile_by_filename_when_no_file_when_iosProject() { - let iosProject = self.iosProject() + let iosProject = iosProject() let ref1 = iosProject.buildFileAssets.reference let ref2 = iosProject.buildFileMain.reference @@ -51,14 +51,14 @@ class PBXOutputSettingsTests: XCTestCase { // MARK: - PBXFileOrder - PBXBuildPhaseFile func test_PBXFileOrder_PBXBuildPhaseFile_by_uuid_when_iosProject() { - let iosProject = self.iosProject() + let iosProject = iosProject() XCTAssertFalse(PBXFileOrder.byUUID.sort(lhs: iosProject.objectBuildPhaseFileAssets, rhs: iosProject.objectBuildPhaseFileMain)) XCTAssertTrue(PBXFileOrder.byUUID.sort(lhs: iosProject.objectBuildPhaseFileMain, rhs: iosProject.objectBuildPhaseFileAssets)) } func test_PBXFileOrder_PBXBuildPhaseFile_by_filename_when_iosProject() { - let iosProject = self.iosProject() + let iosProject = iosProject() XCTAssertTrue(PBXFileOrder.byFilename.sort(lhs: iosProject.objectBuildPhaseFileAssets, rhs: iosProject.objectBuildPhaseFileMain)) XCTAssertFalse(PBXFileOrder.byFilename.sort(lhs: iosProject.objectBuildPhaseFileMain, rhs: iosProject.objectBuildPhaseFileAssets)) @@ -67,28 +67,28 @@ class PBXOutputSettingsTests: XCTestCase { // MARK: - PBXFileOrder - PBXFileReference func test_PBXFileOrder_PBXFileReference_by_uuid_when_iosProject() { - let iosProject = self.iosProject() + let iosProject = iosProject() XCTAssertFalse(PBXFileOrder.byUUID.sort(lhs: iosProject.objectFileReferenceAssets, rhs: iosProject.objectFileReferenceCoreData)) XCTAssertTrue(PBXFileOrder.byUUID.sort(lhs: iosProject.objectFileReferenceCoreData, rhs: iosProject.objectFileReferenceAssets)) } func test_PBXFileOrder_PBXFileReference_by_filename_when_iosProject() { - let iosProject = self.iosProject() + let iosProject = iosProject() XCTAssertTrue(PBXFileOrder.byFilename.sort(lhs: iosProject.objectFileReferenceAssets, rhs: iosProject.objectFileReferenceCoreData)) XCTAssertFalse(PBXFileOrder.byFilename.sort(lhs: iosProject.objectFileReferenceCoreData, rhs: iosProject.objectFileReferenceAssets)) } func test_PBXFileOrder_PBXFileReference_by_filename_when_fileSharedAcrossTargetsProject() { - let fileSharedAcrossTargetsProject = self.fileSharedAcrossTargetsProject() + let fileSharedAcrossTargetsProject = fileSharedAcrossTargetsProject() let sameNameByFilename = fileSharedAcrossTargetsProject.objectFileReferenceSameName.sorted(by: PBXFileOrder.byFilename.sort) XCTAssertLessThan(sameNameByFilename.first!.1.uuid, sameNameByFilename.last!.1.uuid) } func test_PBXFileOrder_PBXFileReference_by_filename_when_nil_name_and_path_when_iosProject() { - let iosProject = self.iosProject() + let iosProject = iosProject() iosProject.fileReferenceAssets.name = nil iosProject.fileReferenceCoreData.name = nil @@ -101,14 +101,14 @@ class PBXOutputSettingsTests: XCTestCase { // MARK: - PBXFileOrder - Other func test_PBXFileOrder_Other_by_uuid_when_iosProject() { - let iosProject = self.iosProject() + let iosProject = iosProject() XCTAssertTrue(PBXFileOrder.byUUID.sort(lhs: iosProject.objectGroupFrameworks, rhs: iosProject.objectGroupProducts)) XCTAssertFalse(PBXFileOrder.byUUID.sort(lhs: iosProject.objectGroupProducts, rhs: iosProject.objectGroupFrameworks)) } func test_PBXFileOrder_Other_by_filename_when_iosProject() { - let iosProject = self.iosProject() + let iosProject = iosProject() XCTAssertTrue(PBXFileOrder.byFilename.sort(lhs: iosProject.objectGroupFrameworks, rhs: iosProject.objectGroupProducts)) XCTAssertFalse(PBXFileOrder.byFilename.sort(lhs: iosProject.objectGroupProducts, rhs: iosProject.objectGroupFrameworks)) @@ -121,7 +121,7 @@ class PBXOutputSettingsTests: XCTestCase { } func test_PBXNavigatorFileOrder_by_filename_when_iosProject() { - let iosProject = self.iosProject() + let iosProject = iosProject() let sort: (PBXFileElement, PBXFileElement) -> Bool = PBXNavigatorFileOrder.byFilename.sort! let sorted = iosProject.navigatorFileGroup.children.sorted(by: sort).map { $0.fileName()! } @@ -141,7 +141,7 @@ class PBXOutputSettingsTests: XCTestCase { } func test_PBXNavigatorFileOrder_by_filename_groups_first_when_iosProject() { - let iosProject = self.iosProject() + let iosProject = iosProject() let sort: (PBXFileElement, PBXFileElement) -> Bool = PBXNavigatorFileOrder.byFilenameGroupsFirst.sort! let sorted = iosProject.navigatorFileGroup.children.sorted(by: sort).map { $0.fileName()! } @@ -167,7 +167,7 @@ class PBXOutputSettingsTests: XCTestCase { } func test_PBXBuildPhaseFileOrder_by_filename_when_iosProject() { - let iosProject = self.iosProject() + let iosProject = iosProject() XCTAssertTrue(PBXBuildPhaseFileOrder.byFilename.sort!(iosProject.buildFileAssets, iosProject.buildFileMain)) XCTAssertFalse(PBXBuildPhaseFileOrder.byFilename.sort!(iosProject.buildFileMain, iosProject.buildFileAssets)) diff --git a/Tests/XcodeProjTests/Objects/Project/PBXProj+Fixtures.swift b/Tests/XcodeProjTests/Objects/Project/PBXProj+Fixtures.swift index 8a397023b..ade46a2a2 100644 --- a/Tests/XcodeProjTests/Objects/Project/PBXProj+Fixtures.swift +++ b/Tests/XcodeProjTests/Objects/Project/PBXProj+Fixtures.swift @@ -6,7 +6,8 @@ extension PBXProj { objectVersion: UInt = Xcode.LastKnown.objectVersion, archiveVersion: UInt = Xcode.LastKnown.archiveVersion, classes: [String: Any] = [:], - objects: [PBXObject] = []) -> PBXProj { + objects: [PBXObject] = []) -> PBXProj + { PBXProj(rootObject: rootObject, objectVersion: objectVersion, archiveVersion: archiveVersion, diff --git a/Tests/XcodeProjTests/Objects/Project/PBXProjEncoderTests.swift b/Tests/XcodeProjTests/Objects/Project/PBXProjEncoderTests.swift index e7ebb6296..d60e08380 100644 --- a/Tests/XcodeProjTests/Objects/Project/PBXProjEncoderTests.swift +++ b/Tests/XcodeProjTests/Objects/Project/PBXProjEncoderTests.swift @@ -11,7 +11,7 @@ class PBXProjEncoderTests: XCTestCase { func test_writeHeaders_when_iOSProject() throws { try loadiOSProject() - let lines = self.lines(fromFile: encodeProject()) + let lines = lines(fromFile: encodeProject()) XCTAssertEqual(583, lines.count) XCTAssertEqual("// !$*UTF8*$!", lines[0]) } @@ -21,7 +21,7 @@ class PBXProjEncoderTests: XCTestCase { func test_buildFiles_in_default_uuid_order_when_iOSProject() throws { try loadiOSProject() - let lines = self.lines(fromFile: encodeProject()) + let lines = lines(fromFile: encodeProject()) var line = lines.validate(line: "/* Begin PBXBuildFile section */") line = lines.validate(lineContaining: "04D5C09F1F153824008A2F98 /* CoreData.framework in Frameworks */", onLineAfter: line) line = lines.validate(lineContaining: "04D5C0A31F153924008A2F98 /* Public.h in Headers */", onLineAfter: line) @@ -43,7 +43,7 @@ class PBXProjEncoderTests: XCTestCase { try loadiOSProject() let settings = PBXOutputSettings(projFileListOrder: .byFilename) - let lines = self.lines(fromFile: encodeProject(settings: settings)) + let lines = lines(fromFile: encodeProject(settings: settings)) var line = lines.validate(line: "/* Begin PBXBuildFile section */") line = lines.validate(lineContaining: "23766C161EAA3484007A9026 /* AppDelegate.swift in Sources */", onLineAfter: line) line = lines.validate(lineContaining: "23766C1D1EAA3484007A9026 /* Assets.xcassets in Resources */", onLineAfter: line) @@ -65,7 +65,7 @@ class PBXProjEncoderTests: XCTestCase { try loadFileSharedAcrossTargetsProject() let settings = PBXOutputSettings(projFileListOrder: .byFilename) - let lines = self.lines(fromFile: encodeProject(settings: settings)) + let lines = lines(fromFile: encodeProject(settings: settings)) var line = lines.validate(line: "/* Begin PBXBuildFile section */") line = lines.validate(lineContaining: "6C103C032A49CC5400D7EFE4 /* FileSharedAcrossTargets.framework in Frameworks */", onLineAfter: line) @@ -79,7 +79,7 @@ class PBXProjEncoderTests: XCTestCase { func test_file_references_in_default_uuid_order_when_iOSProject() throws { try loadiOSProject() - let lines = self.lines(fromFile: encodeProject()) + let lines = lines(fromFile: encodeProject()) var line = lines.validate(line: "/* Begin PBXFileReference section */") line = lines.validate(lineContaining: "04D5C09E1F153824008A2F98 /* CoreData.framework */", onLineAfter: line) line = lines.validate(lineContaining: "04D5C0A01F153915008A2F98 /* Public.h */", onLineAfter: line) @@ -105,7 +105,7 @@ class PBXProjEncoderTests: XCTestCase { func test_file_references_in_default_uuid_order_when_fileSharedAcrossTargetsProject() throws { try loadFileSharedAcrossTargetsProject() - let lines = self.lines(fromFile: encodeProject()) + let lines = lines(fromFile: encodeProject()) var line = lines.validate(line: "/* Begin PBXFileReference section */") line = lines.validate(lineContaining: "6C103BFA2A49CC5300D7EFE4 /* FileSharedAcrossTargets.framework */", onLineAfter: line) line = lines.validate(lineContaining: "6C103BFD2A49CC5300D7EFE4 /* FileSharedAcrossTargets.h */", onLineAfter: line) @@ -121,7 +121,7 @@ class PBXProjEncoderTests: XCTestCase { try loadiOSProject() let settings = PBXOutputSettings(projFileListOrder: .byFilename) - let lines = self.lines(fromFile: encodeProject(settings: settings)) + let lines = lines(fromFile: encodeProject(settings: settings)) var line = lines.validate(line: "/* Begin PBXFileReference section */") line = lines.validate(lineContaining: "23766C151EAA3484007A9026 /* AppDelegate.swift */", onLineAfter: line) line = lines.validate(lineContaining: "23766C1C1EAA3484007A9026 /* Assets.xcassets */", onLineAfter: line) @@ -147,7 +147,7 @@ class PBXProjEncoderTests: XCTestCase { try loadFileSharedAcrossTargetsProject() let settings = PBXOutputSettings(projFileListOrder: .byFilename) - let lines = self.lines(fromFile: encodeProject(settings: settings)) + let lines = lines(fromFile: encodeProject(settings: settings)) var line = lines.validate(line: "/* Begin PBXFileReference section */") line = lines.validate(lineContaining: "6C103BFA2A49CC5300D7EFE4 /* FileSharedAcrossTargets.framework */", onLineAfter: line) line = lines.validate(lineContaining: "6C103BFD2A49CC5300D7EFE4 /* FileSharedAcrossTargets.h */", onLineAfter: line) @@ -163,7 +163,7 @@ class PBXProjEncoderTests: XCTestCase { func test_navigator_groups_in_default_order_when_iOSProject() throws { try loadiOSProject() - let lines = self.lines(fromFile: encodeProject()) + let lines = lines(fromFile: encodeProject()) let beginGroup = lines.findLine("/* Begin PBXGroup section */") @@ -207,7 +207,7 @@ class PBXProjEncoderTests: XCTestCase { try loadiOSProject() let settings = PBXOutputSettings(projNavigatorFileOrder: .byFilename) - let lines = self.lines(fromFile: encodeProject(settings: settings)) + let lines = lines(fromFile: encodeProject(settings: settings)) let beginGroup = lines.findLine("/* Begin PBXGroup section */") @@ -248,7 +248,7 @@ class PBXProjEncoderTests: XCTestCase { try loadiOSProject() let settings = PBXOutputSettings(projNavigatorFileOrder: .byFilenameGroupsFirst) - let lines = self.lines(fromFile: encodeProject(settings: settings)) + let lines = lines(fromFile: encodeProject(settings: settings)) let beginGroup = lines.findLine("/* Begin PBXGroup section */") @@ -290,7 +290,7 @@ class PBXProjEncoderTests: XCTestCase { func test_build_phase_sources_unsorted_when_iOSProject() throws { try loadiOSProject() - let lines = self.lines(fromFile: encodeProject()) + let lines = lines(fromFile: encodeProject()) let beginGroup = lines.findLine("/* Begin PBXSourcesBuildPhase section */") let files = lines.findLine("files = (", after: beginGroup) let endGroup = lines.findLine("/* End PBXSourcesBuildPhase section */") @@ -303,7 +303,7 @@ class PBXProjEncoderTests: XCTestCase { try loadiOSProject() let settings = PBXOutputSettings(projBuildPhaseFileOrder: .byFilename) - let lines = self.lines(fromFile: encodeProject(settings: settings)) + let lines = lines(fromFile: encodeProject(settings: settings)) let beginGroup = lines.findLine("/* Begin PBXSourcesBuildPhase section */") var line = lines.findLine("files = (", after: beginGroup) line = lines.validate(line: "23766C161EAA3484007A9026 /* AppDelegate.swift in Sources */,", after: line) @@ -315,7 +315,7 @@ class PBXProjEncoderTests: XCTestCase { func test_build_phase_headers_unsorted_when_iOSProject() throws { try loadiOSProject() - let lines = self.lines(fromFile: encodeProject()) + let lines = lines(fromFile: encodeProject()) let beginGroup = lines.findLine("/* Begin PBXHeadersBuildPhase section */") let files = lines.findLine("files = (", after: beginGroup) let endGroup = lines.findLine("/* End PBXHeadersBuildPhase section */") @@ -328,7 +328,7 @@ class PBXProjEncoderTests: XCTestCase { try loadiOSProject() let settings = PBXOutputSettings(projBuildPhaseFileOrder: .byFilename) - let lines = self.lines(fromFile: encodeProject(settings: settings)) + let lines = lines(fromFile: encodeProject(settings: settings)) let beginGroup = lines.findLine("/* Begin PBXHeadersBuildPhase section */") var line = lines.findLine("files = (", after: beginGroup) line = lines.validate(line: "04D5C0A51F153924008A2F98 /* Private.h in Headers */,", after: line) @@ -340,7 +340,7 @@ class PBXProjEncoderTests: XCTestCase { func test_build_phase_resources_unsorted_when_iOSProject() throws { try loadiOSProject() - let lines = self.lines(fromFile: encodeProject()) + let lines = lines(fromFile: encodeProject()) let beginGroup = lines.findLine("/* Begin PBXResourcesBuildPhase section */") let files = lines.findLine("files = (", after: beginGroup) let endGroup = lines.findLine("/* End PBXResourcesBuildPhase section */") @@ -353,7 +353,7 @@ class PBXProjEncoderTests: XCTestCase { try loadiOSProject() let settings = PBXOutputSettings(projBuildPhaseFileOrder: .byFilename) - let lines = self.lines(fromFile: encodeProject(settings: settings)) + let lines = lines(fromFile: encodeProject(settings: settings)) let beginGroup = lines.findLine("/* Begin PBXResourcesBuildPhase section */") var line = lines.findLine("files = (", after: beginGroup) line = lines.validate(line: "23766C1D1EAA3484007A9026 /* Assets.xcassets in Resources */,", after: line) @@ -361,12 +361,12 @@ class PBXProjEncoderTests: XCTestCase { line = lines.validate(line: "23766C1B1EAA3484007A9026 /* Main.storyboard in Resources */,", after: line) line = lines.validate(line: "/* End PBXResourcesBuildPhase section */", after: line) } - + func test_build_rules_when_targetWithCustomBuildRulesProject() throws { try loadTargetWithCustomBuildRulesProject() let settings = PBXOutputSettings(projBuildPhaseFileOrder: .byFilename) - let lines = self.lines(fromFile: encodeProject(settings: settings)) + let lines = lines(fromFile: encodeProject(settings: settings)) let beginGroup = lines.findLine("6CAD68202A56E31400662D8A /* PBXBuildRule */ = {") var line = lines.validate(line: "isa = PBXBuildRule;", after: beginGroup) line = lines.validate(line: "compilerSpec = com.apple.compilers.proxy.script;", after: line) @@ -386,7 +386,7 @@ class PBXProjEncoderTests: XCTestCase { try loadProjectWithXCLocalSwiftPackageReference() let settings = PBXOutputSettings(projBuildPhaseFileOrder: .byFilename) - let lines = self.lines(fromFile: encodeProject(settings: settings)) + let lines = lines(fromFile: encodeProject(settings: settings)) let beginGroup = lines.findLine("/* Begin XCLocalSwiftPackageReference section */") var line = lines.validate(line: "C9FDF5C52AD604310096A37A /* XCLocalSwiftPackageReference \"MyLocalPackage\" */ = {", after: beginGroup) line = lines.validate(line: "isa = XCLocalSwiftPackageReference;", after: line) @@ -399,7 +399,7 @@ class PBXProjEncoderTests: XCTestCase { try loadProjectWithXCLocalSwiftPackageReference() let settings = PBXOutputSettings(projBuildPhaseFileOrder: .byFilename) - let lines = self.lines(fromFile: encodeProject(settings: settings)) + let lines = lines(fromFile: encodeProject(settings: settings)) let beginGroup = lines.findLine("packageReferences = (") var line = lines.validate(line: "42AA19FF22AAF0D600428760 /* XCRemoteSwiftPackageReference \"RxSwift\" */,", after: beginGroup) line = lines.validate(line: "C9FDF5C52AD604310096A37A /* XCLocalSwiftPackageReference \"MyLocalPackage\" */,", after: line) @@ -410,7 +410,7 @@ class PBXProjEncoderTests: XCTestCase { try loadProjectWithRelativeXCLocalSwiftPackageReference() let settings = PBXOutputSettings(projBuildPhaseFileOrder: .byFilename) - let lines = self.lines(fromFile: encodeProject(settings: settings)) + let lines = lines(fromFile: encodeProject(settings: settings)) let beginGroup = lines.findLine("packageReferences = (") var line = lines.validate(line: "C9FDF5C82AD8AE400096A37A /* XCLocalSwiftPackageReference \"../MyLocalPackage\" */,", after: beginGroup) line = lines.validate(line: ");", after: line) @@ -420,7 +420,7 @@ class PBXProjEncoderTests: XCTestCase { try loadProjectWithXCLocalSwiftPackageReferences() let settings = PBXOutputSettings(projBuildPhaseFileOrder: .byFilename) - let lines = self.lines(fromFile: encodeProject(settings: settings)) + let lines = lines(fromFile: encodeProject(settings: settings)) let beginGroup = lines.findLine("packageReferences = (") var line = lines.validate(line: "C9FDF5C52AD604310096A37A /* XCLocalSwiftPackageReference \"MyLocalPackage\" */,", after: beginGroup) line = lines.validate(line: "C9FDF5CB2AD8B3B50096A37A /* XCLocalSwiftPackageReference \"MyOtherLocalPackage/MyOtherLocalPackage\" */,", after: line) @@ -438,7 +438,7 @@ class PBXProjEncoderTests: XCTestCase { } } - private func encodeProjectThrows(error expectedError: E, line: UInt = #line) where E: Error { + private func encodeProjectThrows(error expectedError: some Error, line: UInt = #line) { do { _ = try PBXProjEncoder(outputSettings: PBXOutputSettings()).encode(proj: proj) XCTFail("Expected '\(expectedError)' to be thrown", line: line) @@ -460,7 +460,7 @@ class PBXProjEncoderTests: XCTestCase { private func loadFileSharedAcrossTargetsProject() throws { proj = try PBXProj(jsonDictionary: fileSharedAcrossTargetsDictionary().1) } - + private func loadTargetWithCustomBuildRulesProject() throws { proj = try PBXProj(jsonDictionary: targetWithCustomBuildRulesDictionary().1) } @@ -480,7 +480,7 @@ class PBXProjEncoderTests: XCTestCase { // MARK: - Line validations -private extension Array where Element == String { +private extension [String] { @discardableResult func validate(line string: String, betweenLine lineAbove: Int, andLine lineBelow: Int, line: UInt = #line) -> Int { validate(string, using: { $0 == $1 }, betweenLine: lineAbove, andLine: lineBelow, line: line) } diff --git a/Tests/XcodeProjTests/Objects/Project/PBXProjIntegrationTests.swift b/Tests/XcodeProjTests/Objects/Project/PBXProjIntegrationTests.swift index 93838e4d0..fc442ca7d 100644 --- a/Tests/XcodeProjTests/Objects/Project/PBXProjIntegrationTests.swift +++ b/Tests/XcodeProjTests/Objects/Project/PBXProjIntegrationTests.swift @@ -9,7 +9,7 @@ final class PBXProjIntegrationTests: XCTestCase { let decoder = XcodeprojPropertyListDecoder() let proj = try? decoder.decode(PBXProj.self, from: data) XCTAssertNotNil(proj) - if let proj = proj { + if let proj { assert(proj: proj) } } @@ -30,7 +30,7 @@ final class PBXProjIntegrationTests: XCTestCase { try? tmpDir.delete() } - let fixturePath = self.fixturePath().parent() + let fixturePath = fixturePath().parent() let xcodeprojPath = tmpDir + "Project.xcodeproj" try fixturePath.copy(xcodeprojPath) @@ -40,7 +40,7 @@ final class PBXProjIntegrationTests: XCTestCase { try checkedOutput("git", ["add", "."]) try checkedOutput("git", [ "-c", "user.email=test@example.com", "-c", "user.name=Test User", - "commit", "-m", "test" + "commit", "-m", "test", ]) // Read/write the project diff --git a/Tests/XcodeProjTests/Objects/Project/PBXProject+Fixtures.swift b/Tests/XcodeProjTests/Objects/Project/PBXProject+Fixtures.swift index 66e8f9164..695215927 100644 --- a/Tests/XcodeProjTests/Objects/Project/PBXProject+Fixtures.swift +++ b/Tests/XcodeProjTests/Objects/Project/PBXProject+Fixtures.swift @@ -5,7 +5,8 @@ extension PBXProject { static func fixture(name: String = "test", buildConfigurationList: XCConfigurationList = XCConfigurationList.fixture(), compatibilityVersion: String = Xcode.Default.compatibilityVersion, - mainGroup: PBXGroup = PBXGroup.fixture()) -> PBXProject { + mainGroup: PBXGroup = PBXGroup.fixture()) -> PBXProject + { PBXProject(name: name, buildConfigurationList: buildConfigurationList, compatibilityVersion: compatibilityVersion, diff --git a/Tests/XcodeProjTests/Objects/SwiftPackage/XCLocalSwiftPackageReferenceTests.swift b/Tests/XcodeProjTests/Objects/SwiftPackage/XCLocalSwiftPackageReferenceTests.swift index 9586ae352..119b96fce 100644 --- a/Tests/XcodeProjTests/Objects/SwiftPackage/XCLocalSwiftPackageReferenceTests.swift +++ b/Tests/XcodeProjTests/Objects/SwiftPackage/XCLocalSwiftPackageReferenceTests.swift @@ -30,7 +30,7 @@ final class XCLocalSwiftPackageReferenceTests: XCTestCase { // Then XCTAssertEqual(got.value, .dictionary([ "isa": "XCLocalSwiftPackageReference", - "relativePath": "repository" + "relativePath": "repository", ])) } diff --git a/Tests/XcodeProjTests/Objects/Targets/PBXTarget+Fixtures.swift b/Tests/XcodeProjTests/Objects/Targets/PBXTarget+Fixtures.swift index 84e882f5d..07da826aa 100644 --- a/Tests/XcodeProjTests/Objects/Targets/PBXTarget+Fixtures.swift +++ b/Tests/XcodeProjTests/Objects/Targets/PBXTarget+Fixtures.swift @@ -10,7 +10,8 @@ extension PBXTarget { dependencies: [PBXTargetDependency] = [], productName: String? = "Test", product: PBXFileReference = PBXFileReference.fixture(name: "Test.app"), - productType: PBXProductType = PBXProductType.application) -> PBXTarget { + productType: PBXProductType = PBXProductType.application) -> PBXTarget + { PBXTarget(name: name, buildConfigurationList: buildConfigurationList, buildPhases: buildPhases, diff --git a/Tests/XcodeProjTests/Project/XCBreakpointListTests.swift b/Tests/XcodeProjTests/Project/XCBreakpointListTests.swift index 44783730a..1d1da4d8b 100644 --- a/Tests/XcodeProjTests/Project/XCBreakpointListTests.swift +++ b/Tests/XcodeProjTests/Project/XCBreakpointListTests.swift @@ -12,7 +12,7 @@ final class XCBreakpointListIntegrationTests: XCTestCase { func test_init_initializesTheBreakpointListCorrectly() { XCTAssertNotNil(subject) - if let subject = subject { + if let subject { assert(breakpointList: subject) } } diff --git a/Tests/XcodeProjTests/Project/XCUserDataTests.swift b/Tests/XcodeProjTests/Project/XCUserDataTests.swift index 0f3b76d01..1918584f1 100644 --- a/Tests/XcodeProjTests/Project/XCUserDataTests.swift +++ b/Tests/XcodeProjTests/Project/XCUserDataTests.swift @@ -14,11 +14,11 @@ final class XCUserDataTests: XCTestCase { initModel: { try? XCUserData(path: $0) }, modify: { userData in // XCScheme's that are already in place (the removed element) should not be removed by a write - userData.schemes = userData.schemes.filter { $0.name != "iOS-other"} + userData.schemes = userData.schemes.filter { $0.name != "iOS-other" } return userData }, assertion: { - assert(userData: $1, userName: "copy") + assert(userData: $1, userName: "copy") }) } diff --git a/Tests/XcodeProjTests/Project/XcodeProjTests.swift b/Tests/XcodeProjTests/Project/XcodeProjTests.swift index 3f4a81948..424767edd 100644 --- a/Tests/XcodeProjTests/Project/XcodeProjTests.swift +++ b/Tests/XcodeProjTests/Project/XcodeProjTests.swift @@ -24,7 +24,7 @@ final class XcodeProjIntegrationTests: XCTestCase { try testReadWriteProducesNoDiff(from: iosProjectPath, initModel: XcodeProj.init(path:)) } - + func test_initialize_PBXProj_with_data() throws { // Given let pbxprojPath = iosProjectPath + "project.pbxproj" @@ -38,7 +38,7 @@ final class XcodeProjIntegrationTests: XCTestCase { // Then XCTAssertEqual(pbxprojFromData, pbxprojFromDisk) } - + func test_write_includes_workspace_settings() throws { // Define workspace settings that should be written let workspaceSettings = WorkspaceSettings(buildSystem: .new, derivedDataLocationStyle: .default, autoCreateSchemes: false) diff --git a/Tests/XcodeProjTests/Scheme/XCScheme+BuildableReferenceTests.swift b/Tests/XcodeProjTests/Scheme/XCScheme+BuildableReferenceTests.swift index d1ee337dc..776803adb 100644 --- a/Tests/XcodeProjTests/Scheme/XCScheme+BuildableReferenceTests.swift +++ b/Tests/XcodeProjTests/Scheme/XCScheme+BuildableReferenceTests.swift @@ -1,5 +1,5 @@ -@testable import XcodeProj import XCTest +@testable import XcodeProj final class XCSchemeBuildableReferenceTests: XCTestCase { func test_hash() throws { diff --git a/Tests/XcodeProjTests/Scheme/XCSchemeManagementTests.swift b/Tests/XcodeProjTests/Scheme/XCSchemeManagementTests.swift index f94252f48..ed33c9749 100644 --- a/Tests/XcodeProjTests/Scheme/XCSchemeManagementTests.swift +++ b/Tests/XcodeProjTests/Scheme/XCSchemeManagementTests.swift @@ -1,17 +1,17 @@ -import Foundation -import XCTest import AEXML +import Foundation import PathKit +import XCTest @testable import XcodeProj final class XCSchemeManagementTests: XCTestCase { func test_init_from_path() throws { // Given let path = xcschememanagementPath - + // When - let got = try XCSchemeManagement.init(path: path) - + let got = try XCSchemeManagement(path: path) + // Then XCTAssertEqual(got.suppressBuildableAutocreation, [ "E525238B16245A900012E2BA": .init(primary: true), @@ -35,7 +35,7 @@ final class XCSchemeManagementTests: XCTestCase { let path = xcschememanagementPath // When - let reads = try (0..<10).map { _ in + let reads = try (0 ..< 10).map { _ in try XCSchemeManagement(path: path) } @@ -65,12 +65,12 @@ final class XCSchemeManagementTests: XCTestCase { ] ) try subject.write(path: plistPath, override: true) - + // Create a commit try checkedOutput("git", ["init"]) try checkedOutput("git", ["add", "."]) try checkedOutput("git", ["commit", "-m", "test"]) - + // Write again try subject.write(path: plistPath, override: true) diff --git a/Tests/XcodeProjTests/Scheme/XCSchemeTests.swift b/Tests/XcodeProjTests/Scheme/XCSchemeTests.swift index 1c79171d5..d4ed343c2 100644 --- a/Tests/XcodeProjTests/Scheme/XCSchemeTests.swift +++ b/Tests/XcodeProjTests/Scheme/XCSchemeTests.swift @@ -25,7 +25,7 @@ final class XCSchemeIntegrationTests: XCTestCase { let subject = try? XCScheme(path: runnableWithoutBuildableReferenceSchemePath) XCTAssertNotNil(subject) - if let subject = subject { + if let subject { assert(runnableWithoutBuildableReferenceScheme: subject) } } @@ -53,7 +53,7 @@ final class XCSchemeIntegrationTests: XCTestCase { let subject = try? XCScheme(path: minimalSchemePath) XCTAssertNotNil(subject) - if let subject = subject { + if let subject { assert(minimalScheme: subject) } } @@ -331,7 +331,7 @@ final class XCSchemeIntegrationTests: XCTestCase { // Then XCTAssertEqual(reconstructedSubject, subject) } - + func test_buildAction_buildArchitectures() throws { // Given / When let subject = try XCScheme(path: buildArchitecturesSchemePath) @@ -340,7 +340,7 @@ final class XCSchemeIntegrationTests: XCTestCase { let buildAction = try XCTUnwrap(subject.buildAction) XCTAssertTrue(buildAction.buildArchitectures == .matchRunDestination) } - + func test_buildAction_buildArchitectures_whenXMLElementDoesNotExist() throws { // Given / When let subject = try XCScheme(path: minimalSchemePath) @@ -349,7 +349,7 @@ final class XCSchemeIntegrationTests: XCTestCase { let buildAction = try XCTUnwrap(subject.buildAction) XCTAssertTrue(buildAction.buildArchitectures == .useTargetSettings) } - + func test_buildAction_buildArchitectures_serializingAndDeserializing() throws { // Given let scheme = try XCScheme(path: buildArchitecturesSchemePath) @@ -774,7 +774,7 @@ final class XCSchemeIntegrationTests: XCTestCase { // A scheme with the `runPostActionsOnFailure` enabled fixturesPath() + "Schemes/RunPostActionsOnFailure.xcscheme" } - + /// A scheme that `buildArchitectures` is specified "Automatic". private var buildArchitecturesSchemePath: Path { fixturesPath() + "Schemes/BuildArchitectures.xcscheme" diff --git a/Tests/XcodeProjTests/Tests/Fixtures.swift b/Tests/XcodeProjTests/Tests/Fixtures.swift index b90f5d149..40cc343f9 100644 --- a/Tests/XcodeProjTests/Tests/Fixtures.swift +++ b/Tests/XcodeProjTests/Tests/Fixtures.swift @@ -16,7 +16,6 @@ func fileSharedAcrossTargetsDictionary() -> (Path, [String: Any]) { return (fileSharedAcrossTargetsProject, loadPlist(path: fileSharedAcrossTargetsProject.string)!) } - func targetWithCustomBuildRulesDictionary() -> (Path, [String: Any]) { let targetWithCustomBuildRulesProject = fixturesPath() + "TargetWithCustomBuildRules/TargetWithCustomBuildRules.xcodeproj/project.pbxproj" return (targetWithCustomBuildRulesProject, loadPlist(path: targetWithCustomBuildRulesProject.string)!) diff --git a/Tests/XcodeProjTests/Tests/testWrite.swift b/Tests/XcodeProjTests/Tests/testWrite.swift index 01e8ebfc3..44d719d58 100644 --- a/Tests/XcodeProjTests/Tests/testWrite.swift +++ b/Tests/XcodeProjTests/Tests/testWrite.swift @@ -7,7 +7,8 @@ func testWrite(file _: StaticString = #file, line _: UInt = #line, from path: Path, initModel: (Path) -> T?, - modify: (T) -> T) { + modify: (T) -> T) +{ testWrite(from: path, initModel: initModel, modify: modify, assertion: { XCTAssertEqual($0, $1) }) } @@ -16,19 +17,20 @@ func testWrite(file: StaticString = #file, from path: Path, initModel: (Path) -> T?, modify: (T) -> T, - assertion: (_ before: T, _ after: T) -> Void) { + assertion: (_ before: T, _ after: T) -> Void) +{ let copyPath = path.parent() + "copy.\(path.extension!)" try? copyPath.delete() try? path.copy(copyPath) let got = initModel(copyPath) XCTAssertNotNil(got, file: file, line: line) - if let got = got { + if let got { let modified = modify(got) do { try modified.write(path: copyPath, override: true) let gotAfterWriting = initModel(copyPath) XCTAssertNotNil(gotAfterWriting, file: file, line: line) - if let gotAfterWriting = gotAfterWriting { + if let gotAfterWriting { assertion(got, gotAfterWriting) } } catch { @@ -38,10 +40,11 @@ func testWrite(file: StaticString = #file, try? copyPath.delete() } -func testReadWriteProducesNoDiff(file: StaticString = #file, - line: UInt = #line, - from path: Path, - initModel: (Path) throws -> T) throws { +func testReadWriteProducesNoDiff(file _: StaticString = #file, + line _: UInt = #line, + from path: Path, + initModel: (Path) throws -> some Writable) throws +{ let tmpDir = try Path.uniqueTemporary() defer { try? tmpDir.delete() @@ -57,13 +60,13 @@ func testReadWriteProducesNoDiff(file: StaticString = #file, try checkedOutput("git", ["add", "."]) try checkedOutput("git", [ "-c", "user.email=test@example.com", "-c", "user.name=Test User", - "commit", "-m", "test" + "commit", "-m", "test", ]) let object = try initModel(tmpPath) try object.write(path: tmpPath, override: true) - let diff = try XCTUnwrap(try checkedOutput("git", ["diff"])) + let diff = try XCTUnwrap(checkedOutput("git", ["diff"])) XCTAssertEqual(diff, "") } } diff --git a/Tests/XcodeProjTests/Utils/ReferenceGeneratorTests.swift b/Tests/XcodeProjTests/Utils/ReferenceGeneratorTests.swift index 08a3f9760..e16035d81 100644 --- a/Tests/XcodeProjTests/Utils/ReferenceGeneratorTests.swift +++ b/Tests/XcodeProjTests/Utils/ReferenceGeneratorTests.swift @@ -49,7 +49,7 @@ class ReferenceGeneratorTests: XCTestCase { try referenceGenerator.generateReferences(proj: project) return [remoteProjectFileReference, containerItemProxy, productReferenceProxy, productsGroup, buildFile, pluginDependency.productReference!.getObject()!] - .map { $0.reference.value } + .map(\.reference.value) } let firstUUIDs = try generateProject() diff --git a/Tests/XcodeProjTests/Utils/XCConfigTests.swift b/Tests/XcodeProjTests/Utils/XCConfigTests.swift index ade947b42..afb249cd4 100644 --- a/Tests/XcodeProjTests/Utils/XCConfigTests.swift +++ b/Tests/XcodeProjTests/Utils/XCConfigTests.swift @@ -13,7 +13,7 @@ final class XCConfigTests: XCTestCase { (Path("testA"), configA), (Path("testB"), configB), ], - buildSettings: ["a": "b"]) + buildSettings: ["a": "b"]) XCTAssertEqual(config.buildSettings as! [String: String], ["a": "b"]) XCTAssertEqual(config.includes[0].config, configA) XCTAssertEqual(config.includes[1].config, configB) @@ -26,7 +26,7 @@ final class XCConfigTests: XCTestCase { (Path("testA"), configA), (Path("testB"), configB), ], - buildSettings: ["b": "3"]) + buildSettings: ["b": "3"]) let buildSettings = config.flattenedBuildSettings() XCTAssertEqual(buildSettings["a"] as? String, "2") XCTAssertEqual(buildSettings["b"] as? String, "3") @@ -81,7 +81,7 @@ final class XCConfigIntegrationTests: XCTestCase { func test_init_initializesXCConfigWithTheRightProperties() { let subject = try? XCConfig(path: childrenPath()) XCTAssertNotNil(subject) - if let subject = subject { + if let subject { assert(config: subject) } } From b32ae6214d8f5ea1e7f39504df840321b97878f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20Pi=C3=B1era=20Buend=C3=ADa?= <663605+pepicrft@users.noreply.github.com> Date: Sat, 10 Aug 2024 18:23:43 +0200 Subject: [PATCH 337/678] feat: Introduce the new Xcode 16 models `PBXFileSystemSynchronizedRootGroup` and `PBXFileSystemSynchronizedBuildFileExceptionSet` (#827) * Add PBXFileSystemSynchronizedRootGroup and property to PBXTarget * Implement the new models * Add publicHeaders and privateHeaders * Fix some bugs and add some tests * Fix some linting issues * Fix the pipeline to not run twice on PRs * Add tests * feat: Add optional exceptions to PBXFileSystemSynchronizedRootGroup * fix!: Fix non-determinism reading and writing the packageProductDependencies attribute of PBXTarget * Fix issues after rebasing * Update Sources/XcodeProj/Objects/Files/PBXFileSystemSynchronizedRootGroup.swift Co-authored-by: Kas * Add missing attributes --------- Co-authored-by: Kas --- .github/workflows/xcodeproj.yml | 7 +- .gitignore | 3 + .mise.toml | 3 +- .../project.pbxproj | 359 ++++++++++++++++++ .../xcschemes/xcschememanagement.plist | 14 + .../Exception/Exception.swift | 6 + .../SynchronizedRootGroups.swift | 6 + ...temSynchronizedBuildFileExceptionSet.swift | 110 ++++++ .../PBXFileSystemSynchronizedRootGroup.swift | 109 ++++++ .../XcodeProj/Objects/Files/PBXGroup.swift | 10 + .../Objects/Project/PBXObjectParser.swift | 4 + .../Objects/Project/PBXObjects.swift | 27 +- .../Objects/Project/PBXProjEncoder.swift | 12 + .../Objects/Project/PBXProject.swift | 4 +- .../Objects/Sourcery/Equality.generated.swift | 21 + .../XcodeProj/Objects/Targets/PBXTarget.swift | 53 ++- .../XcodeProj/Utils/ReferenceGenerator.swift | 2 +- ...onizedBuildFileExceptionSet+Fixtures.swift | 17 + ...nchronizedBuildFileExceptionSetTests.swift | 29 ++ ...SystemSynchronizedRootGroup+Fixtures.swift | 27 ++ ...FileSystemSynchronizedRootGroupTests.swift | 51 +++ .../Objects/Project/PBXProjEncoderTests.swift | 36 ++ .../Objects/Project/PBXProjectTests.swift | 6 +- ....swift => XcodeProjIntegrationTests.swift} | 9 + Tests/XcodeProjTests/Tests/Fixtures.swift | 5 + 25 files changed, 911 insertions(+), 19 deletions(-) create mode 100644 Fixtures/SynchronizedRootGroups/SynchronizedRootGroups.xcodeproj/project.pbxproj create mode 100644 Fixtures/SynchronizedRootGroups/SynchronizedRootGroups.xcodeproj/xcuserdata/pepicrft.xcuserdatad/xcschemes/xcschememanagement.plist create mode 100644 Fixtures/SynchronizedRootGroups/SynchronizedRootGroups/Exception/Exception.swift create mode 100644 Fixtures/SynchronizedRootGroups/SynchronizedRootGroups/SynchronizedRootGroups.swift create mode 100644 Sources/XcodeProj/Objects/Files/PBXFileSystemSynchronizedBuildFileExceptionSet.swift create mode 100644 Sources/XcodeProj/Objects/Files/PBXFileSystemSynchronizedRootGroup.swift create mode 100644 Tests/XcodeProjTests/Objects/Files/PBXFileSystemSynchronizedBuildFileExceptionSet+Fixtures.swift create mode 100644 Tests/XcodeProjTests/Objects/Files/PBXFileSystemSynchronizedBuildFileExceptionSetTests.swift create mode 100644 Tests/XcodeProjTests/Objects/Files/PBXFileSystemSynchronizedRootGroup+Fixtures.swift create mode 100644 Tests/XcodeProjTests/Objects/Files/PBXFileSystemSynchronizedRootGroupTests.swift rename Tests/XcodeProjTests/Project/{XcodeProjTests.swift => XcodeProjIntegrationTests.swift} (89%) diff --git a/.github/workflows/xcodeproj.yml b/.github/workflows/xcodeproj.yml index 7d921922f..5d1e3b5f7 100644 --- a/.github/workflows/xcodeproj.yml +++ b/.github/workflows/xcodeproj.yml @@ -1,7 +1,11 @@ # https://help.github.com/en/github/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#jobsjob_idname name: XcodeProj -on: [push, pull_request] +on: + push: + branches: + - main + pull_request: {} concurrency: group: xcodeproj-${{ github.head_ref }} @@ -52,6 +56,7 @@ jobs: git config --global init.defaultBranch main - name: Build and run tests run: swift test --enable-test-discovery + lint: name: Lint runs-on: macos-latest diff --git a/.gitignore b/.gitignore index 97f05bc98..a53f04dd9 100644 --- a/.gitignore +++ b/.gitignore @@ -190,3 +190,6 @@ XcodeProj.framework.zip Derived/ *.xcworkspace/ *.xcodeproj/ + +!Fixtures/**/*.xcodeproj/ + diff --git a/.mise.toml b/.mise.toml index 317af7dd7..ec954e154 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,3 +1,4 @@ [tools] -swiftlint = "0.54.0" swiftformat = "0.54.3" +tuist = "4.21.2" +swiftlint = "0.55.1" diff --git a/Fixtures/SynchronizedRootGroups/SynchronizedRootGroups.xcodeproj/project.pbxproj b/Fixtures/SynchronizedRootGroups/SynchronizedRootGroups.xcodeproj/project.pbxproj new file mode 100644 index 000000000..5db92414b --- /dev/null +++ b/Fixtures/SynchronizedRootGroups/SynchronizedRootGroups.xcodeproj/project.pbxproj @@ -0,0 +1,359 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 70; + objects = { + +/* Begin PBXFileReference section */ + 6CF05B8C2C53F5F200EF267F /* SynchronizedRootGroups.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = SynchronizedRootGroups.framework; sourceTree = BUILT_PRODUCTS_DIR; }; +/* End PBXFileReference section */ + +/* Begin PBXFileSystemSynchronizedBuildFileExceptionSet section */ + 6CF05BA32C53F97F00EF267F /* PBXFileSystemSynchronizedBuildFileExceptionSet */ = { + isa = PBXFileSystemSynchronizedBuildFileExceptionSet; + membershipExceptions = ( + Exception/Exception.swift, + ); + target = 6CF05B8B2C53F5F200EF267F /* SynchronizedRootGroups */; + }; +/* End PBXFileSystemSynchronizedBuildFileExceptionSet section */ + +/* Begin PBXFileSystemSynchronizedRootGroup section */ + 6CF05B9D2C53F64800EF267F /* SynchronizedRootGroups */ = {isa = PBXFileSystemSynchronizedRootGroup; exceptions = (6CF05BA32C53F97F00EF267F /* PBXFileSystemSynchronizedBuildFileExceptionSet */, ); explicitFileTypes = {}; explicitFolders = (); path = SynchronizedRootGroups; sourceTree = ""; }; +/* End PBXFileSystemSynchronizedRootGroup section */ + +/* Begin PBXFrameworksBuildPhase section */ + 6CF05B892C53F5F200EF267F /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 6CF05B822C53F5F200EF267F = { + isa = PBXGroup; + children = ( + 6CF05B9D2C53F64800EF267F /* SynchronizedRootGroups */, + 6CF05B8D2C53F5F200EF267F /* Products */, + ); + sourceTree = ""; + }; + 6CF05B8D2C53F5F200EF267F /* Products */ = { + isa = PBXGroup; + children = ( + 6CF05B8C2C53F5F200EF267F /* SynchronizedRootGroups.framework */, + ); + name = Products; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXHeadersBuildPhase section */ + 6CF05B872C53F5F200EF267F /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXHeadersBuildPhase section */ + +/* Begin PBXNativeTarget section */ + 6CF05B8B2C53F5F200EF267F /* SynchronizedRootGroups */ = { + isa = PBXNativeTarget; + buildConfigurationList = 6CF05B922C53F5F200EF267F /* Build configuration list for PBXNativeTarget "SynchronizedRootGroups" */; + buildPhases = ( + 6CF05B872C53F5F200EF267F /* Headers */, + 6CF05B882C53F5F200EF267F /* Sources */, + 6CF05B892C53F5F200EF267F /* Frameworks */, + 6CF05B8A2C53F5F200EF267F /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + fileSystemSynchronizedGroups = ( + 6CF05B9D2C53F64800EF267F /* SynchronizedRootGroups */, + ); + name = SynchronizedRootGroups; + packageProductDependencies = ( + ); + productName = SynchronizedRootGroups; + productReference = 6CF05B8C2C53F5F200EF267F /* SynchronizedRootGroups.framework */; + productType = "com.apple.product-type.framework"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 6CF05B832C53F5F200EF267F /* Project object */ = { + isa = PBXProject; + attributes = { + BuildIndependentTargetsInParallel = 1; + LastUpgradeCheck = 1600; + TargetAttributes = { + 6CF05B8B2C53F5F200EF267F = { + CreatedOnToolsVersion = 16.0; + LastSwiftMigration = 1600; + }; + }; + }; + buildConfigurationList = 6CF05B862C53F5F200EF267F /* Build configuration list for PBXProject "SynchronizedRootGroups" */; + compatibilityVersion = "Xcode 15.0"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 6CF05B822C53F5F200EF267F; + productRefGroup = 6CF05B8D2C53F5F200EF267F /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 6CF05B8B2C53F5F200EF267F /* SynchronizedRootGroups */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 6CF05B8A2C53F5F200EF267F /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 6CF05B882C53F5F200EF267F /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin XCBuildConfiguration section */ + 6CF05B932C53F5F200EF267F /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUILD_LIBRARY_FOR_DISTRIBUTION = YES; + CLANG_ENABLE_MODULES = YES; + CODE_SIGN_STYLE = Automatic; + COMBINE_HIDPI_IMAGES = YES; + CURRENT_PROJECT_VERSION = 1; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + ENABLE_MODULE_VERIFIER = YES; + GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_KEY_NSHumanReadableCopyright = ""; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/../Frameworks", + "@loader_path/Frameworks", + ); + MARKETING_VERSION = 1.0; + MODULE_VERIFIER_SUPPORTED_LANGUAGES = "objective-c objective-c++"; + MODULE_VERIFIER_SUPPORTED_LANGUAGE_STANDARDS = "gnu17 gnu++20"; + PRODUCT_BUNDLE_IDENTIFIER = io.tuist.SynchronizedRootGroups; + PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; + SKIP_INSTALL = YES; + SWIFT_EMIT_LOC_STRINGS = YES; + SWIFT_INSTALL_OBJC_HEADER = NO; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 5.0; + }; + name = Debug; + }; + 6CF05B942C53F5F200EF267F /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUILD_LIBRARY_FOR_DISTRIBUTION = YES; + CLANG_ENABLE_MODULES = YES; + CODE_SIGN_STYLE = Automatic; + COMBINE_HIDPI_IMAGES = YES; + CURRENT_PROJECT_VERSION = 1; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + ENABLE_MODULE_VERIFIER = YES; + GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_KEY_NSHumanReadableCopyright = ""; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/../Frameworks", + "@loader_path/Frameworks", + ); + MARKETING_VERSION = 1.0; + MODULE_VERIFIER_SUPPORTED_LANGUAGES = "objective-c objective-c++"; + MODULE_VERIFIER_SUPPORTED_LANGUAGE_STANDARDS = "gnu17 gnu++20"; + PRODUCT_BUNDLE_IDENTIFIER = io.tuist.SynchronizedRootGroups; + PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; + SKIP_INSTALL = YES; + SWIFT_EMIT_LOC_STRINGS = YES; + SWIFT_INSTALL_OBJC_HEADER = NO; + SWIFT_VERSION = 5.0; + }; + name = Release; + }; + 6CF05B952C53F5F200EF267F /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + CURRENT_PROJECT_VERSION = 1; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + ENABLE_USER_SCRIPT_SANDBOXING = YES; + GCC_C_LANGUAGE_STANDARD = gnu17; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + LOCALIZATION_PREFERS_STRING_CATALOGS = YES; + MACOSX_DEPLOYMENT_TARGET = 14.5; + MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; + MTL_FAST_MATH = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = macosx; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = "DEBUG $(inherited)"; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Debug; + }; + 6CF05B962C53F5F200EF267F /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + CURRENT_PROJECT_VERSION = 1; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_USER_SCRIPT_SANDBOXING = YES; + GCC_C_LANGUAGE_STANDARD = gnu17; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + LOCALIZATION_PREFERS_STRING_CATALOGS = YES; + MACOSX_DEPLOYMENT_TARGET = 14.5; + MTL_ENABLE_DEBUG_INFO = NO; + MTL_FAST_MATH = YES; + SDKROOT = macosx; + SWIFT_COMPILATION_MODE = wholemodule; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 6CF05B862C53F5F200EF267F /* Build configuration list for PBXProject "SynchronizedRootGroups" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 6CF05B952C53F5F200EF267F /* Debug */, + 6CF05B962C53F5F200EF267F /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 6CF05B922C53F5F200EF267F /* Build configuration list for PBXNativeTarget "SynchronizedRootGroups" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 6CF05B932C53F5F200EF267F /* Debug */, + 6CF05B942C53F5F200EF267F /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 6CF05B832C53F5F200EF267F /* Project object */; +} diff --git a/Fixtures/SynchronizedRootGroups/SynchronizedRootGroups.xcodeproj/xcuserdata/pepicrft.xcuserdatad/xcschemes/xcschememanagement.plist b/Fixtures/SynchronizedRootGroups/SynchronizedRootGroups.xcodeproj/xcuserdata/pepicrft.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 000000000..e04d3354a --- /dev/null +++ b/Fixtures/SynchronizedRootGroups/SynchronizedRootGroups.xcodeproj/xcuserdata/pepicrft.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,14 @@ + + + + + SchemeUserState + + SynchronizedRootGroups.xcscheme_^#shared#^_ + + orderHint + 0 + + + + diff --git a/Fixtures/SynchronizedRootGroups/SynchronizedRootGroups/Exception/Exception.swift b/Fixtures/SynchronizedRootGroups/SynchronizedRootGroups/Exception/Exception.swift new file mode 100644 index 000000000..190cf0a74 --- /dev/null +++ b/Fixtures/SynchronizedRootGroups/SynchronizedRootGroups/Exception/Exception.swift @@ -0,0 +1,6 @@ +// +// Exception.swift +// SynchronizedRootGroups +// +// Created by Pedro Piñera Buendía on 26.07.24. +// diff --git a/Fixtures/SynchronizedRootGroups/SynchronizedRootGroups/SynchronizedRootGroups.swift b/Fixtures/SynchronizedRootGroups/SynchronizedRootGroups/SynchronizedRootGroups.swift new file mode 100644 index 000000000..9286b7807 --- /dev/null +++ b/Fixtures/SynchronizedRootGroups/SynchronizedRootGroups/SynchronizedRootGroups.swift @@ -0,0 +1,6 @@ +// +// SynchronizedRootGroups.swift +// SynchronizedRootGroups +// +// Created by Pedro Piñera Buendía on 26.07.24. +// diff --git a/Sources/XcodeProj/Objects/Files/PBXFileSystemSynchronizedBuildFileExceptionSet.swift b/Sources/XcodeProj/Objects/Files/PBXFileSystemSynchronizedBuildFileExceptionSet.swift new file mode 100644 index 000000000..572380cf8 --- /dev/null +++ b/Sources/XcodeProj/Objects/Files/PBXFileSystemSynchronizedBuildFileExceptionSet.swift @@ -0,0 +1,110 @@ +import Foundation + +/// Class representing an element that may contain other elements. +public class PBXFileSystemSynchronizedBuildFileExceptionSet: PBXObject, PlistSerializable { + // MARK: - Attributes + + /// A list of relative paths to children subfolders for which exceptions are applied. + public var membershipExceptions: [String]? + + /// Changes the default header visibility (project) to public for the following headers. + /// Every item in the list is the relative path inside the root synchronized group. + public var publicHeaders: [String]? + + /// Changes the default header visibility (project) to private for the following headers. + /// Every item in the list is the relative path inside the root synchronized group. + public var privateHeaders: [String]? + + /// Additional compiler flags by relative path. + /// Every item in the list is the relative path inside the root synchronized group. + /// The value is the additional compiler flags. + public var additionalCompilerFlagsByRelativePath: [String: String]? + + /// Attributes by relative path. + /// Every item in the list is the relative path inside the root synchronized group. + /// This is used for example when linking frameworks to specify that they are optional with the attribute "Weak" + public var attributesByRelativePath: [String: [String]]? + + var targetReference: PBXObjectReference + + public var target: PBXTarget! { + get { + targetReference.getObject() as? PBXTarget + } + set { + targetReference = newValue.reference + } + } + + // MARK: - Init + + public init(target: PBXTarget, membershipExceptions: [String]?, publicHeaders: [String]?, privateHeaders: [String]?, additionalCompilerFlagsByRelativePath: [String: String]?, attributesByRelativePath: [String: [String]]?) { + targetReference = target.reference + self.membershipExceptions = membershipExceptions + self.publicHeaders = publicHeaders + self.privateHeaders = privateHeaders + self.additionalCompilerFlagsByRelativePath = additionalCompilerFlagsByRelativePath + self.attributesByRelativePath = attributesByRelativePath + super.init() + } + + // MARK: - Decodable + + fileprivate enum CodingKeys: String, CodingKey { + case target + case membershipExceptions + case publicHeaders + case privateHeaders + case additionalCompilerFlagsByRelativePath + case attributesByRelativePath + } + + public required init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + let referenceRepository = decoder.context.objectReferenceRepository + let objects = decoder.context.objects + let targetReference: String = try container.decode(.target) + self.targetReference = referenceRepository.getOrCreate(reference: targetReference, objects: objects) + membershipExceptions = try container.decodeIfPresent(.membershipExceptions) + publicHeaders = try container.decodeIfPresent(.publicHeaders) + privateHeaders = try container.decodeIfPresent(.privateHeaders) + additionalCompilerFlagsByRelativePath = try container.decodeIfPresent(.additionalCompilerFlagsByRelativePath) + attributesByRelativePath = try container.decodeIfPresent(.attributesByRelativePath) + try super.init(from: decoder) + } + + // MARK: - Equatable + + override func isEqual(to object: Any?) -> Bool { + guard let rhs = object as? PBXFileSystemSynchronizedBuildFileExceptionSet else { return false } + return isEqual(to: rhs) + } + + // MARK: - PlistSerializable + + func plistKeyAndValue(proj _: PBXProj, reference: String) throws -> (key: CommentedString, value: PlistValue) { + var dictionary: [CommentedString: PlistValue] = [:] + dictionary["isa"] = .string(CommentedString(PBXFileSystemSynchronizedBuildFileExceptionSet.isa)) + if let membershipExceptions { + dictionary["membershipExceptions"] = .array(membershipExceptions.map { .string(CommentedString($0)) }) + } + if let publicHeaders { + dictionary["publicHeaders"] = .array(publicHeaders.map { .string(CommentedString($0)) }) + } + if let privateHeaders { + dictionary["privateHeaders"] = .array(privateHeaders.map { .string(CommentedString($0)) }) + } + if let additionalCompilerFlagsByRelativePath { + dictionary["additionalCompilerFlagsByRelativePath"] = .dictionary(Dictionary(uniqueKeysWithValues: additionalCompilerFlagsByRelativePath.map { key, value in + (CommentedString(key), PlistValue.string(CommentedString(value))) + })) + } + if let attributesByRelativePath { + dictionary["attributesByRelativePath"] = .dictionary(Dictionary(uniqueKeysWithValues: attributesByRelativePath.map { key, value in + (CommentedString(key), .array(value.map { .string(CommentedString($0)) })) + })) + } + dictionary["target"] = .string(CommentedString(target.reference.value, comment: target.name)) + return (key: CommentedString(reference, comment: "PBXFileSystemSynchronizedBuildFileExceptionSet"), value: .dictionary(dictionary)) + } +} diff --git a/Sources/XcodeProj/Objects/Files/PBXFileSystemSynchronizedRootGroup.swift b/Sources/XcodeProj/Objects/Files/PBXFileSystemSynchronizedRootGroup.swift new file mode 100644 index 000000000..5df7fe342 --- /dev/null +++ b/Sources/XcodeProj/Objects/Files/PBXFileSystemSynchronizedRootGroup.swift @@ -0,0 +1,109 @@ +import Foundation +import PathKit + +public class PBXFileSystemSynchronizedRootGroup: PBXFileElement { + /// It maps relative paths inside the synchronized root group to a particular file type. + /// If a path doesn't have a particular file type specified, Xcode defaults to the default file type + /// based on the extension of the file. + public var explicitFileTypes: [String: String] + + /// Returns the references of the exceptions. + var exceptionsReferences: [PBXObjectReference]? + + /// It returns a list of exception objects that override the configuration for some children + /// in the synchronized root group. + public var exceptions: [PBXFileSystemSynchronizedBuildFileExceptionSet]? { + set { + exceptionsReferences = newValue?.references() + } + get { + exceptionsReferences?.objects() + } + } + + /// A list of relative paths to children folder whose configuration is overriden. + public var explicitFolders: [String] + + /// Initializes the file element with its properties. + /// + /// - Parameters: + /// - sourceTree: file source tree. + /// - path: object relative path from `sourceTree`, if different than `name`. + /// - name: object name. + /// - includeInIndex: should the IDE index the object? + /// - usesTabs: object uses tabs. + /// - indentWidth: the number of positions to indent blocks of code + /// - tabWidth: the visual width of tab characters + /// - wrapsLines: should the IDE wrap lines when editing the object? + /// - explicitFileTypes: It maps relative paths inside the synchronized root group to a particular file type. + /// - exceptions: It returns a list of exception objects that override the configuration for some children in the synchronized root group. + /// - explicitFolders: A list of relative paths to children folder whose configuration is overriden. + public init(sourceTree: PBXSourceTree? = nil, + path: String? = nil, + name: String? = nil, + includeInIndex: Bool? = nil, + usesTabs: Bool? = nil, + indentWidth: UInt? = nil, + tabWidth: UInt? = nil, + wrapsLines: Bool? = nil, + explicitFileTypes: [String: String] = [:], + exceptions: [PBXFileSystemSynchronizedBuildFileExceptionSet] = [], + explicitFolders: [String] = []) { + self.explicitFileTypes = explicitFileTypes + exceptionsReferences = exceptions.references() + self.explicitFolders = explicitFolders + super.init(sourceTree: sourceTree, + path: path, + name: name, + includeInIndex: includeInIndex, + usesTabs: usesTabs, + indentWidth: indentWidth, + tabWidth: tabWidth, + wrapsLines: wrapsLines) + } + + // MARK: - Decodable + + fileprivate enum CodingKeys: String, CodingKey { + case explicitFileTypes + case exceptions + case explicitFolders + } + + public required init(from decoder: Decoder) throws { + let objects = decoder.context.objects + let objectReferenceRepository = decoder.context.objectReferenceRepository + let container = try decoder.container(keyedBy: CodingKeys.self) + explicitFileTypes = try (container.decodeIfPresent(.explicitFileTypes)) ?? [:] + let exceptionsReferences: [String] = try (container.decodeIfPresent(.exceptions)) ?? [] + self.exceptionsReferences = exceptionsReferences.map { objectReferenceRepository.getOrCreate(reference: $0, objects: objects) } + explicitFolders = try (container.decodeIfPresent(.explicitFolders)) ?? [] + try super.init(from: decoder) + } + + // MARK: - PlistSerializable + + override var multiline: Bool { false } + + override func plistKeyAndValue(proj: PBXProj, reference: String) throws -> (key: CommentedString, value: PlistValue) { + var dictionary: [CommentedString: PlistValue] = try super.plistKeyAndValue(proj: proj, reference: reference).value.dictionary ?? [:] + dictionary["isa"] = .string(CommentedString(type(of: self).isa)) + if let exceptionsReferences, !exceptionsReferences.isEmpty { + dictionary["exceptions"] = .array(exceptionsReferences.map { exceptionReference in + .string(CommentedString(exceptionReference.value, comment: "PBXFileSystemSynchronizedBuildFileExceptionSet")) + }) + } + dictionary["explicitFileTypes"] = .dictionary(Dictionary(uniqueKeysWithValues: explicitFileTypes.map { relativePath, fileType in + (CommentedString(relativePath), .string(CommentedString(fileType))) + })) + dictionary["explicitFolders"] = .array(explicitFolders.map { .string(CommentedString($0)) }) + return (key: CommentedString(reference, + comment: name ?? path), + value: .dictionary(dictionary)) + } + + override func isEqual(to object: Any?) -> Bool { + guard let rhs = object as? PBXFileSystemSynchronizedRootGroup else { return false } + return isEqual(to: rhs) + } +} diff --git a/Sources/XcodeProj/Objects/Files/PBXGroup.swift b/Sources/XcodeProj/Objects/Files/PBXGroup.swift index 05cece653..8b8d2814b 100644 --- a/Sources/XcodeProj/Objects/Files/PBXGroup.swift +++ b/Sources/XcodeProj/Objects/Files/PBXGroup.swift @@ -116,6 +116,16 @@ public extension PBXGroup { .first(where: { $0.name == name }) } + /// Returns the synchronized root group with the given name contained in the given parent group. + /// + /// - Parameter groupName: group name. + /// - Returns: the synchronized root group with the given name contained in the given parent group. + func synchronizedRootGroup(named name: String) -> PBXFileSystemSynchronizedRootGroup? { + childrenReferences + .objects() + .first(where: { $0.name == name }) + } + /// Returns the file in the group with the given name. /// /// - Parameter name: file name. diff --git a/Sources/XcodeProj/Objects/Project/PBXObjectParser.swift b/Sources/XcodeProj/Objects/Project/PBXObjectParser.swift index ef80d0466..3c0ad0044 100644 --- a/Sources/XcodeProj/Objects/Project/PBXObjectParser.swift +++ b/Sources/XcodeProj/Objects/Project/PBXObjectParser.swift @@ -68,6 +68,10 @@ final class PBXObjectParser { return try decoder.decode(XCLocalSwiftPackageReference.self, from: data) case XCSwiftPackageProductDependency.isa: return try decoder.decode(XCSwiftPackageProductDependency.self, from: data) + case PBXFileSystemSynchronizedRootGroup.isa: + return try decoder.decode(PBXFileSystemSynchronizedRootGroup.self, from: data) + case PBXFileSystemSynchronizedBuildFileExceptionSet.isa: + return try decoder.decode(PBXFileSystemSynchronizedBuildFileExceptionSet.self, from: data) default: throw PBXObjectError.unknownElement(isa) } diff --git a/Sources/XcodeProj/Objects/Project/PBXObjects.swift b/Sources/XcodeProj/Objects/Project/PBXObjects.swift index 5fbf74e1a..22cfe75cd 100644 --- a/Sources/XcodeProj/Objects/Project/PBXObjects.swift +++ b/Sources/XcodeProj/Objects/Project/PBXObjects.swift @@ -135,6 +135,16 @@ class PBXObjects: Equatable { lock.whileLocked { _swiftPackageProductDependencies } } + private var _fileSystemSynchronizedRootGroups: [PBXObjectReference: PBXFileSystemSynchronizedRootGroup] = [:] + var fileSystemSynchronizedRootGroups: [PBXObjectReference: PBXFileSystemSynchronizedRootGroup] { + lock.whileLocked { _fileSystemSynchronizedRootGroups } + } + + private var _fileSystemSynchronizedBuildFileExceptionSets: [PBXObjectReference: PBXFileSystemSynchronizedBuildFileExceptionSet] = [:] + var fileSystemSynchronizedBuildFileExceptionSets: [PBXObjectReference: PBXFileSystemSynchronizedBuildFileExceptionSet] { + lock.whileLocked { _fileSystemSynchronizedBuildFileExceptionSets } + } + // XCSwiftPackageProductDependency /// Initializes the project objects container @@ -173,7 +183,9 @@ class PBXObjects: Equatable { lhs.carbonResourcesBuildPhases == rhs.carbonResourcesBuildPhases && lhs.buildRules == rhs.buildRules && lhs.swiftPackageProductDependencies == rhs._swiftPackageProductDependencies && - lhs.remoteSwiftPackageReferences == rhs.remoteSwiftPackageReferences + lhs.remoteSwiftPackageReferences == rhs.remoteSwiftPackageReferences && + lhs.fileSystemSynchronizedRootGroups == rhs.fileSystemSynchronizedRootGroups && + lhs.fileSystemSynchronizedBuildFileExceptionSets == rhs.fileSystemSynchronizedBuildFileExceptionSets } // MARK: - Helpers @@ -218,6 +230,8 @@ class PBXObjects: Equatable { case let object as XCRemoteSwiftPackageReference: _remoteSwiftPackageReferences[objectReference] = object case let object as XCLocalSwiftPackageReference: _localSwiftPackageReferences[objectReference] = object case let object as XCSwiftPackageProductDependency: _swiftPackageProductDependencies[objectReference] = object + case let object as PBXFileSystemSynchronizedRootGroup: _fileSystemSynchronizedRootGroups[objectReference] = object + case let object as PBXFileSystemSynchronizedBuildFileExceptionSet: _fileSystemSynchronizedBuildFileExceptionSets[objectReference] = object default: fatalError("Unhandled PBXObject type for \(object), this is likely a bug / todo") } } @@ -278,7 +292,12 @@ class PBXObjects: Equatable { return _remoteSwiftPackageReferences.remove(at: index).value } else if let index = swiftPackageProductDependencies.index(forKey: reference) { return _swiftPackageProductDependencies.remove(at: index).value + } else if let index = fileSystemSynchronizedRootGroups.index(forKey: reference) { + return _fileSystemSynchronizedRootGroups.remove(at: index).value + } else if let index = fileSystemSynchronizedBuildFileExceptionSets.index(forKey: reference) { + return _fileSystemSynchronizedBuildFileExceptionSets.remove(at: index).value } + return nil } @@ -340,6 +359,10 @@ class PBXObjects: Equatable { return object } else if let object = swiftPackageProductDependencies[reference] { return object + } else if let object = fileSystemSynchronizedRootGroups[reference] { + return object + } else if let object = fileSystemSynchronizedBuildFileExceptionSets[reference] { + return object } else { return nil } @@ -431,5 +454,7 @@ extension PBXObjects { carbonResourcesBuildPhases.values.forEach(closure) remoteSwiftPackageReferences.values.forEach(closure) swiftPackageProductDependencies.values.forEach(closure) + fileSystemSynchronizedRootGroups.values.forEach(closure) + fileSystemSynchronizedBuildFileExceptionSets.values.forEach(closure) } } diff --git a/Sources/XcodeProj/Objects/Project/PBXProjEncoder.swift b/Sources/XcodeProj/Objects/Project/PBXProjEncoder.swift index 9b0dd2f26..9ee78300c 100644 --- a/Sources/XcodeProj/Objects/Project/PBXProjEncoder.swift +++ b/Sources/XcodeProj/Objects/Project/PBXProjEncoder.swift @@ -113,6 +113,18 @@ final class PBXProjEncoder { outputSettings: outputSettings, stateHolder: &stateHolder, to: &output) + try write(section: "PBXFileSystemSynchronizedBuildFileExceptionSet", + proj: proj, + objects: proj.objects.fileSystemSynchronizedBuildFileExceptionSets, + outputSettings: outputSettings, + stateHolder: &stateHolder, + to: &output) + try write(section: "PBXFileSystemSynchronizedRootGroup", + proj: proj, + objects: proj.objects.fileSystemSynchronizedRootGroups, + outputSettings: outputSettings, + stateHolder: &stateHolder, + to: &output) try write(section: "PBXFrameworksBuildPhase", proj: proj, objects: proj.objects.frameworksBuildPhases, diff --git a/Sources/XcodeProj/Objects/Project/PBXProject.swift b/Sources/XcodeProj/Objects/Project/PBXProject.swift index 79a3e1485..378309da8 100644 --- a/Sources/XcodeProj/Objects/Project/PBXProject.swift +++ b/Sources/XcodeProj/Objects/Project/PBXProject.swift @@ -443,7 +443,7 @@ extension PBXProject { productDependency = XCSwiftPackageProductDependency(productName: productName, package: reference) objects.add(object: productDependency) } - target.packageProductDependencies.append(productDependency) + target.packageProductDependencies?.append(productDependency) return productDependency } @@ -465,7 +465,7 @@ extension PBXProject { productDependency = XCSwiftPackageProductDependency(productName: productName) objects.add(object: productDependency) } - target.packageProductDependencies.append(productDependency) + target.packageProductDependencies?.append(productDependency) return productDependency } diff --git a/Sources/XcodeProj/Objects/Sourcery/Equality.generated.swift b/Sources/XcodeProj/Objects/Sourcery/Equality.generated.swift index c20d93c20..4c9a1d98c 100644 --- a/Sources/XcodeProj/Objects/Sourcery/Equality.generated.swift +++ b/Sources/XcodeProj/Objects/Sourcery/Equality.generated.swift @@ -301,3 +301,24 @@ extension XCVersionGroup { return super.isEqual(to: rhs) } } + +extension PBXFileSystemSynchronizedRootGroup { + /// :nodoc: + func isEqual(to rhs: PBXFileSystemSynchronizedRootGroup) -> Bool { + if explicitFileTypes != rhs.explicitFileTypes { return false } + if exceptionsReferences != rhs.exceptionsReferences { return false } + if explicitFolders != rhs.explicitFolders { return false } + return super.isEqual(to: rhs) + } +} + +extension PBXFileSystemSynchronizedBuildFileExceptionSet { + /// :nodoc: + func isEqual(to rhs: PBXFileSystemSynchronizedBuildFileExceptionSet) -> Bool { + if membershipExceptions != rhs.membershipExceptions { return false } + if targetReference != rhs.targetReference { return false } + if publicHeaders != rhs.publicHeaders { return false } + if privateHeaders != rhs.privateHeaders { return false } + return super.isEqual(to: rhs) + } +} diff --git a/Sources/XcodeProj/Objects/Targets/PBXTarget.swift b/Sources/XcodeProj/Objects/Targets/PBXTarget.swift index 86646cfd8..b23e0b47f 100644 --- a/Sources/XcodeProj/Objects/Targets/PBXTarget.swift +++ b/Sources/XcodeProj/Objects/Targets/PBXTarget.swift @@ -76,15 +76,28 @@ public class PBXTarget: PBXContainerItem { } /// Swift package product references. - var packageProductDependencyReferences: [PBXObjectReference] + var packageProductDependencyReferences: [PBXObjectReference]? /// Swift packages products. - public var packageProductDependencies: [XCSwiftPackageProductDependency] { + public var packageProductDependencies: [XCSwiftPackageProductDependency]? { set { - packageProductDependencyReferences = newValue.references() + packageProductDependencyReferences = newValue?.references() } get { - packageProductDependencyReferences.objects() + packageProductDependencyReferences?.objects() + } + } + + // File system synchronized groups references. + var fileSystemSynchronizedGroupsReferences: [PBXObjectReference]? + + // File system synchronized groups. + public var fileSystemSynchronizedGroups: [PBXFileSystemSynchronizedRootGroup]? { + set { + fileSystemSynchronizedGroupsReferences = newValue?.references() + } + get { + fileSystemSynchronizedGroupsReferences?.objects() } } @@ -110,12 +123,14 @@ public class PBXTarget: PBXContainerItem { packageProductDependencies: [XCSwiftPackageProductDependency] = [], productName: String? = nil, product: PBXFileReference? = nil, - productType: PBXProductType? = nil) { + productType: PBXProductType? = nil, + fileSystemSynchronizedGroups: [PBXFileSystemSynchronizedRootGroup]? = nil) { buildConfigurationListReference = buildConfigurationList?.reference buildPhaseReferences = buildPhases.references() buildRuleReferences = buildRules.references() dependencyReferences = dependencies.references() packageProductDependencyReferences = packageProductDependencies.references() + fileSystemSynchronizedGroupsReferences = fileSystemSynchronizedGroups?.references() self.name = name self.productName = productName productReference = product?.reference @@ -135,6 +150,7 @@ public class PBXTarget: PBXContainerItem { case productReference case productType case packageProductDependencies + case fileSystemSynchronizedGroups } public required init(from decoder: Decoder) throws { @@ -160,12 +176,21 @@ public class PBXTarget: PBXContainerItem { } else { productReference = nil } - - let packageProductDependencyReferenceStrings: [String] = try container.decodeIfPresent(.packageProductDependencies) ?? [] - packageProductDependencyReferences = packageProductDependencyReferenceStrings.map { - objectReferenceRepository.getOrCreate(reference: $0, objects: objects) + let packageProductDependencyReferenceStrings: [String]? = try container.decodeIfPresent(.packageProductDependencies) + if let packageProductDependencyReferenceStrings { + packageProductDependencyReferences = packageProductDependencyReferenceStrings.map { + objectReferenceRepository.getOrCreate(reference: $0, objects: objects) + } + } else { + packageProductDependencyReferences = nil } + let fileSystemSynchronizedGroupsReferences: [String]? = try container.decodeIfPresent(.fileSystemSynchronizedGroups) + if let fileSystemSynchronizedGroupsReferences { + self.fileSystemSynchronizedGroupsReferences = fileSystemSynchronizedGroupsReferences.map { + objectReferenceRepository.getOrCreate(reference: $0, objects: objects) + } + } productType = try container.decodeIfPresent(.productType) try super.init(from: decoder) } @@ -190,6 +215,13 @@ public class PBXTarget: PBXContainerItem { } dictionary["dependencies"] = .array(dependencyReferences.map { .string(CommentedString($0.value, comment: PBXTargetDependency.isa)) }) + if let fileSystemSynchronizedGroupsReferences { + dictionary["fileSystemSynchronizedGroups"] = .array(fileSystemSynchronizedGroupsReferences.map { fileSystemSynchronizedGroupReference in + let fileSystemSynchronizedGroup: PBXFileSystemSynchronizedRootGroup? = fileSystemSynchronizedGroupReference.getObject() + return .string(CommentedString(fileSystemSynchronizedGroupReference.value, comment: fileSystemSynchronizedGroup?.path)) + }) + } + dictionary["name"] = .string(CommentedString(name)) if let productName { dictionary["productName"] = .string(CommentedString(productName)) @@ -201,11 +233,12 @@ public class PBXTarget: PBXContainerItem { let fileElement: PBXFileElement? = productReference.getObject() dictionary["productReference"] = .string(CommentedString(productReference.value, comment: fileElement?.fileName())) } - if !packageProductDependencies.isEmpty { + if let packageProductDependencies { dictionary["packageProductDependencies"] = .array(packageProductDependencies.map { PlistValue.string(.init($0.reference.value, comment: $0.productName)) }) } + return (key: CommentedString(reference, comment: name), value: .dictionary(dictionary)) } diff --git a/Sources/XcodeProj/Utils/ReferenceGenerator.swift b/Sources/XcodeProj/Utils/ReferenceGenerator.swift index 823c582bd..a098c8298 100644 --- a/Sources/XcodeProj/Utils/ReferenceGenerator.swift +++ b/Sources/XcodeProj/Utils/ReferenceGenerator.swift @@ -100,7 +100,7 @@ final class ReferenceGenerator: ReferenceGenerating { identifiers.append(target.name) // Packages - for packageProductDependency in target.packageProductDependencies { + target.packageProductDependencies?.forEach { packageProductDependency in var identifiers = identifiers identifiers.append(packageProductDependency.productName) fixReference(for: packageProductDependency, identifiers: identifiers) diff --git a/Tests/XcodeProjTests/Objects/Files/PBXFileSystemSynchronizedBuildFileExceptionSet+Fixtures.swift b/Tests/XcodeProjTests/Objects/Files/PBXFileSystemSynchronizedBuildFileExceptionSet+Fixtures.swift new file mode 100644 index 000000000..17e0b1f0d --- /dev/null +++ b/Tests/XcodeProjTests/Objects/Files/PBXFileSystemSynchronizedBuildFileExceptionSet+Fixtures.swift @@ -0,0 +1,17 @@ +import XcodeProj + +extension PBXFileSystemSynchronizedBuildFileExceptionSet { + static func fixture(target: PBXTarget = .fixture(), + membershipExceptions: [String]? = [], + publicHeaders: [String]? = [], + privateHeaders: [String]? = [], + additionalCompilerFlagsByRelativePath: [String: String]? = nil, + attributesByRelativePath: [String: [String]]? = nil) -> PBXFileSystemSynchronizedBuildFileExceptionSet { + PBXFileSystemSynchronizedBuildFileExceptionSet(target: target, + membershipExceptions: membershipExceptions, + publicHeaders: publicHeaders, + privateHeaders: privateHeaders, + additionalCompilerFlagsByRelativePath: additionalCompilerFlagsByRelativePath, + attributesByRelativePath: attributesByRelativePath) + } +} diff --git a/Tests/XcodeProjTests/Objects/Files/PBXFileSystemSynchronizedBuildFileExceptionSetTests.swift b/Tests/XcodeProjTests/Objects/Files/PBXFileSystemSynchronizedBuildFileExceptionSetTests.swift new file mode 100644 index 000000000..842954846 --- /dev/null +++ b/Tests/XcodeProjTests/Objects/Files/PBXFileSystemSynchronizedBuildFileExceptionSetTests.swift @@ -0,0 +1,29 @@ +import Foundation +import XCTest +@testable import XcodeProj + +final class PBXFileSystemSynchronizedBuildFileExceptionSetTests: XCTestCase { + var target: PBXTarget! + var subject: PBXFileSystemSynchronizedBuildFileExceptionSet! + + override func setUp() { + super.setUp() + target = PBXTarget.fixture() + subject = PBXFileSystemSynchronizedBuildFileExceptionSet.fixture(target: target) + } + + override func tearDown() { + target = nil + subject = nil + super.tearDown() + } + + func test_itHasTheCorrectIsa() { + XCTAssertEqual(PBXFileSystemSynchronizedBuildFileExceptionSet.isa, "PBXFileSystemSynchronizedBuildFileExceptionSet") + } + + func test_equal_returnsTheCorrectValue() { + let another = PBXFileSystemSynchronizedBuildFileExceptionSet.fixture(target: target) + XCTAssertEqual(subject, another) + } +} diff --git a/Tests/XcodeProjTests/Objects/Files/PBXFileSystemSynchronizedRootGroup+Fixtures.swift b/Tests/XcodeProjTests/Objects/Files/PBXFileSystemSynchronizedRootGroup+Fixtures.swift new file mode 100644 index 000000000..c4eabf4f7 --- /dev/null +++ b/Tests/XcodeProjTests/Objects/Files/PBXFileSystemSynchronizedRootGroup+Fixtures.swift @@ -0,0 +1,27 @@ +import XcodeProj + +extension PBXFileSystemSynchronizedRootGroup { + static func fixture(sourceTree: PBXSourceTree? = nil, + path: String? = nil, + name: String? = nil, + includeInIndex: Bool? = nil, + usesTabs: Bool? = nil, + indentWidth: UInt? = nil, + tabWidth: UInt? = nil, + wrapsLines: Bool? = nil, + explicitFileTypes: [String: String] = [:], + exceptions: [PBXFileSystemSynchronizedBuildFileExceptionSet] = [], + explicitFolders: [String] = []) -> PBXFileSystemSynchronizedRootGroup { + PBXFileSystemSynchronizedRootGroup(sourceTree: sourceTree, + path: path, + name: name, + includeInIndex: includeInIndex, + usesTabs: usesTabs, + indentWidth: indentWidth, + tabWidth: tabWidth, + wrapsLines: wrapsLines, + explicitFileTypes: explicitFileTypes, + exceptions: exceptions, + explicitFolders: explicitFolders) + } +} diff --git a/Tests/XcodeProjTests/Objects/Files/PBXFileSystemSynchronizedRootGroupTests.swift b/Tests/XcodeProjTests/Objects/Files/PBXFileSystemSynchronizedRootGroupTests.swift new file mode 100644 index 000000000..374156104 --- /dev/null +++ b/Tests/XcodeProjTests/Objects/Files/PBXFileSystemSynchronizedRootGroupTests.swift @@ -0,0 +1,51 @@ +import Foundation +import XCTest +@testable import XcodeProj + +final class PBXFileSystemSynchronizedRootGroupTests: XCTestCase { + var subject: PBXFileSystemSynchronizedRootGroup! + var target: PBXTarget! + var exception: PBXFileSystemSynchronizedBuildFileExceptionSet! + + override func setUp() { + super.setUp() + target = PBXTarget.fixture() + exception = PBXFileSystemSynchronizedBuildFileExceptionSet.fixture(target: target) + subject = PBXFileSystemSynchronizedRootGroup(sourceTree: .group, + path: "synchronized", + name: "synchronized", + includeInIndex: true, + usesTabs: true, + indentWidth: 2, + tabWidth: 2, + wrapsLines: true, + explicitFileTypes: ["Source.m": "sourcecode.c.objc"], + exceptions: [exception], + explicitFolders: []) + } + + override func tearDown() { + exception = nil + subject = nil + super.tearDown() + } + + func test_itHasTheCorrectIsa() { + XCTAssertEqual(PBXFileSystemSynchronizedRootGroup.isa, "PBXFileSystemSynchronizedRootGroup") + } + + func test_equal_returnsTheCorrectValue() { + let another = PBXFileSystemSynchronizedRootGroup(sourceTree: .group, + path: "synchronized", + name: "synchronized", + includeInIndex: true, + usesTabs: true, + indentWidth: 2, + tabWidth: 2, + wrapsLines: true, + explicitFileTypes: ["Source.m": "sourcecode.c.objc"], + exceptions: [exception], + explicitFolders: []) + XCTAssertEqual(subject, another) + } +} diff --git a/Tests/XcodeProjTests/Objects/Project/PBXProjEncoderTests.swift b/Tests/XcodeProjTests/Objects/Project/PBXProjEncoderTests.swift index d60e08380..9ff5e3cbc 100644 --- a/Tests/XcodeProjTests/Objects/Project/PBXProjEncoderTests.swift +++ b/Tests/XcodeProjTests/Objects/Project/PBXProjEncoderTests.swift @@ -285,6 +285,38 @@ class PBXProjEncoderTests: XCTestCase { lines.validate(line: ");", after: line) } + // MARK: - File system synchronized root groups + + func test_fileSystemSynchronizedRootGroups_when_projectWithFileSystemSynchronizedRootGroups() throws { + // Given + try loadSynchronizedRootGroups() + let settings = PBXOutputSettings(projNavigatorFileOrder: .byFilenameGroupsFirst) + let lines = lines(fromFile: encodeProject(settings: settings)) + + let beginGroup = lines.findLine("/* Begin PBXFileSystemSynchronizedRootGroup section */") + var line = lines.validate(line: "6CF05B9D2C53F64800EF267F /* SynchronizedRootGroups */ = {isa = PBXFileSystemSynchronizedRootGroup; exceptions = (6CF05BA32C53F97F00EF267F /* PBXFileSystemSynchronizedBuildFileExceptionSet */, ); explicitFileTypes = {}; explicitFolders = (); path = SynchronizedRootGroups; sourceTree = \"\"; };", after: beginGroup) + line = lines.validate(line: "/* End PBXFileSystemSynchronizedRootGroup section */", after: line) + } + + // MARK: - File system synchronized build file exception set + + func test_fileSystemSynchronizedBuildFileExceptionSets_when_projectWithFileSystemSynchronizedRootGroups() throws { + // Given + try loadSynchronizedRootGroups() + let settings = PBXOutputSettings(projNavigatorFileOrder: .byFilenameGroupsFirst) + let lines = lines(fromFile: encodeProject(settings: settings)) + + let beginGroup = lines.findLine("/* Begin PBXFileSystemSynchronizedBuildFileExceptionSet section */") + var line = lines.validate(line: "6CF05BA32C53F97F00EF267F /* PBXFileSystemSynchronizedBuildFileExceptionSet */ = {", after: beginGroup) + line = lines.validate(line: "isa = PBXFileSystemSynchronizedBuildFileExceptionSet;", after: line) + line = lines.validate(line: "membershipExceptions = (", after: line) + line = lines.validate(line: "Exception/Exception.swift,", after: line) + line = lines.validate(line: ");", after: line) + line = lines.validate(line: "target = 6CF05B8B2C53F5F200EF267F /* SynchronizedRootGroups */;", after: line) + line = lines.validate(line: "};", after: line) + line = lines.validate(line: "/* End PBXFileSystemSynchronizedBuildFileExceptionSet section */", after: line) + } + // MARK: - Build phases func test_build_phase_sources_unsorted_when_iOSProject() throws { @@ -457,6 +489,10 @@ class PBXProjEncoderTests: XCTestCase { proj = try PBXProj(jsonDictionary: iosProjectDictionary().1) } + private func loadSynchronizedRootGroups() throws { + proj = try PBXProj(jsonDictionary: synchronizedRootGroupsFixture().1) + } + private func loadFileSharedAcrossTargetsProject() throws { proj = try PBXProj(jsonDictionary: fileSharedAcrossTargetsDictionary().1) } diff --git a/Tests/XcodeProjTests/Objects/Project/PBXProjectTests.swift b/Tests/XcodeProjTests/Objects/Project/PBXProjectTests.swift index f2b9e0912..5a343bfec 100644 --- a/Tests/XcodeProjTests/Objects/Project/PBXProjectTests.swift +++ b/Tests/XcodeProjTests/Objects/Project/PBXProjectTests.swift @@ -67,7 +67,7 @@ final class PBXProjectTests: XCTestCase { // Then XCTAssertEqual(packageProduct, objects.buildFiles.first?.value.product) XCTAssertEqual(packageProduct, objects.swiftPackageProductDependencies.first?.value) - XCTAssertEqual(packageProduct, target.packageProductDependencies.first) + XCTAssertEqual(packageProduct, target.packageProductDependencies?.first) XCTAssertEqual(objects.fileReferences.first?.value.name, "Product") @@ -240,8 +240,8 @@ final class PBXProjectTests: XCTestCase { XCTAssertEqual(packageProduct, secondPackageProduct) XCTAssertEqual(packageProduct, thirdPackageProduct) XCTAssertEqual(project.remotePackages.count, 1) - XCTAssertEqual(target.packageProductDependencies.count, 2) - XCTAssertEqual(secondTarget.packageProductDependencies.count, 1) + XCTAssertEqual(target.packageProductDependencies?.count, 2) + XCTAssertEqual(secondTarget.packageProductDependencies?.count, 1) XCTAssertNotEqual(buildPhase.files?.first?.hashValue, secondBuildPhase.files?.first?.hashValue) XCTAssertEqual(objects.swiftPackageProductDependencies.count, 2) diff --git a/Tests/XcodeProjTests/Project/XcodeProjTests.swift b/Tests/XcodeProjTests/Project/XcodeProjIntegrationTests.swift similarity index 89% rename from Tests/XcodeProjTests/Project/XcodeProjTests.swift rename to Tests/XcodeProjTests/Project/XcodeProjIntegrationTests.swift index 424767edd..8bcb72580 100644 --- a/Tests/XcodeProjTests/Project/XcodeProjTests.swift +++ b/Tests/XcodeProjTests/Project/XcodeProjIntegrationTests.swift @@ -25,6 +25,11 @@ final class XcodeProjIntegrationTests: XCTestCase { initModel: XcodeProj.init(path:)) } + func test_read_write_produces_no_diff_when_synchronizedRootGroupsFixture() throws { + try testReadWriteProducesNoDiff(from: synchronizedRootGroupsFixturePath, + initModel: XcodeProj.init(path:)) + } + func test_initialize_PBXProj_with_data() throws { // Given let pbxprojPath = iosProjectPath + "project.pbxproj" @@ -90,4 +95,8 @@ final class XcodeProjIntegrationTests: XCTestCase { private var iosProjectPath: Path { fixturesPath() + "iOS/Project.xcodeproj" } + + private var synchronizedRootGroupsFixturePath: Path { + fixturesPath() + "SynchronizedRootGroups/SynchronizedRootGroups.xcodeproj" + } } diff --git a/Tests/XcodeProjTests/Tests/Fixtures.swift b/Tests/XcodeProjTests/Tests/Fixtures.swift index 40cc343f9..edb724a5b 100644 --- a/Tests/XcodeProjTests/Tests/Fixtures.swift +++ b/Tests/XcodeProjTests/Tests/Fixtures.swift @@ -6,6 +6,11 @@ func fixturesPath() -> Path { Path(#file).parent().parent().parent().parent() + "Fixtures" } +func synchronizedRootGroupsFixture() -> (Path, [String: Any]) { + let iosProject = fixturesPath() + "SynchronizedRootGroups/SynchronizedRootGroups.xcodeproj/project.pbxproj" + return (iosProject, loadPlist(path: iosProject.string)!) +} + func iosProjectDictionary() -> (Path, [String: Any]) { let iosProject = fixturesPath() + "iOS/Project.xcodeproj/project.pbxproj" return (iosProject, loadPlist(path: iosProject.string)!) From dc0380c75a04a0288be080d7e3e6a95f2c9f1a46 Mon Sep 17 00:00:00 2001 From: Pedro Date: Sat, 10 Aug 2024 18:28:29 +0200 Subject: [PATCH 338/678] Fix linting workflow --- .../PBXFileSystemSynchronizedBuildFileExceptionSet.swift | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Sources/XcodeProj/Objects/Files/PBXFileSystemSynchronizedBuildFileExceptionSet.swift b/Sources/XcodeProj/Objects/Files/PBXFileSystemSynchronizedBuildFileExceptionSet.swift index 572380cf8..4f363322a 100644 --- a/Sources/XcodeProj/Objects/Files/PBXFileSystemSynchronizedBuildFileExceptionSet.swift +++ b/Sources/XcodeProj/Objects/Files/PBXFileSystemSynchronizedBuildFileExceptionSet.swift @@ -38,7 +38,12 @@ public class PBXFileSystemSynchronizedBuildFileExceptionSet: PBXObject, PlistSer // MARK: - Init - public init(target: PBXTarget, membershipExceptions: [String]?, publicHeaders: [String]?, privateHeaders: [String]?, additionalCompilerFlagsByRelativePath: [String: String]?, attributesByRelativePath: [String: [String]]?) { + public init(target: PBXTarget, + membershipExceptions: [String]?, + publicHeaders: [String]?, + privateHeaders: [String]?, + additionalCompilerFlagsByRelativePath: [String: String]?, + attributesByRelativePath: [String: [String]]?) { targetReference = target.reference self.membershipExceptions = membershipExceptions self.publicHeaders = publicHeaders From c30a845e6e710c23076819e3f0359d3404e2c408 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20Pi=C3=B1era=20Buend=C3=ADa?= <663605+pepicrft@users.noreply.github.com> Date: Sun, 11 Aug 2024 18:54:55 +0200 Subject: [PATCH 339/678] chore: disable the renovatebot dashboard (#840) --- renovate.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/renovate.json b/renovate.json index 7066eafd7..d64bfc863 100644 --- a/renovate.json +++ b/renovate.json @@ -1,7 +1,8 @@ { "$schema": "https://docs.renovatebot.com/renovate-schema.json", "extends": [ - "config:base" + "config:base", + ":disableDependencyDashboard" ], "packageRules": [ { From 59271822fc7ecfb178025ccd79fb51381d5fcb51 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sun, 11 Aug 2024 18:55:34 +0200 Subject: [PATCH 340/678] chore(deps): update dependency tuist to v4.23.0 (#839) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise.toml b/.mise.toml index ec954e154..85845c09f 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,4 +1,4 @@ [tools] swiftformat = "0.54.3" -tuist = "4.21.2" +tuist = "4.23.0" swiftlint = "0.55.1" From db97fede763d9c68e8d70bea52cf1261e4771853 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20Pi=C3=B1era=20Buend=C3=ADa?= <663605+pepicrft@users.noreply.github.com> Date: Sun, 11 Aug 2024 19:01:35 +0200 Subject: [PATCH 341/678] chore: continuously release releasable changes (#842) * Add continuous release * Generate the changelog from version 8.22.0 --- .github/workflows/conventional-pr.yml | 18 + .github/workflows/release.yml | 90 ++ .mise.toml | 1 + CHANGELOG.md | 1089 +------------------------ cliff.toml | 111 +++ 5 files changed, 234 insertions(+), 1075 deletions(-) create mode 100644 .github/workflows/conventional-pr.yml create mode 100644 .github/workflows/release.yml create mode 100644 cliff.toml diff --git a/.github/workflows/conventional-pr.yml b/.github/workflows/conventional-pr.yml new file mode 100644 index 000000000..c145cda3d --- /dev/null +++ b/.github/workflows/conventional-pr.yml @@ -0,0 +1,18 @@ +name: conventional-pr +on: + pull_request: + branches: + - main + - master + types: + - opened + - edited + - synchronize +jobs: + lint-pr: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: CondeNast/conventional-pull-request-action@v0.2.0 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 000000000..a4f0bf4c8 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,90 @@ +name: Release + +on: + push: + branches: + - main + workflow_dispatch: + inputs: + version: + description: 'The version to release' + type: string + +permissions: + contents: write + pull-requests: read + statuses: write + packages: write + +jobs: + release: + name: Release + runs-on: 'ubuntu-latest' + timeout-minutes: 15 + if: "!startsWith(github.event.head_commit.message, '[Release]')" + steps: + - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4 + with: + fetch-depth: 0 + - uses: jdx/mise-action@v2 + with: + experimental: true + - name: Check if there are releasable changes + id: is-releasable + run: | + # Run git cliff and save the output + bumped_output=$(git cliff 8.22.0.. --bump) + echo "Bumped output:" + echo "${bumped_output}" + + # Read the content of CHANGELOG.md + changelog_content=$(cat CHANGELOG.md) + echo "CHANGELOG.md content:" + echo "${changelog_content}" + + # Compare the outputs and set the result + if [ "${bumped_output}" = "${changelog_content}" ]; then + echo "should-release=false" >> $GITHUB_ENV + else + echo "should-release=true" >> $GITHUB_ENV + fi + + - name: Get next version + id: next-version + if: env.should-release == 'true' + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: echo "NEXT_VERSION=$(git cliff 8.22.0.. --bumped-version)" >> "$GITHUB_OUTPUT" + - name: Get release notes + id: release-notes + if: env.should-release == 'true' + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + echo "RELEASE_NOTES<> "$GITHUB_OUTPUT" + git cliff 8.22.0.. --unreleased >> "$GITHUB_OUTPUT" + echo "EOF" >> "$GITHUB_OUTPUT" + - name: Update CHANGELOG.md + if: env.should-release == 'true' + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: git cliff 8.22.0.. --bump -o CHANGELOG.md + - name: Commit changes + id: auto-commit-action + uses: stefanzweifel/git-auto-commit-action@v5 + if: env.should-release == 'true' + with: + commit_options: '--allow-empty' + tagging_message: ${{ steps.next-version.outputs.NEXT_VERSION }} + skip_dirty_check: true + commit_message: "[Release] XcodeProj ${{ steps.next-version.outputs.NEXT_VERSION }}" + - name: Create GitHub Release + uses: softprops/action-gh-release@v2 + if: env.should-release == 'true' + with: + draft: false + repository: tuist/XcodeProj + name: ${{ steps.next-version.outputs.NEXT_VERSION }} + tag_name: ${{ steps.next-version.outputs.NEXT_VERSION }} + body: ${{ steps.release-notes.outputs.RELEASE_NOTES }} + target_commitish: ${{ steps.auto-commit-action.outputs.commit_hash }} diff --git a/.mise.toml b/.mise.toml index 85845c09f..5e6041a47 100644 --- a/.mise.toml +++ b/.mise.toml @@ -2,3 +2,4 @@ swiftformat = "0.54.3" tuist = "4.23.0" swiftlint = "0.55.1" +"git-cliff" = "2.4.0" diff --git a/CHANGELOG.md b/CHANGELOG.md index e7d2ecced..71ffcc400 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,1082 +1,21 @@ -🚀 Check out the guidelines [here](https://tuist.io/docs/contribution/changelog-guidelines/) +# Changelog -## Unreleased +All notable changes to this project will be documented in this file. -## 8.22.0 +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -### Added -* Add `buildArchitectures` to XCScheme+BuildAction by @woin2ee in https://github.com/tuist/XcodeProj/pull/824 +## [Unreleased] +### Details +#### Chore +- Set up SwiftLint and SwiftFormat, run them against the project, and run them as part of the CI workflows by @pepicrft in [#836](https://github.com/tuist/XcodeProj/pull/836) -### Changed -* Update comment to reflect productNameWithExtension() and others by @mikeger in https://github.com/tuist/XcodeProj/pull/823 +#### Docs +- Add filipracki as a contributor for code by @allcontributors[bot] in [#832](https://github.com/tuist/XcodeProj/pull/832) -## 8.21.0 +#### Feat +- Introduce the new Xcode 16 models `PBXFileSystemSynchronizedRootGroup` and `PBXFileSystemSynchronizedBuildFileExceptionSet` by @pepicrft in [#827](https://github.com/tuist/XcodeProj/pull/827) -### Fixed -* Fix package manifest by @0111b in https://github.com/tuist/XcodeProj/pull/816 +[unreleased]: https://github.com/tuist/XcodeProj/compare/8.22.0..HEAD -### Added -* Add Privacy Manifest in 'Projects Using' README table by @stelabouras in https://github.com/tuist/XcodeProj/pull/819 - -### Changed -* Adopt Strict Concurrency checking by @waltflanagan in https://github.com/tuist/XcodeProj/pull/821 -* Set minimum swift version to 5.8 by @waltflanagan in https://github.com/tuist/XcodeProj/pull/822 - -## 8.20.0 - -### Fixed -* Fix deprecation warning when targeting macOS 13 by @jszumski in https://github.com/tuist/XcodeProj/pull/814 - -## 8.19.0 - -### Added - -* Add precompiled header extension to headersExtensions for adding .pch… by @VorkhlikArtem in https://github.com/tuist/XcodeProj/pull/812 - -## 8.18.0 - -### Added -* Add `showNonLocalizedStrings` option to XCScheme+LaunchAction by @ladislas in https://github.com/tuist/XcodeProj/pull/806 -* Fix issue that it is not possible to remove a remote package by @kevin-kp in https://github.com/tuist/XcodeProj/pull/803 -* XCScheme string initializer by @mattmassicotte in https://github.com/tuist/XcodeProj/pull/809 - -### Changed -* Inherit values in the default `SWIFT_ACTIVE_COMPILATION_CONDITIONS` value by @pepicrft in https://github.com/tuist/XcodeProj/pull/811 - -## 8.17.0 - -### Added - -* Fix issue that it is not possible to remove a remote package by @kevin-kp in https://github.com/tuist/XcodeProj/pull/803 - -## 8.16.0 - -### Added - -* Create `PBXProj` class from the Data reprentation of a `pbxproj` file by @Ibrahimhass in https://github.com/tuist/XcodeProj/pull/798 -* Add XCLocalSwiftPackageReference Support by @art-divin in https://github.com/tuist/XcodeProj/pull/799 - -### Fixed - -* Fix issue that multiple products of the same package cannot be added by @kevin-kp in https://github.com/tuist/XcodeProj/pull/801 - -## 8.15.1 - -### Added - -- Added XCLocalSwiftPackageReference Support (#799)[https://github.com/tuist/XcodeProj/pull/799] by [@art-divin](https://github.com/art-divin). - -## 8.15.0 - -### Added - -- Added preferredScreenCaptureFormat to XCScheme.TestAcion [#792](https://github.com/tuist/XcodeProj/pull/792) by [@tatagrigory](https://github.com/tatagrigory). - - -## 8.14.0 - -### Added - -- Add otf font files to known file types [#788](https://github.com/tuist/XcodeProj/pull/788) by[@kwridan](https://github.com/kwridan) -- Get Data representation for `Writable` [#787](https://github.com/tuist/XcodeProj/pull/787) by [@Ibrahimhass](https://github.com/Ibrahimhass) - -## 8.13.0 - -### Added - -- Added `Build Tool Plug-ins` support [#784](https://github.com/tuist/XcodeProj/pull/784) by [@BarredEwe](https://github.com/BarredEwe) - -## 8.12.0 - -### Added - -- `PBXBuildRule.dependencyFile` attribute [#781](https://github.com/tuist/XcodeProj/pull/781) by [@pepicrft](https://github.com/pepicrft). -- Update last known `upgradeCheck` and `swiftUpgradeCheck` constants [#781](https://github.com/tuist/XcodeProj/pull/781) by [@pepicrft](https://github.com/pepicrft). -- Add the defaults `xcschemeFormatVersion`, `lastSwiftUpgradeCheck`, and `lastUpgradeCheck` [#781](https://github.com/tuist/XcodeProj/pull/781) by [@pepicrft](https://github.com/pepicrft). - -## 8.11.0 - -### Added - -- Support for Xcode runtime issue breakpoints [#761](https://github.com/tuist/XcodeProj/pull/761) by [@zenangst](https://github.com/zenangst). -- `Platform.visionOS` case and updated `BuildSettingsProvider` to return the default build settings for visionOS projects [#765](https://github.com/tuist/XcodeProj/pull/765) by [@Mstrodl](https://github.com/Mstrodl). - -### Changed - -- [PathKit](https://github.com/kylef/PathKit) version to [1.0.1](https://github.com/kylef/PathKit/blob/HEAD/CHANGELOG.md#%E2%80%8B101-2021-09-22). -- Bump `xcodeproj.podspec` macOS deployment target to 10.13. - -### Removed - -- **(Breaking)** Dropped [Carthage](https://github.com/Carthage/Carthage) support: Since the tool is not actively maintained. -- **(Breaking)** Dropped CocoaPods support: With the Apple ecosystem moving to Swift Package Manager we'd like to support the transition by dropping support for CocoaPods. The drop will simplify our release process. - -### Fixed - -- Ensured UUIDs are considered when sorting by filename to ensure information is not lost when filenames are equal [#769](https://github.com/tuist/XcodeProj/pull/769) by [@timothycosta](https://github.com/timothycosta). - -## 8.10.0 - -### Added - -- Add try-catch to getting started documentation [#745](https://github.com/tuist/XcodeProj/pull/745) by [@AlexKobachiJP](https://github.com/AlexKobachiJP) -- Add missing Build Settings Provider documentation [#747](https://github.com/tuist/XcodeProj/pull/747) by [@baekteun](https://github.com/baekteun) - -### Fixed - -- Fix unstable reads for `XCSchemeManagement` [#758](https://github.com/tuist/XcodeProj/pull/758) by [@kwridan](https://github.com/kwridan) -- Fix typos in `Writable.swift` [#755](https://github.com/tuist/XcodeProj/pull/755) by [@jpsim](https://github.com/jpsim) - -### Changed - -- Update `XCSharedData` Writable conformance to include `WorkspaceSettings` [#743](https://github.com/tuist/XcodeProj/pull/743) by [@dayton-bobbitt](https://github.com/dayton-bobbitt) - -## 8.9.0 - -### Added - -- Update watchOS application default settings for Xcode 14 [#711](https://github.com/tuist/XcodeProj/pull/711) by [@kwridan](https://github.com/kwridan) -- Implement `Hashable` for `XCScheme.BuildableReference` [#712](https://github.com/tuist/XcodeProj/pull/712) by [@cgrindel](https://github.com/cgrindel) -- Sets customWorkingDirectory for schemes [#720](https://github.com/tuist/XcodeProj/pull/720) by [@maxwellE](https://github.com/maxwellE) -- Add `XCScheme.ExecutionAction.shellToInvoke` [#721](https://github.com/tuist/XcodeProj/pull/721) by [@CrazyFanFan](https://github.com/CrazyFanFan) -- Add `platformFilters` attribute to `PBXBuildFile` and `PBXTargetDependency` [#737](https://github.com/tuist/XcodeProj/pull/737) by [@maxwellE](https://github.com/maxwellE) -- Add suppot for `XCUserData` [#739](https://github.com/tuist/XcodeProj/pull/739) by [@teameh](https://github.com/teameh) - -## 8.8.0 - -### Fixed - -- Fix equality checking of dictionaries [#667](https://github.com/tuist/XcodeProj/pull/667) by [@brentleyjones](https://github.com/brentleyjones) -- Quiet new warnings from Xcode 13.3 [#673](https://github.com/tuist/XcodeProj/pull/673) by [@hisaac](https://github.com/hisaac) -- Fix typo in PBXOutputSettings.swift [#678](https://github.com/tuist/XcodeProj/pull/678) by [@eltociear](https://github.com/eltociear) -- Fix syntax error in docs [#679](https://github.com/tuist/XcodeProj/pull/679) by [@maxwellE](https://github.com/maxwellE) -- Misspelling in comment [#680](https://github.com/tuist/XcodeProj/pull/680) by [@maxwellE](https://github.com/maxwellE) -- Misspelling in comment [#681](https://github.com/tuist/XcodeProj/pull/681) by [@maxwellE](https://github.com/maxwellE) -- Ensure correct `LaunchAction` scheme order [#686](https://github.com/tuist/XcodeProj/pull/686) by [@maxwellE](https://github.com/maxwellE) -- Fix TestAction scheme attribute ordering [#689](https://github.com/tuist/XcodeProj/pull/689) by [@maxwellE](https://github.com/maxwellE) -- Fix `Testables` element ordering [#702](https://github.com/tuist/XcodeProj/pull/702) by [@maxwellE](https://github.com/maxwellE) -- Fix `RemoteRunnable` scheme attr order [#701](https://github.com/tuist/XcodeProj/pull/701) by [@maxwellE](https://github.com/maxwellE) -- Fix ordering of Scheme toplevel attrs [#698](https://github.com/tuist/XcodeProj/pull/698) by [@maxwellE](https://github.com/maxwellE) -- Fix order for `askForAppToLaunch` attr [#705](https://github.com/tuist/XcodeProj/pull/705) by [@maxwellE](https://github.com/maxwellE) -- Fix ordering of diagnostics scheme options [#704](https://github.com/tuist/XcodeProj/pull/704) by [@kwridan](https://github.com/kwridan) - -### Added - -- Add `addDependency()` helper method to `PBXAggregateTarget` [#677](https://github.com/tuist/XcodeProj/pull/677) by [@brentleyjones](https://github.com/brentleyjones) -- Allow for initializing a PBXProj via a direct path [#682](https://github.com/tuist/XcodeProj/pull/682) by [@maxwellE](https://github.com/maxwellE) -- Add `.extensionKitExtension` as the new `PBXProductType` [#691](https://github.com/tuist/XcodeProj/pull/691) by [@mtj0928](https://github.com/mtj0928) -- Added `disablePerformanceAntipatternChecker` to `XCScheme` [#693](https://github.com/tuist/XcodeProj/pull/603) by [@Bogdan-Belogurov](https://github.com/Bogdan-Belogurov) -- Added missing `askForAppToLaunch` in `ProfileAction` [#700](https://github.com/tuist/XcodeProj/pull/700) by [@maxwellE](https://github.com/maxwellE) -- Add `launchAutomaticallySubstyle`->`ProfileAction` [#699](https://github.com/tuist/XcodeProj/pull/699) by [@maxwellE](https://github.com/maxwellE) -- Add `DEAD_CODE_STRIPPING` default project setting [#706](https://github.com/tuist/XcodeProj/pull/706) by [@kwridan](https://github.com/kwridan) - -### Changed - -- Use `Runnable` in `ProfileAction` [#703](https://github.com/tuist/XcodeProj/pull/703) by [@maxwellE](https://github.com/maxwellE) - -## 8.7.1 - -### Changed -- Make WorkspaceSettings initializer public [#658](https://github.com/tuist/XcodeProj/pull/658) by [@jakeatoms](https://github.com/jakeatoms) - -## 8.7.0 -### Added - -- Add DocC Xcode File Type (`.docc`) [#660](https://github.com/tuist/XcodeProj/pull/660) by [@Jake-Prickett](https://github.com/Jake-Prickett) - -## 8.6.0 -### Added - -- Support for location added to test targets (`TestableReference`) [#654](https://github.com/tuist/XcodeProj/pull/654) by [@KrisRJack](https://github.com/KrisRJack) - -## 8.5.0 - -### Added - -- Add XCSchemeManagement struct https://github.com/tuist/XcodeProj/pull/565 by @pepibumur. - -### Changed -- Update the last-known and default constants to align with Xcode 13. - -## 8.4.0 -### Added - -- Support customized DerrivedData path in `WorkspaceSettings` [#650](https://github.com/tuist/XcodeProj/pull/650) by [@freddi-kit](https://github.com/freddi-kit). - -### 8.3.1 -### Fixed - -- Fix Xcode 13 build [#648](https://github.com/tuist/XcodeProj/pull/648) by [@raptorxcz](https://github.com/raptorxcz) - -## 8.3.0 - Mojo -### Added - -- `CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED` to default build setting [#641](https://github.com/tuist/XcodeProj/pull/641) by [@flowbe](https://github.com/flowbe) - -### Fixed - -- Xcode 13 build issues [#646](https://github.com/tuist/XcodeProj/pull/646) by [@jsorge](https://github.com/jsorge) - -## 8.2.0 - Bubbles -### Added - -- Support obtaining the full path of a file element by passing the source root as a string [#624](https://github.com/tuist/XcodeProj/pull/624) by [@ileitch](https://github.com/ileitch). - -### Fixed - -- If RemoteRunnable doesn't contains BuildableReference XcodeProj removes xcscheme file [#627](https://github.com/tuist/XcodeProj/pull/627) by [@subdan](https://github.com/subdan). - -### Changed - -- Updated AEXML to 4.6.1 [#632](https://github.com/tuist/XcodeProj/pull/632) by [@nnsnodnb](https://github.com/nnsnodnb). -## 8.1.0 - Barcelona -### Changed - -- Improve performance of commented string [#635](https://github.com/tuist/XcodeProj/pull/635) by [@adellibovi](https://github.com/adellibovi) - -## 8.0.0 - Amor -### Fixed - -- Adding group set incorrect parent in case of complex path [#614](https://github.com/tuist/XcodeProj/pull/614) by [@avdyushin](https://github.com/avdyushin) -- **Breaking** Fixed issue where some schemes could not be deserialized because a buildable reference did not contain a blueprint identifier [#612](https://github.com/tuist/XcodeProj/pull/612) by [@daltonclaybrook](https://github.com/daltonclaybrook) -- Added the `com.apple.product-type.driver-extension` and `com.apple.product-type.system-extension` PBXProductType [#618](https://github.com/tuist/XcodeProj/pull/618) by [@vgorloff](https://github.com/vgorloff). - -### Changed - -- **Breaking** Make `runPostActionsOnFailure` optional [#619](https://github.com/tuist/XcodeProj/pull/619) by [@kwridan](https://github.com/kwridan) - -## 7.23.0 - Bonsai -### Added - -- Allows passing BuildableIdentifier String to BuildableReference initializer [#605](https://github.com/tuist/XcodeProj/pull/605) by [@freddi-kit](https://github.com/freddi-kit) - -### Fixed - -- Fixed building on Linux [#615](https://github.com/tuist/XcodeProj/pull/615) by [@yonaskolb](https://github.com/yonaskolb) - -## 7.22.0 - Ringui Dingui - -### Added - -- `CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER` to default build setting [#608](https://github.com/tuist/XcodeProj/pull/608) by [@fortmarek](https://github.com/fortmarek) - -### Fixed - -- Prevent overwriting identical workspace data [#607](https://github.com/tuist/XcodeProj/pull/607) by [@ferologics](https://github.com/ferologics) - -## 7.21.0 - Alfredo - -### Changed - -- Speed up md5 generation [#606](https://github.com/tuist/XcodeProj/pull/606) by [@adellibovi](https://github.com/adellibovi) - -## 7.20.0 - Sol - -### Added - -- Added `runPostActionsOnFailure` to `XCScheme` [#603](https://github.com/tuist/XcodeProj/pull/603) by [@FranzBusch](https://github.com/FranzBusch) - -## 7.19.0 - Kreuzberg - -### Fixed - -- JSON decoder not properly decoding `defaultConfigurationIsVisible` in some projects [#593](https://github.com/tuist/XcodeProj/pull/593) by [@tjwio](https://github.com/tjwio) -- JSON decoder not properly decoding `proxyType` in some projects [#596](https://github.com/tuist/XcodeProj/issues/596) by [@tjwio](https://github.com/tjwio) -- BuildPhaseTests not handling failure cases properly [#597](https://github.com/tuist/XcodeProj/issues/597) by [@tjwio](https://github.com/tjwio) -- `xcconfig` parser does not support inline comments [#602](https://github.com/tuist/XcodeProj/issues/602) by [@dive](https://github.com/dive) - -## 7.18.0 - Penguin - -### Added - -- Support for building and running on Linux. [#585](https://github.com/tuist/XcodeProj/pull/585) by [@elliottwilliams](https://github.com/elliottwilliams). -- Tested for compatibility with Swift 5.3 on Ubuntu 18.04. -- XcodeProj requires FoundationXML / libxml2, which is part of the standard Swift Linux toolchain but not necessarily available in all environments. - -## 7.17.0 - Tempelhof - -### Added - -- Added the `com.apple.product-type.metal-library` PBXProductType [#576](https://github.com/tuist/XcodeProj/pull/576) by [@deatondg](https://github.com/deatondg). -- Deprecate PBXBuildPhase.type() function https://github.com/tuist/XcodeProj/pull/571 by [@marciniwanicki](https://github.com/marciniwanicki). -- Added `runOncePerArchitecture` attribute to `PBXBuildRule` https://github.com/tuist/XcodeProj/pull/570 by @sascha - -## 7.16.0 - Cieza - -### Added - -- Set the right `module_name` in the `.podspec.` [#578](https://github.com/tuist/XcodeProj/pull/578) by [@dflems](https://github.com/dflems). - -## 7.15.0 - Marea - -### Fixed - -- explicitFileType corrected for .bundle https://github.com/tuist/XcodeProj/pull/563 by @adamkhazi - -### Added - -- Add support for alwaysOutOfDate flag in PBXShellScriptBuildPhase https://github.com/tuist/XcodeProj/pull/572 by @marciniwanicki -- Added `PBXShellScriptBuildPhase.dependencyFile` attribute https://github.com/tuist/xcodeproj/pull/568 by @polac24 -- Add support for StoreKitConfigurationFileReference in LaunchAction of XCScheme https://github.com/tuist/XcodeProj/pull/573 by @jcolicchio - -## 7.14.0 - -### Fixed - -- lastKnownFileType for .ttf and .sqlite files https://github.com/tuist/XcodeProj/pull/557 by @adamkhazi - -### Added - -- Added selectedTests attribute to XCScheme.TestableReference https://github.com/tuist/XcodeProj/pull/559 by @ooodin - -## 7.13.0 - -### Added - -- Support `on-demand-install-capable` application https://github.com/tuist/XcodeProj/pull/554 by @d-date -- Add RemotePath to RemoteRunnable https://github.com/tuist/XcodeProj/pull/555 by @kwridan - -## 7.12.0 - -### Added - -- Added `LaunchAction.customLLDBInitFile` and `TestAction.customLLDBInitFile` attributes https://github.com/tuist/xcodeproj/pull/553 by @polac24 - -## 7.11.1 - -### Added - -- Added `platformFilter` to the `PBXTargetDependency` https://github.com/tuist/XcodeProj/pull/546 by @tomaslinhart - -## 7.11.0 - -### Changed - -- Point `XcodeProjCExt` to version 0.1.0 https://github.com/tuist/XcodeProj/pull/540 by @khoi - -### Added - -- Added `useTestSelectionWhitelist` attribute to `XCScheme.TestableReference` https://github.com/tuist/xcodeproj/pull/516 by @basvankuijck. - -### Fixed - -- "Products" group has the same ID for any project https://github.com/tuist/XcodeProj/issues/538 by @damirdavletov - -## 7.10.0 - -### Changed - -- Optimize bottlenecks https://github.com/tuist/XcodeProj/pull/529 by @michaeleisel - -## 7.9.0 - -### Changed - -- Remove `Tapestries` folder for tapestry 0.0.5 version https://github.com/tuist/XcodeProj/pull/523 by @fortmarek -- Sped up the generation of commented strings, especially those that include an MD5 hash - -### Fixed - -- Code Coverage Targets and Additional Options Scheme Instability https://github.com/tuist/XcodeProj/pull/522 by @adamkhazi -- Fix `XCWorkspace` `Equatable` https://github.com/tuist/XcodeProj/pull/524 by @adamkhazi - -## 7.8.0 - -### Added - -- Added `PathRunnable` to the `LaunchAction` to allow running any executable https://github.com/tuist/XcodeProj/pull/521 by @vytis - -### Fixed - -- Make `PBXProject.targetAttributes` non optional again and fix equality https://github.com/tuist/XcodeProj/pull/519 by @yonaskolb - -## 7.7.0 - -### Fixed - -- Ensure references to products in external projects are generated with deterministic UUIDs https://github.com/tuist/XcodeProj/pull/518 by @evandcoleman - -## 7.6.0 - -### Changed - -- **Breaking** Make `PBXProject.targetAttributes` optional https://github.com/tuist/XcodeProj/pull/517 by @pepibumur - -### Fixed - -- Remove "Shell" Carthage dependency from carthage xcode project as it's no longer used https://github.com/tuist/XcodeProj/pull/507 by @imben123 - -### Added - -- Added `com.apple.product-type.xcframework` to `PBXProductType`. https://github.com/tuist/XcodeProj/pull/508 by @lakpa -- Added `askForAppToLaunch` parameter to `LaunchAction` and `ProfileAction`. https://github.com/tuist/XcodeProj/pull/515 by @YutoMizutani -- Added `"ENABLE_PREVIEWS"` to target application build settings https://github.com/tuist/XcodeProj/pull/511 by @fortmarek - -## 7.5.0 - -### Fixed - -- Provide default build settings for unit and ui test targets https://github.com/tuist/XcodeProj/pull/501 by @kwridan -- Remove "Shell" Carthage dependency from project manifest as it's no longer used https://github.com/tuist/XcodeProj/pull/505 by @kwridan - -## 7.4.0 - -### Changed - -- Update list of recognized file extensions https://github.com/tuist/XcodeProj/pull/500 by @dflems - -## 7.3.0 - -### Changed - -- Update BuildSettingsProvider to include extension settings https://github.com/tuist/XcodeProj/pull/497 by @kwridan -- Remove the dependency with the Swift Package Manager https://github.com/tuist/XcodeProj/pull/499 by @elliottwilliams - -## 7.2.2 - -### Fixed - -- Make test plans deserialise correctly https://github.com/tuist/XcodeProj/pull/496 by @adamkhazi - -## 7.2.1 - -### Fixed - -- Make test plans optional https://github.com/tuist/XcodeProj/commit/c15034948a2a132bf559f14d3c6b4d1b73749663 by @pepibumur - -### Changed - -- Replaced CircleCI with GitHub actions https://github.com/tuist/XcodeProj/pull/493 by @pepibumur -- Replace CircleCI with GitHub actions https://github.com/tuist/XcodeProj/pull/493 by @pepibumur -- Replace Shell with the SPM's Process utility class https://github.com/tuist/XcodeProj/pull/492 by @pepibumur - -### Added - -- Automating release process with [tapestry](https://github.com/ackeecz/tapestry) https://github.com/tuist/XcodeProj/pull/495 by @fortmarek - -## 7.2.0 - -### Added - -- Added support for Xcode 11 test plans https://github.com/tuist/XcodeProj/pull/491 by @maniramezan - -### Fixed - -- Add remote Swift packages to the Frameworks build phase https://github.com/tuist/XcodeProj/pull/487 by @kwridan -- System library added to a group has empty path https://github.com/tuist/XcodeProj/pull/488 by @damirdavletov -- Fix Products group serialisation with temporary ids https://github.com/tuist/XcodeProj/pull/489 by @damirdavletov - -## 7.1.0 - -### Added - -- Add `onlyGenerateCoverageForSpecifiedTargets` parameter to `TestAction` https://github.com/tuist/XcodeProj/pull/473 by @kateinoigakukun -- Added support for `PBXTargetDependency.product` https://github.com/tuist/XcodeProj/pull/481 by @yonaskolb -- Xcode 11 support. - -## 7.0.1 - -### Changed - -- Update `BuildSettingProvider` to return `LD_RUNPATH_SEARCH_PATHS` as `Array` https://github.com/tuist/xcodeproj/pull/463 by @marciniwanicki -- Update `Project.swift` to make it compatible with tuist 0.17.0 https://github.com/tuist/xcodeproj/pull/469 by @marciniwanicki - -### Added - -- Adding support for adding local Swift packages https://github.com/tuist/XcodeProj/pull/468 by @fortmarek -- Adding additional `lastKnownFileType`s https://github.com/tuist/xcodeproj/pull/458 by @kwridan -- Adding possibility to create variant group for referencing localized resources https://github.com/tuist/xcodeproj/pull/462 by @timbaev - -### Fixed - -- Duplication of packages https://github.com/tuist/XcodeProj/pull/470 by @fortmarek - -## 7.0.0 - -### Changed - -- **Breaking** Change the UUID generation logic to generate ids with a length of 24 https://github.com/tuist/xcodeproj/pull/432 by @pepibumur. -- **Breaking** Renamed module from `xcodeproj` to `XcodeProj` https://github.com/tuist/xcodeproj/pull/398 by @pepibumur. -- Add `override` flag to `PBXGroup.addFile(at:,sourceTree:,sourceRoot:)` https://github.com/tuist/xcodeproj/pull/410 by @mrylmz -- Rename some internal variables to have a more representative name https://github.com/tuist/xcodeproj/pull/415 by @pepibumur. - -### Added - -- **Breaking** Add `SWIFT_COMPILATION_MODE` and `CODE_SIGN_IDENTITY` build settings, remove `DEBUG` flag for Release https://github.com/tuist/xcodeproj/pull/417 @dangthaison91 -- **Breaking** Added throwing an error in case group path can't be resolved by @damirdavletov -- **Breaking** Added remote project support to PBXContainerItemProxy by @damirdavletov -- **Breaking** Add support for `RemoteRunnable` https://github.com/tuist/xcodeproj/pull/400 by @pepibumur. -- **Breaking** Swift 5 support https://github.com/tuist/xcodeproj/pull/397 by @pepibumur. -- Added `com.apple.product-type.application.watchapp2-container` to `PBXProductType`. https://github.com/tuist/xcodeproj/pull/441 by @leogdion. -- Add BatchUpdater to quickly add files to the group https://github.com/tuist/xcodeproj/pull/388 by @CognitiveDisson. -- `WorkspaceSettings.autoCreateSchemes` attribute https://github.com/tuist/xcodeproj/pull/399 by @pepibumur -- Additional Swift 5 fixes: https://github.com/tuist/xcodeproj/pull/402 by @samisuteria -- Make build phase name public by @llinardos. -- Can access embed frameworks build phase for a target by @llinardos. -- Added `com.apple.product-type.framework.static` to `PBXProductType`. https://github.com/tuist/xcodeproj/pull/347 by @ileitch. -- Can add a not existing file to a group https://github.com/tuist/xcodeproj/pull/418 by @llinardos. -- Support for Swift PM Packages https://github.com/tuist/xcodeproj/pull/439 https://github.com/tuist/xcodeproj/pull/444 by @pepibumur @yonaskolb. -- `LaunchAction.customLaunchCommand` attribute https://github.com/tuist/xcodeproj/pull/451 by @pepibumur. -- `XCBuildConfiguration.append` method https://github.com/tuist/xcodeproj/pull/450 by @pepibumur. - -### Fixed - -- Carthage integration https://github.com/tuist/xcodeproj/pull/416 by @pepibumur. -- Relative path is wrong when referencing file outside of project folder https://github.com/tuist/xcodeproj/issues/423 by @damirdavletov -- [crash] Fatal error: Duplicate values for key https://github.com/tuist/xcodeproj/issues/426 by @toshi0383 -- Change PBXContainerItemProxy.remoteGlobalID attribute to support object references https://github.com/tuist/xcodeproj/pull/445 by @yonaskolb -- Dead lock in the `PBXObjects.delete` method https://github.com/tuist/xcodeproj/pull/449 by @pepibumur - -### Removed - -- OSLogs https://github.com/tuist/xcodeproj/pull/453 by @pepibumur. - -## 6.7.0 - -### Changed - -- **Breaking** Make `PBXBuildPhase.files` optional to match Xcode's behavior https://github.com/tuist/xcodeproj/pull/391 by @pepibumur. - -### Added - -- Add location variable to XCWorkspaceDataElement https://github.com/tuist/xcodeproj/pull/387 by @pepibumur. - -### Fixed - -- Fixed file full path performance issue https://github.com/tuist/xcodeproj/pull/372 by @CognitiveDisson. -- Diffing issues when writing the project https://github.com/tuist/xcodeproj/pull/391 by @pepibumur. - -## 6.6.0 - -### Fixed - -- Fix adding files to `PBXBuildPhase` https://github.com/tuist/xcodeproj/pull/380 @danilsmakotin. -- Improve project encoding performance https://github.com/tuist/xcodeproj/pull/371 by @CognitiveDisson. -- Project decoding performance issue https://github.com/tuist/xcodeproj/pull/365 by @CognitiveDisson. -- Fix PBXTarget extension methods https://github.com/tuist/xcodeproj/pull/367 by @danilsmakotin. - -### Added - -- Added `GPUFrameCaptureMode` and `GPUValidationMode` options to `LaunchAction` https://github.com/tuist/xcodeproj/pull/368 by @schiewe. -- Add Swiftformat https://github.com/tuist/xcodeproj/pull/375 by @pepibumur. - -### Changed - -- **Breaking** Rename GPUFrameCaptureMode cases to start with a lowercase letter https://github.com/tuist/xcodeproj/pull/375 by @pepibumur. -- Fix linting issues https://github.com/tuist/xcodeproj/pull/375 by @pepibumur. - -## 6.5.0 - -### Changed - -- Make Xcode.Supported.xcschemeFormatVersion public https://github.com/tuist/xcodeproj/pull/361 by @yonaskolb. - -### Added - -- Fix remote target dependency https://github.com/tuist/xcodeproj/pull/362 by @mxcl. - -## 6.4.0 - -### Added - -- Added `projReferenceFormat` to `PBXOutputSettings` to allow changing the output format of generated references. `withPrefixAndSuffix` will give the legacy behaviour `xcode` will generate 32 character references as XCode does. https://github.com/tuist/xcodeproj/pull/345 by @samskiter. -- Danger https://github.com/tuist/xcodeproj/pull/357 by @pepibumur. -- Support for WorkspaceSettings https://github.com/tuist/xcodeproj/pull/359 by @pepibumur. - -## 6.3.0 - -### Added - -- Added `parallelizable` and `randomExecutionOrdering` attributes to `XCScheme.TestableReference` https://github.com/tuist/xcodeproj/pull/340 by @alvarhansen. - -### Fixed - -- Fixed possible generated UUID conflicts https://github.com/tuist/xcodeproj/pull/342 by @yonaskolb. -- Fixed not working PBXFileElement.fullPath(sourceRoot:) method https://github.com/tuist/xcodeproj/pull/343 by @Vyeczorny. - -## 6.2.0 - -### Added - -- Carthage and CocoaPods support https://github.com/tuist/xcodeproj/pull/339 by @pepibumur. - -### Changed - -- Improved writing performance https://github.com/tuist/xcodeproj/pull/336 https://github.com/tuist/xcodeproj/pull/337 https://github.com/tuist/xcodeproj/pull/338 by @yonaskolb. -- Replaced Swift Package Manager dependency with PathKit https://github.com/tuist/xcodeproj/pull/334 by @yonaskolb. - -## 6.1.0 - -### Added - -- Added ability to pass in a `PBXObject` into the `PBXProject.targetAttributes` dictionary, which will be encoded into its UUID. Can be used for `TestTargetID` https://github.com/tuist/xcodeproj/pull/333 by @yonaskolb. - -### Changed - -- Changed `XCScheme.BuildableReference` init to make `blueprint` a `PBXObject` and added a `setBlueprint(:)` function https://github.com/tuist/xcodeproj/pull/320 by @yonaskolb. -- Bump AEXML version to 4.3.3 https://github.com/tuist/xcodeproj/pull/310 by @pepibumur. -- Improves performance of object references https://github.com/tuist/xcodeproj/pull/332 by @yonaskolb. -- Prefix reference with object type acronym. eg. `PBXFileReference` becomes `FR_XXXXXXXXXXXXXXXXX` https://github.com/tuist/xcodeproj/pull/332 by @yonaskolb. -- Add `TEMP` prefix to temporary unfixed reference values https://github.com/tuist/xcodeproj/pull/332 by @yonaskolb. - -### Fixed - -- Fixed written order of scheme attributes in Swift 4.2 https://github.com/tuist/xcodeproj/pull/325 and https://github.com/tuist/xcodeproj/pull/331 by @yonaskolb and @drekka - -## 6.0.1 - -### Fixed - -- Fixes `PBXProject` attributes not being set properly https://github.com/tuist/xcodeproj/pull/318 by @yonaskolb. -- Fixed remoteGlobalID typo https://github.com/tuist/xcodeproj/pull/315 by @yonaskolb. -- Fixed `XCBuildConfiguration.buildConfiguration` type https://github.com/tuist/xcodeproj/pull/316 by @yonaskolb. - -## 6.0.0 - -Note: Migration guidelines are included in the project README. - -### Changed - -- **Breaking** Make `PBXObjectReference` internal https://github.com/tuist/xcodeproj/pull/300 by @pepibumur. -- **Breaking** Make `PBXObjects` internal https://github.com/tuist/xcodeproj/pull/300 by @pepibumur. -- **Breaking** Move `PBXObjects` helpers to `PBXProj` https://github.com/tuist/xcodeproj/pull/300 by @pepibumur. - -## 5.2.0 - -### Changed - -- Some tweaks to support Xcode 10 https://github.com/tuist/xcodeproj/pull/298 by @pepibumur. - -## 5.1.1 - -### Changed - -- **Breaking** Change `PBXBuildFile.file` attribute to be of type `PBXFileElement` https://github.com/tuist/xcodeproj/pull/297 by @pepibumur. - -### Added - -- Add `PBXBuildPhase.add(file:)` method that takes a file element and returns a build file https://github.com/tuist/xcodeproj/pull/297 by @pepibumur. -- Add `PBXProj.rootObject` attribute https://github.com/tuist/xcodeproj/pull/297 by @pepibumur. - -### Fixed - -- `XCBuildConfiguration.baseConfiguration` type https://github.com/tuist/xcodeproj/pull/297 @pepibumur. - -## 5.1.0 - -### Added - -- `setAttributes`, `removeAttributes` and `attributes` to `PBXProject` https://github.com/tuist/xcodeproj/pull/295 by @pepibumur - -### Changed - -- **Breaking** Change `blueprintIdentifier` type to `PBXObjectReference` https://github.com/tuist/xcodeproj/pull/289 by @pepibumur - -### Fixed - -- Fix grammatical issues and add some convenient getters https://github.com/tuist/xcodeproj/pull/291 by @pepibumur -- Fix targets not getting the reference generated https://github.com/tuist/xcodeproj/pull/290 by @pepibumur -- Product references not being generated https://github.com/tuist/xcodeproj/pull/294 by @pepibumur - -### Removed - -- **Breaking** Make `PBXProject.attributes` internal https://github.com/tuist/xcodeproj/pull/295 by @pepibumur - -## 5.0.0 - -Nothing new since the release rc2. - -## 5.0.0-rc2 - -### Changed - -- **Breaking** Rename `filesReferences` to `fileReferences` https://github.com/tuist/xcodeproj/pull/271 by @pepibumur - -### Added - -- Xcode 10 inputFileListPaths and outputFileListPaths attributes https://github.com/tuist/xcodeproj/pull/271 by @pepibumur -- Split up `XCScheme` models and make them conform the `Equatable` protocol https://github.com/tuist/xcodeproj/pull/273 by @pepibumur -- Convenient methods to add and fetch build configurations https://github.com/tuist/xcodeproj/pull/283 by @pepibumur -- `.inc` extension to the header file extensions by @pepibumur - -## 5.0.0-rc1 - -### Breaking - -- Rename project to xcodeproj by @pepibumur. -- Drop Carthage and CocoaPods support by @pepibumur. -- Use Basic AbsolutePath, RelativePath and Process extensions by @pepibumur. -- Use `PBXObjectReference` instead of `String` to reference objects from `PBXProj.Objects` by @pepibumur. -- Remove `ObjectReference` by @pepibumur. -- Update `PBXNativeTarget` reference attributes to be of type `PBXObjectReference` by @pepibumur. -- Add convenient methods to materialize objects references https://github.com/tuist/xcodeproj/pull/12 by @pepibumur. -- Rename some PBXProject attributes for consistency https://github.com/tuist/xcodeproj/pull/268 by @pepibumur. - -### Added - -- Add `addDependency` method to `PBXNativeTarget` by @pepibumur. -- Danger check that reports Swiftlint results https://github.com/xcodeswift/xcproj/pull/257 by @pepibumur. -- Xcode constants by @pepibumur. -- Convenient API from objects by @pepibumur. -- `BuildSettingsProvider` by @pepibumur. -- Add `addDependency` method to `PBXNativeTarget` by @pepibumur. -- Method in `XCConfigurationList` to get the build configurations objects @pepibumur. -- Method to get the configuration list from any target https://github.com/tuist/xcodeproj/pull/10 by @pepibumur. -- Migration guidelines https://github.com/tuist/xcodeproj/pull/264 by @pepibumur. - -### Removed - -- Deprecated elements by @pepibumur. -- Tests that test the conformance of `Equatable` by @pepibumur. - -### Fixed - -- XCConfig parser strips the trailing semicolon from a configuration value https://github.com/xcodeswift/xcproj/pull/250 by @briantkelley -- `fullPath(fileElement:reference:sourceRoot:)` now returns the correct path for files that exist within a variant group https://github.com/xcodeswift/xcproj/pull/255 by @ileitch - -### Added - -- Update Danger to warn if the PR title contains WIP https://github.com/xcodeswift/xcproj/pull/259 by @pepibumur. -- Test coverage reports https://github.com/xcodeswift/xcproj/pull/258 by @pepibumur - -## 4.3.0 - -### Added - -- CI pipeline runs also on a Linux environment https://github.com/xcodeswift/xcproj/pull/249 by @pepibumur. -- Auto-generation of Equatable conformances using Sourcery https://github.com/xcodeswift/xcproj/pull/189 @by pepibumur. - -### Fixed - -- Some updates to match the Xcode 9.3 project format https://github.com/xcodeswift/xcproj/pull/247 by @LinusU - -## 4.2.0 - -### Added - -- `PBXNativeTarget.productInstallPath`, `PBXTargetDependency.name` https://github.com/xcodeswift/xcproj/pull/241 by @briantkelley -- `PBXContainerItem` super class of `PBXBuildPhase` and `PBXTarget` https://github.com/xcodeswift/xcproj/pull/243 by @briantkelley -- `PBXFileElement.wrapsLines`property https://github.com/xcodeswift/xcproj/pull/244 by @briantkelley -- `PBXFileReference` `languageSpecificationIdentifier` and `plistStructureDefinitionIdentifier` properties https://github.com/xcodeswift/xcproj/pull/244 by @briantkelley - -### Changed - -- Support for `XCConfig` project-relative includes https://github.com/xcodeswift/xcproj/pull/238 by @briantkelley -- Migrated `PBXProject.projectRoot` to `PBXProject.projectRoots` https://github.com/xcodeswift/xcproj/pull/242 by @briantkelley -- Moved `PBXFileElement.includeInIndex` and `PBXGroup`'s `usesTabs`, `indentWidth`, and `tabWidth` properties to `PBXFileElement` https://github.com/xcodeswift/xcproj/pull/244 by @briantkelley -- `PBXContainerItem` super class of `PBXFileElement` https://github.com/xcodeswift/xcproj/pull/244 by @briantkelley -- `PBXVariantGroup` and `XCVersionGroup` now inherit from `PBXGroup` https://github.com/xcodeswift/xcproj/pull/244 by @briantkelley - -### Fixed - -- `PBXObject.isEqual(to:)` overrides correctly call super https://github.com/xcodeswift/xcproj/pull/239 by @briantkelley -- `PBXAggregateTarget` does not write `buildRules` https://github.com/xcodeswift/xcproj/pull/241 by @briantkelley -- Writes showEnvVarsInLog only when false https://github.com/xcodeswift/xcproj/pull/240 by @briantkelley -- Writes `PBXProject.projectReferences` to the plist https://github.com/xcodeswift/xcproj/pull/242 by @briantkelley -- Comment generation for `PBXProject`, `PBXTarget`, and `PBXVariantGroup` https://github.com/xcodeswift/xcproj/pull/243 by @briantkelley -- `fullPath` now returns the path for a file inside a group without a folder https://github.com/xcodeswift/xcproj/pull/246 by @ileitch -- Quotes strings containing a triple underscore or double forward slash in .pbxproj file https://github.com/xcodeswift/xcproj/pull/245 by @briantkelley - -## 4.1.0 - -### Added - -- Added `tvOS` and `watchOS` Carthage support https://github.com/xcodeswift/xcproj/pull/232 by @yonaskolb -- Added support for scheme environment variables https://github.com/xcodeswift/xcproj/pull/227 by @turekj - -### Fixed - -- Fixed PBXObject sublasses from checking Equatable properly https://github.com/xcodeswift/xcproj/pull/224 by @yonaskolb -- Fix Carthage support https://github.com/xcodeswift/xcproj/pull/226 by @ileitch -- Fix adding file reference to bundle and package files https://github.com/xcodeswift/xcproj/pull/234 by @fuzza -- Fix adding PBXGroup without folder reference https://github.com/xcodeswift/xcproj/pull/235 by @fuzza -- Fixed some more diffs from Xcode https://github.com/xcodeswift/xcproj/pull/233 by @yonaskolb - -### Changed - -- Carthage minimum Deployment Target https://github.com/xcodeswift/xcproj/pull/229 by @olbrichj - -### 4.0.0 - -### Added - -- Added support for scheme pre-actions and post-actions https://github.com/xcodeswift/xcproj/pull/217 by @kastiglione - -### Changed - -- **Breaking:** Changed the return type of some helper functions that create or fetch PBXObjects to be `ObjectReference`, which includes the reference as well as the object https://github.com/xcodeswift/xcproj/pull/218 by @yonaskolb -- **Breaking:** Changed some `Int` properties into `Bool` or `UInt` https://github.com/xcodeswift/xcproj/pull/221 by @yonaskolb -- Changed the writing of some properties to minimise diffs when opening projects in Xcode https://github.com/xcodeswift/xcproj/pull/220 by @yonaskolb - -## 3.0.0 - -### Fixed - -- Fix Xcode 9.2 warning https://github.com/xcodeswift/xcproj/pull/209 by @keith -- macOS CLI targets now have a nil extension, instead of an empty string https://github.com/xcodeswift/xcproj/pull/208 by @keith -- Fix unnecessary quotations in CommentedString https://github.com/xcodeswift/xcproj/pull/211 by @allu22 -- Fixed xml files format not matching Xcode format, added some missing actions attributes. https://github.com/xcodeswift/xcproj/pull/216 by @ilyapuchka - -### Changed - -- **Breaking:** `XCWorkspace.Data` renamed to `XCWorkspaceData` and removed `references`. -- Improved README examples. https://github.com/xcodeswift/xcproj/pull/212 by @ilyapuchka -- Added methods to get paths to workspace, project and breakpoints and shemes files, added public methods to write them separatery. https://github.com/xcodeswift/xcproj/pull/215 by @ilyapuchka -- Added helper methods for adding source file to the project. https://github.com/xcodeswift/xcproj/pull/213 by @ilyapuchka - -## 2.0.0 - -### Added - -- Deterministic reference generation https://github.com/xcodeswift/xcproj/pull/185 by @pepibumur - -### Removed - -- **Breaking Change** `Referenceable` protocol https://github.com/xcodeswift/xcproj/pull/185 by @pepibumur. -- **Breaking Change** Deprecated methods to access objects from the `PBXProj`. Developers should use the `PBXProj.objects` property instead. https://github.com/xcodeswift/xcproj/pull/185 by @pepibumur. - -### Fixed - -- **Breaking:** `PBXSourceTree` no longer has raw values and gained an associated value case to support custom locations https://github.com/xcodeswift/xcproj/pull/198 by @briantkelley - -### Changed - -- **Breaking:** The `buildableProductRunnable` property on`XCScheme.LaunchAction` and `XCScheme.ProfileAction` is now optional. Similarly, `macroExpansion` on `XCScheme.TestAction` is also optional. https://github.com/xcodeswift/xcproj/pull/194 by @briantkelley -- The `XCScheme` initialization from an XML file has been relaxed, better matching Xcode's behavior. Default values will be used if the XML file is missing the relevant element or attribute. https://github.com/xcodeswift/xcproj/pull/194 by @briantkelley - -### Migrate from 1.x.x to 2.x.x - -- If you were using objects getters in `PBXProj` you should use the getters in `PBXProj.objects` instead. -- Objects don't include a `reference` property anymore. Objects associated references are the keys in the dictionary that contains them. -- When objects are added to the `PBXProj.objects` collection a reference needs to be passed. The reference can be calculated using the function `PBXProj.objects.generateReference` that generates a unique and deterministic reference based on the given object and identifier. -- If you were using `buildableProductRunnable` and `macroExpansion` properties from `XCScheme` actions they are now optionals. - -## 1.8.0 - -### Fixed - -- Optimised performance of object lookups https://github.com/xcodeswift/xcproj/pull/191 by @kastiglione - -### Added - -- Add breakpoint `condition` parameter by [@alexruperez](https://github.com/alexruperez). -- Support Xcode Extension product type https://github.com/xcodeswift/xcproj/pull/190 by @briantkelley -- Support for the legacy Build Carbon Resources build phase https://github.com/xcodeswift/xcproj/pull/196 by @briantkelley -- Support for custom build rules by https://github.com/xcodeswift/xcproj/pull/197 @briantkelley - -### Fixed - -- Optimised escaping of CommentedString https://github.com/xcodeswift/xcproj/pull/195 by @kastiglione -- Optimised performance of object lookups https://github.com/xcodeswift/xcproj/pull/191 by @kastiglione -- fixed PBXLegacyTarget write order https://github.com/xcodeswift/xcproj/pull/199 by @kastiglione -- fixed comment generation of PBXBuildFiles without a name https://github.com/xcodeswift/xcproj/pull/203 by @briantkelley -- fixed PBXReferenceTarget encoding in pbxproj file https://github.com/xcodeswift/xcproj/pull/202 by @briantkelley - -## 1.7.0 - -### Added - -- Support more indentation options on PBXGroups https://github.com/xcodeswift/xcproj/pull/168 by @bkase. -- Support `PBXLegacyTarget` https://github.com/xcodeswift/xcproj/pull/171 by @bkase. -- Breakpoint support through `XCBreakpointList`. https://github.com/xcodeswift/xcproj/pull/172 by [@alexruperez](https://github.com/alexruperez) -- Add convenience method to find targets with a given name https://github.com/xcodeswift/xcproj/pull/184 by @pepibumur. -- Danger plugin that fails earlier if files have been added/deleted and the Carthage project hasn't been regenerated afterwards https://github.com/xcodeswift/xcproj/pull/187 by @pepibumur. - -## 1.6.1 - -### Fixed - -- Fix encoded line breaks in PBXFileReference https://github.com/xcodeswift/xcproj/pull/177 by @yonaskolb - -## 1.6.0 - -### Added - -- PBXLegacyTarget support https://github.com/xcodeswift/xcproj/pull/171 by @bkase -- Integration tests https://github.com/xcodeswift/xcproj/pull/168 by @pepibumur -- More examples to the README https://github.com/xcodeswift/xcproj/pull/116 by @pepibumur. -- Add adding / editing command line arguments for Launch, Test and Profile Actions in `XCScheme`. https://github.com/xcodeswift/xcproj/pull/167 by @rahul-malik -- Test the contract with XcodeGen https://github.com/xcodeswift/xcproj/pull/170 by @pepibumur -- Add `PBXProj.Objects.getFileElement` https://github.com/xcodeswift/xcproj/pull/175 by @yonaskolb - -### Fixed - -- `PBXGroup` not generating the comment properly for its children https://github.com/xcodeswift/xcproj/pull/169 by @pepibumur. -- Make `PBXFileElement` a superclass for `PBXFileReference`, `PBXGroup`, and `PBXVariantGroup` https://github.com/xcodeswift/xcproj/pull/173 by @gubikmic -- Added `path` to `PBXVariantGroup` init https://github.com/xcodeswift/xcproj/pull/174 by @yonaskolb - -## 1.5.0 - -### Added - -- Add `codeCoverageEnabled` parameter to `TestAction` https://github.com/xcodeswift/xcproj/pull/166 by @kastiglione -- Make `final` classes that are not extendible https://github.com/xcodeswift/xcproj/pull/164 by @pepibumur. - -### Fixed - -- Fix `PBXProject` `productRefGroup` comment https://github.com/xcodeswift/xcproj/pull/161 by @allu22 -- Fix deprecation warnings for `PBXProj` objects usage https://github.com/xcodeswift/xcproj/pull/162 by @rahul-malik - -## 1.4.0 - Take me out - -### Added - -- Danger integration https://github.com/xcodeswift/xcproj/pull/158 by @pepibumur - -### Changed - -- Improve efficiency of looking up `PBXObject`'s from `PBXProj` https://github.com/xcodeswift/xcproj/pull/136 by @rahul-malik - -### Deprecated - -- `PBXObject` objects accessors https://github.com/xcodeswift/xcproj/pull/136/files#diff-f4369d9af58a6914f0e5cdf81ed18530R6 by @rahul-malik. - -### Fixed - -- Fix `PBXBuildFile` wrongly defaulting the settings attribute when it was nil https://github.com/xcodeswift/xcproj/pull/149 by @allu22 -- Fix `PBXTarget` generating the wrong comment for the `productReference` property https://github.com/xcodeswift/xcproj/pull/151 by @allu22. -- Add missing `usesTabs` property to `PBXGroup` https://github.com/xcodeswift/xcproj/pull/147 by @allu22. -- Fix generated comment for `PBXHeadersBuildPhase` by @allu22. -- Fix wrong `BuidlSettings.swift` file name https://github.com/xcodeswift/xcproj/pull/146 by @allu22. -- Fix `projectReferences` type https://github.com/xcodeswift/xcproj/pull/135 by @solgar. - -### Added - -- Danger checks https://github.com/xcodeswift/xcproj/pull/160 by @pepibumur -- New product type `ocUnitTestBundle` https://github.com/xcodeswift/xcproj/pull/134 by @solgar. - -## 1.3.0 - Esbarzers - -### Added - -- Add `PBXSourceTree.developerDir` type https://github.com/xcodeswift/xcproj/commit/5504fcde00bc56cf6c240ecd7cc36c05296861f8 by @pepibumur. - -### Fixed - -- Fix `PBXShellScriptBuildPhase` bug decoding `showEnvVarsInLog` https://github.com/xcodeswift/xcproj/commit/521b4e62b70f5fc43a06d00c43916d4899138553 by @pepibumur. -- Fix `PBXFileReference` bug decoding `useTabs` https://github.com/xcodeswift/xcproj/commit/c533987496959a3e32c0ddfe45a0f2db8d5daae0 by @pepibumur. -- Fix `PBXFileReference` bug decoding `lineEnding` https://github.com/xcodeswift/xcproj/commit/8a2c94effbe94859a68d58e0c49d66156ba1eaea by @pepibumur. - -## 1.2.0 - Two shoes - -### Added - -- Carthage support https://github.com/xcodeswift/xcproj/pull/125 by @pepibumur. -- `buildPhases` property to `PBXProj` https://github.com/xcodeswift/xcproj/pull/132 by @pepibumur. - -### Fixed - -- Build phase `buildActionMask` wrong default value https://github.com/xcodeswift/xcproj/pull/131 by @pepibumur. - -## 1.1.0 - Muerdo - -### Added - -- It supports now SPM-generated projects https://github.com/xcodeswift/xcproj/pull/124 by @pepibumur. Thanks @josefdolezal for the report. -- Project and workspace initializer that takes the path as a string https://github.com/xcodeswift/xcproj/pull/123 by @pepibumur. - -### Fixed - -- Fix the decoding of the `PBXFileReference.fileEncoding` property https://github.com/xcodeswift/xcproj/pull/127 by @gubikmic. -- Fix some wrong comments and typos https://github.com/xcodeswift/xcproj/pull/126 by @gubikmic - -## 1.0.0 - Acho - -### Changed - -- **Breaking:** Review optionality of attributes to align it with Xcode one https://github.com/xcodeswift/xcproj/pull/107 by @pepibumur. -- Contributing, and code of conduct point to the organization ones by @pepibumur. -- New changelog format introduced by @pepibumur. - -### Fixed - -- Use the super init to decode reference in some objects https://github.com/xcodeswift/xcproj/pull/110 by @yonaskolb -- Schemes being shared with an extension https://github.com/xcodeswift/xcproj/pull/113 by @esttorhe. -- Contributors link in the README.md https://github.com/xcodeswift/xcproj/pull/117 by @tapanprakasht. - -### Security - -## 0.4.1 - -- Add back the `BuildSettings` typelias removed by mistake https://github.com/xcodeswift/xcproj/pull/109 by @pepibumur. -- Fix a bug decoding the `PBXProject.projectRoot` property that should be decoded as an optional https://github.com/xcodeswift/xcproj/issues/108 by @pepibumur. - -## 0.4.0 - -- Remove dependency with Unbox and use the language coding/decoding features https://github.com/xcodeswift/xcproj/pull/99 by @pepibumur and @artemnovichkov. -- Enable xcproj in [Open Collective](https://opencollective.com/xcproj) by @pepibumur. -- Support parsing XCVersionGroup objects https://github.com/xcodeswift/xcproj/pull/96 by @pepibumur. -- Add iOS support to the `.podspec` https://github.com/xcodeswift/xcproj/pull/92 by @pepibumur. -- Fix comment for buildConfigurationList https://github.com/xcodeswift/xcproj/pull/93 by @toshi0383. -- Update `PBXProj` classes property to be a dictionary https://github.com/xcodeswift/xcproj/pull/94 by @toshi0383. -- Fix comment in the `BuildPhase` object https://github.com/xcodeswift/xcproj/pull/95 by @toshi0383. - -## 0.3.0 - -- Turn `PBXVariantGroup` children property into an array https://github.com/xcodeswift/xcproj/pull/88 by @pepibumur -- Add `PBXReferenceProxy` object https://github.com/xcodeswift/xcproj/pull/85 by @pepibumur -- Migrate project to Swift 4 https://github.com/xcodeswift/xcproj/pull/84 by @artemnovichkov -- Fix build phase script error undoer Xcode 9 https://github.com/xcodeswift/xcproj/pull/81 by @kixswift - -## 0.2.0 - -- Add how to use section https://github.com/xcodeswift/xcproj/pull/77 by @pepibumur -- Add contributing guidelines https://github.com/xcodeswift/xcproj/pull/76 by @pepibumur - -## 0.1.2 - -- Update shell build script phase input and output files to be array instead of set https://github.com/xcodeswift/xcproj/issues/65 by @pepibumur -- Fix wrong comment in the shell script build phase https://github.com/xcodeswift/xcproj/issues/67 by @ppeibumur -- Fix wron gcomment in `PBXSourcesBuildPhase` files property https://github.com/xcodeswift/xcproj/issues/68 by @pepibumur -- Add `XCVersionGroup` project element used by Core Data models https://github.com/xcodeswift/xcproj/issues/69 by @pepibumur -- Update `XCConcigurationList` build configurations to be an array https://github.com/xcodeswift/xcproj/issues/70 by @pepibumur - -## 0.1.1 - -- Change `BuildSettings` to `[String: Any]` https://github.com/xcodeswift/xcproj/pull/52 by @yonaskolb -- Plist fixes https://github.com/xcodeswift/xcproj/pull/54 by @yonaskolb - -## 0.1.0 - -- Update struct to classes and clean up API https://github.com/xcodeswift/xcproj/pull/51 by @yonaskolb -- Fix and cleanup strings escaping https://github.com/xcodeswift/xcproj/pull/48 by @yonaskolb -- Add `runOnlyForDeploymentPostprocessing` to `PBXShellScriptBuildPhase` by @yonaskolb -- Remove force unwrap for `XCScheme` https://github.com/xcodeswift/xcproj/pull/39 by @Shakarang - -## 0.0.9 - -- CocoaPods support https://github.com/xcodeswift/xcproj/pull/35 by @pepibumur -- Make project models mutable https://github.com/xcodeswift/xcproj/pull/33 by @yonaskolb - -## 0.0.7 - -- Downgrade Swift Tools versions to 4.0 https://github.com/xcodeswift/xcproj/pull/27 by @yonaskolb -- Make Scheme intializers public https://github.com/xcodeswift/xcproj/pull/28 by @yonaskolb -- Change PBXGroup.children to be an array https://github.com/xcodeswift/xcproj/pull/26 by @yonaskolb -- Make XcodeProj writable https://github.com/xcodeswift/xcproj/pull/20 by @yonaskolb -- Write baseConfigurationReference https://github.com/xcodeswift/xcproj/pull/24 by @yonaskolb -- Convert booleans to YES or NO https://github.com/xcodeswift/xcproj/pull/23 by @yonaskolb -- Make more properties public https://github.com/xcodeswift/xcproj/pull/19 by @yonaskolb - -## 0.0.6 - -- Fix an issue with unescaped strings by @yonaskolb https://github.com/xcodeswift/xcproj/issues/16 -- Update Swift Tools Version to 4.0 https://github.com/xcodeswift/xcproj/commit/f0f5ffe58ce0d29bb986189abf6391c6552fd347 -- Remove CryptoSwift dependency https://github.com/xcodeswift/xcproj/commit/f0f5ffe58ce0d29bb986189abf6391c6552fd347 - -## 0.0.5 - -- Remove `UUID` typealias https://github.com/xcodeswift/xcproj/pull/15 -- Add `UUID` identifier generation from `PBXProj` https://github.com/xcodeswift/xcproj/pull/14 - -## 0.0.4 - -- Writing support for `PBXProj` - https://github.com/xcodeswift/xcproj/pull/8 -- Document RELEASE process https://github.com/xcodeswift/xcproj/pull/7. -- Add documentation https://github.com/xcodeswift/xcproj/pull/6 - -## 0.0.1 - -- First version of the Swift library. -- It supports **reading** and parsing the following models: - xcodeproj. - xcworkspace. - pbxproj. - > This version doesn't support writing yet + diff --git a/cliff.toml b/cliff.toml new file mode 100644 index 000000000..fd69f534d --- /dev/null +++ b/cliff.toml @@ -0,0 +1,111 @@ +# git-cliff ~ configuration file +# https://git-cliff.org/docs/configuration + +[remote.github] +owner = "tuist" +repo = "XcodeProj" +# token = "" + +[changelog] +# template for the changelog header +header = """ +# Changelog\n +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).\n +""" +# template for the changelog body +# https://keats.github.io/tera/docs/#introduction +body = """ +{%- macro remote_url() -%} + https://github.com/{{ remote.github.owner }}/{{ remote.github.repo }} +{%- endmacro -%} + +{% if version -%} + ## [{{ version | trim_start_matches(pat="v") }}] - {{ timestamp | date(format="%Y-%m-%d") }} +{% else -%} + ## [Unreleased] +{% endif -%} + +### Details\ + +{% for group, commits in commits | group_by(attribute="group") %} + #### {{ group | upper_first }} + {%- for commit in commits %} + - {{ commit.message | upper_first | trim }}\ + {% if commit.github.username %} by @{{ commit.github.username }}{%- endif -%} + {% if commit.github.pr_number %} in \ + [#{{ commit.github.pr_number }}]({{ self::remote_url() }}/pull/{{ commit.github.pr_number }}) \ + {%- endif -%} + {% endfor %} +{% endfor %} + +{%- if github.contributors | filter(attribute="is_first_time", value=true) | length != 0 %} + ## New Contributors +{%- endif -%} + +{% for contributor in github.contributors | filter(attribute="is_first_time", value=true) %} + * @{{ contributor.username }} made their first contribution + {%- if contributor.pr_number %} in \ + [#{{ contributor.pr_number }}]({{ self::remote_url() }}/pull/{{ contributor.pr_number }}) \ + {%- endif %} +{%- endfor %}\n +""" +# template for the changelog footer +footer = """ +{%- macro remote_url() -%} + https://github.com/{{ remote.github.owner }}/{{ remote.github.repo }} +{%- endmacro -%} + +{% for release in releases -%} + {% if release.version -%} + {% if release.previous.version -%} + [{{ release.version | trim_start_matches(pat="v") }}]: \ + {{ self::remote_url() }}/compare/{{ release.previous.version }}..{{ release.version }} + {% endif -%} + {% else -%} + [unreleased]: {{ self::remote_url() }}/compare/{{ release.previous.version }}..HEAD + {% endif -%} +{% endfor %} + +Check out [GitHub releases](https://github.com/tuist/XcodeProj/releases) for older releases. + + +""" +# remove the leading and trailing whitespace from the templates +trim = true +# postprocessors +postprocessors = [] + +[git] +# parse the commits based on https://www.conventionalcommits.org +conventional_commits = true +# filter out the commits that are not conventional +filter_unconventional = true +# process each line of a commit as an individual commit +split_commits = false +# regex for preprocessing the commit messages +commit_preprocessors = [ + # remove issue numbers from commits + { pattern = '\((\w+\s)?#([0-9]+)\)', replace = "" }, +] +# protect breaking changes from being skipped due to matching a skipping commit_parser +protect_breaking_commits = false +# filter out the commits that are not matched by commit parsers +filter_commits = false +# regex for matching git tags +tag_pattern = "[0-9].*" +# regex for skipping tags +skip_tags = "beta|alpha" +# regex for ignoring tags +ignore_tags = "rc" +# sort the tags topologically +topo_order = false +# sort the commits inside sections by oldest/newest order +sort_commits = "newest" + +[bump] +breaking_always_bump_major = true +features_always_bump_minor=true +initial_tag="8.22.0" From 3ed8d9f551100ead75e49c22e02de383e87914d7 Mon Sep 17 00:00:00 2001 From: Pedro Date: Sun, 11 Aug 2024 19:03:37 +0200 Subject: [PATCH 342/678] Force release From 2b14180320b6c709597760ffde7b4c5a4a639153 Mon Sep 17 00:00:00 2001 From: pepicrft Date: Sun, 11 Aug 2024 17:07:38 +0000 Subject: [PATCH 343/678] [Release] XcodeProj 8.23.0 --- CHANGELOG.md | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 71ffcc400..4ad599852 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,9 +5,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## [Unreleased] +## [8.23.0] - 2024-08-11 ### Details #### Chore +- Continuously release releasable changes by @pepicrft in [#842](https://github.com/tuist/XcodeProj/pull/842) +- Update dependency tuist to v4.23.0 by @renovate[bot] in [#839](https://github.com/tuist/XcodeProj/pull/839) +- Disable the renovatebot dashboard by @pepicrft in [#840](https://github.com/tuist/XcodeProj/pull/840) - Set up SwiftLint and SwiftFormat, run them against the project, and run them as part of the CI workflows by @pepicrft in [#836](https://github.com/tuist/XcodeProj/pull/836) #### Docs @@ -16,6 +19,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 #### Feat - Introduce the new Xcode 16 models `PBXFileSystemSynchronizedRootGroup` and `PBXFileSystemSynchronizedBuildFileExceptionSet` by @pepicrft in [#827](https://github.com/tuist/XcodeProj/pull/827) -[unreleased]: https://github.com/tuist/XcodeProj/compare/8.22.0..HEAD +[8.23.0]: https://github.com/tuist/XcodeProj/compare/8.22.0..8.23.0 + + +Check out [GitHub releases](https://github.com/tuist/XcodeProj/releases) for older releases. From 20f754ab6c0daceb88664ca43b27eec65455d3a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20Pi=C3=B1era=20Buend=C3=ADa?= <663605+pepicrft@users.noreply.github.com> Date: Sun, 11 Aug 2024 19:48:50 +0200 Subject: [PATCH 344/678] Update renovate.json --- renovate.json | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/renovate.json b/renovate.json index d64bfc863..d59546372 100644 --- a/renovate.json +++ b/renovate.json @@ -1,14 +1,19 @@ { "$schema": "https://docs.renovatebot.com/renovate-schema.json", "extends": [ - "config:base", - ":disableDependencyDashboard" + ":semanticCommits", + "config:recommended" ], "packageRules": [ { "matchUpdateTypes": ["minor", "patch", "pin", "digest"], "automerge": true, - "automergeType": "pr" + "automergeType": "pr", + "automergeStrategy": "auto" } - ] + ], + "lockFileMaintenance": { + "enabled": true, + "automerge": true + } } From a8cdfd3b7a548952ec17139d1b13f42c9d8d8013 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20Pi=C3=B1era=20Buend=C3=ADa?= <663605+pepicrft@users.noreply.github.com> Date: Sun, 11 Aug 2024 19:50:21 +0200 Subject: [PATCH 345/678] Update renovate.json --- renovate.json | 1 + 1 file changed, 1 insertion(+) diff --git a/renovate.json b/renovate.json index d59546372..9ec02b3bc 100644 --- a/renovate.json +++ b/renovate.json @@ -2,6 +2,7 @@ "$schema": "https://docs.renovatebot.com/renovate-schema.json", "extends": [ ":semanticCommits", + ":disableDependencyDashboard", "config:recommended" ], "packageRules": [ From 65652d434b6f4ceb54a172e08028272112a5f878 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 19 Aug 2024 18:34:09 +0000 Subject: [PATCH 346/678] chore(deps): update dependency tuist to v4.24.0 --- .mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise.toml b/.mise.toml index 5e6041a47..457da3ae4 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,5 +1,5 @@ [tools] swiftformat = "0.54.3" -tuist = "4.23.0" +tuist = "4.24.0" swiftlint = "0.55.1" "git-cliff" = "2.4.0" From c15e011dc0ea74f7833bf33c2791483beb9c7577 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" Date: Mon, 19 Aug 2024 22:00:25 +0000 Subject: [PATCH 347/678] [Release] XcodeProj 8.23.1 --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4ad599852..b02d4c886 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,11 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [8.23.1] - 2024-08-19 +### Details +#### Chore +- Update dependency tuist to v4.24.0 by @renovate[bot] in [#844](https://github.com/tuist/XcodeProj/pull/844) + ## [8.23.0] - 2024-08-11 ### Details #### Chore @@ -19,6 +24,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 #### Feat - Introduce the new Xcode 16 models `PBXFileSystemSynchronizedRootGroup` and `PBXFileSystemSynchronizedBuildFileExceptionSet` by @pepicrft in [#827](https://github.com/tuist/XcodeProj/pull/827) +[8.23.1]: https://github.com/tuist/XcodeProj/compare/8.23.0..8.23.1 [8.23.0]: https://github.com/tuist/XcodeProj/compare/8.22.0..8.23.0 From f893e23f4e61ca6704f41c13b23d4f9bd4113207 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 23 Aug 2024 11:16:11 +0000 Subject: [PATCH 348/678] chore(deps): update dependency apple/swift-docc-plugin to from: "1.4.1" --- Package.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Package.swift b/Package.swift index 4e4b66835..d8e3cbab7 100644 --- a/Package.swift +++ b/Package.swift @@ -10,7 +10,7 @@ let package = Package( dependencies: [ .package(url: "https://github.com/tadija/AEXML.git", .upToNextMinor(from: "4.6.1")), .package(url: "https://github.com/kylef/PathKit.git", .upToNextMinor(from: "1.0.1")), - .package(url: "https://github.com/apple/swift-docc-plugin", from: "1.3.0"), + .package(url: "https://github.com/apple/swift-docc-plugin", from: "1.4.1"), ], targets: [ .target(name: "XcodeProj", From a1ff175a2f3bfbec166f33b264263c55f2149720 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" Date: Fri, 23 Aug 2024 14:27:51 +0000 Subject: [PATCH 349/678] [Release] XcodeProj 8.23.2 --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index b02d4c886..2674bd6f1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,11 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [8.23.2] - 2024-08-23 +### Details +#### Chore +- Update dependency apple/swift-docc-plugin to from: "1.4.1" by @renovate[bot] in [#848](https://github.com/tuist/XcodeProj/pull/848) + ## [8.23.1] - 2024-08-19 ### Details #### Chore @@ -24,6 +29,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 #### Feat - Introduce the new Xcode 16 models `PBXFileSystemSynchronizedRootGroup` and `PBXFileSystemSynchronizedBuildFileExceptionSet` by @pepicrft in [#827](https://github.com/tuist/XcodeProj/pull/827) +[8.23.2]: https://github.com/tuist/XcodeProj/compare/8.23.1..8.23.2 [8.23.1]: https://github.com/tuist/XcodeProj/compare/8.23.0..8.23.1 [8.23.0]: https://github.com/tuist/XcodeProj/compare/8.22.0..8.23.0 From 432adf38805cff88d0529f122c4c636ce9b10628 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 27 Aug 2024 13:08:36 +0000 Subject: [PATCH 350/678] chore(deps): update dependency tuist to v4.25.0 --- .mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise.toml b/.mise.toml index 457da3ae4..0608afa69 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,5 +1,5 @@ [tools] swiftformat = "0.54.3" -tuist = "4.24.0" +tuist = "4.25.0" swiftlint = "0.55.1" "git-cliff" = "2.4.0" From 4cd0544600459a6a37a0fb8eed5d7c21205164d6 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" Date: Tue, 27 Aug 2024 16:11:53 +0000 Subject: [PATCH 351/678] [Release] XcodeProj 8.23.3 --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2674bd6f1..0bd635330 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,11 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [8.23.3] - 2024-08-27 +### Details +#### Chore +- Update dependency tuist to v4.25.0 by @renovate[bot] in [#849](https://github.com/tuist/XcodeProj/pull/849) + ## [8.23.2] - 2024-08-23 ### Details #### Chore @@ -29,6 +34,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 #### Feat - Introduce the new Xcode 16 models `PBXFileSystemSynchronizedRootGroup` and `PBXFileSystemSynchronizedBuildFileExceptionSet` by @pepicrft in [#827](https://github.com/tuist/XcodeProj/pull/827) +[8.23.3]: https://github.com/tuist/XcodeProj/compare/8.23.2..8.23.3 [8.23.2]: https://github.com/tuist/XcodeProj/compare/8.23.1..8.23.2 [8.23.1]: https://github.com/tuist/XcodeProj/compare/8.23.0..8.23.1 [8.23.0]: https://github.com/tuist/XcodeProj/compare/8.22.0..8.23.0 From e7d888648073c9062aff742c3e3ef11315ed63d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20Pi=C3=B1era=20Buend=C3=ADa?= <663605+pepicrft@users.noreply.github.com> Date: Wed, 28 Aug 2024 17:20:21 +0200 Subject: [PATCH 352/678] Update CODE_OF_CONDUCT.md --- CODE_OF_CONDUCT.md | 129 ++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 127 insertions(+), 2 deletions(-) diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index c8d974ca1..a74f7e61f 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -1,3 +1,128 @@ -# Code of conduct +# Contributor Covenant Code of Conduct -The code of conduct is available in [Tuist's handbook](https://handbook.tuist.io/people/code-of-conduct.html). +## Our Pledge + +We as members, contributors, and leaders pledge to make participation in our +community a harassment-free experience for everyone, regardless of age, body +size, visible or invisible disability, ethnicity, sex characteristics, gender +identity and expression, level of experience, education, socio-economic status, +nationality, personal appearance, race, religion, or sexual identity +and orientation. + +We pledge to act and interact in ways that contribute to an open, welcoming, +diverse, inclusive, and healthy community. + +## Our Standards + +Examples of behavior that contributes to a positive environment for our +community include: + +* Demonstrating empathy and kindness toward other people +* Being respectful of differing opinions, viewpoints, and experiences +* Giving and gracefully accepting constructive feedback +* Accepting responsibility and apologizing to those affected by our mistakes, + and learning from the experience +* Focusing on what is best not just for us as individuals, but for the + overall community + +Examples of unacceptable behavior include: + +* The use of sexualized language or imagery, and sexual attention or + advances of any kind +* Trolling, insulting or derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or email + address, without their explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Enforcement Responsibilities + +Community leaders are responsible for clarifying and enforcing our standards of +acceptable behavior and will take appropriate and fair corrective action in +response to any behavior that they deem inappropriate, threatening, offensive, +or harmful. + +Community leaders have the right and responsibility to remove, edit, or reject +comments, commits, code, wiki edits, issues, and other contributions that are +not aligned to this Code of Conduct, and will communicate reasons for moderation +decisions when appropriate. + +## Scope + +This Code of Conduct applies within all community spaces, and also applies when +an individual is officially representing the community in public spaces. +Examples of representing our community include using an official e-mail address, +posting via an official social media account, or acting as an appointed +representative at an online or offline event. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be +reported to the community leaders responsible for enforcement at +oss@tuist.io. +All complaints will be reviewed and investigated promptly and fairly. + +All community leaders are obligated to respect the privacy and security of the +reporter of any incident. + +## Enforcement Guidelines + +Community leaders will follow these Community Impact Guidelines in determining +the consequences for any action they deem in violation of this Code of Conduct: + +### 1. Correction + +**Community Impact**: Use of inappropriate language or other behavior deemed +unprofessional or unwelcome in the community. + +**Consequence**: A private, written warning from community leaders, providing +clarity around the nature of the violation and an explanation of why the +behavior was inappropriate. A public apology may be requested. + +### 2. Warning + +**Community Impact**: A violation through a single incident or series +of actions. + +**Consequence**: A warning with consequences for continued behavior. No +interaction with the people involved, including unsolicited interaction with +those enforcing the Code of Conduct, for a specified period of time. This +includes avoiding interactions in community spaces as well as external channels +like social media. Violating these terms may lead to a temporary or +permanent ban. + +### 3. Temporary Ban + +**Community Impact**: A serious violation of community standards, including +sustained inappropriate behavior. + +**Consequence**: A temporary ban from any sort of interaction or public +communication with the community for a specified period of time. No public or +private interaction with the people involved, including unsolicited interaction +with those enforcing the Code of Conduct, is allowed during this period. +Violating these terms may lead to a permanent ban. + +### 4. Permanent Ban + +**Community Impact**: Demonstrating a pattern of violation of community +standards, including sustained inappropriate behavior, harassment of an +individual, or aggression toward or disparagement of classes of individuals. + +**Consequence**: A permanent ban from any sort of public interaction within +the community. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], +version 2.0, available at +https://www.contributor-covenant.org/version/2/0/code_of_conduct.html. + +Community Impact Guidelines were inspired by [Mozilla's code of conduct +enforcement ladder](https://github.com/mozilla/diversity). + +[homepage]: https://www.contributor-covenant.org + +For answers to common questions about this code of conduct, see the FAQ at +https://www.contributor-covenant.org/faq. Translations are available at +https://www.contributor-covenant.org/translations. From 8e46b9ffd80d697e96bda4306884fc18b9a1129d Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 29 Aug 2024 17:19:08 +0000 Subject: [PATCH 353/678] chore(deps): update dependency apple/swift-docc-plugin to from: "1.4.2" --- Package.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Package.swift b/Package.swift index d8e3cbab7..bf226e444 100644 --- a/Package.swift +++ b/Package.swift @@ -10,7 +10,7 @@ let package = Package( dependencies: [ .package(url: "https://github.com/tadija/AEXML.git", .upToNextMinor(from: "4.6.1")), .package(url: "https://github.com/kylef/PathKit.git", .upToNextMinor(from: "1.0.1")), - .package(url: "https://github.com/apple/swift-docc-plugin", from: "1.4.1"), + .package(url: "https://github.com/apple/swift-docc-plugin", from: "1.4.2"), ], targets: [ .target(name: "XcodeProj", From c98062d2ae6e267715fc584538d43927622898ea Mon Sep 17 00:00:00 2001 From: "renovate[bot]" Date: Thu, 29 Aug 2024 19:54:04 +0000 Subject: [PATCH 354/678] [Release] XcodeProj 8.23.4 --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0bd635330..30e2a4958 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,11 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [8.23.4] - 2024-08-29 +### Details +#### Chore +- Update dependency apple/swift-docc-plugin to from: "1.4.2" by @renovate[bot] in [#850](https://github.com/tuist/XcodeProj/pull/850) + ## [8.23.3] - 2024-08-27 ### Details #### Chore @@ -34,6 +39,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 #### Feat - Introduce the new Xcode 16 models `PBXFileSystemSynchronizedRootGroup` and `PBXFileSystemSynchronizedBuildFileExceptionSet` by @pepicrft in [#827](https://github.com/tuist/XcodeProj/pull/827) +[8.23.4]: https://github.com/tuist/XcodeProj/compare/8.23.3..8.23.4 [8.23.3]: https://github.com/tuist/XcodeProj/compare/8.23.2..8.23.3 [8.23.2]: https://github.com/tuist/XcodeProj/compare/8.23.1..8.23.2 [8.23.1]: https://github.com/tuist/XcodeProj/compare/8.23.0..8.23.1 From 677678108eca6b0061d37b481a5b8b52408e2f0e Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 3 Sep 2024 16:29:55 +0000 Subject: [PATCH 355/678] chore(deps): update dependency tuist to v4.26.0 --- .mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise.toml b/.mise.toml index 0608afa69..70cc31a47 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,5 +1,5 @@ [tools] swiftformat = "0.54.3" -tuist = "4.25.0" +tuist = "4.26.0" swiftlint = "0.55.1" "git-cliff" = "2.4.0" From ea4be99ddc4664aa3198b63ee7d7b83e69e19631 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" Date: Tue, 3 Sep 2024 18:59:22 +0000 Subject: [PATCH 356/678] [Release] XcodeProj 8.23.5 --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 30e2a4958..d85e70976 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,11 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [8.23.5] - 2024-09-03 +### Details +#### Chore +- Update dependency tuist to v4.26.0 by @renovate[bot] in [#851](https://github.com/tuist/XcodeProj/pull/851) + ## [8.23.4] - 2024-08-29 ### Details #### Chore @@ -39,6 +44,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 #### Feat - Introduce the new Xcode 16 models `PBXFileSystemSynchronizedRootGroup` and `PBXFileSystemSynchronizedBuildFileExceptionSet` by @pepicrft in [#827](https://github.com/tuist/XcodeProj/pull/827) +[8.23.5]: https://github.com/tuist/XcodeProj/compare/8.23.4..8.23.5 [8.23.4]: https://github.com/tuist/XcodeProj/compare/8.23.3..8.23.4 [8.23.3]: https://github.com/tuist/XcodeProj/compare/8.23.2..8.23.3 [8.23.2]: https://github.com/tuist/XcodeProj/compare/8.23.1..8.23.2 From d4482ec0a623a7ad1a782ec9b1094bb807add267 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 10 Sep 2024 13:06:47 +0000 Subject: [PATCH 357/678] chore(deps): update dependency apple/swift-docc-plugin to from: "1.4.3" --- Package.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Package.swift b/Package.swift index bf226e444..548f0c23b 100644 --- a/Package.swift +++ b/Package.swift @@ -10,7 +10,7 @@ let package = Package( dependencies: [ .package(url: "https://github.com/tadija/AEXML.git", .upToNextMinor(from: "4.6.1")), .package(url: "https://github.com/kylef/PathKit.git", .upToNextMinor(from: "1.0.1")), - .package(url: "https://github.com/apple/swift-docc-plugin", from: "1.4.2"), + .package(url: "https://github.com/apple/swift-docc-plugin", from: "1.4.3"), ], targets: [ .target(name: "XcodeProj", From aaef02b5d7a78aae5ff6d7b2a1c8349dd596e6ea Mon Sep 17 00:00:00 2001 From: "renovate[bot]" Date: Tue, 10 Sep 2024 16:44:19 +0000 Subject: [PATCH 358/678] [Release] XcodeProj 8.23.6 --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d85e70976..4dd087af4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,11 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [8.23.6] - 2024-09-10 +### Details +#### Chore +- Update dependency apple/swift-docc-plugin to from: "1.4.3" by @renovate[bot] in [#853](https://github.com/tuist/XcodeProj/pull/853) + ## [8.23.5] - 2024-09-03 ### Details #### Chore @@ -44,6 +49,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 #### Feat - Introduce the new Xcode 16 models `PBXFileSystemSynchronizedRootGroup` and `PBXFileSystemSynchronizedBuildFileExceptionSet` by @pepicrft in [#827](https://github.com/tuist/XcodeProj/pull/827) +[8.23.6]: https://github.com/tuist/XcodeProj/compare/8.23.5..8.23.6 [8.23.5]: https://github.com/tuist/XcodeProj/compare/8.23.4..8.23.5 [8.23.4]: https://github.com/tuist/XcodeProj/compare/8.23.3..8.23.4 [8.23.3]: https://github.com/tuist/XcodeProj/compare/8.23.2..8.23.3 From 1f027720ec4dc174a3657d17a40344549cdaa501 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 19 Sep 2024 12:21:59 +0000 Subject: [PATCH 359/678] chore(deps): update dependency tuist to v4.27.0 --- .mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise.toml b/.mise.toml index 70cc31a47..1a0125f84 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,5 +1,5 @@ [tools] swiftformat = "0.54.3" -tuist = "4.26.0" +tuist = "4.27.0" swiftlint = "0.55.1" "git-cliff" = "2.4.0" From ec42c0c7fb0a514793553e22c4052409517b3ebb Mon Sep 17 00:00:00 2001 From: "renovate[bot]" Date: Thu, 19 Sep 2024 16:19:55 +0000 Subject: [PATCH 360/678] [Release] XcodeProj 8.23.7 --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4dd087af4..5cade7c5a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,11 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [8.23.7] - 2024-09-19 +### Details +#### Chore +- Update dependency tuist to v4.27.0 by @renovate[bot] in [#856](https://github.com/tuist/XcodeProj/pull/856) + ## [8.23.6] - 2024-09-10 ### Details #### Chore @@ -49,6 +54,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 #### Feat - Introduce the new Xcode 16 models `PBXFileSystemSynchronizedRootGroup` and `PBXFileSystemSynchronizedBuildFileExceptionSet` by @pepicrft in [#827](https://github.com/tuist/XcodeProj/pull/827) +[8.23.7]: https://github.com/tuist/XcodeProj/compare/8.23.6..8.23.7 [8.23.6]: https://github.com/tuist/XcodeProj/compare/8.23.5..8.23.6 [8.23.5]: https://github.com/tuist/XcodeProj/compare/8.23.4..8.23.5 [8.23.4]: https://github.com/tuist/XcodeProj/compare/8.23.3..8.23.4 From fe420c474b3b7eec620ce83823f9dc4304f16815 Mon Sep 17 00:00:00 2001 From: ScaryKermitDev <30935200+Howler4695@users.noreply.github.com> Date: Thu, 26 Sep 2024 11:25:40 -0500 Subject: [PATCH 361/678] fix: error: ambiguous use of 'arc4random_uniform' on Linux distros (#846) * apply fix for error: ambiguous use of 'arc4random_uniform' * Got rid of unneeded cast * fix lint --- Sources/XcodeProj/Extensions/String+Utils.swift | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/Sources/XcodeProj/Extensions/String+Utils.swift b/Sources/XcodeProj/Extensions/String+Utils.swift index 51fc0bf35..b5f4a2614 100644 --- a/Sources/XcodeProj/Extensions/String+Utils.swift +++ b/Sources/XcodeProj/Extensions/String+Utils.swift @@ -1,13 +1,5 @@ import Foundation -#if os(Linux) - import SwiftGlibc - - public func arc4random_uniform(_ max: UInt32) -> Int32 { - SwiftGlibc.rand() % Int32(max - 1) - } -#endif - public extension String { var quoted: String { "\"\(self)\"" @@ -22,8 +14,8 @@ public extension String { var randomString = "" for _ in 0 ..< length { - let randomValue = arc4random_uniform(UInt32(base.count)) - randomString += "\(base[base.index(base.startIndex, offsetBy: Int(randomValue))])" + let randomValue = Int.random(in: 0 ..< base.count) + randomString += "\(base[base.index(base.startIndex, offsetBy: randomValue)])" } return randomString } From 46fe15644abd14df0c288ba55ab00eda32e78a18 Mon Sep 17 00:00:00 2001 From: pepicrft Date: Thu, 26 Sep 2024 16:26:03 +0000 Subject: [PATCH 362/678] [Release] XcodeProj 8.23.8 --- CHANGELOG.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5cade7c5a..147f26553 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [8.23.8] - 2024-09-26 +### Details +#### Fix +- Error: ambiguous use of 'arc4random_uniform' on Linux distros by @Howler4695 in [#846](https://github.com/tuist/XcodeProj/pull/846) + +## New Contributors +* @Howler4695 made their first contribution in [#846](https://github.com/tuist/XcodeProj/pull/846) ## [8.23.7] - 2024-09-19 ### Details #### Chore @@ -54,6 +61,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 #### Feat - Introduce the new Xcode 16 models `PBXFileSystemSynchronizedRootGroup` and `PBXFileSystemSynchronizedBuildFileExceptionSet` by @pepicrft in [#827](https://github.com/tuist/XcodeProj/pull/827) +[8.23.8]: https://github.com/tuist/XcodeProj/compare/8.23.7..8.23.8 [8.23.7]: https://github.com/tuist/XcodeProj/compare/8.23.6..8.23.7 [8.23.6]: https://github.com/tuist/XcodeProj/compare/8.23.5..8.23.6 [8.23.5]: https://github.com/tuist/XcodeProj/compare/8.23.4..8.23.5 From 22eea63522b856925d75c4f0c5ad7b08185b367d Mon Sep 17 00:00:00 2001 From: Kim de Vos Date: Fri, 27 Sep 2024 17:18:34 +0200 Subject: [PATCH 363/678] fix: order for `XCLocalSwiftPackageReference` and `XCRemoteSwiftPackageReference` (#855) * Flip the order of `XCLocalSwiftPackageReference` and `XCRemoteSwiftPackageReference` * Add tasks to run tests and build the package in Linux from a macOS environment using Podman * Install Swift in the Linux environments * Remove Tests/LinuxMain.swift * Build and test in a virtualized Linux container from the macOS environment * Set up Docker * Install Podman * Initialize the machine before starting it * Run from ubuntu-latest --------- Co-authored-by: Pedro --- .github/workflows/xcodeproj.yml | 28 ++---- .mise.toml | 1 + .mise/tasks/build | 4 + .mise/tasks/build-linux | 16 ++++ .mise/tasks/test | 4 + .mise/tasks/test-linux | 16 ++++ Package.resolved | 96 +++++++++---------- .../Objects/Project/PBXProjEncoder.swift | 8 +- Tests/LinuxMain.swift | 8 -- 9 files changed, 102 insertions(+), 79 deletions(-) create mode 100755 .mise/tasks/build create mode 100755 .mise/tasks/build-linux create mode 100755 .mise/tasks/test create mode 100755 .mise/tasks/test-linux delete mode 100644 Tests/LinuxMain.swift diff --git a/.github/workflows/xcodeproj.yml b/.github/workflows/xcodeproj.yml index 5d1e3b5f7..904880cdb 100644 --- a/.github/workflows/xcodeproj.yml +++ b/.github/workflows/xcodeproj.yml @@ -20,42 +20,34 @@ jobs: runs-on: macos-latest steps: - uses: actions/checkout@v3 - - uses: maxim-lobanov/setup-xcode@v1 - with: - xcode-version: latest-stable + - uses: jdx/mise-action@v2 - name: Build - run: swift build -c release + run: mise run build build-linux: name: Build (Linux) runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 + - uses: jdx/mise-action@v2 - name: Build - run: swift build -c release + run: mise run build-linux test: name: Test (macOS / Xcode) runs-on: macos-latest steps: - uses: actions/checkout@v3 - - uses: maxim-lobanov/setup-xcode@v1 - with: - xcode-version: latest-stable + - uses: jdx/mise-action@v2 - name: Run tests - run: swift test --enable-code-coverage - - name: Send test coverage report - run: bash <(curl -s https://codecov.io/bash) + run: mise run test + test-linux: name: Test (Linux) runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - - name: Set Git config - run: | - git config --global user.email "xcodeproj@tuist.io" - git config --global user.name "xcodeproj" - git config --global init.defaultBranch main - - name: Build and run tests - run: swift test --enable-test-discovery + - uses: jdx/mise-action@v2 + - name: Test + run: mise run test-linux lint: name: Lint diff --git a/.mise.toml b/.mise.toml index 1a0125f84..39b93e5d9 100644 --- a/.mise.toml +++ b/.mise.toml @@ -2,4 +2,5 @@ swiftformat = "0.54.3" tuist = "4.27.0" swiftlint = "0.55.1" +swift="5.10.1" "git-cliff" = "2.4.0" diff --git a/.mise/tasks/build b/.mise/tasks/build new file mode 100755 index 000000000..59b111039 --- /dev/null +++ b/.mise/tasks/build @@ -0,0 +1,4 @@ +#!/usr/bin/env bash +# mise description="Build the package in the host" + +swift build --package-path $MISE_PROJECT_ROOT --configuration debug diff --git a/.mise/tasks/build-linux b/.mise/tasks/build-linux new file mode 100755 index 000000000..ca969937a --- /dev/null +++ b/.mise/tasks/build-linux @@ -0,0 +1,16 @@ +#!/usr/bin/env bash +# mise description="Build on Linux" + +CONTAINER_RUNTIME=$(command -v podman || command -v docker) + +if [ -z "$CONTAINER_RUNTIME" ]; then + echo "Neither podman nor docker is available. Please install one to proceed." + exit 1 +fi + +$CONTAINER_RUNTIME run --rm --interactive --tty --volume "$(pwd):/package" --workdir "/package" swift:5.10.1 bash -c " + git config --global user.email 'xcodeproj@tuist.io' && + git config --global user.name 'xcodeproj' && + git config --global init.defaultBranch main && + swift build --configuration release +" diff --git a/.mise/tasks/test b/.mise/tasks/test new file mode 100755 index 000000000..8103d2d5f --- /dev/null +++ b/.mise/tasks/test @@ -0,0 +1,4 @@ +#!/usr/bin/env bash +# mise description="Run tests in the host" + +swift test --package-path $MISE_PROJECT_ROOT diff --git a/.mise/tasks/test-linux b/.mise/tasks/test-linux new file mode 100755 index 000000000..03150d3c7 --- /dev/null +++ b/.mise/tasks/test-linux @@ -0,0 +1,16 @@ +#!/usr/bin/env bash +# mise description="Run tests on Linux" + +CONTAINER_RUNTIME=$(command -v podman || command -v docker) + +if [ -z "$CONTAINER_RUNTIME" ]; then + echo "Neither podman nor docker is available. Please install one to proceed." + exit 1 +fi + +$CONTAINER_RUNTIME run --rm --interactive --tty --volume "$(pwd):/package" --workdir "/package" swift:5.10.1 bash -c " + git config --global user.email 'xcodeproj@tuist.io' && + git config --global user.name 'xcodeproj' && + git config --global init.defaultBranch main && + swift test +" diff --git a/Package.resolved b/Package.resolved index 03a6b4a69..36febe524 100644 --- a/Package.resolved +++ b/Package.resolved @@ -1,52 +1,50 @@ { - "object": { - "pins": [ - { - "package": "AEXML", - "repositoryURL": "https://github.com/tadija/AEXML.git", - "state": { - "branch": null, - "revision": "38f7d00b23ecd891e1ee656fa6aeebd6ba04ecc3", - "version": "4.6.1" - } - }, - { - "package": "PathKit", - "repositoryURL": "https://github.com/kylef/PathKit.git", - "state": { - "branch": null, - "revision": "3bfd2737b700b9a36565a8c94f4ad2b050a5e574", - "version": "1.0.1" - } - }, - { - "package": "Spectre", - "repositoryURL": "https://github.com/kylef/Spectre.git", - "state": { - "branch": null, - "revision": "26cc5e9ae0947092c7139ef7ba612e34646086c7", - "version": "0.10.1" - } - }, - { - "package": "SwiftDocCPlugin", - "repositoryURL": "https://github.com/apple/swift-docc-plugin", - "state": { - "branch": null, - "revision": "26ac5758409154cc448d7ab82389c520fa8a8247", - "version": "1.3.0" - } - }, - { - "package": "SymbolKit", - "repositoryURL": "https://github.com/apple/swift-docc-symbolkit", - "state": { - "branch": null, - "revision": "b45d1f2ed151d057b54504d653e0da5552844e34", - "version": "1.0.0" - } + "pins" : [ + { + "identity" : "aexml", + "kind" : "remoteSourceControl", + "location" : "https://github.com/tadija/AEXML.git", + "state" : { + "revision" : "38f7d00b23ecd891e1ee656fa6aeebd6ba04ecc3", + "version" : "4.6.1" } - ] - }, - "version": 1 + }, + { + "identity" : "pathkit", + "kind" : "remoteSourceControl", + "location" : "https://github.com/kylef/PathKit.git", + "state" : { + "revision" : "3bfd2737b700b9a36565a8c94f4ad2b050a5e574", + "version" : "1.0.1" + } + }, + { + "identity" : "spectre", + "kind" : "remoteSourceControl", + "location" : "https://github.com/kylef/Spectre.git", + "state" : { + "revision" : "26cc5e9ae0947092c7139ef7ba612e34646086c7", + "version" : "0.10.1" + } + }, + { + "identity" : "swift-docc-plugin", + "kind" : "remoteSourceControl", + "location" : "https://github.com/apple/swift-docc-plugin", + "state" : { + "revision" : "85e4bb4e1cd62cec64a4b8e769dcefdf0c5b9d64", + "version" : "1.4.3" + } + }, + { + "identity" : "swift-docc-symbolkit", + "kind" : "remoteSourceControl", + "location" : "https://github.com/swiftlang/swift-docc-symbolkit", + "state" : { + "revision" : "b45d1f2ed151d057b54504d653e0da5552844e34", + "version" : "1.0.0" + } + } + ], + "version" : 2 } diff --git a/Sources/XcodeProj/Objects/Project/PBXProjEncoder.swift b/Sources/XcodeProj/Objects/Project/PBXProjEncoder.swift index 9ee78300c..7321fb1d0 100644 --- a/Sources/XcodeProj/Objects/Project/PBXProjEncoder.swift +++ b/Sources/XcodeProj/Objects/Project/PBXProjEncoder.swift @@ -215,15 +215,15 @@ final class PBXProjEncoder { outputSettings: outputSettings, stateHolder: &stateHolder, to: &output) - try write(section: "XCRemoteSwiftPackageReference", + try write(section: "XCLocalSwiftPackageReference", proj: proj, - objects: proj.objects.remoteSwiftPackageReferences, + objects: proj.objects.localSwiftPackageReferences, outputSettings: outputSettings, stateHolder: &stateHolder, to: &output) - try write(section: "XCLocalSwiftPackageReference", + try write(section: "XCRemoteSwiftPackageReference", proj: proj, - objects: proj.objects.localSwiftPackageReferences, + objects: proj.objects.remoteSwiftPackageReferences, outputSettings: outputSettings, stateHolder: &stateHolder, to: &output) diff --git a/Tests/LinuxMain.swift b/Tests/LinuxMain.swift deleted file mode 100644 index 7a12607d4..000000000 --- a/Tests/LinuxMain.swift +++ /dev/null @@ -1,8 +0,0 @@ -import XCTest - -import XcodeProjTests - -var tests = [XCTestCaseEntry]() -tests += XcodeProjTests.__allTests() - -XCTMain(tests) From 4b60b9bd08e71b19b00d30eb82f440d7361dbd93 Mon Sep 17 00:00:00 2001 From: pepicrft Date: Fri, 27 Sep 2024 15:19:28 +0000 Subject: [PATCH 364/678] [Release] XcodeProj 8.23.9 --- CHANGELOG.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 147f26553..0ba776157 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [8.23.9] - 2024-09-27 +### Details +#### Fix +- Order for `XCLocalSwiftPackageReference` and `XCRemoteSwiftPackageReference` by @kimdv in [#855](https://github.com/tuist/XcodeProj/pull/855) + +## New Contributors +* @kimdv made their first contribution in [#855](https://github.com/tuist/XcodeProj/pull/855) ## [8.23.8] - 2024-09-26 ### Details #### Fix @@ -61,6 +68,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 #### Feat - Introduce the new Xcode 16 models `PBXFileSystemSynchronizedRootGroup` and `PBXFileSystemSynchronizedBuildFileExceptionSet` by @pepicrft in [#827](https://github.com/tuist/XcodeProj/pull/827) +[8.23.9]: https://github.com/tuist/XcodeProj/compare/8.23.8..8.23.9 [8.23.8]: https://github.com/tuist/XcodeProj/compare/8.23.7..8.23.8 [8.23.7]: https://github.com/tuist/XcodeProj/compare/8.23.6..8.23.7 [8.23.6]: https://github.com/tuist/XcodeProj/compare/8.23.5..8.23.6 From 82f4c8219b1d270cec93201d6c16c102ec38d7ad Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 27 Sep 2024 17:26:59 +0200 Subject: [PATCH 365/678] chore(deps): update dependency tuist to v4.28.1 (#857) * Remove Swift from the .mise.toml * Do not match commit titles when there's a single commit --------- Co-authored-by: Pedro --- .github/workflows/conventional-pr.yml | 2 ++ .mise.toml | 1 - 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/conventional-pr.yml b/.github/workflows/conventional-pr.yml index c145cda3d..d41825ced 100644 --- a/.github/workflows/conventional-pr.yml +++ b/.github/workflows/conventional-pr.yml @@ -14,5 +14,7 @@ jobs: steps: - uses: actions/checkout@v2 - uses: CondeNast/conventional-pull-request-action@v0.2.0 + with: + commitTitleMatch: false env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.mise.toml b/.mise.toml index 39b93e5d9..1a0125f84 100644 --- a/.mise.toml +++ b/.mise.toml @@ -2,5 +2,4 @@ swiftformat = "0.54.3" tuist = "4.27.0" swiftlint = "0.55.1" -swift="5.10.1" "git-cliff" = "2.4.0" From fb82a52d0fcc8f50c2593785ba94873d8c9353ff Mon Sep 17 00:00:00 2001 From: pepicrft Date: Fri, 27 Sep 2024 15:27:16 +0000 Subject: [PATCH 366/678] [Release] XcodeProj 8.23.10 --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0ba776157..8ed29edbf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,11 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [8.23.10] - 2024-09-27 +### Details +#### Chore +- Update dependency tuist to v4.28.1 by @renovate[bot] in [#857](https://github.com/tuist/XcodeProj/pull/857) + ## [8.23.9] - 2024-09-27 ### Details #### Fix @@ -68,6 +73,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 #### Feat - Introduce the new Xcode 16 models `PBXFileSystemSynchronizedRootGroup` and `PBXFileSystemSynchronizedBuildFileExceptionSet` by @pepicrft in [#827](https://github.com/tuist/XcodeProj/pull/827) +[8.23.10]: https://github.com/tuist/XcodeProj/compare/8.23.9..8.23.10 [8.23.9]: https://github.com/tuist/XcodeProj/compare/8.23.8..8.23.9 [8.23.8]: https://github.com/tuist/XcodeProj/compare/8.23.7..8.23.8 [8.23.7]: https://github.com/tuist/XcodeProj/compare/8.23.6..8.23.7 From a600d997bc0d910c6c392833e71c1f33435c0247 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 27 Sep 2024 17:35:26 +0200 Subject: [PATCH 367/678] chore(deps): update dependency tuist to v4.28.1 (#858) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise.toml b/.mise.toml index 1a0125f84..953d2b026 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,5 +1,5 @@ [tools] swiftformat = "0.54.3" -tuist = "4.27.0" +tuist = "4.28.1" swiftlint = "0.55.1" "git-cliff" = "2.4.0" From 4c9414f2b8f9490ef6665777a6fcc931d232b1ec Mon Sep 17 00:00:00 2001 From: pepicrft Date: Fri, 27 Sep 2024 15:35:53 +0000 Subject: [PATCH 368/678] [Release] XcodeProj 8.23.11 --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8ed29edbf..dcc17a95c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,11 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [8.23.11] - 2024-09-27 +### Details +#### Chore +- Update dependency tuist to v4.28.1 by @renovate[bot] in [#858](https://github.com/tuist/XcodeProj/pull/858) + ## [8.23.10] - 2024-09-27 ### Details #### Chore @@ -73,6 +78,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 #### Feat - Introduce the new Xcode 16 models `PBXFileSystemSynchronizedRootGroup` and `PBXFileSystemSynchronizedBuildFileExceptionSet` by @pepicrft in [#827](https://github.com/tuist/XcodeProj/pull/827) +[8.23.11]: https://github.com/tuist/XcodeProj/compare/8.23.10..8.23.11 [8.23.10]: https://github.com/tuist/XcodeProj/compare/8.23.9..8.23.10 [8.23.9]: https://github.com/tuist/XcodeProj/compare/8.23.8..8.23.9 [8.23.8]: https://github.com/tuist/XcodeProj/compare/8.23.7..8.23.8 From 2f925d2a1ce500412fbe8dc74efe52022839c958 Mon Sep 17 00:00:00 2001 From: Kim de Vos Date: Fri, 27 Sep 2024 17:45:49 +0200 Subject: [PATCH 369/678] feat: make `PBXProject.compatibilityVersion` optional and add `PBXProject.preferredProjectObjectVersion` to support Xcode 16 (#854) * feat: Make compatibilityVersion optional * feat: Introduce `preferredProjectObjectVersion` * Increase the header-max-length of the PR title * Change the value to an array * Fix the syntax (again) --------- Co-authored-by: Pedro --- .github/.commitlint.rules.js | 5 +++++ .github/workflows/conventional-pr.yml | 1 + .../Objects/Project/PBXProject.swift | 21 +++++++++++++++---- .../Files/PBXContainerItemProxyTests.swift | 2 +- .../Objects/Files/PBXFileElementTests.swift | 2 ++ .../Objects/Files/PBXGroupTests.swift | 4 ++++ .../Objects/Project/PBXProject+Fixtures.swift | 1 + .../Objects/Project/PBXProjectTests.swift | 7 +++++++ .../Targets/PBXAggregateTargetTests.swift | 1 + .../Targets/PBXNativeTargetTests.swift | 1 + .../Utils/ReferenceGeneratorTests.swift | 1 + 11 files changed, 41 insertions(+), 5 deletions(-) create mode 100644 .github/.commitlint.rules.js diff --git a/.github/.commitlint.rules.js b/.github/.commitlint.rules.js new file mode 100644 index 000000000..ee3d4d402 --- /dev/null +++ b/.github/.commitlint.rules.js @@ -0,0 +1,5 @@ +module.exports = { + rules: { + 'header-max-length': [2, 'always', 200], + } +} diff --git a/.github/workflows/conventional-pr.yml b/.github/workflows/conventional-pr.yml index d41825ced..ba4a1e53f 100644 --- a/.github/workflows/conventional-pr.yml +++ b/.github/workflows/conventional-pr.yml @@ -16,5 +16,6 @@ jobs: - uses: CondeNast/conventional-pull-request-action@v0.2.0 with: commitTitleMatch: false + commitlintRulesPath: ".github/.commitlint.rules.js" env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/Sources/XcodeProj/Objects/Project/PBXProject.swift b/Sources/XcodeProj/Objects/Project/PBXProject.swift index 378309da8..14e896995 100644 --- a/Sources/XcodeProj/Objects/Project/PBXProject.swift +++ b/Sources/XcodeProj/Objects/Project/PBXProject.swift @@ -21,7 +21,10 @@ public final class PBXProject: PBXObject { } /// A string representation of the XcodeCompatibilityVersion. - public var compatibilityVersion: String + public var compatibilityVersion: String? + + /// An int representation of the PreferredProjectObjectVersion. + public var preferredProjectObjectVersion: Int? /// The region of development. public var developmentRegion: String? @@ -286,6 +289,7 @@ public final class PBXProject: PBXObject { /// - name: xcodeproj's name. /// - buildConfigurationList: project build configuration list. /// - compatibilityVersion: project compatibility version. + /// - preferredProjectObjectVersion: preferred project object version /// - mainGroup: project main group. /// - developmentRegion: project has development region. /// - hasScannedForEncodings: project has scanned for encodings. @@ -300,7 +304,8 @@ public final class PBXProject: PBXObject { /// - targetAttributes: project target's attributes. public init(name: String, buildConfigurationList: XCConfigurationList, - compatibilityVersion: String, + compatibilityVersion: String?, + preferredProjectObjectVersion: Int?, mainGroup: PBXGroup, developmentRegion: String? = nil, hasScannedForEncodings: Int = 0, @@ -316,6 +321,7 @@ public final class PBXProject: PBXObject { self.name = name buildConfigurationListReference = buildConfigurationList.reference self.compatibilityVersion = compatibilityVersion + self.preferredProjectObjectVersion = preferredProjectObjectVersion mainGroupReference = mainGroup.reference self.developmentRegion = developmentRegion self.hasScannedForEncodings = hasScannedForEncodings @@ -338,6 +344,7 @@ public final class PBXProject: PBXObject { case name case buildConfigurationList case compatibilityVersion + case preferredProjectObjectVersion case developmentRegion case hasScannedForEncodings case knownRegions @@ -359,7 +366,8 @@ public final class PBXProject: PBXObject { name = try (container.decodeIfPresent(.name)) ?? "" let buildConfigurationListReference: String = try container.decode(.buildConfigurationList) self.buildConfigurationListReference = referenceRepository.getOrCreate(reference: buildConfigurationListReference, objects: objects) - compatibilityVersion = try container.decode(.compatibilityVersion) + compatibilityVersion = try container.decodeIfPresent(.compatibilityVersion) + preferredProjectObjectVersion = try container.decodeIfPresent(.preferredProjectObjectVersion) developmentRegion = try container.decodeIfPresent(.developmentRegion) let hasScannedForEncodingsString: String? = try container.decodeIfPresent(.hasScannedForEncodings) hasScannedForEncodings = hasScannedForEncodingsString.flatMap { Int($0) } ?? 0 @@ -482,7 +490,9 @@ extension PBXProject: PlistSerializable { let buildConfigurationListCommentedString = CommentedString(buildConfigurationListReference.value, comment: buildConfigurationListComment) dictionary["buildConfigurationList"] = .string(buildConfigurationListCommentedString) - dictionary["compatibilityVersion"] = .string(CommentedString(compatibilityVersion)) + if let compatibilityVersion { + dictionary["compatibilityVersion"] = .string(CommentedString(compatibilityVersion)) + } if let developmentRegion { dictionary["developmentRegion"] = .string(CommentedString(developmentRegion)) } @@ -494,6 +504,9 @@ extension PBXProject: PlistSerializable { } let mainGroupObject: PBXGroup? = mainGroupReference.getObject() dictionary["mainGroup"] = .string(CommentedString(mainGroupReference.value, comment: mainGroupObject?.fileName())) + if let preferredProjectObjectVersion { + dictionary["preferredProjectObjectVersion"] = .string(CommentedString(preferredProjectObjectVersion.description)) + } if let productsGroupReference { let productRefGroupObject: PBXGroup? = productsGroupReference.getObject() dictionary["productRefGroup"] = .string(CommentedString(productsGroupReference.value, diff --git a/Tests/XcodeProjTests/Objects/Files/PBXContainerItemProxyTests.swift b/Tests/XcodeProjTests/Objects/Files/PBXContainerItemProxyTests.swift index e5e06c921..f0c7fa4bd 100644 --- a/Tests/XcodeProjTests/Objects/Files/PBXContainerItemProxyTests.swift +++ b/Tests/XcodeProjTests/Objects/Files/PBXContainerItemProxyTests.swift @@ -20,7 +20,7 @@ final class PBXContainerItemProxyTests: XCTestCase { func test_maintains_remoteID() { let target = PBXNativeTarget(name: "") - let project = PBXProject(name: "", buildConfigurationList: XCConfigurationList(), compatibilityVersion: "", mainGroup: PBXGroup()) + let project = PBXProject(name: "", buildConfigurationList: XCConfigurationList(), compatibilityVersion: "", preferredProjectObjectVersion: nil, mainGroup: PBXGroup()) let containerProxy = PBXContainerItemProxy(containerPortal: .project(project), remoteGlobalID: .object(target)) XCTAssertEqual(target.uuid, containerProxy.remoteGlobalID?.uuid) diff --git a/Tests/XcodeProjTests/Objects/Files/PBXFileElementTests.swift b/Tests/XcodeProjTests/Objects/Files/PBXFileElementTests.swift index 9adac1ad8..3a0859f27 100644 --- a/Tests/XcodeProjTests/Objects/Files/PBXFileElementTests.swift +++ b/Tests/XcodeProjTests/Objects/Files/PBXFileElementTests.swift @@ -54,6 +54,7 @@ final class PBXFileElementTests: XCTestCase { let project = PBXProject(name: "ProjectName", buildConfigurationList: XCConfigurationList(), compatibilityVersion: "0", + preferredProjectObjectVersion: nil, mainGroup: mainGroup) let objects = PBXObjects(objects: [project, mainGroup, fileref, group]) @@ -109,6 +110,7 @@ final class PBXFileElementTests: XCTestCase { let project = PBXProject(name: "ProjectName", buildConfigurationList: XCConfigurationList(), compatibilityVersion: "0", + preferredProjectObjectVersion: nil, mainGroup: rootGroup) let objects = PBXObjects(objects: [fileref, nestedGroup, rootGroup, project]) diff --git a/Tests/XcodeProjTests/Objects/Files/PBXGroupTests.swift b/Tests/XcodeProjTests/Objects/Files/PBXGroupTests.swift index 915a714da..41080cf09 100644 --- a/Tests/XcodeProjTests/Objects/Files/PBXGroupTests.swift +++ b/Tests/XcodeProjTests/Objects/Files/PBXGroupTests.swift @@ -18,6 +18,7 @@ final class PBXGroupTests: XCTestCase { let pbxProject = PBXProject(name: "ProjectName", buildConfigurationList: XCConfigurationList(), compatibilityVersion: "0", + preferredProjectObjectVersion: nil, mainGroup: group) project.add(object: pbxProject) @@ -139,6 +140,7 @@ final class PBXGroupTests: XCTestCase { let pbxProject = PBXProject(name: "ProjectName", buildConfigurationList: XCConfigurationList(), compatibilityVersion: "0", + preferredProjectObjectVersion: nil, mainGroup: group) project.add(object: pbxProject) @@ -163,6 +165,7 @@ final class PBXGroupTests: XCTestCase { let pbxProject = PBXProject(name: "ProjectName", buildConfigurationList: XCConfigurationList(), compatibilityVersion: "0", + preferredProjectObjectVersion: nil, mainGroup: group) project.add(object: pbxProject) @@ -186,6 +189,7 @@ final class PBXGroupTests: XCTestCase { let pbxProject = PBXProject(name: "ProjectName", buildConfigurationList: XCConfigurationList(), compatibilityVersion: "0", + preferredProjectObjectVersion: nil, mainGroup: group) project.add(object: pbxProject) diff --git a/Tests/XcodeProjTests/Objects/Project/PBXProject+Fixtures.swift b/Tests/XcodeProjTests/Objects/Project/PBXProject+Fixtures.swift index 695215927..d59c3e9c8 100644 --- a/Tests/XcodeProjTests/Objects/Project/PBXProject+Fixtures.swift +++ b/Tests/XcodeProjTests/Objects/Project/PBXProject+Fixtures.swift @@ -10,6 +10,7 @@ extension PBXProject { PBXProject(name: name, buildConfigurationList: buildConfigurationList, compatibilityVersion: compatibilityVersion, + preferredProjectObjectVersion: nil, mainGroup: mainGroup) } } diff --git a/Tests/XcodeProjTests/Objects/Project/PBXProjectTests.swift b/Tests/XcodeProjTests/Objects/Project/PBXProjectTests.swift index 5a343bfec..8353a8a80 100644 --- a/Tests/XcodeProjTests/Objects/Project/PBXProjectTests.swift +++ b/Tests/XcodeProjTests/Objects/Project/PBXProjectTests.swift @@ -12,6 +12,7 @@ final class PBXProjectTests: XCTestCase { let project = PBXProject(name: "", buildConfigurationList: XCConfigurationList(), compatibilityVersion: "", + preferredProjectObjectVersion: nil, mainGroup: PBXGroup(), attributes: ["LastUpgradeCheck": "0940"], targetAttributes: [target: ["TestTargetID": "123"]]) @@ -54,6 +55,7 @@ final class PBXProjectTests: XCTestCase { let project = PBXProject(name: "Project", buildConfigurationList: configurationList, compatibilityVersion: "0", + preferredProjectObjectVersion: nil, mainGroup: mainGroup, targets: [target]) @@ -89,6 +91,7 @@ final class PBXProjectTests: XCTestCase { let project = PBXProject(name: "Project", buildConfigurationList: configurationList, compatibilityVersion: "0", + preferredProjectObjectVersion: nil, mainGroup: mainGroup, targets: [target]) @@ -125,6 +128,7 @@ final class PBXProjectTests: XCTestCase { let project = PBXProject(name: "Project", buildConfigurationList: configurationList, compatibilityVersion: "0", + preferredProjectObjectVersion: nil, mainGroup: mainGroup, targets: [target]) @@ -165,6 +169,7 @@ final class PBXProjectTests: XCTestCase { let project = PBXProject(name: "Project", buildConfigurationList: configurationList, compatibilityVersion: "0", + preferredProjectObjectVersion: nil, mainGroup: mainGroup, targets: [target]) @@ -218,6 +223,7 @@ final class PBXProjectTests: XCTestCase { let project = PBXProject(name: "Project", buildConfigurationList: configurationList, compatibilityVersion: "0", + preferredProjectObjectVersion: nil, mainGroup: mainGroup, targets: [target, secondTarget]) @@ -292,6 +298,7 @@ final class PBXProjectTests: XCTestCase { let project = PBXProject(name: "Project", buildConfigurationList: configurationList, compatibilityVersion: "0", + preferredProjectObjectVersion: nil, mainGroup: mainGroup, targets: [target, secondTarget]) diff --git a/Tests/XcodeProjTests/Objects/Targets/PBXAggregateTargetTests.swift b/Tests/XcodeProjTests/Objects/Targets/PBXAggregateTargetTests.swift index d16bfd075..3083d623e 100644 --- a/Tests/XcodeProjTests/Objects/Targets/PBXAggregateTargetTests.swift +++ b/Tests/XcodeProjTests/Objects/Targets/PBXAggregateTargetTests.swift @@ -39,6 +39,7 @@ final class PBXAggregateTargetTests: XCTestCase { let project = PBXProject(name: "Project", buildConfigurationList: configurationList, compatibilityVersion: "0", + preferredProjectObjectVersion: nil, mainGroup: mainGroup) objects.add(object: project) diff --git a/Tests/XcodeProjTests/Objects/Targets/PBXNativeTargetTests.swift b/Tests/XcodeProjTests/Objects/Targets/PBXNativeTargetTests.swift index 5dd690fe5..3a08b7aa9 100644 --- a/Tests/XcodeProjTests/Objects/Targets/PBXNativeTargetTests.swift +++ b/Tests/XcodeProjTests/Objects/Targets/PBXNativeTargetTests.swift @@ -40,6 +40,7 @@ final class PBXNativeTargetTests: XCTestCase { let project = PBXProject(name: "Project", buildConfigurationList: configurationList, compatibilityVersion: "0", + preferredProjectObjectVersion: nil, mainGroup: mainGroup) objects.add(object: project) diff --git a/Tests/XcodeProjTests/Utils/ReferenceGeneratorTests.swift b/Tests/XcodeProjTests/Utils/ReferenceGeneratorTests.swift index e16035d81..e9d15059c 100644 --- a/Tests/XcodeProjTests/Utils/ReferenceGeneratorTests.swift +++ b/Tests/XcodeProjTests/Utils/ReferenceGeneratorTests.swift @@ -94,6 +94,7 @@ private extension PBXProj { let project = PBXProject(name: "test", buildConfigurationList: XCConfigurationList.fixture(), compatibilityVersion: Xcode.Default.compatibilityVersion, + preferredProjectObjectVersion: nil, mainGroup: mainGroup) add(object: mainGroup) From d257c94360b2145f95b71fddda987a7542c4f947 Mon Sep 17 00:00:00 2001 From: pepicrft Date: Fri, 27 Sep 2024 15:46:06 +0000 Subject: [PATCH 370/678] [Release] XcodeProj 8.24.0 --- CHANGELOG.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index dcc17a95c..dad49d3e6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,11 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [8.24.0] - 2024-09-27 +### Details +#### Feat +- Make `PBXProject.compatibilityVersion` optional and add `PBXProject.preferredProjectObjectVersion` to support Xcode 16 by @kimdv in [#854](https://github.com/tuist/XcodeProj/pull/854) + ## [8.23.11] - 2024-09-27 ### Details #### Chore @@ -20,8 +25,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 #### Fix - Order for `XCLocalSwiftPackageReference` and `XCRemoteSwiftPackageReference` by @kimdv in [#855](https://github.com/tuist/XcodeProj/pull/855) -## New Contributors -* @kimdv made their first contribution in [#855](https://github.com/tuist/XcodeProj/pull/855) ## [8.23.8] - 2024-09-26 ### Details #### Fix @@ -78,6 +81,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 #### Feat - Introduce the new Xcode 16 models `PBXFileSystemSynchronizedRootGroup` and `PBXFileSystemSynchronizedBuildFileExceptionSet` by @pepicrft in [#827](https://github.com/tuist/XcodeProj/pull/827) +[8.24.0]: https://github.com/tuist/XcodeProj/compare/8.23.11..8.24.0 [8.23.11]: https://github.com/tuist/XcodeProj/compare/8.23.10..8.23.11 [8.23.10]: https://github.com/tuist/XcodeProj/compare/8.23.9..8.23.10 [8.23.9]: https://github.com/tuist/XcodeProj/compare/8.23.8..8.23.9 From 0c3876fee82f4d8748bb4ea86ebc0c27a3b00c94 Mon Sep 17 00:00:00 2001 From: Pedro Date: Fri, 27 Sep 2024 17:52:49 +0200 Subject: [PATCH 371/678] Remove the stale workflow --- .github/workflows/stale.yml | 52 ------------------------------------- 1 file changed, 52 deletions(-) delete mode 100644 .github/workflows/stale.yml diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml deleted file mode 100644 index 8663ed48b..000000000 --- a/.github/workflows/stale.yml +++ /dev/null @@ -1,52 +0,0 @@ -name: 'Close stale issues and PRs' -on: - schedule: - - cron: '30 1 * * *' - -jobs: - stale: - runs-on: ubuntu-latest - steps: - - uses: actions/stale@v9 - with: - stale-issue-message: | - Hola 👋, - - We want to inform you that the issue has been marked as stale. This means that there hasn't been any activity or updates on it for quite some time, and it's possible that it may no longer be relevant or actionable. - If you still believe that this issue is valid and requires attention, please provide an update or any additional information that can help us address it. Otherwise, we may consider closing it in the near future. - Thank you for your understanding. - - stale-pr-message: | - Hola 👋, - - We want to let you know that your pull request has been marked as stale. It seems that there hasn't been any activity or updates on it for a while. - - If you're still interested in having this pull request merged or reviewed, please provide any necessary updates or address any feedback that may have been given. We would be happy to continue the review process and consider merging it into the `main` branch. - - However, if this pull request is no longer a priority or if you've decided to take a different approach, please let us know so we can close it accordingly. - - Thank you for your understanding and contribution. - close-issue-message: | - Hola 👋, - - We want to inform you that we have decided to close this stale issue as there hasn't been any activity or response regarding it after marking it as stale. - - We understand that circumstances may have changed or priorities may have shifted, and that's completely understandable. If you still believe that this issue needs to be addressed, please feel free to reopen it and provide any necessary updates or additional information. - - We appreciate your understanding and look forward to your continued contributions to the project. - - Thank you. - close-pr-message: | - Hola 👋, - - We want to let you know that we have decided to close your pull request #456 due to prolonged inactivity. Despite the initial interest and efforts put into the pull request, we haven't seen any updates or responses for a considerable period of time. - - We understand that circumstances change and priorities shift, which may have led to this inactivity. If you still wish to contribute or have further discussions on this feature or bug fix, please don't hesitate to reopen the pull request and engage with the community. - - We appreciate your understanding and the time you invested in submitting the pull request. Your contributions are valuable, and we hope to collaborate with you on future endeavors. - - Thank you. - stale-issue-label: 'stale' - stale-pr-label: 'stale' - days-before-stale: 30 - days-before-close: 5 From f79bdb754c7bf4825338a20a0e5418d8acda7efa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20Pi=C3=B1era=20Buend=C3=ADa?= <663605+pepicrft@users.noreply.github.com> Date: Fri, 27 Sep 2024 19:05:36 +0200 Subject: [PATCH 372/678] fix: repository cleanup (#859) * Remove .sourcery.yml * Remove .xcode-version * Remove REALEASE.md * Remove deploy-docs pipeline * Remove Info.plist * Update README.md * Remove Netlify badge * Configure Swift Package Index to deploy the documentation --- .github/workflows/deploy-docs.yml | 49 ------------------------------- .sourcery.yml | 6 ---- .spi.yml | 4 +++ .xcode-version | 1 - Info.plist | 26 ---------------- README.md | 8 +---- RELEASE.md | 10 ------- 7 files changed, 5 insertions(+), 99 deletions(-) delete mode 100644 .github/workflows/deploy-docs.yml delete mode 100644 .sourcery.yml create mode 100644 .spi.yml delete mode 100644 .xcode-version delete mode 100644 Info.plist delete mode 100644 RELEASE.md diff --git a/.github/workflows/deploy-docs.yml b/.github/workflows/deploy-docs.yml deleted file mode 100644 index 82cb9d5db..000000000 --- a/.github/workflows/deploy-docs.yml +++ /dev/null @@ -1,49 +0,0 @@ -name: Deploy Docs - -on: - workflow_dispatch: {} - push: - branches: - - main - -concurrency: - group: deploy-docs-${{ github.head_ref }} - cancel-in-progress: true - -jobs: - deploy: - name: Deploy Documentation - runs-on: macos-14 - steps: - - name: Start deployment - uses: bobheadxi/deployments@v1 - id: deployment - with: - env: production - step: start - - name: Checkout Package - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Select Xcode - run: sudo xcode-select -switch /Applications/Xcode_$(cat .xcode-version).app - - name: Build documentation - run: swift package --allow-writing-to-directory ./docs generate-documentation --target XcodeProj --output-path ./docs --transform-for-static-hosting --hosting-base-path / --disable-indexing - - name: Publish to Cloudflare Pages - uses: cloudflare/pages-action@v1 - with: - apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} - accountId: cc0237353f2f825680b0463629cd4a86 - projectName: xcodeproj-docs - directory: docs/ - gitHubToken: ${{ secrets.GITHUB_TOKEN }} - wranglerVersion: '3' - - name: Finish deployment - uses: bobheadxi/deployments@v1 - if: always() - with: - env: ${{ steps.deployment.outputs.env }} - step: finish - status: ${{ job.status }} - deployment_id: ${{ steps.deployment.outputs.deployment_id }} - env_url: "https://xcodeproj.tuist.io" diff --git a/.sourcery.yml b/.sourcery.yml deleted file mode 100644 index e575499c2..000000000 --- a/.sourcery.yml +++ /dev/null @@ -1,6 +0,0 @@ -sources: - - Sources/ -templates: - - templates -output: - Sources/XcodeProj/Objects/Sourcery diff --git a/.spi.yml b/.spi.yml new file mode 100644 index 000000000..c3c607785 --- /dev/null +++ b/.spi.yml @@ -0,0 +1,4 @@ +version: 1 +builder: + configs: + - documentation_targets: [XcodeProj] diff --git a/.xcode-version b/.xcode-version deleted file mode 100644 index 2bbd2b4b4..000000000 --- a/.xcode-version +++ /dev/null @@ -1 +0,0 @@ -15.0.1 diff --git a/Info.plist b/Info.plist deleted file mode 100644 index a11b3ce78..000000000 --- a/Info.plist +++ /dev/null @@ -1,26 +0,0 @@ - - - - - CFBundleDevelopmentRegion - $(DEVELOPMENT_LANGUAGE) - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - $(PRODUCT_NAME) - CFBundlePackageType - FMWK - CFBundleShortVersionString - 1.0 - CFBundleVersion - $(CURRENT_PROJECT_VERSION) - NSHumanReadableCopyright - Copyright ©. All rights reserved. - NSPrincipalClass - - - diff --git a/README.md b/README.md index 2f504e865..ff763a9e6 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,5 @@ # XcodeProj -[![Netlify Status](https://api.netlify.com/api/v1/badges/005ef674-d103-4b05-a4d1-79413ce9d766/deploy-status)](https://app.netlify.com/sites/xcodeproj/deploys) - [![All Contributors](https://img.shields.io/badge/all_contributors-41-orange.svg?style=flat-square)](#contributors-) @@ -10,6 +8,7 @@ [![Release](https://img.shields.io/github/release/tuist/xcodeproj.svg)](https://github.com/tuist/xcodeproj/releases) [![Code Coverage](https://codecov.io/gh/tuist/xcodeproj/branch/main/graph/badge.svg)](https://codecov.io/gh/tuist/xcodeproj) [![License](https://img.shields.io/badge/License-MIT-yellow.svg)](https://github.com/tuist/xcodeproj/blob/main/LICENSE.md) +[![](https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2Ftuist%2FXcodeProj%2Fbadge%3Ftype%3Dswift-versions)](https://swiftpackageindex.com/tuist/XcodeProj) XcodeProj is a library written in Swift for parsing and working with Xcode projects. It's heavily inspired by [CocoaPods XcodeProj](https://github.com/CocoaPods/Xcodeproj) and [xcode](https://www.npmjs.com/package/xcode). @@ -20,7 +19,6 @@ XcodeProj is a library written in Swift for parsing and working with Xcode proje - [Installation](#installation) - [Swift Package Manager](#swift-package-manager) - [Scripting](#scripting) - - [Documentation 📝](#documentation-) - [References 📚](#references-) - [Contributing](#contributing) - [License](#license) @@ -107,10 +105,6 @@ object. [`swift-sh`]: https://github.com/mxcl/swift-sh -## Documentation 📝 - -Want to start using XcodeProj? Start by digging into our [documentation](/Documentation) which will help you get familiar with the API and get to know more about the Xcode projects structure. - ## References 📚 - [Xcode Project File Format](http://www.monobjc.net/xcode-project-file-format.html) diff --git a/RELEASE.md b/RELEASE.md deleted file mode 100644 index 4b8c5c729..000000000 --- a/RELEASE.md +++ /dev/null @@ -1,10 +0,0 @@ -# Releasing - -In this document you'll find all the necessary steps to release a new version of `xcodeproj`: - -1. Make sure you are in the `main` branch. -2. Determine the next version based on the unreleased changes. -3. Add the version section to the `CHANGELOG.md`, update the versions in the `README.md`. -4. Commit the changes and tag them `git commit -m "Version x.y.z"` & `git tag x.y.z`. -5. Push the changes `git push origin main --tags` -6. Create the release on GitHub including the release notes from the `CHANGELOG.md`. From babd2491ea34777bec9d33381a60cd782559b4b3 Mon Sep 17 00:00:00 2001 From: pepicrft Date: Fri, 27 Sep 2024 17:05:52 +0000 Subject: [PATCH 373/678] [Release] XcodeProj 8.24.1 --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index dad49d3e6..e87871c1b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,11 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [8.24.1] - 2024-09-27 +### Details +#### Fix +- Repository cleanup by @pepicrft in [#859](https://github.com/tuist/XcodeProj/pull/859) + ## [8.24.0] - 2024-09-27 ### Details #### Feat @@ -81,6 +86,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 #### Feat - Introduce the new Xcode 16 models `PBXFileSystemSynchronizedRootGroup` and `PBXFileSystemSynchronizedBuildFileExceptionSet` by @pepicrft in [#827](https://github.com/tuist/XcodeProj/pull/827) +[8.24.1]: https://github.com/tuist/XcodeProj/compare/8.24.0..8.24.1 [8.24.0]: https://github.com/tuist/XcodeProj/compare/8.23.11..8.24.0 [8.23.11]: https://github.com/tuist/XcodeProj/compare/8.23.10..8.23.11 [8.23.10]: https://github.com/tuist/XcodeProj/compare/8.23.9..8.23.10 From 32f787db357bfa6daee1b91bc9e8945a986f3cd4 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 8 Oct 2024 18:32:27 +0200 Subject: [PATCH 374/678] chore(deps): update dependency tuist to v4.29.0 (#863) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise.toml b/.mise.toml index 953d2b026..571d90551 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,5 +1,5 @@ [tools] swiftformat = "0.54.3" -tuist = "4.28.1" +tuist = "4.29.0" swiftlint = "0.55.1" "git-cliff" = "2.4.0" From 11ca77906e31c7de25dfbc73310637cf0d6b73c9 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 8 Oct 2024 18:32:45 +0200 Subject: [PATCH 375/678] chore(deps): update actions/checkout digest to eef6144 (#864) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a4f0bf4c8..896b23f6d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -23,7 +23,7 @@ jobs: timeout-minutes: 15 if: "!startsWith(github.event.head_commit.message, '[Release]')" steps: - - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4 + - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4 with: fetch-depth: 0 - uses: jdx/mise-action@v2 From 0837bc3be910bbdbfccbcd499b321f7e3747acf3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20Pi=C3=B1era=20Buend=C3=ADa?= <663605+pepicrft@users.noreply.github.com> Date: Tue, 8 Oct 2024 19:02:28 +0200 Subject: [PATCH 376/678] fix: issues parsing Xcode 16 projects (#862) --- .github/workflows/release.yml | 8 +- .github/workflows/xcodeproj.yml | 6 + .../project.pbxproj | 13 +- Fixtures/Xcode16/README.md | 3 + .../Xcode16/Test.xcodeproj/project.pbxproj | 340 ++++++++++++++++++ .../AccentColor.colorset/Contents.json | 11 + .../AppIcon.appiconset/Contents.json | 85 +++++ .../Test/Assets.xcassets/Contents.json | 6 + Fixtures/Xcode16/Test/ContentView.swift | 24 ++ .../Preview Assets.xcassets/Contents.json | 6 + Fixtures/Xcode16/Test/Test.entitlements | 10 + Fixtures/Xcode16/Test/TestApp.swift | 17 + .../Xcode16/copy.xcodeproj/project.pbxproj | 335 +++++++++++++++++ .../PBXFileSystemSynchronizedRootGroup.swift | 22 +- .../Objects/Project/PBXProject.swift | 25 +- .../Files/PBXContainerItemProxyTests.swift | 2 +- .../Objects/Files/PBXFileElementTests.swift | 2 + .../Objects/Files/PBXGroupTests.swift | 4 + .../Objects/Project/PBXProjEncoderTests.swift | 13 +- .../Objects/Project/PBXProject+Fixtures.swift | 1 + .../Objects/Project/PBXProjectTests.swift | 7 + .../Targets/PBXAggregateTargetTests.swift | 1 + .../Targets/PBXNativeTargetTests.swift | 1 + .../Project/XcodeProjIntegrationTests.swift | 9 + .../Utils/ReferenceGeneratorTests.swift | 1 + 25 files changed, 935 insertions(+), 17 deletions(-) create mode 100644 Fixtures/Xcode16/README.md create mode 100644 Fixtures/Xcode16/Test.xcodeproj/project.pbxproj create mode 100644 Fixtures/Xcode16/Test/Assets.xcassets/AccentColor.colorset/Contents.json create mode 100644 Fixtures/Xcode16/Test/Assets.xcassets/AppIcon.appiconset/Contents.json create mode 100644 Fixtures/Xcode16/Test/Assets.xcassets/Contents.json create mode 100644 Fixtures/Xcode16/Test/ContentView.swift create mode 100644 Fixtures/Xcode16/Test/Preview Content/Preview Assets.xcassets/Contents.json create mode 100644 Fixtures/Xcode16/Test/Test.entitlements create mode 100644 Fixtures/Xcode16/Test/TestApp.swift create mode 100644 Fixtures/Xcode16/copy.xcodeproj/project.pbxproj diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 896b23f6d..56b05e3c2 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -7,7 +7,7 @@ on: workflow_dispatch: inputs: version: - description: 'The version to release' + description: "The version to release" type: string permissions: @@ -19,7 +19,7 @@ permissions: jobs: release: name: Release - runs-on: 'ubuntu-latest' + runs-on: "ubuntu-latest" timeout-minutes: 15 if: "!startsWith(github.event.head_commit.message, '[Release]')" steps: @@ -62,7 +62,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | echo "RELEASE_NOTES<> "$GITHUB_OUTPUT" - git cliff 8.22.0.. --unreleased >> "$GITHUB_OUTPUT" + git cliff 8.22.0.. --bump --unreleased >> "$GITHUB_OUTPUT" echo "EOF" >> "$GITHUB_OUTPUT" - name: Update CHANGELOG.md if: env.should-release == 'true' @@ -74,7 +74,7 @@ jobs: uses: stefanzweifel/git-auto-commit-action@v5 if: env.should-release == 'true' with: - commit_options: '--allow-empty' + commit_options: "--allow-empty" tagging_message: ${{ steps.next-version.outputs.NEXT_VERSION }} skip_dirty_check: true commit_message: "[Release] XcodeProj ${{ steps.next-version.outputs.NEXT_VERSION }}" diff --git a/.github/workflows/xcodeproj.yml b/.github/workflows/xcodeproj.yml index 904880cdb..abe2b1317 100644 --- a/.github/workflows/xcodeproj.yml +++ b/.github/workflows/xcodeproj.yml @@ -20,6 +20,8 @@ jobs: runs-on: macos-latest steps: - uses: actions/checkout@v3 + - name: Select Xcode 16 + run: sudo xcode-select -switch /Applications/Xcode_16.app/Contents/Developer - uses: jdx/mise-action@v2 - name: Build run: mise run build @@ -36,6 +38,8 @@ jobs: runs-on: macos-latest steps: - uses: actions/checkout@v3 + - name: Select Xcode 16 + run: sudo xcode-select -switch /Applications/Xcode_16.app/Contents/Developer - uses: jdx/mise-action@v2 - name: Run tests run: mise run test @@ -54,5 +58,7 @@ jobs: runs-on: macos-latest steps: - uses: actions/checkout@v3 + - name: Select Xcode 16 + run: sudo xcode-select -switch /Applications/Xcode_16.app/Contents/Developer - uses: jdx/mise-action@v2 - run: mise run lint diff --git a/Fixtures/SynchronizedRootGroups/SynchronizedRootGroups.xcodeproj/project.pbxproj b/Fixtures/SynchronizedRootGroups/SynchronizedRootGroups.xcodeproj/project.pbxproj index 5db92414b..c6a599659 100644 --- a/Fixtures/SynchronizedRootGroups/SynchronizedRootGroups.xcodeproj/project.pbxproj +++ b/Fixtures/SynchronizedRootGroups/SynchronizedRootGroups.xcodeproj/project.pbxproj @@ -21,7 +21,18 @@ /* End PBXFileSystemSynchronizedBuildFileExceptionSet section */ /* Begin PBXFileSystemSynchronizedRootGroup section */ - 6CF05B9D2C53F64800EF267F /* SynchronizedRootGroups */ = {isa = PBXFileSystemSynchronizedRootGroup; exceptions = (6CF05BA32C53F97F00EF267F /* PBXFileSystemSynchronizedBuildFileExceptionSet */, ); explicitFileTypes = {}; explicitFolders = (); path = SynchronizedRootGroups; sourceTree = ""; }; + 6CF05B9D2C53F64800EF267F /* SynchronizedRootGroups */ = { + isa = PBXFileSystemSynchronizedRootGroup; + exceptions = ( + 6CF05BA32C53F97F00EF267F /* PBXFileSystemSynchronizedBuildFileExceptionSet */, + ); + explicitFileTypes = { + }; + explicitFolders = ( + ); + path = SynchronizedRootGroups; + sourceTree = ""; + }; /* End PBXFileSystemSynchronizedRootGroup section */ /* Begin PBXFrameworksBuildPhase section */ diff --git a/Fixtures/Xcode16/README.md b/Fixtures/Xcode16/README.md new file mode 100644 index 000000000..e1673acd1 --- /dev/null +++ b/Fixtures/Xcode16/README.md @@ -0,0 +1,3 @@ +# Xcode 16 project + +Xcode 16 introduced some changes in Xcode projects, like [this one](https://github.com/tuist/XcodeProj/issues/861), so this fixture tries to capture those changes to run tests against them. diff --git a/Fixtures/Xcode16/Test.xcodeproj/project.pbxproj b/Fixtures/Xcode16/Test.xcodeproj/project.pbxproj new file mode 100644 index 000000000..38d0a9761 --- /dev/null +++ b/Fixtures/Xcode16/Test.xcodeproj/project.pbxproj @@ -0,0 +1,340 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 77; + objects = { + +/* Begin PBXFileReference section */ + A4C5307E2CAAC8EA00EDC73B /* Test.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Test.app; sourceTree = BUILT_PRODUCTS_DIR; }; +/* End PBXFileReference section */ + +/* Begin PBXFileSystemSynchronizedRootGroup section */ + A4C530802CAAC8EA00EDC73B /* Test */ = { + isa = PBXFileSystemSynchronizedRootGroup; + path = Test; + sourceTree = ""; + }; +/* End PBXFileSystemSynchronizedRootGroup section */ + +/* Begin PBXFrameworksBuildPhase section */ + A4C5307B2CAAC8EA00EDC73B /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + A4C530752CAAC8EA00EDC73B = { + isa = PBXGroup; + children = ( + A4C530802CAAC8EA00EDC73B /* Test */, + A4C5307F2CAAC8EA00EDC73B /* Products */, + ); + sourceTree = ""; + }; + A4C5307F2CAAC8EA00EDC73B /* Products */ = { + isa = PBXGroup; + children = ( + A4C5307E2CAAC8EA00EDC73B /* Test.app */, + ); + name = Products; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + A4C5307D2CAAC8EA00EDC73B /* Test */ = { + isa = PBXNativeTarget; + buildConfigurationList = A4C5308D2CAAC8EC00EDC73B /* Build configuration list for PBXNativeTarget "Test" */; + buildPhases = ( + A4C5307A2CAAC8EA00EDC73B /* Sources */, + A4C5307B2CAAC8EA00EDC73B /* Frameworks */, + A4C5307C2CAAC8EA00EDC73B /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + fileSystemSynchronizedGroups = ( + A4C530802CAAC8EA00EDC73B /* Test */, + ); + name = Test; + packageProductDependencies = ( + ); + productName = Test; + productReference = A4C5307E2CAAC8EA00EDC73B /* Test.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + A4C530762CAAC8EA00EDC73B /* Project object */ = { + isa = PBXProject; + attributes = { + BuildIndependentTargetsInParallel = 1; + LastSwiftUpdateCheck = 1610; + LastUpgradeCheck = 1610; + TargetAttributes = { + A4C5307D2CAAC8EA00EDC73B = { + CreatedOnToolsVersion = 16.1; + }; + }; + }; + buildConfigurationList = A4C530792CAAC8EA00EDC73B /* Build configuration list for PBXProject "Test" */; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = A4C530752CAAC8EA00EDC73B; + minimizedProjectReferenceProxies = 1; + preferredProjectObjectVersion = 77; + productRefGroup = A4C5307F2CAAC8EA00EDC73B /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + A4C5307D2CAAC8EA00EDC73B /* Test */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + A4C5307C2CAAC8EA00EDC73B /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + A4C5307A2CAAC8EA00EDC73B /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin XCBuildConfiguration section */ + A4C5308B2CAAC8EC00EDC73B /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + ENABLE_USER_SCRIPT_SANDBOXING = YES; + GCC_C_LANGUAGE_STANDARD = gnu17; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + LOCALIZATION_PREFERS_STRING_CATALOGS = YES; + MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; + MTL_FAST_MATH = YES; + ONLY_ACTIVE_ARCH = YES; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = "DEBUG $(inherited)"; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + }; + name = Debug; + }; + A4C5308C2CAAC8EC00EDC73B /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_USER_SCRIPT_SANDBOXING = YES; + GCC_C_LANGUAGE_STANDARD = gnu17; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + LOCALIZATION_PREFERS_STRING_CATALOGS = YES; + MTL_ENABLE_DEBUG_INFO = NO; + MTL_FAST_MATH = YES; + SWIFT_COMPILATION_MODE = wholemodule; + }; + name = Release; + }; + A4C5308E2CAAC8EC00EDC73B /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + CODE_SIGN_ENTITLEMENTS = Test/Test.entitlements; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + DEVELOPMENT_ASSET_PATHS = "\"Test/Preview Content\""; + ENABLE_PREVIEWS = YES; + GENERATE_INFOPLIST_FILE = YES; + "INFOPLIST_KEY_UIApplicationSceneManifest_Generation[sdk=iphoneos*]" = YES; + "INFOPLIST_KEY_UIApplicationSceneManifest_Generation[sdk=iphonesimulator*]" = YES; + "INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents[sdk=iphoneos*]" = YES; + "INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents[sdk=iphonesimulator*]" = YES; + "INFOPLIST_KEY_UILaunchScreen_Generation[sdk=iphoneos*]" = YES; + "INFOPLIST_KEY_UILaunchScreen_Generation[sdk=iphonesimulator*]" = YES; + "INFOPLIST_KEY_UIStatusBarStyle[sdk=iphoneos*]" = UIStatusBarStyleDefault; + "INFOPLIST_KEY_UIStatusBarStyle[sdk=iphonesimulator*]" = UIStatusBarStyleDefault; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + IPHONEOS_DEPLOYMENT_TARGET = 18.1; + LD_RUNPATH_SEARCH_PATHS = "@executable_path/Frameworks"; + "LD_RUNPATH_SEARCH_PATHS[sdk=macosx*]" = "@executable_path/../Frameworks"; + MACOSX_DEPLOYMENT_TARGET = 15.0; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = com.example.Test; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = auto; + SUPPORTED_PLATFORMS = "iphoneos iphonesimulator macosx xros xrsimulator"; + SWIFT_EMIT_LOC_STRINGS = YES; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2,7"; + XROS_DEPLOYMENT_TARGET = 2.1; + }; + name = Debug; + }; + A4C5308F2CAAC8EC00EDC73B /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + CODE_SIGN_ENTITLEMENTS = Test/Test.entitlements; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + DEVELOPMENT_ASSET_PATHS = "\"Test/Preview Content\""; + ENABLE_PREVIEWS = YES; + GENERATE_INFOPLIST_FILE = YES; + "INFOPLIST_KEY_UIApplicationSceneManifest_Generation[sdk=iphoneos*]" = YES; + "INFOPLIST_KEY_UIApplicationSceneManifest_Generation[sdk=iphonesimulator*]" = YES; + "INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents[sdk=iphoneos*]" = YES; + "INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents[sdk=iphonesimulator*]" = YES; + "INFOPLIST_KEY_UILaunchScreen_Generation[sdk=iphoneos*]" = YES; + "INFOPLIST_KEY_UILaunchScreen_Generation[sdk=iphonesimulator*]" = YES; + "INFOPLIST_KEY_UIStatusBarStyle[sdk=iphoneos*]" = UIStatusBarStyleDefault; + "INFOPLIST_KEY_UIStatusBarStyle[sdk=iphonesimulator*]" = UIStatusBarStyleDefault; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + IPHONEOS_DEPLOYMENT_TARGET = 18.1; + LD_RUNPATH_SEARCH_PATHS = "@executable_path/Frameworks"; + "LD_RUNPATH_SEARCH_PATHS[sdk=macosx*]" = "@executable_path/../Frameworks"; + MACOSX_DEPLOYMENT_TARGET = 15.0; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = com.example.Test; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = auto; + SUPPORTED_PLATFORMS = "iphoneos iphonesimulator macosx xros xrsimulator"; + SWIFT_EMIT_LOC_STRINGS = YES; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2,7"; + XROS_DEPLOYMENT_TARGET = 2.1; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + A4C530792CAAC8EA00EDC73B /* Build configuration list for PBXProject "Test" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + A4C5308B2CAAC8EC00EDC73B /* Debug */, + A4C5308C2CAAC8EC00EDC73B /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + A4C5308D2CAAC8EC00EDC73B /* Build configuration list for PBXNativeTarget "Test" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + A4C5308E2CAAC8EC00EDC73B /* Debug */, + A4C5308F2CAAC8EC00EDC73B /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = A4C530762CAAC8EA00EDC73B /* Project object */; +} diff --git a/Fixtures/Xcode16/Test/Assets.xcassets/AccentColor.colorset/Contents.json b/Fixtures/Xcode16/Test/Assets.xcassets/AccentColor.colorset/Contents.json new file mode 100644 index 000000000..eb8789700 --- /dev/null +++ b/Fixtures/Xcode16/Test/Assets.xcassets/AccentColor.colorset/Contents.json @@ -0,0 +1,11 @@ +{ + "colors" : [ + { + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Fixtures/Xcode16/Test/Assets.xcassets/AppIcon.appiconset/Contents.json b/Fixtures/Xcode16/Test/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 000000000..ffdfe150b --- /dev/null +++ b/Fixtures/Xcode16/Test/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,85 @@ +{ + "images" : [ + { + "idiom" : "universal", + "platform" : "ios", + "size" : "1024x1024" + }, + { + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "dark" + } + ], + "idiom" : "universal", + "platform" : "ios", + "size" : "1024x1024" + }, + { + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "tinted" + } + ], + "idiom" : "universal", + "platform" : "ios", + "size" : "1024x1024" + }, + { + "idiom" : "mac", + "scale" : "1x", + "size" : "16x16" + }, + { + "idiom" : "mac", + "scale" : "2x", + "size" : "16x16" + }, + { + "idiom" : "mac", + "scale" : "1x", + "size" : "32x32" + }, + { + "idiom" : "mac", + "scale" : "2x", + "size" : "32x32" + }, + { + "idiom" : "mac", + "scale" : "1x", + "size" : "128x128" + }, + { + "idiom" : "mac", + "scale" : "2x", + "size" : "128x128" + }, + { + "idiom" : "mac", + "scale" : "1x", + "size" : "256x256" + }, + { + "idiom" : "mac", + "scale" : "2x", + "size" : "256x256" + }, + { + "idiom" : "mac", + "scale" : "1x", + "size" : "512x512" + }, + { + "idiom" : "mac", + "scale" : "2x", + "size" : "512x512" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Fixtures/Xcode16/Test/Assets.xcassets/Contents.json b/Fixtures/Xcode16/Test/Assets.xcassets/Contents.json new file mode 100644 index 000000000..73c00596a --- /dev/null +++ b/Fixtures/Xcode16/Test/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Fixtures/Xcode16/Test/ContentView.swift b/Fixtures/Xcode16/Test/ContentView.swift new file mode 100644 index 000000000..32435833a --- /dev/null +++ b/Fixtures/Xcode16/Test/ContentView.swift @@ -0,0 +1,24 @@ +// +// ContentView.swift +// Test +// +// Created by F1248 on 30.09.24. +// + +import SwiftUI + +struct ContentView: View { + var body: some View { + VStack { + Image(systemName: "globe") + .imageScale(.large) + .foregroundStyle(.tint) + Text("Hello, world!") + } + .padding() + } +} + +#Preview { + ContentView() +} diff --git a/Fixtures/Xcode16/Test/Preview Content/Preview Assets.xcassets/Contents.json b/Fixtures/Xcode16/Test/Preview Content/Preview Assets.xcassets/Contents.json new file mode 100644 index 000000000..73c00596a --- /dev/null +++ b/Fixtures/Xcode16/Test/Preview Content/Preview Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Fixtures/Xcode16/Test/Test.entitlements b/Fixtures/Xcode16/Test/Test.entitlements new file mode 100644 index 000000000..f2ef3ae02 --- /dev/null +++ b/Fixtures/Xcode16/Test/Test.entitlements @@ -0,0 +1,10 @@ + + + + + com.apple.security.app-sandbox + + com.apple.security.files.user-selected.read-only + + + diff --git a/Fixtures/Xcode16/Test/TestApp.swift b/Fixtures/Xcode16/Test/TestApp.swift new file mode 100644 index 000000000..bb7480e72 --- /dev/null +++ b/Fixtures/Xcode16/Test/TestApp.swift @@ -0,0 +1,17 @@ +// +// TestApp.swift +// Test +// +// Created by F1248 on 30.09.24. +// + +import SwiftUI + +@main +struct TestApp: App { + var body: some Scene { + WindowGroup { + ContentView() + } + } +} diff --git a/Fixtures/Xcode16/copy.xcodeproj/project.pbxproj b/Fixtures/Xcode16/copy.xcodeproj/project.pbxproj new file mode 100644 index 000000000..4a66fedfd --- /dev/null +++ b/Fixtures/Xcode16/copy.xcodeproj/project.pbxproj @@ -0,0 +1,335 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 77; + objects = { + +/* Begin PBXFileReference section */ + A4C5307E2CAAC8EA00EDC73B /* Test.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Test.app; sourceTree = BUILT_PRODUCTS_DIR; }; +/* End PBXFileReference section */ + +/* Begin PBXFileSystemSynchronizedRootGroup section */ + A4C530802CAAC8EA00EDC73B /* Test */ = {isa = PBXFileSystemSynchronizedRootGroup; explicitFileTypes = {}; explicitFolders = (); path = Test; sourceTree = ""; }; +/* End PBXFileSystemSynchronizedRootGroup section */ + +/* Begin PBXFrameworksBuildPhase section */ + A4C5307B2CAAC8EA00EDC73B /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + A4C530752CAAC8EA00EDC73B = { + isa = PBXGroup; + children = ( + A4C530802CAAC8EA00EDC73B /* Test */, + A4C5307F2CAAC8EA00EDC73B /* Products */, + ); + sourceTree = ""; + }; + A4C5307F2CAAC8EA00EDC73B /* Products */ = { + isa = PBXGroup; + children = ( + A4C5307E2CAAC8EA00EDC73B /* Test.app */, + ); + name = Products; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + A4C5307D2CAAC8EA00EDC73B /* Test */ = { + isa = PBXNativeTarget; + buildConfigurationList = A4C5308D2CAAC8EC00EDC73B /* Build configuration list for PBXNativeTarget "Test" */; + buildPhases = ( + A4C5307A2CAAC8EA00EDC73B /* Sources */, + A4C5307B2CAAC8EA00EDC73B /* Frameworks */, + A4C5307C2CAAC8EA00EDC73B /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + fileSystemSynchronizedGroups = ( + A4C530802CAAC8EA00EDC73B /* Test */, + ); + name = Test; + packageProductDependencies = ( + ); + productName = Test; + productReference = A4C5307E2CAAC8EA00EDC73B /* Test.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + A4C530762CAAC8EA00EDC73B /* Project object */ = { + isa = PBXProject; + attributes = { + BuildIndependentTargetsInParallel = 1; + LastSwiftUpdateCheck = 1610; + LastUpgradeCheck = 1610; + TargetAttributes = { + A4C5307D2CAAC8EA00EDC73B = { + CreatedOnToolsVersion = 16.1; + }; + }; + }; + buildConfigurationList = A4C530792CAAC8EA00EDC73B /* Build configuration list for PBXProject "copy" */; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = A4C530752CAAC8EA00EDC73B; + preferredProjectObjectVersion = 77; + productRefGroup = A4C5307F2CAAC8EA00EDC73B /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + A4C5307D2CAAC8EA00EDC73B /* Test */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + A4C5307C2CAAC8EA00EDC73B /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + A4C5307A2CAAC8EA00EDC73B /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin XCBuildConfiguration section */ + A4C5308B2CAAC8EC00EDC73B /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + ENABLE_USER_SCRIPT_SANDBOXING = YES; + GCC_C_LANGUAGE_STANDARD = gnu17; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + LOCALIZATION_PREFERS_STRING_CATALOGS = YES; + MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; + MTL_FAST_MATH = YES; + ONLY_ACTIVE_ARCH = YES; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = "DEBUG $(inherited)"; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + }; + name = Debug; + }; + A4C5308C2CAAC8EC00EDC73B /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_USER_SCRIPT_SANDBOXING = YES; + GCC_C_LANGUAGE_STANDARD = gnu17; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + LOCALIZATION_PREFERS_STRING_CATALOGS = YES; + MTL_ENABLE_DEBUG_INFO = NO; + MTL_FAST_MATH = YES; + SWIFT_COMPILATION_MODE = wholemodule; + }; + name = Release; + }; + A4C5308E2CAAC8EC00EDC73B /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + CODE_SIGN_ENTITLEMENTS = Test/Test.entitlements; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + DEVELOPMENT_ASSET_PATHS = "\"Test/Preview Content\""; + ENABLE_PREVIEWS = YES; + GENERATE_INFOPLIST_FILE = YES; + "INFOPLIST_KEY_UIApplicationSceneManifest_Generation[sdk=iphoneos*]" = YES; + "INFOPLIST_KEY_UIApplicationSceneManifest_Generation[sdk=iphonesimulator*]" = YES; + "INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents[sdk=iphoneos*]" = YES; + "INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents[sdk=iphonesimulator*]" = YES; + "INFOPLIST_KEY_UILaunchScreen_Generation[sdk=iphoneos*]" = YES; + "INFOPLIST_KEY_UILaunchScreen_Generation[sdk=iphonesimulator*]" = YES; + "INFOPLIST_KEY_UIStatusBarStyle[sdk=iphoneos*]" = UIStatusBarStyleDefault; + "INFOPLIST_KEY_UIStatusBarStyle[sdk=iphonesimulator*]" = UIStatusBarStyleDefault; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + IPHONEOS_DEPLOYMENT_TARGET = 18.1; + LD_RUNPATH_SEARCH_PATHS = "@executable_path/Frameworks"; + "LD_RUNPATH_SEARCH_PATHS[sdk=macosx*]" = "@executable_path/../Frameworks"; + MACOSX_DEPLOYMENT_TARGET = 15.0; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = com.example.Test; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = auto; + SUPPORTED_PLATFORMS = "iphoneos iphonesimulator macosx xros xrsimulator"; + SWIFT_EMIT_LOC_STRINGS = YES; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2,7"; + XROS_DEPLOYMENT_TARGET = 2.1; + }; + name = Debug; + }; + A4C5308F2CAAC8EC00EDC73B /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + CODE_SIGN_ENTITLEMENTS = Test/Test.entitlements; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + DEVELOPMENT_ASSET_PATHS = "\"Test/Preview Content\""; + ENABLE_PREVIEWS = YES; + GENERATE_INFOPLIST_FILE = YES; + "INFOPLIST_KEY_UIApplicationSceneManifest_Generation[sdk=iphoneos*]" = YES; + "INFOPLIST_KEY_UIApplicationSceneManifest_Generation[sdk=iphonesimulator*]" = YES; + "INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents[sdk=iphoneos*]" = YES; + "INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents[sdk=iphonesimulator*]" = YES; + "INFOPLIST_KEY_UILaunchScreen_Generation[sdk=iphoneos*]" = YES; + "INFOPLIST_KEY_UILaunchScreen_Generation[sdk=iphonesimulator*]" = YES; + "INFOPLIST_KEY_UIStatusBarStyle[sdk=iphoneos*]" = UIStatusBarStyleDefault; + "INFOPLIST_KEY_UIStatusBarStyle[sdk=iphonesimulator*]" = UIStatusBarStyleDefault; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + IPHONEOS_DEPLOYMENT_TARGET = 18.1; + LD_RUNPATH_SEARCH_PATHS = "@executable_path/Frameworks"; + "LD_RUNPATH_SEARCH_PATHS[sdk=macosx*]" = "@executable_path/../Frameworks"; + MACOSX_DEPLOYMENT_TARGET = 15.0; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = com.example.Test; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = auto; + SUPPORTED_PLATFORMS = "iphoneos iphonesimulator macosx xros xrsimulator"; + SWIFT_EMIT_LOC_STRINGS = YES; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2,7"; + XROS_DEPLOYMENT_TARGET = 2.1; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + A4C530792CAAC8EA00EDC73B /* Build configuration list for PBXProject "copy" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + A4C5308B2CAAC8EC00EDC73B /* Debug */, + A4C5308C2CAAC8EC00EDC73B /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + A4C5308D2CAAC8EC00EDC73B /* Build configuration list for PBXNativeTarget "Test" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + A4C5308E2CAAC8EC00EDC73B /* Debug */, + A4C5308F2CAAC8EC00EDC73B /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = A4C530762CAAC8EA00EDC73B /* Project object */; +} diff --git a/Sources/XcodeProj/Objects/Files/PBXFileSystemSynchronizedRootGroup.swift b/Sources/XcodeProj/Objects/Files/PBXFileSystemSynchronizedRootGroup.swift index 5df7fe342..882d27db5 100644 --- a/Sources/XcodeProj/Objects/Files/PBXFileSystemSynchronizedRootGroup.swift +++ b/Sources/XcodeProj/Objects/Files/PBXFileSystemSynchronizedRootGroup.swift @@ -5,7 +5,7 @@ public class PBXFileSystemSynchronizedRootGroup: PBXFileElement { /// It maps relative paths inside the synchronized root group to a particular file type. /// If a path doesn't have a particular file type specified, Xcode defaults to the default file type /// based on the extension of the file. - public var explicitFileTypes: [String: String] + public var explicitFileTypes: [String: String]? /// Returns the references of the exceptions. var exceptionsReferences: [PBXObjectReference]? @@ -22,7 +22,7 @@ public class PBXFileSystemSynchronizedRootGroup: PBXFileElement { } /// A list of relative paths to children folder whose configuration is overriden. - public var explicitFolders: [String] + public var explicitFolders: [String]? /// Initializes the file element with its properties. /// @@ -74,16 +74,16 @@ public class PBXFileSystemSynchronizedRootGroup: PBXFileElement { let objects = decoder.context.objects let objectReferenceRepository = decoder.context.objectReferenceRepository let container = try decoder.container(keyedBy: CodingKeys.self) - explicitFileTypes = try (container.decodeIfPresent(.explicitFileTypes)) ?? [:] + explicitFileTypes = try container.decodeIfPresent(.explicitFileTypes) let exceptionsReferences: [String] = try (container.decodeIfPresent(.exceptions)) ?? [] self.exceptionsReferences = exceptionsReferences.map { objectReferenceRepository.getOrCreate(reference: $0, objects: objects) } - explicitFolders = try (container.decodeIfPresent(.explicitFolders)) ?? [] + explicitFolders = try container.decodeIfPresent(.explicitFolders) try super.init(from: decoder) } // MARK: - PlistSerializable - override var multiline: Bool { false } + override var multiline: Bool { true } override func plistKeyAndValue(proj: PBXProj, reference: String) throws -> (key: CommentedString, value: PlistValue) { var dictionary: [CommentedString: PlistValue] = try super.plistKeyAndValue(proj: proj, reference: reference).value.dictionary ?? [:] @@ -93,10 +93,14 @@ public class PBXFileSystemSynchronizedRootGroup: PBXFileElement { .string(CommentedString(exceptionReference.value, comment: "PBXFileSystemSynchronizedBuildFileExceptionSet")) }) } - dictionary["explicitFileTypes"] = .dictionary(Dictionary(uniqueKeysWithValues: explicitFileTypes.map { relativePath, fileType in - (CommentedString(relativePath), .string(CommentedString(fileType))) - })) - dictionary["explicitFolders"] = .array(explicitFolders.map { .string(CommentedString($0)) }) + if let explicitFileTypes { + dictionary["explicitFileTypes"] = .dictionary(Dictionary(uniqueKeysWithValues: explicitFileTypes.map { relativePath, fileType in + (CommentedString(relativePath), .string(CommentedString(fileType))) + })) + } + if let explicitFolders { + dictionary["explicitFolders"] = .array(explicitFolders.map { .string(CommentedString($0)) }) + } return (key: CommentedString(reference, comment: name ?? path), value: .dictionary(dictionary)) diff --git a/Sources/XcodeProj/Objects/Project/PBXProject.swift b/Sources/XcodeProj/Objects/Project/PBXProject.swift index 14e896995..50dd148d0 100644 --- a/Sources/XcodeProj/Objects/Project/PBXProject.swift +++ b/Sources/XcodeProj/Objects/Project/PBXProject.swift @@ -26,6 +26,9 @@ public final class PBXProject: PBXObject { /// An int representation of the PreferredProjectObjectVersion. public var preferredProjectObjectVersion: Int? + /// An int representation of the minimizedProjectReferenceProxies attribute + public var minimizedProjectReferenceProxies: Int? + /// The region of development. public var developmentRegion: String? @@ -290,6 +293,7 @@ public final class PBXProject: PBXObject { /// - buildConfigurationList: project build configuration list. /// - compatibilityVersion: project compatibility version. /// - preferredProjectObjectVersion: preferred project object version + /// - minimizedProjectReferenceProxies: minimized project reference proxies /// - mainGroup: project main group. /// - developmentRegion: project has development region. /// - hasScannedForEncodings: project has scanned for encodings. @@ -306,6 +310,7 @@ public final class PBXProject: PBXObject { buildConfigurationList: XCConfigurationList, compatibilityVersion: String?, preferredProjectObjectVersion: Int?, + minimizedProjectReferenceProxies: Int?, mainGroup: PBXGroup, developmentRegion: String? = nil, hasScannedForEncodings: Int = 0, @@ -322,6 +327,7 @@ public final class PBXProject: PBXObject { buildConfigurationListReference = buildConfigurationList.reference self.compatibilityVersion = compatibilityVersion self.preferredProjectObjectVersion = preferredProjectObjectVersion + self.minimizedProjectReferenceProxies = minimizedProjectReferenceProxies mainGroupReference = mainGroup.reference self.developmentRegion = developmentRegion self.hasScannedForEncodings = hasScannedForEncodings @@ -345,6 +351,7 @@ public final class PBXProject: PBXObject { case buildConfigurationList case compatibilityVersion case preferredProjectObjectVersion + case minimizedProjectReferenceProxies case developmentRegion case hasScannedForEncodings case knownRegions @@ -367,7 +374,20 @@ public final class PBXProject: PBXObject { let buildConfigurationListReference: String = try container.decode(.buildConfigurationList) self.buildConfigurationListReference = referenceRepository.getOrCreate(reference: buildConfigurationListReference, objects: objects) compatibilityVersion = try container.decodeIfPresent(.compatibilityVersion) - preferredProjectObjectVersion = try container.decodeIfPresent(.preferredProjectObjectVersion) + preferredProjectObjectVersion = if let stringValue = try container.decodeIfPresent(String.self, forKey: .preferredProjectObjectVersion) { + Int(stringValue) + } else if let intValue = try container.decodeIfPresent(Int.self, forKey: .preferredProjectObjectVersion) { + intValue + } else { + nil + } + minimizedProjectReferenceProxies = if let stringValue = try container.decodeIfPresent(String.self, forKey: .minimizedProjectReferenceProxies) { + Int(stringValue) + } else if let intValue = try container.decodeIfPresent(Int.self, forKey: .minimizedProjectReferenceProxies) { + intValue + } else { + nil + } developmentRegion = try container.decodeIfPresent(.developmentRegion) let hasScannedForEncodingsString: String? = try container.decodeIfPresent(.hasScannedForEncodings) hasScannedForEncodings = hasScannedForEncodingsString.flatMap { Int($0) } ?? 0 @@ -507,6 +527,9 @@ extension PBXProject: PlistSerializable { if let preferredProjectObjectVersion { dictionary["preferredProjectObjectVersion"] = .string(CommentedString(preferredProjectObjectVersion.description)) } + if let minimizedProjectReferenceProxies { + dictionary["minimizedProjectReferenceProxies"] = .string(CommentedString(minimizedProjectReferenceProxies.description)) + } if let productsGroupReference { let productRefGroupObject: PBXGroup? = productsGroupReference.getObject() dictionary["productRefGroup"] = .string(CommentedString(productsGroupReference.value, diff --git a/Tests/XcodeProjTests/Objects/Files/PBXContainerItemProxyTests.swift b/Tests/XcodeProjTests/Objects/Files/PBXContainerItemProxyTests.swift index f0c7fa4bd..e5f660a78 100644 --- a/Tests/XcodeProjTests/Objects/Files/PBXContainerItemProxyTests.swift +++ b/Tests/XcodeProjTests/Objects/Files/PBXContainerItemProxyTests.swift @@ -20,7 +20,7 @@ final class PBXContainerItemProxyTests: XCTestCase { func test_maintains_remoteID() { let target = PBXNativeTarget(name: "") - let project = PBXProject(name: "", buildConfigurationList: XCConfigurationList(), compatibilityVersion: "", preferredProjectObjectVersion: nil, mainGroup: PBXGroup()) + let project = PBXProject(name: "", buildConfigurationList: XCConfigurationList(), compatibilityVersion: "", preferredProjectObjectVersion: nil, minimizedProjectReferenceProxies: nil, mainGroup: PBXGroup()) let containerProxy = PBXContainerItemProxy(containerPortal: .project(project), remoteGlobalID: .object(target)) XCTAssertEqual(target.uuid, containerProxy.remoteGlobalID?.uuid) diff --git a/Tests/XcodeProjTests/Objects/Files/PBXFileElementTests.swift b/Tests/XcodeProjTests/Objects/Files/PBXFileElementTests.swift index 3a0859f27..b7b5acd81 100644 --- a/Tests/XcodeProjTests/Objects/Files/PBXFileElementTests.swift +++ b/Tests/XcodeProjTests/Objects/Files/PBXFileElementTests.swift @@ -55,6 +55,7 @@ final class PBXFileElementTests: XCTestCase { buildConfigurationList: XCConfigurationList(), compatibilityVersion: "0", preferredProjectObjectVersion: nil, + minimizedProjectReferenceProxies: nil, mainGroup: mainGroup) let objects = PBXObjects(objects: [project, mainGroup, fileref, group]) @@ -111,6 +112,7 @@ final class PBXFileElementTests: XCTestCase { buildConfigurationList: XCConfigurationList(), compatibilityVersion: "0", preferredProjectObjectVersion: nil, + minimizedProjectReferenceProxies: nil, mainGroup: rootGroup) let objects = PBXObjects(objects: [fileref, nestedGroup, rootGroup, project]) diff --git a/Tests/XcodeProjTests/Objects/Files/PBXGroupTests.swift b/Tests/XcodeProjTests/Objects/Files/PBXGroupTests.swift index 41080cf09..fae0e530d 100644 --- a/Tests/XcodeProjTests/Objects/Files/PBXGroupTests.swift +++ b/Tests/XcodeProjTests/Objects/Files/PBXGroupTests.swift @@ -19,6 +19,7 @@ final class PBXGroupTests: XCTestCase { buildConfigurationList: XCConfigurationList(), compatibilityVersion: "0", preferredProjectObjectVersion: nil, + minimizedProjectReferenceProxies: nil, mainGroup: group) project.add(object: pbxProject) @@ -141,6 +142,7 @@ final class PBXGroupTests: XCTestCase { buildConfigurationList: XCConfigurationList(), compatibilityVersion: "0", preferredProjectObjectVersion: nil, + minimizedProjectReferenceProxies: nil, mainGroup: group) project.add(object: pbxProject) @@ -166,6 +168,7 @@ final class PBXGroupTests: XCTestCase { buildConfigurationList: XCConfigurationList(), compatibilityVersion: "0", preferredProjectObjectVersion: nil, + minimizedProjectReferenceProxies: nil, mainGroup: group) project.add(object: pbxProject) @@ -190,6 +193,7 @@ final class PBXGroupTests: XCTestCase { buildConfigurationList: XCConfigurationList(), compatibilityVersion: "0", preferredProjectObjectVersion: nil, + minimizedProjectReferenceProxies: nil, mainGroup: group) project.add(object: pbxProject) diff --git a/Tests/XcodeProjTests/Objects/Project/PBXProjEncoderTests.swift b/Tests/XcodeProjTests/Objects/Project/PBXProjEncoderTests.swift index 9ff5e3cbc..482bf8cce 100644 --- a/Tests/XcodeProjTests/Objects/Project/PBXProjEncoderTests.swift +++ b/Tests/XcodeProjTests/Objects/Project/PBXProjEncoderTests.swift @@ -294,7 +294,18 @@ class PBXProjEncoderTests: XCTestCase { let lines = lines(fromFile: encodeProject(settings: settings)) let beginGroup = lines.findLine("/* Begin PBXFileSystemSynchronizedRootGroup section */") - var line = lines.validate(line: "6CF05B9D2C53F64800EF267F /* SynchronizedRootGroups */ = {isa = PBXFileSystemSynchronizedRootGroup; exceptions = (6CF05BA32C53F97F00EF267F /* PBXFileSystemSynchronizedBuildFileExceptionSet */, ); explicitFileTypes = {}; explicitFolders = (); path = SynchronizedRootGroups; sourceTree = \"\"; };", after: beginGroup) + var line = lines.validate(line: "6CF05B9D2C53F64800EF267F /* SynchronizedRootGroups */ = {", after: beginGroup) + line = lines.validate(line: "isa = PBXFileSystemSynchronizedRootGroup;", after: line) + line = lines.validate(line: "exceptions = (", after: line) + line = lines.validate(line: "6CF05BA32C53F97F00EF267F /* PBXFileSystemSynchronizedBuildFileExceptionSet */,", after: line) + line = lines.validate(line: ");", after: line) + line = lines.validate(line: "explicitFileTypes = {", after: line) + line = lines.validate(line: "};", after: line) + line = lines.validate(line: "explicitFolders = (", after: line) + line = lines.validate(line: ");", after: line) + line = lines.validate(line: "path = SynchronizedRootGroups;", after: line) + line = lines.validate(line: "sourceTree = \"\";", after: line) + line = lines.validate(line: "};", after: line) line = lines.validate(line: "/* End PBXFileSystemSynchronizedRootGroup section */", after: line) } diff --git a/Tests/XcodeProjTests/Objects/Project/PBXProject+Fixtures.swift b/Tests/XcodeProjTests/Objects/Project/PBXProject+Fixtures.swift index d59c3e9c8..dd51d4143 100644 --- a/Tests/XcodeProjTests/Objects/Project/PBXProject+Fixtures.swift +++ b/Tests/XcodeProjTests/Objects/Project/PBXProject+Fixtures.swift @@ -11,6 +11,7 @@ extension PBXProject { buildConfigurationList: buildConfigurationList, compatibilityVersion: compatibilityVersion, preferredProjectObjectVersion: nil, + minimizedProjectReferenceProxies: nil, mainGroup: mainGroup) } } diff --git a/Tests/XcodeProjTests/Objects/Project/PBXProjectTests.swift b/Tests/XcodeProjTests/Objects/Project/PBXProjectTests.swift index 8353a8a80..dc79c4698 100644 --- a/Tests/XcodeProjTests/Objects/Project/PBXProjectTests.swift +++ b/Tests/XcodeProjTests/Objects/Project/PBXProjectTests.swift @@ -13,6 +13,7 @@ final class PBXProjectTests: XCTestCase { buildConfigurationList: XCConfigurationList(), compatibilityVersion: "", preferredProjectObjectVersion: nil, + minimizedProjectReferenceProxies: nil, mainGroup: PBXGroup(), attributes: ["LastUpgradeCheck": "0940"], targetAttributes: [target: ["TestTargetID": "123"]]) @@ -56,6 +57,7 @@ final class PBXProjectTests: XCTestCase { buildConfigurationList: configurationList, compatibilityVersion: "0", preferredProjectObjectVersion: nil, + minimizedProjectReferenceProxies: nil, mainGroup: mainGroup, targets: [target]) @@ -92,6 +94,7 @@ final class PBXProjectTests: XCTestCase { buildConfigurationList: configurationList, compatibilityVersion: "0", preferredProjectObjectVersion: nil, + minimizedProjectReferenceProxies: nil, mainGroup: mainGroup, targets: [target]) @@ -129,6 +132,7 @@ final class PBXProjectTests: XCTestCase { buildConfigurationList: configurationList, compatibilityVersion: "0", preferredProjectObjectVersion: nil, + minimizedProjectReferenceProxies: nil, mainGroup: mainGroup, targets: [target]) @@ -170,6 +174,7 @@ final class PBXProjectTests: XCTestCase { buildConfigurationList: configurationList, compatibilityVersion: "0", preferredProjectObjectVersion: nil, + minimizedProjectReferenceProxies: nil, mainGroup: mainGroup, targets: [target]) @@ -224,6 +229,7 @@ final class PBXProjectTests: XCTestCase { buildConfigurationList: configurationList, compatibilityVersion: "0", preferredProjectObjectVersion: nil, + minimizedProjectReferenceProxies: nil, mainGroup: mainGroup, targets: [target, secondTarget]) @@ -299,6 +305,7 @@ final class PBXProjectTests: XCTestCase { buildConfigurationList: configurationList, compatibilityVersion: "0", preferredProjectObjectVersion: nil, + minimizedProjectReferenceProxies: nil, mainGroup: mainGroup, targets: [target, secondTarget]) diff --git a/Tests/XcodeProjTests/Objects/Targets/PBXAggregateTargetTests.swift b/Tests/XcodeProjTests/Objects/Targets/PBXAggregateTargetTests.swift index 3083d623e..09947e76c 100644 --- a/Tests/XcodeProjTests/Objects/Targets/PBXAggregateTargetTests.swift +++ b/Tests/XcodeProjTests/Objects/Targets/PBXAggregateTargetTests.swift @@ -40,6 +40,7 @@ final class PBXAggregateTargetTests: XCTestCase { buildConfigurationList: configurationList, compatibilityVersion: "0", preferredProjectObjectVersion: nil, + minimizedProjectReferenceProxies: nil, mainGroup: mainGroup) objects.add(object: project) diff --git a/Tests/XcodeProjTests/Objects/Targets/PBXNativeTargetTests.swift b/Tests/XcodeProjTests/Objects/Targets/PBXNativeTargetTests.swift index 3a08b7aa9..11aa27581 100644 --- a/Tests/XcodeProjTests/Objects/Targets/PBXNativeTargetTests.swift +++ b/Tests/XcodeProjTests/Objects/Targets/PBXNativeTargetTests.swift @@ -41,6 +41,7 @@ final class PBXNativeTargetTests: XCTestCase { buildConfigurationList: configurationList, compatibilityVersion: "0", preferredProjectObjectVersion: nil, + minimizedProjectReferenceProxies: nil, mainGroup: mainGroup) objects.add(object: project) diff --git a/Tests/XcodeProjTests/Project/XcodeProjIntegrationTests.swift b/Tests/XcodeProjTests/Project/XcodeProjIntegrationTests.swift index 8bcb72580..374515c8b 100644 --- a/Tests/XcodeProjTests/Project/XcodeProjIntegrationTests.swift +++ b/Tests/XcodeProjTests/Project/XcodeProjIntegrationTests.swift @@ -4,6 +4,11 @@ import XCTest @testable import XcodeProj final class XcodeProjIntegrationTests: XCTestCase { + func test_write_xcode16Project() throws { + try testReadWriteProducesNoDiff(from: xcode16ProjectPath, + initModel: XcodeProj.init(path:)) + } + func test_read_iosXcodeProj() throws { let subject = try XcodeProj(path: iosProjectPath) assert(project: subject) @@ -96,6 +101,10 @@ final class XcodeProjIntegrationTests: XCTestCase { fixturesPath() + "iOS/Project.xcodeproj" } + private var xcode16ProjectPath: Path { + fixturesPath() + "Xcode16/Test.xcodeproj" + } + private var synchronizedRootGroupsFixturePath: Path { fixturesPath() + "SynchronizedRootGroups/SynchronizedRootGroups.xcodeproj" } diff --git a/Tests/XcodeProjTests/Utils/ReferenceGeneratorTests.swift b/Tests/XcodeProjTests/Utils/ReferenceGeneratorTests.swift index e9d15059c..6df8959c3 100644 --- a/Tests/XcodeProjTests/Utils/ReferenceGeneratorTests.swift +++ b/Tests/XcodeProjTests/Utils/ReferenceGeneratorTests.swift @@ -95,6 +95,7 @@ private extension PBXProj { buildConfigurationList: XCConfigurationList.fixture(), compatibilityVersion: Xcode.Default.compatibilityVersion, preferredProjectObjectVersion: nil, + minimizedProjectReferenceProxies: nil, mainGroup: mainGroup) add(object: mainGroup) From 0b5e5a80e4357bf27bf1ba28879896a7d965a092 Mon Sep 17 00:00:00 2001 From: pepicrft Date: Thu, 10 Oct 2024 10:13:25 +0000 Subject: [PATCH 377/678] [Release] XcodeProj 8.24.2 --- CHANGELOG.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index e87871c1b..1b1f77f4e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,15 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [8.24.2] - 2024-10-10 +### Details +#### Chore +- Update actions/checkout digest to eef6144 by @renovate[bot] in [#864](https://github.com/tuist/XcodeProj/pull/864) +- Update dependency tuist to v4.29.0 by @renovate[bot] in [#863](https://github.com/tuist/XcodeProj/pull/863) + +#### Fix +- Issues parsing Xcode 16 projects by @pepicrft in [#862](https://github.com/tuist/XcodeProj/pull/862) + ## [8.24.1] - 2024-09-27 ### Details #### Fix @@ -86,6 +95,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 #### Feat - Introduce the new Xcode 16 models `PBXFileSystemSynchronizedRootGroup` and `PBXFileSystemSynchronizedBuildFileExceptionSet` by @pepicrft in [#827](https://github.com/tuist/XcodeProj/pull/827) +[8.24.2]: https://github.com/tuist/XcodeProj/compare/8.24.1..8.24.2 [8.24.1]: https://github.com/tuist/XcodeProj/compare/8.24.0..8.24.1 [8.24.0]: https://github.com/tuist/XcodeProj/compare/8.23.11..8.24.0 [8.23.11]: https://github.com/tuist/XcodeProj/compare/8.23.10..8.23.11 From a3cbebb3e0d4b3926863a1d352285783053ab585 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 10 Oct 2024 10:46:50 +0000 Subject: [PATCH 378/678] chore(deps): update dependency tuist to v4.29.1 --- .mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise.toml b/.mise.toml index 571d90551..81a34e8c5 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,5 +1,5 @@ [tools] swiftformat = "0.54.3" -tuist = "4.29.0" +tuist = "4.29.1" swiftlint = "0.55.1" "git-cliff" = "2.4.0" From dc3b87a4e69f9cd06c6cb16199f5d0472e57ef6b Mon Sep 17 00:00:00 2001 From: "renovate[bot]" Date: Thu, 10 Oct 2024 14:26:35 +0000 Subject: [PATCH 379/678] [Release] XcodeProj 8.24.3 --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1b1f77f4e..1089d0bc2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,11 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [8.24.3] - 2024-10-10 +### Details +#### Chore +- Update dependency tuist to v4.29.1 by @renovate[bot] in [#866](https://github.com/tuist/XcodeProj/pull/866) + ## [8.24.2] - 2024-10-10 ### Details #### Chore @@ -95,6 +100,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 #### Feat - Introduce the new Xcode 16 models `PBXFileSystemSynchronizedRootGroup` and `PBXFileSystemSynchronizedBuildFileExceptionSet` by @pepicrft in [#827](https://github.com/tuist/XcodeProj/pull/827) +[8.24.3]: https://github.com/tuist/XcodeProj/compare/8.24.2..8.24.3 [8.24.2]: https://github.com/tuist/XcodeProj/compare/8.24.1..8.24.2 [8.24.1]: https://github.com/tuist/XcodeProj/compare/8.24.0..8.24.1 [8.24.0]: https://github.com/tuist/XcodeProj/compare/8.23.11..8.24.0 From ec4abeaddb80e251d51055e79f997e1ab89b2ecf Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 16 Oct 2024 14:34:28 +0000 Subject: [PATCH 380/678] chore(deps): update dependency tuist to v4.30.0 --- .mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise.toml b/.mise.toml index 81a34e8c5..95a598261 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,5 +1,5 @@ [tools] swiftformat = "0.54.3" -tuist = "4.29.1" +tuist = "4.30.0" swiftlint = "0.55.1" "git-cliff" = "2.4.0" From 59b6e3fe9b07e3323b4c4e97b58523bc3c5754a0 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" Date: Wed, 16 Oct 2024 17:47:49 +0000 Subject: [PATCH 381/678] [Release] XcodeProj 8.24.4 --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1089d0bc2..e7d62c350 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,11 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [8.24.4] - 2024-10-16 +### Details +#### Chore +- Update dependency tuist to v4.30.0 by @renovate[bot] in [#870](https://github.com/tuist/XcodeProj/pull/870) + ## [8.24.3] - 2024-10-10 ### Details #### Chore @@ -100,6 +105,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 #### Feat - Introduce the new Xcode 16 models `PBXFileSystemSynchronizedRootGroup` and `PBXFileSystemSynchronizedBuildFileExceptionSet` by @pepicrft in [#827](https://github.com/tuist/XcodeProj/pull/827) +[8.24.4]: https://github.com/tuist/XcodeProj/compare/8.24.3..8.24.4 [8.24.3]: https://github.com/tuist/XcodeProj/compare/8.24.2..8.24.3 [8.24.2]: https://github.com/tuist/XcodeProj/compare/8.24.1..8.24.2 [8.24.1]: https://github.com/tuist/XcodeProj/compare/8.24.0..8.24.1 From 4d85c97dd96ffea4400d0f136a0ee405683ea9e5 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 23 Oct 2024 12:51:04 +0000 Subject: [PATCH 382/678] chore(deps): update dependency tuist to v4.31.0 --- .mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise.toml b/.mise.toml index 95a598261..800ef6454 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,5 +1,5 @@ [tools] swiftformat = "0.54.3" -tuist = "4.30.0" +tuist = "4.31.0" swiftlint = "0.55.1" "git-cliff" = "2.4.0" From 0c622f0dbf69a314d4e00e912e0b81fb9a2b3282 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" Date: Wed, 23 Oct 2024 16:57:20 +0000 Subject: [PATCH 383/678] [Release] XcodeProj 8.24.5 --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index e7d62c350..db93dd1a0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,11 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [8.24.5] - 2024-10-23 +### Details +#### Chore +- Update dependency tuist to v4.31.0 by @renovate[bot] in [#872](https://github.com/tuist/XcodeProj/pull/872) + ## [8.24.4] - 2024-10-16 ### Details #### Chore @@ -105,6 +110,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 #### Feat - Introduce the new Xcode 16 models `PBXFileSystemSynchronizedRootGroup` and `PBXFileSystemSynchronizedBuildFileExceptionSet` by @pepicrft in [#827](https://github.com/tuist/XcodeProj/pull/827) +[8.24.5]: https://github.com/tuist/XcodeProj/compare/8.24.4..8.24.5 [8.24.4]: https://github.com/tuist/XcodeProj/compare/8.24.3..8.24.4 [8.24.3]: https://github.com/tuist/XcodeProj/compare/8.24.2..8.24.3 [8.24.2]: https://github.com/tuist/XcodeProj/compare/8.24.1..8.24.2 From 8157e7c553ae44c44a9875e836e86beac7416a59 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 23 Oct 2024 20:11:42 +0000 Subject: [PATCH 384/678] chore(deps): update actions/checkout digest to 11bd719 --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 56b05e3c2..b62a1336d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -23,7 +23,7 @@ jobs: timeout-minutes: 15 if: "!startsWith(github.event.head_commit.message, '[Release]')" steps: - - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4 + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 with: fetch-depth: 0 - uses: jdx/mise-action@v2 From f6c9cb05835086af13f91317f92693848b43ea47 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" Date: Wed, 23 Oct 2024 22:39:29 +0000 Subject: [PATCH 385/678] [Release] XcodeProj 8.24.6 --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index db93dd1a0..1b8766aaf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,11 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [8.24.6] - 2024-10-23 +### Details +#### Chore +- Update actions/checkout digest to 11bd719 by @renovate[bot] in [#873](https://github.com/tuist/XcodeProj/pull/873) + ## [8.24.5] - 2024-10-23 ### Details #### Chore @@ -110,6 +115,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 #### Feat - Introduce the new Xcode 16 models `PBXFileSystemSynchronizedRootGroup` and `PBXFileSystemSynchronizedBuildFileExceptionSet` by @pepicrft in [#827](https://github.com/tuist/XcodeProj/pull/827) +[8.24.6]: https://github.com/tuist/XcodeProj/compare/8.24.5..8.24.6 [8.24.5]: https://github.com/tuist/XcodeProj/compare/8.24.4..8.24.5 [8.24.4]: https://github.com/tuist/XcodeProj/compare/8.24.3..8.24.4 [8.24.3]: https://github.com/tuist/XcodeProj/compare/8.24.2..8.24.3 From 8ce59b07b50bfbeb7f204c6a3f65fc51b1a26b1b Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 31 Oct 2024 17:17:19 +0000 Subject: [PATCH 386/678] chore(deps): update dependency tuist to v4.32.0 --- .mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise.toml b/.mise.toml index 800ef6454..b4ffd31ba 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,5 +1,5 @@ [tools] swiftformat = "0.54.3" -tuist = "4.31.0" +tuist = "4.32.0" swiftlint = "0.55.1" "git-cliff" = "2.4.0" From 2c495492fb6e01de5e718a0fd94e0fb28a307d4d Mon Sep 17 00:00:00 2001 From: "renovate[bot]" Date: Thu, 31 Oct 2024 19:34:44 +0000 Subject: [PATCH 387/678] [Release] XcodeProj 8.24.7 --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1b8766aaf..a69dccb5e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,11 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [8.24.7] - 2024-10-31 +### Details +#### Chore +- Update dependency tuist to v4.32.0 by @renovate[bot] in [#875](https://github.com/tuist/XcodeProj/pull/875) + ## [8.24.6] - 2024-10-23 ### Details #### Chore @@ -115,6 +120,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 #### Feat - Introduce the new Xcode 16 models `PBXFileSystemSynchronizedRootGroup` and `PBXFileSystemSynchronizedBuildFileExceptionSet` by @pepicrft in [#827](https://github.com/tuist/XcodeProj/pull/827) +[8.24.7]: https://github.com/tuist/XcodeProj/compare/8.24.6..8.24.7 [8.24.6]: https://github.com/tuist/XcodeProj/compare/8.24.5..8.24.6 [8.24.5]: https://github.com/tuist/XcodeProj/compare/8.24.4..8.24.5 [8.24.4]: https://github.com/tuist/XcodeProj/compare/8.24.3..8.24.4 From 4e4f5961e2eefd1a6695d87347cdd9d3c13fb6ba Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 1 Nov 2024 16:49:55 +0000 Subject: [PATCH 388/678] chore(deps): update dependency tuist to v4.32.1 --- .mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise.toml b/.mise.toml index b4ffd31ba..fff987951 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,5 +1,5 @@ [tools] swiftformat = "0.54.3" -tuist = "4.32.0" +tuist = "4.32.1" swiftlint = "0.55.1" "git-cliff" = "2.4.0" From 549ed5445c4c84e45fa6b3f1ff3f56bc94973779 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" Date: Fri, 1 Nov 2024 18:20:58 +0000 Subject: [PATCH 389/678] [Release] XcodeProj 8.24.8 --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index a69dccb5e..cded08711 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,11 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [8.24.8] - 2024-11-01 +### Details +#### Chore +- Update dependency tuist to v4.32.1 by @renovate[bot] in [#876](https://github.com/tuist/XcodeProj/pull/876) + ## [8.24.7] - 2024-10-31 ### Details #### Chore @@ -120,6 +125,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 #### Feat - Introduce the new Xcode 16 models `PBXFileSystemSynchronizedRootGroup` and `PBXFileSystemSynchronizedBuildFileExceptionSet` by @pepicrft in [#827](https://github.com/tuist/XcodeProj/pull/827) +[8.24.8]: https://github.com/tuist/XcodeProj/compare/8.24.7..8.24.8 [8.24.7]: https://github.com/tuist/XcodeProj/compare/8.24.6..8.24.7 [8.24.6]: https://github.com/tuist/XcodeProj/compare/8.24.5..8.24.6 [8.24.5]: https://github.com/tuist/XcodeProj/compare/8.24.4..8.24.5 From 8b82209310f26796a400a3fe976c9300161ac795 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 7 Nov 2024 18:36:04 +0000 Subject: [PATCH 390/678] chore(deps): update dependency tuist to v4.33.0 (#877) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise.toml b/.mise.toml index fff987951..4824d9583 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,5 +1,5 @@ [tools] swiftformat = "0.54.3" -tuist = "4.32.1" +tuist = "4.33.0" swiftlint = "0.55.1" "git-cliff" = "2.4.0" From 85265f385fd4d22e366a856f1ee0e1ecf3298a51 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" Date: Thu, 7 Nov 2024 18:36:38 +0000 Subject: [PATCH 391/678] [Release] XcodeProj 8.24.9 --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index cded08711..24363f421 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,11 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [8.24.9] - 2024-11-07 +### Details +#### Chore +- Update dependency tuist to v4.33.0 by @renovate[bot] in [#877](https://github.com/tuist/XcodeProj/pull/877) + ## [8.24.8] - 2024-11-01 ### Details #### Chore @@ -125,6 +130,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 #### Feat - Introduce the new Xcode 16 models `PBXFileSystemSynchronizedRootGroup` and `PBXFileSystemSynchronizedBuildFileExceptionSet` by @pepicrft in [#827](https://github.com/tuist/XcodeProj/pull/827) +[8.24.9]: https://github.com/tuist/XcodeProj/compare/8.24.8..8.24.9 [8.24.8]: https://github.com/tuist/XcodeProj/compare/8.24.7..8.24.8 [8.24.7]: https://github.com/tuist/XcodeProj/compare/8.24.6..8.24.7 [8.24.6]: https://github.com/tuist/XcodeProj/compare/8.24.5..8.24.6 From 5e09f610f17cb6eb8b3c1c94073db1ac919bd9a7 Mon Sep 17 00:00:00 2001 From: Yunseo Kang <65678579+yungu0010@users.noreply.github.com> Date: Wed, 20 Nov 2024 21:49:38 +0900 Subject: [PATCH 392/678] refactor: align ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES with the Xcode default (#881) * fix: aline always_embed_swift_standard_libiraries with the xcode default * delete always_embed_swift_standard_libraries from test targetSettings watchOSApplication * remove no longer used method * fix build error --- .../XcodeProj/Utils/BuildSettingsProvider.swift | 15 --------------- .../Utils/BuildSettingsProviderTests.swift | 1 - 2 files changed, 16 deletions(-) diff --git a/Sources/XcodeProj/Utils/BuildSettingsProvider.swift b/Sources/XcodeProj/Utils/BuildSettingsProvider.swift index 82a845c36..cc529a787 100644 --- a/Sources/XcodeProj/Utils/BuildSettingsProvider.swift +++ b/Sources/XcodeProj/Utils/BuildSettingsProvider.swift @@ -72,10 +72,6 @@ public class BuildSettingsProvider { buildSettings.merge(targetSwiftSettings(product: product), uniquingKeysWith: { $1 }) } - if let platform, let product, let swift, swift == true { - buildSettings.merge(targetSwiftSettings(platform: platform, product: product), uniquingKeysWith: { $1 }) - } - return buildSettings } @@ -370,17 +366,6 @@ public class BuildSettingsProvider { return [:] } } - - private static func targetSwiftSettings(platform: Platform, product: Product) -> BuildSettings { - switch (platform, product) { - case (.watchOS, .application): - return [ - "ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES": "YES", - ] - default: - return [:] - } - } } // Overloading `~=` enables customizing switch statement pattern matching diff --git a/Tests/XcodeProjTests/Utils/BuildSettingsProviderTests.swift b/Tests/XcodeProjTests/Utils/BuildSettingsProviderTests.swift index 4b65f3e19..c03339fce 100644 --- a/Tests/XcodeProjTests/Utils/BuildSettingsProviderTests.swift +++ b/Tests/XcodeProjTests/Utils/BuildSettingsProviderTests.swift @@ -135,7 +135,6 @@ class BuildSettingProviderTests: XCTestCase { // Then assertEqualSettings(results, [ - "ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES": "YES", "ASSETCATALOG_COMPILER_APPICON_NAME": "AppIcon", "ENABLE_PREVIEWS": "YES", "LD_RUNPATH_SEARCH_PATHS": ["$(inherited)", "@executable_path/Frameworks"], From d321ce50e111b8476e65653fca483f22b63cf58f Mon Sep 17 00:00:00 2001 From: fortmarek Date: Wed, 20 Nov 2024 12:50:00 +0000 Subject: [PATCH 393/678] [Release] XcodeProj 8.24.10 --- CHANGELOG.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 24363f421..9b5b8faa6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [8.24.10] - 2024-11-20 +### Details +#### Refactor +- Align ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES with the Xcode default by @yungu0010 in [#881](https://github.com/tuist/XcodeProj/pull/881) + +## New Contributors +* @yungu0010 made their first contribution in [#881](https://github.com/tuist/XcodeProj/pull/881) ## [8.24.9] - 2024-11-07 ### Details #### Chore @@ -130,6 +137,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 #### Feat - Introduce the new Xcode 16 models `PBXFileSystemSynchronizedRootGroup` and `PBXFileSystemSynchronizedBuildFileExceptionSet` by @pepicrft in [#827](https://github.com/tuist/XcodeProj/pull/827) +[8.24.10]: https://github.com/tuist/XcodeProj/compare/8.24.9..8.24.10 [8.24.9]: https://github.com/tuist/XcodeProj/compare/8.24.8..8.24.9 [8.24.8]: https://github.com/tuist/XcodeProj/compare/8.24.7..8.24.8 [8.24.7]: https://github.com/tuist/XcodeProj/compare/8.24.6..8.24.7 From 0959d821aae8971dddf8f31abf3bacdb2dec2523 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 27 Nov 2024 18:05:26 +0000 Subject: [PATCH 394/678] chore(deps): update dependency tuist to v4.36.0 (#882) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise.toml b/.mise.toml index 4824d9583..075d5edcc 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,5 +1,5 @@ [tools] swiftformat = "0.54.3" -tuist = "4.33.0" +tuist = "4.36.0" swiftlint = "0.55.1" "git-cliff" = "2.4.0" From 9f26d78d72ef40dd2e35f624bbcde1e3b28762cf Mon Sep 17 00:00:00 2001 From: "renovate[bot]" Date: Wed, 27 Nov 2024 18:05:45 +0000 Subject: [PATCH 395/678] [Release] XcodeProj 8.24.11 --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9b5b8faa6..693278fa5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,11 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [8.24.11] - 2024-11-27 +### Details +#### Chore +- Update dependency tuist to v4.36.0 by @renovate[bot] in [#882](https://github.com/tuist/XcodeProj/pull/882) + ## [8.24.10] - 2024-11-20 ### Details #### Refactor @@ -137,6 +142,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 #### Feat - Introduce the new Xcode 16 models `PBXFileSystemSynchronizedRootGroup` and `PBXFileSystemSynchronizedBuildFileExceptionSet` by @pepicrft in [#827](https://github.com/tuist/XcodeProj/pull/827) +[8.24.11]: https://github.com/tuist/XcodeProj/compare/8.24.10..8.24.11 [8.24.10]: https://github.com/tuist/XcodeProj/compare/8.24.9..8.24.10 [8.24.9]: https://github.com/tuist/XcodeProj/compare/8.24.8..8.24.9 [8.24.8]: https://github.com/tuist/XcodeProj/compare/8.24.7..8.24.8 From 846804186aff36bedb079c6d5731c14f76fb0a65 Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Tue, 3 Dec 2024 15:38:59 +0100 Subject: [PATCH 396/678] docs: add georgenavarro as a contributor for code (#885) * docs: update README.md [skip ci] * docs: update .all-contributorsrc [skip ci] --------- Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com> --- .all-contributorsrc | 9 +++++++++ README.md | 3 ++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/.all-contributorsrc b/.all-contributorsrc index eb0f72aef..3d6e6ae82 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -373,6 +373,15 @@ "contributions": [ "code" ] + }, + { + "login": "georgenavarro", + "name": "George Navarro", + "avatar_url": "https://avatars.githubusercontent.com/u/2748028?v=4", + "profile": "https://github.com/georgenavarro", + "contributions": [ + "code" + ] } ], "contributorsPerLine": 7, diff --git a/README.md b/README.md index ff763a9e6..2cf137ff4 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # XcodeProj -[![All Contributors](https://img.shields.io/badge/all_contributors-41-orange.svg?style=flat-square)](#contributors-) +[![All Contributors](https://img.shields.io/badge/all_contributors-42-orange.svg?style=flat-square)](#contributors-) [![Swift Package Manager](https://img.shields.io/badge/swift%20package%20manager-compatible-brightgreen.svg)](https://swift.org/package-manager/) @@ -187,6 +187,7 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d Jaewon-Yun
Jaewon-Yun

💻 Mike Gerasymenko
Mike Gerasymenko

💻 Filip Racki
Filip Racki

💻 + George Navarro
George Navarro

💻 From 10c918e3548f01490398674656036e320ca5b0e8 Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Tue, 3 Dec 2024 15:40:22 +0100 Subject: [PATCH 397/678] docs: add kelvinharron as a contributor for code (#886) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * docs: update README.md [skip ci] * docs: update .all-contributorsrc [skip ci] --------- Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com> Co-authored-by: Pedro Piñera Buendía <663605+pepicrft@users.noreply.github.com> --- .all-contributorsrc | 8 ++++++++ README.md | 5 ++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/.all-contributorsrc b/.all-contributorsrc index 3d6e6ae82..586feebb5 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -375,6 +375,14 @@ ] }, { + "login": "kelvinharron", + "name": "Kelvin Harron", + "avatar_url": "https://avatars.githubusercontent.com/u/16445381?v=4", + "profile": "https://github.com/kelvinharron", + "contributions": [ + "code" + ] + }, "login": "georgenavarro", "name": "George Navarro", "avatar_url": "https://avatars.githubusercontent.com/u/2748028?v=4", diff --git a/README.md b/README.md index 2cf137ff4..b275555d1 100644 --- a/README.md +++ b/README.md @@ -187,7 +187,10 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d Jaewon-Yun
Jaewon-Yun

💻 Mike Gerasymenko
Mike Gerasymenko

💻 Filip Racki
Filip Racki

💻 - George Navarro
George Navarro

💻 + Kelvin Harron
Kelvin Harron

💻 + + + George Navarro
George Navarro

💻 From 7f92f6f22282f2d70edbb99ee032b9821bae83e2 Mon Sep 17 00:00:00 2001 From: Maxim Date: Tue, 3 Dec 2024 19:04:44 +0300 Subject: [PATCH 398/678] fix: Inconsistent behaviour with Xcode 16 when `PBXProject.TargetAttributes` is empty (#865) * remove empty TargetAttributes from result pbxproj as Xcode 16 do each run * Add tests * Fix the tests on Linux * Some fixes * Lint fixes * Use Swift 5.10.0 * Don't virtualize on CI * Fix tests on Linux * Not select Xcode * Fix linting issue * Fix tests on linux --------- Co-authored-by: Maxim Kholyavkin Co-authored-by: Pedro --- .all-contributorsrc | 1 + .github/workflows/xcodeproj.yml | 16 ++-- .mise/tasks/test-linux | 2 +- .swift-version | 2 +- Package.resolved | 18 ---- Package.swift | 3 +- Sources/XcodeProj/Errors/Errors.swift | 54 ++++++------ .../KeyedDecodingContainer+Additions.swift | 8 +- .../Objects/Files/PBXContainerItemProxy.swift | 24 +++--- .../XcodeProj/Objects/Files/PBXGroup.swift | 11 ++- .../Objects/Files/PBXSourceTree.swift | 22 ++--- .../Objects/Project/PBXObjects.swift | 54 ++++++------ .../Objects/Project/PBXOutputSettings.swift | 28 +++--- .../Objects/Project/PBXProject.swift | 2 +- .../XCRemoteSwiftPackageReference.swift | 12 +-- .../Objects/Targets/PBXProductType.swift | 32 +++---- .../Scheme/XCScheme+BuildableReference.swift | 4 +- Sources/XcodeProj/Scheme/XCScheme.swift | 4 +- .../XcodeProj/Scheme/XCSchemeManagement.swift | 2 +- .../Utils/BuildSettingsProvider.swift | 85 +++++++++++-------- Sources/XcodeProj/Utils/PBXBatchUpdater.swift | 11 ++- Sources/XcodeProj/Utils/PlistValue.swift | 20 ++--- .../XcodeProj/Workspace/XCWorkspaceData.swift | 4 +- .../Workspace/XCWorkspaceDataElement.swift | 10 +-- .../XCWorkspaceDataElementLocationType.swift | 38 ++++----- .../Objects/Project/PBXProjectTests.swift | 25 ++++++ Tuist.swift | 3 + Tuist/Config.swift | 3 - 28 files changed, 257 insertions(+), 241 deletions(-) create mode 100644 Tuist.swift delete mode 100644 Tuist/Config.swift diff --git a/.all-contributorsrc b/.all-contributorsrc index 586feebb5..1d5814be4 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -383,6 +383,7 @@ "code" ] }, + { "login": "georgenavarro", "name": "George Navarro", "avatar_url": "https://avatars.githubusercontent.com/u/2748028?v=4", diff --git a/.github/workflows/xcodeproj.yml b/.github/workflows/xcodeproj.yml index abe2b1317..d00503152 100644 --- a/.github/workflows/xcodeproj.yml +++ b/.github/workflows/xcodeproj.yml @@ -20,8 +20,6 @@ jobs: runs-on: macos-latest steps: - uses: actions/checkout@v3 - - name: Select Xcode 16 - run: sudo xcode-select -switch /Applications/Xcode_16.app/Contents/Developer - uses: jdx/mise-action@v2 - name: Build run: mise run build @@ -31,15 +29,14 @@ jobs: steps: - uses: actions/checkout@v3 - uses: jdx/mise-action@v2 + - uses: swift-actions/setup-swift@v2 - name: Build - run: mise run build-linux + run: swift build --configuration release test: name: Test (macOS / Xcode) runs-on: macos-latest steps: - uses: actions/checkout@v3 - - name: Select Xcode 16 - run: sudo xcode-select -switch /Applications/Xcode_16.app/Contents/Developer - uses: jdx/mise-action@v2 - name: Run tests run: mise run test @@ -50,15 +47,18 @@ jobs: steps: - uses: actions/checkout@v3 - uses: jdx/mise-action@v2 + - uses: swift-actions/setup-swift@v2 + - run: | + git config --global user.email 'xcodeproj@tuist.dev' + git config --global user.name 'xcodeproj' + git config --global init.defaultBranch main - name: Test - run: mise run test-linux + run: swift test lint: name: Lint runs-on: macos-latest steps: - uses: actions/checkout@v3 - - name: Select Xcode 16 - run: sudo xcode-select -switch /Applications/Xcode_16.app/Contents/Developer - uses: jdx/mise-action@v2 - run: mise run lint diff --git a/.mise/tasks/test-linux b/.mise/tasks/test-linux index 03150d3c7..f60874e80 100755 --- a/.mise/tasks/test-linux +++ b/.mise/tasks/test-linux @@ -1,7 +1,7 @@ #!/usr/bin/env bash # mise description="Run tests on Linux" -CONTAINER_RUNTIME=$(command -v podman || command -v docker) +CONTAINER_RUNTIME=docker if [ -z "$CONTAINER_RUNTIME" ]; then echo "Neither podman nor docker is available. Please install one to proceed." diff --git a/.swift-version b/.swift-version index 64ff7ded7..f9ce5a96e 100644 --- a/.swift-version +++ b/.swift-version @@ -1 +1 @@ -5.7.1 +5.10 diff --git a/Package.resolved b/Package.resolved index 36febe524..cb0282427 100644 --- a/Package.resolved +++ b/Package.resolved @@ -26,24 +26,6 @@ "revision" : "26cc5e9ae0947092c7139ef7ba612e34646086c7", "version" : "0.10.1" } - }, - { - "identity" : "swift-docc-plugin", - "kind" : "remoteSourceControl", - "location" : "https://github.com/apple/swift-docc-plugin", - "state" : { - "revision" : "85e4bb4e1cd62cec64a4b8e769dcefdf0c5b9d64", - "version" : "1.4.3" - } - }, - { - "identity" : "swift-docc-symbolkit", - "kind" : "remoteSourceControl", - "location" : "https://github.com/swiftlang/swift-docc-symbolkit", - "state" : { - "revision" : "b45d1f2ed151d057b54504d653e0da5552844e34", - "version" : "1.0.0" - } } ], "version" : 2 diff --git a/Package.swift b/Package.swift index 548f0c23b..3511847a3 100644 --- a/Package.swift +++ b/Package.swift @@ -1,4 +1,4 @@ -// swift-tools-version:5.8 +// swift-tools-version:5.10.0 import PackageDescription @@ -10,7 +10,6 @@ let package = Package( dependencies: [ .package(url: "https://github.com/tadija/AEXML.git", .upToNextMinor(from: "4.6.1")), .package(url: "https://github.com/kylef/PathKit.git", .upToNextMinor(from: "1.0.1")), - .package(url: "https://github.com/apple/swift-docc-plugin", from: "1.4.3"), ], targets: [ .target(name: "XcodeProj", diff --git a/Sources/XcodeProj/Errors/Errors.swift b/Sources/XcodeProj/Errors/Errors.swift index 8d563abac..4c98dab03 100644 --- a/Sources/XcodeProj/Errors/Errors.swift +++ b/Sources/XcodeProj/Errors/Errors.swift @@ -16,11 +16,11 @@ public enum XCodeProjError: Error, CustomStringConvertible, Sendable { public var description: String { switch self { case let .notFound(path): - return "The project cannot be found at \(path.string)" + "The project cannot be found at \(path.string)" case let .pbxprojNotFound(path): - return "The project doesn't contain a .pbxproj file at path: \(path.string)" + "The project doesn't contain a .pbxproj file at path: \(path.string)" case let .xcworkspaceNotFound(path): - return "The project doesn't contain a .xcworkspace at path: \(path.string)" + "The project doesn't contain a .xcworkspace at path: \(path.string)" } } } @@ -36,7 +36,7 @@ public enum XCSharedDataError: Error, CustomStringConvertible { public var description: String { switch self { case let .notFound(path): - return "xcshareddata not found at path \(path.string)" + "xcshareddata not found at path \(path.string)" } } } @@ -52,7 +52,7 @@ public enum XCUserDataError: Error, CustomStringConvertible { public var description: String { switch self { case let .notFound(path): - return "xcuserdata not found at path \(path.string)" + "xcuserdata not found at path \(path.string)" } } } @@ -68,7 +68,7 @@ public enum XCWorkspaceError: Error, CustomStringConvertible { public var description: String { switch self { case let .notFound(path): - return "The project cannot be found at \(path.string)" + "The project cannot be found at \(path.string)" } } } @@ -84,7 +84,7 @@ public enum XCWorkspaceDataError: Error, CustomStringConvertible { public var description: String { switch self { case let .notFound(path): - return "Workspace not found at \(path.string)" + "Workspace not found at \(path.string)" } } } @@ -100,7 +100,7 @@ public enum XcodeprojEditingError: Error, CustomStringConvertible { public var description: String { switch self { case let .unexistingFile(path): - return "The file at path \(path.string) doesn't exist" + "The file at path \(path.string) doesn't exist" } } } @@ -116,7 +116,7 @@ public enum XcodeprojWritingError: Error, CustomStringConvertible { public var description: String { switch self { case let .invalidType(classType, expected): - return "Invalid type for object \(classType) that expects a \(expected)" + "Invalid type for object \(classType) that expects a \(expected)" } } } @@ -140,15 +140,15 @@ public enum PBXObjectError: Error, CustomStringConvertible { public var description: String { switch self { case .missingIsa: - return "Isa property is missing." + "Isa property is missing." case let .unknownElement(element): - return "The element \(element) is not supported." + "The element \(element) is not supported." case .objectsReleased: - return "The PBXObjects instance has been released before saving." + "The PBXObjects instance has been released before saving." case let .objectNotFound(reference): - return "PBXObject with reference \"\(reference)\" not found." + "PBXObject with reference \"\(reference)\" not found." case let .orphaned(type, reference): - return "Trying to use object \(type) with reference '\(reference)' before being added to any project" + "Trying to use object \(type) with reference '\(reference)' before being added to any project" } } } @@ -164,7 +164,7 @@ enum PBXProjEncoderError: Error, CustomStringConvertible { var description: String { switch self { case .emptyProjectReference: - return "PBXProj should contain a reference to the XcodeProj object that represents the project" + "PBXProj should contain a reference to the XcodeProj object that represents the project" } } } @@ -187,23 +187,23 @@ enum PBXProjError: Error, CustomStringConvertible, Equatable { var description: String { switch self { case let .notFound(path): - return ".pbxproj not found at path \(path.string)" + ".pbxproj not found at path \(path.string)" case let .invalidGroupPath(sourceRoot, elementPath): - return "Cannot calculate full path for file element \"\(elementPath ?? "")\" in source root: \"\(sourceRoot)\"" + "Cannot calculate full path for file element \"\(elementPath ?? "")\" in source root: \"\(sourceRoot)\"" case let .targetNotFound(targetName): - return "Could not find target with \(targetName)" + "Could not find target with \(targetName)" case let .frameworksBuildPhaseNotFound(targetName): - return "Could not find frameworks build phase for target \(targetName)" + "Could not find frameworks build phase for target \(targetName)" case let .sourcesBuildPhaseNotFound(targetName): - return "Could not find sources build phase for target \(targetName)" + "Could not find sources build phase for target \(targetName)" case let .pathIsAbsolute(path): - return "Path must be relative, but path \(path.string) is absolute" + "Path must be relative, but path \(path.string) is absolute" case let .multipleLocalPackages(productName: productName): - return "Found multiple top-level packages named \(productName)" + "Found multiple top-level packages named \(productName)" case let .multipleRemotePackages(productName: productName): - return "Can not resolve dependency \(productName) - conflicting version requirements" + "Can not resolve dependency \(productName) - conflicting version requirements" case .malformed: - return "The .pbxproj is malformed." + "The .pbxproj is malformed." } } } @@ -221,9 +221,9 @@ public enum XCBreakpointListError: Error, CustomStringConvertible { public var description: String { switch self { case let .notFound(path): - return "Breakpoints_v2.xcbkptlist couldn't be found at path \(path.string)" + "Breakpoints_v2.xcbkptlist couldn't be found at path \(path.string)" case let .missing(property): - return "Property \(property) missing" + "Property \(property) missing" } } } @@ -238,7 +238,7 @@ public enum XCConfigError: Error, CustomStringConvertible { public var description: String { switch self { case let .notFound(path): - return ".xcconfig file not found at \(path.string)" + ".xcconfig file not found at \(path.string)" } } } diff --git a/Sources/XcodeProj/Extensions/KeyedDecodingContainer+Additions.swift b/Sources/XcodeProj/Extensions/KeyedDecodingContainer+Additions.swift index eadc1c410..7ff253646 100644 --- a/Sources/XcodeProj/Extensions/KeyedDecodingContainer+Additions.swift +++ b/Sources/XcodeProj/Extensions/KeyedDecodingContainer+Additions.swift @@ -11,15 +11,15 @@ extension KeyedDecodingContainer { func decodeIntIfPresent(_ key: KeyedDecodingContainer.Key) throws -> UInt? { if let string: String = try? decodeIfPresent(key) { - return UInt(string) + UInt(string) } else if let bool: Bool = try? decodeIfPresent(key) { - return bool ? 0 : 1 + bool ? 0 : 1 } else if let int: UInt = try decodeIfPresent(key) { // don't `try?` here in case key _does_ exist but isn't an expected type // ie. not a string/bool/int - return int + int } else { - return nil + nil } } diff --git a/Sources/XcodeProj/Objects/Files/PBXContainerItemProxy.swift b/Sources/XcodeProj/Objects/Files/PBXContainerItemProxy.swift index 014bc3eea..bbff85ce0 100644 --- a/Sources/XcodeProj/Objects/Files/PBXContainerItemProxy.swift +++ b/Sources/XcodeProj/Objects/Files/PBXContainerItemProxy.swift @@ -20,8 +20,8 @@ public final class PBXContainerItemProxy: PBXObject { var uuid: String { switch self { - case let .reference(reference): return reference.value - case let .string(string): return string + case let .reference(reference): reference.value + case let .string(string): string } } @@ -29,11 +29,11 @@ public final class PBXContainerItemProxy: PBXObject { switch self { case let .reference(reference): if let object = reference.getObject() { - return .object(object) + .object(object) } else { - return .string(reference.value) + .string(reference.value) } - case let .string(string): return .string(string) + case let .string(string): .string(string) } } } @@ -44,15 +44,15 @@ public final class PBXContainerItemProxy: PBXObject { var uuid: String { switch self { - case let .object(object): return object.uuid - case let .string(string): return string + case let .object(object): object.uuid + case let .string(string): string } } var reference: RemoteGlobalIDReference { switch self { - case let .object(object): return .reference(object.reference) - case let .string(string): return .string(string) + case let .object(object): .reference(object.reference) + case let .string(string): .string(string) } } } @@ -185,11 +185,11 @@ private extension PBXContainerItemProxy.ContainerPortal { var reference: PBXObjectReference? { switch self { case let .project(project): - return project.reference + project.reference case let .fileReference(fileReference): - return fileReference.reference + fileReference.reference case .unknownObject: - return nil + nil } } diff --git a/Sources/XcodeProj/Objects/Files/PBXGroup.swift b/Sources/XcodeProj/Objects/Files/PBXGroup.swift index 8b8d2814b..24b618064 100644 --- a/Sources/XcodeProj/Objects/Files/PBXGroup.swift +++ b/Sources/XcodeProj/Objects/Files/PBXGroup.swift @@ -215,18 +215,17 @@ public extension PBXGroup { return existingFileReference.value } - let path: String? - switch sourceTree { + let path: String? = switch sourceTree { case .group: - path = groupPath.map { filePath.relative(to: $0) }?.string + groupPath.map { filePath.relative(to: $0) }?.string case .sourceRoot: - path = filePath.relative(to: sourceRoot).string + filePath.relative(to: sourceRoot).string case .absolute, .sdkRoot, .developerDir: - path = filePath.string + filePath.string default: - path = nil + nil } let fileReference = PBXFileReference( sourceTree: sourceTree, diff --git a/Sources/XcodeProj/Objects/Files/PBXSourceTree.swift b/Sources/XcodeProj/Objects/Files/PBXSourceTree.swift index 811df5f8f..8d230376d 100644 --- a/Sources/XcodeProj/Objects/Files/PBXSourceTree.swift +++ b/Sources/XcodeProj/Objects/Files/PBXSourceTree.swift @@ -54,10 +54,10 @@ public enum PBXSourceTree: CustomStringConvertible, Equatable, Decodable { (.buildProductsDir, .buildProductsDir), (.sdkRoot, .sdkRoot), (.developerDir, .developerDir): - return true + true case let (.custom(lhsValue), .custom(rhsValue)): - return lhsValue == rhsValue + lhsValue == rhsValue case (.none, _), (.absolute, _), @@ -67,28 +67,28 @@ public enum PBXSourceTree: CustomStringConvertible, Equatable, Decodable { (.sdkRoot, _), (.developerDir, _), (.custom, _): - return false + false } } public var description: String { switch self { case .none: - return PBXSourceTree.noneValue + PBXSourceTree.noneValue case .absolute: - return PBXSourceTree.absoluteValue + PBXSourceTree.absoluteValue case .group: - return PBXSourceTree.groupValue + PBXSourceTree.groupValue case .sourceRoot: - return PBXSourceTree.sourceRootValue + PBXSourceTree.sourceRootValue case .buildProductsDir: - return PBXSourceTree.buildProductsDirValue + PBXSourceTree.buildProductsDirValue case .sdkRoot: - return PBXSourceTree.sdkRootValue + PBXSourceTree.sdkRootValue case .developerDir: - return PBXSourceTree.developerDirValue + PBXSourceTree.developerDirValue case let .custom(value): - return value + value } } } diff --git a/Sources/XcodeProj/Objects/Project/PBXObjects.swift b/Sources/XcodeProj/Objects/Project/PBXObjects.swift index 22cfe75cd..33d767a1c 100644 --- a/Sources/XcodeProj/Objects/Project/PBXObjects.swift +++ b/Sources/XcodeProj/Objects/Project/PBXObjects.swift @@ -312,59 +312,59 @@ class PBXObjects: Equatable { // Expression was too complex to be solved in reasonable time; // consider breaking up the expression into distinct sub-expressions if let object = buildFiles[reference] { - return object + object } else if let object = aggregateTargets[reference] { - return object + object } else if let object = legacyTargets[reference] { - return object + object } else if let object = containerItemProxies[reference] { - return object + object } else if let object = groups[reference] { - return object + object } else if let object = configurationLists[reference] { - return object + object } else if let object = buildConfigurations[reference] { - return object + object } else if let object = variantGroups[reference] { - return object + object } else if let object = targetDependencies[reference] { - return object + object } else if let object = nativeTargets[reference] { - return object + object } else if let object = fileReferences[reference] { - return object + object } else if let object = projects[reference] { - return object + object } else if let object = versionGroups[reference] { - return object + object } else if let object = referenceProxies[reference] { - return object + object } else if let object = copyFilesBuildPhases[reference] { - return object + object } else if let object = shellScriptBuildPhases[reference] { - return object + object } else if let object = resourcesBuildPhases[reference] { - return object + object } else if let object = frameworksBuildPhases[reference] { - return object + object } else if let object = headersBuildPhases[reference] { - return object + object } else if let object = sourcesBuildPhases[reference] { - return object + object } else if let object = carbonResourcesBuildPhases[reference] { - return object + object } else if let object = buildRules[reference] { - return object + object } else if let object = remoteSwiftPackageReferences[reference] { - return object + object } else if let object = swiftPackageProductDependencies[reference] { - return object + object } else if let object = fileSystemSynchronizedRootGroups[reference] { - return object + object } else if let object = fileSystemSynchronizedBuildFileExceptionSets[reference] { - return object + object } else { - return nil + nil } } } diff --git a/Sources/XcodeProj/Objects/Project/PBXOutputSettings.swift b/Sources/XcodeProj/Objects/Project/PBXOutputSettings.swift index 0d82fb228..0d825794b 100644 --- a/Sources/XcodeProj/Objects/Project/PBXOutputSettings.swift +++ b/Sources/XcodeProj/Objects/Project/PBXOutputSettings.swift @@ -47,28 +47,28 @@ public enum PBXFileOrder { func sort(lhs: (PBXObjectReference, PBXBuildFile), rhs: (PBXObjectReference, PBXBuildFile)) -> Bool { switch self { case .byFilename: - return sortBuildFilesByName(lhs.1, rhs.1) + sortBuildFilesByName(lhs.1, rhs.1) default: - return lhs.0 < rhs.0 + lhs.0 < rhs.0 } } func sort(lhs: (PBXObjectReference, PBXBuildPhaseFile), rhs: (PBXObjectReference, PBXBuildPhaseFile)) -> Bool { switch self { case .byFilename: - return sortBuildFilesByName(lhs.1.buildFile, rhs.1.buildFile) + sortBuildFilesByName(lhs.1.buildFile, rhs.1.buildFile) default: - return lhs.0 < rhs.0 + lhs.0 < rhs.0 } } func sort(lhs: (PBXObjectReference, PBXFileReference), rhs: (PBXObjectReference, PBXFileReference)) -> Bool { switch self { case .byFilename: - return sortFileElementsByName(lhs.1, rhs.1) + sortFileElementsByName(lhs.1, rhs.1) default: - return lhs.0 < rhs.0 + lhs.0 < rhs.0 } } } @@ -76,9 +76,9 @@ public enum PBXFileOrder { private extension PBXFileElement { var isGroup: Bool { switch self { - case is PBXVariantGroup, is XCVersionGroup: return false - case is PBXGroup: return true - default: return false + case is PBXVariantGroup, is XCVersionGroup: false + case is PBXGroup: true + default: false } } } @@ -97,10 +97,10 @@ public enum PBXNavigatorFileOrder { var sort: ((PBXFileElement, PBXFileElement) -> Bool)? { switch self { case .byFilename: - return { sortFileElementsByName($0, $1) } + { sortFileElementsByName($0, $1) } case .byFilenameGroupsFirst: - return { lhs, rhs in + { lhs, rhs in let lhsIsGroup = lhs.isGroup if lhsIsGroup != rhs.isGroup { return lhsIsGroup @@ -109,7 +109,7 @@ public enum PBXNavigatorFileOrder { } default: - return nil // Don't sort. + nil // Don't sort. } } } @@ -125,12 +125,12 @@ public enum PBXBuildPhaseFileOrder { var sort: ((PBXBuildFile, PBXBuildFile) -> Bool)? { switch self { case .byFilename: - return { lhs, rhs in + { lhs, rhs in sortBuildFilesByName(lhs, rhs) } default: - return nil // Don't sort. + nil // Don't sort. } } } diff --git a/Sources/XcodeProj/Objects/Project/PBXProject.swift b/Sources/XcodeProj/Objects/Project/PBXProject.swift index 50dd148d0..8e8ddcab5 100644 --- a/Sources/XcodeProj/Objects/Project/PBXProject.swift +++ b/Sources/XcodeProj/Objects/Project/PBXProject.swift @@ -571,7 +571,7 @@ extension PBXProject: PlistSerializable { (value as? PBXObject)?.reference.value ?? value } } - plistAttributes[PBXProject.targetAttributesKey] = plistTargetAttributes + plistAttributes[PBXProject.targetAttributesKey] = plistTargetAttributes.isEmpty ? nil : plistTargetAttributes dictionary["attributes"] = plistAttributes.plist() diff --git a/Sources/XcodeProj/Objects/SwiftPackage/XCRemoteSwiftPackageReference.swift b/Sources/XcodeProj/Objects/SwiftPackage/XCRemoteSwiftPackageReference.swift index 3f8a40001..c28dc39b3 100644 --- a/Sources/XcodeProj/Objects/SwiftPackage/XCRemoteSwiftPackageReference.swift +++ b/Sources/XcodeProj/Objects/SwiftPackage/XCRemoteSwiftPackageReference.swift @@ -57,33 +57,33 @@ public class XCRemoteSwiftPackageReference: PBXContainerItem, PlistSerializable func plistValues() -> [CommentedString: PlistValue] { switch self { case let .revision(revision): - return [ + [ "kind": "revision", "revision": .string(.init(revision)), ] case let .branch(branch): - return [ + [ "kind": "branch", "branch": .string(.init(branch)), ] case let .exact(version): - return [ + [ "kind": "exactVersion", "version": .string(.init(version)), ] case let .range(from, to): - return [ + [ "kind": "versionRange", "minimumVersion": .string(.init(from)), "maximumVersion": .string(.init(to)), ] case let .upToNextMinorVersion(version): - return [ + [ "kind": "upToNextMinorVersion", "minimumVersion": .string(.init(version)), ] case let .upToNextMajorVersion(version): - return [ + [ "kind": "upToNextMajorVersion", "minimumVersion": .string(.init(version)), ] diff --git a/Sources/XcodeProj/Objects/Targets/PBXProductType.swift b/Sources/XcodeProj/Objects/Targets/PBXProductType.swift index 785d1ec1c..3957a72dc 100644 --- a/Sources/XcodeProj/Objects/Targets/PBXProductType.swift +++ b/Sources/XcodeProj/Objects/Targets/PBXProductType.swift @@ -37,38 +37,38 @@ public enum PBXProductType: String, Decodable { public var fileExtension: String? { switch self { case .application, .watchApp, .watch2App, .watch2AppContainer, .messagesApplication, .onDemandInstallCapableApplication: - return "app" + "app" case .framework, .staticFramework: - return "framework" + "framework" case .dynamicLibrary: - return "dylib" + "dylib" case .staticLibrary: - return "a" + "a" case .bundle: - return "bundle" + "bundle" case .unitTestBundle, .uiTestBundle: - return "xctest" + "xctest" case .appExtension, .extensionKitExtension, .tvExtension, .watchExtension, .watch2Extension, .messagesExtension, .stickerPack, .xcodeExtension, .intentsServiceExtension: - return "appex" + "appex" case .commandLineTool: - return nil + nil case .xpcService: - return "xpc" + "xpc" case .ocUnitTestBundle: - return "octest" + "octest" case .instrumentsPackage: - return "instrpkg" + "instrpkg" case .xcFramework: - return "xcframework" + "xcframework" case .metalLibrary: - return "metallib" + "metallib" case .systemExtension: - return "systemextension" + "systemextension" case .driverExtension: - return "dext" + "dext" case .none: - return nil + nil } } } diff --git a/Sources/XcodeProj/Scheme/XCScheme+BuildableReference.swift b/Sources/XcodeProj/Scheme/XCScheme+BuildableReference.swift index 5ded8df2f..c44f3806e 100644 --- a/Sources/XcodeProj/Scheme/XCScheme+BuildableReference.swift +++ b/Sources/XcodeProj/Scheme/XCScheme+BuildableReference.swift @@ -13,8 +13,8 @@ public extension XCScheme { var string: String { switch self { - case let .reference(object): return object.value - case let .string(string): return string + case let .reference(object): object.value + case let .string(string): string } } } diff --git a/Sources/XcodeProj/Scheme/XCScheme.swift b/Sources/XcodeProj/Scheme/XCScheme.swift index 33130c9fe..a3043a93f 100644 --- a/Sources/XcodeProj/Scheme/XCScheme.swift +++ b/Sources/XcodeProj/Scheme/XCScheme.swift @@ -9,9 +9,9 @@ public enum XCSchemeError: Error, CustomStringConvertible, Sendable { public var description: String { switch self { case let .notFound(path): - return ".xcscheme couldn't be found at path \(path.string)" + ".xcscheme couldn't be found at path \(path.string)" case let .missing(property): - return "Property \(property) missing" + "Property \(property) missing" } } } diff --git a/Sources/XcodeProj/Scheme/XCSchemeManagement.swift b/Sources/XcodeProj/Scheme/XCSchemeManagement.swift index 992c8f7d9..dce47e271 100644 --- a/Sources/XcodeProj/Scheme/XCSchemeManagement.swift +++ b/Sources/XcodeProj/Scheme/XCSchemeManagement.swift @@ -8,7 +8,7 @@ public enum XCSchemeManagementError: Error, Equatable, LocalizedError, CustomStr public var description: String { switch self { case let .notFound(path): - return "Couldn't initialize XCSchemeManagement because the file at path \(path.string) was not found." + "Couldn't initialize XCSchemeManagement because the file at path \(path.string) was not found." } } diff --git a/Sources/XcodeProj/Utils/BuildSettingsProvider.swift b/Sources/XcodeProj/Utils/BuildSettingsProvider.swift index cc529a787..cdfd052ec 100644 --- a/Sources/XcodeProj/Utils/BuildSettingsProvider.swift +++ b/Sources/XcodeProj/Utils/BuildSettingsProvider.swift @@ -82,11 +82,11 @@ public class BuildSettingsProvider { public static func projectDefault(variant: Variant) -> BuildSettings { switch variant { case .all: - return projectAll() + projectAll() case .debug: - return projectDebug() + projectDebug() case .release: - return projectRelease() + projectRelease() } } @@ -165,28 +165,28 @@ public class BuildSettingsProvider { private static func targetSettings(platform: Platform) -> BuildSettings { switch platform { case .iOS: - return [ + [ "SDKROOT": "iphoneos", "CODE_SIGN_IDENTITY": "iPhone Developer", "TARGETED_DEVICE_FAMILY": "1,2", ] case .macOS: - return [ + [ "SDKROOT": "macosx", "CODE_SIGN_IDENTITY": "-", ] case .tvOS: - return [ + [ "SDKROOT": "appletvos", "TARGETED_DEVICE_FAMILY": "3", ] case .watchOS: - return [ + [ "SDKROOT": "watchos", "TARGETED_DEVICE_FAMILY": "4", ] case .visionOS: - return [ + [ "SDKROOT": "xros", "TARGETED_DEVICE_FAMILY": "1,2,7", ] @@ -196,12 +196,12 @@ public class BuildSettingsProvider { private static func targetSettings(product: Product) -> BuildSettings { switch product { case .application: - return [ + [ "ASSETCATALOG_COMPILER_APPICON_NAME": "AppIcon", "ENABLE_PREVIEWS": "YES", ] case .framework: - return [ + [ "CODE_SIGN_IDENTITY": "", "CURRENT_PROJECT_VERSION": "1", "DEFINES_MODULE": "YES", @@ -215,12 +215,12 @@ public class BuildSettingsProvider { "VERSIONING_SYSTEM": "apple-generic", ] case .bundle: - return [ + [ "WRAPPER_EXTENSION": "bundle", "SKIP_INSTALL": "YES", ] default: - return [:] + [:] } } @@ -228,72 +228,72 @@ public class BuildSettingsProvider { private static func targetSettings(platform: Platform, product: Product) -> BuildSettings { switch (platform, product) { case (.iOS, .application): - return [ + [ "LD_RUNPATH_SEARCH_PATHS": ["$(inherited)", "@executable_path/Frameworks"], ] case (.macOS, .application): - return [ + [ "COMBINE_HIDPI_IMAGES": "YES", "LD_RUNPATH_SEARCH_PATHS": ["$(inherited)", "@executable_path/../Frameworks"], ] case (.tvOS, .application): - return [ + [ "ASSETCATALOG_COMPILER_APPICON_NAME": "App Icon & Top Shelf Image", "ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME": "LaunchImage", "LD_RUNPATH_SEARCH_PATHS": ["$(inherited)", "@executable_path/Frameworks"], ] case (.watchOS, .application): - return [ + [ "SKIP_INSTALL": "YES", "LD_RUNPATH_SEARCH_PATHS": ["$(inherited)", "@executable_path/Frameworks"], ] case (.iOS, .framework): - return [ + [ "LD_RUNPATH_SEARCH_PATHS": ["$(inherited)", "@executable_path/Frameworks", "@loader_path/Frameworks"], ] case (.macOS, .framework): - return [ + [ "COMBINE_HIDPI_IMAGES": "YES", "FRAMEWORK_VERSION": "A", "LD_RUNPATH_SEARCH_PATHS": ["$(inherited)", "@executable_path/../Frameworks", "@loader_path/../Frameworks"], ] case (.tvOS, .framework): - return [ + [ "LD_RUNPATH_SEARCH_PATHS": ["$(inherited)", "@executable_path/Frameworks", "@loader_path/Frameworks"], ] case (.watchOS, .framework): - return [ + [ "APPLICATION_EXTENSION_API_ONLY": "YES", "LD_RUNPATH_SEARCH_PATHS": ["$(inherited)", "@executable_path/Frameworks", "@loader_path/Frameworks"], ] case ([.iOS, .tvOS, .watchOS], .staticLibrary): - return [ + [ "OTHER_LDFLAGS": "-ObjC", "SKIP_INSTALL": "YES", ] case (.macOS, .staticLibrary): - return [ + [ "EXECUTABLE_PREFIX": "lib", "SKIP_INSTALL": "YES", ] case (.macOS, .dynamicLibrary): - return [ + [ "DYLIB_COMPATIBILITY_VERSION": "1", "DYLIB_CURRENT_VERSION": "1", "EXECUTABLE_PREFIX": "lib", "SKIP_INSTALL": "YES", ] case (.macOS, .bundle): - return [ + [ "COMBINE_HIDPI_IMAGES": "YES", "INSTALL_PATH": "$(LOCAL_LIBRARY_DIR)/Bundles", ] case ([.iOS, .tvOS], .appExtension): - return [ + [ "LD_RUNPATH_SEARCH_PATHS": ["$(inherited)", "@executable_path/Frameworks", "@executable_path/../../Frameworks"], ] case (.macOS, .appExtension): - return [ + [ "LD_RUNPATH_SEARCH_PATHS": [ "$(inherited)", "@executable_path/../Frameworks", @@ -301,7 +301,7 @@ public class BuildSettingsProvider { ], ] case (.watchOS, .watchExtension): - return [ + [ "LD_RUNPATH_SEARCH_PATHS": [ "$(inherited)", "@executable_path/Frameworks", @@ -309,7 +309,7 @@ public class BuildSettingsProvider { ], ] case (.watchOS, .appExtension): - return [ + [ "LD_RUNPATH_SEARCH_PATHS": [ "$(inherited)", "@executable_path/Frameworks", @@ -318,15 +318,15 @@ public class BuildSettingsProvider { ], ] case ([.iOS, .tvOS], [.unitTests, .uiTests]): - return [ + [ "LD_RUNPATH_SEARCH_PATHS": ["$(inherited)", "@executable_path/Frameworks", "@loader_path/Frameworks"], ] case (.macOS, [.unitTests, .uiTests]): - return [ + [ "LD_RUNPATH_SEARCH_PATHS": ["$(inherited)", "@executable_path/../Frameworks", "@loader_path/../Frameworks"], ] default: - return [:] + [:] } } @@ -334,36 +334,47 @@ public class BuildSettingsProvider { platform: Platform) -> BuildSettings { switch (variant, platform) { default: - return [:] + [:] } } private static func targetSwiftSettings(variant: Variant) -> BuildSettings { switch variant { case .debug: - return [ + [ "SWIFT_OPTIMIZATION_LEVEL": "-Onone", "SWIFT_ACTIVE_COMPILATION_CONDITIONS": ["$(inherited)", "DEBUG"], "SWIFT_COMPILATION_MODE": "singlefile", ] case .release: - return [ + [ "SWIFT_OPTIMIZATION_LEVEL": "-Owholemodule", "SWIFT_COMPILATION_MODE": "wholemodule", ] default: - return [:] + [:] } } private static func targetSwiftSettings(product: Product) -> BuildSettings { switch product { case .framework: - return [ + [ "DEFINES_MODULE": "YES", ] default: - return [:] + [:] + } + } + + private static func targetSwiftSettings(platform: Platform, product: Product) -> BuildSettings { + switch (platform, product) { + case (.watchOS, .application): + [ + "ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES": "YES", + ] + default: + [:] } } } diff --git a/Sources/XcodeProj/Utils/PBXBatchUpdater.swift b/Sources/XcodeProj/Utils/PBXBatchUpdater.swift index d23a49262..2e127d5e9 100644 --- a/Sources/XcodeProj/Utils/PBXBatchUpdater.swift +++ b/Sources/XcodeProj/Utils/PBXBatchUpdater.swift @@ -75,16 +75,15 @@ public final class PBXBatchUpdater { return existing } - let path: String? - switch sourceTree { + let path: String? = switch sourceTree { case .group: - path = filePath.relative(to: groupPath).string + filePath.relative(to: groupPath).string case .sourceRoot: - path = filePath.relative(to: sourceRoot).string + filePath.relative(to: sourceRoot).string case .absolute: - path = filePath.string + filePath.string default: - path = nil + nil } let fileReference = PBXFileReference( sourceTree: sourceTree, diff --git a/Sources/XcodeProj/Utils/PlistValue.swift b/Sources/XcodeProj/Utils/PlistValue.swift index d36496c50..92e2e8efe 100644 --- a/Sources/XcodeProj/Utils/PlistValue.swift +++ b/Sources/XcodeProj/Utils/PlistValue.swift @@ -12,22 +12,22 @@ indirect enum PlistValue { var string: CommentedString? { switch self { - case let .string(string): return string - default: return nil + case let .string(string): string + default: nil } } var array: [PlistValue]? { switch self { - case let .array(array): return array - default: return nil + case let .array(array): array + default: nil } } var dictionary: [CommentedString: PlistValue]? { switch self { - case let .dictionary(dictionary): return dictionary - default: return nil + case let .dictionary(dictionary): dictionary + default: nil } } } @@ -72,13 +72,13 @@ extension PlistValue: Equatable { static func == (lhs: PlistValue, rhs: PlistValue) -> Bool { switch (lhs, rhs) { case let (.string(lhsString), .string(rhsString)): - return lhsString == rhsString + lhsString == rhsString case let (.array(lhsArray), .array(rhsArray)): - return lhsArray == rhsArray + lhsArray == rhsArray case let (.dictionary(lhsDictionary), .dictionary(rhsDictionary)): - return lhsDictionary == rhsDictionary + lhsDictionary == rhsDictionary default: - return false + false } } } diff --git a/Sources/XcodeProj/Workspace/XCWorkspaceData.swift b/Sources/XcodeProj/Workspace/XCWorkspaceData.swift index 13c413bbe..0a5601bee 100644 --- a/Sources/XcodeProj/Workspace/XCWorkspaceData.swift +++ b/Sources/XcodeProj/Workspace/XCWorkspaceData.swift @@ -78,9 +78,9 @@ private extension XCWorkspaceDataElement { func xmlElement() -> AEXMLElement { switch self { case let .file(fileRef): - return fileRef.xmlElement() + fileRef.xmlElement() case let .group(group): - return group.xmlElement() + group.xmlElement() } } } diff --git a/Sources/XcodeProj/Workspace/XCWorkspaceDataElement.swift b/Sources/XcodeProj/Workspace/XCWorkspaceDataElement.swift index 439a8f092..78467a716 100644 --- a/Sources/XcodeProj/Workspace/XCWorkspaceDataElement.swift +++ b/Sources/XcodeProj/Workspace/XCWorkspaceDataElement.swift @@ -12,9 +12,9 @@ public enum XCWorkspaceDataElement: Equatable { public var location: XCWorkspaceDataElementLocationType { switch self { case let .file(ref): - return ref.location + ref.location case let .group(ref): - return ref.location + ref.location } } @@ -23,11 +23,11 @@ public enum XCWorkspaceDataElement: Equatable { public static func == (lhs: XCWorkspaceDataElement, rhs: XCWorkspaceDataElement) -> Bool { switch (lhs, rhs) { case let (.file(lhs), .file(rhs)): - return lhs == rhs + lhs == rhs case let (.group(lhs), .group(rhs)): - return lhs == rhs + lhs == rhs default: - return false + false } } } diff --git a/Sources/XcodeProj/Workspace/XCWorkspaceDataElementLocationType.swift b/Sources/XcodeProj/Workspace/XCWorkspaceDataElementLocationType.swift index aac0d8bdb..53d1966e0 100644 --- a/Sources/XcodeProj/Workspace/XCWorkspaceDataElementLocationType.swift +++ b/Sources/XcodeProj/Workspace/XCWorkspaceDataElementLocationType.swift @@ -15,34 +15,34 @@ public enum XCWorkspaceDataElementLocationType { public var schema: String { switch self { case .absolute: - return "absolute" + "absolute" case .container: - return "container" + "container" case .developer: - return "developer" + "developer" case .group: - return "group" + "group" case .current: - return "self" + "self" case let .other(schema, _): - return schema + schema } } public var path: String { switch self { case let .absolute(path): - return path + path case let .container(path): - return path + path case let .developer(path): - return path + path case let .group(path): - return path + path case let .current(path): - return path + path case let .other(_, path): - return path + path } } @@ -79,18 +79,18 @@ extension XCWorkspaceDataElementLocationType: Equatable { public static func == (lhs: XCWorkspaceDataElementLocationType, rhs: XCWorkspaceDataElementLocationType) -> Bool { switch (lhs, rhs) { case let (.absolute(lhs), .absolute(rhs)): - return lhs == rhs + lhs == rhs case let (.container(lhs), .container(rhs)): - return lhs == rhs + lhs == rhs case let (.developer(lhs), .developer(rhs)): - return lhs == rhs + lhs == rhs case let (.group(lhs), .group(rhs)): - return lhs == rhs + lhs == rhs case let (.current(lhs), .current(rhs)): - return lhs == rhs + lhs == rhs case let (.other(lhs0, lhs1), .other(rhs0, rhs1)): - return lhs0 == rhs0 && lhs1 == rhs1 - default: return false + lhs0 == rhs0 && lhs1 == rhs1 + default: false } } } diff --git a/Tests/XcodeProjTests/Objects/Project/PBXProjectTests.swift b/Tests/XcodeProjTests/Objects/Project/PBXProjectTests.swift index dc79c4698..ba48a65f1 100644 --- a/Tests/XcodeProjTests/Objects/Project/PBXProjectTests.swift +++ b/Tests/XcodeProjTests/Objects/Project/PBXProjectTests.swift @@ -33,6 +33,31 @@ final class PBXProjectTests: XCTestCase { XCTAssertEqual(attributes, expectedAttributes) } + func test_plistKeyAndValue_doesntReturnTargetAttributes_when_itsEmpty() throws { + // Given + let target = PBXTarget(name: "") + target.reference.fix("app") + + let testTarget = PBXTarget(name: "") + testTarget.reference.fix("test") + + let project = PBXProject(name: "Project", + buildConfigurationList: XCConfigurationList(), + compatibilityVersion: nil, + preferredProjectObjectVersion: nil, + minimizedProjectReferenceProxies: nil, + mainGroup: PBXGroup()) + + project.setTargetAttributes(["custom": "abc", "TestTargetID": testTarget], target: target) + + // When + let plist = try project.plistKeyAndValue(proj: PBXProj(), reference: "") + + // Then + let attributes: [CommentedString: PlistValue]? = plist.value.dictionary?["TargetAttributes"]?.dictionary + XCTAssertNil(attributes) + } + func test_addLocalSwiftPackage() throws { // Given let objects = PBXObjects(objects: []) diff --git a/Tuist.swift b/Tuist.swift new file mode 100644 index 000000000..b6140696a --- /dev/null +++ b/Tuist.swift @@ -0,0 +1,3 @@ +import ProjectDescription + +let tuist = Tuist(generationOptions: .options()) diff --git a/Tuist/Config.swift b/Tuist/Config.swift deleted file mode 100644 index 4b9d60274..000000000 --- a/Tuist/Config.swift +++ /dev/null @@ -1,3 +0,0 @@ -import ProjectDescription - -let config = Config(generationOptions: .options()) From 555366d3530e6f297d0a1e18b13b3d8a048ce6f1 Mon Sep 17 00:00:00 2001 From: pepicrft Date: Tue, 3 Dec 2024 16:05:07 +0000 Subject: [PATCH 399/678] [Release] XcodeProj 8.24.12 --- CHANGELOG.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 693278fa5..0113b3931 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,17 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [8.24.12] - 2024-12-03 +### Details +#### Docs +- Add kelvinharron as a contributor for code by @allcontributors[bot] in [#886](https://github.com/tuist/XcodeProj/pull/886) +- Add georgenavarro as a contributor for code by @allcontributors[bot] in [#885](https://github.com/tuist/XcodeProj/pull/885) + +#### Fix +- Inconsistent behaviour with Xcode 16 when `PBXProject.TargetAttributes` is empty by @Speakus in [#865](https://github.com/tuist/XcodeProj/pull/865) + +## New Contributors +* @Speakus made their first contribution in [#865](https://github.com/tuist/XcodeProj/pull/865) ## [8.24.11] - 2024-11-27 ### Details #### Chore @@ -142,6 +153,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 #### Feat - Introduce the new Xcode 16 models `PBXFileSystemSynchronizedRootGroup` and `PBXFileSystemSynchronizedBuildFileExceptionSet` by @pepicrft in [#827](https://github.com/tuist/XcodeProj/pull/827) +[8.24.12]: https://github.com/tuist/XcodeProj/compare/8.24.11..8.24.12 [8.24.11]: https://github.com/tuist/XcodeProj/compare/8.24.10..8.24.11 [8.24.10]: https://github.com/tuist/XcodeProj/compare/8.24.9..8.24.10 [8.24.9]: https://github.com/tuist/XcodeProj/compare/8.24.8..8.24.9 From 4b9f49539de354122a889e2376c470ebed76b7f7 Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Tue, 3 Dec 2024 17:05:19 +0100 Subject: [PATCH 400/678] docs: add Speakus as a contributor for code (#887) * docs: update README.md [skip ci] * docs: update .all-contributorsrc [skip ci] --------- Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com> --- .all-contributorsrc | 9 +++++++++ README.md | 5 +++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/.all-contributorsrc b/.all-contributorsrc index 1d5814be4..486c1c8f1 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -391,6 +391,15 @@ "contributions": [ "code" ] + }, + { + "login": "Speakus", + "name": "Maxim", + "avatar_url": "https://avatars.githubusercontent.com/u/849294?v=4", + "profile": "https://github.com/Speakus", + "contributions": [ + "code" + ] } ], "contributorsPerLine": 7, diff --git a/README.md b/README.md index b275555d1..c5fd51ff8 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # XcodeProj -[![All Contributors](https://img.shields.io/badge/all_contributors-42-orange.svg?style=flat-square)](#contributors-) +[![All Contributors](https://img.shields.io/badge/all_contributors-44-orange.svg?style=flat-square)](#contributors-) [![Swift Package Manager](https://img.shields.io/badge/swift%20package%20manager-compatible-brightgreen.svg)](https://swift.org/package-manager/) @@ -190,7 +190,8 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d Kelvin Harron
Kelvin Harron

💻 - George Navarro
George Navarro

💻 + George Navarro
George Navarro

💻 + Maxim
Maxim

💻 From 2297ad2962a6b00625d23fa1a68829977ba15f7a Mon Sep 17 00:00:00 2001 From: George Navarro Date: Tue, 3 Dec 2024 08:47:46 -0800 Subject: [PATCH 401/678] refactor: Update PathRunnable so that it subclasses Runnable (#883) * Made the buildableReference parameter of Runnable's init an optional parameter. The buildableReference property of Runnable was optional so now the init parameter type will match. This change will allow PathRunnable, which does not use a BuildableReference to subclass Runnable like BuildableProductRunnable and RemoteRunnable do. * Refactored PathRunnable to subclass from Runnable. Making PathRunnable subclass from Runnable will bring it line with BuildableProductRunnable and RemoteRunnable. Now all three will now be able to be abstracted behind a Runnable var or parameter. * Removed pathRunnable property from LaunchAction Removed the dedicated pathRunnable var from LaunchAction now that the runnable var can hold a PathRunnable. Also updated the test case for PathRunnable serialization. * Brought back pathRunnable var on LaunchAction as a computed var for backwards compatibility * Removed excessive isEqual check in PathRunnable's == implementation * Added support for PathRunnable in ProfileAction * Added a convenience init method to LaunchAction with a PathRunnable parameter for backwards compatibility * Make the inits non-breaking --------- Co-authored-by: Pedro --- .../Scheme/XCScheme+LaunchAction.swift | 115 ++++++++++++++++-- .../Scheme/XCScheme+PathRunnable.swift | 34 +++--- .../Scheme/XCScheme+ProfileAction.swift | 3 + .../XcodeProj/Scheme/XCScheme+Runnable.swift | 2 +- .../XcodeProjTests/Scheme/XCSchemeTests.swift | 2 +- 5 files changed, 127 insertions(+), 29 deletions(-) diff --git a/Sources/XcodeProj/Scheme/XCScheme+LaunchAction.swift b/Sources/XcodeProj/Scheme/XCScheme+LaunchAction.swift index 4edd89770..53d529153 100644 --- a/Sources/XcodeProj/Scheme/XCScheme+LaunchAction.swift +++ b/Sources/XcodeProj/Scheme/XCScheme+LaunchAction.swift @@ -42,7 +42,16 @@ public extension XCScheme { public var buildConfiguration: String public var launchStyle: Style public var askForAppToLaunch: Bool? - public var pathRunnable: PathRunnable? + public var pathRunnable: PathRunnable? { + // For backwards compatibility + get { + runnable as? PathRunnable + } + set { + self.pathRunnable = newValue + } + } + public var customWorkingDirectory: String? public var useCustomWorkingDirectory: Bool public var ignoresPersistentStateOnLaunch: Bool @@ -78,6 +87,7 @@ public extension XCScheme { // MARK: - Init + @available(*, deprecated, message: "Use the init() that consolidates pathRunnable and runnable into a single parameter.") public init(runnable: Runnable?, buildConfiguration: String, preActions: [ExecutionAction] = [], @@ -87,7 +97,7 @@ public extension XCScheme { selectedLauncherIdentifier: String = XCScheme.defaultLauncher, launchStyle: Style = .auto, askForAppToLaunch: Bool? = nil, - pathRunnable: PathRunnable? = nil, + pathRunnable _: PathRunnable? = nil, customWorkingDirectory: String? = nil, useCustomWorkingDirectory: Bool = false, ignoresPersistentStateOnLaunch: Bool = false, @@ -126,7 +136,6 @@ public extension XCScheme { self.selectedDebuggerIdentifier = selectedDebuggerIdentifier self.selectedLauncherIdentifier = selectedLauncherIdentifier self.askForAppToLaunch = askForAppToLaunch - self.pathRunnable = pathRunnable self.customWorkingDirectory = customWorkingDirectory self.useCustomWorkingDirectory = useCustomWorkingDirectory self.ignoresPersistentStateOnLaunch = ignoresPersistentStateOnLaunch @@ -161,6 +170,93 @@ public extension XCScheme { super.init(preActions, postActions) } + public convenience init( + pathRunnable: PathRunnable?, + buildConfiguration: String, + preActions: [ExecutionAction] = [], + postActions: [ExecutionAction] = [], + macroExpansion: BuildableReference? = nil, + selectedDebuggerIdentifier: String = XCScheme.defaultDebugger, + selectedLauncherIdentifier: String = XCScheme.defaultLauncher, + launchStyle: Style = .auto, + askForAppToLaunch: Bool? = nil, + customWorkingDirectory: String? = nil, + useCustomWorkingDirectory: Bool = false, + ignoresPersistentStateOnLaunch: Bool = false, + debugDocumentVersioning: Bool = true, + debugServiceExtension: String = LaunchAction.defaultDebugServiceExtension, + allowLocationSimulation: Bool = true, + locationScenarioReference: LocationScenarioReference? = nil, + enableGPUFrameCaptureMode: GPUFrameCaptureMode = LaunchAction.defaultGPUFrameCaptureMode, + disableGPUValidationMode: Bool = false, + enableGPUShaderValidationMode: Bool = false, + showGraphicsOverview: Bool = false, + logGraphicsOverview: Bool = false, + enableAddressSanitizer: Bool = false, + enableASanStackUseAfterReturn: Bool = false, + enableThreadSanitizer: Bool = false, + stopOnEveryThreadSanitizerIssue: Bool = false, + enableUBSanitizer: Bool = false, + stopOnEveryUBSanitizerIssue: Bool = false, + disableMainThreadChecker: Bool = false, + disablePerformanceAntipatternChecker: Bool = false, + stopOnEveryMainThreadCheckerIssue: Bool = false, + additionalOptions: [AdditionalOption] = [], + commandlineArguments: CommandLineArguments? = nil, + environmentVariables: [EnvironmentVariable]? = nil, + language: String? = nil, + region: String? = nil, + showNonLocalizedStrings: Bool = false, + launchAutomaticallySubstyle: String? = nil, + storeKitConfigurationFileReference: StoreKitConfigurationFileReference? = nil, + customLaunchCommand: String? = nil, + customLLDBInitFile: String? = nil + ) { + self.init( + runnable: pathRunnable, + buildConfiguration: buildConfiguration, + preActions: preActions, + postActions: postActions, + macroExpansion: macroExpansion, + selectedDebuggerIdentifier: selectedDebuggerIdentifier, + selectedLauncherIdentifier: selectedLauncherIdentifier, + launchStyle: launchStyle, + askForAppToLaunch: askForAppToLaunch, + pathRunnable: pathRunnable, + customWorkingDirectory: customWorkingDirectory, + useCustomWorkingDirectory: useCustomWorkingDirectory, + ignoresPersistentStateOnLaunch: ignoresPersistentStateOnLaunch, + debugDocumentVersioning: debugDocumentVersioning, + debugServiceExtension: debugServiceExtension, + allowLocationSimulation: allowLocationSimulation, + locationScenarioReference: locationScenarioReference, + enableGPUFrameCaptureMode: enableGPUFrameCaptureMode, + disableGPUValidationMode: disableGPUValidationMode, + enableGPUShaderValidationMode: enableGPUShaderValidationMode, + showGraphicsOverview: showGraphicsOverview, + logGraphicsOverview: logGraphicsOverview, + enableAddressSanitizer: enableAddressSanitizer, + enableASanStackUseAfterReturn: enableASanStackUseAfterReturn, + enableThreadSanitizer: enableThreadSanitizer, + stopOnEveryThreadSanitizerIssue: stopOnEveryThreadSanitizerIssue, + enableUBSanitizer: enableUBSanitizer, + stopOnEveryUBSanitizerIssue: stopOnEveryUBSanitizerIssue, + disableMainThreadChecker: disableMainThreadChecker, + disablePerformanceAntipatternChecker: disablePerformanceAntipatternChecker, + stopOnEveryMainThreadCheckerIssue: stopOnEveryMainThreadCheckerIssue, + additionalOptions: additionalOptions, + commandlineArguments: commandlineArguments, + environmentVariables: environmentVariables, + language: language, + region: region, + showNonLocalizedStrings: showNonLocalizedStrings, + launchAutomaticallySubstyle: launchAutomaticallySubstyle, + storeKitConfigurationFileReference: storeKitConfigurationFileReference, + customLaunchCommand: customLaunchCommand, + customLLDBInitFile: customLLDBInitFile + ) + } + // swiftlint:disable:next function_body_length override init(element: AEXMLElement) throws { buildConfiguration = element.attributes["buildConfiguration"] ?? LaunchAction.defaultBuildConfiguration @@ -177,15 +273,13 @@ public extension XCScheme { // Runnable let buildableProductRunnableElement = element["BuildableProductRunnable"] let remoteRunnableElement = element["RemoteRunnable"] + let pathRunnable = element["PathRunnable"] if buildableProductRunnableElement.error == nil { runnable = try BuildableProductRunnable(element: buildableProductRunnableElement) } else if remoteRunnableElement.error == nil { runnable = try RemoteRunnable(element: remoteRunnableElement) - } - - let pathRunnable = element["PathRunnable"] - if pathRunnable.error == nil { - self.pathRunnable = try PathRunnable(element: pathRunnable) + } else if pathRunnable.error == nil { + runnable = try PathRunnable(element: pathRunnable) } let buildableReferenceElement = element["MacroExpansion"]["BuildableReference"] @@ -324,10 +418,6 @@ public extension XCScheme { element.addChild(runnable.xmlElement()) } - if let pathRunnable { - element.addChild(pathRunnable.xmlElement()) - } - if let locationScenarioReference { element.addChild(locationScenarioReference.xmlElement()) } @@ -395,7 +485,6 @@ public extension XCScheme { buildConfiguration == rhs.buildConfiguration && launchStyle == rhs.launchStyle && askForAppToLaunch == rhs.askForAppToLaunch && - pathRunnable == rhs.pathRunnable && customWorkingDirectory == rhs.customWorkingDirectory && useCustomWorkingDirectory == rhs.useCustomWorkingDirectory && ignoresPersistentStateOnLaunch == rhs.ignoresPersistentStateOnLaunch && diff --git a/Sources/XcodeProj/Scheme/XCScheme+PathRunnable.swift b/Sources/XcodeProj/Scheme/XCScheme+PathRunnable.swift index 220de342d..44296ea24 100644 --- a/Sources/XcodeProj/Scheme/XCScheme+PathRunnable.swift +++ b/Sources/XcodeProj/Scheme/XCScheme+PathRunnable.swift @@ -3,10 +3,9 @@ import Foundation import PathKit public extension XCScheme { - class PathRunnable: Equatable { + class PathRunnable: Runnable { // MARK: - Attributes - public var runnableDebuggingMode: String public var filePath: String // MARK: - Init @@ -14,30 +13,37 @@ public extension XCScheme { public init(filePath: String, runnableDebuggingMode: String = "0") { self.filePath = filePath - self.runnableDebuggingMode = runnableDebuggingMode + super.init(buildableReference: nil, + runnableDebuggingMode: runnableDebuggingMode) } - init(element: AEXMLElement) throws { - runnableDebuggingMode = element.attributes["runnableDebuggingMode"] ?? "0" + override init(element: AEXMLElement) throws { filePath = element.attributes["FilePath"] ?? "" + try super.init(element: element) } // MARK: - XML - func xmlElement() -> AEXMLElement { - AEXMLElement(name: "PathRunnable", - value: nil, - attributes: [ - "runnableDebuggingMode": runnableDebuggingMode, - "FilePath": filePath, - ]) + override func xmlElement() -> AEXMLElement { + let element = super.xmlElement() + element.name = "PathRunnable" + element.attributes["FilePath"] = filePath + return element } // MARK: - Equatable + override func isEqual(other: XCScheme.Runnable) -> Bool { + guard let other = other as? PathRunnable else { + return false + } + + return super.isEqual(other: other) && + filePath == other.filePath + } + public static func == (lhs: PathRunnable, rhs: PathRunnable) -> Bool { - lhs.runnableDebuggingMode == rhs.runnableDebuggingMode && - lhs.filePath == rhs.filePath + lhs.isEqual(other: rhs) } } } diff --git a/Sources/XcodeProj/Scheme/XCScheme+ProfileAction.swift b/Sources/XcodeProj/Scheme/XCScheme+ProfileAction.swift index 6c4864996..f972cf76a 100644 --- a/Sources/XcodeProj/Scheme/XCScheme+ProfileAction.swift +++ b/Sources/XcodeProj/Scheme/XCScheme+ProfileAction.swift @@ -115,10 +115,13 @@ public extension XCScheme { // Runnable let buildableProductRunnableElement = element["BuildableProductRunnable"] let remoteRunnableElement = element["RemoteRunnable"] + let pathRunnableElement = element["PathRunnable"] if buildableProductRunnableElement.error == nil { runnable = try BuildableProductRunnable(element: buildableProductRunnableElement) } else if remoteRunnableElement.error == nil { runnable = try RemoteRunnable(element: remoteRunnableElement) + } else if pathRunnableElement.error == nil { + runnable = try PathRunnable(element: pathRunnableElement) } let buildableReferenceElement = element["MacroExpansion"]["BuildableReference"] diff --git a/Sources/XcodeProj/Scheme/XCScheme+Runnable.swift b/Sources/XcodeProj/Scheme/XCScheme+Runnable.swift index 27471e9f3..4ada2d38c 100644 --- a/Sources/XcodeProj/Scheme/XCScheme+Runnable.swift +++ b/Sources/XcodeProj/Scheme/XCScheme+Runnable.swift @@ -10,7 +10,7 @@ public extension XCScheme { // MARK: - Init - public init(buildableReference: BuildableReference, + public init(buildableReference: BuildableReference?, runnableDebuggingMode: String = "0") { self.buildableReference = buildableReference self.runnableDebuggingMode = runnableDebuggingMode diff --git a/Tests/XcodeProjTests/Scheme/XCSchemeTests.swift b/Tests/XcodeProjTests/Scheme/XCSchemeTests.swift index d4ed343c2..44ed24fc4 100644 --- a/Tests/XcodeProjTests/Scheme/XCSchemeTests.swift +++ b/Tests/XcodeProjTests/Scheme/XCSchemeTests.swift @@ -159,7 +159,7 @@ final class XCSchemeIntegrationTests: XCTestCase { // Given let filePath = "/usr/bin/foo" let pathRunnable = XCScheme.PathRunnable(filePath: filePath, runnableDebuggingMode: "0") - let subject = XCScheme.LaunchAction(runnable: nil, buildConfiguration: "Debug", pathRunnable: pathRunnable) + let subject = XCScheme.LaunchAction(runnable: pathRunnable, buildConfiguration: "Debug") // When let element = subject.xmlElement() From 4e84f417552dc5243d189339bbe0fb08d9e5cb42 Mon Sep 17 00:00:00 2001 From: pepicrft Date: Tue, 3 Dec 2024 16:48:08 +0000 Subject: [PATCH 402/678] [Release] XcodeProj 8.24.13 --- CHANGELOG.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0113b3931..b17ebeb3c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,16 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [8.24.13] - 2024-12-03 +### Details +#### Docs +- Add Speakus as a contributor for code by @allcontributors[bot] in [#887](https://github.com/tuist/XcodeProj/pull/887) + +#### Refactor +- Update PathRunnable so that it subclasses Runnable by @georgenavarro in [#883](https://github.com/tuist/XcodeProj/pull/883) + +## New Contributors +* @georgenavarro made their first contribution in [#883](https://github.com/tuist/XcodeProj/pull/883) ## [8.24.12] - 2024-12-03 ### Details #### Docs @@ -153,6 +163,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 #### Feat - Introduce the new Xcode 16 models `PBXFileSystemSynchronizedRootGroup` and `PBXFileSystemSynchronizedBuildFileExceptionSet` by @pepicrft in [#827](https://github.com/tuist/XcodeProj/pull/827) +[8.24.13]: https://github.com/tuist/XcodeProj/compare/8.24.12..8.24.13 [8.24.12]: https://github.com/tuist/XcodeProj/compare/8.24.11..8.24.12 [8.24.11]: https://github.com/tuist/XcodeProj/compare/8.24.10..8.24.11 [8.24.10]: https://github.com/tuist/XcodeProj/compare/8.24.9..8.24.10 From b90739231652494eea67386457525a61587cad78 Mon Sep 17 00:00:00 2001 From: Kelvin Harron Date: Tue, 3 Dec 2024 18:36:18 +0100 Subject: [PATCH 403/678] feat: Add handling for Swift Testing Only Parallelization (#871) * add handling for swiftTestingOnly as introduced in Xcode 16 * delete dead links from References * fix formatting * more formatting * rename Parallelization to Parallelizable to adhere to xcode naming * rename Parallelization to Parallelizable to adhere to xcode naming * add init as deprecated, updated extension and removed redundant unit test * rename Parallelizable type to TestParallelization and make both types available in TestableReference with deprecation warning to maintain backwards caompatability * reintroduce parallelizable from xmlElement * fix tests using old type * use computed var to best handle backwards compat with updated tests * address lint warnings * Fix linting issues * Fix linting issue --------- Co-authored-by: Pedro --- README.md | 2 - .../Scheme/XCScheme+TestParallelization.swift | 12 ++ .../Scheme/XCScheme+TestableReference.swift | 48 ++++++- .../XcodeProjTests/Scheme/XCSchemeTests.swift | 117 +++++++++++++++++- 4 files changed, 168 insertions(+), 11 deletions(-) create mode 100644 Sources/XcodeProj/Scheme/XCScheme+TestParallelization.swift diff --git a/README.md b/README.md index c5fd51ff8..334c34b72 100644 --- a/README.md +++ b/README.md @@ -108,14 +108,12 @@ object. ## References 📚 - [Xcode Project File Format](http://www.monobjc.net/xcode-project-file-format.html) -- [A brief look at the Xcode project format](http://danwright.info/blog/2010/10/xcode-pbxproject-files/) - [pbexplorer](https://github.com/mjmsmith/pbxplorer) - [pbxproj identifiers](https://pewpewthespells.com/blog/pbxproj_identifiers.html) - [mob-pbxproj](https://github.com/kronenthaler/mod-pbxproj) - [Xcodeproj](https://github.com/CocoaPods/Xcodeproj) - [Nanaimo](https://github.com/CocoaPods/Nanaimo) - [Facebook Buck](https://buckbuild.com/javadoc/com/facebook/buck/apple/xcode/xcodeproj/package-summary.html) -- [Swift Package Manager - Xcodeproj](https://github.com/apple/swift-package-manager/tree/main/Sources/Xcodeproj) ## Contributing diff --git a/Sources/XcodeProj/Scheme/XCScheme+TestParallelization.swift b/Sources/XcodeProj/Scheme/XCScheme+TestParallelization.swift new file mode 100644 index 000000000..dda224b1b --- /dev/null +++ b/Sources/XcodeProj/Scheme/XCScheme+TestParallelization.swift @@ -0,0 +1,12 @@ +import Foundation + +public extension XCScheme { + /// With the introduction of Swift Testing and Xcode 16, you can now choose to run your tests + // in parallel across either the full suite of tests in a target with `.all`, just those created + // under Swift Testing with `.swiftTestingOnly`, or run them serially with the `.none` option. + enum TestParallelization: String { + case all + case swiftTestingOnly + case none + } +} diff --git a/Sources/XcodeProj/Scheme/XCScheme+TestableReference.swift b/Sources/XcodeProj/Scheme/XCScheme+TestableReference.swift index 88b5bd1b3..da8f87c44 100644 --- a/Sources/XcodeProj/Scheme/XCScheme+TestableReference.swift +++ b/Sources/XcodeProj/Scheme/XCScheme+TestableReference.swift @@ -6,7 +6,13 @@ public extension XCScheme { // MARK: - Attributes public var skipped: Bool - public var parallelizable: Bool + @available(*, deprecated, message: "Please use parallelization property instead") + public var parallelizable: Bool { + get { parallelization == .swiftTestingOnly } + set { parallelization = newValue ? .swiftTestingOnly : .none } + } + + public var parallelization: TestParallelization public var randomExecutionOrdering: Bool public var useTestSelectionWhitelist: Bool? public var buildableReference: BuildableReference @@ -16,6 +22,25 @@ public extension XCScheme { // MARK: - Init + public init(skipped: Bool, + parallelization: TestParallelization = .none, + randomExecutionOrdering: Bool = false, + buildableReference: BuildableReference, + locationScenarioReference: LocationScenarioReference? = nil, + skippedTests: [TestItem] = [], + selectedTests: [TestItem] = [], + useTestSelectionWhitelist: Bool? = nil) { + self.skipped = skipped + self.parallelization = parallelization + self.randomExecutionOrdering = randomExecutionOrdering + self.buildableReference = buildableReference + self.locationScenarioReference = locationScenarioReference + self.useTestSelectionWhitelist = useTestSelectionWhitelist + self.selectedTests = selectedTests + self.skippedTests = skippedTests + } + + @available(*, deprecated, message: "Use init with Parallelization argument instead") public init(skipped: Bool, parallelizable: Bool = false, randomExecutionOrdering: Bool = false, @@ -25,7 +50,7 @@ public extension XCScheme { selectedTests: [TestItem] = [], useTestSelectionWhitelist: Bool? = nil) { self.skipped = skipped - self.parallelizable = parallelizable + parallelization = parallelizable ? .swiftTestingOnly : .none self.randomExecutionOrdering = randomExecutionOrdering self.buildableReference = buildableReference self.locationScenarioReference = locationScenarioReference @@ -36,7 +61,13 @@ public extension XCScheme { init(element: AEXMLElement) throws { skipped = element.attributes["skipped"] == "YES" - parallelizable = element.attributes["parallelizable"] == "YES" + + if let parallelizableValue = element.attributes["parallelizable"] { + parallelization = parallelizableValue == "YES" ? .all : .none + } else { + parallelization = .swiftTestingOnly + } + useTestSelectionWhitelist = element.attributes["useTestSelectionWhitelist"] == "YES" randomExecutionOrdering = element.attributes["testExecutionOrdering"] == "random" buildableReference = try BuildableReference(element: element["BuildableReference"]) @@ -63,7 +94,16 @@ public extension XCScheme { func xmlElement() -> AEXMLElement { var attributes: [String: String] = ["skipped": skipped.xmlString] - attributes["parallelizable"] = parallelizable ? parallelizable.xmlString : nil + + switch parallelization { + case .all: + attributes["parallelizable"] = "YES" + case .none: + attributes["parallelizable"] = "NO" + case .swiftTestingOnly: + break // SwiftTesting is inferred by the lack of a value + } + if let useTestSelectionWhitelist { attributes["useTestSelectionWhitelist"] = useTestSelectionWhitelist.xmlString } diff --git a/Tests/XcodeProjTests/Scheme/XCSchemeTests.swift b/Tests/XcodeProjTests/Scheme/XCSchemeTests.swift index 44ed24fc4..9d57bf8b1 100644 --- a/Tests/XcodeProjTests/Scheme/XCSchemeTests.swift +++ b/Tests/XcodeProjTests/Scheme/XCSchemeTests.swift @@ -68,7 +68,7 @@ final class XCSchemeIntegrationTests: XCTestCase { func test_write_testableReferenceDefaultAttributesValuesAreOmitted() { let reference = XCScheme.TestableReference( skipped: false, - parallelizable: false, + parallelization: .swiftTestingOnly, randomExecutionOrdering: false, buildableReference: XCScheme.BuildableReference( referencedContainer: "", @@ -85,10 +85,10 @@ final class XCSchemeIntegrationTests: XCTestCase { XCTAssertNil(subject.attributes["useTestSelectionWhitelist"]) } - func test_write_testableReferenceAttributesValues() { + func test_write_testableReferenceAttributesValues_allParallelizable() { let reference = XCScheme.TestableReference( skipped: false, - parallelizable: true, + parallelization: .all, randomExecutionOrdering: true, buildableReference: XCScheme.BuildableReference( referencedContainer: "", @@ -107,11 +107,117 @@ final class XCSchemeIntegrationTests: XCTestCase { XCTAssertEqual(subject.attributes["testExecutionOrdering"], "random") } + func test_write_testableReferenceAttributesValues_noneParallelizable() { + let reference = XCScheme.TestableReference( + skipped: false, + parallelization: .none, + randomExecutionOrdering: true, + buildableReference: XCScheme.BuildableReference( + referencedContainer: "", + blueprint: PBXObject(), + buildableName: "", + blueprintName: "" + ), + skippedTests: [], + selectedTests: [], + useTestSelectionWhitelist: true + ) + let subject = reference.xmlElement() + XCTAssertEqual(subject.attributes["skipped"], "NO") + XCTAssertEqual(subject.attributes["parallelizable"], "NO") + XCTAssertEqual(subject.attributes["useTestSelectionWhitelist"], "YES") + XCTAssertEqual(subject.attributes["testExecutionOrdering"], "random") + } + + func test_write_testableReferenceAttributesValues_trueParallelizable() { + let reference = XCScheme.TestableReference( + skipped: false, + parallelizable: true, + randomExecutionOrdering: true, + buildableReference: XCScheme.BuildableReference( + referencedContainer: "", + blueprint: PBXObject(), + buildableName: "", + blueprintName: "" + ), + skippedTests: [], + selectedTests: [], + useTestSelectionWhitelist: true + ) + let subject = reference.xmlElement() + XCTAssertEqual(subject.attributes["skipped"], "NO") + XCTAssertEqual(subject.attributes["parallelizable"], nil) + XCTAssertEqual(subject.attributes["useTestSelectionWhitelist"], "YES") + XCTAssertEqual(subject.attributes["testExecutionOrdering"], "random") + } + + func test_write_testableReferenceAttributesValues_falseParallelizable() { + let reference = XCScheme.TestableReference( + skipped: false, + parallelizable: false, + randomExecutionOrdering: true, + buildableReference: XCScheme.BuildableReference( + referencedContainer: "", + blueprint: PBXObject(), + buildableName: "", + blueprintName: "" + ), + skippedTests: [], + selectedTests: [], + useTestSelectionWhitelist: true + ) + let subject = reference.xmlElement() + XCTAssertEqual(subject.attributes["skipped"], "NO") + XCTAssertEqual(subject.attributes["parallelizable"], "NO") + XCTAssertEqual(subject.attributes["useTestSelectionWhitelist"], "YES") + XCTAssertEqual(subject.attributes["testExecutionOrdering"], "random") + } + + func test_computed_parallelizable_testableReference_false() { + let reference = XCScheme.TestableReference( + skipped: false, + parallelizable: false, + randomExecutionOrdering: true, + buildableReference: XCScheme.BuildableReference( + referencedContainer: "", + blueprint: PBXObject(), + buildableName: "", + blueprintName: "" + ), + skippedTests: [], + selectedTests: [], + useTestSelectionWhitelist: true + ) + + XCTAssertEqual(reference.parallelizable, false) + XCTAssertEqual(reference.parallelization, .none) + } + + func test_computed_parallelizable_testableReference_true() { + let reference = XCScheme.TestableReference( + skipped: false, + parallelizable: true, + randomExecutionOrdering: true, + buildableReference: XCScheme.BuildableReference( + referencedContainer: "", + blueprint: PBXObject(), + buildableName: "", + blueprintName: "" + ), + skippedTests: [], + selectedTests: [], + useTestSelectionWhitelist: true + ) + + XCTAssertEqual(reference.parallelizable, true) + XCTAssertEqual(reference.parallelization, .swiftTestingOnly) + } + func test_write_testableReferenceSelectedTests() { // Given let reference = XCScheme.TestableReference( skipped: false, - parallelizable: true, + parallelization: .all, randomExecutionOrdering: true, buildableReference: XCScheme.BuildableReference( referencedContainer: "", @@ -397,7 +503,8 @@ final class XCSchemeIntegrationTests: XCTestCase { XCTAssertEqual(scheme.testAction?.codeCoverageEnabled, true) XCTAssertEqual(scheme.testAction?.onlyGenerateCoverageForSpecifiedTargets, true) XCTAssertEqual(scheme.testAction?.testables.first?.skipped, false) - XCTAssertEqual(scheme.testAction?.testables.first?.parallelizable, false) + XCTAssertEqual(scheme.testAction?.testables.first?.parallelizable, true) + XCTAssertEqual(scheme.testAction?.testables.first?.parallelization, .swiftTestingOnly) XCTAssertEqual(scheme.testAction?.testables.first?.randomExecutionOrdering, false) XCTAssertEqual(scheme.testAction?.testables.first?.useTestSelectionWhitelist, false) XCTAssertEqual(scheme.testAction?.testables.first?.buildableReference.buildableIdentifier, "primary") From d3df4265b8383dd56dae4b01f817d30c22e7612c Mon Sep 17 00:00:00 2001 From: pepicrft Date: Tue, 3 Dec 2024 17:36:37 +0000 Subject: [PATCH 404/678] [Release] XcodeProj 8.25.0 --- CHANGELOG.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index b17ebeb3c..301396103 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [8.25.0] - 2024-12-03 +### Details +#### Feat +- Add handling for Swift Testing Only Parallelization by @kelvinharron in [#871](https://github.com/tuist/XcodeProj/pull/871) + +## New Contributors +* @kelvinharron made their first contribution in [#871](https://github.com/tuist/XcodeProj/pull/871) ## [8.24.13] - 2024-12-03 ### Details #### Docs @@ -163,6 +170,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 #### Feat - Introduce the new Xcode 16 models `PBXFileSystemSynchronizedRootGroup` and `PBXFileSystemSynchronizedBuildFileExceptionSet` by @pepicrft in [#827](https://github.com/tuist/XcodeProj/pull/827) +[8.25.0]: https://github.com/tuist/XcodeProj/compare/8.24.13..8.25.0 [8.24.13]: https://github.com/tuist/XcodeProj/compare/8.24.12..8.24.13 [8.24.12]: https://github.com/tuist/XcodeProj/compare/8.24.11..8.24.12 [8.24.11]: https://github.com/tuist/XcodeProj/compare/8.24.10..8.24.11 From 503473d2d86fcb1a396e7925dd0eeccd77d2ebfa Mon Sep 17 00:00:00 2001 From: George Navarro Date: Thu, 19 Dec 2024 01:37:26 -0800 Subject: [PATCH 405/678] fix: Infinite recursion and Incorrect deprecation notice in PathRunnable (#889) * Fixed infinite recursion in the setter LaunchAction.pathRunnable * Moved the deprecation notice to the correct initializer * Fixed up inits as suggested in review * Fix linting issues --------- Co-authored-by: Pedro --- Sources/XcodeProj/Scheme/XCScheme+LaunchAction.swift | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/Sources/XcodeProj/Scheme/XCScheme+LaunchAction.swift b/Sources/XcodeProj/Scheme/XCScheme+LaunchAction.swift index 53d529153..889898230 100644 --- a/Sources/XcodeProj/Scheme/XCScheme+LaunchAction.swift +++ b/Sources/XcodeProj/Scheme/XCScheme+LaunchAction.swift @@ -48,7 +48,7 @@ public extension XCScheme { runnable as? PathRunnable } set { - self.pathRunnable = newValue + runnable = newValue } } @@ -87,7 +87,6 @@ public extension XCScheme { // MARK: - Init - @available(*, deprecated, message: "Use the init() that consolidates pathRunnable and runnable into a single parameter.") public init(runnable: Runnable?, buildConfiguration: String, preActions: [ExecutionAction] = [], @@ -97,7 +96,6 @@ public extension XCScheme { selectedLauncherIdentifier: String = XCScheme.defaultLauncher, launchStyle: Style = .auto, askForAppToLaunch: Bool? = nil, - pathRunnable _: PathRunnable? = nil, customWorkingDirectory: String? = nil, useCustomWorkingDirectory: Bool = false, ignoresPersistentStateOnLaunch: Bool = false, @@ -170,8 +168,9 @@ public extension XCScheme { super.init(preActions, postActions) } + @available(*, deprecated, message: "Use the init() that consolidates pathRunnable and runnable into a single parameter.") public convenience init( - pathRunnable: PathRunnable?, + runnable: Runnable?, buildConfiguration: String, preActions: [ExecutionAction] = [], postActions: [ExecutionAction] = [], @@ -180,6 +179,7 @@ public extension XCScheme { selectedLauncherIdentifier: String = XCScheme.defaultLauncher, launchStyle: Style = .auto, askForAppToLaunch: Bool? = nil, + pathRunnable: PathRunnable?, customWorkingDirectory: String? = nil, useCustomWorkingDirectory: Bool = false, ignoresPersistentStateOnLaunch: Bool = false, @@ -222,7 +222,6 @@ public extension XCScheme { selectedLauncherIdentifier: selectedLauncherIdentifier, launchStyle: launchStyle, askForAppToLaunch: askForAppToLaunch, - pathRunnable: pathRunnable, customWorkingDirectory: customWorkingDirectory, useCustomWorkingDirectory: useCustomWorkingDirectory, ignoresPersistentStateOnLaunch: ignoresPersistentStateOnLaunch, From cacc788556572a45c16d12db8b868279374b11df Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 19 Dec 2024 10:57:27 +0100 Subject: [PATCH 406/678] chore(deps): update dependency tuist to v4.38.1 (#890) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise.toml b/.mise.toml index 075d5edcc..80487b090 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,5 +1,5 @@ [tools] swiftformat = "0.54.3" -tuist = "4.36.0" +tuist = "4.38.1" swiftlint = "0.55.1" "git-cliff" = "2.4.0" From 63ee80c848dca3aadab414f49fec66f8c1862fc7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20Pi=C3=B1era=20Buend=C3=ADa?= <663605+pepicrft@users.noreply.github.com> Date: Thu, 19 Dec 2024 12:03:19 +0100 Subject: [PATCH 407/678] Fix continuous integration (#891) * Expose GITHUB_TOKEN * Use Swift 6 on Linux --- .github/workflows/xcodeproj.yml | 1 + .swift-version | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/xcodeproj.yml b/.github/workflows/xcodeproj.yml index d00503152..dd16df6b0 100644 --- a/.github/workflows/xcodeproj.yml +++ b/.github/workflows/xcodeproj.yml @@ -13,6 +13,7 @@ concurrency: env: MISE_EXPERIMENTAL: 1 + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} jobs: build: diff --git a/.swift-version b/.swift-version index f9ce5a96e..e0ea36fee 100644 --- a/.swift-version +++ b/.swift-version @@ -1 +1 @@ -5.10 +6.0 From 0500afc49b418b8cbfb8a376d8d5c37274459956 Mon Sep 17 00:00:00 2001 From: pepicrft Date: Thu, 19 Dec 2024 11:03:57 +0000 Subject: [PATCH 408/678] [Release] XcodeProj 8.25.1 --- CHANGELOG.md | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 301396103..8ef37e154 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,14 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [8.25.1] - 2024-12-19 +### Details +#### Chore +- Update dependency tuist to v4.38.1 by @renovate[bot] in [#890](https://github.com/tuist/XcodeProj/pull/890) + +#### Fix +- Infinite recursion and Incorrect deprecation notice in PathRunnable by @georgenavarro in [#889](https://github.com/tuist/XcodeProj/pull/889) + ## [8.25.0] - 2024-12-03 ### Details #### Feat @@ -20,8 +28,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 #### Refactor - Update PathRunnable so that it subclasses Runnable by @georgenavarro in [#883](https://github.com/tuist/XcodeProj/pull/883) -## New Contributors -* @georgenavarro made their first contribution in [#883](https://github.com/tuist/XcodeProj/pull/883) ## [8.24.12] - 2024-12-03 ### Details #### Docs @@ -170,6 +176,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 #### Feat - Introduce the new Xcode 16 models `PBXFileSystemSynchronizedRootGroup` and `PBXFileSystemSynchronizedBuildFileExceptionSet` by @pepicrft in [#827](https://github.com/tuist/XcodeProj/pull/827) +[8.25.1]: https://github.com/tuist/XcodeProj/compare/8.25.0..8.25.1 [8.25.0]: https://github.com/tuist/XcodeProj/compare/8.24.13..8.25.0 [8.24.13]: https://github.com/tuist/XcodeProj/compare/8.24.12..8.24.13 [8.24.12]: https://github.com/tuist/XcodeProj/compare/8.24.11..8.24.12 From 2f6a810acf9a62c8875e29ace508f487f22345d1 Mon Sep 17 00:00:00 2001 From: Andy Kolean Date: Sat, 21 Dec 2024 07:16:37 -0500 Subject: [PATCH 409/678] feat: add path to XcodeProj and XCWorkspace (#892) * feat: add optional projectPath to XcodeProj * PR comments + Workspace path --- Sources/XcodeProj/Project/XcodeProj.swift | 11 +++++++++-- Sources/XcodeProj/Workspace/XCWorkspace.swift | 17 +++++++++++------ 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/Sources/XcodeProj/Project/XcodeProj.swift b/Sources/XcodeProj/Project/XcodeProj.swift index 83734f246..57ac7889f 100644 --- a/Sources/XcodeProj/Project/XcodeProj.swift +++ b/Sources/XcodeProj/Project/XcodeProj.swift @@ -8,6 +8,9 @@ public final class XcodeProj: Equatable { /// Project workspace public var workspace: XCWorkspace + /// The path to the `.xcodeproj` directory. + public let path: Path? + /// .pbxproj representation public var pbxproj: PBXProj @@ -43,6 +46,7 @@ public final class XcodeProj: Equatable { .glob("*.xcuserdatad") .compactMap { try? XCUserData(path: $0) } + self.path = path self.pbxproj = pbxproj self.workspace = workspace self.sharedData = sharedData @@ -63,11 +67,13 @@ public final class XcodeProj: Equatable { public init(workspace: XCWorkspace, pbxproj: PBXProj, sharedData: XCSharedData? = nil, - userData: [XCUserData] = []) { + userData: [XCUserData] = [], + path: Path? = nil) { self.workspace = workspace self.pbxproj = pbxproj self.sharedData = sharedData self.userData = userData + self.path = path } // MARK: - Equatable @@ -76,7 +82,8 @@ public final class XcodeProj: Equatable { lhs.workspace == rhs.workspace && lhs.pbxproj == rhs.pbxproj && lhs.sharedData == rhs.sharedData && - lhs.userData == rhs.userData + lhs.userData == rhs.userData && + lhs.path == rhs.path } } diff --git a/Sources/XcodeProj/Workspace/XCWorkspace.swift b/Sources/XcodeProj/Workspace/XCWorkspace.swift index 7f99f6c0a..afefcf44f 100644 --- a/Sources/XcodeProj/Workspace/XCWorkspace.swift +++ b/Sources/XcodeProj/Workspace/XCWorkspace.swift @@ -6,6 +6,9 @@ public final class XCWorkspace: Writable, Equatable { /// Workspace data public var data: XCWorkspaceData + /// The path to the `.xcworkspace` directory. + public let path: Path? + // MARK: - Init /// Initializes the workspace with the path where the workspace is. @@ -15,14 +18,14 @@ public final class XCWorkspace: Writable, Equatable { /// - Parameter path: .xcworkspace path. /// - Throws: throws an error if the workspace cannot be initialized. public convenience init(path: Path) throws { - if !path.exists { + guard path.exists else { throw XCWorkspaceError.notFound(path: path) } let xcworkspaceDataPaths = path.glob("*.xcworkspacedata") - if xcworkspaceDataPaths.isEmpty { - self.init() + if let xcworkspaceDataPath = xcworkspaceDataPaths.first { + try self.init(data: XCWorkspaceData(path: xcworkspaceDataPath), path: path) } else { - try self.init(data: XCWorkspaceData(path: xcworkspaceDataPaths.first!)) + self.init() } } @@ -44,8 +47,10 @@ public final class XCWorkspace: Writable, Equatable { /// /// - Parameters: /// - data: workspace data. - public init(data: XCWorkspaceData) { + /// - path: .xcworkspace path. + public init(data: XCWorkspaceData, path: Path? = nil) { self.data = data + self.path = path } // MARK: - Writable @@ -75,6 +80,6 @@ public final class XCWorkspace: Writable, Equatable { // MARK: - Equatable public static func == (lhs: XCWorkspace, rhs: XCWorkspace) -> Bool { - lhs.data == rhs.data + lhs.data == rhs.data && lhs.path == rhs.path } } From efaaec0d195ce3278980ce1991dd81b1bca42365 Mon Sep 17 00:00:00 2001 From: fortmarek Date: Sat, 21 Dec 2024 12:17:03 +0000 Subject: [PATCH 410/678] [Release] XcodeProj 8.26.0 --- CHANGELOG.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8ef37e154..f43a2ce2a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [8.26.0] - 2024-12-21 +### Details +#### Feat +- Add path to XcodeProj and XCWorkspace by @ajkolean in [#892](https://github.com/tuist/XcodeProj/pull/892) + +## New Contributors +* @ajkolean made their first contribution in [#892](https://github.com/tuist/XcodeProj/pull/892) ## [8.25.1] - 2024-12-19 ### Details #### Chore @@ -176,6 +183,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 #### Feat - Introduce the new Xcode 16 models `PBXFileSystemSynchronizedRootGroup` and `PBXFileSystemSynchronizedBuildFileExceptionSet` by @pepicrft in [#827](https://github.com/tuist/XcodeProj/pull/827) +[8.26.0]: https://github.com/tuist/XcodeProj/compare/8.25.1..8.26.0 [8.25.1]: https://github.com/tuist/XcodeProj/compare/8.25.0..8.25.1 [8.25.0]: https://github.com/tuist/XcodeProj/compare/8.24.13..8.25.0 [8.24.13]: https://github.com/tuist/XcodeProj/compare/8.24.12..8.24.13 From 4e96cd9812348c02c4114415e25cadc0103a5ae0 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 24 Dec 2024 21:17:04 +0000 Subject: [PATCH 411/678] chore(deps): update dependency tuist to v4.38.2 (#893) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise.toml b/.mise.toml index 80487b090..ee77fd9a0 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,5 +1,5 @@ [tools] swiftformat = "0.54.3" -tuist = "4.38.1" +tuist = "4.38.2" swiftlint = "0.55.1" "git-cliff" = "2.4.0" From 6e971133653f069b7699d5fb081e5db1e5f81559 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" Date: Tue, 24 Dec 2024 21:17:51 +0000 Subject: [PATCH 412/678] [Release] XcodeProj 8.26.1 --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index f43a2ce2a..be3cd3d6b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,11 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [8.26.1] - 2024-12-24 +### Details +#### Chore +- Update dependency tuist to v4.38.2 by @renovate[bot] in [#893](https://github.com/tuist/XcodeProj/pull/893) + ## [8.26.0] - 2024-12-21 ### Details #### Feat @@ -183,6 +188,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 #### Feat - Introduce the new Xcode 16 models `PBXFileSystemSynchronizedRootGroup` and `PBXFileSystemSynchronizedBuildFileExceptionSet` by @pepicrft in [#827](https://github.com/tuist/XcodeProj/pull/827) +[8.26.1]: https://github.com/tuist/XcodeProj/compare/8.26.0..8.26.1 [8.26.0]: https://github.com/tuist/XcodeProj/compare/8.25.1..8.26.0 [8.25.1]: https://github.com/tuist/XcodeProj/compare/8.25.0..8.25.1 [8.25.0]: https://github.com/tuist/XcodeProj/compare/8.24.13..8.25.0 From 606d5aad9eaaebc9698acd7d3194eb4742100f4e Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 10 Jan 2025 18:41:25 +0000 Subject: [PATCH 413/678] chore(deps): update dependency tuist to v4.39.1 (#895) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise.toml b/.mise.toml index ee77fd9a0..7e6f855ad 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,5 +1,5 @@ [tools] swiftformat = "0.54.3" -tuist = "4.38.2" +tuist = "4.39.1" swiftlint = "0.55.1" "git-cliff" = "2.4.0" From 802098f0445fca99844aa1721f438cdd2c1988a5 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" Date: Fri, 10 Jan 2025 18:42:09 +0000 Subject: [PATCH 414/678] [Release] XcodeProj 8.26.2 --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index be3cd3d6b..b56ac9909 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,11 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [8.26.2] - 2025-01-10 +### Details +#### Chore +- Update dependency tuist to v4.39.1 by @renovate[bot] in [#895](https://github.com/tuist/XcodeProj/pull/895) + ## [8.26.1] - 2024-12-24 ### Details #### Chore @@ -188,6 +193,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 #### Feat - Introduce the new Xcode 16 models `PBXFileSystemSynchronizedRootGroup` and `PBXFileSystemSynchronizedBuildFileExceptionSet` by @pepicrft in [#827](https://github.com/tuist/XcodeProj/pull/827) +[8.26.2]: https://github.com/tuist/XcodeProj/compare/8.26.1..8.26.2 [8.26.1]: https://github.com/tuist/XcodeProj/compare/8.26.0..8.26.1 [8.26.0]: https://github.com/tuist/XcodeProj/compare/8.25.1..8.26.0 [8.25.1]: https://github.com/tuist/XcodeProj/compare/8.25.0..8.25.1 From 5c0b7899e304251ccdedafdf5f86251982a5b4bd Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 22 Jan 2025 20:30:16 +0000 Subject: [PATCH 415/678] chore(deps): update dependency tuist to v4.40.0 (#900) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise.toml b/.mise.toml index 7e6f855ad..f08eae172 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,5 +1,5 @@ [tools] swiftformat = "0.54.3" -tuist = "4.39.1" +tuist = "4.40.0" swiftlint = "0.55.1" "git-cliff" = "2.4.0" From 647cba2719e85748ec82d0720ee7afe5b7a6421e Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 22 Jan 2025 20:31:09 +0000 Subject: [PATCH 416/678] [Release] XcodeProj 8.26.3 --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index b56ac9909..4ea697962 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,11 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [8.26.3] - 2025-01-22 +### Details +#### Chore +- Update dependency tuist to v4.40.0 by @renovate[bot] in [#900](https://github.com/tuist/XcodeProj/pull/900) + ## [8.26.2] - 2025-01-10 ### Details #### Chore @@ -193,6 +198,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 #### Feat - Introduce the new Xcode 16 models `PBXFileSystemSynchronizedRootGroup` and `PBXFileSystemSynchronizedBuildFileExceptionSet` by @pepicrft in [#827](https://github.com/tuist/XcodeProj/pull/827) +[8.26.3]: https://github.com/tuist/XcodeProj/compare/8.26.2..8.26.3 [8.26.2]: https://github.com/tuist/XcodeProj/compare/8.26.1..8.26.2 [8.26.1]: https://github.com/tuist/XcodeProj/compare/8.26.0..8.26.1 [8.26.0]: https://github.com/tuist/XcodeProj/compare/8.25.1..8.26.0 From efdc4f5845b33cfad6c9c96be7d880a2d8c45727 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20Wei=C3=9F?= Date: Fri, 24 Jan 2025 19:27:13 +0100 Subject: [PATCH 417/678] fix: add missing BuildSettingsProvider for visionOS (#898) * fix: Fix BuildSettingsProvider for visionOS * feat: Add visionOS mapping to additional cases Add new test cases for additional visionOS mappings Add tests for missing watchOS cases --- .../Utils/BuildSettingsProvider.swift | 15 +- .../Utils/BuildSettingsProviderTests.swift | 178 ++++++++++++++++++ 2 files changed, 190 insertions(+), 3 deletions(-) diff --git a/Sources/XcodeProj/Utils/BuildSettingsProvider.swift b/Sources/XcodeProj/Utils/BuildSettingsProvider.swift index cdfd052ec..f348d2ad1 100644 --- a/Sources/XcodeProj/Utils/BuildSettingsProvider.swift +++ b/Sources/XcodeProj/Utils/BuildSettingsProvider.swift @@ -188,6 +188,7 @@ public class BuildSettingsProvider { case .visionOS: [ "SDKROOT": "xros", + "CODE_SIGN_IDENTITY": "iPhone Developer", "TARGETED_DEVICE_FAMILY": "1,2,7", ] } @@ -247,6 +248,10 @@ public class BuildSettingsProvider { "SKIP_INSTALL": "YES", "LD_RUNPATH_SEARCH_PATHS": ["$(inherited)", "@executable_path/Frameworks"], ] + case (.visionOS, .application): + [ + "LD_RUNPATH_SEARCH_PATHS": ["$(inherited)", "@executable_path/Frameworks"], + ] case (.iOS, .framework): [ "LD_RUNPATH_SEARCH_PATHS": ["$(inherited)", "@executable_path/Frameworks", "@loader_path/Frameworks"], @@ -266,7 +271,11 @@ public class BuildSettingsProvider { "APPLICATION_EXTENSION_API_ONLY": "YES", "LD_RUNPATH_SEARCH_PATHS": ["$(inherited)", "@executable_path/Frameworks", "@loader_path/Frameworks"], ] - case ([.iOS, .tvOS, .watchOS], .staticLibrary): + case (.visionOS, .framework): + [ + "LD_RUNPATH_SEARCH_PATHS": ["$(inherited)", "@executable_path/Frameworks", "@loader_path/Frameworks"], + ] + case ([.iOS, .tvOS, .watchOS, .visionOS], .staticLibrary): [ "OTHER_LDFLAGS": "-ObjC", "SKIP_INSTALL": "YES", @@ -288,7 +297,7 @@ public class BuildSettingsProvider { "COMBINE_HIDPI_IMAGES": "YES", "INSTALL_PATH": "$(LOCAL_LIBRARY_DIR)/Bundles", ] - case ([.iOS, .tvOS], .appExtension): + case ([.iOS, .tvOS, .visionOS], .appExtension): [ "LD_RUNPATH_SEARCH_PATHS": ["$(inherited)", "@executable_path/Frameworks", "@executable_path/../../Frameworks"], ] @@ -317,7 +326,7 @@ public class BuildSettingsProvider { "@executable_path/../../../../Frameworks", ], ] - case ([.iOS, .tvOS], [.unitTests, .uiTests]): + case ([.iOS, .tvOS, .visionOS], [.unitTests, .uiTests]): [ "LD_RUNPATH_SEARCH_PATHS": ["$(inherited)", "@executable_path/Frameworks", "@loader_path/Frameworks"], ] diff --git a/Tests/XcodeProjTests/Utils/BuildSettingsProviderTests.swift b/Tests/XcodeProjTests/Utils/BuildSettingsProviderTests.swift index c03339fce..7630c5f10 100644 --- a/Tests/XcodeProjTests/Utils/BuildSettingsProviderTests.swift +++ b/Tests/XcodeProjTests/Utils/BuildSettingsProviderTests.swift @@ -146,6 +146,138 @@ class BuildSettingProviderTests: XCTestCase { ]) } + func test_targetSettings_watchOSFramework() { + // Given / When + let results = BuildSettingsProvider.targetDefault(variant: .release, + platform: .watchOS, + product: .framework, + swift: true) + + // Then + assertEqualSettings(results, [ + "APPLICATION_EXTENSION_API_ONLY": "YES", + "CODE_SIGN_IDENTITY": "", + "CURRENT_PROJECT_VERSION": "1", + "DEFINES_MODULE": "YES", + "DYLIB_COMPATIBILITY_VERSION": "1", + "DYLIB_CURRENT_VERSION": "1", + "DYLIB_INSTALL_NAME_BASE": "@rpath", + "INSTALL_PATH": "$(LOCAL_LIBRARY_DIR)/Frameworks", + "LD_RUNPATH_SEARCH_PATHS": [ + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ], + "PRODUCT_NAME": "$(TARGET_NAME:c99extidentifier)", + "SDKROOT": "watchos", + "SKIP_INSTALL": "YES", + "SWIFT_COMPILATION_MODE": "wholemodule", + "SWIFT_OPTIMIZATION_LEVEL": "-Owholemodule", + "TARGETED_DEVICE_FAMILY": "4", + "VERSIONING_SYSTEM": "apple-generic", + "VERSION_INFO_PREFIX": "", + ]) + } + + func test_targetSettings_watchOSExtension() { + // Given / When + let results = BuildSettingsProvider.targetDefault(variant: .release, + platform: .watchOS, + product: .appExtension, + swift: true) + + // Then + assertEqualSettings(results, [ + "LD_RUNPATH_SEARCH_PATHS": [ + "$(inherited)", + "@executable_path/Frameworks", + "@executable_path/../../Frameworks", + "@executable_path/../../../../Frameworks", + ], + "SDKROOT": "watchos", + "SWIFT_COMPILATION_MODE": "wholemodule", + "SWIFT_OPTIMIZATION_LEVEL": "-Owholemodule", + "TARGETED_DEVICE_FAMILY": "4", + ]) + } + + func test_targetSettings_visionOSAplication() { + // Given / When + let results = BuildSettingsProvider.targetDefault(variant: .release, + platform: .visionOS, + product: .application, + swift: true) + + // Then + assertEqualSettings(results, [ + "CODE_SIGN_IDENTITY": "iPhone Developer", + "ASSETCATALOG_COMPILER_APPICON_NAME": "AppIcon", + "ENABLE_PREVIEWS": "YES", + "LD_RUNPATH_SEARCH_PATHS": [ + "$(inherited)", + "@executable_path/Frameworks", + ], + "SDKROOT": "xros", + "SWIFT_COMPILATION_MODE": "wholemodule", + "SWIFT_OPTIMIZATION_LEVEL": "-Owholemodule", + "TARGETED_DEVICE_FAMILY": "1,2,7", + ]) + } + + func test_targetSettings_visionOSFramework() { + // Given / When + let results = BuildSettingsProvider.targetDefault(variant: .release, + platform: .visionOS, + product: .framework, + swift: true) + + // Then + assertEqualSettings(results, [ + "CODE_SIGN_IDENTITY": "", + "CURRENT_PROJECT_VERSION": "1", + "DEFINES_MODULE": "YES", + "DYLIB_COMPATIBILITY_VERSION": "1", + "DYLIB_CURRENT_VERSION": "1", + "DYLIB_INSTALL_NAME_BASE": "@rpath", + "INSTALL_PATH": "$(LOCAL_LIBRARY_DIR)/Frameworks", + "LD_RUNPATH_SEARCH_PATHS": [ + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ], + "PRODUCT_NAME": "$(TARGET_NAME:c99extidentifier)", + "SDKROOT": "xros", + "SKIP_INSTALL": "YES", + "SWIFT_COMPILATION_MODE": "wholemodule", + "SWIFT_OPTIMIZATION_LEVEL": "-Owholemodule", + "TARGETED_DEVICE_FAMILY": "1,2,7", + "VERSIONING_SYSTEM": "apple-generic", + "VERSION_INFO_PREFIX": "", + ]) + } + + func test_targetSettings_visionOSExtension() { + // Given / When + let results = BuildSettingsProvider.targetDefault(variant: .release, + platform: .visionOS, + product: .appExtension, + swift: true) + + // Then + assertEqualSettings(results, [ + "CODE_SIGN_IDENTITY": "iPhone Developer", + "LD_RUNPATH_SEARCH_PATHS": [ + "$(inherited)", + "@executable_path/Frameworks", + "@executable_path/../../Frameworks", + ], + "SDKROOT": "xros", + "SWIFT_COMPILATION_MODE": "wholemodule", + "SWIFT_OPTIMIZATION_LEVEL": "-Owholemodule", + "TARGETED_DEVICE_FAMILY": "1,2,7", + ]) + } + func test_targetSettings_iOSUnitTests() { // Given / When let results = BuildSettingsProvider.targetDefault(variant: .debug, @@ -236,6 +368,52 @@ class BuildSettingProviderTests: XCTestCase { ]) } + func test_targetSettings_visionOSUnitTests() { + // Given / When + let results = BuildSettingsProvider.targetDefault(variant: .debug, + platform: .visionOS, + product: .unitTests, + swift: true) + + // Then + assertEqualSettings(results, [ + "CODE_SIGN_IDENTITY": "iPhone Developer", + "SDKROOT": "xros", + "LD_RUNPATH_SEARCH_PATHS": [ + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ], + "SWIFT_ACTIVE_COMPILATION_CONDITIONS": ["$(inherited)", "DEBUG"], + "SWIFT_COMPILATION_MODE": "singlefile", + "SWIFT_OPTIMIZATION_LEVEL": "-Onone", + "TARGETED_DEVICE_FAMILY": "1,2,7", + ]) + } + + func test_targetSettings_visionOSUITests() { + // Given / When + let results = BuildSettingsProvider.targetDefault(variant: .debug, + platform: .visionOS, + product: .uiTests, + swift: true) + + // Then + assertEqualSettings(results, [ + "CODE_SIGN_IDENTITY": "iPhone Developer", + "SDKROOT": "xros", + "LD_RUNPATH_SEARCH_PATHS": [ + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ], + "SWIFT_ACTIVE_COMPILATION_CONDITIONS": ["$(inherited)", "DEBUG"], + "SWIFT_COMPILATION_MODE": "singlefile", + "SWIFT_OPTIMIZATION_LEVEL": "-Onone", + "TARGETED_DEVICE_FAMILY": "1,2,7", + ]) + } + // MARK: - Helpers func assertEqualSettings(_ lhs: BuildSettings, _ rhs: BuildSettings, file: StaticString = #file, line: UInt = #line) { From 15b85e6480b8b12ced81e68f39d83a97b7601cfa Mon Sep 17 00:00:00 2001 From: fortmarek <9371695+fortmarek@users.noreply.github.com> Date: Fri, 24 Jan 2025 18:27:43 +0000 Subject: [PATCH 418/678] [Release] XcodeProj 8.26.4 --- CHANGELOG.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4ea697962..909106670 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [8.26.4] - 2025-01-24 +### Details +#### Fix +- Add missing BuildSettingsProvider for visionOS by @alexanderwe in [#898](https://github.com/tuist/XcodeProj/pull/898) + +## New Contributors +* @alexanderwe made their first contribution in [#898](https://github.com/tuist/XcodeProj/pull/898) ## [8.26.3] - 2025-01-22 ### Details #### Chore @@ -198,6 +205,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 #### Feat - Introduce the new Xcode 16 models `PBXFileSystemSynchronizedRootGroup` and `PBXFileSystemSynchronizedBuildFileExceptionSet` by @pepicrft in [#827](https://github.com/tuist/XcodeProj/pull/827) +[8.26.4]: https://github.com/tuist/XcodeProj/compare/8.26.3..8.26.4 [8.26.3]: https://github.com/tuist/XcodeProj/compare/8.26.2..8.26.3 [8.26.2]: https://github.com/tuist/XcodeProj/compare/8.26.1..8.26.2 [8.26.1]: https://github.com/tuist/XcodeProj/compare/8.26.0..8.26.1 From 684e4ef1a4e43667d9afa378ee209ff88850e2d4 Mon Sep 17 00:00:00 2001 From: Bryan Summersett Date: Mon, 27 Jan 2025 14:01:47 -0800 Subject: [PATCH 419/678] fix: ensure that file references are fixed for filesystem synchronized root groups (#897) * Ensure that file references are fixed for filesystem synchronized root groups * Fix lint * fix: Ensure that file references are fixed for filesystem synchronized root groups --- .../XcodeProj/Utils/ReferenceGenerator.swift | 17 ++++++++++ .../Utils/ReferenceGeneratorTests.swift | 34 +++++++++++++++++++ 2 files changed, 51 insertions(+) diff --git a/Sources/XcodeProj/Utils/ReferenceGenerator.swift b/Sources/XcodeProj/Utils/ReferenceGenerator.swift index a098c8298..01f0267e9 100644 --- a/Sources/XcodeProj/Utils/ReferenceGenerator.swift +++ b/Sources/XcodeProj/Utils/ReferenceGenerator.swift @@ -139,6 +139,8 @@ final class ReferenceGenerator: ReferenceGenerating { guard let childFileElement: PBXFileElement = child.getObject() else { return } if let childGroup = childFileElement as? PBXGroup { try generateGroupReferences(childGroup, identifiers: identifiers) + } else if let childSynchronizedRootGroup = childFileElement as? PBXFileSystemSynchronizedRootGroup { + try generateSynchronizedRootGroupReferences(childSynchronizedRootGroup, identifiers: identifiers) } else if let childFileReference = childFileElement as? PBXFileReference { try generateFileReference(childFileReference, identifiers: identifiers) } else if let childReferenceProxy = childFileElement as? PBXReferenceProxy { @@ -161,6 +163,21 @@ final class ReferenceGenerator: ReferenceGenerating { fixReference(for: fileReference, identifiers: identifiers) } + /// Generates the reference for a synchronized root group object. + /// + /// - Parameters: + /// - synchronizedRootGroup: synchronized root group instance. + /// - identifiers: list of identifiers. + private func generateSynchronizedRootGroupReferences(_ synchronizedRootGroup: PBXFileSystemSynchronizedRootGroup, + identifiers: [String]) throws { + var identifiers = identifiers + if let groupName = synchronizedRootGroup.fileName() { + identifiers.append(groupName) + } + + fixReference(for: synchronizedRootGroup, identifiers: identifiers) + } + /// Generates the reference for a configuration list object. /// /// - Parameters: diff --git a/Tests/XcodeProjTests/Utils/ReferenceGeneratorTests.swift b/Tests/XcodeProjTests/Utils/ReferenceGeneratorTests.swift index 6df8959c3..af3a2f1b1 100644 --- a/Tests/XcodeProjTests/Utils/ReferenceGeneratorTests.swift +++ b/Tests/XcodeProjTests/Utils/ReferenceGeneratorTests.swift @@ -83,6 +83,21 @@ class ReferenceGeneratorTests: XCTestCase { XCTAssertNotEqual(firstProductsGroupUUID, secondProductsGroupUUID) } + + func test_projectWithFilesystemSynchronizedRootGroup_convertsReferencesToPermanent() throws { + let project = PBXProj(rootObject: nil, objectVersion: 0, archiveVersion: 0, classes: [:], objects: []) + let pbxProject = project.makeProject() + + let syncedGroup = project.makeSynchronizedRootGroup() + let target = project.makeTarget() + target.fileSystemSynchronizedGroups = [syncedGroup] + pbxProject.targets.append(target) + + let referenceGenerator = ReferenceGenerator(outputSettings: PBXOutputSettings()) + try referenceGenerator.generateReferences(proj: project) + + XCTAssert(!syncedGroup.reference.temporary) + } } private extension PBXProj { @@ -168,4 +183,23 @@ private extension PBXProj { return (target, buildFile) } + + func makeTarget() -> PBXTarget { + let target = PBXNativeTarget(name: "MyApp", + productName: "MyApp.app", + productType: .application) + add(object: target) + return target + } + + func makeSynchronizedRootGroup() -> PBXFileSystemSynchronizedRootGroup { + let syncedGroup = PBXFileSystemSynchronizedRootGroup( + sourceTree: .group, + path: "SyncedPath", + name: "SyncedGroup" + ) + add(object: syncedGroup) + rootObject!.mainGroup.children.append(syncedGroup) + return syncedGroup + } } From 63d250e9813b20ad4437286b1f8161f2c9c02689 Mon Sep 17 00:00:00 2001 From: fortmarek <9371695+fortmarek@users.noreply.github.com> Date: Mon, 27 Jan 2025 22:02:18 +0000 Subject: [PATCH 420/678] [Release] XcodeProj 8.26.5 --- CHANGELOG.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 909106670..b50d483b3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [8.26.5] - 2025-01-27 +### Details +#### Fix +- Ensure that file references are fixed for filesystem synchronized root groups by @bryansum in [#897](https://github.com/tuist/XcodeProj/pull/897) + +## New Contributors +* @bryansum made their first contribution in [#897](https://github.com/tuist/XcodeProj/pull/897) ## [8.26.4] - 2025-01-24 ### Details #### Fix @@ -205,6 +212,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 #### Feat - Introduce the new Xcode 16 models `PBXFileSystemSynchronizedRootGroup` and `PBXFileSystemSynchronizedBuildFileExceptionSet` by @pepicrft in [#827](https://github.com/tuist/XcodeProj/pull/827) +[8.26.5]: https://github.com/tuist/XcodeProj/compare/8.26.4..8.26.5 [8.26.4]: https://github.com/tuist/XcodeProj/compare/8.26.3..8.26.4 [8.26.3]: https://github.com/tuist/XcodeProj/compare/8.26.2..8.26.3 [8.26.2]: https://github.com/tuist/XcodeProj/compare/8.26.1..8.26.2 From 3976ea31aa9b99cfb6d26ffc49d8146d9912b616 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 5 Feb 2025 12:58:26 +0000 Subject: [PATCH 421/678] chore(deps): update dependency tuist to v4.41.0 (#901) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise.toml b/.mise.toml index f08eae172..2814d4749 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,5 +1,5 @@ [tools] swiftformat = "0.54.3" -tuist = "4.40.0" +tuist = "4.41.0" swiftlint = "0.55.1" "git-cliff" = "2.4.0" From 6f90427e172da66336739801c84b9cef3e17367b Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 5 Feb 2025 12:59:08 +0000 Subject: [PATCH 422/678] [Release] XcodeProj 8.26.6 --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index b50d483b3..46bb6f171 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,11 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [8.26.6] - 2025-02-05 +### Details +#### Chore +- Update dependency tuist to v4.41.0 by @renovate[bot] in [#901](https://github.com/tuist/XcodeProj/pull/901) + ## [8.26.5] - 2025-01-27 ### Details #### Fix @@ -212,6 +217,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 #### Feat - Introduce the new Xcode 16 models `PBXFileSystemSynchronizedRootGroup` and `PBXFileSystemSynchronizedBuildFileExceptionSet` by @pepicrft in [#827](https://github.com/tuist/XcodeProj/pull/827) +[8.26.6]: https://github.com/tuist/XcodeProj/compare/8.26.5..8.26.6 [8.26.5]: https://github.com/tuist/XcodeProj/compare/8.26.4..8.26.5 [8.26.4]: https://github.com/tuist/XcodeProj/compare/8.26.3..8.26.4 [8.26.3]: https://github.com/tuist/XcodeProj/compare/8.26.2..8.26.3 From 83145b48568e012e1ff3581b9a81ddcdf0cc2ff3 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 13 Feb 2025 21:47:04 +0000 Subject: [PATCH 423/678] chore(deps): update dependency tuist to v4.42.0 (#902) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise.toml b/.mise.toml index 2814d4749..5ed0b9038 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,5 +1,5 @@ [tools] swiftformat = "0.54.3" -tuist = "4.41.0" +tuist = "4.42.0" swiftlint = "0.55.1" "git-cliff" = "2.4.0" From 0fc894272122db301e5db7805c108b66f5e81922 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 13 Feb 2025 21:47:49 +0000 Subject: [PATCH 424/678] [Release] XcodeProj 8.26.7 --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 46bb6f171..db85ce691 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,11 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [8.26.7] - 2025-02-13 +### Details +#### Chore +- Update dependency tuist to v4.42.0 by @renovate[bot] in [#902](https://github.com/tuist/XcodeProj/pull/902) + ## [8.26.6] - 2025-02-05 ### Details #### Chore @@ -217,6 +222,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 #### Feat - Introduce the new Xcode 16 models `PBXFileSystemSynchronizedRootGroup` and `PBXFileSystemSynchronizedBuildFileExceptionSet` by @pepicrft in [#827](https://github.com/tuist/XcodeProj/pull/827) +[8.26.7]: https://github.com/tuist/XcodeProj/compare/8.26.6..8.26.7 [8.26.6]: https://github.com/tuist/XcodeProj/compare/8.26.5..8.26.6 [8.26.5]: https://github.com/tuist/XcodeProj/compare/8.26.4..8.26.5 [8.26.4]: https://github.com/tuist/XcodeProj/compare/8.26.3..8.26.4 From d91856cf7269c1bbe9626fc397b282c749f177bb Mon Sep 17 00:00:00 2001 From: Mike Simons Date: Tue, 18 Feb 2025 09:24:52 -0500 Subject: [PATCH 425/678] refactor: strongly type plist values to achieve full sendability (#904) * refactor: strongly type plist values to achieve full sendability (#835) * First pass at decoding changes * Keep `PlistObject` internal * Cleanup * Testable imports * Optimize project parsing. * Reduce reliance on PlistObject Not removing yet due to some other `[String: Any]` usage * Linting * Update tests and add missing new element kinds from main * Clearer names to match return types --- Sources/XcodeProj/Errors/Errors.swift | 3 + .../Extensions/Dictionary+Enumerate.swift | 24 ------ .../Extensions/Dictionary+Extras.swift | 9 --- .../XcodeProj/Objects/Project/PBXObject.swift | 7 +- .../Project/PBXObjectDictionaryEntry.swift | 47 +++++++++++ .../Objects/Project/PBXObjectParser.swift | 81 ------------------- .../XcodeProj/Objects/Project/PBXProj.swift | 64 ++------------- Sources/XcodeProj/Utils/Decoders.swift | 4 +- Sources/XcodeProj/Utils/JSONDecoding.swift | 6 -- Sources/XcodeProj/Utils/PlistDecoding.swift | 37 +++++++++ .../Extensions/Decodable+Dictionary.swift | 18 ----- .../Extensions/Dictionary+ExtrasTests.swift | 22 ----- .../Project/PBXOutputSettingsTests.swift | 8 +- .../Objects/Project/PBXProjEncoderTests.swift | 14 ++-- .../XCLocalSwiftPackageReferenceTests.swift | 7 +- .../XCRemoteSwiftPackageReferenceTests.swift | 15 ++-- ...XCSwiftPackageProductDependencyTests.swift | 18 +++-- Tests/XcodeProjTests/Tests/Fixtures.swift | 32 ++++---- 18 files changed, 150 insertions(+), 266 deletions(-) delete mode 100644 Sources/XcodeProj/Extensions/Dictionary+Enumerate.swift delete mode 100644 Sources/XcodeProj/Extensions/Dictionary+Extras.swift create mode 100644 Sources/XcodeProj/Objects/Project/PBXObjectDictionaryEntry.swift delete mode 100644 Sources/XcodeProj/Objects/Project/PBXObjectParser.swift create mode 100644 Sources/XcodeProj/Utils/PlistDecoding.swift delete mode 100644 Tests/XcodeProjTests/Extensions/Decodable+Dictionary.swift delete mode 100644 Tests/XcodeProjTests/Extensions/Dictionary+ExtrasTests.swift diff --git a/Sources/XcodeProj/Errors/Errors.swift b/Sources/XcodeProj/Errors/Errors.swift index 4c98dab03..2f46663e0 100644 --- a/Sources/XcodeProj/Errors/Errors.swift +++ b/Sources/XcodeProj/Errors/Errors.swift @@ -132,6 +132,7 @@ public enum XcodeprojWritingError: Error, CustomStringConvertible { /// - orphaned: the object doesn't belong to any project. public enum PBXObjectError: Error, CustomStringConvertible { case missingIsa + case missingReference case unknownElement(String) case objectsReleased case objectNotFound(String) @@ -149,6 +150,8 @@ public enum PBXObjectError: Error, CustomStringConvertible { "PBXObject with reference \"\(reference)\" not found." case let .orphaned(type, reference): "Trying to use object \(type) with reference '\(reference)' before being added to any project" + case .missingReference: + "Missing reference value" } } } diff --git a/Sources/XcodeProj/Extensions/Dictionary+Enumerate.swift b/Sources/XcodeProj/Extensions/Dictionary+Enumerate.swift deleted file mode 100644 index b6a6b91a3..000000000 --- a/Sources/XcodeProj/Extensions/Dictionary+Enumerate.swift +++ /dev/null @@ -1,24 +0,0 @@ -import Foundation - -extension Dictionary { - func enumerateKeysAndObjects( - options opts: NSEnumerationOptions = [], - using block: (Any, Any, UnsafeMutablePointer) throws -> Void - ) throws { - var blockError: Error? - // For performance it is very important to create a separate dictionary instance. - // (self as NSDictionary).enumerateKeys... - works much slower - let dictionary = NSDictionary(dictionary: self) - dictionary.enumerateKeysAndObjects(options: opts) { key, obj, stops in - do { - try block(key, obj, stops) - } catch { - blockError = error - stops.pointee = true - } - } - if let error = blockError { - throw error - } - } -} diff --git a/Sources/XcodeProj/Extensions/Dictionary+Extras.swift b/Sources/XcodeProj/Extensions/Dictionary+Extras.swift deleted file mode 100644 index 2044bd530..000000000 --- a/Sources/XcodeProj/Extensions/Dictionary+Extras.swift +++ /dev/null @@ -1,9 +0,0 @@ -import Foundation - -/// Static initializer that creates a Dictionary from a .plist file. -/// -/// - Parameter path: the path of the .plist file. -/// - Returns: initialized dictionary. -public func loadPlist(path: String) -> [String: AnyObject]? { - NSDictionary(contentsOfFile: path) as? [String: AnyObject] -} diff --git a/Sources/XcodeProj/Objects/Project/PBXObject.swift b/Sources/XcodeProj/Objects/Project/PBXObject.swift index 780f4154b..6f205084a 100644 --- a/Sources/XcodeProj/Objects/Project/PBXObject.swift +++ b/Sources/XcodeProj/Objects/Project/PBXObject.swift @@ -45,7 +45,12 @@ public class PBXObject: Hashable, Decodable, Equatable, AutoEquatable { let referenceRepository = decoder.context.objectReferenceRepository let objects = decoder.context.objects let container = try decoder.container(keyedBy: CodingKeys.self) - let reference: String = try container.decode(.reference) + + // The reference to an object in a pbxproj is the key of a dictionary, so read the value from the codingPath + guard let reference = container.codingPath.last?.stringValue else { + throw PBXObjectError.missingReference + } + self.reference = referenceRepository.getOrCreate(reference: reference, objects: objects) self.reference.setObject(self) } diff --git a/Sources/XcodeProj/Objects/Project/PBXObjectDictionaryEntry.swift b/Sources/XcodeProj/Objects/Project/PBXObjectDictionaryEntry.swift new file mode 100644 index 000000000..33e3adaa1 --- /dev/null +++ b/Sources/XcodeProj/Objects/Project/PBXObjectDictionaryEntry.swift @@ -0,0 +1,47 @@ +import Foundation + +struct PBXObjectDictionaryEntry: Decodable { + let object: PBXObject + + enum CodingKeys: CodingKey { + case isa + } + + init(from decoder: any Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + let isa = try container.decode(String.self, forKey: .isa) + + object = switch isa { + case PBXFileElement.isa: try PBXFileElement(from: decoder) + case PBXBuildFile.isa: try PBXBuildFile(from: decoder) + case PBXFileReference.isa: try PBXFileReference(from: decoder) + case PBXLegacyTarget.isa: try PBXLegacyTarget(from: decoder) + case PBXNativeTarget.isa: try PBXNativeTarget(from: decoder) + case PBXAggregateTarget.isa: try PBXAggregateTarget(from: decoder) + case PBXProject.isa: try PBXProject(from: decoder) + case PBXGroup.isa: try PBXGroup(from: decoder) + case PBXHeadersBuildPhase.isa: try PBXHeadersBuildPhase(from: decoder) + case PBXFrameworksBuildPhase.isa: try PBXFrameworksBuildPhase(from: decoder) + case XCConfigurationList.isa: try XCConfigurationList(from: decoder) + case PBXResourcesBuildPhase.isa: try PBXResourcesBuildPhase(from: decoder) + case PBXShellScriptBuildPhase.isa: try PBXShellScriptBuildPhase(from: decoder) + case PBXSourcesBuildPhase.isa: try PBXSourcesBuildPhase(from: decoder) + case PBXTargetDependency.isa: try PBXTargetDependency(from: decoder) + case PBXVariantGroup.isa: try PBXVariantGroup(from: decoder) + case XCBuildConfiguration.isa: try XCBuildConfiguration(from: decoder) + case PBXCopyFilesBuildPhase.isa: try PBXCopyFilesBuildPhase(from: decoder) + case PBXContainerItemProxy.isa: try PBXContainerItemProxy(from: decoder) + case PBXReferenceProxy.isa: try PBXReferenceProxy(from: decoder) + case XCVersionGroup.isa: try XCVersionGroup(from: decoder) + case PBXRezBuildPhase.isa: try PBXRezBuildPhase(from: decoder) + case PBXBuildRule.isa: try PBXBuildRule(from: decoder) + case XCRemoteSwiftPackageReference.isa: try XCRemoteSwiftPackageReference(from: decoder) + case XCLocalSwiftPackageReference.isa: try XCLocalSwiftPackageReference(from: decoder) + case XCSwiftPackageProductDependency.isa: try XCSwiftPackageProductDependency(from: decoder) + case PBXFileSystemSynchronizedRootGroup.isa: try PBXFileSystemSynchronizedRootGroup(from: decoder) + case PBXFileSystemSynchronizedBuildFileExceptionSet.isa: try PBXFileSystemSynchronizedBuildFileExceptionSet(from: decoder) + default: + throw PBXObjectError.unknownElement(isa) + } + } +} diff --git a/Sources/XcodeProj/Objects/Project/PBXObjectParser.swift b/Sources/XcodeProj/Objects/Project/PBXObjectParser.swift deleted file mode 100644 index 3c0ad0044..000000000 --- a/Sources/XcodeProj/Objects/Project/PBXObjectParser.swift +++ /dev/null @@ -1,81 +0,0 @@ -import Foundation - -final class PBXObjectParser { - private let userInfo: [CodingUserInfoKey: Any] - private let decoder = XcodeprojJSONDecoder() - - init(userInfo: [CodingUserInfoKey: Any]) { - self.userInfo = userInfo - } - - // swiftlint:disable function_body_length - public func parse(reference: String, dictionary: [String: Any]) throws -> PBXObject { - var mutableDictionary = dictionary - mutableDictionary["reference"] = reference - let data = try JSONSerialization.data(withJSONObject: mutableDictionary, options: []) - guard let isa = dictionary["isa"] as? String else { throw PBXObjectError.missingIsa } - // Order is important for performance - switch isa { - case PBXFileElement.isa: - return try decoder.decode(PBXFileElement.self, from: data) - case PBXBuildFile.isa: - return try decoder.decode(PBXBuildFile.self, from: data) - case PBXFileReference.isa: - return try decoder.decode(PBXFileReference.self, from: data) - case PBXLegacyTarget.isa: - return try decoder.decode(PBXLegacyTarget.self, from: data) - case PBXNativeTarget.isa: - return try decoder.decode(PBXNativeTarget.self, from: data) - case PBXAggregateTarget.isa: - return try decoder.decode(PBXAggregateTarget.self, from: data) - case PBXProject.isa: - return try decoder.decode(PBXProject.self, from: data) - case PBXGroup.isa: - return try decoder.decode(PBXGroup.self, from: data) - case PBXHeadersBuildPhase.isa: - return try decoder.decode(PBXHeadersBuildPhase.self, from: data) - case PBXFrameworksBuildPhase.isa: - return try decoder.decode(PBXFrameworksBuildPhase.self, from: data) - case XCConfigurationList.isa: - return try decoder.decode(XCConfigurationList.self, from: data) - case PBXResourcesBuildPhase.isa: - return try decoder.decode(PBXResourcesBuildPhase.self, from: data) - case PBXShellScriptBuildPhase.isa: - return try decoder.decode(PBXShellScriptBuildPhase.self, from: data) - case PBXSourcesBuildPhase.isa: - return try decoder.decode(PBXSourcesBuildPhase.self, from: data) - case PBXTargetDependency.isa: - return try decoder.decode(PBXTargetDependency.self, from: data) - case PBXVariantGroup.isa: - return try decoder.decode(PBXVariantGroup.self, from: data) - case XCBuildConfiguration.isa: - return try decoder.decode(XCBuildConfiguration.self, from: data) - case PBXCopyFilesBuildPhase.isa: - return try decoder.decode(PBXCopyFilesBuildPhase.self, from: data) - case PBXContainerItemProxy.isa: - return try decoder.decode(PBXContainerItemProxy.self, from: data) - case PBXReferenceProxy.isa: - return try decoder.decode(PBXReferenceProxy.self, from: data) - case XCVersionGroup.isa: - return try decoder.decode(XCVersionGroup.self, from: data) - case PBXRezBuildPhase.isa: - return try decoder.decode(PBXRezBuildPhase.self, from: data) - case PBXBuildRule.isa: - return try decoder.decode(PBXBuildRule.self, from: data) - case XCRemoteSwiftPackageReference.isa: - return try decoder.decode(XCRemoteSwiftPackageReference.self, from: data) - case XCLocalSwiftPackageReference.isa: - return try decoder.decode(XCLocalSwiftPackageReference.self, from: data) - case XCSwiftPackageProductDependency.isa: - return try decoder.decode(XCSwiftPackageProductDependency.self, from: data) - case PBXFileSystemSynchronizedRootGroup.isa: - return try decoder.decode(PBXFileSystemSynchronizedRootGroup.self, from: data) - case PBXFileSystemSynchronizedBuildFileExceptionSet.isa: - return try decoder.decode(PBXFileSystemSynchronizedBuildFileExceptionSet.self, from: data) - default: - throw PBXObjectError.unknownElement(isa) - } - } - - // swiftlint:enable function_body_length -} diff --git a/Sources/XcodeProj/Objects/Project/PBXProj.swift b/Sources/XcodeProj/Objects/Project/PBXProj.swift index 48a6ee367..78e6da101 100644 --- a/Sources/XcodeProj/Objects/Project/PBXProj.swift +++ b/Sources/XcodeProj/Objects/Project/PBXProj.swift @@ -72,25 +72,7 @@ public final class PBXProj: Decodable { /// - Parameters: /// - data: data representation of pbxproj file. public convenience init(data: Data) throws { - var propertyListFormat = PropertyListSerialization.PropertyListFormat.xml - - let serialized = try PropertyListSerialization.propertyList( - from: data, - options: .mutableContainersAndLeaves, - format: &propertyListFormat - ) - - guard let pbxProjDictionary = serialized as? [String: Any] else { - throw PBXProjError.malformed - } - - let context = ProjectDecodingContext( - pbxProjValueReader: { key in - pbxProjDictionary[key] - } - ) - - let plistDecoder = XcodeprojPropertyListDecoder(context: context) + let plistDecoder = XcodeprojPropertyListDecoder(context: ProjectDecodingContext()) let pbxproj: PBXProj = try plistDecoder.decode(PBXProj.self, from: data) self.init( @@ -135,23 +117,12 @@ public final class PBXProj: Decodable { objectVersion = try container.decodeIntIfPresent(.objectVersion) ?? 0 archiveVersion = try container.decodeIntIfPresent(.archiveVersion) ?? 1 classes = try container.decodeIfPresent([String: Any].self, forKey: .classes) ?? [:] - let objectsDictionary: [String: Any] = try container.decodeIfPresent([String: Any].self, forKey: .objects) ?? [:] - let objectsDictionaries: [String: [String: Any]] = (objectsDictionary as? [String: [String: Any]]) ?? [:] + let objectsDictionary: [String: PBXObjectDictionaryEntry] = try container.decodeIfPresent([String: PBXObjectDictionaryEntry].self, forKey: .objects) ?? [:] - let parser = PBXObjectParser( - userInfo: decoder.userInfo - ) - try objectsDictionaries.enumerateKeysAndObjects(options: .concurrent) { key, obj, _ in - // swiftlint:disable force_cast - let reference = key as! String - let dictionary = obj as! [String: Any] - // swiftlint:enable force_cast - let object = try parser.parse( - reference: reference, - dictionary: dictionary - ) - objects.add(object: object) + for entry in objectsDictionary { + objects.add(object: entry.value.object) } + self.objects = objects try rootGroup()?.assignParentToChildren() @@ -160,34 +131,13 @@ public final class PBXProj: Decodable { // MARK: Static Methods private static func createPBXProj(path: Path) throws -> PBXProj { - let (pbxProjData, pbxProjDictionary) = try PBXProj.readPBXProj(path: path) - let context = ProjectDecodingContext( - pbxProjValueReader: { key in - pbxProjDictionary[key] - } - ) + let pbxProjData = try Data(contentsOf: path.url) - let plistDecoder = XcodeprojPropertyListDecoder(context: context) + let plistDecoder = XcodeprojPropertyListDecoder(context: ProjectDecodingContext()) let pbxproj: PBXProj = try plistDecoder.decode(PBXProj.self, from: pbxProjData) try pbxproj.updateProjectName(path: path) return pbxproj } - - private static func readPBXProj(path: Path) throws -> (Data, [String: Any]) { - let plistXML = try Data(contentsOf: path.url) - var propertyListFormat = PropertyListSerialization.PropertyListFormat.xml - let serialized = try PropertyListSerialization.propertyList( - from: plistXML, - options: .mutableContainersAndLeaves, - format: &propertyListFormat - ) - - guard let pbxProjDictionary = serialized as? [String: Any] else { - throw PBXProjError.malformed - } - - return (plistXML, pbxProjDictionary) - } } // MARK: - Public helpers diff --git a/Sources/XcodeProj/Utils/Decoders.swift b/Sources/XcodeProj/Utils/Decoders.swift index 1bf6522cd..e0cb19b43 100644 --- a/Sources/XcodeProj/Utils/Decoders.swift +++ b/Sources/XcodeProj/Utils/Decoders.swift @@ -31,12 +31,10 @@ class ProjectDecodingContext { /// Objects. let objects: PBXObjects - let pbxProjValueReader: ((String) -> Any?)? - init(pbxProjValueReader: ((String) -> Any?)? = nil) { + init() { objectReferenceRepository = PBXObjectReferenceRepository() objects = PBXObjects(objects: []) - self.pbxProjValueReader = pbxProjValueReader } } diff --git a/Sources/XcodeProj/Utils/JSONDecoding.swift b/Sources/XcodeProj/Utils/JSONDecoding.swift index 2e80a6074..1478f4199 100644 --- a/Sources/XcodeProj/Utils/JSONDecoding.swift +++ b/Sources/XcodeProj/Utils/JSONDecoding.swift @@ -19,12 +19,6 @@ struct JSONCodingKeys: CodingKey { extension KeyedDecodingContainer { func decode(_ type: [String: Any].Type, forKey key: K) throws -> [String: Any] { - // Optimization for root dictionary decoding - if let decoder = try? superDecoder().context, - let pbxProjValueReader = decoder.pbxProjValueReader, - let result = pbxProjValueReader(key.stringValue) as? [String: Any] { - return result - } let container = try nestedContainer(keyedBy: JSONCodingKeys.self, forKey: key) return try container.decode(type) } diff --git a/Sources/XcodeProj/Utils/PlistDecoding.swift b/Sources/XcodeProj/Utils/PlistDecoding.swift new file mode 100644 index 000000000..4e65da68a --- /dev/null +++ b/Sources/XcodeProj/Utils/PlistDecoding.swift @@ -0,0 +1,37 @@ +import Foundation + +indirect enum PlistObject: Sendable, Equatable { + case string(String) + case array([String]) + case dictionary([String: PlistObject]) +} + +extension PlistObject: Codable { + public init(from decoder: Decoder) throws { + let container = try decoder.singleValueContainer() + do { + let string = try container.decode(String.self) + self = .string(string) + } catch { + do { + let array = try container.decode([String].self) + self = .array(array) + } catch { + let dictionary = try container.decode([String: PlistObject].self) + self = .dictionary(dictionary) + } + } + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.singleValueContainer() + switch self { + case let .string(string): + try container.encode(string) + case let .array(array): + try container.encode(array) + case let .dictionary(dictionary): + try container.encode(dictionary) + } + } +} diff --git a/Tests/XcodeProjTests/Extensions/Decodable+Dictionary.swift b/Tests/XcodeProjTests/Extensions/Decodable+Dictionary.swift deleted file mode 100644 index 00303ef53..000000000 --- a/Tests/XcodeProjTests/Extensions/Decodable+Dictionary.swift +++ /dev/null @@ -1,18 +0,0 @@ -import Foundation -@testable import XcodeProj - -extension Decodable { - /// Initialies the Decodable object with a JSON dictionary. - /// - /// - Parameter jsonDictionary: json dictionary. - /// - Throws: throws an error if the initialization fails. - init(jsonDictionary: [String: Any]) throws { - let data = try JSONSerialization.data(withJSONObject: jsonDictionary, options: []) - let decoder = XcodeprojJSONDecoder( - context: ProjectDecodingContext(pbxProjValueReader: { key in - jsonDictionary[key] - }) - ) - self = try decoder.decode(Self.self, from: data) - } -} diff --git a/Tests/XcodeProjTests/Extensions/Dictionary+ExtrasTests.swift b/Tests/XcodeProjTests/Extensions/Dictionary+ExtrasTests.swift deleted file mode 100644 index 5ff3c4037..000000000 --- a/Tests/XcodeProjTests/Extensions/Dictionary+ExtrasTests.swift +++ /dev/null @@ -1,22 +0,0 @@ -import Foundation -import PathKit -import XcodeProj -import XCTest - -class DictionaryExtrasTests: XCTestCase { - var fixtures: Path! - - override func setUp() { - super.setUp() - fixtures = Path(#file).parent().parent().parent().parent() + "Fixtures" - } - - func test_loadPlist_returnsANilValue_whenTheFileDoesntExist() { - XCTAssertNil(loadPlist(path: "test")) - } - - func test_loadPlist_returnsTheDictionary_whenTheFileDoesExist() { - let iosProject = fixtures + "iOS/Project.xcodeproj/project.pbxproj" - XCTAssertNotNil(loadPlist(path: iosProject.string)) - } -} diff --git a/Tests/XcodeProjTests/Objects/Project/PBXOutputSettingsTests.swift b/Tests/XcodeProjTests/Objects/Project/PBXOutputSettingsTests.swift index 03fbc0222..9e4813b95 100644 --- a/Tests/XcodeProjTests/Objects/Project/PBXOutputSettingsTests.swift +++ b/Tests/XcodeProjTests/Objects/Project/PBXOutputSettingsTests.swift @@ -202,8 +202,8 @@ class PBXOutputSettingsTests: XCTestCase { } private func iosProject() -> iOSProject { - let dic = iosProjectDictionary() - let proj = try! PBXProj(jsonDictionary: dic.1) + let data = try! iosProjectData() + let proj = try! PBXProj(data: data) let buildFileAssets = proj.buildFiles.first { $0.file?.fileName() == "Assets.xcassets" }! let buildFileMain = proj.buildFiles.first { $0.file?.fileName() == "Main.storyboard" }! @@ -257,8 +257,8 @@ class PBXOutputSettingsTests: XCTestCase { } func fileSharedAcrossTargetsProject() -> FileSharedAcrossTargetsProject { - let dic = fileSharedAcrossTargetsDictionary() - let proj = try! PBXProj(jsonDictionary: dic.1) + let dic = try! fileSharedAcrossTargetsData() + let proj = try! PBXProj(data: dic) let buildFileSameName = proj.buildFiles.filter { $0.file?.fileName() == "SameName.h" } let objectBuildFileSameName = proj.buildFiles.map { ($0.reference, $0) } diff --git a/Tests/XcodeProjTests/Objects/Project/PBXProjEncoderTests.swift b/Tests/XcodeProjTests/Objects/Project/PBXProjEncoderTests.swift index 482bf8cce..81c674fb7 100644 --- a/Tests/XcodeProjTests/Objects/Project/PBXProjEncoderTests.swift +++ b/Tests/XcodeProjTests/Objects/Project/PBXProjEncoderTests.swift @@ -497,31 +497,31 @@ class PBXProjEncoderTests: XCTestCase { } private func loadiOSProject() throws { - proj = try PBXProj(jsonDictionary: iosProjectDictionary().1) + proj = try PBXProj(data: iosProjectData()) } private func loadSynchronizedRootGroups() throws { - proj = try PBXProj(jsonDictionary: synchronizedRootGroupsFixture().1) + proj = try PBXProj(data: synchronizedRootGroupsFixture()) } private func loadFileSharedAcrossTargetsProject() throws { - proj = try PBXProj(jsonDictionary: fileSharedAcrossTargetsDictionary().1) + proj = try PBXProj(data: fileSharedAcrossTargetsData()) } private func loadTargetWithCustomBuildRulesProject() throws { - proj = try PBXProj(jsonDictionary: targetWithCustomBuildRulesDictionary().1) + proj = try PBXProj(data: targetWithCustomBuildRulesData()) } private func loadProjectWithXCLocalSwiftPackageReference() throws { - proj = try PBXProj(jsonDictionary: iosProjectWithXCLocalSwiftPackageReference().1) + proj = try PBXProj(data: iosProjectWithXCLocalSwiftPackageReference()) } private func loadProjectWithXCLocalSwiftPackageReferences() throws { - proj = try PBXProj(jsonDictionary: iosProjectWithXCLocalSwiftPackageReferences().1) + proj = try PBXProj(data: iosProjectWithXCLocalSwiftPackageReferences()) } private func loadProjectWithRelativeXCLocalSwiftPackageReference() throws { - proj = try PBXProj(jsonDictionary: iosProjectWithRelativeXCLocalSwiftPackageReferences().1) + proj = try PBXProj(data: iosProjectWithRelativeXCLocalSwiftPackageReferences()) } } diff --git a/Tests/XcodeProjTests/Objects/SwiftPackage/XCLocalSwiftPackageReferenceTests.swift b/Tests/XcodeProjTests/Objects/SwiftPackage/XCLocalSwiftPackageReferenceTests.swift index 119b96fce..17d28f42e 100644 --- a/Tests/XcodeProjTests/Objects/SwiftPackage/XCLocalSwiftPackageReferenceTests.swift +++ b/Tests/XcodeProjTests/Objects/SwiftPackage/XCLocalSwiftPackageReferenceTests.swift @@ -7,12 +7,13 @@ final class XCLocalSwiftPackageReferenceTests: XCTestCase { func test_init() throws { // Given let decoder = XcodeprojPropertyListDecoder() - let plist: [String: Any] = ["reference": "ref", - "relativePath": "path"] + let plist: [String: [String: Any]] = ["ref": ["relativePath": "path"]] + let data = try PropertyListSerialization.data(fromPropertyList: plist, format: .xml, options: 0) // When - let got = try decoder.decode(XCLocalSwiftPackageReference.self, from: data) + let decoded = try decoder.decode([String: XCLocalSwiftPackageReference].self, from: data) + let got = try XCTUnwrap(decoded["ref"]) // Then XCTAssertEqual(got.reference.value, "ref") diff --git a/Tests/XcodeProjTests/Objects/SwiftPackage/XCRemoteSwiftPackageReferenceTests.swift b/Tests/XcodeProjTests/Objects/SwiftPackage/XCRemoteSwiftPackageReferenceTests.swift index 2139fcbf1..a06008726 100644 --- a/Tests/XcodeProjTests/Objects/SwiftPackage/XCRemoteSwiftPackageReferenceTests.swift +++ b/Tests/XcodeProjTests/Objects/SwiftPackage/XCRemoteSwiftPackageReferenceTests.swift @@ -7,16 +7,17 @@ final class XCRemoteSwiftPackageReferenceTests: XCTestCase { func test_init() throws { // Given let decoder = XcodeprojPropertyListDecoder() - let plist: [String: Any] = ["reference": "ref", - "repositoryURL": "url", - "requirement": [ - "kind": "revision", - "revision": "abc", - ]] + let plist: [String: [String: Any]] = ["ref": [ + "repositoryURL": "url", + "requirement": [ + "kind": "revision", + "revision": "abc", + ]]] let data = try PropertyListSerialization.data(fromPropertyList: plist, format: .xml, options: 0) // When - let got = try decoder.decode(XCRemoteSwiftPackageReference.self, from: data) + let decoded = try decoder.decode([String: XCRemoteSwiftPackageReference].self, from: data) + let got = try XCTUnwrap(decoded["ref"]) // Then XCTAssertEqual(got.reference.value, "ref") diff --git a/Tests/XcodeProjTests/Objects/SwiftPackage/XCSwiftPackageProductDependencyTests.swift b/Tests/XcodeProjTests/Objects/SwiftPackage/XCSwiftPackageProductDependencyTests.swift index a473311a1..60823f04b 100644 --- a/Tests/XcodeProjTests/Objects/SwiftPackage/XCSwiftPackageProductDependencyTests.swift +++ b/Tests/XcodeProjTests/Objects/SwiftPackage/XCSwiftPackageProductDependencyTests.swift @@ -8,13 +8,14 @@ final class XCSwiftPackageProductDependencyTests: XCTestCase { // Given let decoder = XcodeprojPropertyListDecoder() let encoder = PropertyListEncoder() - let plist = ["reference": "reference", - "productName": "xcodeproj", - "package": "packageReference"] + let plist = ["reference": [ + "productName": "xcodeproj", + "package": "packageReference"]] let data = try encoder.encode(plist) // When - let got = try decoder.decode(XCSwiftPackageProductDependency.self, from: data) + let decoded = try decoder.decode([String: XCSwiftPackageProductDependency].self, from: data) + let got = try XCTUnwrap(decoded["reference"]) // Then XCTAssertEqual(got.productName, "xcodeproj") @@ -26,13 +27,14 @@ final class XCSwiftPackageProductDependencyTests: XCTestCase { // Given let decoder = XcodeprojPropertyListDecoder() let encoder = PropertyListEncoder() - let plist = ["reference": "reference", - "productName": "plugin:xcodeproj", - "package": "packageReference"] + let plist = ["reference": [ + "productName": "plugin:xcodeproj", + "package": "packageReference"]] let data = try encoder.encode(plist) // When - let got = try decoder.decode(XCSwiftPackageProductDependency.self, from: data) + let decoded = try decoder.decode([String: XCSwiftPackageProductDependency].self, from: data) + let got = try XCTUnwrap(decoded["reference"]) // Then XCTAssertEqual(got.productName, "xcodeproj") diff --git a/Tests/XcodeProjTests/Tests/Fixtures.swift b/Tests/XcodeProjTests/Tests/Fixtures.swift index edb724a5b..24deecb17 100644 --- a/Tests/XcodeProjTests/Tests/Fixtures.swift +++ b/Tests/XcodeProjTests/Tests/Fixtures.swift @@ -1,42 +1,42 @@ import Foundation import PathKit -import XcodeProj +@testable import XcodeProj func fixturesPath() -> Path { Path(#file).parent().parent().parent().parent() + "Fixtures" } -func synchronizedRootGroupsFixture() -> (Path, [String: Any]) { - let iosProject = fixturesPath() + "SynchronizedRootGroups/SynchronizedRootGroups.xcodeproj/project.pbxproj" - return (iosProject, loadPlist(path: iosProject.string)!) +func synchronizedRootGroupsFixture() throws -> Data { + let synchronizedRootGroups = fixturesPath() + "SynchronizedRootGroups/SynchronizedRootGroups.xcodeproj/project.pbxproj" + return try Data(contentsOf: synchronizedRootGroups.url) } -func iosProjectDictionary() -> (Path, [String: Any]) { +func iosProjectData() throws -> Data { let iosProject = fixturesPath() + "iOS/Project.xcodeproj/project.pbxproj" - return (iosProject, loadPlist(path: iosProject.string)!) + return try Data(contentsOf: iosProject.url) } -func fileSharedAcrossTargetsDictionary() -> (Path, [String: Any]) { +func fileSharedAcrossTargetsData() throws -> Data { let fileSharedAcrossTargetsProject = fixturesPath() + "FileSharedAcrossTargets/FileSharedAcrossTargets.xcodeproj/project.pbxproj" - return (fileSharedAcrossTargetsProject, loadPlist(path: fileSharedAcrossTargetsProject.string)!) + return try Data(contentsOf: fileSharedAcrossTargetsProject.url) } -func targetWithCustomBuildRulesDictionary() -> (Path, [String: Any]) { +func targetWithCustomBuildRulesData() throws -> Data { let targetWithCustomBuildRulesProject = fixturesPath() + "TargetWithCustomBuildRules/TargetWithCustomBuildRules.xcodeproj/project.pbxproj" - return (targetWithCustomBuildRulesProject, loadPlist(path: targetWithCustomBuildRulesProject.string)!) + return try Data(contentsOf: targetWithCustomBuildRulesProject.url) } -func iosProjectWithXCLocalSwiftPackageReference() -> (Path, [String: Any]) { +func iosProjectWithXCLocalSwiftPackageReference() throws -> Data { let iosProjectWithXCLocalSwiftPackageReference = fixturesPath() + "iOS/ProjectWithXCLocalSwiftPackageReference.xcodeproj/project.pbxproj" - return (iosProjectWithXCLocalSwiftPackageReference, loadPlist(path: iosProjectWithXCLocalSwiftPackageReference.string)!) + return try Data(contentsOf: iosProjectWithXCLocalSwiftPackageReference.url) } -func iosProjectWithRelativeXCLocalSwiftPackageReferences() -> (Path, [String: Any]) { +func iosProjectWithRelativeXCLocalSwiftPackageReferences() throws -> Data { let iosProjectWithXCLocalSwiftPackageReference = fixturesPath() + "iOS/ProjectWithRelativeXCLocalSwiftPackageReference/ProjectWithRelativeXCLocalSwiftPackageReference.xcodeproj/project.pbxproj" - return (iosProjectWithXCLocalSwiftPackageReference, loadPlist(path: iosProjectWithXCLocalSwiftPackageReference.string)!) + return try Data(contentsOf: iosProjectWithXCLocalSwiftPackageReference.url) } -func iosProjectWithXCLocalSwiftPackageReferences() -> (Path, [String: Any]) { +func iosProjectWithXCLocalSwiftPackageReferences() throws -> Data { let iosProjectWithXCLocalSwiftPackageReference = fixturesPath() + "iOS/ProjectWithXCLocalSwiftPackageReferences.xcodeproj/project.pbxproj" - return (iosProjectWithXCLocalSwiftPackageReference, loadPlist(path: iosProjectWithXCLocalSwiftPackageReference.string)!) + return try Data(contentsOf: iosProjectWithXCLocalSwiftPackageReference.url) } From b9992de5b44b37a25c57e472a17e392f20923d71 Mon Sep 17 00:00:00 2001 From: waltflanagan <398293+waltflanagan@users.noreply.github.com> Date: Tue, 18 Feb 2025 14:25:18 +0000 Subject: [PATCH 426/678] [Release] XcodeProj 8.26.8 --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index db85ce691..71bed8eeb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,11 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [8.26.8] - 2025-02-18 +### Details +#### Refactor +- Strongly type plist values to achieve full sendability by @waltflanagan in [#904](https://github.com/tuist/XcodeProj/pull/904) + ## [8.26.7] - 2025-02-13 ### Details #### Chore @@ -222,6 +227,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 #### Feat - Introduce the new Xcode 16 models `PBXFileSystemSynchronizedRootGroup` and `PBXFileSystemSynchronizedBuildFileExceptionSet` by @pepicrft in [#827](https://github.com/tuist/XcodeProj/pull/827) +[8.26.8]: https://github.com/tuist/XcodeProj/compare/8.26.7..8.26.8 [8.26.7]: https://github.com/tuist/XcodeProj/compare/8.26.6..8.26.7 [8.26.6]: https://github.com/tuist/XcodeProj/compare/8.26.5..8.26.6 [8.26.5]: https://github.com/tuist/XcodeProj/compare/8.26.4..8.26.5 From 97c50366b08aeb792e05e2d20e0ed4fd19704785 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adin=20=C4=86ebi=C4=87?= Date: Tue, 18 Feb 2025 16:08:11 +0100 Subject: [PATCH 427/678] feat: support `PBXFileSystemSynchronizedGroupBuildPhaseMembershipExceptionSet` (#894) * Add support for reading `PBXFileSystemSynchronizedGroupBuildPhaseMembershipExceptionSet` * Fix reading and writing PBXFileSystemSynchronizedGroupBuildPhaseMembershipExceptionSet * Fix tests * Fix lint issue * Add comment * Add PBXFileSystemSynchronizedGroupBuildPhaseMembershipExceptionSet case to PBXObjectDictionaryEntry --------- Co-authored-by: Yusuf Olokoba Co-authored-by: fortmarek --- Fixtures/SynchronizedRootGroups/.gitignore | 1 + .../project.pbxproj | 41 ++++++--- ...temSynchronizedBuildFileExceptionSet.swift | 2 +- ...BXFileSystemSynchronizedExceptionSet.swift | 4 + ...roupBuildPhaseMembershipExceptionSet.swift | 83 +++++++++++++++++++ .../PBXFileSystemSynchronizedRootGroup.swift | 12 +-- .../Project/PBXObjectDictionaryEntry.swift | 1 + .../Objects/Project/PBXObjects.swift | 15 +++- .../Objects/Project/PBXProjEncoder.swift | 6 ++ .../Objects/Sourcery/Equality.generated.swift | 9 ++ .../Objects/Project/PBXProjEncoderTests.swift | 37 ++++++--- 11 files changed, 179 insertions(+), 32 deletions(-) create mode 100644 Fixtures/SynchronizedRootGroups/.gitignore create mode 100644 Sources/XcodeProj/Objects/Files/PBXFileSystemSynchronizedExceptionSet.swift create mode 100644 Sources/XcodeProj/Objects/Files/PBXFileSystemSynchronizedGroupBuildPhaseMembershipExceptionSet.swift diff --git a/Fixtures/SynchronizedRootGroups/.gitignore b/Fixtures/SynchronizedRootGroups/.gitignore new file mode 100644 index 000000000..9e69ba792 --- /dev/null +++ b/Fixtures/SynchronizedRootGroups/.gitignore @@ -0,0 +1 @@ +*.xcodeproj/xcuserdata diff --git a/Fixtures/SynchronizedRootGroups/SynchronizedRootGroups.xcodeproj/project.pbxproj b/Fixtures/SynchronizedRootGroups/SynchronizedRootGroups.xcodeproj/project.pbxproj index c6a599659..a8db250fe 100644 --- a/Fixtures/SynchronizedRootGroups/SynchronizedRootGroups.xcodeproj/project.pbxproj +++ b/Fixtures/SynchronizedRootGroups/SynchronizedRootGroups.xcodeproj/project.pbxproj @@ -3,9 +3,21 @@ archiveVersion = 1; classes = { }; - objectVersion = 70; + objectVersion = 73; objects = { +/* Begin PBXCopyFilesBuildPhase section */ + F841A9CA2D63AFBB00059ED6 /* CopyFiles */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(CONTENTS_FOLDER_PATH)/XPCServices"; + dstSubfolderSpec = 16; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXCopyFilesBuildPhase section */ + /* Begin PBXFileReference section */ 6CF05B8C2C53F5F200EF267F /* SynchronizedRootGroups.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = SynchronizedRootGroups.framework; sourceTree = BUILT_PRODUCTS_DIR; }; /* End PBXFileReference section */ @@ -20,19 +32,23 @@ }; /* End PBXFileSystemSynchronizedBuildFileExceptionSet section */ -/* Begin PBXFileSystemSynchronizedRootGroup section */ - 6CF05B9D2C53F64800EF267F /* SynchronizedRootGroups */ = { - isa = PBXFileSystemSynchronizedRootGroup; - exceptions = ( - 6CF05BA32C53F97F00EF267F /* PBXFileSystemSynchronizedBuildFileExceptionSet */, - ); - explicitFileTypes = { +/* Begin PBXFileSystemSynchronizedGroupBuildPhaseMembershipExceptionSet section */ + F841A9D12D63B00A00059ED6 /* PBXFileSystemSynchronizedGroupBuildPhaseMembershipExceptionSet */ = { + isa = PBXFileSystemSynchronizedGroupBuildPhaseMembershipExceptionSet; + attributesByRelativePath = { + XPCService.xpc = ( + RemoveHeadersOnCopy, + ); }; - explicitFolders = ( + buildPhase = F841A9CA2D63AFBB00059ED6 /* CopyFiles */; + membershipExceptions = ( + XPCService.xpc, ); - path = SynchronizedRootGroups; - sourceTree = ""; }; +/* End PBXFileSystemSynchronizedGroupBuildPhaseMembershipExceptionSet section */ + +/* Begin PBXFileSystemSynchronizedRootGroup section */ + 6CF05B9D2C53F64800EF267F /* SynchronizedRootGroups */ = {isa = PBXFileSystemSynchronizedRootGroup; exceptions = (6CF05BA32C53F97F00EF267F /* PBXFileSystemSynchronizedBuildFileExceptionSet */, F841A9D12D63B00A00059ED6 /* PBXFileSystemSynchronizedGroupBuildPhaseMembershipExceptionSet */, ); explicitFileTypes = {}; explicitFolders = (); path = SynchronizedRootGroups; sourceTree = ""; }; /* End PBXFileSystemSynchronizedRootGroup section */ /* Begin PBXFrameworksBuildPhase section */ @@ -83,6 +99,7 @@ 6CF05B882C53F5F200EF267F /* Sources */, 6CF05B892C53F5F200EF267F /* Frameworks */, 6CF05B8A2C53F5F200EF267F /* Resources */, + F841A9CA2D63AFBB00059ED6 /* CopyFiles */, ); buildRules = ( ); @@ -114,7 +131,6 @@ }; }; buildConfigurationList = 6CF05B862C53F5F200EF267F /* Build configuration list for PBXProject "SynchronizedRootGroups" */; - compatibilityVersion = "Xcode 15.0"; developmentRegion = en; hasScannedForEncodings = 0; knownRegions = ( @@ -122,6 +138,7 @@ Base, ); mainGroup = 6CF05B822C53F5F200EF267F; + preferredProjectObjectVersion = 60; productRefGroup = 6CF05B8D2C53F5F200EF267F /* Products */; projectDirPath = ""; projectRoot = ""; diff --git a/Sources/XcodeProj/Objects/Files/PBXFileSystemSynchronizedBuildFileExceptionSet.swift b/Sources/XcodeProj/Objects/Files/PBXFileSystemSynchronizedBuildFileExceptionSet.swift index 4f363322a..c375f16d0 100644 --- a/Sources/XcodeProj/Objects/Files/PBXFileSystemSynchronizedBuildFileExceptionSet.swift +++ b/Sources/XcodeProj/Objects/Files/PBXFileSystemSynchronizedBuildFileExceptionSet.swift @@ -1,7 +1,7 @@ import Foundation /// Class representing an element that may contain other elements. -public class PBXFileSystemSynchronizedBuildFileExceptionSet: PBXObject, PlistSerializable { +public class PBXFileSystemSynchronizedBuildFileExceptionSet: PBXFileSystemSynchronizedExceptionSet, PlistSerializable { // MARK: - Attributes /// A list of relative paths to children subfolders for which exceptions are applied. diff --git a/Sources/XcodeProj/Objects/Files/PBXFileSystemSynchronizedExceptionSet.swift b/Sources/XcodeProj/Objects/Files/PBXFileSystemSynchronizedExceptionSet.swift new file mode 100644 index 000000000..095bd24e9 --- /dev/null +++ b/Sources/XcodeProj/Objects/Files/PBXFileSystemSynchronizedExceptionSet.swift @@ -0,0 +1,4 @@ +import Foundation + +/// Common class for exception sets, such as `PBXFileSystemSynchronizedGroupBuildPhaseMembershipExceptionSet` and `PBXFileSystemSynchronizedBuildFileExceptionSet` +public class PBXFileSystemSynchronizedExceptionSet: PBXObject {} diff --git a/Sources/XcodeProj/Objects/Files/PBXFileSystemSynchronizedGroupBuildPhaseMembershipExceptionSet.swift b/Sources/XcodeProj/Objects/Files/PBXFileSystemSynchronizedGroupBuildPhaseMembershipExceptionSet.swift new file mode 100644 index 000000000..b2326893e --- /dev/null +++ b/Sources/XcodeProj/Objects/Files/PBXFileSystemSynchronizedGroupBuildPhaseMembershipExceptionSet.swift @@ -0,0 +1,83 @@ +import Foundation + +public class PBXFileSystemSynchronizedGroupBuildPhaseMembershipExceptionSet: PBXFileSystemSynchronizedExceptionSet, PlistSerializable { + // MARK: - Attributes + + /// A list of relative paths to children subfolders for which exceptions are applied. + public var membershipExceptions: [String]? + + /// Build phase that this exception set applies to. + public var buildPhase: PBXBuildPhase! { + get { + buildPhaseReference.getObject() as? PBXBuildPhase + } + set { + buildPhaseReference = newValue.reference + } + } + + /// Attributes by relative path. + /// Every item in the list is the relative path inside the root synchronized group. + /// For example `RemoveHeadersOnCopy` and `CodeSignOnCopy`. + public var attributesByRelativePath: [String: [String]]? + + var buildPhaseReference: PBXObjectReference + + // MARK: - Init + + public init( + buildPhase: PBXBuildPhase, + membershipExceptions: [String]?, + attributesByRelativePath: [String: [String]]? + ) { + buildPhaseReference = buildPhase.reference + self.membershipExceptions = membershipExceptions + self.attributesByRelativePath = attributesByRelativePath + super.init() + } + + // MARK: - Decodable + + fileprivate enum CodingKeys: String, CodingKey { + case buildPhase + case membershipExceptions + case attributesByRelativePath + } + + public required init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + let referenceRepository = decoder.context.objectReferenceRepository + let objects = decoder.context.objects + let buildPhaseReference: String = try container.decode(.buildPhase) + self.buildPhaseReference = referenceRepository.getOrCreate(reference: buildPhaseReference, objects: objects) + membershipExceptions = try container.decodeIfPresent(.membershipExceptions) + attributesByRelativePath = try container.decodeIfPresent(.attributesByRelativePath) + try super.init(from: decoder) + } + + // MARK: - Equatable + + override func isEqual(to object: Any?) -> Bool { + guard let rhs = object as? PBXFileSystemSynchronizedGroupBuildPhaseMembershipExceptionSet else { + return false + } + return isEqual(to: rhs) + } + + // MARK: - PlistSerializable + + func plistKeyAndValue(proj _: PBXProj, reference: String) throws -> (key: CommentedString, value: PlistValue) { + var dictionary: [CommentedString: PlistValue] = [:] + dictionary["isa"] = .string(CommentedString(type(of: self).isa)) + if let membershipExceptions { + dictionary["membershipExceptions"] = .array(membershipExceptions.map { .string(CommentedString($0)) }) + } + if let attributesByRelativePath { + dictionary["attributesByRelativePath"] = .dictionary(Dictionary(uniqueKeysWithValues: attributesByRelativePath.map { key, value in + (CommentedString(key), .array(value.map { .string(CommentedString($0)) })) + })) + } + dictionary["buildPhase"] = .string(CommentedString(buildPhase.reference.value, comment: buildPhase.name() ?? "CopyFiles")) + return (key: CommentedString(reference, comment: "PBXFileSystemSynchronizedGroupBuildPhaseMembershipExceptionSet"), value: .dictionary(dictionary)) + } +} diff --git a/Sources/XcodeProj/Objects/Files/PBXFileSystemSynchronizedRootGroup.swift b/Sources/XcodeProj/Objects/Files/PBXFileSystemSynchronizedRootGroup.swift index 882d27db5..43e090eff 100644 --- a/Sources/XcodeProj/Objects/Files/PBXFileSystemSynchronizedRootGroup.swift +++ b/Sources/XcodeProj/Objects/Files/PBXFileSystemSynchronizedRootGroup.swift @@ -12,7 +12,7 @@ public class PBXFileSystemSynchronizedRootGroup: PBXFileElement { /// It returns a list of exception objects that override the configuration for some children /// in the synchronized root group. - public var exceptions: [PBXFileSystemSynchronizedBuildFileExceptionSet]? { + public var exceptions: [PBXFileSystemSynchronizedExceptionSet]? { set { exceptionsReferences = newValue?.references() } @@ -47,7 +47,7 @@ public class PBXFileSystemSynchronizedRootGroup: PBXFileElement { tabWidth: UInt? = nil, wrapsLines: Bool? = nil, explicitFileTypes: [String: String] = [:], - exceptions: [PBXFileSystemSynchronizedBuildFileExceptionSet] = [], + exceptions: [PBXFileSystemSynchronizedExceptionSet] = [], explicitFolders: [String] = []) { self.explicitFileTypes = explicitFileTypes exceptionsReferences = exceptions.references() @@ -83,14 +83,14 @@ public class PBXFileSystemSynchronizedRootGroup: PBXFileElement { // MARK: - PlistSerializable - override var multiline: Bool { true } + override var multiline: Bool { (exceptions?.count ?? 0) < 2 } override func plistKeyAndValue(proj: PBXProj, reference: String) throws -> (key: CommentedString, value: PlistValue) { var dictionary: [CommentedString: PlistValue] = try super.plistKeyAndValue(proj: proj, reference: reference).value.dictionary ?? [:] dictionary["isa"] = .string(CommentedString(type(of: self).isa)) - if let exceptionsReferences, !exceptionsReferences.isEmpty { - dictionary["exceptions"] = .array(exceptionsReferences.map { exceptionReference in - .string(CommentedString(exceptionReference.value, comment: "PBXFileSystemSynchronizedBuildFileExceptionSet")) + if let exceptions, !exceptions.isEmpty { + dictionary["exceptions"] = .array(exceptions.map { exception in + .string(CommentedString(exception.reference.value, comment: type(of: exception).isa)) }) } if let explicitFileTypes { diff --git a/Sources/XcodeProj/Objects/Project/PBXObjectDictionaryEntry.swift b/Sources/XcodeProj/Objects/Project/PBXObjectDictionaryEntry.swift index 33e3adaa1..d2a541bf7 100644 --- a/Sources/XcodeProj/Objects/Project/PBXObjectDictionaryEntry.swift +++ b/Sources/XcodeProj/Objects/Project/PBXObjectDictionaryEntry.swift @@ -40,6 +40,7 @@ struct PBXObjectDictionaryEntry: Decodable { case XCSwiftPackageProductDependency.isa: try XCSwiftPackageProductDependency(from: decoder) case PBXFileSystemSynchronizedRootGroup.isa: try PBXFileSystemSynchronizedRootGroup(from: decoder) case PBXFileSystemSynchronizedBuildFileExceptionSet.isa: try PBXFileSystemSynchronizedBuildFileExceptionSet(from: decoder) + case PBXFileSystemSynchronizedGroupBuildPhaseMembershipExceptionSet.isa: try PBXFileSystemSynchronizedGroupBuildPhaseMembershipExceptionSet(from: decoder) default: throw PBXObjectError.unknownElement(isa) } diff --git a/Sources/XcodeProj/Objects/Project/PBXObjects.swift b/Sources/XcodeProj/Objects/Project/PBXObjects.swift index 33d767a1c..70083a779 100644 --- a/Sources/XcodeProj/Objects/Project/PBXObjects.swift +++ b/Sources/XcodeProj/Objects/Project/PBXObjects.swift @@ -145,6 +145,11 @@ class PBXObjects: Equatable { lock.whileLocked { _fileSystemSynchronizedBuildFileExceptionSets } } + private var _fileSystemSynchronizedGroupBuildPhaseMembershipExceptionSet: [PBXObjectReference: PBXFileSystemSynchronizedGroupBuildPhaseMembershipExceptionSet] = [:] + var fileSystemSynchronizedGroupBuildPhaseMembershipExceptionSet: [PBXObjectReference: PBXFileSystemSynchronizedGroupBuildPhaseMembershipExceptionSet] { + lock.whileLocked { _fileSystemSynchronizedGroupBuildPhaseMembershipExceptionSet } + } + // XCSwiftPackageProductDependency /// Initializes the project objects container @@ -185,7 +190,8 @@ class PBXObjects: Equatable { lhs.swiftPackageProductDependencies == rhs._swiftPackageProductDependencies && lhs.remoteSwiftPackageReferences == rhs.remoteSwiftPackageReferences && lhs.fileSystemSynchronizedRootGroups == rhs.fileSystemSynchronizedRootGroups && - lhs.fileSystemSynchronizedBuildFileExceptionSets == rhs.fileSystemSynchronizedBuildFileExceptionSets + lhs.fileSystemSynchronizedBuildFileExceptionSets == rhs.fileSystemSynchronizedBuildFileExceptionSets && + lhs.fileSystemSynchronizedGroupBuildPhaseMembershipExceptionSet == rhs.fileSystemSynchronizedGroupBuildPhaseMembershipExceptionSet } // MARK: - Helpers @@ -232,6 +238,8 @@ class PBXObjects: Equatable { case let object as XCSwiftPackageProductDependency: _swiftPackageProductDependencies[objectReference] = object case let object as PBXFileSystemSynchronizedRootGroup: _fileSystemSynchronizedRootGroups[objectReference] = object case let object as PBXFileSystemSynchronizedBuildFileExceptionSet: _fileSystemSynchronizedBuildFileExceptionSets[objectReference] = object + case let object as PBXFileSystemSynchronizedGroupBuildPhaseMembershipExceptionSet: + _fileSystemSynchronizedGroupBuildPhaseMembershipExceptionSet[objectReference] = object default: fatalError("Unhandled PBXObject type for \(object), this is likely a bug / todo") } } @@ -296,6 +304,8 @@ class PBXObjects: Equatable { return _fileSystemSynchronizedRootGroups.remove(at: index).value } else if let index = fileSystemSynchronizedBuildFileExceptionSets.index(forKey: reference) { return _fileSystemSynchronizedBuildFileExceptionSets.remove(at: index).value + } else if let index = fileSystemSynchronizedGroupBuildPhaseMembershipExceptionSet.index(forKey: reference) { + return _fileSystemSynchronizedGroupBuildPhaseMembershipExceptionSet.remove(at: index).value } return nil @@ -363,6 +373,8 @@ class PBXObjects: Equatable { object } else if let object = fileSystemSynchronizedBuildFileExceptionSets[reference] { object + } else if let object = fileSystemSynchronizedGroupBuildPhaseMembershipExceptionSet[reference] { + object } else { nil } @@ -456,5 +468,6 @@ extension PBXObjects { swiftPackageProductDependencies.values.forEach(closure) fileSystemSynchronizedRootGroups.values.forEach(closure) fileSystemSynchronizedBuildFileExceptionSets.values.forEach(closure) + fileSystemSynchronizedGroupBuildPhaseMembershipExceptionSet.values.forEach(closure) } } diff --git a/Sources/XcodeProj/Objects/Project/PBXProjEncoder.swift b/Sources/XcodeProj/Objects/Project/PBXProjEncoder.swift index 7321fb1d0..bfbb4adec 100644 --- a/Sources/XcodeProj/Objects/Project/PBXProjEncoder.swift +++ b/Sources/XcodeProj/Objects/Project/PBXProjEncoder.swift @@ -119,6 +119,12 @@ final class PBXProjEncoder { outputSettings: outputSettings, stateHolder: &stateHolder, to: &output) + try write(section: "PBXFileSystemSynchronizedGroupBuildPhaseMembershipExceptionSet", + proj: proj, + objects: proj.objects.fileSystemSynchronizedGroupBuildPhaseMembershipExceptionSet, + outputSettings: outputSettings, + stateHolder: &stateHolder, + to: &output) try write(section: "PBXFileSystemSynchronizedRootGroup", proj: proj, objects: proj.objects.fileSystemSynchronizedRootGroups, diff --git a/Sources/XcodeProj/Objects/Sourcery/Equality.generated.swift b/Sources/XcodeProj/Objects/Sourcery/Equality.generated.swift index 4c9a1d98c..b8087736f 100644 --- a/Sources/XcodeProj/Objects/Sourcery/Equality.generated.swift +++ b/Sources/XcodeProj/Objects/Sourcery/Equality.generated.swift @@ -322,3 +322,12 @@ extension PBXFileSystemSynchronizedBuildFileExceptionSet { return super.isEqual(to: rhs) } } + +extension PBXFileSystemSynchronizedGroupBuildPhaseMembershipExceptionSet { + /// :nodoc: + func isEqual(to rhs: PBXFileSystemSynchronizedGroupBuildPhaseMembershipExceptionSet) -> Bool { + if membershipExceptions != rhs.membershipExceptions { return false } + if buildPhaseReference != rhs.buildPhaseReference { return false } + return super.isEqual(to: rhs) + } +} diff --git a/Tests/XcodeProjTests/Objects/Project/PBXProjEncoderTests.swift b/Tests/XcodeProjTests/Objects/Project/PBXProjEncoderTests.swift index 81c674fb7..2f0e49c81 100644 --- a/Tests/XcodeProjTests/Objects/Project/PBXProjEncoderTests.swift +++ b/Tests/XcodeProjTests/Objects/Project/PBXProjEncoderTests.swift @@ -294,18 +294,7 @@ class PBXProjEncoderTests: XCTestCase { let lines = lines(fromFile: encodeProject(settings: settings)) let beginGroup = lines.findLine("/* Begin PBXFileSystemSynchronizedRootGroup section */") - var line = lines.validate(line: "6CF05B9D2C53F64800EF267F /* SynchronizedRootGroups */ = {", after: beginGroup) - line = lines.validate(line: "isa = PBXFileSystemSynchronizedRootGroup;", after: line) - line = lines.validate(line: "exceptions = (", after: line) - line = lines.validate(line: "6CF05BA32C53F97F00EF267F /* PBXFileSystemSynchronizedBuildFileExceptionSet */,", after: line) - line = lines.validate(line: ");", after: line) - line = lines.validate(line: "explicitFileTypes = {", after: line) - line = lines.validate(line: "};", after: line) - line = lines.validate(line: "explicitFolders = (", after: line) - line = lines.validate(line: ");", after: line) - line = lines.validate(line: "path = SynchronizedRootGroups;", after: line) - line = lines.validate(line: "sourceTree = \"\";", after: line) - line = lines.validate(line: "};", after: line) + var line = lines.validate(line: "6CF05B9D2C53F64800EF267F /* SynchronizedRootGroups */ = {isa = PBXFileSystemSynchronizedRootGroup; exceptions = (6CF05BA32C53F97F00EF267F /* PBXFileSystemSynchronizedBuildFileExceptionSet */, F841A9D12D63B00A00059ED6 /* PBXFileSystemSynchronizedGroupBuildPhaseMembershipExceptionSet */, ); explicitFileTypes = {}; explicitFolders = (); path = SynchronizedRootGroups; sourceTree = \"\"; };", after: beginGroup) line = lines.validate(line: "/* End PBXFileSystemSynchronizedRootGroup section */", after: line) } @@ -328,6 +317,30 @@ class PBXProjEncoderTests: XCTestCase { line = lines.validate(line: "/* End PBXFileSystemSynchronizedBuildFileExceptionSet section */", after: line) } + // MARK: - File system synchronized group build phase membership exception set + + func test_fileSystemSynchronizedGroupBuildPhaseMembershipExceptionSets_when_projectWithFileSystemSynchronizedRootGroups() throws { + // Given + try loadSynchronizedRootGroups() + let settings = PBXOutputSettings(projNavigatorFileOrder: .byFilenameGroupsFirst) + let lines = lines(fromFile: encodeProject(settings: settings)) + + let beginGroup = lines.findLine("/* Begin PBXFileSystemSynchronizedGroupBuildPhaseMembershipExceptionSet section */") + var line = lines.validate(line: "F841A9D12D63B00A00059ED6 /* PBXFileSystemSynchronizedGroupBuildPhaseMembershipExceptionSet */ = {", after: beginGroup) + line = lines.validate(line: "isa = PBXFileSystemSynchronizedGroupBuildPhaseMembershipExceptionSet;", after: line) + line = lines.validate(line: "attributesByRelativePath = {", after: line) + line = lines.validate(line: "XPCService.xpc = (", after: line) + line = lines.validate(line: "RemoveHeadersOnCopy,", after: line) + line = lines.validate(line: ");", after: line) + line = lines.validate(line: "};", after: line) + line = lines.validate(line: "buildPhase = F841A9CA2D63AFBB00059ED6 /* CopyFiles */;", after: line) + line = lines.validate(line: "membershipExceptions = (", after: line) + line = lines.validate(line: "XPCService.xpc,", after: line) + line = lines.validate(line: ");", after: line) + line = lines.validate(line: "};", after: line) + line = lines.validate(line: "/* End PBXFileSystemSynchronizedGroupBuildPhaseMembershipExceptionSet section */", after: line) + } + // MARK: - Build phases func test_build_phase_sources_unsorted_when_iOSProject() throws { From 142b7ea0a087eabf4d12207302a185a0e9d4659b Mon Sep 17 00:00:00 2001 From: fortmarek <9371695+fortmarek@users.noreply.github.com> Date: Tue, 18 Feb 2025 15:43:22 +0000 Subject: [PATCH 428/678] [Release] XcodeProj 8.27.0 --- CHANGELOG.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 71bed8eeb..7dd401252 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [8.27.0] - 2025-02-18 +### Details +#### Feat +- Support `PBXFileSystemSynchronizedGroupBuildPhaseMembershipExceptionSet` by @adincebic in [#894](https://github.com/tuist/XcodeProj/pull/894) + +## New Contributors +* @adincebic made their first contribution in [#894](https://github.com/tuist/XcodeProj/pull/894) ## [8.26.8] - 2025-02-18 ### Details #### Refactor @@ -227,6 +234,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 #### Feat - Introduce the new Xcode 16 models `PBXFileSystemSynchronizedRootGroup` and `PBXFileSystemSynchronizedBuildFileExceptionSet` by @pepicrft in [#827](https://github.com/tuist/XcodeProj/pull/827) +[8.27.0]: https://github.com/tuist/XcodeProj/compare/8.26.8..8.27.0 [8.26.8]: https://github.com/tuist/XcodeProj/compare/8.26.7..8.26.8 [8.26.7]: https://github.com/tuist/XcodeProj/compare/8.26.6..8.26.7 [8.26.6]: https://github.com/tuist/XcodeProj/compare/8.26.5..8.26.6 From 7b9b9735b559ce59be1dd64a341558216dd068a1 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 19 Feb 2025 19:28:51 +0000 Subject: [PATCH 429/678] chore(deps): update dependency tuist to v4.43.0 (#905) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise.toml b/.mise.toml index 5ed0b9038..9958a433e 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,5 +1,5 @@ [tools] swiftformat = "0.54.3" -tuist = "4.42.0" +tuist = "4.43.0" swiftlint = "0.55.1" "git-cliff" = "2.4.0" From cbd622399d845f7686ac96c5110cea5a784758a3 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 19 Feb 2025 19:29:30 +0000 Subject: [PATCH 430/678] [Release] XcodeProj 8.27.1 --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7dd401252..fa943e3f0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,11 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [8.27.1] - 2025-02-19 +### Details +#### Chore +- Update dependency tuist to v4.43.0 by @renovate[bot] in [#905](https://github.com/tuist/XcodeProj/pull/905) + ## [8.27.0] - 2025-02-18 ### Details #### Feat @@ -234,6 +239,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 #### Feat - Introduce the new Xcode 16 models `PBXFileSystemSynchronizedRootGroup` and `PBXFileSystemSynchronizedBuildFileExceptionSet` by @pepicrft in [#827](https://github.com/tuist/XcodeProj/pull/827) +[8.27.1]: https://github.com/tuist/XcodeProj/compare/8.27.0..8.27.1 [8.27.0]: https://github.com/tuist/XcodeProj/compare/8.26.8..8.27.0 [8.26.8]: https://github.com/tuist/XcodeProj/compare/8.26.7..8.26.8 [8.26.7]: https://github.com/tuist/XcodeProj/compare/8.26.6..8.26.7 From b21f776cf74fa4aa2397f716401bbdff9ae85c4b Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 21 Feb 2025 15:55:35 +0000 Subject: [PATCH 431/678] chore(deps): update dependency tuist to v4.43.1 (#906) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise.toml b/.mise.toml index 9958a433e..0da0ff6e9 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,5 +1,5 @@ [tools] swiftformat = "0.54.3" -tuist = "4.43.0" +tuist = "4.43.1" swiftlint = "0.55.1" "git-cliff" = "2.4.0" From 7cb7fbe091b3feb087bb179c445fb96b4fa10982 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 21 Feb 2025 15:56:28 +0000 Subject: [PATCH 432/678] [Release] XcodeProj 8.27.2 --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index fa943e3f0..c35c192fe 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,11 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [8.27.2] - 2025-02-21 +### Details +#### Chore +- Update dependency tuist to v4.43.1 by @renovate[bot] in [#906](https://github.com/tuist/XcodeProj/pull/906) + ## [8.27.1] - 2025-02-19 ### Details #### Chore @@ -239,6 +244,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 #### Feat - Introduce the new Xcode 16 models `PBXFileSystemSynchronizedRootGroup` and `PBXFileSystemSynchronizedBuildFileExceptionSet` by @pepicrft in [#827](https://github.com/tuist/XcodeProj/pull/827) +[8.27.2]: https://github.com/tuist/XcodeProj/compare/8.27.1..8.27.2 [8.27.1]: https://github.com/tuist/XcodeProj/compare/8.27.0..8.27.1 [8.27.0]: https://github.com/tuist/XcodeProj/compare/8.26.8..8.27.0 [8.26.8]: https://github.com/tuist/XcodeProj/compare/8.26.7..8.26.8 From bc589a85ae8aab9ececd554102c9b26d2bf3db24 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 25 Feb 2025 19:13:48 +0000 Subject: [PATCH 433/678] chore(deps): update dependency tuist to v4.43.2 (#907) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise.toml b/.mise.toml index 0da0ff6e9..b8c945a93 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,5 +1,5 @@ [tools] swiftformat = "0.54.3" -tuist = "4.43.1" +tuist = "4.43.2" swiftlint = "0.55.1" "git-cliff" = "2.4.0" From 02bc2dd6224aa59147941d85fdc45a7677af62f6 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 25 Feb 2025 19:14:38 +0000 Subject: [PATCH 434/678] [Release] XcodeProj 8.27.3 --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index c35c192fe..070b325ee 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,11 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [8.27.3] - 2025-02-25 +### Details +#### Chore +- Update dependency tuist to v4.43.2 by @renovate[bot] in [#907](https://github.com/tuist/XcodeProj/pull/907) + ## [8.27.2] - 2025-02-21 ### Details #### Chore @@ -244,6 +249,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 #### Feat - Introduce the new Xcode 16 models `PBXFileSystemSynchronizedRootGroup` and `PBXFileSystemSynchronizedBuildFileExceptionSet` by @pepicrft in [#827](https://github.com/tuist/XcodeProj/pull/827) +[8.27.3]: https://github.com/tuist/XcodeProj/compare/8.27.2..8.27.3 [8.27.2]: https://github.com/tuist/XcodeProj/compare/8.27.1..8.27.2 [8.27.1]: https://github.com/tuist/XcodeProj/compare/8.27.0..8.27.1 [8.27.0]: https://github.com/tuist/XcodeProj/compare/8.26.8..8.27.0 From c16bba359fcda6592df4f5654bf5446db39fe388 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 10 Mar 2025 22:57:03 +0000 Subject: [PATCH 435/678] chore(deps): update dependency tuist to v4.44.1 (#909) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise.toml b/.mise.toml index b8c945a93..0d4cca4a0 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,5 +1,5 @@ [tools] swiftformat = "0.54.3" -tuist = "4.43.2" +tuist = "4.44.1" swiftlint = "0.55.1" "git-cliff" = "2.4.0" From e653dc7c7a234d841b0cb9fd9d858372da03be76 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 10 Mar 2025 22:57:38 +0000 Subject: [PATCH 436/678] [Release] XcodeProj 8.27.4 --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 070b325ee..b63758959 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,11 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [8.27.4] - 2025-03-10 +### Details +#### Chore +- Update dependency tuist to v4.44.1 by @renovate[bot] in [#909](https://github.com/tuist/XcodeProj/pull/909) + ## [8.27.3] - 2025-02-25 ### Details #### Chore @@ -249,6 +254,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 #### Feat - Introduce the new Xcode 16 models `PBXFileSystemSynchronizedRootGroup` and `PBXFileSystemSynchronizedBuildFileExceptionSet` by @pepicrft in [#827](https://github.com/tuist/XcodeProj/pull/827) +[8.27.4]: https://github.com/tuist/XcodeProj/compare/8.27.3..8.27.4 [8.27.3]: https://github.com/tuist/XcodeProj/compare/8.27.2..8.27.3 [8.27.2]: https://github.com/tuist/XcodeProj/compare/8.27.1..8.27.2 [8.27.1]: https://github.com/tuist/XcodeProj/compare/8.27.0..8.27.1 From 2ad0b55f0ec3a2ca5bedf5051e15b45b19d43a2e Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 11 Mar 2025 22:27:56 +0000 Subject: [PATCH 437/678] chore(deps): update dependency tuist to v4.44.2 (#910) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise.toml b/.mise.toml index 0d4cca4a0..5f2b8f717 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,5 +1,5 @@ [tools] swiftformat = "0.54.3" -tuist = "4.44.1" +tuist = "4.44.2" swiftlint = "0.55.1" "git-cliff" = "2.4.0" From 8b77ece5708ed8b5bcd5819d339124c573279eb6 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 11 Mar 2025 22:28:37 +0000 Subject: [PATCH 438/678] [Release] XcodeProj 8.27.5 --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index b63758959..eca9c8728 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,11 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [8.27.5] - 2025-03-11 +### Details +#### Chore +- Update dependency tuist to v4.44.2 by @renovate[bot] in [#910](https://github.com/tuist/XcodeProj/pull/910) + ## [8.27.4] - 2025-03-10 ### Details #### Chore @@ -254,6 +259,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 #### Feat - Introduce the new Xcode 16 models `PBXFileSystemSynchronizedRootGroup` and `PBXFileSystemSynchronizedBuildFileExceptionSet` by @pepicrft in [#827](https://github.com/tuist/XcodeProj/pull/827) +[8.27.5]: https://github.com/tuist/XcodeProj/compare/8.27.4..8.27.5 [8.27.4]: https://github.com/tuist/XcodeProj/compare/8.27.3..8.27.4 [8.27.3]: https://github.com/tuist/XcodeProj/compare/8.27.2..8.27.3 [8.27.2]: https://github.com/tuist/XcodeProj/compare/8.27.1..8.27.2 From 95ee036f62fdd3308f5cd2790a58e16e2d9d274d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20Pi=C3=B1era=20Buend=C3=ADa?= <663605+pepicrft@users.noreply.github.com> Date: Fri, 14 Mar 2025 15:40:18 +0100 Subject: [PATCH 439/678] chore: update changelog and renovate configuration (#911) Enhance commit parsing and dependency management: - Add commit parsers to cliff.toml for better changelog categorization - Configure semantic commit scopes for dependencies and Swift Package Manager --- cliff.toml | 16 ++++++++++++++++ renovate.json | 7 ++++++- 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/cliff.toml b/cliff.toml index fd69f534d..9f4edec6a 100644 --- a/cliff.toml +++ b/cliff.toml @@ -90,6 +90,22 @@ commit_preprocessors = [ # remove issue numbers from commits { pattern = '\((\w+\s)?#([0-9]+)\)', replace = "" }, ] +commit_parsers = [ + { message = "^feat", group = "Features" }, + { message = "^fix", group = "Bug Fixes" }, + { message = "^doc", group = "Documentation" }, + { message = "^perf", group = "Performance" }, + { message = "^refactor", group = "Refactor" }, + { message = "^style", group = "Styling" }, + { message = "^test", group = "Testing" }, + { message = "^chore\\(spm.*\\)", skip = false }, + { message = "^chore\\(deps.*\\)", skip = true }, + { message = "^chore\\(pr\\)", skip = true }, + { message = "^chore\\(pull\\)", skip = true }, + { message = "^chore\\(release\\): prepare for", skip = true }, + { message = "^chore|^ci", group = "Miscellaneous Tasks" }, + { body = ".*security", group = "Security" }, +] # protect breaking changes from being skipped due to matching a skipping commit_parser protect_breaking_commits = false # filter out the commits that are not matched by commit parsers diff --git a/renovate.json b/renovate.json index 9ec02b3bc..a425f0734 100644 --- a/renovate.json +++ b/renovate.json @@ -10,7 +10,12 @@ "matchUpdateTypes": ["minor", "patch", "pin", "digest"], "automerge": true, "automergeType": "pr", - "automergeStrategy": "auto" + "automergeStrategy": "auto", + "semanticCommitScope": "deps" + }, + { + "matchManagers": ["swift"], + "semanticCommitScope": "spm" } ], "lockFileMaintenance": { From 6c185f503a7577a338d0b08c70efe95ff2e9f873 Mon Sep 17 00:00:00 2001 From: pepicrft <663605+pepicrft@users.noreply.github.com> Date: Fri, 14 Mar 2025 14:40:46 +0000 Subject: [PATCH 440/678] [Release] XcodeProj 8.27.6 --- CHANGELOG.md | 216 +++++++-------------------------------------------- 1 file changed, 26 insertions(+), 190 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index eca9c8728..35307e864 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,34 +5,14 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## [8.27.5] - 2025-03-11 +## [8.27.6] - 2025-03-14 ### Details -#### Chore -- Update dependency tuist to v4.44.2 by @renovate[bot] in [#910](https://github.com/tuist/XcodeProj/pull/910) - -## [8.27.4] - 2025-03-10 -### Details -#### Chore -- Update dependency tuist to v4.44.1 by @renovate[bot] in [#909](https://github.com/tuist/XcodeProj/pull/909) - -## [8.27.3] - 2025-02-25 -### Details -#### Chore -- Update dependency tuist to v4.43.2 by @renovate[bot] in [#907](https://github.com/tuist/XcodeProj/pull/907) - -## [8.27.2] - 2025-02-21 -### Details -#### Chore -- Update dependency tuist to v4.43.1 by @renovate[bot] in [#906](https://github.com/tuist/XcodeProj/pull/906) - -## [8.27.1] - 2025-02-19 -### Details -#### Chore -- Update dependency tuist to v4.43.0 by @renovate[bot] in [#905](https://github.com/tuist/XcodeProj/pull/905) +#### Miscellaneous Tasks +- Update changelog and renovate configuration by @pepicrft in [#911](https://github.com/tuist/XcodeProj/pull/911) ## [8.27.0] - 2025-02-18 ### Details -#### Feat +#### Features - Support `PBXFileSystemSynchronizedGroupBuildPhaseMembershipExceptionSet` by @adincebic in [#894](https://github.com/tuist/XcodeProj/pull/894) ## New Contributors @@ -42,70 +22,42 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 #### Refactor - Strongly type plist values to achieve full sendability by @waltflanagan in [#904](https://github.com/tuist/XcodeProj/pull/904) -## [8.26.7] - 2025-02-13 -### Details -#### Chore -- Update dependency tuist to v4.42.0 by @renovate[bot] in [#902](https://github.com/tuist/XcodeProj/pull/902) - -## [8.26.6] - 2025-02-05 -### Details -#### Chore -- Update dependency tuist to v4.41.0 by @renovate[bot] in [#901](https://github.com/tuist/XcodeProj/pull/901) - ## [8.26.5] - 2025-01-27 ### Details -#### Fix +#### Bug Fixes - Ensure that file references are fixed for filesystem synchronized root groups by @bryansum in [#897](https://github.com/tuist/XcodeProj/pull/897) ## New Contributors * @bryansum made their first contribution in [#897](https://github.com/tuist/XcodeProj/pull/897) ## [8.26.4] - 2025-01-24 ### Details -#### Fix +#### Bug Fixes - Add missing BuildSettingsProvider for visionOS by @alexanderwe in [#898](https://github.com/tuist/XcodeProj/pull/898) ## New Contributors * @alexanderwe made their first contribution in [#898](https://github.com/tuist/XcodeProj/pull/898) -## [8.26.3] - 2025-01-22 -### Details -#### Chore -- Update dependency tuist to v4.40.0 by @renovate[bot] in [#900](https://github.com/tuist/XcodeProj/pull/900) - -## [8.26.2] - 2025-01-10 -### Details -#### Chore -- Update dependency tuist to v4.39.1 by @renovate[bot] in [#895](https://github.com/tuist/XcodeProj/pull/895) - -## [8.26.1] - 2024-12-24 -### Details -#### Chore -- Update dependency tuist to v4.38.2 by @renovate[bot] in [#893](https://github.com/tuist/XcodeProj/pull/893) - ## [8.26.0] - 2024-12-21 ### Details -#### Feat +#### Features - Add path to XcodeProj and XCWorkspace by @ajkolean in [#892](https://github.com/tuist/XcodeProj/pull/892) ## New Contributors * @ajkolean made their first contribution in [#892](https://github.com/tuist/XcodeProj/pull/892) ## [8.25.1] - 2024-12-19 ### Details -#### Chore -- Update dependency tuist to v4.38.1 by @renovate[bot] in [#890](https://github.com/tuist/XcodeProj/pull/890) - -#### Fix +#### Bug Fixes - Infinite recursion and Incorrect deprecation notice in PathRunnable by @georgenavarro in [#889](https://github.com/tuist/XcodeProj/pull/889) ## [8.25.0] - 2024-12-03 ### Details -#### Feat +#### Features - Add handling for Swift Testing Only Parallelization by @kelvinharron in [#871](https://github.com/tuist/XcodeProj/pull/871) ## New Contributors * @kelvinharron made their first contribution in [#871](https://github.com/tuist/XcodeProj/pull/871) ## [8.24.13] - 2024-12-03 ### Details -#### Docs +#### Documentation - Add Speakus as a contributor for code by @allcontributors[bot] in [#887](https://github.com/tuist/XcodeProj/pull/887) #### Refactor @@ -113,20 +65,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [8.24.12] - 2024-12-03 ### Details -#### Docs +#### Bug Fixes +- Inconsistent behaviour with Xcode 16 when `PBXProject.TargetAttributes` is empty by @Speakus in [#865](https://github.com/tuist/XcodeProj/pull/865) + +#### Documentation - Add kelvinharron as a contributor for code by @allcontributors[bot] in [#886](https://github.com/tuist/XcodeProj/pull/886) - Add georgenavarro as a contributor for code by @allcontributors[bot] in [#885](https://github.com/tuist/XcodeProj/pull/885) -#### Fix -- Inconsistent behaviour with Xcode 16 when `PBXProject.TargetAttributes` is empty by @Speakus in [#865](https://github.com/tuist/XcodeProj/pull/865) - ## New Contributors * @Speakus made their first contribution in [#865](https://github.com/tuist/XcodeProj/pull/865) -## [8.24.11] - 2024-11-27 -### Details -#### Chore -- Update dependency tuist to v4.36.0 by @renovate[bot] in [#882](https://github.com/tuist/XcodeProj/pull/882) - ## [8.24.10] - 2024-11-20 ### Details #### Refactor @@ -134,173 +81,62 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## New Contributors * @yungu0010 made their first contribution in [#881](https://github.com/tuist/XcodeProj/pull/881) -## [8.24.9] - 2024-11-07 -### Details -#### Chore -- Update dependency tuist to v4.33.0 by @renovate[bot] in [#877](https://github.com/tuist/XcodeProj/pull/877) - -## [8.24.8] - 2024-11-01 -### Details -#### Chore -- Update dependency tuist to v4.32.1 by @renovate[bot] in [#876](https://github.com/tuist/XcodeProj/pull/876) - -## [8.24.7] - 2024-10-31 -### Details -#### Chore -- Update dependency tuist to v4.32.0 by @renovate[bot] in [#875](https://github.com/tuist/XcodeProj/pull/875) - -## [8.24.6] - 2024-10-23 -### Details -#### Chore -- Update actions/checkout digest to 11bd719 by @renovate[bot] in [#873](https://github.com/tuist/XcodeProj/pull/873) - -## [8.24.5] - 2024-10-23 -### Details -#### Chore -- Update dependency tuist to v4.31.0 by @renovate[bot] in [#872](https://github.com/tuist/XcodeProj/pull/872) - -## [8.24.4] - 2024-10-16 -### Details -#### Chore -- Update dependency tuist to v4.30.0 by @renovate[bot] in [#870](https://github.com/tuist/XcodeProj/pull/870) - -## [8.24.3] - 2024-10-10 -### Details -#### Chore -- Update dependency tuist to v4.29.1 by @renovate[bot] in [#866](https://github.com/tuist/XcodeProj/pull/866) - ## [8.24.2] - 2024-10-10 ### Details -#### Chore -- Update actions/checkout digest to eef6144 by @renovate[bot] in [#864](https://github.com/tuist/XcodeProj/pull/864) -- Update dependency tuist to v4.29.0 by @renovate[bot] in [#863](https://github.com/tuist/XcodeProj/pull/863) - -#### Fix +#### Bug Fixes - Issues parsing Xcode 16 projects by @pepicrft in [#862](https://github.com/tuist/XcodeProj/pull/862) ## [8.24.1] - 2024-09-27 ### Details -#### Fix +#### Bug Fixes - Repository cleanup by @pepicrft in [#859](https://github.com/tuist/XcodeProj/pull/859) ## [8.24.0] - 2024-09-27 ### Details -#### Feat +#### Features - Make `PBXProject.compatibilityVersion` optional and add `PBXProject.preferredProjectObjectVersion` to support Xcode 16 by @kimdv in [#854](https://github.com/tuist/XcodeProj/pull/854) -## [8.23.11] - 2024-09-27 -### Details -#### Chore -- Update dependency tuist to v4.28.1 by @renovate[bot] in [#858](https://github.com/tuist/XcodeProj/pull/858) - -## [8.23.10] - 2024-09-27 -### Details -#### Chore -- Update dependency tuist to v4.28.1 by @renovate[bot] in [#857](https://github.com/tuist/XcodeProj/pull/857) - ## [8.23.9] - 2024-09-27 ### Details -#### Fix +#### Bug Fixes - Order for `XCLocalSwiftPackageReference` and `XCRemoteSwiftPackageReference` by @kimdv in [#855](https://github.com/tuist/XcodeProj/pull/855) ## [8.23.8] - 2024-09-26 ### Details -#### Fix +#### Bug Fixes - Error: ambiguous use of 'arc4random_uniform' on Linux distros by @Howler4695 in [#846](https://github.com/tuist/XcodeProj/pull/846) ## New Contributors * @Howler4695 made their first contribution in [#846](https://github.com/tuist/XcodeProj/pull/846) -## [8.23.7] - 2024-09-19 -### Details -#### Chore -- Update dependency tuist to v4.27.0 by @renovate[bot] in [#856](https://github.com/tuist/XcodeProj/pull/856) - -## [8.23.6] - 2024-09-10 -### Details -#### Chore -- Update dependency apple/swift-docc-plugin to from: "1.4.3" by @renovate[bot] in [#853](https://github.com/tuist/XcodeProj/pull/853) - -## [8.23.5] - 2024-09-03 -### Details -#### Chore -- Update dependency tuist to v4.26.0 by @renovate[bot] in [#851](https://github.com/tuist/XcodeProj/pull/851) - -## [8.23.4] - 2024-08-29 -### Details -#### Chore -- Update dependency apple/swift-docc-plugin to from: "1.4.2" by @renovate[bot] in [#850](https://github.com/tuist/XcodeProj/pull/850) - -## [8.23.3] - 2024-08-27 -### Details -#### Chore -- Update dependency tuist to v4.25.0 by @renovate[bot] in [#849](https://github.com/tuist/XcodeProj/pull/849) - -## [8.23.2] - 2024-08-23 +## [8.23.0] - 2024-08-11 ### Details -#### Chore -- Update dependency apple/swift-docc-plugin to from: "1.4.1" by @renovate[bot] in [#848](https://github.com/tuist/XcodeProj/pull/848) +#### Documentation +- Add filipracki as a contributor for code by @allcontributors[bot] in [#832](https://github.com/tuist/XcodeProj/pull/832) -## [8.23.1] - 2024-08-19 -### Details -#### Chore -- Update dependency tuist to v4.24.0 by @renovate[bot] in [#844](https://github.com/tuist/XcodeProj/pull/844) +#### Features +- Introduce the new Xcode 16 models `PBXFileSystemSynchronizedRootGroup` and `PBXFileSystemSynchronizedBuildFileExceptionSet` by @pepicrft in [#827](https://github.com/tuist/XcodeProj/pull/827) -## [8.23.0] - 2024-08-11 -### Details -#### Chore +#### Miscellaneous Tasks - Continuously release releasable changes by @pepicrft in [#842](https://github.com/tuist/XcodeProj/pull/842) -- Update dependency tuist to v4.23.0 by @renovate[bot] in [#839](https://github.com/tuist/XcodeProj/pull/839) - Disable the renovatebot dashboard by @pepicrft in [#840](https://github.com/tuist/XcodeProj/pull/840) - Set up SwiftLint and SwiftFormat, run them against the project, and run them as part of the CI workflows by @pepicrft in [#836](https://github.com/tuist/XcodeProj/pull/836) -#### Docs -- Add filipracki as a contributor for code by @allcontributors[bot] in [#832](https://github.com/tuist/XcodeProj/pull/832) - -#### Feat -- Introduce the new Xcode 16 models `PBXFileSystemSynchronizedRootGroup` and `PBXFileSystemSynchronizedBuildFileExceptionSet` by @pepicrft in [#827](https://github.com/tuist/XcodeProj/pull/827) - -[8.27.5]: https://github.com/tuist/XcodeProj/compare/8.27.4..8.27.5 -[8.27.4]: https://github.com/tuist/XcodeProj/compare/8.27.3..8.27.4 -[8.27.3]: https://github.com/tuist/XcodeProj/compare/8.27.2..8.27.3 -[8.27.2]: https://github.com/tuist/XcodeProj/compare/8.27.1..8.27.2 -[8.27.1]: https://github.com/tuist/XcodeProj/compare/8.27.0..8.27.1 +[8.27.6]: https://github.com/tuist/XcodeProj/compare/8.27.5..8.27.6 [8.27.0]: https://github.com/tuist/XcodeProj/compare/8.26.8..8.27.0 [8.26.8]: https://github.com/tuist/XcodeProj/compare/8.26.7..8.26.8 -[8.26.7]: https://github.com/tuist/XcodeProj/compare/8.26.6..8.26.7 -[8.26.6]: https://github.com/tuist/XcodeProj/compare/8.26.5..8.26.6 [8.26.5]: https://github.com/tuist/XcodeProj/compare/8.26.4..8.26.5 [8.26.4]: https://github.com/tuist/XcodeProj/compare/8.26.3..8.26.4 -[8.26.3]: https://github.com/tuist/XcodeProj/compare/8.26.2..8.26.3 -[8.26.2]: https://github.com/tuist/XcodeProj/compare/8.26.1..8.26.2 -[8.26.1]: https://github.com/tuist/XcodeProj/compare/8.26.0..8.26.1 [8.26.0]: https://github.com/tuist/XcodeProj/compare/8.25.1..8.26.0 [8.25.1]: https://github.com/tuist/XcodeProj/compare/8.25.0..8.25.1 [8.25.0]: https://github.com/tuist/XcodeProj/compare/8.24.13..8.25.0 [8.24.13]: https://github.com/tuist/XcodeProj/compare/8.24.12..8.24.13 [8.24.12]: https://github.com/tuist/XcodeProj/compare/8.24.11..8.24.12 -[8.24.11]: https://github.com/tuist/XcodeProj/compare/8.24.10..8.24.11 [8.24.10]: https://github.com/tuist/XcodeProj/compare/8.24.9..8.24.10 -[8.24.9]: https://github.com/tuist/XcodeProj/compare/8.24.8..8.24.9 -[8.24.8]: https://github.com/tuist/XcodeProj/compare/8.24.7..8.24.8 -[8.24.7]: https://github.com/tuist/XcodeProj/compare/8.24.6..8.24.7 -[8.24.6]: https://github.com/tuist/XcodeProj/compare/8.24.5..8.24.6 -[8.24.5]: https://github.com/tuist/XcodeProj/compare/8.24.4..8.24.5 -[8.24.4]: https://github.com/tuist/XcodeProj/compare/8.24.3..8.24.4 -[8.24.3]: https://github.com/tuist/XcodeProj/compare/8.24.2..8.24.3 [8.24.2]: https://github.com/tuist/XcodeProj/compare/8.24.1..8.24.2 [8.24.1]: https://github.com/tuist/XcodeProj/compare/8.24.0..8.24.1 [8.24.0]: https://github.com/tuist/XcodeProj/compare/8.23.11..8.24.0 -[8.23.11]: https://github.com/tuist/XcodeProj/compare/8.23.10..8.23.11 -[8.23.10]: https://github.com/tuist/XcodeProj/compare/8.23.9..8.23.10 [8.23.9]: https://github.com/tuist/XcodeProj/compare/8.23.8..8.23.9 [8.23.8]: https://github.com/tuist/XcodeProj/compare/8.23.7..8.23.8 -[8.23.7]: https://github.com/tuist/XcodeProj/compare/8.23.6..8.23.7 -[8.23.6]: https://github.com/tuist/XcodeProj/compare/8.23.5..8.23.6 -[8.23.5]: https://github.com/tuist/XcodeProj/compare/8.23.4..8.23.5 -[8.23.4]: https://github.com/tuist/XcodeProj/compare/8.23.3..8.23.4 -[8.23.3]: https://github.com/tuist/XcodeProj/compare/8.23.2..8.23.3 -[8.23.2]: https://github.com/tuist/XcodeProj/compare/8.23.1..8.23.2 -[8.23.1]: https://github.com/tuist/XcodeProj/compare/8.23.0..8.23.1 [8.23.0]: https://github.com/tuist/XcodeProj/compare/8.22.0..8.23.0 From 06abb332f6e358f319d5e6f0111c07802b84d985 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 14 Mar 2025 23:01:29 +0000 Subject: [PATCH 441/678] chore(spm): update dependency tadija/aexml to from: "4.7.0" (#912) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- Package.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Package.swift b/Package.swift index 3511847a3..eb8e78af5 100644 --- a/Package.swift +++ b/Package.swift @@ -8,7 +8,7 @@ let package = Package( .library(name: "XcodeProj", targets: ["XcodeProj"]), ], dependencies: [ - .package(url: "https://github.com/tadija/AEXML.git", .upToNextMinor(from: "4.6.1")), + .package(url: "https://github.com/tadija/AEXML.git", .upToNextMinor(from: "4.7.0")), .package(url: "https://github.com/kylef/PathKit.git", .upToNextMinor(from: "1.0.1")), ], targets: [ From b1caa062d4aaab3e3d2bed5fe0ac5f8ce9bf84f4 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 14 Mar 2025 23:01:54 +0000 Subject: [PATCH 442/678] [Release] XcodeProj 8.27.7 --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 35307e864..c79d1aa63 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,11 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [8.27.7] - 2025-03-14 +### Details +#### Chore +- Update dependency tadija/aexml to from: "4.7.0" by @renovate[bot] in [#912](https://github.com/tuist/XcodeProj/pull/912) + ## [8.27.6] - 2025-03-14 ### Details #### Miscellaneous Tasks @@ -121,6 +126,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Disable the renovatebot dashboard by @pepicrft in [#840](https://github.com/tuist/XcodeProj/pull/840) - Set up SwiftLint and SwiftFormat, run them against the project, and run them as part of the CI workflows by @pepicrft in [#836](https://github.com/tuist/XcodeProj/pull/836) +[8.27.7]: https://github.com/tuist/XcodeProj/compare/8.27.6..8.27.7 [8.27.6]: https://github.com/tuist/XcodeProj/compare/8.27.5..8.27.6 [8.27.0]: https://github.com/tuist/XcodeProj/compare/8.26.8..8.27.0 [8.26.8]: https://github.com/tuist/XcodeProj/compare/8.26.7..8.26.8 From a9eb6af1d35c7a854adfcc42c7dd48c1f26371f1 Mon Sep 17 00:00:00 2001 From: Mike Simons Date: Mon, 17 Mar 2025 14:10:09 -0400 Subject: [PATCH 443/678] refactor!: strongly typed values in `BuildSettings` and `BuildFileSettings` (#903) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Introduce `BuildSetting` enum to enable strongly typed setting serialization * Migrate `BuildSettings` to use `BuildSetting` enum. * Remove unused method that was the result of another PR’s rebase. * Fix equality on `XCBuildConfiguration` * Update `PlistValue` to write `BuildSetting` correctly * Fix Tests * Fix tests This was fun. `NSDictionary(buildSettings)` is not able to be compared because we wrap swift values so we must use `==` on the swift types since they are not concrete and equatable. * Fix tests * Linting * Allow string literal interpolation * Convert `PBXBuildFile` settings to strong types. The settings here are constrained to two cases, one as a string and one as a string array as defined here: https://buck.build/javadoc/com/facebook/buck/apple/xcode/xcodeproj/PBXBuildFile.html Given the narrow use case we should constraint the available types here to fit the need. * Add tests * Linting * Fix pbxbuildfile equality * Add easy access to build setting values * Strongly typed classes tho these appear to always be empty * Strongly typed attributes XcodeGen introduced the ability to include whole `PBXObject` values within these dictionaries which end up being written to the project as their reference string value. In order to simplify the attributes interface, i’m removing that capability and consumers will need to do their own unwrapping. * linting * Convenience accessors for BuildFileSetting * Remove deprecated `parallelizable` * Silence sendability warnings * Conform `BuildSetting` to `CustomStringConvertible` * Extract `BuildFileSettings` to own file and convert tests to SwiftTesting * Extract ProjecteAttributes to own file * Delete commented code * Linting * Add bool bridging to `BuildSetting` * Update to Swift 6 * Update from `#file` to `#filePath` for swift 6 * Try to get the right swift version on linux * Maybe 6.0.3 fixes the issue * Migrate to `XCTUnwrap` to avoid `!` which will crash the test suite and not give an accurate failure count * Revert to 6.0.2 6.0.3 is not supported and also doesnt have a fix we need. * Fix tests * Exclude tests that need `plist` serialization from linux This need a fix that is in swift 6.1 to pass on linux: https://github.com/swiftlang/swift-foundation/pull/1002 * Lint fixes * moar linting * Add specific `targetReference` to `ProjectAttribute` Also removed `Encodable` conformance as we have a custom `plist` method that is used for writing. * Linting * Add Hashable and literal expressibility for Tuist Tests * Linting --- .github/workflows/xcodeproj.yml | 4 + Package.swift | 2 +- .../XcodeProj/Extensions/Path+Extras.swift | 2 +- .../Objects/BuildPhase/BuildFileSetting.swift | 55 + .../Objects/BuildPhase/PBXBuildFile.swift | 24 +- .../Objects/Configuration/BuildSettings.swift | 80 +- .../Configuration/XCBuildConfiguration.swift | 12 +- .../XcodeProj/Objects/Project/PBXProj.swift | 14 +- .../Objects/Project/PBXProject.swift | 37 +- .../Objects/Project/ProjectAttribute.swift | 55 + .../Objects/Sourcery/Equality.generated.swift | 8 +- .../Scheme/XCScheme+TestableReference.swift | 27 +- .../Utils/BuildSettingsProvider.swift | 13 +- Sources/XcodeProj/Utils/Decoders.swift | 4 +- Sources/XcodeProj/Utils/PlistValue.swift | 51 + Sources/XcodeProj/Utils/XCConfig.swift | 12 +- .../Extensions/XCTestCase+Assertions.swift | 2 +- .../BuildPhase/PBXBuildFileTests.swift | 16 + .../Configuration/BuildFileSettingTests.swift | 34 + .../Configuration/BuildSettingTests.swift | 49 + .../XCBuildConfigurationTests.swift | 10 +- .../Project/PBXOutputSettingsTests.swift | 518 ++++---- .../Objects/Project/PBXProj+Fixtures.swift | 2 +- .../Objects/Project/PBXProjEncoderTests.swift | 1082 +++++++++-------- .../Project/PBXProjIntegrationTests.swift | 151 +-- .../Objects/Project/PBXProjectTests.swift | 37 +- .../Project/XCBreakpointListTests.swift | 10 +- .../Project/XCUserDataTests.swift | 22 +- .../Project/XcodeProjIntegrationTests.swift | 221 ++-- .../XcodeProjTests/Scheme/XCSchemeTests.swift | 86 +- Tests/XcodeProjTests/Tests/Fixtures.swift | 2 +- Tests/XcodeProjTests/Tests/testWrite.swift | 16 +- .../Utils/BuildSettingsProviderTests.swift | 131 +- .../XcodeProjTests/Utils/XCConfigTests.swift | 34 +- .../Workspace/XCWorkspaceDataTests.swift | 4 +- 35 files changed, 1585 insertions(+), 1242 deletions(-) create mode 100644 Sources/XcodeProj/Objects/BuildPhase/BuildFileSetting.swift create mode 100644 Sources/XcodeProj/Objects/Project/ProjectAttribute.swift create mode 100644 Tests/XcodeProjTests/Objects/Configuration/BuildFileSettingTests.swift create mode 100644 Tests/XcodeProjTests/Objects/Configuration/BuildSettingTests.swift diff --git a/.github/workflows/xcodeproj.yml b/.github/workflows/xcodeproj.yml index dd16df6b0..591f2df6c 100644 --- a/.github/workflows/xcodeproj.yml +++ b/.github/workflows/xcodeproj.yml @@ -31,6 +31,8 @@ jobs: - uses: actions/checkout@v3 - uses: jdx/mise-action@v2 - uses: swift-actions/setup-swift@v2 + with: + swift-version: "6.0.2" - name: Build run: swift build --configuration release test: @@ -49,6 +51,8 @@ jobs: - uses: actions/checkout@v3 - uses: jdx/mise-action@v2 - uses: swift-actions/setup-swift@v2 + with: + swift-version: "6.0.2" - run: | git config --global user.email 'xcodeproj@tuist.dev' git config --global user.name 'xcodeproj' diff --git a/Package.swift b/Package.swift index eb8e78af5..fe5447e8e 100644 --- a/Package.swift +++ b/Package.swift @@ -1,4 +1,4 @@ -// swift-tools-version:5.10.0 +// swift-tools-version:6.0.0 import PackageDescription diff --git a/Sources/XcodeProj/Extensions/Path+Extras.swift b/Sources/XcodeProj/Extensions/Path+Extras.swift index 75d0f1547..4b76668eb 100644 --- a/Sources/XcodeProj/Extensions/Path+Extras.swift +++ b/Sources/XcodeProj/Extensions/Path+Extras.swift @@ -43,7 +43,7 @@ extension Path { let matchc = gt.gl_pathc #endif return (0 ..< Int(matchc)).compactMap { index in - if let path = String(validatingUTF8: gt.gl_pathv[index]!) { + if let path = String(validatingCString: gt.gl_pathv[index]!) { return Path(path) } return nil diff --git a/Sources/XcodeProj/Objects/BuildPhase/BuildFileSetting.swift b/Sources/XcodeProj/Objects/BuildPhase/BuildFileSetting.swift new file mode 100644 index 000000000..0c2a101f1 --- /dev/null +++ b/Sources/XcodeProj/Objects/BuildPhase/BuildFileSetting.swift @@ -0,0 +1,55 @@ +public enum BuildFileSetting: Sendable, Equatable, Hashable { + case string(String) + case array([String]) + + public var stringValue: String? { + if case let .string(value) = self { + value + } else { + nil + } + } + + public var arrayValue: [String]? { + if case let .array(value) = self { + value + } else { + nil + } + } +} + +extension BuildFileSetting: Codable { + public init(from decoder: Decoder) throws { + let container = try decoder.singleValueContainer() + do { + let string = try container.decode(String.self) + self = .string(string) + } catch { + let array = try container.decode([String].self) + self = .array(array) + } + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.singleValueContainer() + switch self { + case let .string(string): + try container.encode(string) + case let .array(array): + try container.encode(array) + } + } +} + +extension BuildFileSetting: ExpressibleByArrayLiteral { + public init(arrayLiteral elements: String...) { + self = .array(elements) + } +} + +extension BuildFileSetting: ExpressibleByStringInterpolation { + public init(stringLiteral value: StringLiteralType) { + self = .string(value) + } +} diff --git a/Sources/XcodeProj/Objects/BuildPhase/PBXBuildFile.swift b/Sources/XcodeProj/Objects/BuildPhase/PBXBuildFile.swift index 5bf89bc25..094132d79 100644 --- a/Sources/XcodeProj/Objects/BuildPhase/PBXBuildFile.swift +++ b/Sources/XcodeProj/Objects/BuildPhase/PBXBuildFile.swift @@ -31,7 +31,25 @@ public final class PBXBuildFile: PBXObject { } /// Element settings - public var settings: [String: Any]? + public var settings: [String: BuildFileSetting]? + + /// Potentially present for `PBXHeadersBuildPhase` : https://buck.build/javadoc/com/facebook/buck/apple/xcode/xcodeproj/PBXBuildFile.html + public var attributes: [String]? { + if case let .array(attributes) = settings?["ATTRIBUTES"] { + attributes + } else { + nil + } + } + + /// Potentially present for `PBXSourcesBuildPhase` : https://buck.build/javadoc/com/facebook/buck/apple/xcode/xcodeproj/PBXBuildFile.html + public var compilerFlags: String? { + if case let .string(compilerFlags) = settings?["COMPILER_FLAGS"] { + compilerFlags + } else { + nil + } + } /// Platform filter attribute. /// Introduced in: Xcode 11 @@ -53,7 +71,7 @@ public final class PBXBuildFile: PBXObject { /// - settings: build file settings. public init(file: PBXFileElement? = nil, product: XCSwiftPackageProductDependency? = nil, - settings: [String: Any]? = nil, + settings: [String: BuildFileSetting]? = nil, platformFilter: String? = nil, platformFilters: [String]? = nil) { fileReference = file?.reference @@ -84,7 +102,7 @@ public final class PBXBuildFile: PBXObject { if let productRefString: String = try container.decodeIfPresent(.productRef) { productReference = objectReferenceRepository.getOrCreate(reference: productRefString, objects: objects) } - settings = try container.decodeIfPresent([String: Any].self, forKey: .settings) + settings = try container.decodeIfPresent([String: BuildFileSetting].self, forKey: .settings) platformFilter = try container.decodeIfPresent(.platformFilter) platformFilters = try container.decodeIfPresent([String].self, forKey: .platformFilters) try super.init(from: decoder) diff --git a/Sources/XcodeProj/Objects/Configuration/BuildSettings.swift b/Sources/XcodeProj/Objects/Configuration/BuildSettings.swift index 066dbb50d..5ca94d202 100644 --- a/Sources/XcodeProj/Objects/Configuration/BuildSettings.swift +++ b/Sources/XcodeProj/Objects/Configuration/BuildSettings.swift @@ -1,4 +1,82 @@ import Foundation /// Build settings. -public typealias BuildSettings = [String: Any] +public typealias BuildSettings = [String: BuildSetting] + +private let yes = "YES" +private let no = "NO" + +public enum BuildSetting: Sendable, Equatable { + case string(String) + case array([String]) + + public var stringValue: String? { + if case let .string(value) = self { + value + } else { + nil + } + } + + public var boolValue: Bool? { + if case let .string(value) = self { + switch value { + case yes: true + case no: false + default: nil + } + } else { + nil + } + } + + public var arrayValue: [String]? { + if case let .array(value) = self { + value + } else { + nil + } + } +} + +extension BuildSetting: CustomStringConvertible { + public var description: String { + switch self { + case let .string(string): + string + case let .array(array): + array.joined(separator: " ") + } + } +} + +extension BuildSetting: Decodable { + public init(from decoder: Decoder) throws { + let container = try decoder.singleValueContainer() + do { + let string = try container.decode(String.self) + self = .string(string) + } catch { + let array = try container.decode([String].self) + self = .array(array) + } + } +} + +extension BuildSetting: ExpressibleByArrayLiteral { + public init(arrayLiteral elements: String...) { + self = .array(elements) + } +} + +extension BuildSetting: ExpressibleByStringInterpolation { + public init(stringLiteral value: StringLiteralType) { + self = .string(value) + } +} + +extension BuildSetting: ExpressibleByBooleanLiteral { + public init(booleanLiteral value: Bool) { + self = .string(value ? yes : no) + } +} diff --git a/Sources/XcodeProj/Objects/Configuration/XCBuildConfiguration.swift b/Sources/XcodeProj/Objects/Configuration/XCBuildConfiguration.swift index 71e05c3dc..159dc201c 100644 --- a/Sources/XcodeProj/Objects/Configuration/XCBuildConfiguration.swift +++ b/Sources/XcodeProj/Objects/Configuration/XCBuildConfiguration.swift @@ -59,7 +59,7 @@ public final class XCBuildConfiguration: PBXObject { } else { baseConfigurationReference = nil } - buildSettings = try container.decode([String: Any].self, forKey: .buildSettings) + buildSettings = try container.decode(BuildSettings.self, forKey: .buildSettings) name = try container.decode(.name) try super.init(from: decoder) } @@ -75,16 +75,16 @@ public final class XCBuildConfiguration: PBXObject { public func append(setting name: String, value: String) { guard !value.isEmpty else { return } - let existing: Any = buildSettings[name] ?? "$(inherited)" + let existing: BuildSetting = buildSettings[name] ?? "$(inherited)" switch existing { - case let string as String where string != value: + case let .string(string) where string != value: let newValue = [string, value].joined(separator: " ") - buildSettings[name] = newValue - case let array as [String]: + buildSettings[name] = .string(newValue) + case let .array(array): var newValue = array newValue.append(value) - buildSettings[name] = newValue.uniqued() + buildSettings[name] = .array(newValue.uniqued()) default: break } diff --git a/Sources/XcodeProj/Objects/Project/PBXProj.swift b/Sources/XcodeProj/Objects/Project/PBXProj.swift index 78e6da101..c8faeb274 100644 --- a/Sources/XcodeProj/Objects/Project/PBXProj.swift +++ b/Sources/XcodeProj/Objects/Project/PBXProj.swift @@ -14,7 +14,8 @@ public final class PBXProj: Decodable { public var objectVersion: UInt /// Project classes. - public var classes: [String: Any] + /// This appears to always be empty as defined here: http://www.monobjc.net/xcode-project-file-format.html + public var classes: [String: [String]] /// Project root object. var rootObjectReference: PBXObjectReference? @@ -40,7 +41,7 @@ public final class PBXProj: Decodable { public init(rootObject: PBXProject? = nil, objectVersion: UInt = Xcode.LastKnown.objectVersion, archiveVersion: UInt = Xcode.LastKnown.archiveVersion, - classes: [String: Any] = [:], + classes: [String: [String]] = [:], objects: [PBXObject] = []) { self.archiveVersion = archiveVersion self.objectVersion = objectVersion @@ -88,7 +89,7 @@ public final class PBXProj: Decodable { rootObject: PBXProject? = nil, objectVersion: UInt = Xcode.LastKnown.objectVersion, archiveVersion: UInt = Xcode.LastKnown.archiveVersion, - classes: [String: Any] = [:], + classes: [String: [String]] = [:], objects: PBXObjects ) { self.archiveVersion = archiveVersion @@ -116,7 +117,7 @@ public final class PBXProj: Decodable { self.rootObjectReference = objectReferenceRepository.getOrCreate(reference: rootObjectReference, objects: objects) objectVersion = try container.decodeIntIfPresent(.objectVersion) ?? 0 archiveVersion = try container.decodeIntIfPresent(.archiveVersion) ?? 1 - classes = try container.decodeIfPresent([String: Any].self, forKey: .classes) ?? [:] + classes = try container.decodeIfPresent([String: [String]].self, forKey: .classes) ?? [:] let objectsDictionary: [String: PBXObjectDictionaryEntry] = try container.decodeIfPresent([String: PBXObjectDictionaryEntry].self, forKey: .objects) ?? [:] for entry in objectsDictionary { @@ -261,10 +262,9 @@ extension PBXProj { extension PBXProj: Equatable { public static func == (lhs: PBXProj, rhs: PBXProj) -> Bool { - let equalClasses = NSDictionary(dictionary: lhs.classes).isEqual(to: rhs.classes) - return lhs.archiveVersion == rhs.archiveVersion && + lhs.archiveVersion == rhs.archiveVersion && lhs.objectVersion == rhs.objectVersion && - equalClasses && + lhs.classes == rhs.classes && lhs.objects == rhs.objects } } diff --git a/Sources/XcodeProj/Objects/Project/PBXProject.swift b/Sources/XcodeProj/Objects/Project/PBXProject.swift index 8e8ddcab5..85b3cae41 100644 --- a/Sources/XcodeProj/Objects/Project/PBXProject.swift +++ b/Sources/XcodeProj/Objects/Project/PBXProject.swift @@ -108,20 +108,20 @@ public final class PBXProject: PBXObject { /// Project attributes. /// Target attributes will be merged into this - public var attributes: [String: Any] + public var attributes: [String: ProjectAttribute] /// Target attribute references. - var targetAttributeReferences: [PBXObjectReference: [String: Any]] + var targetAttributeReferences: [PBXObjectReference: [String: ProjectAttribute]] /// Target attributes. - public var targetAttributes: [PBXTarget: [String: Any]] { + public var targetAttributes: [PBXTarget: [String: ProjectAttribute]] { set { targetAttributeReferences = [:] for item in newValue { targetAttributeReferences[item.key.reference] = item.value } } get { - var attributes: [PBXTarget: [String: Any]] = [:] + var attributes: [PBXTarget: [String: ProjectAttribute]] = [:] for targetAttributeReference in targetAttributeReferences { if let object: PBXTarget = targetAttributeReference.key.getObject() { attributes[object] = targetAttributeReference.value @@ -176,7 +176,7 @@ public final class PBXProject: PBXObject { /// - Parameters: /// - attributes: attributes that will be set. /// - target: target. - public func setTargetAttributes(_ attributes: [String: Any], target: PBXTarget) { + public func setTargetAttributes(_ attributes: [String: ProjectAttribute], target: PBXTarget) { targetAttributeReferences[target.reference] = attributes } @@ -321,8 +321,8 @@ public final class PBXProject: PBXObject { projectRoots: [String] = [], targets: [PBXTarget] = [], packages: [XCRemoteSwiftPackageReference] = [], - attributes: [String: Any] = [:], - targetAttributes: [PBXTarget: [String: Any]] = [:]) { + attributes: [String: ProjectAttribute] = [:], + targetAttributes: [PBXTarget: [String: ProjectAttribute]] = [:]) { self.name = name buildConfigurationListReference = buildConfigurationList.reference self.compatibilityVersion = compatibilityVersion @@ -417,10 +417,12 @@ public final class PBXProject: PBXObject { let packageRefeferenceStrings: [String] = try container.decodeIfPresent(.packageReferences) ?? [] packageReferences = packageRefeferenceStrings.map { referenceRepository.getOrCreate(reference: $0, objects: objects) } - var attributes = try (container.decodeIfPresent([String: Any].self, forKey: .attributes) ?? [:]) - var targetAttributeReferences: [PBXObjectReference: [String: Any]] = [:] - if let targetAttributes = attributes[PBXProject.targetAttributesKey] as? [String: [String: Any]] { - targetAttributes.forEach { targetAttributeReferences[referenceRepository.getOrCreate(reference: $0.key, objects: objects)] = $0.value } + var attributes = try (container.decodeIfPresent([String: ProjectAttribute].self, forKey: .attributes) ?? [:]) + var targetAttributeReferences: [PBXObjectReference: [String: ProjectAttribute]] = [:] + if case let .attributeDictionary(targetAttributes) = attributes[PBXProject.targetAttributesKey] { + for targetAttribute in targetAttributes { + targetAttributeReferences[referenceRepository.getOrCreate(reference: targetAttribute.key, objects: objects)] = targetAttribute.value + } attributes[PBXProject.targetAttributesKey] = nil } self.attributes = attributes @@ -562,16 +564,17 @@ extension PBXProject: PlistSerializable { dictionary["packageReferences"] = PlistValue.array(finalPackageReferences) } - var plistAttributes: [String: Any] = attributes + var plistAttributes: [String: ProjectAttribute] = attributes // merge target attributes - var plistTargetAttributes: [String: Any] = [:] + var plistTargetAttributes: [String: [String: ProjectAttribute]] = [:] for (reference, value) in targetAttributeReferences { - plistTargetAttributes[reference.value] = value.mapValues { value in - (value as? PBXObject)?.reference.value ?? value - } + plistTargetAttributes[reference.value] = value + } + + if !plistTargetAttributes.isEmpty { + plistAttributes[PBXProject.targetAttributesKey] = .attributeDictionary(plistTargetAttributes) } - plistAttributes[PBXProject.targetAttributesKey] = plistTargetAttributes.isEmpty ? nil : plistTargetAttributes dictionary["attributes"] = plistAttributes.plist() diff --git a/Sources/XcodeProj/Objects/Project/ProjectAttribute.swift b/Sources/XcodeProj/Objects/Project/ProjectAttribute.swift new file mode 100644 index 000000000..02a78f1d7 --- /dev/null +++ b/Sources/XcodeProj/Objects/Project/ProjectAttribute.swift @@ -0,0 +1,55 @@ +public enum ProjectAttribute: Equatable { + case string(String) + case array([String]) + case targetReference(PBXObject) + case attributeDictionary([String: [String: ProjectAttribute]]) + + public var stringValue: String? { + if case let .string(value) = self { + value + } else { + nil + } + } + + public var arrayValue: [String]? { + if case let .array(value) = self { + value + } else { + nil + } + } +} + +extension ProjectAttribute: Decodable { + public init(from decoder: Decoder) throws { + let container = try decoder.singleValueContainer() + + if let string = try? container.decode(String.self) { + self = .string(string) + } else if let array = try? container.decode([String].self) { + self = .array(array) + } else { + let targetAttributes = try container.decode([String: [String: ProjectAttribute]].self) + self = .attributeDictionary(targetAttributes) + } + } +} + +extension ProjectAttribute: ExpressibleByArrayLiteral { + public init(arrayLiteral elements: String...) { + self = .array(elements) + } +} + +extension ProjectAttribute: ExpressibleByStringInterpolation { + public init(stringLiteral value: StringLiteralType) { + self = .string(value) + } +} + +extension ProjectAttribute: ExpressibleByDictionaryLiteral { + public init(dictionaryLiteral elements: (String, [String: ProjectAttribute])...) { + self = .attributeDictionary(Dictionary(uniqueKeysWithValues: elements)) + } +} diff --git a/Sources/XcodeProj/Objects/Sourcery/Equality.generated.swift b/Sources/XcodeProj/Objects/Sourcery/Equality.generated.swift index b8087736f..cd69699a9 100644 --- a/Sources/XcodeProj/Objects/Sourcery/Equality.generated.swift +++ b/Sources/XcodeProj/Objects/Sourcery/Equality.generated.swift @@ -15,7 +15,7 @@ extension PBXBuildFile { func isEqual(to rhs: PBXBuildFile) -> Bool { if fileReference != rhs.fileReference { return false } if productReference != rhs.productReference { return false } - if !NSDictionary(dictionary: settings ?? [:]).isEqual(NSDictionary(dictionary: rhs.settings ?? [:])) { return false } + if settings != rhs.settings { return false } if platformFilter != rhs.platformFilter { return false } if buildPhase != rhs.buildPhase { return false } return super.isEqual(to: rhs) @@ -166,8 +166,8 @@ extension PBXProject { if projectReferences != rhs.projectReferences { return false } if projectRoots != rhs.projectRoots { return false } if targetReferences != rhs.targetReferences { return false } - if !NSDictionary(dictionary: attributes).isEqual(NSDictionary(dictionary: rhs.attributes)) { return false } - if !NSDictionary(dictionary: targetAttributeReferences).isEqual(NSDictionary(dictionary: rhs.targetAttributeReferences)) { return false } + if attributes != rhs.attributes { return false } + if targetAttributeReferences != rhs.targetAttributeReferences { return false } if packageReferences != rhs.packageReferences { return false } if remotePackages != rhs.remotePackages { return false } if localPackages != rhs.localPackages { return false } @@ -259,7 +259,7 @@ extension XCBuildConfiguration { /// :nodoc: func isEqual(to rhs: XCBuildConfiguration) -> Bool { if baseConfigurationReference != rhs.baseConfigurationReference { return false } - if !NSDictionary(dictionary: buildSettings).isEqual(NSDictionary(dictionary: rhs.buildSettings)) { return false } + if buildSettings != rhs.buildSettings { return false } if name != rhs.name { return false } return super.isEqual(to: rhs) } diff --git a/Sources/XcodeProj/Scheme/XCScheme+TestableReference.swift b/Sources/XcodeProj/Scheme/XCScheme+TestableReference.swift index da8f87c44..f6b6a4b42 100644 --- a/Sources/XcodeProj/Scheme/XCScheme+TestableReference.swift +++ b/Sources/XcodeProj/Scheme/XCScheme+TestableReference.swift @@ -6,12 +6,6 @@ public extension XCScheme { // MARK: - Attributes public var skipped: Bool - @available(*, deprecated, message: "Please use parallelization property instead") - public var parallelizable: Bool { - get { parallelization == .swiftTestingOnly } - set { parallelization = newValue ? .swiftTestingOnly : .none } - } - public var parallelization: TestParallelization public var randomExecutionOrdering: Bool public var useTestSelectionWhitelist: Bool? @@ -40,25 +34,6 @@ public extension XCScheme { self.skippedTests = skippedTests } - @available(*, deprecated, message: "Use init with Parallelization argument instead") - public init(skipped: Bool, - parallelizable: Bool = false, - randomExecutionOrdering: Bool = false, - buildableReference: BuildableReference, - locationScenarioReference: LocationScenarioReference? = nil, - skippedTests: [TestItem] = [], - selectedTests: [TestItem] = [], - useTestSelectionWhitelist: Bool? = nil) { - self.skipped = skipped - parallelization = parallelizable ? .swiftTestingOnly : .none - self.randomExecutionOrdering = randomExecutionOrdering - self.buildableReference = buildableReference - self.locationScenarioReference = locationScenarioReference - self.useTestSelectionWhitelist = useTestSelectionWhitelist - self.selectedTests = selectedTests - self.skippedTests = skippedTests - } - init(element: AEXMLElement) throws { skipped = element.attributes["skipped"] == "YES" @@ -139,7 +114,7 @@ public extension XCScheme { public static func == (lhs: TestableReference, rhs: TestableReference) -> Bool { lhs.skipped == rhs.skipped && - lhs.parallelizable == rhs.parallelizable && + lhs.parallelization == rhs.parallelization && lhs.randomExecutionOrdering == rhs.randomExecutionOrdering && lhs.buildableReference == rhs.buildableReference && lhs.locationScenarioReference == rhs.locationScenarioReference && diff --git a/Sources/XcodeProj/Utils/BuildSettingsProvider.swift b/Sources/XcodeProj/Utils/BuildSettingsProvider.swift index f348d2ad1..71a4d59ca 100644 --- a/Sources/XcodeProj/Utils/BuildSettingsProvider.swift +++ b/Sources/XcodeProj/Utils/BuildSettingsProvider.swift @@ -46,7 +46,7 @@ public class BuildSettingsProvider { /// - swift: true if the target contains Swift code. /// - Returns: build settings. public static func targetDefault(variant: Variant? = nil, platform: Platform?, product: Product?, swift: Bool? = nil) -> BuildSettings { - var buildSettings: [String: Any] = [:] + var buildSettings: BuildSettings = [:] if let platform { buildSettings.merge(targetSettings(platform: platform), uniquingKeysWith: { $1 }) @@ -375,17 +375,6 @@ public class BuildSettingsProvider { [:] } } - - private static func targetSwiftSettings(platform: Platform, product: Product) -> BuildSettings { - switch (platform, product) { - case (.watchOS, .application): - [ - "ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES": "YES", - ] - default: - [:] - } - } } // Overloading `~=` enables customizing switch statement pattern matching diff --git a/Sources/XcodeProj/Utils/Decoders.swift b/Sources/XcodeProj/Utils/Decoders.swift index e0cb19b43..31b610065 100644 --- a/Sources/XcodeProj/Utils/Decoders.swift +++ b/Sources/XcodeProj/Utils/Decoders.swift @@ -46,7 +46,7 @@ extension CodingUserInfoKey { } /// Xcodeproj JSON decoder. -class XcodeprojJSONDecoder: JSONDecoder { +final class XcodeprojJSONDecoder: JSONDecoder, @unchecked Sendable { /// Default init. init(context: ProjectDecodingContext = ProjectDecodingContext()) { super.init() @@ -55,7 +55,7 @@ class XcodeprojJSONDecoder: JSONDecoder { } /// Xcodeproj property list decoder. -class XcodeprojPropertyListDecoder: PropertyListDecoder { +final class XcodeprojPropertyListDecoder: PropertyListDecoder, @unchecked Sendable { /// Default init. init(context: ProjectDecodingContext = ProjectDecodingContext()) { super.init() diff --git a/Sources/XcodeProj/Utils/PlistValue.swift b/Sources/XcodeProj/Utils/PlistValue.swift index 92e2e8efe..432a04b29 100644 --- a/Sources/XcodeProj/Utils/PlistValue.swift +++ b/Sources/XcodeProj/Utils/PlistValue.swift @@ -85,6 +85,55 @@ extension PlistValue: Equatable { // MARK: - Dictionary Extension (PlistValue) +extension [String: BuildSetting] { + func plist() -> PlistValue { + var dictionary: [CommentedString: PlistValue] = [:] + forEach { key, value in + switch value { + case let .string(stringValue): + dictionary[CommentedString(key)] = PlistValue.string(CommentedString(stringValue)) + case let .array(arrayValue): + dictionary[CommentedString(key)] = arrayValue.plist() + } + } + return .dictionary(dictionary) + } +} + +extension [String: BuildFileSetting] { + func plist() -> PlistValue { + var dictionary: [CommentedString: PlistValue] = [:] + forEach { key, value in + switch value { + case let .string(stringValue): + dictionary[CommentedString(key)] = PlistValue.string(CommentedString(stringValue)) + case let .array(arrayValue): + dictionary[CommentedString(key)] = arrayValue.plist() + } + } + return .dictionary(dictionary) + } +} + +extension [String: ProjectAttribute] { + func plist() -> PlistValue { + var dictionary: [CommentedString: PlistValue] = [:] + forEach { key, value in + switch value { + case let .string(stringValue): + dictionary[CommentedString(key)] = PlistValue.string(CommentedString(stringValue)) + case let .array(arrayValue): + dictionary[CommentedString(key)] = arrayValue.plist() + case let .attributeDictionary(attributes): + dictionary[CommentedString(key)] = attributes.mapValues { $0.plist() }.plist() + case let .targetReference(object): + dictionary[CommentedString(key)] = .string(CommentedString(object.reference.value)) + } + } + return .dictionary(dictionary) + } +} + extension Dictionary where Key == String { func plist() -> PlistValue { var dictionary: [CommentedString: PlistValue] = [:] @@ -95,6 +144,8 @@ extension Dictionary where Key == String { dictionary[CommentedString(key)] = subDictionary.plist() } else if let string = value as? CustomStringConvertible { dictionary[CommentedString(key)] = .string(CommentedString(string.description)) + } else if let plistValue = value as? PlistValue { + dictionary[CommentedString(key)] = plistValue } } return .dictionary(dictionary) diff --git a/Sources/XcodeProj/Utils/XCConfig.swift b/Sources/XcodeProj/Utils/XCConfig.swift index e1e585ea6..639f6c1b0 100644 --- a/Sources/XcodeProj/Utils/XCConfig.swift +++ b/Sources/XcodeProj/Utils/XCConfig.swift @@ -35,10 +35,10 @@ public final class XCConfig { let fileLines = try path.read().components(separatedBy: "\n") includes = fileLines .compactMap(XCConfigParser.configFrom(path: path, projectPath: projectPath)) - var buildSettings: [String: String] = [:] + var buildSettings: BuildSettings = [:] fileLines .compactMap(XCConfigParser.settingFrom) - .forEach { buildSettings[$0.key] = $0.value } + .forEach { buildSettings[$0.key] = .string($0.value) } self.buildSettings = buildSettings } } @@ -62,7 +62,7 @@ enum XCConfigParser { } return nil } - .compactMap { pathString in + .compactMap { pathString -> (include: Path, config: XCConfig)? in let includePath: Path = .init(pathString) var config: XCConfig? do { @@ -114,7 +114,7 @@ extension XCConfig: Equatable { return false } } - return NSDictionary(dictionary: lhs.buildSettings).isEqual(to: rhs.buildSettings) + return lhs.buildSettings == rhs.buildSettings } } @@ -124,8 +124,8 @@ public extension XCConfig { /// It returns the build settings after flattening all the includes. /// /// - Returns: build settings flattening all the includes. - func flattenedBuildSettings() -> [String: Any] { - var content: [String: Any] = buildSettings + func flattenedBuildSettings() -> [String: BuildSetting] { + var content: [String: BuildSetting] = buildSettings includes .map(\.1) .flattened() diff --git a/Tests/XcodeProjTests/Extensions/XCTestCase+Assertions.swift b/Tests/XcodeProjTests/Extensions/XCTestCase+Assertions.swift index 9d1330dd1..a9b989716 100644 --- a/Tests/XcodeProjTests/Extensions/XCTestCase+Assertions.swift +++ b/Tests/XcodeProjTests/Extensions/XCTestCase+Assertions.swift @@ -12,7 +12,7 @@ extension XCTestCase { return unwrappedObj } - func XCTAssertThrowsSpecificError(_ expression: @autoclosure () throws -> some Any, _ error: E, _ message: @autoclosure () -> String = "", file: StaticString = #file, line: UInt = #line) { + func XCTAssertThrowsSpecificError(_ expression: @autoclosure () throws -> some Any, _ error: E, _ message: @autoclosure () -> String = "", file: StaticString = #filePath, line: UInt = #line) { XCTAssertThrowsError(try expression(), message(), file: file, line: line) { actualError in let message = "Expected \(error) got \(actualError)" diff --git a/Tests/XcodeProjTests/Objects/BuildPhase/PBXBuildFileTests.swift b/Tests/XcodeProjTests/Objects/BuildPhase/PBXBuildFileTests.swift index 5dbd1cd22..63686a756 100644 --- a/Tests/XcodeProjTests/Objects/BuildPhase/PBXBuildFileTests.swift +++ b/Tests/XcodeProjTests/Objects/BuildPhase/PBXBuildFileTests.swift @@ -13,4 +13,20 @@ final class PBXBuildFileTests: XCTestCase { ) XCTAssertEqual(pbxBuildFile.platformFilter, "platformFilter") } + + func test_platformCompilerFlagsIsSet() { + let expected = "flagValue" + let pbxBuildFile = PBXBuildFile( + settings: ["COMPILER_FLAGS": .string(expected)] + ) + XCTAssertEqual(pbxBuildFile.compilerFlags, expected) + } + + func test_platformAttributesIsSet() { + let expected = ["Public"] + let pbxBuildFile = PBXBuildFile( + settings: ["ATTRIBUTES": .array(expected)] + ) + XCTAssertEqual(pbxBuildFile.attributes, expected) + } } diff --git a/Tests/XcodeProjTests/Objects/Configuration/BuildFileSettingTests.swift b/Tests/XcodeProjTests/Objects/Configuration/BuildFileSettingTests.swift new file mode 100644 index 000000000..5064f56e2 --- /dev/null +++ b/Tests/XcodeProjTests/Objects/Configuration/BuildFileSettingTests.swift @@ -0,0 +1,34 @@ +import Foundation +import Testing +@testable import XcodeProj + +struct BuildFileSettingTests { + @Test func test_BuildSettings_encodes_to_JSON() async throws { + let expectedJSON = #"{"one":"one","two":["two","two"]}"# + + let settings: [String: BuildFileSetting] = [ + "one": .string("one"), + "two": .array(["two", "two"]), + ] + + let encoder = JSONEncoder() + encoder.outputFormatting = .sortedKeys + + let result = try encoder.encode(settings) + + #expect(result == expectedJSON.data(using: .utf8)) + } + + @Test func test_buildSettings_decodes_from_JSON() async throws { + let json = #"{"one":"one","two":["two","two"]}"# + + let expectedSettings: [String: BuildFileSetting] = [ + "one": .string("one"), + "two": .array(["two", "two"]), + ] + + let result = try JSONDecoder().decode([String: BuildFileSetting].self, from: json.data(using: .utf8)!) + + #expect(result == expectedSettings) + } +} diff --git a/Tests/XcodeProjTests/Objects/Configuration/BuildSettingTests.swift b/Tests/XcodeProjTests/Objects/Configuration/BuildSettingTests.swift new file mode 100644 index 000000000..5842a0a7c --- /dev/null +++ b/Tests/XcodeProjTests/Objects/Configuration/BuildSettingTests.swift @@ -0,0 +1,49 @@ +import Foundation +import Testing +@testable import XcodeProj + +struct BuildSettingTests { + @Test func test_BuildSettings_encode_to_string() async throws { + #expect(BuildSetting.string("one").description == "one") + #expect(BuildSetting.array(["one", "two"]).description == "one two") + } + + @Test func test_buildSettings_decodes_from_JSON() async throws { + let json = #"{"one":"one","two":["two","two"]}"# + + let expectedSettings: BuildSettings = [ + "one": .string("one"), + "two": .array(["two", "two"]), + ] + + let result = try JSONDecoder().decode(BuildSettings.self, from: json.data(using: .utf8)!) + + #expect(result == expectedSettings) + } + + @Test func test_buildSettings_bool_conversion() async throws { + let settings: [BuildSetting] = [ + BuildSetting.string("YES"), + BuildSetting.string("NO"), + BuildSetting.string("tuist"), + BuildSetting.string("No"), + BuildSetting.string("yES"), + BuildSetting.array(["YES", "yES"]), + true, + false, + ] + + let expected: [Bool?] = [ + true, + false, + nil, + nil, + nil, + nil, + true, + false, + ] + + #expect(settings.map(\.boolValue) == expected) + } +} diff --git a/Tests/XcodeProjTests/Objects/Configuration/XCBuildConfigurationTests.swift b/Tests/XcodeProjTests/Objects/Configuration/XCBuildConfigurationTests.swift index c818562b8..e29ef2d54 100644 --- a/Tests/XcodeProjTests/Objects/Configuration/XCBuildConfigurationTests.swift +++ b/Tests/XcodeProjTests/Objects/Configuration/XCBuildConfigurationTests.swift @@ -28,7 +28,7 @@ final class XCBuildConfigurationTests: XCTestCase { subject.append(setting: "PRODUCT_NAME", value: "$(TARGET_NAME:c99extidentifier)") // Then - XCTAssertEqual(subject.buildSettings["PRODUCT_NAME"] as? String, "$(inherited) $(TARGET_NAME:c99extidentifier)") + XCTAssertEqual(subject.buildSettings["PRODUCT_NAME"], "$(inherited) $(TARGET_NAME:c99extidentifier)") } func test_append_when_theSettingExists() { @@ -41,7 +41,7 @@ final class XCBuildConfigurationTests: XCTestCase { subject.append(setting: "OTHER_LDFLAGS", value: "flag2") // Then - XCTAssertEqual(subject.buildSettings["OTHER_LDFLAGS"] as? String, "flag1 flag2") + XCTAssertEqual(subject.buildSettings["OTHER_LDFLAGS"], "flag1 flag2") } func test_append_when_duplicateSettingExists() { @@ -54,7 +54,7 @@ final class XCBuildConfigurationTests: XCTestCase { subject.append(setting: "OTHER_LDFLAGS", value: "flag1") // Then - XCTAssertEqual(subject.buildSettings["OTHER_LDFLAGS"] as? String, "flag1") + XCTAssertEqual(subject.buildSettings["OTHER_LDFLAGS"], "flag1") } func test_append_removesDuplicates_when_theSettingIsAnArray() { @@ -69,7 +69,7 @@ final class XCBuildConfigurationTests: XCTestCase { subject.append(setting: "OTHER_LDFLAGS", value: "flag1") // Then - XCTAssertEqual(subject.buildSettings["OTHER_LDFLAGS"] as? [String], ["flag1", "flag2"]) + XCTAssertEqual(subject.buildSettings["OTHER_LDFLAGS"], ["flag1", "flag2"]) } func test_append_when_theSettingExistsAsAnArray() { @@ -82,7 +82,7 @@ final class XCBuildConfigurationTests: XCTestCase { subject.append(setting: "OTHER_LDFLAGS", value: "flag3") // Then - XCTAssertEqual(subject.buildSettings["OTHER_LDFLAGS"] as? [String], ["flag1", "flag2", "flag3"]) + XCTAssertEqual(subject.buildSettings["OTHER_LDFLAGS"], ["flag1", "flag2", "flag3"]) } private func testDictionary() -> [String: Any] { diff --git a/Tests/XcodeProjTests/Objects/Project/PBXOutputSettingsTests.swift b/Tests/XcodeProjTests/Objects/Project/PBXOutputSettingsTests.swift index 9e4813b95..dfc935bed 100644 --- a/Tests/XcodeProjTests/Objects/Project/PBXOutputSettingsTests.swift +++ b/Tests/XcodeProjTests/Objects/Project/PBXOutputSettingsTests.swift @@ -1,276 +1,278 @@ +#if os(macOS) || (os(Linux) && compiler(>=6.1)) -import XCTest -@testable import XcodeProj + import XCTest + @testable import XcodeProj -class PBXOutputSettingsTests: XCTestCase { - // MARK: - PBXFileOrder - PBXBuldFile + class PBXOutputSettingsTests: XCTestCase { + // MARK: - PBXFileOrder - PBXBuldFile - func test_PBXFileOrder_PBXBuildFile_by_uuid_when_iosProject() { - let iosProject = iosProject() + func test_PBXFileOrder_PBXBuildFile_by_uuid_when_iosProject() throws { + let iosProject = try iosProject() - XCTAssertFalse(PBXFileOrder.byUUID.sort(lhs: iosProject.objectBuildFileAssets, rhs: iosProject.objectBuildFileMain)) - XCTAssertTrue(PBXFileOrder.byUUID.sort(lhs: iosProject.objectBuildFileMain, rhs: iosProject.objectBuildFileAssets)) - } - - func test_PBXFileOrder_PBXBuildFile_by_filename_when_iosProject() { - let iosProject = iosProject() - - XCTAssertTrue(PBXFileOrder.byFilename.sort(lhs: iosProject.objectBuildFileAssets, rhs: iosProject.objectBuildFileMain)) - XCTAssertFalse(PBXFileOrder.byFilename.sort(lhs: iosProject.objectBuildFileMain, rhs: iosProject.objectBuildFileAssets)) - } - - func test_PBXFileOrder_PBXBuildFile_by_filename_when_fileSharedAcrossTargetsProject() { - let fileSharedAcrossTargetsProject = fileSharedAcrossTargetsProject() - - let sameNameByFilename = fileSharedAcrossTargetsProject.objectBuildFileSameName.sorted(by: PBXFileOrder.byFilename.sort) - XCTAssertLessThan(sameNameByFilename.first!.1.uuid, sameNameByFilename.last!.1.uuid) - } - - func test_PBXFileOrder_PBXBuildFile_by_filename_when_nil_name_and_path_when_iosProject() { - let iosProject = iosProject() - - iosProject.buildFileAssets.file?.name = nil - iosProject.buildFileMain.file?.name = nil - iosProject.buildFileAssets.file?.path = nil - iosProject.buildFileMain.file?.path = nil - XCTAssertFalse(PBXFileOrder.byFilename.sort(lhs: iosProject.objectBuildFileAssets, rhs: iosProject.objectBuildFileMain)) - XCTAssertTrue(PBXFileOrder.byFilename.sort(lhs: iosProject.objectBuildFileMain, rhs: iosProject.objectBuildFileAssets)) - } - - func test_PBXFileOrder_PBXBuildFile_by_filename_when_no_file_when_iosProject() { - let iosProject = iosProject() - - let ref1 = iosProject.buildFileAssets.reference - let ref2 = iosProject.buildFileMain.reference - iosProject.buildFileAssets.file = nil - iosProject.buildFileMain.file = nil - XCTAssertFalse(PBXFileOrder.byFilename.sort(lhs: (ref1, iosProject.buildFileAssets), rhs: (ref2, iosProject.buildFileMain))) - XCTAssertTrue(PBXFileOrder.byFilename.sort(lhs: (ref2, iosProject.buildFileMain), rhs: (ref1, iosProject.buildFileAssets))) - } - - // MARK: - PBXFileOrder - PBXBuildPhaseFile + XCTAssertFalse(PBXFileOrder.byUUID.sort(lhs: iosProject.objectBuildFileAssets, rhs: iosProject.objectBuildFileMain)) + XCTAssertTrue(PBXFileOrder.byUUID.sort(lhs: iosProject.objectBuildFileMain, rhs: iosProject.objectBuildFileAssets)) + } - func test_PBXFileOrder_PBXBuildPhaseFile_by_uuid_when_iosProject() { - let iosProject = iosProject() + func test_PBXFileOrder_PBXBuildFile_by_filename_when_iosProject() throws { + let iosProject = try iosProject() - XCTAssertFalse(PBXFileOrder.byUUID.sort(lhs: iosProject.objectBuildPhaseFileAssets, rhs: iosProject.objectBuildPhaseFileMain)) - XCTAssertTrue(PBXFileOrder.byUUID.sort(lhs: iosProject.objectBuildPhaseFileMain, rhs: iosProject.objectBuildPhaseFileAssets)) - } - - func test_PBXFileOrder_PBXBuildPhaseFile_by_filename_when_iosProject() { - let iosProject = iosProject() - - XCTAssertTrue(PBXFileOrder.byFilename.sort(lhs: iosProject.objectBuildPhaseFileAssets, rhs: iosProject.objectBuildPhaseFileMain)) - XCTAssertFalse(PBXFileOrder.byFilename.sort(lhs: iosProject.objectBuildPhaseFileMain, rhs: iosProject.objectBuildPhaseFileAssets)) - } - - // MARK: - PBXFileOrder - PBXFileReference - - func test_PBXFileOrder_PBXFileReference_by_uuid_when_iosProject() { - let iosProject = iosProject() - - XCTAssertFalse(PBXFileOrder.byUUID.sort(lhs: iosProject.objectFileReferenceAssets, rhs: iosProject.objectFileReferenceCoreData)) - XCTAssertTrue(PBXFileOrder.byUUID.sort(lhs: iosProject.objectFileReferenceCoreData, rhs: iosProject.objectFileReferenceAssets)) - } + XCTAssertTrue(PBXFileOrder.byFilename.sort(lhs: iosProject.objectBuildFileAssets, rhs: iosProject.objectBuildFileMain)) + XCTAssertFalse(PBXFileOrder.byFilename.sort(lhs: iosProject.objectBuildFileMain, rhs: iosProject.objectBuildFileAssets)) + } - func test_PBXFileOrder_PBXFileReference_by_filename_when_iosProject() { - let iosProject = iosProject() + func test_PBXFileOrder_PBXBuildFile_by_filename_when_fileSharedAcrossTargetsProject() throws { + let fileSharedAcrossTargetsProject = try fileSharedAcrossTargetsProject() - XCTAssertTrue(PBXFileOrder.byFilename.sort(lhs: iosProject.objectFileReferenceAssets, rhs: iosProject.objectFileReferenceCoreData)) - XCTAssertFalse(PBXFileOrder.byFilename.sort(lhs: iosProject.objectFileReferenceCoreData, rhs: iosProject.objectFileReferenceAssets)) - } + let sameNameByFilename = fileSharedAcrossTargetsProject.objectBuildFileSameName.sorted(by: PBXFileOrder.byFilename.sort) + XCTAssertLessThan(sameNameByFilename.first!.1.uuid, sameNameByFilename.last!.1.uuid) + } - func test_PBXFileOrder_PBXFileReference_by_filename_when_fileSharedAcrossTargetsProject() { - let fileSharedAcrossTargetsProject = fileSharedAcrossTargetsProject() + func test_PBXFileOrder_PBXBuildFile_by_filename_when_nil_name_and_path_when_iosProject() throws { + let iosProject = try iosProject() - let sameNameByFilename = fileSharedAcrossTargetsProject.objectFileReferenceSameName.sorted(by: PBXFileOrder.byFilename.sort) - XCTAssertLessThan(sameNameByFilename.first!.1.uuid, sameNameByFilename.last!.1.uuid) - } + iosProject.buildFileAssets.file?.name = nil + iosProject.buildFileMain.file?.name = nil + iosProject.buildFileAssets.file?.path = nil + iosProject.buildFileMain.file?.path = nil + XCTAssertFalse(PBXFileOrder.byFilename.sort(lhs: iosProject.objectBuildFileAssets, rhs: iosProject.objectBuildFileMain)) + XCTAssertTrue(PBXFileOrder.byFilename.sort(lhs: iosProject.objectBuildFileMain, rhs: iosProject.objectBuildFileAssets)) + } - func test_PBXFileOrder_PBXFileReference_by_filename_when_nil_name_and_path_when_iosProject() { - let iosProject = iosProject() + func test_PBXFileOrder_PBXBuildFile_by_filename_when_no_file_when_iosProject() throws { + let iosProject = try iosProject() - iosProject.fileReferenceAssets.name = nil - iosProject.fileReferenceCoreData.name = nil - iosProject.fileReferenceAssets.path = nil - iosProject.fileReferenceCoreData.path = nil - XCTAssertFalse(PBXFileOrder.byFilename.sort(lhs: iosProject.objectFileReferenceAssets, rhs: iosProject.objectFileReferenceCoreData)) - XCTAssertTrue(PBXFileOrder.byFilename.sort(lhs: iosProject.objectFileReferenceCoreData, rhs: iosProject.objectFileReferenceAssets)) - } + let ref1 = iosProject.buildFileAssets.reference + let ref2 = iosProject.buildFileMain.reference + iosProject.buildFileAssets.file = nil + iosProject.buildFileMain.file = nil + XCTAssertFalse(PBXFileOrder.byFilename.sort(lhs: (ref1, iosProject.buildFileAssets), rhs: (ref2, iosProject.buildFileMain))) + XCTAssertTrue(PBXFileOrder.byFilename.sort(lhs: (ref2, iosProject.buildFileMain), rhs: (ref1, iosProject.buildFileAssets))) + } - // MARK: - PBXFileOrder - Other + // MARK: - PBXFileOrder - PBXBuildPhaseFile + + func test_PBXFileOrder_PBXBuildPhaseFile_by_uuid_when_iosProject() throws { + let iosProject = try iosProject() + + XCTAssertFalse(PBXFileOrder.byUUID.sort(lhs: iosProject.objectBuildPhaseFileAssets, rhs: iosProject.objectBuildPhaseFileMain)) + XCTAssertTrue(PBXFileOrder.byUUID.sort(lhs: iosProject.objectBuildPhaseFileMain, rhs: iosProject.objectBuildPhaseFileAssets)) + } + + func test_PBXFileOrder_PBXBuildPhaseFile_by_filename_when_iosProject() throws { + let iosProject = try iosProject() + + XCTAssertTrue(PBXFileOrder.byFilename.sort(lhs: iosProject.objectBuildPhaseFileAssets, rhs: iosProject.objectBuildPhaseFileMain)) + XCTAssertFalse(PBXFileOrder.byFilename.sort(lhs: iosProject.objectBuildPhaseFileMain, rhs: iosProject.objectBuildPhaseFileAssets)) + } + + // MARK: - PBXFileOrder - PBXFileReference + + func test_PBXFileOrder_PBXFileReference_by_uuid_when_iosProject() throws { + let iosProject = try iosProject() + + XCTAssertFalse(PBXFileOrder.byUUID.sort(lhs: iosProject.objectFileReferenceAssets, rhs: iosProject.objectFileReferenceCoreData)) + XCTAssertTrue(PBXFileOrder.byUUID.sort(lhs: iosProject.objectFileReferenceCoreData, rhs: iosProject.objectFileReferenceAssets)) + } + + func test_PBXFileOrder_PBXFileReference_by_filename_when_iosProject() throws { + let iosProject = try iosProject() + + XCTAssertTrue(PBXFileOrder.byFilename.sort(lhs: iosProject.objectFileReferenceAssets, rhs: iosProject.objectFileReferenceCoreData)) + XCTAssertFalse(PBXFileOrder.byFilename.sort(lhs: iosProject.objectFileReferenceCoreData, rhs: iosProject.objectFileReferenceAssets)) + } + + func test_PBXFileOrder_PBXFileReference_by_filename_when_fileSharedAcrossTargetsProject() throws { + let fileSharedAcrossTargetsProject = try fileSharedAcrossTargetsProject() + + let sameNameByFilename = fileSharedAcrossTargetsProject.objectFileReferenceSameName.sorted(by: PBXFileOrder.byFilename.sort) + XCTAssertLessThan(sameNameByFilename.first!.1.uuid, sameNameByFilename.last!.1.uuid) + } + + func test_PBXFileOrder_PBXFileReference_by_filename_when_nil_name_and_path_when_iosProject() throws { + let iosProject = try iosProject() + + iosProject.fileReferenceAssets.name = nil + iosProject.fileReferenceCoreData.name = nil + iosProject.fileReferenceAssets.path = nil + iosProject.fileReferenceCoreData.path = nil + XCTAssertFalse(PBXFileOrder.byFilename.sort(lhs: iosProject.objectFileReferenceAssets, rhs: iosProject.objectFileReferenceCoreData)) + XCTAssertTrue(PBXFileOrder.byFilename.sort(lhs: iosProject.objectFileReferenceCoreData, rhs: iosProject.objectFileReferenceAssets)) + } - func test_PBXFileOrder_Other_by_uuid_when_iosProject() { - let iosProject = iosProject() + // MARK: - PBXFileOrder - Other + + func test_PBXFileOrder_Other_by_uuid_when_iosProject() throws { + let iosProject = try iosProject() + + XCTAssertTrue(PBXFileOrder.byUUID.sort(lhs: iosProject.objectGroupFrameworks, rhs: iosProject.objectGroupProducts)) + XCTAssertFalse(PBXFileOrder.byUUID.sort(lhs: iosProject.objectGroupProducts, rhs: iosProject.objectGroupFrameworks)) + } + + func test_PBXFileOrder_Other_by_filename_when_iosProject() throws { + let iosProject = try iosProject() + + XCTAssertTrue(PBXFileOrder.byFilename.sort(lhs: iosProject.objectGroupFrameworks, rhs: iosProject.objectGroupProducts)) + XCTAssertFalse(PBXFileOrder.byFilename.sort(lhs: iosProject.objectGroupProducts, rhs: iosProject.objectGroupFrameworks)) + } - XCTAssertTrue(PBXFileOrder.byUUID.sort(lhs: iosProject.objectGroupFrameworks, rhs: iosProject.objectGroupProducts)) - XCTAssertFalse(PBXFileOrder.byUUID.sort(lhs: iosProject.objectGroupProducts, rhs: iosProject.objectGroupFrameworks)) - } - - func test_PBXFileOrder_Other_by_filename_when_iosProject() { - let iosProject = iosProject() + // MARK: - PBXNavigatorFileOrder + + func test_PBXNavigatorFileOrder_unsorted_when_iosProject() { + XCTAssertNil(PBXNavigatorFileOrder.unsorted.sort) + } - XCTAssertTrue(PBXFileOrder.byFilename.sort(lhs: iosProject.objectGroupFrameworks, rhs: iosProject.objectGroupProducts)) - XCTAssertFalse(PBXFileOrder.byFilename.sort(lhs: iosProject.objectGroupProducts, rhs: iosProject.objectGroupFrameworks)) - } - - // MARK: - PBXNavigatorFileOrder - - func test_PBXNavigatorFileOrder_unsorted_when_iosProject() { - XCTAssertNil(PBXNavigatorFileOrder.unsorted.sort) - } - - func test_PBXNavigatorFileOrder_by_filename_when_iosProject() { - let iosProject = iosProject() - - let sort: (PBXFileElement, PBXFileElement) -> Bool = PBXNavigatorFileOrder.byFilename.sort! - let sorted = iosProject.navigatorFileGroup.children.sorted(by: sort).map { $0.fileName()! } - XCTAssertEqual([ - "AppDelegate.swift", - "Assets.xcassets", - "GroupWithoutFolder", - "Info.plist", - "LaunchScreen.storyboard", - "Main.storyboard", - "Model.xcdatamodeld", - "Private.h", - "Protected.h", - "Public.h", - "ViewController.swift", - ], sorted) - } - - func test_PBXNavigatorFileOrder_by_filename_groups_first_when_iosProject() { - let iosProject = iosProject() - - let sort: (PBXFileElement, PBXFileElement) -> Bool = PBXNavigatorFileOrder.byFilenameGroupsFirst.sort! - let sorted = iosProject.navigatorFileGroup.children.sorted(by: sort).map { $0.fileName()! } - XCTAssertEqual([ - "GroupWithoutFolder", - "AppDelegate.swift", - "Assets.xcassets", - "Info.plist", - "LaunchScreen.storyboard", - "Main.storyboard", - "Model.xcdatamodeld", - "Private.h", - "Protected.h", - "Public.h", - "ViewController.swift", - ], sorted) - } - - // MARK: - PBXBuildPhaseFileOrder - - func test_PBXBuildPhaseFileOrder_unsorted() { - XCTAssertNil(PBXBuildPhaseFileOrder.unsorted.sort) - } - - func test_PBXBuildPhaseFileOrder_by_filename_when_iosProject() { - let iosProject = iosProject() - - XCTAssertTrue(PBXBuildPhaseFileOrder.byFilename.sort!(iosProject.buildFileAssets, iosProject.buildFileMain)) - XCTAssertFalse(PBXBuildPhaseFileOrder.byFilename.sort!(iosProject.buildFileMain, iosProject.buildFileAssets)) - } - - // MARK: - Private - - struct iOSProject { - var proj: PBXProj! - var buildFileAssets: PBXBuildFile! - var buildFileMain: PBXBuildFile! - - var objectBuildFileAssets: (PBXObjectReference, PBXBuildFile)! - var objectBuildFileMain: (PBXObjectReference, PBXBuildFile)! - - var objectBuildPhaseFileAssets: (PBXObjectReference, PBXBuildPhaseFile)! - var objectBuildPhaseFileMain: (PBXObjectReference, PBXBuildPhaseFile)! - - var fileReferenceAssets: PBXFileReference! - var fileReferenceCoreData: PBXFileReference! - - var objectFileReferenceAssets: (PBXObjectReference, PBXFileReference)! - var objectFileReferenceCoreData: (PBXObjectReference, PBXFileReference)! - - var groupFrameworks: PBXGroup! - var groupProducts: PBXGroup! - - var objectGroupFrameworks: (PBXObjectReference, PBXGroup)! - var objectGroupProducts: (PBXObjectReference, PBXGroup)! - - var navigatorFileGroup: PBXGroup! - } - - private func iosProject() -> iOSProject { - let data = try! iosProjectData() - let proj = try! PBXProj(data: data) - - let buildFileAssets = proj.buildFiles.first { $0.file?.fileName() == "Assets.xcassets" }! - let buildFileMain = proj.buildFiles.first { $0.file?.fileName() == "Main.storyboard" }! - - let objectBuildFileAssets = (buildFileAssets.reference, buildFileAssets) - let objectBuildFileMain = (buildFileMain.reference, buildFileMain) - - let objectBuildPhaseFileAssets = proj.objects.buildPhaseFile.first { $0.value.buildFile.file?.fileName() == "Assets.xcassets" }! - let objectBuildPhaseFileMain = proj.objects.buildPhaseFile.first { $0.value.buildFile.file?.fileName() == "Main.storyboard" }! - - let fileReferenceAssets = proj.fileReferences.first { $0.fileName() == "Assets.xcassets" }! - let fileReferenceCoreData = proj.fileReferences.first { $0.fileName() == "CoreData.framework" }! - - let objectFileReferenceAssets = (buildFileAssets.reference, fileReferenceAssets) - let objectFileReferenceCoreData = (buildFileMain.reference, fileReferenceCoreData) - - let groupFrameworks = proj.groups.first { $0.fileName() == "Frameworks" }! - let groupProducts = proj.groups.first { $0.fileName() == "Products" }! - - let objectGroupFrameworks = (groupFrameworks.reference, groupFrameworks) - let objectGroupProducts = (groupProducts.reference, groupProducts) - - let navigatorFileGroup = proj.groups.first { $0.fileName() == "iOS" }! - - return iOSProject( - proj: proj, - buildFileAssets: buildFileAssets, - buildFileMain: buildFileMain, - objectBuildFileAssets: objectBuildFileAssets, - objectBuildFileMain: objectBuildFileMain, - objectBuildPhaseFileAssets: objectBuildPhaseFileAssets, - objectBuildPhaseFileMain: objectBuildPhaseFileMain, - fileReferenceAssets: fileReferenceAssets, - fileReferenceCoreData: fileReferenceCoreData, - objectFileReferenceAssets: objectFileReferenceAssets, - objectFileReferenceCoreData: objectFileReferenceCoreData, - groupFrameworks: groupFrameworks, - groupProducts: groupProducts, - objectGroupFrameworks: objectGroupFrameworks, - objectGroupProducts: objectGroupProducts, - navigatorFileGroup: navigatorFileGroup - ) - } - - struct FileSharedAcrossTargetsProject { - var proj: PBXProj! - var buildFileSameName: [PBXBuildFile]! - var objectBuildFileSameName: [(PBXObjectReference, PBXBuildFile)]! - var fileReferenceSameName: [PBXFileReference]! - var objectFileReferenceSameName: [(PBXObjectReference, PBXFileReference)]! - } + func test_PBXNavigatorFileOrder_by_filename_when_iosProject() throws { + let iosProject = try iosProject() - func fileSharedAcrossTargetsProject() -> FileSharedAcrossTargetsProject { - let dic = try! fileSharedAcrossTargetsData() - let proj = try! PBXProj(data: dic) - - let buildFileSameName = proj.buildFiles.filter { $0.file?.fileName() == "SameName.h" } - let objectBuildFileSameName = proj.buildFiles.map { ($0.reference, $0) } - let fileReferenceSameName = proj.fileReferences.filter { $0.fileName() == "FileSharedAcrossTargetsTests.swift" } - let objectFileReferenceSameName = fileReferenceSameName.map { ($0.reference, $0) } - - return FileSharedAcrossTargetsProject( - proj: proj, - buildFileSameName: buildFileSameName, - objectBuildFileSameName: objectBuildFileSameName, - fileReferenceSameName: fileReferenceSameName, - objectFileReferenceSameName: objectFileReferenceSameName - ) + let sort: (PBXFileElement, PBXFileElement) -> Bool = PBXNavigatorFileOrder.byFilename.sort! + let sorted = iosProject.navigatorFileGroup.children.sorted(by: sort).map { $0.fileName()! } + XCTAssertEqual([ + "AppDelegate.swift", + "Assets.xcassets", + "GroupWithoutFolder", + "Info.plist", + "LaunchScreen.storyboard", + "Main.storyboard", + "Model.xcdatamodeld", + "Private.h", + "Protected.h", + "Public.h", + "ViewController.swift", + ], sorted) + } + + func test_PBXNavigatorFileOrder_by_filename_groups_first_when_iosProject() throws { + let iosProject = try iosProject() + + let sort: (PBXFileElement, PBXFileElement) -> Bool = PBXNavigatorFileOrder.byFilenameGroupsFirst.sort! + let sorted = iosProject.navigatorFileGroup.children.sorted(by: sort).map { $0.fileName()! } + XCTAssertEqual([ + "GroupWithoutFolder", + "AppDelegate.swift", + "Assets.xcassets", + "Info.plist", + "LaunchScreen.storyboard", + "Main.storyboard", + "Model.xcdatamodeld", + "Private.h", + "Protected.h", + "Public.h", + "ViewController.swift", + ], sorted) + } + + // MARK: - PBXBuildPhaseFileOrder + + func test_PBXBuildPhaseFileOrder_unsorted() { + XCTAssertNil(PBXBuildPhaseFileOrder.unsorted.sort) + } + + func test_PBXBuildPhaseFileOrder_by_filename_when_iosProject() throws { + let iosProject = try iosProject() + + XCTAssertTrue(PBXBuildPhaseFileOrder.byFilename.sort!(iosProject.buildFileAssets, iosProject.buildFileMain)) + XCTAssertFalse(PBXBuildPhaseFileOrder.byFilename.sort!(iosProject.buildFileMain, iosProject.buildFileAssets)) + } + + // MARK: - Private + + struct iOSProject { + var proj: PBXProj! + var buildFileAssets: PBXBuildFile! + var buildFileMain: PBXBuildFile! + + var objectBuildFileAssets: (PBXObjectReference, PBXBuildFile)! + var objectBuildFileMain: (PBXObjectReference, PBXBuildFile)! + + var objectBuildPhaseFileAssets: (PBXObjectReference, PBXBuildPhaseFile)! + var objectBuildPhaseFileMain: (PBXObjectReference, PBXBuildPhaseFile)! + + var fileReferenceAssets: PBXFileReference! + var fileReferenceCoreData: PBXFileReference! + + var objectFileReferenceAssets: (PBXObjectReference, PBXFileReference)! + var objectFileReferenceCoreData: (PBXObjectReference, PBXFileReference)! + + var groupFrameworks: PBXGroup! + var groupProducts: PBXGroup! + + var objectGroupFrameworks: (PBXObjectReference, PBXGroup)! + var objectGroupProducts: (PBXObjectReference, PBXGroup)! + + var navigatorFileGroup: PBXGroup! + } + + private func iosProject() throws -> iOSProject { + let data = try XCTUnwrap(iosProjectData()) + let proj = try XCTUnwrap(PBXProj(data: data)) + + let buildFileAssets = proj.buildFiles.first { $0.file?.fileName() == "Assets.xcassets" }! + let buildFileMain = proj.buildFiles.first { $0.file?.fileName() == "Main.storyboard" }! + + let objectBuildFileAssets = (buildFileAssets.reference, buildFileAssets) + let objectBuildFileMain = (buildFileMain.reference, buildFileMain) + + let objectBuildPhaseFileAssets = proj.objects.buildPhaseFile.first { $0.value.buildFile.file?.fileName() == "Assets.xcassets" }! + let objectBuildPhaseFileMain = proj.objects.buildPhaseFile.first { $0.value.buildFile.file?.fileName() == "Main.storyboard" }! + + let fileReferenceAssets = proj.fileReferences.first { $0.fileName() == "Assets.xcassets" }! + let fileReferenceCoreData = proj.fileReferences.first { $0.fileName() == "CoreData.framework" }! + + let objectFileReferenceAssets = (buildFileAssets.reference, fileReferenceAssets) + let objectFileReferenceCoreData = (buildFileMain.reference, fileReferenceCoreData) + + let groupFrameworks = proj.groups.first { $0.fileName() == "Frameworks" }! + let groupProducts = proj.groups.first { $0.fileName() == "Products" }! + + let objectGroupFrameworks = (groupFrameworks.reference, groupFrameworks) + let objectGroupProducts = (groupProducts.reference, groupProducts) + + let navigatorFileGroup = proj.groups.first { $0.fileName() == "iOS" }! + + return iOSProject( + proj: proj, + buildFileAssets: buildFileAssets, + buildFileMain: buildFileMain, + objectBuildFileAssets: objectBuildFileAssets, + objectBuildFileMain: objectBuildFileMain, + objectBuildPhaseFileAssets: objectBuildPhaseFileAssets, + objectBuildPhaseFileMain: objectBuildPhaseFileMain, + fileReferenceAssets: fileReferenceAssets, + fileReferenceCoreData: fileReferenceCoreData, + objectFileReferenceAssets: objectFileReferenceAssets, + objectFileReferenceCoreData: objectFileReferenceCoreData, + groupFrameworks: groupFrameworks, + groupProducts: groupProducts, + objectGroupFrameworks: objectGroupFrameworks, + objectGroupProducts: objectGroupProducts, + navigatorFileGroup: navigatorFileGroup + ) + } + + struct FileSharedAcrossTargetsProject { + var proj: PBXProj! + var buildFileSameName: [PBXBuildFile]! + var objectBuildFileSameName: [(PBXObjectReference, PBXBuildFile)]! + var fileReferenceSameName: [PBXFileReference]! + var objectFileReferenceSameName: [(PBXObjectReference, PBXFileReference)]! + } + + func fileSharedAcrossTargetsProject() throws -> FileSharedAcrossTargetsProject { + let dic = try XCTUnwrap(fileSharedAcrossTargetsData()) + let proj = try XCTUnwrap(PBXProj(data: dic)) + + let buildFileSameName = proj.buildFiles.filter { $0.file?.fileName() == "SameName.h" } + let objectBuildFileSameName = proj.buildFiles.map { ($0.reference, $0) } + let fileReferenceSameName = proj.fileReferences.filter { $0.fileName() == "FileSharedAcrossTargetsTests.swift" } + let objectFileReferenceSameName = fileReferenceSameName.map { ($0.reference, $0) } + + return FileSharedAcrossTargetsProject( + proj: proj, + buildFileSameName: buildFileSameName, + objectBuildFileSameName: objectBuildFileSameName, + fileReferenceSameName: fileReferenceSameName, + objectFileReferenceSameName: objectFileReferenceSameName + ) + } } -} +#endif diff --git a/Tests/XcodeProjTests/Objects/Project/PBXProj+Fixtures.swift b/Tests/XcodeProjTests/Objects/Project/PBXProj+Fixtures.swift index ade46a2a2..8488d0fb7 100644 --- a/Tests/XcodeProjTests/Objects/Project/PBXProj+Fixtures.swift +++ b/Tests/XcodeProjTests/Objects/Project/PBXProj+Fixtures.swift @@ -5,7 +5,7 @@ extension PBXProj { static func fixture(rootObject: PBXProject? = PBXProject.fixture(), objectVersion: UInt = Xcode.LastKnown.objectVersion, archiveVersion: UInt = Xcode.LastKnown.archiveVersion, - classes: [String: Any] = [:], + classes: [String: [String]] = [:], objects: [PBXObject] = []) -> PBXProj { PBXProj(rootObject: rootObject, diff --git a/Tests/XcodeProjTests/Objects/Project/PBXProjEncoderTests.swift b/Tests/XcodeProjTests/Objects/Project/PBXProjEncoderTests.swift index 2f0e49c81..4fb2b6ec0 100644 --- a/Tests/XcodeProjTests/Objects/Project/PBXProjEncoderTests.swift +++ b/Tests/XcodeProjTests/Objects/Project/PBXProjEncoderTests.swift @@ -1,618 +1,620 @@ +#if os(macOS) || (os(Linux) && compiler(>=6.1)) + import Foundation + import XCTest + @testable import XcodeProj -import Foundation -import XCTest -@testable import XcodeProj + class PBXProjEncoderTests: XCTestCase { + var proj: PBXProj! -class PBXProjEncoderTests: XCTestCase { - var proj: PBXProj! + // MARK: - Header - // MARK: - Header + func test_writeHeaders_when_iOSProject() throws { + try loadiOSProject() - func test_writeHeaders_when_iOSProject() throws { - try loadiOSProject() - - let lines = lines(fromFile: encodeProject()) - XCTAssertEqual(583, lines.count) - XCTAssertEqual("// !$*UTF8*$!", lines[0]) - } + let lines = lines(fromFile: encodeProject()) + XCTAssertEqual(583, lines.count) + XCTAssertEqual("// !$*UTF8*$!", lines[0]) + } - // MARK: - Internal file lists - - func test_buildFiles_in_default_uuid_order_when_iOSProject() throws { - try loadiOSProject() - - let lines = lines(fromFile: encodeProject()) - var line = lines.validate(line: "/* Begin PBXBuildFile section */") - line = lines.validate(lineContaining: "04D5C09F1F153824008A2F98 /* CoreData.framework in Frameworks */", onLineAfter: line) - line = lines.validate(lineContaining: "04D5C0A31F153924008A2F98 /* Public.h in Headers */", onLineAfter: line) - line = lines.validate(lineContaining: "04D5C0A41F153924008A2F98 /* Protected.h in Headers */", onLineAfter: line) - line = lines.validate(lineContaining: "04D5C0A51F153924008A2F98 /* Private.h in Headers */", onLineAfter: line) - line = lines.validate(lineContaining: "23766C161EAA3484007A9026 /* AppDelegate.swift in Sources */", onLineAfter: line) - line = lines.validate(lineContaining: "23766C181EAA3484007A9026 /* ViewController.swift in Sources */", onLineAfter: line) - line = lines.validate(lineContaining: "23766C1B1EAA3484007A9026 /* Main.storyboard in Resources */", onLineAfter: line) - line = lines.validate(lineContaining: "23766C1D1EAA3484007A9026 /* Assets.xcassets in Resources */", onLineAfter: line) - line = lines.validate(lineContaining: "23766C201EAA3484007A9026 /* LaunchScreen.storyboard in Resources */", onLineAfter: line) - line = lines.validate(lineContaining: "23766C2B1EAA3484007A9026 /* iOSTests.swift in Sources */", onLineAfter: line) - line = lines.validate(lineContaining: "3CD1EADD205763E400DAEECB /* Model.xcdatamodeld in Sources */", onLineAfter: line) - line = lines.validate(lineContaining: "42AA1A1A22AAF48100428760 /* MyLocalPackage in Frameworks */", onLineAfter: line) - line = lines.validate(lineContaining: "42AA1A1C22AAF48100428760 /* RxSwift in Frameworks */", onLineAfter: line) - lines.validate(line: "/* End PBXBuildFile section */", onLineAfter: line) - } + // MARK: - Internal file lists + + func test_buildFiles_in_default_uuid_order_when_iOSProject() throws { + try loadiOSProject() + + let lines = lines(fromFile: encodeProject()) + var line = lines.validate(line: "/* Begin PBXBuildFile section */") + line = lines.validate(lineContaining: "04D5C09F1F153824008A2F98 /* CoreData.framework in Frameworks */", onLineAfter: line) + line = lines.validate(lineContaining: "04D5C0A31F153924008A2F98 /* Public.h in Headers */", onLineAfter: line) + line = lines.validate(lineContaining: "04D5C0A41F153924008A2F98 /* Protected.h in Headers */", onLineAfter: line) + line = lines.validate(lineContaining: "04D5C0A51F153924008A2F98 /* Private.h in Headers */", onLineAfter: line) + line = lines.validate(lineContaining: "23766C161EAA3484007A9026 /* AppDelegate.swift in Sources */", onLineAfter: line) + line = lines.validate(lineContaining: "23766C181EAA3484007A9026 /* ViewController.swift in Sources */", onLineAfter: line) + line = lines.validate(lineContaining: "23766C1B1EAA3484007A9026 /* Main.storyboard in Resources */", onLineAfter: line) + line = lines.validate(lineContaining: "23766C1D1EAA3484007A9026 /* Assets.xcassets in Resources */", onLineAfter: line) + line = lines.validate(lineContaining: "23766C201EAA3484007A9026 /* LaunchScreen.storyboard in Resources */", onLineAfter: line) + line = lines.validate(lineContaining: "23766C2B1EAA3484007A9026 /* iOSTests.swift in Sources */", onLineAfter: line) + line = lines.validate(lineContaining: "3CD1EADD205763E400DAEECB /* Model.xcdatamodeld in Sources */", onLineAfter: line) + line = lines.validate(lineContaining: "42AA1A1A22AAF48100428760 /* MyLocalPackage in Frameworks */", onLineAfter: line) + line = lines.validate(lineContaining: "42AA1A1C22AAF48100428760 /* RxSwift in Frameworks */", onLineAfter: line) + lines.validate(line: "/* End PBXBuildFile section */", onLineAfter: line) + } - func test_buildFiles_in_filename_order_when_iOSProject() throws { - try loadiOSProject() - - let settings = PBXOutputSettings(projFileListOrder: .byFilename) - let lines = lines(fromFile: encodeProject(settings: settings)) - var line = lines.validate(line: "/* Begin PBXBuildFile section */") - line = lines.validate(lineContaining: "23766C161EAA3484007A9026 /* AppDelegate.swift in Sources */", onLineAfter: line) - line = lines.validate(lineContaining: "23766C1D1EAA3484007A9026 /* Assets.xcassets in Resources */", onLineAfter: line) - line = lines.validate(lineContaining: "04D5C09F1F153824008A2F98 /* CoreData.framework in Frameworks */", onLineAfter: line) - line = lines.validate(lineContaining: "23766C201EAA3484007A9026 /* LaunchScreen.storyboard in Resources */", onLineAfter: line) - line = lines.validate(lineContaining: "23766C1B1EAA3484007A9026 /* Main.storyboard in Resources */", onLineAfter: line) - line = lines.validate(lineContaining: "3CD1EADD205763E400DAEECB /* Model.xcdatamodeld in Sources */", onLineAfter: line) - line = lines.validate(lineContaining: "04D5C0A51F153924008A2F98 /* Private.h in Headers */", onLineAfter: line) - line = lines.validate(lineContaining: "04D5C0A41F153924008A2F98 /* Protected.h in Headers */", onLineAfter: line) - line = lines.validate(lineContaining: "04D5C0A31F153924008A2F98 /* Public.h in Headers */", onLineAfter: line) - line = lines.validate(lineContaining: "23766C181EAA3484007A9026 /* ViewController.swift in Sources */", onLineAfter: line) - line = lines.validate(lineContaining: "23766C2B1EAA3484007A9026 /* iOSTests.swift in Sources */", onLineAfter: line) - line = lines.validate(lineContaining: "42AA1A1A22AAF48100428760 /* MyLocalPackage in Frameworks */", onLineAfter: line) - line = lines.validate(lineContaining: "42AA1A1C22AAF48100428760 /* RxSwift in Frameworks */", onLineAfter: line) - lines.validate(line: "/* End PBXBuildFile section */", onLineAfter: line) - } + func test_buildFiles_in_filename_order_when_iOSProject() throws { + try loadiOSProject() + + let settings = PBXOutputSettings(projFileListOrder: .byFilename) + let lines = lines(fromFile: encodeProject(settings: settings)) + var line = lines.validate(line: "/* Begin PBXBuildFile section */") + line = lines.validate(lineContaining: "23766C161EAA3484007A9026 /* AppDelegate.swift in Sources */", onLineAfter: line) + line = lines.validate(lineContaining: "23766C1D1EAA3484007A9026 /* Assets.xcassets in Resources */", onLineAfter: line) + line = lines.validate(lineContaining: "04D5C09F1F153824008A2F98 /* CoreData.framework in Frameworks */", onLineAfter: line) + line = lines.validate(lineContaining: "23766C201EAA3484007A9026 /* LaunchScreen.storyboard in Resources */", onLineAfter: line) + line = lines.validate(lineContaining: "23766C1B1EAA3484007A9026 /* Main.storyboard in Resources */", onLineAfter: line) + line = lines.validate(lineContaining: "3CD1EADD205763E400DAEECB /* Model.xcdatamodeld in Sources */", onLineAfter: line) + line = lines.validate(lineContaining: "04D5C0A51F153924008A2F98 /* Private.h in Headers */", onLineAfter: line) + line = lines.validate(lineContaining: "04D5C0A41F153924008A2F98 /* Protected.h in Headers */", onLineAfter: line) + line = lines.validate(lineContaining: "04D5C0A31F153924008A2F98 /* Public.h in Headers */", onLineAfter: line) + line = lines.validate(lineContaining: "23766C181EAA3484007A9026 /* ViewController.swift in Sources */", onLineAfter: line) + line = lines.validate(lineContaining: "23766C2B1EAA3484007A9026 /* iOSTests.swift in Sources */", onLineAfter: line) + line = lines.validate(lineContaining: "42AA1A1A22AAF48100428760 /* MyLocalPackage in Frameworks */", onLineAfter: line) + line = lines.validate(lineContaining: "42AA1A1C22AAF48100428760 /* RxSwift in Frameworks */", onLineAfter: line) + lines.validate(line: "/* End PBXBuildFile section */", onLineAfter: line) + } - func test_buildFiles_in_filename_order_when_fileSharedAcrossTargetsProject() throws { - try loadFileSharedAcrossTargetsProject() + func test_buildFiles_in_filename_order_when_fileSharedAcrossTargetsProject() throws { + try loadFileSharedAcrossTargetsProject() - let settings = PBXOutputSettings(projFileListOrder: .byFilename) - let lines = lines(fromFile: encodeProject(settings: settings)) - var line = lines.validate(line: "/* Begin PBXBuildFile section */") + let settings = PBXOutputSettings(projFileListOrder: .byFilename) + let lines = lines(fromFile: encodeProject(settings: settings)) + var line = lines.validate(line: "/* Begin PBXBuildFile section */") - line = lines.validate(lineContaining: "6C103C032A49CC5400D7EFE4 /* FileSharedAcrossTargets.framework in Frameworks */", onLineAfter: line) - line = lines.validate(lineContaining: "6C103C092A49CC5400D7EFE4 /* FileSharedAcrossTargets.h in Headers */", onLineAfter: line) - line = lines.validate(lineContaining: "6C103C082A49CC5400D7EFE4 /* FileSharedAcrossTargetsTests.swift in Sources */", onLineAfter: line) - line = lines.validate(lineContaining: "6C103C132A49CC7300D7EFE4 /* SharedHeader.h in Headers */", onLineAfter: line) + line = lines.validate(lineContaining: "6C103C032A49CC5400D7EFE4 /* FileSharedAcrossTargets.framework in Frameworks */", onLineAfter: line) + line = lines.validate(lineContaining: "6C103C092A49CC5400D7EFE4 /* FileSharedAcrossTargets.h in Headers */", onLineAfter: line) + line = lines.validate(lineContaining: "6C103C082A49CC5400D7EFE4 /* FileSharedAcrossTargetsTests.swift in Sources */", onLineAfter: line) + line = lines.validate(lineContaining: "6C103C132A49CC7300D7EFE4 /* SharedHeader.h in Headers */", onLineAfter: line) - lines.validate(line: "/* End PBXBuildFile section */", onLineAfter: line) - } + lines.validate(line: "/* End PBXBuildFile section */", onLineAfter: line) + } - func test_file_references_in_default_uuid_order_when_iOSProject() throws { - try loadiOSProject() - - let lines = lines(fromFile: encodeProject()) - var line = lines.validate(line: "/* Begin PBXFileReference section */") - line = lines.validate(lineContaining: "04D5C09E1F153824008A2F98 /* CoreData.framework */", onLineAfter: line) - line = lines.validate(lineContaining: "04D5C0A01F153915008A2F98 /* Public.h */", onLineAfter: line) - line = lines.validate(lineContaining: "04D5C0A11F15391B008A2F98 /* Protected.h */", onLineAfter: line) - line = lines.validate(lineContaining: "04D5C0A21F153921008A2F98 /* Private.h */", onLineAfter: line) - line = lines.validate(lineContaining: "23766C121EAA3484007A9026 /* iOS.app */", onLineAfter: line) - line = lines.validate(lineContaining: "23766C151EAA3484007A9026 /* AppDelegate.swift */", onLineAfter: line) - line = lines.validate(lineContaining: "23766C171EAA3484007A9026 /* ViewController.swift */", onLineAfter: line) - line = lines.validate(lineContaining: "23766C1A1EAA3484007A9026 /* Base */", onLineAfter: line) - line = lines.validate(lineContaining: "23766C1C1EAA3484007A9026 /* Assets.xcassets */", onLineAfter: line) - line = lines.validate(lineContaining: "23766C1F1EAA3484007A9026 /* Base */", onLineAfter: line) - line = lines.validate(lineContaining: "23766C211EAA3484007A9026 /* Info.plist */", onLineAfter: line) - line = lines.validate(lineContaining: "23766C261EAA3484007A9026 /* iOSTests.xctest */", onLineAfter: line) - line = lines.validate(lineContaining: "23766C2A1EAA3484007A9026 /* iOSTests.swift */", onLineAfter: line) - line = lines.validate(lineContaining: "23766C2C1EAA3484007A9026 /* Info.plist */", onLineAfter: line) - line = lines.validate(lineContaining: "23C1E0AF23657FB500B8D1EF /* iOS.xctestplan */", onLineAfter: line) - line = lines.validate(lineContaining: "3CD1EADC205763E400DAEECB /* Model.xcdatamodel */", onLineAfter: line) - line = lines.validate(lineContaining: "42AA1A1822AAF41000428760 /* MyLocalPackage */", onLineAfter: line) - - lines.validate(line: "/* End PBXFileReference section */", onLineAfter: line) - } + func test_file_references_in_default_uuid_order_when_iOSProject() throws { + try loadiOSProject() + + let lines = lines(fromFile: encodeProject()) + var line = lines.validate(line: "/* Begin PBXFileReference section */") + line = lines.validate(lineContaining: "04D5C09E1F153824008A2F98 /* CoreData.framework */", onLineAfter: line) + line = lines.validate(lineContaining: "04D5C0A01F153915008A2F98 /* Public.h */", onLineAfter: line) + line = lines.validate(lineContaining: "04D5C0A11F15391B008A2F98 /* Protected.h */", onLineAfter: line) + line = lines.validate(lineContaining: "04D5C0A21F153921008A2F98 /* Private.h */", onLineAfter: line) + line = lines.validate(lineContaining: "23766C121EAA3484007A9026 /* iOS.app */", onLineAfter: line) + line = lines.validate(lineContaining: "23766C151EAA3484007A9026 /* AppDelegate.swift */", onLineAfter: line) + line = lines.validate(lineContaining: "23766C171EAA3484007A9026 /* ViewController.swift */", onLineAfter: line) + line = lines.validate(lineContaining: "23766C1A1EAA3484007A9026 /* Base */", onLineAfter: line) + line = lines.validate(lineContaining: "23766C1C1EAA3484007A9026 /* Assets.xcassets */", onLineAfter: line) + line = lines.validate(lineContaining: "23766C1F1EAA3484007A9026 /* Base */", onLineAfter: line) + line = lines.validate(lineContaining: "23766C211EAA3484007A9026 /* Info.plist */", onLineAfter: line) + line = lines.validate(lineContaining: "23766C261EAA3484007A9026 /* iOSTests.xctest */", onLineAfter: line) + line = lines.validate(lineContaining: "23766C2A1EAA3484007A9026 /* iOSTests.swift */", onLineAfter: line) + line = lines.validate(lineContaining: "23766C2C1EAA3484007A9026 /* Info.plist */", onLineAfter: line) + line = lines.validate(lineContaining: "23C1E0AF23657FB500B8D1EF /* iOS.xctestplan */", onLineAfter: line) + line = lines.validate(lineContaining: "3CD1EADC205763E400DAEECB /* Model.xcdatamodel */", onLineAfter: line) + line = lines.validate(lineContaining: "42AA1A1822AAF41000428760 /* MyLocalPackage */", onLineAfter: line) + + lines.validate(line: "/* End PBXFileReference section */", onLineAfter: line) + } - func test_file_references_in_default_uuid_order_when_fileSharedAcrossTargetsProject() throws { - try loadFileSharedAcrossTargetsProject() + func test_file_references_in_default_uuid_order_when_fileSharedAcrossTargetsProject() throws { + try loadFileSharedAcrossTargetsProject() - let lines = lines(fromFile: encodeProject()) - var line = lines.validate(line: "/* Begin PBXFileReference section */") - line = lines.validate(lineContaining: "6C103BFA2A49CC5300D7EFE4 /* FileSharedAcrossTargets.framework */", onLineAfter: line) - line = lines.validate(lineContaining: "6C103BFD2A49CC5300D7EFE4 /* FileSharedAcrossTargets.h */", onLineAfter: line) - line = lines.validate(lineContaining: "6C103C022A49CC5400D7EFE4 /* FileSharedAcrossTargetsTests.xctest */", onLineAfter: line) - line = lines.validate(lineContaining: "6C103C072A49CC5400D7EFE4 /* FileSharedAcrossTargetsTests.swift */", onLineAfter: line) - line = lines.validate(lineContaining: "6C103C122A49CC7300D7EFE4 /* SharedHeader.h */", onLineAfter: line) - line = lines.validate(lineContaining: "6CB965012A49DC1F009186C6 /* FileSharedAcrossTargetsTests.swift */", onLineAfter: line) + let lines = lines(fromFile: encodeProject()) + var line = lines.validate(line: "/* Begin PBXFileReference section */") + line = lines.validate(lineContaining: "6C103BFA2A49CC5300D7EFE4 /* FileSharedAcrossTargets.framework */", onLineAfter: line) + line = lines.validate(lineContaining: "6C103BFD2A49CC5300D7EFE4 /* FileSharedAcrossTargets.h */", onLineAfter: line) + line = lines.validate(lineContaining: "6C103C022A49CC5400D7EFE4 /* FileSharedAcrossTargetsTests.xctest */", onLineAfter: line) + line = lines.validate(lineContaining: "6C103C072A49CC5400D7EFE4 /* FileSharedAcrossTargetsTests.swift */", onLineAfter: line) + line = lines.validate(lineContaining: "6C103C122A49CC7300D7EFE4 /* SharedHeader.h */", onLineAfter: line) + line = lines.validate(lineContaining: "6CB965012A49DC1F009186C6 /* FileSharedAcrossTargetsTests.swift */", onLineAfter: line) - lines.validate(line: "/* End PBXFileReference section */", onLineAfter: line) - } + lines.validate(line: "/* End PBXFileReference section */", onLineAfter: line) + } - func test_file_references_in_filename_order_when_iOSProject() throws { - try loadiOSProject() - - let settings = PBXOutputSettings(projFileListOrder: .byFilename) - let lines = lines(fromFile: encodeProject(settings: settings)) - var line = lines.validate(line: "/* Begin PBXFileReference section */") - line = lines.validate(lineContaining: "23766C151EAA3484007A9026 /* AppDelegate.swift */", onLineAfter: line) - line = lines.validate(lineContaining: "23766C1C1EAA3484007A9026 /* Assets.xcassets */", onLineAfter: line) - line = lines.validate(lineContaining: "23766C1A1EAA3484007A9026 /* Base */", onLineAfter: line) - line = lines.validate(lineContaining: "23766C1F1EAA3484007A9026 /* Base */", onLineAfter: line) - line = lines.validate(lineContaining: "04D5C09E1F153824008A2F98 /* CoreData.framework */", onLineAfter: line) - line = lines.validate(lineContaining: "23766C211EAA3484007A9026 /* Info.plist */", onLineAfter: line) - line = lines.validate(lineContaining: "23766C2C1EAA3484007A9026 /* Info.plist */", onLineAfter: line) - line = lines.validate(lineContaining: "3CD1EADC205763E400DAEECB /* Model.xcdatamodel */", onLineAfter: line) - line = lines.validate(lineContaining: "42AA1A1822AAF41000428760 /* MyLocalPackage */", onLineAfter: line) - line = lines.validate(lineContaining: "04D5C0A21F153921008A2F98 /* Private.h */", onLineAfter: line) - line = lines.validate(lineContaining: "04D5C0A11F15391B008A2F98 /* Protected.h */", onLineAfter: line) - line = lines.validate(lineContaining: "04D5C0A01F153915008A2F98 /* Public.h */", onLineAfter: line) - line = lines.validate(lineContaining: "23766C171EAA3484007A9026 /* ViewController.swift */", onLineAfter: line) - line = lines.validate(lineContaining: "23766C121EAA3484007A9026 /* iOS.app */", onLineAfter: line) - line = lines.validate(lineContaining: "23C1E0AF23657FB500B8D1EF /* iOS.xctestplan */", onLineAfter: line) - line = lines.validate(lineContaining: "23766C2A1EAA3484007A9026 /* iOSTests.swift */", onLineAfter: line) - line = lines.validate(lineContaining: "23766C261EAA3484007A9026 /* iOSTests.xctest */", onLineAfter: line) - lines.validate(line: "/* End PBXFileReference section */", onLineAfter: line) - } + func test_file_references_in_filename_order_when_iOSProject() throws { + try loadiOSProject() + + let settings = PBXOutputSettings(projFileListOrder: .byFilename) + let lines = lines(fromFile: encodeProject(settings: settings)) + var line = lines.validate(line: "/* Begin PBXFileReference section */") + line = lines.validate(lineContaining: "23766C151EAA3484007A9026 /* AppDelegate.swift */", onLineAfter: line) + line = lines.validate(lineContaining: "23766C1C1EAA3484007A9026 /* Assets.xcassets */", onLineAfter: line) + line = lines.validate(lineContaining: "23766C1A1EAA3484007A9026 /* Base */", onLineAfter: line) + line = lines.validate(lineContaining: "23766C1F1EAA3484007A9026 /* Base */", onLineAfter: line) + line = lines.validate(lineContaining: "04D5C09E1F153824008A2F98 /* CoreData.framework */", onLineAfter: line) + line = lines.validate(lineContaining: "23766C211EAA3484007A9026 /* Info.plist */", onLineAfter: line) + line = lines.validate(lineContaining: "23766C2C1EAA3484007A9026 /* Info.plist */", onLineAfter: line) + line = lines.validate(lineContaining: "3CD1EADC205763E400DAEECB /* Model.xcdatamodel */", onLineAfter: line) + line = lines.validate(lineContaining: "42AA1A1822AAF41000428760 /* MyLocalPackage */", onLineAfter: line) + line = lines.validate(lineContaining: "04D5C0A21F153921008A2F98 /* Private.h */", onLineAfter: line) + line = lines.validate(lineContaining: "04D5C0A11F15391B008A2F98 /* Protected.h */", onLineAfter: line) + line = lines.validate(lineContaining: "04D5C0A01F153915008A2F98 /* Public.h */", onLineAfter: line) + line = lines.validate(lineContaining: "23766C171EAA3484007A9026 /* ViewController.swift */", onLineAfter: line) + line = lines.validate(lineContaining: "23766C121EAA3484007A9026 /* iOS.app */", onLineAfter: line) + line = lines.validate(lineContaining: "23C1E0AF23657FB500B8D1EF /* iOS.xctestplan */", onLineAfter: line) + line = lines.validate(lineContaining: "23766C2A1EAA3484007A9026 /* iOSTests.swift */", onLineAfter: line) + line = lines.validate(lineContaining: "23766C261EAA3484007A9026 /* iOSTests.xctest */", onLineAfter: line) + lines.validate(line: "/* End PBXFileReference section */", onLineAfter: line) + } - func test_file_references_in_filename_order_when_fileSharedAcrossTargetsProject() throws { - try loadFileSharedAcrossTargetsProject() - - let settings = PBXOutputSettings(projFileListOrder: .byFilename) - let lines = lines(fromFile: encodeProject(settings: settings)) - var line = lines.validate(line: "/* Begin PBXFileReference section */") - line = lines.validate(lineContaining: "6C103BFA2A49CC5300D7EFE4 /* FileSharedAcrossTargets.framework */", onLineAfter: line) - line = lines.validate(lineContaining: "6C103BFD2A49CC5300D7EFE4 /* FileSharedAcrossTargets.h */", onLineAfter: line) - line = lines.validate(lineContaining: "6C103C072A49CC5400D7EFE4 /* FileSharedAcrossTargetsTests.swift */", onLineAfter: line) - line = lines.validate(lineContaining: "6CB965012A49DC1F009186C6 /* FileSharedAcrossTargetsTests.swift */", onLineAfter: line) - line = lines.validate(lineContaining: "6C103C022A49CC5400D7EFE4 /* FileSharedAcrossTargetsTests.xctest */", onLineAfter: line) - line = lines.validate(lineContaining: "6C103C122A49CC7300D7EFE4 /* SharedHeader.h */", onLineAfter: line) - lines.validate(line: "/* End PBXFileReference section */", onLineAfter: line) - } + func test_file_references_in_filename_order_when_fileSharedAcrossTargetsProject() throws { + try loadFileSharedAcrossTargetsProject() + + let settings = PBXOutputSettings(projFileListOrder: .byFilename) + let lines = lines(fromFile: encodeProject(settings: settings)) + var line = lines.validate(line: "/* Begin PBXFileReference section */") + line = lines.validate(lineContaining: "6C103BFA2A49CC5300D7EFE4 /* FileSharedAcrossTargets.framework */", onLineAfter: line) + line = lines.validate(lineContaining: "6C103BFD2A49CC5300D7EFE4 /* FileSharedAcrossTargets.h */", onLineAfter: line) + line = lines.validate(lineContaining: "6C103C072A49CC5400D7EFE4 /* FileSharedAcrossTargetsTests.swift */", onLineAfter: line) + line = lines.validate(lineContaining: "6CB965012A49DC1F009186C6 /* FileSharedAcrossTargetsTests.swift */", onLineAfter: line) + line = lines.validate(lineContaining: "6C103C022A49CC5400D7EFE4 /* FileSharedAcrossTargetsTests.xctest */", onLineAfter: line) + line = lines.validate(lineContaining: "6C103C122A49CC7300D7EFE4 /* SharedHeader.h */", onLineAfter: line) + lines.validate(line: "/* End PBXFileReference section */", onLineAfter: line) + } - // MARK: - Navigator - - func test_navigator_groups_in_default_order_when_iOSProject() throws { - try loadiOSProject() - - let lines = lines(fromFile: encodeProject()) - - let beginGroup = lines.findLine("/* Begin PBXGroup section */") - - // Root - let rootGroup = lines.findLine("23766C091EAA3484007A9026 = {", after: beginGroup) - let rootChildrenStart = lines.findLine("children = (", after: rootGroup) - let rootChildrenEnd = lines.findLine(");", after: rootChildrenStart) - - lines.validate(line: "23766C141EAA3484007A9026 /* iOS */,", betweenLine: rootChildrenStart, andLine: rootChildrenEnd) - lines.validate(line: "23766C291EAA3484007A9026 /* iOSTests */,", betweenLine: rootChildrenStart, andLine: rootChildrenEnd) - lines.validate(line: "23766C131EAA3484007A9026 /* Products */,", betweenLine: rootChildrenStart, andLine: rootChildrenEnd) - lines.validate(line: "04D5C09D1F153824008A2F98 /* Frameworks */,", betweenLine: rootChildrenStart, andLine: rootChildrenEnd) - - // iOS - let iosGroup = lines.findLine("23766C141EAA3484007A9026 /* iOS */ = {", after: beginGroup) - let iosChildrenStart = lines.findLine("children = (", after: iosGroup) - let iosChildrenEnd = lines.findLine(");", after: iosChildrenStart) - - lines.validate(line: "3CD1EADB205763E400DAEECB /* Model.xcdatamodeld */,", betweenLine: iosChildrenStart, andLine: iosChildrenEnd) - lines.validate(line: "3CD1EAD92057638200DAEECB /* GroupWithoutFolder */,", betweenLine: iosChildrenStart, andLine: iosChildrenEnd) - lines.validate(line: "23766C151EAA3484007A9026 /* AppDelegate.swift */,", betweenLine: iosChildrenStart, andLine: iosChildrenEnd) - lines.validate(line: "23766C171EAA3484007A9026 /* ViewController.swift */,", betweenLine: iosChildrenStart, andLine: iosChildrenEnd) - lines.validate(line: "23766C191EAA3484007A9026 /* Main.storyboard */,", betweenLine: iosChildrenStart, andLine: iosChildrenEnd) - lines.validate(line: "23766C1C1EAA3484007A9026 /* Assets.xcassets */,", betweenLine: iosChildrenStart, andLine: iosChildrenEnd) - lines.validate(line: "23766C1E1EAA3484007A9026 /* LaunchScreen.storyboard */,", betweenLine: iosChildrenStart, andLine: iosChildrenEnd) - lines.validate(line: "23766C211EAA3484007A9026 /* Info.plist */,", betweenLine: iosChildrenStart, andLine: iosChildrenEnd) - lines.validate(line: "04D5C0A01F153915008A2F98 /* Public.h */,", betweenLine: iosChildrenStart, andLine: iosChildrenEnd) - lines.validate(line: "04D5C0A11F15391B008A2F98 /* Protected.h */,", betweenLine: iosChildrenStart, andLine: iosChildrenEnd) - lines.validate(line: "04D5C0A21F153921008A2F98 /* Private.h */,", betweenLine: iosChildrenStart, andLine: iosChildrenEnd) - - // iOS Tests - let iosTestsGroup = lines.findLine("23766C291EAA3484007A9026 /* iOSTests */ = {", after: beginGroup) - let iosTestsChildrenStart = lines.findLine("children = (", after: iosTestsGroup) - let iosTestsChildrenEnd = lines.findLine(");", after: iosTestsChildrenStart) - - lines.validate(line: "23766C2A1EAA3484007A9026 /* iOSTests.swift */,", betweenLine: iosTestsChildrenStart, andLine: iosTestsChildrenEnd) - lines.validate(line: "23766C2C1EAA3484007A9026 /* Info.plist */,", betweenLine: iosTestsChildrenStart, andLine: iosTestsChildrenEnd) - } + // MARK: - Navigator + + func test_navigator_groups_in_default_order_when_iOSProject() throws { + try loadiOSProject() + + let lines = lines(fromFile: encodeProject()) + + let beginGroup = lines.findLine("/* Begin PBXGroup section */") + + // Root + let rootGroup = lines.findLine("23766C091EAA3484007A9026 = {", after: beginGroup) + let rootChildrenStart = lines.findLine("children = (", after: rootGroup) + let rootChildrenEnd = lines.findLine(");", after: rootChildrenStart) + + lines.validate(line: "23766C141EAA3484007A9026 /* iOS */,", betweenLine: rootChildrenStart, andLine: rootChildrenEnd) + lines.validate(line: "23766C291EAA3484007A9026 /* iOSTests */,", betweenLine: rootChildrenStart, andLine: rootChildrenEnd) + lines.validate(line: "23766C131EAA3484007A9026 /* Products */,", betweenLine: rootChildrenStart, andLine: rootChildrenEnd) + lines.validate(line: "04D5C09D1F153824008A2F98 /* Frameworks */,", betweenLine: rootChildrenStart, andLine: rootChildrenEnd) + + // iOS + let iosGroup = lines.findLine("23766C141EAA3484007A9026 /* iOS */ = {", after: beginGroup) + let iosChildrenStart = lines.findLine("children = (", after: iosGroup) + let iosChildrenEnd = lines.findLine(");", after: iosChildrenStart) + + lines.validate(line: "3CD1EADB205763E400DAEECB /* Model.xcdatamodeld */,", betweenLine: iosChildrenStart, andLine: iosChildrenEnd) + lines.validate(line: "3CD1EAD92057638200DAEECB /* GroupWithoutFolder */,", betweenLine: iosChildrenStart, andLine: iosChildrenEnd) + lines.validate(line: "23766C151EAA3484007A9026 /* AppDelegate.swift */,", betweenLine: iosChildrenStart, andLine: iosChildrenEnd) + lines.validate(line: "23766C171EAA3484007A9026 /* ViewController.swift */,", betweenLine: iosChildrenStart, andLine: iosChildrenEnd) + lines.validate(line: "23766C191EAA3484007A9026 /* Main.storyboard */,", betweenLine: iosChildrenStart, andLine: iosChildrenEnd) + lines.validate(line: "23766C1C1EAA3484007A9026 /* Assets.xcassets */,", betweenLine: iosChildrenStart, andLine: iosChildrenEnd) + lines.validate(line: "23766C1E1EAA3484007A9026 /* LaunchScreen.storyboard */,", betweenLine: iosChildrenStart, andLine: iosChildrenEnd) + lines.validate(line: "23766C211EAA3484007A9026 /* Info.plist */,", betweenLine: iosChildrenStart, andLine: iosChildrenEnd) + lines.validate(line: "04D5C0A01F153915008A2F98 /* Public.h */,", betweenLine: iosChildrenStart, andLine: iosChildrenEnd) + lines.validate(line: "04D5C0A11F15391B008A2F98 /* Protected.h */,", betweenLine: iosChildrenStart, andLine: iosChildrenEnd) + lines.validate(line: "04D5C0A21F153921008A2F98 /* Private.h */,", betweenLine: iosChildrenStart, andLine: iosChildrenEnd) + + // iOS Tests + let iosTestsGroup = lines.findLine("23766C291EAA3484007A9026 /* iOSTests */ = {", after: beginGroup) + let iosTestsChildrenStart = lines.findLine("children = (", after: iosTestsGroup) + let iosTestsChildrenEnd = lines.findLine(");", after: iosTestsChildrenStart) + + lines.validate(line: "23766C2A1EAA3484007A9026 /* iOSTests.swift */,", betweenLine: iosTestsChildrenStart, andLine: iosTestsChildrenEnd) + lines.validate(line: "23766C2C1EAA3484007A9026 /* Info.plist */,", betweenLine: iosTestsChildrenStart, andLine: iosTestsChildrenEnd) + } - func test_navigator_groups_in_filename_order_when_iOSProject() throws { - try loadiOSProject() - - let settings = PBXOutputSettings(projNavigatorFileOrder: .byFilename) - let lines = lines(fromFile: encodeProject(settings: settings)) - - let beginGroup = lines.findLine("/* Begin PBXGroup section */") - - // Root - let rootGroup = lines.findLine("23766C091EAA3484007A9026 = {", after: beginGroup) - var line = lines.findLine("children = (", after: rootGroup) - line = lines.validate(line: "04D5C09D1F153824008A2F98 /* Frameworks */,", after: line) - line = lines.validate(line: "23766C131EAA3484007A9026 /* Products */,", after: line) - line = lines.validate(line: "23766C141EAA3484007A9026 /* iOS */,", after: line) - line = lines.validate(line: "23766C291EAA3484007A9026 /* iOSTests */,", after: line) - lines.validate(line: ");", after: line) - - // iOS - let iosGroup = lines.findLine("23766C141EAA3484007A9026 /* iOS */ = {", after: beginGroup) - line = lines.findLine("children = (", after: iosGroup) - line = lines.validate(line: "23766C151EAA3484007A9026 /* AppDelegate.swift */,", after: line) - line = lines.validate(line: "23766C1C1EAA3484007A9026 /* Assets.xcassets */,", after: line) - line = lines.validate(line: "3CD1EAD92057638200DAEECB /* GroupWithoutFolder */,", after: line) - line = lines.validate(line: "23766C211EAA3484007A9026 /* Info.plist */,", after: line) - line = lines.validate(line: "23766C1E1EAA3484007A9026 /* LaunchScreen.storyboard */,", after: line) - line = lines.validate(line: "23766C191EAA3484007A9026 /* Main.storyboard */,", after: line) - line = lines.validate(line: "3CD1EADB205763E400DAEECB /* Model.xcdatamodeld */,", after: line) - line = lines.validate(line: "04D5C0A21F153921008A2F98 /* Private.h */,", after: line) - line = lines.validate(line: "04D5C0A11F15391B008A2F98 /* Protected.h */,", after: line) - line = lines.validate(line: "04D5C0A01F153915008A2F98 /* Public.h */,", after: line) - line = lines.validate(line: "23766C171EAA3484007A9026 /* ViewController.swift */,", after: line) - lines.validate(line: ");", after: line) - - // iOS Tests - let iosTestsGroup = lines.findLine("23766C291EAA3484007A9026 /* iOSTests */ = {", after: beginGroup) - line = lines.findLine("children = (", after: iosTestsGroup) - line = lines.validate(line: "23766C2C1EAA3484007A9026 /* Info.plist */,", after: line) - line = lines.validate(line: "23766C2A1EAA3484007A9026 /* iOSTests.swift */,", after: line) - lines.validate(line: ");", after: line) - } + func test_navigator_groups_in_filename_order_when_iOSProject() throws { + try loadiOSProject() + + let settings = PBXOutputSettings(projNavigatorFileOrder: .byFilename) + let lines = lines(fromFile: encodeProject(settings: settings)) + + let beginGroup = lines.findLine("/* Begin PBXGroup section */") + + // Root + let rootGroup = lines.findLine("23766C091EAA3484007A9026 = {", after: beginGroup) + var line = lines.findLine("children = (", after: rootGroup) + line = lines.validate(line: "04D5C09D1F153824008A2F98 /* Frameworks */,", after: line) + line = lines.validate(line: "23766C131EAA3484007A9026 /* Products */,", after: line) + line = lines.validate(line: "23766C141EAA3484007A9026 /* iOS */,", after: line) + line = lines.validate(line: "23766C291EAA3484007A9026 /* iOSTests */,", after: line) + lines.validate(line: ");", after: line) + + // iOS + let iosGroup = lines.findLine("23766C141EAA3484007A9026 /* iOS */ = {", after: beginGroup) + line = lines.findLine("children = (", after: iosGroup) + line = lines.validate(line: "23766C151EAA3484007A9026 /* AppDelegate.swift */,", after: line) + line = lines.validate(line: "23766C1C1EAA3484007A9026 /* Assets.xcassets */,", after: line) + line = lines.validate(line: "3CD1EAD92057638200DAEECB /* GroupWithoutFolder */,", after: line) + line = lines.validate(line: "23766C211EAA3484007A9026 /* Info.plist */,", after: line) + line = lines.validate(line: "23766C1E1EAA3484007A9026 /* LaunchScreen.storyboard */,", after: line) + line = lines.validate(line: "23766C191EAA3484007A9026 /* Main.storyboard */,", after: line) + line = lines.validate(line: "3CD1EADB205763E400DAEECB /* Model.xcdatamodeld */,", after: line) + line = lines.validate(line: "04D5C0A21F153921008A2F98 /* Private.h */,", after: line) + line = lines.validate(line: "04D5C0A11F15391B008A2F98 /* Protected.h */,", after: line) + line = lines.validate(line: "04D5C0A01F153915008A2F98 /* Public.h */,", after: line) + line = lines.validate(line: "23766C171EAA3484007A9026 /* ViewController.swift */,", after: line) + lines.validate(line: ");", after: line) + + // iOS Tests + let iosTestsGroup = lines.findLine("23766C291EAA3484007A9026 /* iOSTests */ = {", after: beginGroup) + line = lines.findLine("children = (", after: iosTestsGroup) + line = lines.validate(line: "23766C2C1EAA3484007A9026 /* Info.plist */,", after: line) + line = lines.validate(line: "23766C2A1EAA3484007A9026 /* iOSTests.swift */,", after: line) + lines.validate(line: ");", after: line) + } - func test_navigator_groups_in_filename_groups_first_order_when_iOSProject() throws { - try loadiOSProject() - - let settings = PBXOutputSettings(projNavigatorFileOrder: .byFilenameGroupsFirst) - let lines = lines(fromFile: encodeProject(settings: settings)) - - let beginGroup = lines.findLine("/* Begin PBXGroup section */") - - // Root - let rootGroup = lines.findLine("23766C091EAA3484007A9026 = {", after: beginGroup) - var line = lines.findLine("children = (", after: rootGroup) - line = lines.validate(line: "04D5C09D1F153824008A2F98 /* Frameworks */,", after: line) - line = lines.validate(line: "23766C131EAA3484007A9026 /* Products */,", after: line) - line = lines.validate(line: "23766C141EAA3484007A9026 /* iOS */,", after: line) - line = lines.validate(line: "23766C291EAA3484007A9026 /* iOSTests */,", after: line) - lines.validate(line: ");", after: line) - - // iOS - let iosGroup = lines.findLine("23766C141EAA3484007A9026 /* iOS */ = {", after: beginGroup) - line = lines.findLine("children = (", after: iosGroup) - line = lines.validate(line: "3CD1EAD92057638200DAEECB /* GroupWithoutFolder */,", after: line) - line = lines.validate(line: "23766C151EAA3484007A9026 /* AppDelegate.swift */,", after: line) - line = lines.validate(line: "23766C1C1EAA3484007A9026 /* Assets.xcassets */,", after: line) - line = lines.validate(line: "23766C211EAA3484007A9026 /* Info.plist */,", after: line) - line = lines.validate(line: "23766C1E1EAA3484007A9026 /* LaunchScreen.storyboard */,", after: line) - line = lines.validate(line: "23766C191EAA3484007A9026 /* Main.storyboard */,", after: line) - line = lines.validate(line: "3CD1EADB205763E400DAEECB /* Model.xcdatamodeld */,", after: line) - line = lines.validate(line: "04D5C0A21F153921008A2F98 /* Private.h */,", after: line) - line = lines.validate(line: "04D5C0A11F15391B008A2F98 /* Protected.h */,", after: line) - line = lines.validate(line: "04D5C0A01F153915008A2F98 /* Public.h */,", after: line) - line = lines.validate(line: "23766C171EAA3484007A9026 /* ViewController.swift */,", after: line) - lines.validate(line: ");", after: line) - - // iOS Tests - let iosTestsGroup = lines.findLine("23766C291EAA3484007A9026 /* iOSTests */ = {", after: beginGroup) - line = lines.findLine("children = (", after: iosTestsGroup) - line = lines.validate(line: "23766C2C1EAA3484007A9026 /* Info.plist */,", after: line) - line = lines.validate(line: "23766C2A1EAA3484007A9026 /* iOSTests.swift */,", after: line) - lines.validate(line: ");", after: line) - } + func test_navigator_groups_in_filename_groups_first_order_when_iOSProject() throws { + try loadiOSProject() + + let settings = PBXOutputSettings(projNavigatorFileOrder: .byFilenameGroupsFirst) + let lines = lines(fromFile: encodeProject(settings: settings)) + + let beginGroup = lines.findLine("/* Begin PBXGroup section */") + + // Root + let rootGroup = lines.findLine("23766C091EAA3484007A9026 = {", after: beginGroup) + var line = lines.findLine("children = (", after: rootGroup) + line = lines.validate(line: "04D5C09D1F153824008A2F98 /* Frameworks */,", after: line) + line = lines.validate(line: "23766C131EAA3484007A9026 /* Products */,", after: line) + line = lines.validate(line: "23766C141EAA3484007A9026 /* iOS */,", after: line) + line = lines.validate(line: "23766C291EAA3484007A9026 /* iOSTests */,", after: line) + lines.validate(line: ");", after: line) + + // iOS + let iosGroup = lines.findLine("23766C141EAA3484007A9026 /* iOS */ = {", after: beginGroup) + line = lines.findLine("children = (", after: iosGroup) + line = lines.validate(line: "3CD1EAD92057638200DAEECB /* GroupWithoutFolder */,", after: line) + line = lines.validate(line: "23766C151EAA3484007A9026 /* AppDelegate.swift */,", after: line) + line = lines.validate(line: "23766C1C1EAA3484007A9026 /* Assets.xcassets */,", after: line) + line = lines.validate(line: "23766C211EAA3484007A9026 /* Info.plist */,", after: line) + line = lines.validate(line: "23766C1E1EAA3484007A9026 /* LaunchScreen.storyboard */,", after: line) + line = lines.validate(line: "23766C191EAA3484007A9026 /* Main.storyboard */,", after: line) + line = lines.validate(line: "3CD1EADB205763E400DAEECB /* Model.xcdatamodeld */,", after: line) + line = lines.validate(line: "04D5C0A21F153921008A2F98 /* Private.h */,", after: line) + line = lines.validate(line: "04D5C0A11F15391B008A2F98 /* Protected.h */,", after: line) + line = lines.validate(line: "04D5C0A01F153915008A2F98 /* Public.h */,", after: line) + line = lines.validate(line: "23766C171EAA3484007A9026 /* ViewController.swift */,", after: line) + lines.validate(line: ");", after: line) + + // iOS Tests + let iosTestsGroup = lines.findLine("23766C291EAA3484007A9026 /* iOSTests */ = {", after: beginGroup) + line = lines.findLine("children = (", after: iosTestsGroup) + line = lines.validate(line: "23766C2C1EAA3484007A9026 /* Info.plist */,", after: line) + line = lines.validate(line: "23766C2A1EAA3484007A9026 /* iOSTests.swift */,", after: line) + lines.validate(line: ");", after: line) + } - // MARK: - File system synchronized root groups + // MARK: - File system synchronized root groups - func test_fileSystemSynchronizedRootGroups_when_projectWithFileSystemSynchronizedRootGroups() throws { - // Given - try loadSynchronizedRootGroups() - let settings = PBXOutputSettings(projNavigatorFileOrder: .byFilenameGroupsFirst) - let lines = lines(fromFile: encodeProject(settings: settings)) + func test_fileSystemSynchronizedRootGroups_when_projectWithFileSystemSynchronizedRootGroups() throws { + // Given + try loadSynchronizedRootGroups() + let settings = PBXOutputSettings(projNavigatorFileOrder: .byFilenameGroupsFirst) + let lines = lines(fromFile: encodeProject(settings: settings)) - let beginGroup = lines.findLine("/* Begin PBXFileSystemSynchronizedRootGroup section */") - var line = lines.validate(line: "6CF05B9D2C53F64800EF267F /* SynchronizedRootGroups */ = {isa = PBXFileSystemSynchronizedRootGroup; exceptions = (6CF05BA32C53F97F00EF267F /* PBXFileSystemSynchronizedBuildFileExceptionSet */, F841A9D12D63B00A00059ED6 /* PBXFileSystemSynchronizedGroupBuildPhaseMembershipExceptionSet */, ); explicitFileTypes = {}; explicitFolders = (); path = SynchronizedRootGroups; sourceTree = \"\"; };", after: beginGroup) - line = lines.validate(line: "/* End PBXFileSystemSynchronizedRootGroup section */", after: line) - } + let beginGroup = lines.findLine("/* Begin PBXFileSystemSynchronizedRootGroup section */") + var line = lines.validate(line: "6CF05B9D2C53F64800EF267F /* SynchronizedRootGroups */ = {isa = PBXFileSystemSynchronizedRootGroup; exceptions = (6CF05BA32C53F97F00EF267F /* PBXFileSystemSynchronizedBuildFileExceptionSet */, F841A9D12D63B00A00059ED6 /* PBXFileSystemSynchronizedGroupBuildPhaseMembershipExceptionSet */, ); explicitFileTypes = {}; explicitFolders = (); path = SynchronizedRootGroups; sourceTree = \"\"; };", after: beginGroup) + line = lines.validate(line: "/* End PBXFileSystemSynchronizedRootGroup section */", after: line) + } - // MARK: - File system synchronized build file exception set - - func test_fileSystemSynchronizedBuildFileExceptionSets_when_projectWithFileSystemSynchronizedRootGroups() throws { - // Given - try loadSynchronizedRootGroups() - let settings = PBXOutputSettings(projNavigatorFileOrder: .byFilenameGroupsFirst) - let lines = lines(fromFile: encodeProject(settings: settings)) - - let beginGroup = lines.findLine("/* Begin PBXFileSystemSynchronizedBuildFileExceptionSet section */") - var line = lines.validate(line: "6CF05BA32C53F97F00EF267F /* PBXFileSystemSynchronizedBuildFileExceptionSet */ = {", after: beginGroup) - line = lines.validate(line: "isa = PBXFileSystemSynchronizedBuildFileExceptionSet;", after: line) - line = lines.validate(line: "membershipExceptions = (", after: line) - line = lines.validate(line: "Exception/Exception.swift,", after: line) - line = lines.validate(line: ");", after: line) - line = lines.validate(line: "target = 6CF05B8B2C53F5F200EF267F /* SynchronizedRootGroups */;", after: line) - line = lines.validate(line: "};", after: line) - line = lines.validate(line: "/* End PBXFileSystemSynchronizedBuildFileExceptionSet section */", after: line) - } + // MARK: - File system synchronized build file exception set + + func test_fileSystemSynchronizedBuildFileExceptionSets_when_projectWithFileSystemSynchronizedRootGroups() throws { + // Given + try loadSynchronizedRootGroups() + let settings = PBXOutputSettings(projNavigatorFileOrder: .byFilenameGroupsFirst) + let lines = lines(fromFile: encodeProject(settings: settings)) + + let beginGroup = lines.findLine("/* Begin PBXFileSystemSynchronizedBuildFileExceptionSet section */") + var line = lines.validate(line: "6CF05BA32C53F97F00EF267F /* PBXFileSystemSynchronizedBuildFileExceptionSet */ = {", after: beginGroup) + line = lines.validate(line: "isa = PBXFileSystemSynchronizedBuildFileExceptionSet;", after: line) + line = lines.validate(line: "membershipExceptions = (", after: line) + line = lines.validate(line: "Exception/Exception.swift,", after: line) + line = lines.validate(line: ");", after: line) + line = lines.validate(line: "target = 6CF05B8B2C53F5F200EF267F /* SynchronizedRootGroups */;", after: line) + line = lines.validate(line: "};", after: line) + line = lines.validate(line: "/* End PBXFileSystemSynchronizedBuildFileExceptionSet section */", after: line) + } - // MARK: - File system synchronized group build phase membership exception set - - func test_fileSystemSynchronizedGroupBuildPhaseMembershipExceptionSets_when_projectWithFileSystemSynchronizedRootGroups() throws { - // Given - try loadSynchronizedRootGroups() - let settings = PBXOutputSettings(projNavigatorFileOrder: .byFilenameGroupsFirst) - let lines = lines(fromFile: encodeProject(settings: settings)) - - let beginGroup = lines.findLine("/* Begin PBXFileSystemSynchronizedGroupBuildPhaseMembershipExceptionSet section */") - var line = lines.validate(line: "F841A9D12D63B00A00059ED6 /* PBXFileSystemSynchronizedGroupBuildPhaseMembershipExceptionSet */ = {", after: beginGroup) - line = lines.validate(line: "isa = PBXFileSystemSynchronizedGroupBuildPhaseMembershipExceptionSet;", after: line) - line = lines.validate(line: "attributesByRelativePath = {", after: line) - line = lines.validate(line: "XPCService.xpc = (", after: line) - line = lines.validate(line: "RemoveHeadersOnCopy,", after: line) - line = lines.validate(line: ");", after: line) - line = lines.validate(line: "};", after: line) - line = lines.validate(line: "buildPhase = F841A9CA2D63AFBB00059ED6 /* CopyFiles */;", after: line) - line = lines.validate(line: "membershipExceptions = (", after: line) - line = lines.validate(line: "XPCService.xpc,", after: line) - line = lines.validate(line: ");", after: line) - line = lines.validate(line: "};", after: line) - line = lines.validate(line: "/* End PBXFileSystemSynchronizedGroupBuildPhaseMembershipExceptionSet section */", after: line) - } + // MARK: - File system synchronized group build phase membership exception set + + func test_fileSystemSynchronizedGroupBuildPhaseMembershipExceptionSets_when_projectWithFileSystemSynchronizedRootGroups() throws { + // Given + try loadSynchronizedRootGroups() + let settings = PBXOutputSettings(projNavigatorFileOrder: .byFilenameGroupsFirst) + let lines = lines(fromFile: encodeProject(settings: settings)) + + let beginGroup = lines.findLine("/* Begin PBXFileSystemSynchronizedGroupBuildPhaseMembershipExceptionSet section */") + var line = lines.validate(line: "F841A9D12D63B00A00059ED6 /* PBXFileSystemSynchronizedGroupBuildPhaseMembershipExceptionSet */ = {", after: beginGroup) + line = lines.validate(line: "isa = PBXFileSystemSynchronizedGroupBuildPhaseMembershipExceptionSet;", after: line) + line = lines.validate(line: "attributesByRelativePath = {", after: line) + line = lines.validate(line: "XPCService.xpc = (", after: line) + line = lines.validate(line: "RemoveHeadersOnCopy,", after: line) + line = lines.validate(line: ");", after: line) + line = lines.validate(line: "};", after: line) + line = lines.validate(line: "buildPhase = F841A9CA2D63AFBB00059ED6 /* CopyFiles */;", after: line) + line = lines.validate(line: "membershipExceptions = (", after: line) + line = lines.validate(line: "XPCService.xpc,", after: line) + line = lines.validate(line: ");", after: line) + line = lines.validate(line: "};", after: line) + line = lines.validate(line: "/* End PBXFileSystemSynchronizedGroupBuildPhaseMembershipExceptionSet section */", after: line) + } - // MARK: - Build phases + // MARK: - Build phases - func test_build_phase_sources_unsorted_when_iOSProject() throws { - try loadiOSProject() + func test_build_phase_sources_unsorted_when_iOSProject() throws { + try loadiOSProject() - let lines = lines(fromFile: encodeProject()) - let beginGroup = lines.findLine("/* Begin PBXSourcesBuildPhase section */") - let files = lines.findLine("files = (", after: beginGroup) - let endGroup = lines.findLine("/* End PBXSourcesBuildPhase section */") - lines.validate(line: "23766C181EAA3484007A9026 /* ViewController.swift in Sources */,", betweenLine: files, andLine: endGroup) - lines.validate(line: "23766C161EAA3484007A9026 /* AppDelegate.swift in Sources */,", betweenLine: files, andLine: endGroup) - lines.validate(line: "3CD1EADD205763E400DAEECB /* Model.xcdatamodeld in Sources */,", betweenLine: files, andLine: endGroup) - } + let lines = lines(fromFile: encodeProject()) + let beginGroup = lines.findLine("/* Begin PBXSourcesBuildPhase section */") + let files = lines.findLine("files = (", after: beginGroup) + let endGroup = lines.findLine("/* End PBXSourcesBuildPhase section */") + lines.validate(line: "23766C181EAA3484007A9026 /* ViewController.swift in Sources */,", betweenLine: files, andLine: endGroup) + lines.validate(line: "23766C161EAA3484007A9026 /* AppDelegate.swift in Sources */,", betweenLine: files, andLine: endGroup) + lines.validate(line: "3CD1EADD205763E400DAEECB /* Model.xcdatamodeld in Sources */,", betweenLine: files, andLine: endGroup) + } - func test_build_phase_sources_sorted_when_iOSProject() throws { - try loadiOSProject() - - let settings = PBXOutputSettings(projBuildPhaseFileOrder: .byFilename) - let lines = lines(fromFile: encodeProject(settings: settings)) - let beginGroup = lines.findLine("/* Begin PBXSourcesBuildPhase section */") - var line = lines.findLine("files = (", after: beginGroup) - line = lines.validate(line: "23766C161EAA3484007A9026 /* AppDelegate.swift in Sources */,", after: line) - line = lines.validate(line: "3CD1EADD205763E400DAEECB /* Model.xcdatamodeld in Sources */,", after: line) - line = lines.validate(line: "23766C181EAA3484007A9026 /* ViewController.swift in Sources */,", after: line) - line = lines.validate(line: "/* End PBXSourcesBuildPhase section */", after: line) - } + func test_build_phase_sources_sorted_when_iOSProject() throws { + try loadiOSProject() + + let settings = PBXOutputSettings(projBuildPhaseFileOrder: .byFilename) + let lines = lines(fromFile: encodeProject(settings: settings)) + let beginGroup = lines.findLine("/* Begin PBXSourcesBuildPhase section */") + var line = lines.findLine("files = (", after: beginGroup) + line = lines.validate(line: "23766C161EAA3484007A9026 /* AppDelegate.swift in Sources */,", after: line) + line = lines.validate(line: "3CD1EADD205763E400DAEECB /* Model.xcdatamodeld in Sources */,", after: line) + line = lines.validate(line: "23766C181EAA3484007A9026 /* ViewController.swift in Sources */,", after: line) + line = lines.validate(line: "/* End PBXSourcesBuildPhase section */", after: line) + } - func test_build_phase_headers_unsorted_when_iOSProject() throws { - try loadiOSProject() + func test_build_phase_headers_unsorted_when_iOSProject() throws { + try loadiOSProject() - let lines = lines(fromFile: encodeProject()) - let beginGroup = lines.findLine("/* Begin PBXHeadersBuildPhase section */") - let files = lines.findLine("files = (", after: beginGroup) - let endGroup = lines.findLine("/* End PBXHeadersBuildPhase section */") - lines.validate(line: "04D5C0A41F153924008A2F98 /* Protected.h in Headers */,", betweenLine: files, andLine: endGroup) - lines.validate(line: "04D5C0A51F153924008A2F98 /* Private.h in Headers */,", betweenLine: files, andLine: endGroup) - lines.validate(line: "04D5C0A31F153924008A2F98 /* Public.h in Headers */,", betweenLine: files, andLine: endGroup) - } + let lines = lines(fromFile: encodeProject()) + let beginGroup = lines.findLine("/* Begin PBXHeadersBuildPhase section */") + let files = lines.findLine("files = (", after: beginGroup) + let endGroup = lines.findLine("/* End PBXHeadersBuildPhase section */") + lines.validate(line: "04D5C0A41F153924008A2F98 /* Protected.h in Headers */,", betweenLine: files, andLine: endGroup) + lines.validate(line: "04D5C0A51F153924008A2F98 /* Private.h in Headers */,", betweenLine: files, andLine: endGroup) + lines.validate(line: "04D5C0A31F153924008A2F98 /* Public.h in Headers */,", betweenLine: files, andLine: endGroup) + } - func test_build_phase_headers_sorted_when_iOSProject() throws { - try loadiOSProject() - - let settings = PBXOutputSettings(projBuildPhaseFileOrder: .byFilename) - let lines = lines(fromFile: encodeProject(settings: settings)) - let beginGroup = lines.findLine("/* Begin PBXHeadersBuildPhase section */") - var line = lines.findLine("files = (", after: beginGroup) - line = lines.validate(line: "04D5C0A51F153924008A2F98 /* Private.h in Headers */,", after: line) - line = lines.validate(line: "04D5C0A41F153924008A2F98 /* Protected.h in Headers */,", after: line) - line = lines.validate(line: "04D5C0A31F153924008A2F98 /* Public.h in Headers */,", after: line) - line = lines.validate(line: "/* End PBXHeadersBuildPhase section */", after: line) - } + func test_build_phase_headers_sorted_when_iOSProject() throws { + try loadiOSProject() + + let settings = PBXOutputSettings(projBuildPhaseFileOrder: .byFilename) + let lines = lines(fromFile: encodeProject(settings: settings)) + let beginGroup = lines.findLine("/* Begin PBXHeadersBuildPhase section */") + var line = lines.findLine("files = (", after: beginGroup) + line = lines.validate(line: "04D5C0A51F153924008A2F98 /* Private.h in Headers */,", after: line) + line = lines.validate(line: "04D5C0A41F153924008A2F98 /* Protected.h in Headers */,", after: line) + line = lines.validate(line: "04D5C0A31F153924008A2F98 /* Public.h in Headers */,", after: line) + line = lines.validate(line: "/* End PBXHeadersBuildPhase section */", after: line) + } - func test_build_phase_resources_unsorted_when_iOSProject() throws { - try loadiOSProject() + func test_build_phase_resources_unsorted_when_iOSProject() throws { + try loadiOSProject() - let lines = lines(fromFile: encodeProject()) - let beginGroup = lines.findLine("/* Begin PBXResourcesBuildPhase section */") - let files = lines.findLine("files = (", after: beginGroup) - let endGroup = lines.findLine("/* End PBXResourcesBuildPhase section */") - lines.validate(line: "23766C1D1EAA3484007A9026 /* Assets.xcassets in Resources */,", betweenLine: files, andLine: endGroup) - lines.validate(line: "23766C1B1EAA3484007A9026 /* Main.storyboard in Resources */,", betweenLine: files, andLine: endGroup) - lines.validate(line: "23766C201EAA3484007A9026 /* LaunchScreen.storyboard in Resources */,", betweenLine: files, andLine: endGroup) - } + let lines = lines(fromFile: encodeProject()) + let beginGroup = lines.findLine("/* Begin PBXResourcesBuildPhase section */") + let files = lines.findLine("files = (", after: beginGroup) + let endGroup = lines.findLine("/* End PBXResourcesBuildPhase section */") + lines.validate(line: "23766C1D1EAA3484007A9026 /* Assets.xcassets in Resources */,", betweenLine: files, andLine: endGroup) + lines.validate(line: "23766C1B1EAA3484007A9026 /* Main.storyboard in Resources */,", betweenLine: files, andLine: endGroup) + lines.validate(line: "23766C201EAA3484007A9026 /* LaunchScreen.storyboard in Resources */,", betweenLine: files, andLine: endGroup) + } - func test_build_phase_resources_sorted_when_iOSProject() throws { - try loadiOSProject() - - let settings = PBXOutputSettings(projBuildPhaseFileOrder: .byFilename) - let lines = lines(fromFile: encodeProject(settings: settings)) - let beginGroup = lines.findLine("/* Begin PBXResourcesBuildPhase section */") - var line = lines.findLine("files = (", after: beginGroup) - line = lines.validate(line: "23766C1D1EAA3484007A9026 /* Assets.xcassets in Resources */,", after: line) - line = lines.validate(line: "23766C201EAA3484007A9026 /* LaunchScreen.storyboard in Resources */,", after: line) - line = lines.validate(line: "23766C1B1EAA3484007A9026 /* Main.storyboard in Resources */,", after: line) - line = lines.validate(line: "/* End PBXResourcesBuildPhase section */", after: line) - } + func test_build_phase_resources_sorted_when_iOSProject() throws { + try loadiOSProject() + + let settings = PBXOutputSettings(projBuildPhaseFileOrder: .byFilename) + let lines = lines(fromFile: encodeProject(settings: settings)) + let beginGroup = lines.findLine("/* Begin PBXResourcesBuildPhase section */") + var line = lines.findLine("files = (", after: beginGroup) + line = lines.validate(line: "23766C1D1EAA3484007A9026 /* Assets.xcassets in Resources */,", after: line) + line = lines.validate(line: "23766C201EAA3484007A9026 /* LaunchScreen.storyboard in Resources */,", after: line) + line = lines.validate(line: "23766C1B1EAA3484007A9026 /* Main.storyboard in Resources */,", after: line) + line = lines.validate(line: "/* End PBXResourcesBuildPhase section */", after: line) + } - func test_build_rules_when_targetWithCustomBuildRulesProject() throws { - try loadTargetWithCustomBuildRulesProject() - - let settings = PBXOutputSettings(projBuildPhaseFileOrder: .byFilename) - let lines = lines(fromFile: encodeProject(settings: settings)) - let beginGroup = lines.findLine("6CAD68202A56E31400662D8A /* PBXBuildRule */ = {") - var line = lines.validate(line: "isa = PBXBuildRule;", after: beginGroup) - line = lines.validate(line: "compilerSpec = com.apple.compilers.proxy.script;", after: line) - line = lines.validate(line: "dependencyFile = \"$(DERIVED_FILES_DIR)/$(INPUT_FILE_PATH).d\";", after: line) - line = lines.validate(line: "fileType = pattern.proxy;", after: line) - line = lines.validate(line: "inputFiles = (", after: line) - line = lines.validate(line: ");", after: line) - line = lines.validate(line: "isEditable = 1;", after: line) - line = lines.validate(line: "name = \"Custom 2 with dependency file\";", after: line) - line = lines.validate(line: "outputFiles = (", after: line) - line = lines.validate(line: ");", after: line) - line = lines.validate(line: "script = \"# Type a script or drag a script file from your workspace to insert its path.\\n\";", after: line) - line = lines.validate(line: "};", after: line) - } + func test_build_rules_when_targetWithCustomBuildRulesProject() throws { + try loadTargetWithCustomBuildRulesProject() + + let settings = PBXOutputSettings(projBuildPhaseFileOrder: .byFilename) + let lines = lines(fromFile: encodeProject(settings: settings)) + let beginGroup = lines.findLine("6CAD68202A56E31400662D8A /* PBXBuildRule */ = {") + var line = lines.validate(line: "isa = PBXBuildRule;", after: beginGroup) + line = lines.validate(line: "compilerSpec = com.apple.compilers.proxy.script;", after: line) + line = lines.validate(line: "dependencyFile = \"$(DERIVED_FILES_DIR)/$(INPUT_FILE_PATH).d\";", after: line) + line = lines.validate(line: "fileType = pattern.proxy;", after: line) + line = lines.validate(line: "inputFiles = (", after: line) + line = lines.validate(line: ");", after: line) + line = lines.validate(line: "isEditable = 1;", after: line) + line = lines.validate(line: "name = \"Custom 2 with dependency file\";", after: line) + line = lines.validate(line: "outputFiles = (", after: line) + line = lines.validate(line: ");", after: line) + line = lines.validate(line: "script = \"# Type a script or drag a script file from your workspace to insert its path.\\n\";", after: line) + line = lines.validate(line: "};", after: line) + } - func test_package_section_when_projectWithXCLocalSwiftPackageReference() throws { - try loadProjectWithXCLocalSwiftPackageReference() - - let settings = PBXOutputSettings(projBuildPhaseFileOrder: .byFilename) - let lines = lines(fromFile: encodeProject(settings: settings)) - let beginGroup = lines.findLine("/* Begin XCLocalSwiftPackageReference section */") - var line = lines.validate(line: "C9FDF5C52AD604310096A37A /* XCLocalSwiftPackageReference \"MyLocalPackage\" */ = {", after: beginGroup) - line = lines.validate(line: "isa = XCLocalSwiftPackageReference;", after: line) - line = lines.validate(line: "relativePath = MyLocalPackage;", after: line) - line = lines.validate(line: "};", after: line) - line = lines.validate(line: "/* End XCLocalSwiftPackageReference section */", after: line) - } + func test_package_section_when_projectWithXCLocalSwiftPackageReference() throws { + try loadProjectWithXCLocalSwiftPackageReference() + + let settings = PBXOutputSettings(projBuildPhaseFileOrder: .byFilename) + let lines = lines(fromFile: encodeProject(settings: settings)) + let beginGroup = lines.findLine("/* Begin XCLocalSwiftPackageReference section */") + var line = lines.validate(line: "C9FDF5C52AD604310096A37A /* XCLocalSwiftPackageReference \"MyLocalPackage\" */ = {", after: beginGroup) + line = lines.validate(line: "isa = XCLocalSwiftPackageReference;", after: line) + line = lines.validate(line: "relativePath = MyLocalPackage;", after: line) + line = lines.validate(line: "};", after: line) + line = lines.validate(line: "/* End XCLocalSwiftPackageReference section */", after: line) + } - func test_package_references_when_projectWithXCLocalSwiftPackageReference() throws { - try loadProjectWithXCLocalSwiftPackageReference() + func test_package_references_when_projectWithXCLocalSwiftPackageReference() throws { + try loadProjectWithXCLocalSwiftPackageReference() - let settings = PBXOutputSettings(projBuildPhaseFileOrder: .byFilename) - let lines = lines(fromFile: encodeProject(settings: settings)) - let beginGroup = lines.findLine("packageReferences = (") - var line = lines.validate(line: "42AA19FF22AAF0D600428760 /* XCRemoteSwiftPackageReference \"RxSwift\" */,", after: beginGroup) - line = lines.validate(line: "C9FDF5C52AD604310096A37A /* XCLocalSwiftPackageReference \"MyLocalPackage\" */,", after: line) - line = lines.validate(line: ");", after: line) - } + let settings = PBXOutputSettings(projBuildPhaseFileOrder: .byFilename) + let lines = lines(fromFile: encodeProject(settings: settings)) + let beginGroup = lines.findLine("packageReferences = (") + var line = lines.validate(line: "42AA19FF22AAF0D600428760 /* XCRemoteSwiftPackageReference \"RxSwift\" */,", after: beginGroup) + line = lines.validate(line: "C9FDF5C52AD604310096A37A /* XCLocalSwiftPackageReference \"MyLocalPackage\" */,", after: line) + line = lines.validate(line: ");", after: line) + } - func test_package_references_when_projectWithRelativePathForXCLocalSwiftPackageReference() throws { - try loadProjectWithRelativeXCLocalSwiftPackageReference() + func test_package_references_when_projectWithRelativePathForXCLocalSwiftPackageReference() throws { + try loadProjectWithRelativeXCLocalSwiftPackageReference() - let settings = PBXOutputSettings(projBuildPhaseFileOrder: .byFilename) - let lines = lines(fromFile: encodeProject(settings: settings)) - let beginGroup = lines.findLine("packageReferences = (") - var line = lines.validate(line: "C9FDF5C82AD8AE400096A37A /* XCLocalSwiftPackageReference \"../MyLocalPackage\" */,", after: beginGroup) - line = lines.validate(line: ");", after: line) - } + let settings = PBXOutputSettings(projBuildPhaseFileOrder: .byFilename) + let lines = lines(fromFile: encodeProject(settings: settings)) + let beginGroup = lines.findLine("packageReferences = (") + var line = lines.validate(line: "C9FDF5C82AD8AE400096A37A /* XCLocalSwiftPackageReference \"../MyLocalPackage\" */,", after: beginGroup) + line = lines.validate(line: ");", after: line) + } - func test_package_references_when_projectWithXCLocalSwiftPackageReferences() throws { - try loadProjectWithXCLocalSwiftPackageReferences() + func test_package_references_when_projectWithXCLocalSwiftPackageReferences() throws { + try loadProjectWithXCLocalSwiftPackageReferences() - let settings = PBXOutputSettings(projBuildPhaseFileOrder: .byFilename) - let lines = lines(fromFile: encodeProject(settings: settings)) - let beginGroup = lines.findLine("packageReferences = (") - var line = lines.validate(line: "C9FDF5C52AD604310096A37A /* XCLocalSwiftPackageReference \"MyLocalPackage\" */,", after: beginGroup) - line = lines.validate(line: "C9FDF5CB2AD8B3B50096A37A /* XCLocalSwiftPackageReference \"MyOtherLocalPackage/MyOtherLocalPackage\" */,", after: line) - line = lines.validate(line: ");", after: line) - } + let settings = PBXOutputSettings(projBuildPhaseFileOrder: .byFilename) + let lines = lines(fromFile: encodeProject(settings: settings)) + let beginGroup = lines.findLine("packageReferences = (") + var line = lines.validate(line: "C9FDF5C52AD604310096A37A /* XCLocalSwiftPackageReference \"MyLocalPackage\" */,", after: beginGroup) + line = lines.validate(line: "C9FDF5CB2AD8B3B50096A37A /* XCLocalSwiftPackageReference \"MyOtherLocalPackage/MyOtherLocalPackage\" */,", after: line) + line = lines.validate(line: ");", after: line) + } - // MARK: - Test internals + // MARK: - Test internals - private func encodeProject(settings: PBXOutputSettings = PBXOutputSettings(), line: UInt = #line) -> String { - do { - return try PBXProjEncoder(outputSettings: settings).encode(proj: proj) - } catch { - XCTFail("Unexpected error encoding project: \(error)", line: line) - return "" + private func encodeProject(settings: PBXOutputSettings = PBXOutputSettings(), line: UInt = #line) -> String { + do { + return try PBXProjEncoder(outputSettings: settings).encode(proj: proj) + } catch { + XCTFail("Unexpected error encoding project: \(error)", line: line) + return "" + } } - } - private func encodeProjectThrows(error expectedError: some Error, line: UInt = #line) { - do { - _ = try PBXProjEncoder(outputSettings: PBXOutputSettings()).encode(proj: proj) - XCTFail("Expected '\(expectedError)' to be thrown", line: line) - } catch { - if type(of: expectedError) != type(of: error) { - XCTFail("Expected '\(expectedError)' to be thrown, but got \(error)", line: line) + private func encodeProjectThrows(error expectedError: some Error, line: UInt = #line) { + do { + _ = try PBXProjEncoder(outputSettings: PBXOutputSettings()).encode(proj: proj) + XCTFail("Expected '\(expectedError)' to be thrown", line: line) + } catch { + if type(of: expectedError) != type(of: error) { + XCTFail("Expected '\(expectedError)' to be thrown, but got \(error)", line: line) + } } } - } - private func lines(fromFile file: String) -> [String] { - file.replacingOccurrences(of: "\t", with: "").components(separatedBy: "\n") - } + private func lines(fromFile file: String) -> [String] { + file.replacingOccurrences(of: "\t", with: "").components(separatedBy: "\n") + } - private func loadiOSProject() throws { - proj = try PBXProj(data: iosProjectData()) - } + private func loadiOSProject() throws { + proj = try PBXProj(data: iosProjectData()) + } - private func loadSynchronizedRootGroups() throws { - proj = try PBXProj(data: synchronizedRootGroupsFixture()) - } + private func loadSynchronizedRootGroups() throws { + proj = try PBXProj(data: synchronizedRootGroupsFixture()) + } - private func loadFileSharedAcrossTargetsProject() throws { - proj = try PBXProj(data: fileSharedAcrossTargetsData()) - } + private func loadFileSharedAcrossTargetsProject() throws { + proj = try PBXProj(data: fileSharedAcrossTargetsData()) + } - private func loadTargetWithCustomBuildRulesProject() throws { - proj = try PBXProj(data: targetWithCustomBuildRulesData()) - } + private func loadTargetWithCustomBuildRulesProject() throws { + proj = try PBXProj(data: targetWithCustomBuildRulesData()) + } - private func loadProjectWithXCLocalSwiftPackageReference() throws { - proj = try PBXProj(data: iosProjectWithXCLocalSwiftPackageReference()) - } + private func loadProjectWithXCLocalSwiftPackageReference() throws { + proj = try PBXProj(data: iosProjectWithXCLocalSwiftPackageReference()) + } - private func loadProjectWithXCLocalSwiftPackageReferences() throws { - proj = try PBXProj(data: iosProjectWithXCLocalSwiftPackageReferences()) - } + private func loadProjectWithXCLocalSwiftPackageReferences() throws { + proj = try PBXProj(data: iosProjectWithXCLocalSwiftPackageReferences()) + } - private func loadProjectWithRelativeXCLocalSwiftPackageReference() throws { - proj = try PBXProj(data: iosProjectWithRelativeXCLocalSwiftPackageReferences()) + private func loadProjectWithRelativeXCLocalSwiftPackageReference() throws { + proj = try PBXProj(data: iosProjectWithRelativeXCLocalSwiftPackageReferences()) + } } -} -// MARK: - Line validations + // MARK: - Line validations -private extension [String] { - @discardableResult func validate(line string: String, betweenLine lineAbove: Int, andLine lineBelow: Int, line: UInt = #line) -> Int { - validate(string, using: { $0 == $1 }, betweenLine: lineAbove, andLine: lineBelow, line: line) - } + private extension [String] { + @discardableResult func validate(line string: String, betweenLine lineAbove: Int, andLine lineBelow: Int, line: UInt = #line) -> Int { + validate(string, using: { $0 == $1 }, betweenLine: lineAbove, andLine: lineBelow, line: line) + } - @discardableResult func validate(lineContaining string: String, betweenLine lineAbove: Int, andLine lineBelow: Int, line: UInt = #line) -> Int { - validate(string, using: { $0.contains($1) }, betweenLine: lineAbove, andLine: lineBelow, line: line) - } + @discardableResult func validate(lineContaining string: String, betweenLine lineAbove: Int, andLine lineBelow: Int, line: UInt = #line) -> Int { + validate(string, using: { $0.contains($1) }, betweenLine: lineAbove, andLine: lineBelow, line: line) + } - func validate(_ string: String, using: (String, String) -> Bool, betweenLine lineAbove: Int, andLine lineBelow: Int, line: UInt) -> Int { - let lineNumber = validate(string, using: using, after: lineAbove, line: line) - if lineNumber >= lineBelow { - XCTFail("Expected to find line between lines \(lineAbove) and \(lineBelow), but was found after \(lineBelow).", line: line) + func validate(_ string: String, using: (String, String) -> Bool, betweenLine lineAbove: Int, andLine lineBelow: Int, line: UInt) -> Int { + let lineNumber = validate(string, using: using, after: lineAbove, line: line) + if lineNumber >= lineBelow { + XCTFail("Expected to find line between lines \(lineAbove) and \(lineBelow), but was found after \(lineBelow).", line: line) + } + return lineNumber } - return lineNumber - } - @discardableResult func validate(line string: String, onLineAfter: Int, line: UInt = #line) -> Int { - validate(string, using: { $0 == $1 }, onLineAfter: onLineAfter, line: line) - } + @discardableResult func validate(line string: String, onLineAfter: Int, line: UInt = #line) -> Int { + validate(string, using: { $0 == $1 }, onLineAfter: onLineAfter, line: line) + } - @discardableResult func validate(lineContaining string: String, onLineAfter: Int, line: UInt = #line) -> Int { - validate(string, using: { $0.contains($1) }, onLineAfter: onLineAfter, line: line) - } + @discardableResult func validate(lineContaining string: String, onLineAfter: Int, line: UInt = #line) -> Int { + validate(string, using: { $0.contains($1) }, onLineAfter: onLineAfter, line: line) + } - func validate(_ string: String, using: (String, String) -> Bool, onLineAfter: Int, line: UInt) -> Int { - let lineNumber = validate(string, using: using, after: onLineAfter, line: line) - if lineNumber != onLineAfter + 1 { - XCTFail("Expected to find at line \(onLineAfter + 1), but was found on line \(lineNumber).", line: line) + func validate(_ string: String, using: (String, String) -> Bool, onLineAfter: Int, line: UInt) -> Int { + let lineNumber = validate(string, using: using, after: onLineAfter, line: line) + if lineNumber != onLineAfter + 1 { + XCTFail("Expected to find at line \(onLineAfter + 1), but was found on line \(lineNumber).", line: line) + } + return lineNumber } - return lineNumber - } - @discardableResult func validate(line string: String, after: Int = 0, line: UInt = #line) -> Int { - validate(string, using: { $0 == $1 }, after: after, line: line) - } + @discardableResult func validate(line string: String, after: Int = 0, line: UInt = #line) -> Int { + validate(string, using: { $0 == $1 }, after: after, line: line) + } - @discardableResult func validate(lineContaining string: String, after: Int = 0, line: UInt = #line) -> Int { - validate(string, using: { $0.contains($1) }, after: after, line: line) - } + @discardableResult func validate(lineContaining string: String, after: Int = 0, line: UInt = #line) -> Int { + validate(string, using: { $0.contains($1) }, after: after, line: line) + } - func validate(_ string: String, using: (String, String) -> Bool, after: Int, line: UInt) -> Int { - let lineNumber = findLine(string, matcher: using, after: after) - if lineNumber == endIndex { - XCTFail("Line not found after line \(after)", line: line) + func validate(_ string: String, using: (String, String) -> Bool, after: Int, line: UInt) -> Int { + let lineNumber = findLine(string, matcher: using, after: after) + if lineNumber == endIndex { + XCTFail("Line not found after line \(after)", line: line) + } + return lineNumber } - return lineNumber - } - func findLine(_ string: String, after: Int = 0) -> Int { - findLine(string, matcher: { $0 == $1 }, after: after) - } + func findLine(_ string: String, after: Int = 0) -> Int { + findLine(string, matcher: { $0 == $1 }, after: after) + } - func findLine(containing string: String, after: Int = 0) -> Int { - findLine(string, matcher: { $0.contains($1) }, after: after) - } + func findLine(containing string: String, after: Int = 0) -> Int { + findLine(string, matcher: { $0.contains($1) }, after: after) + } - func findLine(_ string: String, matcher: (String, String) -> Bool, after: Int) -> Int { - for i in after ..< endIndex { - if matcher(self[i], string) { - return i + func findLine(_ string: String, matcher: (String, String) -> Bool, after: Int) -> Int { + for i in after ..< endIndex { + if matcher(self[i], string) { + return i + } } + return endIndex } - return endIndex - } - func log() { - var line = 0 - forEach { - let lineStr = "\(line)" - let lineNo = lineStr + String(repeating: " ", count: 5 - lineStr.count) - print(lineNo, "|", $0) - line += 1 + func log() { + var line = 0 + forEach { + let lineStr = "\(line)" + let lineNo = lineStr + String(repeating: " ", count: 5 - lineStr.count) + print(lineNo, "|", $0) + line += 1 + } } } -} + +#endif diff --git a/Tests/XcodeProjTests/Objects/Project/PBXProjIntegrationTests.swift b/Tests/XcodeProjTests/Objects/Project/PBXProjIntegrationTests.swift index fc442ca7d..570c89e8f 100644 --- a/Tests/XcodeProjTests/Objects/Project/PBXProjIntegrationTests.swift +++ b/Tests/XcodeProjTests/Objects/Project/PBXProjIntegrationTests.swift @@ -1,86 +1,89 @@ -import Foundation -import PathKit -import XCTest -@testable import XcodeProj +#if os(macOS) || (os(Linux) && compiler(>=6.1)) + import Foundation + import PathKit + import XCTest + @testable import XcodeProj -final class PBXProjIntegrationTests: XCTestCase { - func test_init_initializesTheProjCorrectly() { - let data = try! Data(contentsOf: fixturePath().url) - let decoder = XcodeprojPropertyListDecoder() - let proj = try? decoder.decode(PBXProj.self, from: data) - XCTAssertNotNil(proj) - if let proj { - assert(proj: proj) + final class PBXProjIntegrationTests: XCTestCase { + func test_init_initializesTheProjCorrectly() throws { + let data = try XCTUnwrap(Data(contentsOf: fixturePath().url)) + let decoder = XcodeprojPropertyListDecoder() + let proj = try? decoder.decode(PBXProj.self, from: data) + XCTAssertNotNil(proj) + if let proj { + assert(proj: proj) + } } - } - - func test_write() { - testWrite(from: fixturePath(), - initModel: { path -> PBXProj? in - let data = try! Data(contentsOf: path.url) - let decoder = XcodeprojPropertyListDecoder() - return try? decoder.decode(PBXProj.self, from: data) - }, - modify: { $0 }) - } - func test_write_produces_no_diff() throws { - let tmpDir = try Path.uniqueTemporary() - defer { - try? tmpDir.delete() + func test_write() throws { + try testWrite(from: fixturePath(), + initModel: { path -> PBXProj? in + let data = try XCTUnwrap(Data(contentsOf: path.url)) + let decoder = XcodeprojPropertyListDecoder() + return try? decoder.decode(PBXProj.self, from: data) + }, + modify: { $0 }) } - let fixturePath = fixturePath().parent() - let xcodeprojPath = tmpDir + "Project.xcodeproj" - try fixturePath.copy(xcodeprojPath) + func test_write_produces_no_diff() throws { + let tmpDir = try Path.uniqueTemporary() + defer { + try? tmpDir.delete() + } - try tmpDir.chdir { - // Create a commit - try checkedOutput("git", ["init"]) - try checkedOutput("git", ["add", "."]) - try checkedOutput("git", [ - "-c", "user.email=test@example.com", "-c", "user.name=Test User", - "commit", "-m", "test", - ]) + let fixturePath = fixturePath().parent() + let xcodeprojPath = tmpDir + "Project.xcodeproj" + try fixturePath.copy(xcodeprojPath) - // Read/write the project - let project = try XcodeProj(path: xcodeprojPath) - try project.writePBXProj(path: xcodeprojPath, outputSettings: PBXOutputSettings()) + try tmpDir.chdir { + // Create a commit + try checkedOutput("git", ["init"]) + try checkedOutput("git", ["add", "."]) + try checkedOutput("git", [ + "-c", "user.email=test@example.com", "-c", "user.name=Test User", + "commit", "-m", "test", + ]) - let got = try checkedOutput("git", ["status"]) - XCTAssertTrue(got?.contains("nothing to commit") ?? false) + // Read/write the project + let project = try XcodeProj(path: xcodeprojPath) + try project.writePBXProj(path: xcodeprojPath, outputSettings: PBXOutputSettings()) + + let got = try checkedOutput("git", ["status"]) + XCTAssertTrue(got?.contains("nothing to commit") ?? false) + } } - } - private func fixturePath() -> Path { - let path = fixturesPath() + "iOS/Project.xcodeproj/project.pbxproj" - return path - } + private func fixturePath() -> Path { + let path = fixturesPath() + "iOS/Project.xcodeproj/project.pbxproj" + return path + } - private func assert(proj: PBXProj) { - XCTAssertEqual(proj.archiveVersion, 1) - XCTAssertEqual(proj.objectVersion, 52) - XCTAssertEqual(proj.classes.count, 0) - XCTAssertEqual(proj.objects.buildFiles.count, 13) - XCTAssertEqual(proj.objects.aggregateTargets.count, 0) - XCTAssertEqual(proj.objects.containerItemProxies.count, 1) - XCTAssertEqual(proj.objects.copyFilesBuildPhases.count, 1) - XCTAssertEqual(proj.objects.groups.count, 6) - XCTAssertEqual(proj.objects.configurationLists.count, 3) - XCTAssertEqual(proj.objects.buildConfigurations.count, 6) - XCTAssertEqual(proj.objects.variantGroups.count, 2) - XCTAssertEqual(proj.objects.targetDependencies.count, 1) - XCTAssertEqual(proj.objects.sourcesBuildPhases.count, 2) - XCTAssertEqual(proj.objects.shellScriptBuildPhases.count, 1) - XCTAssertEqual(proj.objects.resourcesBuildPhases.count, 2) - XCTAssertEqual(proj.objects.frameworksBuildPhases.count, 2) - XCTAssertEqual(proj.objects.headersBuildPhases.count, 1) - XCTAssertEqual(proj.objects.nativeTargets.count, 2) - XCTAssertEqual(proj.objects.fileReferences.count, 17) - XCTAssertEqual(proj.objects.buildRules.count, 1) - XCTAssertEqual(proj.objects.versionGroups.count, 1) - XCTAssertEqual(proj.objects.projects.count, 1) - XCTAssertEqual(proj.objects.swiftPackageProductDependencies.count, 2) - XCTAssertEqual(proj.objects.remoteSwiftPackageReferences.count, 1) + private func assert(proj: PBXProj) { + XCTAssertEqual(proj.archiveVersion, 1) + XCTAssertEqual(proj.objectVersion, 52) + XCTAssertEqual(proj.classes.count, 0) + XCTAssertEqual(proj.objects.buildFiles.count, 13) + XCTAssertEqual(proj.objects.aggregateTargets.count, 0) + XCTAssertEqual(proj.objects.containerItemProxies.count, 1) + XCTAssertEqual(proj.objects.copyFilesBuildPhases.count, 1) + XCTAssertEqual(proj.objects.groups.count, 6) + XCTAssertEqual(proj.objects.configurationLists.count, 3) + XCTAssertEqual(proj.objects.buildConfigurations.count, 6) + XCTAssertEqual(proj.objects.variantGroups.count, 2) + XCTAssertEqual(proj.objects.targetDependencies.count, 1) + XCTAssertEqual(proj.objects.sourcesBuildPhases.count, 2) + XCTAssertEqual(proj.objects.shellScriptBuildPhases.count, 1) + XCTAssertEqual(proj.objects.resourcesBuildPhases.count, 2) + XCTAssertEqual(proj.objects.frameworksBuildPhases.count, 2) + XCTAssertEqual(proj.objects.headersBuildPhases.count, 1) + XCTAssertEqual(proj.objects.nativeTargets.count, 2) + XCTAssertEqual(proj.objects.fileReferences.count, 17) + XCTAssertEqual(proj.objects.buildRules.count, 1) + XCTAssertEqual(proj.objects.versionGroups.count, 1) + XCTAssertEqual(proj.objects.projects.count, 1) + XCTAssertEqual(proj.objects.swiftPackageProductDependencies.count, 2) + XCTAssertEqual(proj.objects.remoteSwiftPackageReferences.count, 1) + } } -} + +#endif diff --git a/Tests/XcodeProjTests/Objects/Project/PBXProjectTests.swift b/Tests/XcodeProjTests/Objects/Project/PBXProjectTests.swift index ba48a65f1..4d767bd15 100644 --- a/Tests/XcodeProjTests/Objects/Project/PBXProjectTests.swift +++ b/Tests/XcodeProjTests/Objects/Project/PBXProjectTests.swift @@ -18,7 +18,40 @@ final class PBXProjectTests: XCTestCase { attributes: ["LastUpgradeCheck": "0940"], targetAttributes: [target: ["TestTargetID": "123"]]) - project.setTargetAttributes(["custom": "abc", "TestTargetID": testTarget], target: target) + project.setTargetAttributes(["custom": "abc", "TestTargetID": .targetReference(testTarget)], target: target) + + let plist = try project.plistKeyAndValue(proj: PBXProj(), reference: "") + let attributes = plist.value.dictionary?["attributes"]?.dictionary ?? [:] + + let expectedAttributes: [CommentedString: PlistValue] = [ + "LastUpgradeCheck": "0940", + "TargetAttributes": ["app": [ + "custom": "abc", + "TestTargetID": "test", + ]], + ] + XCTAssertEqual(attributes, expectedAttributes) + } + + func test_attributes_writes_fixed_value_correctly() throws { + let target = PBXTarget(name: "") + target.reference.fix("app") + + let testTarget = PBXTarget(name: "") + + let project = PBXProject(name: "", + buildConfigurationList: XCConfigurationList(), + compatibilityVersion: "", + preferredProjectObjectVersion: nil, + minimizedProjectReferenceProxies: nil, + mainGroup: PBXGroup(), + attributes: ["LastUpgradeCheck": "0940"], + targetAttributes: [target: ["TestTargetID": "123"]]) + + project.setTargetAttributes(["custom": "abc", "TestTargetID": .targetReference(testTarget)], target: target) + + // When writing the project we need to account for any mutation of the object that may have occurred after being added to the project. + testTarget.reference.fix("test") let plist = try project.plistKeyAndValue(proj: PBXProj(), reference: "") let attributes = plist.value.dictionary?["attributes"]?.dictionary ?? [:] @@ -48,7 +81,7 @@ final class PBXProjectTests: XCTestCase { minimizedProjectReferenceProxies: nil, mainGroup: PBXGroup()) - project.setTargetAttributes(["custom": "abc", "TestTargetID": testTarget], target: target) + project.setTargetAttributes(["custom": "abc", "TestTargetID": .targetReference(testTarget)], target: target) // When let plist = try project.plistKeyAndValue(proj: PBXProj(), reference: "") diff --git a/Tests/XcodeProjTests/Project/XCBreakpointListTests.swift b/Tests/XcodeProjTests/Project/XCBreakpointListTests.swift index 1d1da4d8b..5def85b4e 100644 --- a/Tests/XcodeProjTests/Project/XCBreakpointListTests.swift +++ b/Tests/XcodeProjTests/Project/XCBreakpointListTests.swift @@ -17,11 +17,11 @@ final class XCBreakpointListIntegrationTests: XCTestCase { } } - func test_write() { - testWrite(from: fixturePath(), - initModel: { try? XCBreakpointList(path: $0) }, - modify: { $0 }, - assertion: { assert(breakpointList: $1) }) + func test_write() throws { + try testWrite(from: fixturePath(), + initModel: { try? XCBreakpointList(path: $0) }, + modify: { $0 }, + assertion: { assert(breakpointList: $1) }) } // MARK: - Private diff --git a/Tests/XcodeProjTests/Project/XCUserDataTests.swift b/Tests/XcodeProjTests/Project/XCUserDataTests.swift index 1918584f1..36ab2db26 100644 --- a/Tests/XcodeProjTests/Project/XCUserDataTests.swift +++ b/Tests/XcodeProjTests/Project/XCUserDataTests.swift @@ -9,17 +9,17 @@ final class XCUserDataTests: XCTestCase { assert(userData: subject, userName: "username1") } - func test_write_userData() { - testWrite(from: userDataPath, - initModel: { try? XCUserData(path: $0) }, - modify: { userData in - // XCScheme's that are already in place (the removed element) should not be removed by a write - userData.schemes = userData.schemes.filter { $0.name != "iOS-other" } - return userData - }, - assertion: { - assert(userData: $1, userName: "copy") - }) + func test_write_userData() throws { + try testWrite(from: userDataPath, + initModel: { try? XCUserData(path: $0) }, + modify: { userData in + // XCScheme's that are already in place (the removed element) should not be removed by a write + userData.schemes = userData.schemes.filter { $0.name != "iOS-other" } + return userData + }, + assertion: { + assert(userData: $1, userName: "copy") + }) } func test_read_write_produces_no_diff() throws { diff --git a/Tests/XcodeProjTests/Project/XcodeProjIntegrationTests.swift b/Tests/XcodeProjTests/Project/XcodeProjIntegrationTests.swift index 374515c8b..f3bd72571 100644 --- a/Tests/XcodeProjTests/Project/XcodeProjIntegrationTests.swift +++ b/Tests/XcodeProjTests/Project/XcodeProjIntegrationTests.swift @@ -1,111 +1,114 @@ -import Foundation -import PathKit -import XCTest -@testable import XcodeProj - -final class XcodeProjIntegrationTests: XCTestCase { - func test_write_xcode16Project() throws { - try testReadWriteProducesNoDiff(from: xcode16ProjectPath, - initModel: XcodeProj.init(path:)) +#if os(macOS) || (os(Linux) && compiler(>=6.1)) + import Foundation + import PathKit + import XCTest + @testable import XcodeProj + + final class XcodeProjIntegrationTests: XCTestCase { + func test_write_xcode16Project() throws { + try testReadWriteProducesNoDiff(from: xcode16ProjectPath, + initModel: XcodeProj.init(path:)) + } + + func test_read_iosXcodeProj() throws { + let subject = try XcodeProj(path: iosProjectPath) + assert(project: subject) + } + + func test_write_iosXcodeProj() throws { + try testWrite(from: iosProjectPath, + initModel: { try? XcodeProj(path: $0) }, + modify: { project in + // XCUserData that is already in place (the removed element) should not be removed by a write + _ = project.userData.removeLast() + return project + }, + assertion: { assert(project: $1) }) + } + + func test_read_write_produces_no_diff() throws { + try testReadWriteProducesNoDiff(from: iosProjectPath, + initModel: XcodeProj.init(path:)) + } + + func test_read_write_produces_no_diff_when_synchronizedRootGroupsFixture() throws { + try testReadWriteProducesNoDiff(from: synchronizedRootGroupsFixturePath, + initModel: XcodeProj.init(path:)) + } + + func test_initialize_PBXProj_with_data() throws { + // Given + let pbxprojPath = iosProjectPath + "project.pbxproj" + let pbxprojFromDisk = try PBXProj(path: pbxprojPath) + let pbxprojData = try Data(contentsOf: pbxprojPath.url) + + // When + let pbxprojFromData = try PBXProj(data: pbxprojData) + try pbxprojFromData.updateProjectName(path: pbxprojPath) + + // Then + XCTAssertEqual(pbxprojFromData, pbxprojFromDisk) + } + + func test_write_includes_workspace_settings() throws { + // Define workspace settings that should be written + let workspaceSettings = WorkspaceSettings(buildSystem: .new, derivedDataLocationStyle: .default, autoCreateSchemes: false) + + try testWrite(from: iosProjectPath, + initModel: { try? XcodeProj(path: $0) }, + modify: { project in + project.sharedData?.workspaceSettings = workspaceSettings + return project + }, + assertion: { + /** + * Expect that the workspace settings read from file are equal to the + * workspace settings we expected to write. + */ + XCTAssertEqual($1.sharedData?.workspaceSettings, workspaceSettings) + }) + } + + // MARK: - Private + + private func assert(project: XcodeProj) { + // Workspace + XCTAssertEqual(project.workspace.data.children.count, 1) + + // Project + XCTAssertEqual(project.pbxproj.objects.buildFiles.count, 13) + + // Shared Data + XCTAssertNotNil(project.sharedData) + XCTAssertEqual(project.sharedData?.schemes.count, 1) + XCTAssertNotNil(project.sharedData?.breakpoints) + XCTAssertNil(project.sharedData?.workspaceSettings) + + // User Data + XCTAssertEqual(project.userData.count, 3) + + XCTAssertEqual(project.userData[0].userName, "username1") + XCTAssertEqual(project.userData[0].schemes.count, 3) + XCTAssertEqual(project.userData[0].breakpoints?.breakpoints.count, 2) + XCTAssertNotNil(project.userData[0].schemeManagement) + + XCTAssertEqual(project.userData[1].userName, "username2") + XCTAssertEqual(project.userData[1].schemes.count, 1) + XCTAssertNil(project.userData[1].breakpoints?.breakpoints) + XCTAssertNil(project.userData[1].schemeManagement) + } + + private var iosProjectPath: Path { + fixturesPath() + "iOS/Project.xcodeproj" + } + + private var xcode16ProjectPath: Path { + fixturesPath() + "Xcode16/Test.xcodeproj" + } + + private var synchronizedRootGroupsFixturePath: Path { + fixturesPath() + "SynchronizedRootGroups/SynchronizedRootGroups.xcodeproj" + } } - func test_read_iosXcodeProj() throws { - let subject = try XcodeProj(path: iosProjectPath) - assert(project: subject) - } - - func test_write_iosXcodeProj() { - testWrite(from: iosProjectPath, - initModel: { try? XcodeProj(path: $0) }, - modify: { project in - // XCUserData that is already in place (the removed element) should not be removed by a write - _ = project.userData.removeLast() - return project - }, - assertion: { assert(project: $1) }) - } - - func test_read_write_produces_no_diff() throws { - try testReadWriteProducesNoDiff(from: iosProjectPath, - initModel: XcodeProj.init(path:)) - } - - func test_read_write_produces_no_diff_when_synchronizedRootGroupsFixture() throws { - try testReadWriteProducesNoDiff(from: synchronizedRootGroupsFixturePath, - initModel: XcodeProj.init(path:)) - } - - func test_initialize_PBXProj_with_data() throws { - // Given - let pbxprojPath = iosProjectPath + "project.pbxproj" - let pbxprojFromDisk = try PBXProj(path: pbxprojPath) - let pbxprojData = try Data(contentsOf: pbxprojPath.url) - - // When - let pbxprojFromData = try PBXProj(data: pbxprojData) - try pbxprojFromData.updateProjectName(path: pbxprojPath) - - // Then - XCTAssertEqual(pbxprojFromData, pbxprojFromDisk) - } - - func test_write_includes_workspace_settings() throws { - // Define workspace settings that should be written - let workspaceSettings = WorkspaceSettings(buildSystem: .new, derivedDataLocationStyle: .default, autoCreateSchemes: false) - - testWrite(from: iosProjectPath, - initModel: { try? XcodeProj(path: $0) }, - modify: { project in - project.sharedData?.workspaceSettings = workspaceSettings - return project - }, - assertion: { - /** - * Expect that the workspace settings read from file are equal to the - * workspace settings we expected to write. - */ - XCTAssertEqual($1.sharedData?.workspaceSettings, workspaceSettings) - }) - } - - // MARK: - Private - - private func assert(project: XcodeProj) { - // Workspace - XCTAssertEqual(project.workspace.data.children.count, 1) - - // Project - XCTAssertEqual(project.pbxproj.objects.buildFiles.count, 13) - - // Shared Data - XCTAssertNotNil(project.sharedData) - XCTAssertEqual(project.sharedData?.schemes.count, 1) - XCTAssertNotNil(project.sharedData?.breakpoints) - XCTAssertNil(project.sharedData?.workspaceSettings) - - // User Data - XCTAssertEqual(project.userData.count, 3) - - XCTAssertEqual(project.userData[0].userName, "username1") - XCTAssertEqual(project.userData[0].schemes.count, 3) - XCTAssertEqual(project.userData[0].breakpoints?.breakpoints.count, 2) - XCTAssertNotNil(project.userData[0].schemeManagement) - - XCTAssertEqual(project.userData[1].userName, "username2") - XCTAssertEqual(project.userData[1].schemes.count, 1) - XCTAssertNil(project.userData[1].breakpoints?.breakpoints) - XCTAssertNil(project.userData[1].schemeManagement) - } - - private var iosProjectPath: Path { - fixturesPath() + "iOS/Project.xcodeproj" - } - - private var xcode16ProjectPath: Path { - fixturesPath() + "Xcode16/Test.xcodeproj" - } - - private var synchronizedRootGroupsFixturePath: Path { - fixturesPath() + "SynchronizedRootGroups/SynchronizedRootGroups.xcodeproj" - } -} +#endif diff --git a/Tests/XcodeProjTests/Scheme/XCSchemeTests.swift b/Tests/XcodeProjTests/Scheme/XCSchemeTests.swift index 9d57bf8b1..70058b778 100644 --- a/Tests/XcodeProjTests/Scheme/XCSchemeTests.swift +++ b/Tests/XcodeProjTests/Scheme/XCSchemeTests.swift @@ -9,11 +9,11 @@ final class XCSchemeIntegrationTests: XCTestCase { assert(scheme: subject) } - func test_write_iosScheme() { - testWrite(from: iosSchemePath, - initModel: { try? XCScheme(path: $0) }, - modify: { $0 }, - assertion: { assert(scheme: $1) }) + func test_write_iosScheme() throws { + try testWrite(from: iosSchemePath, + initModel: { try? XCScheme(path: $0) }, + modify: { $0 }, + assertion: { assert(scheme: $1) }) } func test_read_write_produces_no_diff() throws { @@ -42,11 +42,11 @@ final class XCSchemeIntegrationTests: XCTestCase { XCTAssertEqual(remoteRunnable.remotePath, "/var/containers/Bundle/Application/018F0933-05E8-4359-9955-39E0523C4246/Ava.app") } - func test_write_runnableWithoutBuildableReferenceScheme() { - testWrite(from: runnableWithoutBuildableReferenceSchemePath, - initModel: { try? XCScheme(path: $0) }, - modify: { $0 }, - assertion: { assert(runnableWithoutBuildableReferenceScheme: $1) }) + func test_write_runnableWithoutBuildableReferenceScheme() throws { + try testWrite(from: runnableWithoutBuildableReferenceSchemePath, + initModel: { try? XCScheme(path: $0) }, + modify: { $0 }, + assertion: { assert(runnableWithoutBuildableReferenceScheme: $1) }) } func test_read_minimalScheme() { @@ -58,11 +58,11 @@ final class XCSchemeIntegrationTests: XCTestCase { } } - func test_write_minimalScheme() { - testWrite(from: minimalSchemePath, - initModel: { try? XCScheme(path: $0) }, - modify: { $0 }, - assertion: { assert(minimalScheme: $1) }) + func test_write_minimalScheme() throws { + try testWrite(from: minimalSchemePath, + initModel: { try? XCScheme(path: $0) }, + modify: { $0 }, + assertion: { assert(minimalScheme: $1) }) } func test_write_testableReferenceDefaultAttributesValuesAreOmitted() { @@ -85,7 +85,7 @@ final class XCSchemeIntegrationTests: XCTestCase { XCTAssertNil(subject.attributes["useTestSelectionWhitelist"]) } - func test_write_testableReferenceAttributesValues_allParallelizable() { + func test_write_testableReferenceAttributesValues_allParallelization() { let reference = XCScheme.TestableReference( skipped: false, parallelization: .all, @@ -107,7 +107,7 @@ final class XCSchemeIntegrationTests: XCTestCase { XCTAssertEqual(subject.attributes["testExecutionOrdering"], "random") } - func test_write_testableReferenceAttributesValues_noneParallelizable() { + func test_write_testableReferenceAttributesValues_noneParallelization() { let reference = XCScheme.TestableReference( skipped: false, parallelization: .none, @@ -129,10 +129,10 @@ final class XCSchemeIntegrationTests: XCTestCase { XCTAssertEqual(subject.attributes["testExecutionOrdering"], "random") } - func test_write_testableReferenceAttributesValues_trueParallelizable() { + func test_write_testableReferenceAttributesValues_swiftTestingOnlyParallelization() { let reference = XCScheme.TestableReference( skipped: false, - parallelizable: true, + parallelization: .swiftTestingOnly, randomExecutionOrdering: true, buildableReference: XCScheme.BuildableReference( referencedContainer: "", @@ -151,32 +151,10 @@ final class XCSchemeIntegrationTests: XCTestCase { XCTAssertEqual(subject.attributes["testExecutionOrdering"], "random") } - func test_write_testableReferenceAttributesValues_falseParallelizable() { - let reference = XCScheme.TestableReference( - skipped: false, - parallelizable: false, - randomExecutionOrdering: true, - buildableReference: XCScheme.BuildableReference( - referencedContainer: "", - blueprint: PBXObject(), - buildableName: "", - blueprintName: "" - ), - skippedTests: [], - selectedTests: [], - useTestSelectionWhitelist: true - ) - let subject = reference.xmlElement() - XCTAssertEqual(subject.attributes["skipped"], "NO") - XCTAssertEqual(subject.attributes["parallelizable"], "NO") - XCTAssertEqual(subject.attributes["useTestSelectionWhitelist"], "YES") - XCTAssertEqual(subject.attributes["testExecutionOrdering"], "random") - } - - func test_computed_parallelizable_testableReference_false() { + func test_computed_parallelization_testableReference_none() { let reference = XCScheme.TestableReference( skipped: false, - parallelizable: false, + parallelization: .none, randomExecutionOrdering: true, buildableReference: XCScheme.BuildableReference( referencedContainer: "", @@ -189,30 +167,9 @@ final class XCSchemeIntegrationTests: XCTestCase { useTestSelectionWhitelist: true ) - XCTAssertEqual(reference.parallelizable, false) XCTAssertEqual(reference.parallelization, .none) } - func test_computed_parallelizable_testableReference_true() { - let reference = XCScheme.TestableReference( - skipped: false, - parallelizable: true, - randomExecutionOrdering: true, - buildableReference: XCScheme.BuildableReference( - referencedContainer: "", - blueprint: PBXObject(), - buildableName: "", - blueprintName: "" - ), - skippedTests: [], - selectedTests: [], - useTestSelectionWhitelist: true - ) - - XCTAssertEqual(reference.parallelizable, true) - XCTAssertEqual(reference.parallelization, .swiftTestingOnly) - } - func test_write_testableReferenceSelectedTests() { // Given let reference = XCScheme.TestableReference( @@ -503,7 +460,6 @@ final class XCSchemeIntegrationTests: XCTestCase { XCTAssertEqual(scheme.testAction?.codeCoverageEnabled, true) XCTAssertEqual(scheme.testAction?.onlyGenerateCoverageForSpecifiedTargets, true) XCTAssertEqual(scheme.testAction?.testables.first?.skipped, false) - XCTAssertEqual(scheme.testAction?.testables.first?.parallelizable, true) XCTAssertEqual(scheme.testAction?.testables.first?.parallelization, .swiftTestingOnly) XCTAssertEqual(scheme.testAction?.testables.first?.randomExecutionOrdering, false) XCTAssertEqual(scheme.testAction?.testables.first?.useTestSelectionWhitelist, false) diff --git a/Tests/XcodeProjTests/Tests/Fixtures.swift b/Tests/XcodeProjTests/Tests/Fixtures.swift index 24deecb17..7fbb031de 100644 --- a/Tests/XcodeProjTests/Tests/Fixtures.swift +++ b/Tests/XcodeProjTests/Tests/Fixtures.swift @@ -3,7 +3,7 @@ import PathKit @testable import XcodeProj func fixturesPath() -> Path { - Path(#file).parent().parent().parent().parent() + "Fixtures" + Path(#filePath).parent().parent().parent().parent() + "Fixtures" } func synchronizedRootGroupsFixture() throws -> Data { diff --git a/Tests/XcodeProjTests/Tests/testWrite.swift b/Tests/XcodeProjTests/Tests/testWrite.swift index 44d719d58..5362af16d 100644 --- a/Tests/XcodeProjTests/Tests/testWrite.swift +++ b/Tests/XcodeProjTests/Tests/testWrite.swift @@ -6,29 +6,29 @@ import XCTest func testWrite(file _: StaticString = #file, line _: UInt = #line, from path: Path, - initModel: (Path) -> T?, - modify: (T) -> T) + initModel: (Path) throws -> T?, + modify: (T) -> T) throws { - testWrite(from: path, initModel: initModel, modify: modify, assertion: { XCTAssertEqual($0, $1) }) + try testWrite(from: path, initModel: initModel, modify: modify, assertion: { XCTAssertEqual($0, $1) }) } -func testWrite(file: StaticString = #file, +func testWrite(file: StaticString = #filePath, line: UInt = #line, from path: Path, - initModel: (Path) -> T?, + initModel: (Path) throws -> T?, modify: (T) -> T, - assertion: (_ before: T, _ after: T) -> Void) + assertion: (_ before: T, _ after: T) -> Void) throws { let copyPath = path.parent() + "copy.\(path.extension!)" try? copyPath.delete() try? path.copy(copyPath) - let got = initModel(copyPath) + let got = try initModel(copyPath) XCTAssertNotNil(got, file: file, line: line) if let got { let modified = modify(got) do { try modified.write(path: copyPath, override: true) - let gotAfterWriting = initModel(copyPath) + let gotAfterWriting = try initModel(copyPath) XCTAssertNotNil(gotAfterWriting, file: file, line: line) if let gotAfterWriting { assertion(got, gotAfterWriting) diff --git a/Tests/XcodeProjTests/Utils/BuildSettingsProviderTests.swift b/Tests/XcodeProjTests/Utils/BuildSettingsProviderTests.swift index 7630c5f10..747bbb375 100644 --- a/Tests/XcodeProjTests/Utils/BuildSettingsProviderTests.swift +++ b/Tests/XcodeProjTests/Utils/BuildSettingsProviderTests.swift @@ -9,9 +9,7 @@ class BuildSettingProviderTests: XCTestCase { platform: .iOS, product: .application, swift: true) - - // Then - assertEqualSettings(results, [ + let expected: BuildSettings = [ "ASSETCATALOG_COMPILER_APPICON_NAME": "AppIcon", "ENABLE_PREVIEWS": "YES", "CODE_SIGN_IDENTITY": "iPhone Developer", @@ -23,7 +21,10 @@ class BuildSettingProviderTests: XCTestCase { "SWIFT_COMPILATION_MODE": "wholemodule", "SWIFT_OPTIMIZATION_LEVEL": "-Owholemodule", "TARGETED_DEVICE_FAMILY": "1,2", - ]) + ] + + // Then + XCTAssertEqual(results, expected) } func test_targetSettings_iosFramework() { @@ -32,9 +33,7 @@ class BuildSettingProviderTests: XCTestCase { platform: .iOS, product: .framework, swift: true) - - // Then - assertEqualSettings(results, [ + let expected: BuildSettings = [ "CODE_SIGN_IDENTITY": "", "CURRENT_PROJECT_VERSION": "1", "DEFINES_MODULE": "YES", @@ -55,7 +54,10 @@ class BuildSettingProviderTests: XCTestCase { "TARGETED_DEVICE_FAMILY": "1,2", "VERSIONING_SYSTEM": "apple-generic", "VERSION_INFO_PREFIX": "", - ]) + ] + + // Then + XCTAssertEqual(results, expected) } func test_targetSettings_iosExtension() { @@ -64,9 +66,7 @@ class BuildSettingProviderTests: XCTestCase { platform: .iOS, product: .appExtension, swift: true) - - // Then - assertEqualSettings(results, [ + let expected: BuildSettings = [ "CODE_SIGN_IDENTITY": "iPhone Developer", "LD_RUNPATH_SEARCH_PATHS": [ "$(inherited)", @@ -77,7 +77,9 @@ class BuildSettingProviderTests: XCTestCase { "SWIFT_COMPILATION_MODE": "wholemodule", "SWIFT_OPTIMIZATION_LEVEL": "-Owholemodule", "TARGETED_DEVICE_FAMILY": "1,2", - ]) + ] + // Then + XCTAssertEqual(results, expected) } func test_targetSettings_macOSAplication() { @@ -87,8 +89,7 @@ class BuildSettingProviderTests: XCTestCase { product: .application, swift: true) - // Then - assertEqualSettings(results, [ + let expected: BuildSettings = [ "ASSETCATALOG_COMPILER_APPICON_NAME": "AppIcon", "ENABLE_PREVIEWS": "YES", "CODE_SIGN_IDENTITY": "-", @@ -100,7 +101,9 @@ class BuildSettingProviderTests: XCTestCase { "SDKROOT": "macosx", "SWIFT_COMPILATION_MODE": "wholemodule", "SWIFT_OPTIMIZATION_LEVEL": "-Owholemodule", - ]) + ] + // Then + XCTAssertEqual(results, expected) } func test_targetSettings_tvOSAplication() { @@ -110,8 +113,7 @@ class BuildSettingProviderTests: XCTestCase { product: .application, swift: true) - // Then - assertEqualSettings(results, [ + let expected: BuildSettings = [ "ASSETCATALOG_COMPILER_APPICON_NAME": "App Icon & Top Shelf Image", "ENABLE_PREVIEWS": "YES", "ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME": "LaunchImage", @@ -123,7 +125,10 @@ class BuildSettingProviderTests: XCTestCase { "SWIFT_COMPILATION_MODE": "wholemodule", "SWIFT_OPTIMIZATION_LEVEL": "-Owholemodule", "TARGETED_DEVICE_FAMILY": "3", - ]) + ] + + // Then + XCTAssertEqual(results, expected) } func test_targetSettings_watchOSAplication() { @@ -133,8 +138,7 @@ class BuildSettingProviderTests: XCTestCase { product: .application, swift: true) - // Then - assertEqualSettings(results, [ + let expected: BuildSettings = [ "ASSETCATALOG_COMPILER_APPICON_NAME": "AppIcon", "ENABLE_PREVIEWS": "YES", "LD_RUNPATH_SEARCH_PATHS": ["$(inherited)", "@executable_path/Frameworks"], @@ -143,7 +147,9 @@ class BuildSettingProviderTests: XCTestCase { "SWIFT_COMPILATION_MODE": "wholemodule", "SWIFT_OPTIMIZATION_LEVEL": "-Owholemodule", "TARGETED_DEVICE_FAMILY": "4", - ]) + ] + + XCTAssertEqual(results, expected) } func test_targetSettings_watchOSFramework() { @@ -154,7 +160,7 @@ class BuildSettingProviderTests: XCTestCase { swift: true) // Then - assertEqualSettings(results, [ + let expected: BuildSettings = [ "APPLICATION_EXTENSION_API_ONLY": "YES", "CODE_SIGN_IDENTITY": "", "CURRENT_PROJECT_VERSION": "1", @@ -176,7 +182,9 @@ class BuildSettingProviderTests: XCTestCase { "TARGETED_DEVICE_FAMILY": "4", "VERSIONING_SYSTEM": "apple-generic", "VERSION_INFO_PREFIX": "", - ]) + ] + + XCTAssertEqual(results, expected) } func test_targetSettings_watchOSExtension() { @@ -187,7 +195,7 @@ class BuildSettingProviderTests: XCTestCase { swift: true) // Then - assertEqualSettings(results, [ + let expected: BuildSettings = [ "LD_RUNPATH_SEARCH_PATHS": [ "$(inherited)", "@executable_path/Frameworks", @@ -198,7 +206,9 @@ class BuildSettingProviderTests: XCTestCase { "SWIFT_COMPILATION_MODE": "wholemodule", "SWIFT_OPTIMIZATION_LEVEL": "-Owholemodule", "TARGETED_DEVICE_FAMILY": "4", - ]) + ] + + XCTAssertEqual(results, expected) } func test_targetSettings_visionOSAplication() { @@ -209,7 +219,7 @@ class BuildSettingProviderTests: XCTestCase { swift: true) // Then - assertEqualSettings(results, [ + let expected: BuildSettings = [ "CODE_SIGN_IDENTITY": "iPhone Developer", "ASSETCATALOG_COMPILER_APPICON_NAME": "AppIcon", "ENABLE_PREVIEWS": "YES", @@ -221,7 +231,9 @@ class BuildSettingProviderTests: XCTestCase { "SWIFT_COMPILATION_MODE": "wholemodule", "SWIFT_OPTIMIZATION_LEVEL": "-Owholemodule", "TARGETED_DEVICE_FAMILY": "1,2,7", - ]) + ] + + XCTAssertEqual(results, expected) } func test_targetSettings_visionOSFramework() { @@ -232,7 +244,7 @@ class BuildSettingProviderTests: XCTestCase { swift: true) // Then - assertEqualSettings(results, [ + let expected: BuildSettings = [ "CODE_SIGN_IDENTITY": "", "CURRENT_PROJECT_VERSION": "1", "DEFINES_MODULE": "YES", @@ -253,7 +265,9 @@ class BuildSettingProviderTests: XCTestCase { "TARGETED_DEVICE_FAMILY": "1,2,7", "VERSIONING_SYSTEM": "apple-generic", "VERSION_INFO_PREFIX": "", - ]) + ] + + XCTAssertEqual(results, expected) } func test_targetSettings_visionOSExtension() { @@ -264,7 +278,7 @@ class BuildSettingProviderTests: XCTestCase { swift: true) // Then - assertEqualSettings(results, [ + let expected: BuildSettings = [ "CODE_SIGN_IDENTITY": "iPhone Developer", "LD_RUNPATH_SEARCH_PATHS": [ "$(inherited)", @@ -275,7 +289,9 @@ class BuildSettingProviderTests: XCTestCase { "SWIFT_COMPILATION_MODE": "wholemodule", "SWIFT_OPTIMIZATION_LEVEL": "-Owholemodule", "TARGETED_DEVICE_FAMILY": "1,2,7", - ]) + ] + + XCTAssertEqual(results, expected) } func test_targetSettings_iOSUnitTests() { @@ -285,8 +301,7 @@ class BuildSettingProviderTests: XCTestCase { product: .unitTests, swift: true) - // Then - assertEqualSettings(results, [ + let expected: BuildSettings = [ "CODE_SIGN_IDENTITY": "iPhone Developer", "SDKROOT": "iphoneos", "LD_RUNPATH_SEARCH_PATHS": [ @@ -298,7 +313,10 @@ class BuildSettingProviderTests: XCTestCase { "SWIFT_COMPILATION_MODE": "singlefile", "SWIFT_OPTIMIZATION_LEVEL": "-Onone", "TARGETED_DEVICE_FAMILY": "1,2", - ]) + ] + + // Then + XCTAssertEqual(results, expected) } func test_targetSettings_iOSUITests() { @@ -307,9 +325,7 @@ class BuildSettingProviderTests: XCTestCase { platform: .iOS, product: .uiTests, swift: true) - - // Then - assertEqualSettings(results, [ + let expected: BuildSettings = [ "CODE_SIGN_IDENTITY": "iPhone Developer", "SDKROOT": "iphoneos", "LD_RUNPATH_SEARCH_PATHS": [ @@ -321,7 +337,10 @@ class BuildSettingProviderTests: XCTestCase { "SWIFT_COMPILATION_MODE": "singlefile", "SWIFT_OPTIMIZATION_LEVEL": "-Onone", "TARGETED_DEVICE_FAMILY": "1,2", - ]) + ] + + // Then + XCTAssertEqual(results, expected) } func test_targetSettings_macOSUnitTests() { @@ -331,8 +350,7 @@ class BuildSettingProviderTests: XCTestCase { product: .unitTests, swift: true) - // Then - assertEqualSettings(results, [ + let expected: BuildSettings = [ "CODE_SIGN_IDENTITY": "-", "SDKROOT": "macosx", "LD_RUNPATH_SEARCH_PATHS": [ @@ -343,7 +361,10 @@ class BuildSettingProviderTests: XCTestCase { "SWIFT_ACTIVE_COMPILATION_CONDITIONS": ["$(inherited)", "DEBUG"], "SWIFT_COMPILATION_MODE": "singlefile", "SWIFT_OPTIMIZATION_LEVEL": "-Onone", - ]) + ] + + // Then + XCTAssertEqual(results, expected) } func test_targetSettings_tvOSUnitTests() { @@ -352,9 +373,7 @@ class BuildSettingProviderTests: XCTestCase { platform: .tvOS, product: .unitTests, swift: true) - - // Then - assertEqualSettings(results, [ + let expected: BuildSettings = [ "SDKROOT": "appletvos", "LD_RUNPATH_SEARCH_PATHS": [ "$(inherited)", @@ -365,7 +384,10 @@ class BuildSettingProviderTests: XCTestCase { "SWIFT_COMPILATION_MODE": "singlefile", "SWIFT_OPTIMIZATION_LEVEL": "-Onone", "TARGETED_DEVICE_FAMILY": "3", - ]) + ] + + // Then + XCTAssertEqual(results, expected) } func test_targetSettings_visionOSUnitTests() { @@ -376,7 +398,7 @@ class BuildSettingProviderTests: XCTestCase { swift: true) // Then - assertEqualSettings(results, [ + let expected: BuildSettings = [ "CODE_SIGN_IDENTITY": "iPhone Developer", "SDKROOT": "xros", "LD_RUNPATH_SEARCH_PATHS": [ @@ -388,7 +410,9 @@ class BuildSettingProviderTests: XCTestCase { "SWIFT_COMPILATION_MODE": "singlefile", "SWIFT_OPTIMIZATION_LEVEL": "-Onone", "TARGETED_DEVICE_FAMILY": "1,2,7", - ]) + ] + + XCTAssertEqual(results, expected) } func test_targetSettings_visionOSUITests() { @@ -399,7 +423,7 @@ class BuildSettingProviderTests: XCTestCase { swift: true) // Then - assertEqualSettings(results, [ + let expected: BuildSettings = [ "CODE_SIGN_IDENTITY": "iPhone Developer", "SDKROOT": "xros", "LD_RUNPATH_SEARCH_PATHS": [ @@ -411,15 +435,8 @@ class BuildSettingProviderTests: XCTestCase { "SWIFT_COMPILATION_MODE": "singlefile", "SWIFT_OPTIMIZATION_LEVEL": "-Onone", "TARGETED_DEVICE_FAMILY": "1,2,7", - ]) - } - - // MARK: - Helpers + ] - func assertEqualSettings(_ lhs: BuildSettings, _ rhs: BuildSettings, file: StaticString = #file, line: UInt = #line) { - XCTAssertEqual(lhs as NSDictionary, - rhs as NSDictionary, - file: file, - line: line) + XCTAssertEqual(results, expected) } } diff --git a/Tests/XcodeProjTests/Utils/XCConfigTests.swift b/Tests/XcodeProjTests/Utils/XCConfigTests.swift index afb249cd4..a23cca1ee 100644 --- a/Tests/XcodeProjTests/Utils/XCConfigTests.swift +++ b/Tests/XcodeProjTests/Utils/XCConfigTests.swift @@ -14,7 +14,7 @@ final class XCConfigTests: XCTestCase { (Path("testB"), configB), ], buildSettings: ["a": "b"]) - XCTAssertEqual(config.buildSettings as! [String: String], ["a": "b"]) + XCTAssertEqual(config.buildSettings, ["a": "b"]) XCTAssertEqual(config.includes[0].config, configA) XCTAssertEqual(config.includes[1].config, configB) } @@ -28,8 +28,8 @@ final class XCConfigTests: XCTestCase { ], buildSettings: ["b": "3"]) let buildSettings = config.flattenedBuildSettings() - XCTAssertEqual(buildSettings["a"] as? String, "2") - XCTAssertEqual(buildSettings["b"] as? String, "3") + XCTAssertEqual(buildSettings["a"], "2") + XCTAssertEqual(buildSettings["b"], "3") } func test_xcconfig_settingRegex() { @@ -86,10 +86,10 @@ final class XCConfigIntegrationTests: XCTestCase { } } - func test_write_writesTheContentProperly() { - testWrite(from: childrenPath(), - initModel: { try? XCConfig(path: $0) }, - modify: { $0 }) + func test_write_writesTheContentProperly() throws { + try testWrite(from: childrenPath(), + initModel: { try? XCConfig(path: $0) }, + modify: { $0 }) } private func childrenPath() -> Path { @@ -101,16 +101,16 @@ final class XCConfigIntegrationTests: XCTestCase { } private func assert(config: XCConfig) { - XCTAssertEqual(config.buildSettings["CONFIGURATION_BUILD_DIR"] as? String, "Test/") - XCTAssertEqual(config.flattenedBuildSettings()["CONFIGURATION_BUILD_DIR"] as? String, "Test/") - XCTAssertEqual(config.buildSettings["GCC_PREPROCESSOR_DEFINITIONS"] as? String, "$(inherited)") - XCTAssertEqual(config.flattenedBuildSettings()["GCC_PREPROCESSOR_DEFINITIONS"] as? String, "$(inherited)") - XCTAssertEqual(config.buildSettings["WARNING_CFLAGS"] as? String, "-Wall -Wno-direct-ivar-access -Wno-objc-missing-property-synthesis -Wno-readonly-iboutlet-property -Wno-switch-enum -Wno-padded") - XCTAssertEqual(config.flattenedBuildSettings()["WARNING_CFLAGS"] as? String, "-Wall -Wno-direct-ivar-access -Wno-objc-missing-property-synthesis -Wno-readonly-iboutlet-property -Wno-switch-enum -Wno-padded") + XCTAssertEqual(config.buildSettings["CONFIGURATION_BUILD_DIR"], "Test/") + XCTAssertEqual(config.flattenedBuildSettings()["CONFIGURATION_BUILD_DIR"], "Test/") + XCTAssertEqual(config.buildSettings["GCC_PREPROCESSOR_DEFINITIONS"], "$(inherited)") + XCTAssertEqual(config.flattenedBuildSettings()["GCC_PREPROCESSOR_DEFINITIONS"], "$(inherited)") + XCTAssertEqual(config.buildSettings["WARNING_CFLAGS"], "-Wall -Wno-direct-ivar-access -Wno-objc-missing-property-synthesis -Wno-readonly-iboutlet-property -Wno-switch-enum -Wno-padded") + XCTAssertEqual(config.flattenedBuildSettings()["WARNING_CFLAGS"], "-Wall -Wno-direct-ivar-access -Wno-objc-missing-property-synthesis -Wno-readonly-iboutlet-property -Wno-switch-enum -Wno-padded") XCTAssertEqual(config.includes.count, 1) - XCTAssertEqual(config.flattenedBuildSettings()["OTHER_SWIFT_FLAGS_XCODE_0821"] as? String, "$(inherited)") - XCTAssertEqual(config.flattenedBuildSettings()["OTHER_SWIFT_FLAGS_XCODE_0830"] as? String, "$(inherited) -enable-bridging-pch") - XCTAssertEqual(config.flattenedBuildSettings()["PRODUCT_NAME"] as? String, "$(TARGET_NAME)") - XCTAssertEqual(config.flattenedBuildSettings()["SWIFT_OPTIMIZATION_LEVEL"] as? String, "-Onone") + XCTAssertEqual(config.flattenedBuildSettings()["OTHER_SWIFT_FLAGS_XCODE_0821"], "$(inherited)") + XCTAssertEqual(config.flattenedBuildSettings()["OTHER_SWIFT_FLAGS_XCODE_0830"], "$(inherited) -enable-bridging-pch") + XCTAssertEqual(config.flattenedBuildSettings()["PRODUCT_NAME"], "$(TARGET_NAME)") + XCTAssertEqual(config.flattenedBuildSettings()["SWIFT_OPTIMIZATION_LEVEL"], "-Onone") } } diff --git a/Tests/XcodeProjTests/Workspace/XCWorkspaceDataTests.swift b/Tests/XcodeProjTests/Workspace/XCWorkspaceDataTests.swift index 420ea7ed2..d3076ca0b 100644 --- a/Tests/XcodeProjTests/Workspace/XCWorkspaceDataTests.swift +++ b/Tests/XcodeProjTests/Workspace/XCWorkspaceDataTests.swift @@ -39,8 +39,8 @@ final class XCWorkspaceDataIntegrationTests: XCTestCase { } catch {} } - func test_write() { - testWrite( + func test_write() throws { + try testWrite( from: fixturePath(), initModel: { try? XCWorkspaceData(path: $0) }, modify: { From 128d90e4633a8e6941586dea75426e177dfb92e6 Mon Sep 17 00:00:00 2001 From: fortmarek <9371695+fortmarek@users.noreply.github.com> Date: Mon, 17 Mar 2025 18:10:44 +0000 Subject: [PATCH 444/678] [Release] XcodeProj 9.0.0 --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index c79d1aa63..7742c76bf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,11 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [9.0.0] - 2025-03-17 +### Details +#### Refactor +- Strongly typed values in `BuildSettings` and `BuildFileSettings` by @waltflanagan in [#903](https://github.com/tuist/XcodeProj/pull/903) + ## [8.27.7] - 2025-03-14 ### Details #### Chore @@ -126,6 +131,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Disable the renovatebot dashboard by @pepicrft in [#840](https://github.com/tuist/XcodeProj/pull/840) - Set up SwiftLint and SwiftFormat, run them against the project, and run them as part of the CI workflows by @pepicrft in [#836](https://github.com/tuist/XcodeProj/pull/836) +[9.0.0]: https://github.com/tuist/XcodeProj/compare/8.27.7..9.0.0 [8.27.7]: https://github.com/tuist/XcodeProj/compare/8.27.6..8.27.7 [8.27.6]: https://github.com/tuist/XcodeProj/compare/8.27.5..8.27.6 [8.27.0]: https://github.com/tuist/XcodeProj/compare/8.26.8..8.27.0 From 3c3dd871974aa677cd956c61c64ef8475e69f207 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 18 Mar 2025 01:59:32 +0000 Subject: [PATCH 445/678] chore(deps): update dependency tuist to v4.44.3 (#914) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise.toml b/.mise.toml index 5f2b8f717..447ea597f 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,5 +1,5 @@ [tools] swiftformat = "0.54.3" -tuist = "4.44.2" +tuist = "4.44.3" swiftlint = "0.55.1" "git-cliff" = "2.4.0" From 6af2938b3d2763de430a3f5edb098f7e6296164c Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 26 Mar 2025 03:09:25 +0000 Subject: [PATCH 446/678] chore(deps): update dependency tuist to v4.45.0 (#915) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise.toml b/.mise.toml index 447ea597f..e97747a03 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,5 +1,5 @@ [tools] swiftformat = "0.54.3" -tuist = "4.44.3" +tuist = "4.45.0" swiftlint = "0.55.1" "git-cliff" = "2.4.0" From fe18cc9f791027757e27c54fc5ae9ec52e1dbb47 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 27 Mar 2025 16:40:54 +0000 Subject: [PATCH 447/678] chore(deps): update dependency tuist to v4.45.1 (#917) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise.toml b/.mise.toml index e97747a03..b6578bf91 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,5 +1,5 @@ [tools] swiftformat = "0.54.3" -tuist = "4.45.0" +tuist = "4.45.1" swiftlint = "0.55.1" "git-cliff" = "2.4.0" From 2956863c11c9e8d22d3d93c88ee7974407d73142 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 3 Apr 2025 14:46:24 +0000 Subject: [PATCH 448/678] chore(deps): update dependency tuist to v4.46.0 (#922) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise.toml b/.mise.toml index b6578bf91..475217cba 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,5 +1,5 @@ [tools] swiftformat = "0.54.3" -tuist = "4.45.1" +tuist = "4.46.0" swiftlint = "0.55.1" "git-cliff" = "2.4.0" From c7bb76d657ba574f1e1f0f907588a92af345ea90 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 3 Apr 2025 21:48:48 +0000 Subject: [PATCH 449/678] chore(deps): update dependency tuist to v4.46.1 (#923) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise.toml b/.mise.toml index 475217cba..87c676e08 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,5 +1,5 @@ [tools] swiftformat = "0.54.3" -tuist = "4.46.0" +tuist = "4.46.1" swiftlint = "0.55.1" "git-cliff" = "2.4.0" From 6b20779414543fd743b2070cef0de5c30d0d113e Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Mon, 7 Apr 2025 13:16:09 +0200 Subject: [PATCH 450/678] docs: add bryansum as a contributor for code (#899) * docs: update README.md [skip ci] * docs: update .all-contributorsrc [skip ci] --------- Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com> --- .all-contributorsrc | 9 +++++++++ README.md | 3 ++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/.all-contributorsrc b/.all-contributorsrc index 486c1c8f1..31098a309 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -400,6 +400,15 @@ "contributions": [ "code" ] + }, + { + "login": "bryansum", + "name": "Bryan Summersett", + "avatar_url": "https://avatars.githubusercontent.com/u/49369?v=4", + "profile": "https://github.com/bryansum", + "contributions": [ + "code" + ] } ], "contributorsPerLine": 7, diff --git a/README.md b/README.md index 334c34b72..3d169855d 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # XcodeProj -[![All Contributors](https://img.shields.io/badge/all_contributors-44-orange.svg?style=flat-square)](#contributors-) +[![All Contributors](https://img.shields.io/badge/all_contributors-45-orange.svg?style=flat-square)](#contributors-) [![Swift Package Manager](https://img.shields.io/badge/swift%20package%20manager-compatible-brightgreen.svg)](https://swift.org/package-manager/) @@ -190,6 +190,7 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d George Navarro
George Navarro

💻 Maxim
Maxim

💻 + Bryan Summersett
Bryan Summersett

💻 From 99fa3525d8f0e6590bff444c3357b022a921dcb5 Mon Sep 17 00:00:00 2001 From: Damien Rivet Date: Mon, 7 Apr 2025 22:17:58 +0200 Subject: [PATCH 451/678] fix(buildsettings): add missing global accent color name build setting for apps (#920) * [#919] Add global accent color name build setting * [#919] Refactor BuildSettingsProvider tests to Swift Testing * Linting --- .../Utils/BuildSettingsProvider.swift | 1 + .../Utils/BuildSettingsProviderTests.swift | 767 ++++++++---------- 2 files changed, 335 insertions(+), 433 deletions(-) diff --git a/Sources/XcodeProj/Utils/BuildSettingsProvider.swift b/Sources/XcodeProj/Utils/BuildSettingsProvider.swift index 71a4d59ca..f6cd0e01d 100644 --- a/Sources/XcodeProj/Utils/BuildSettingsProvider.swift +++ b/Sources/XcodeProj/Utils/BuildSettingsProvider.swift @@ -199,6 +199,7 @@ public class BuildSettingsProvider { case .application: [ "ASSETCATALOG_COMPILER_APPICON_NAME": "AppIcon", + "ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME": "AccentColor", "ENABLE_PREVIEWS": "YES", ] case .framework: diff --git a/Tests/XcodeProjTests/Utils/BuildSettingsProviderTests.swift b/Tests/XcodeProjTests/Utils/BuildSettingsProviderTests.swift index 747bbb375..5c3acfcf3 100644 --- a/Tests/XcodeProjTests/Utils/BuildSettingsProviderTests.swift +++ b/Tests/XcodeProjTests/Utils/BuildSettingsProviderTests.swift @@ -1,442 +1,343 @@ import Foundation -import XCTest +import Testing @testable import XcodeProj -class BuildSettingProviderTests: XCTestCase { - func test_targetSettings_iosAplication() { - // Given / When - let results = BuildSettingsProvider.targetDefault(variant: .release, - platform: .iOS, - product: .application, - swift: true) - let expected: BuildSettings = [ - "ASSETCATALOG_COMPILER_APPICON_NAME": "AppIcon", - "ENABLE_PREVIEWS": "YES", - "CODE_SIGN_IDENTITY": "iPhone Developer", - "LD_RUNPATH_SEARCH_PATHS": [ - "$(inherited)", - "@executable_path/Frameworks", - ], - "SDKROOT": "iphoneos", - "SWIFT_COMPILATION_MODE": "wholemodule", - "SWIFT_OPTIMIZATION_LEVEL": "-Owholemodule", - "TARGETED_DEVICE_FAMILY": "1,2", +@Suite("Build setting provider tests") +struct BuildSettingProviderTests { + @Test( + "Target settings", + arguments: [ + TestParameters( + title: "iOS App", + results: BuildSettingsProvider.targetDefault(variant: .release, platform: .iOS, product: .application, swift: true), + expectedOutput: [ + "ASSETCATALOG_COMPILER_APPICON_NAME": "AppIcon", + "ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME": "AccentColor", + "ENABLE_PREVIEWS": "YES", + "CODE_SIGN_IDENTITY": "iPhone Developer", + "LD_RUNPATH_SEARCH_PATHS": [ + "$(inherited)", + "@executable_path/Frameworks", + ], + "SDKROOT": "iphoneos", + "SWIFT_COMPILATION_MODE": "wholemodule", + "SWIFT_OPTIMIZATION_LEVEL": "-Owholemodule", + "TARGETED_DEVICE_FAMILY": "1,2", + ] + ), + TestParameters( + title: "iOS Framework", + results: BuildSettingsProvider.targetDefault(variant: .release, platform: .iOS, product: .framework, swift: true), + expectedOutput: [ + "CODE_SIGN_IDENTITY": "", + "CURRENT_PROJECT_VERSION": "1", + "DEFINES_MODULE": "YES", + "DYLIB_COMPATIBILITY_VERSION": "1", + "DYLIB_CURRENT_VERSION": "1", + "DYLIB_INSTALL_NAME_BASE": "@rpath", + "INSTALL_PATH": "$(LOCAL_LIBRARY_DIR)/Frameworks", + "LD_RUNPATH_SEARCH_PATHS": [ + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ], + "PRODUCT_NAME": "$(TARGET_NAME:c99extidentifier)", + "SDKROOT": "iphoneos", + "SKIP_INSTALL": "YES", + "SWIFT_COMPILATION_MODE": "wholemodule", + "SWIFT_OPTIMIZATION_LEVEL": "-Owholemodule", + "TARGETED_DEVICE_FAMILY": "1,2", + "VERSIONING_SYSTEM": "apple-generic", + "VERSION_INFO_PREFIX": "", + ] + ), + TestParameters( + title: "iOS App extension", + results: BuildSettingsProvider.targetDefault(variant: .release, platform: .iOS, product: .appExtension, swift: true), + expectedOutput: [ + "CODE_SIGN_IDENTITY": "iPhone Developer", + "LD_RUNPATH_SEARCH_PATHS": [ + "$(inherited)", + "@executable_path/Frameworks", + "@executable_path/../../Frameworks", + ], + "SDKROOT": "iphoneos", + "SWIFT_COMPILATION_MODE": "wholemodule", + "SWIFT_OPTIMIZATION_LEVEL": "-Owholemodule", + "TARGETED_DEVICE_FAMILY": "1,2", + ] + ), + TestParameters( + title: "macOS App", + results: BuildSettingsProvider.targetDefault(variant: .release, platform: .macOS, product: .application, swift: true), + expectedOutput: [ + "ASSETCATALOG_COMPILER_APPICON_NAME": "AppIcon", + "ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME": "AccentColor", + "ENABLE_PREVIEWS": "YES", + "CODE_SIGN_IDENTITY": "-", + "COMBINE_HIDPI_IMAGES": "YES", + "LD_RUNPATH_SEARCH_PATHS": [ + "$(inherited)", + "@executable_path/../Frameworks", + ], + "SDKROOT": "macosx", + "SWIFT_COMPILATION_MODE": "wholemodule", + "SWIFT_OPTIMIZATION_LEVEL": "-Owholemodule", + ] + ), + TestParameters( + title: "tvOS App", + results: BuildSettingsProvider.targetDefault(variant: .release, platform: .tvOS, product: .application, swift: true), + expectedOutput: [ + "ASSETCATALOG_COMPILER_APPICON_NAME": "App Icon & Top Shelf Image", + "ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME": "AccentColor", + "ENABLE_PREVIEWS": "YES", + "ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME": "LaunchImage", + "LD_RUNPATH_SEARCH_PATHS": [ + "$(inherited)", + "@executable_path/Frameworks", + ], + "SDKROOT": "appletvos", + "SWIFT_COMPILATION_MODE": "wholemodule", + "SWIFT_OPTIMIZATION_LEVEL": "-Owholemodule", + "TARGETED_DEVICE_FAMILY": "3", + ] + ), + TestParameters( + title: "watchOS App", + results: BuildSettingsProvider.targetDefault(variant: .release, platform: .watchOS, product: .application, swift: true), + expectedOutput: [ + "ASSETCATALOG_COMPILER_APPICON_NAME": "AppIcon", + "ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME": "AccentColor", + "ENABLE_PREVIEWS": "YES", + "LD_RUNPATH_SEARCH_PATHS": [ + "$(inherited)", + "@executable_path/Frameworks", + ], + "SDKROOT": "watchos", + "SKIP_INSTALL": "YES", + "SWIFT_COMPILATION_MODE": "wholemodule", + "SWIFT_OPTIMIZATION_LEVEL": "-Owholemodule", + "TARGETED_DEVICE_FAMILY": "4", + ] + ), + TestParameters( + title: "watchOS Framework", + results: BuildSettingsProvider.targetDefault(variant: .release, platform: .watchOS, product: .framework, swift: true), + expectedOutput: [ + "APPLICATION_EXTENSION_API_ONLY": "YES", + "CODE_SIGN_IDENTITY": "", + "CURRENT_PROJECT_VERSION": "1", + "DEFINES_MODULE": "YES", + "DYLIB_COMPATIBILITY_VERSION": "1", + "DYLIB_CURRENT_VERSION": "1", + "DYLIB_INSTALL_NAME_BASE": "@rpath", + "INSTALL_PATH": "$(LOCAL_LIBRARY_DIR)/Frameworks", + "LD_RUNPATH_SEARCH_PATHS": [ + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ], + "PRODUCT_NAME": "$(TARGET_NAME:c99extidentifier)", + "SDKROOT": "watchos", + "SKIP_INSTALL": "YES", + "SWIFT_COMPILATION_MODE": "wholemodule", + "SWIFT_OPTIMIZATION_LEVEL": "-Owholemodule", + "TARGETED_DEVICE_FAMILY": "4", + "VERSIONING_SYSTEM": "apple-generic", + "VERSION_INFO_PREFIX": "", + ] + ), + TestParameters( + title: "watchOS App extension", + results: BuildSettingsProvider.targetDefault(variant: .release, platform: .watchOS, product: .appExtension, swift: true), + expectedOutput: [ + "LD_RUNPATH_SEARCH_PATHS": [ + "$(inherited)", + "@executable_path/Frameworks", + "@executable_path/../../Frameworks", + "@executable_path/../../../../Frameworks", + ], + "SDKROOT": "watchos", + "SWIFT_COMPILATION_MODE": "wholemodule", + "SWIFT_OPTIMIZATION_LEVEL": "-Owholemodule", + "TARGETED_DEVICE_FAMILY": "4", + ] + ), + TestParameters( + title: "visionOS App", + results: BuildSettingsProvider.targetDefault(variant: .release, platform: .visionOS, product: .application, swift: true), + expectedOutput: [ + "CODE_SIGN_IDENTITY": "iPhone Developer", + "ASSETCATALOG_COMPILER_APPICON_NAME": "AppIcon", + "ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME": "AccentColor", + "ENABLE_PREVIEWS": "YES", + "LD_RUNPATH_SEARCH_PATHS": [ + "$(inherited)", + "@executable_path/Frameworks", + ], + "SDKROOT": "xros", + "SWIFT_COMPILATION_MODE": "wholemodule", + "SWIFT_OPTIMIZATION_LEVEL": "-Owholemodule", + "TARGETED_DEVICE_FAMILY": "1,2,7", + ] + ), + TestParameters( + title: "visionOS Framework", + results: BuildSettingsProvider.targetDefault(variant: .release, platform: .visionOS, product: .framework, swift: true), + expectedOutput: [ + "CODE_SIGN_IDENTITY": "", + "CURRENT_PROJECT_VERSION": "1", + "DEFINES_MODULE": "YES", + "DYLIB_COMPATIBILITY_VERSION": "1", + "DYLIB_CURRENT_VERSION": "1", + "DYLIB_INSTALL_NAME_BASE": "@rpath", + "INSTALL_PATH": "$(LOCAL_LIBRARY_DIR)/Frameworks", + "LD_RUNPATH_SEARCH_PATHS": [ + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ], + "PRODUCT_NAME": "$(TARGET_NAME:c99extidentifier)", + "SDKROOT": "xros", + "SKIP_INSTALL": "YES", + "SWIFT_COMPILATION_MODE": "wholemodule", + "SWIFT_OPTIMIZATION_LEVEL": "-Owholemodule", + "TARGETED_DEVICE_FAMILY": "1,2,7", + "VERSIONING_SYSTEM": "apple-generic", + "VERSION_INFO_PREFIX": "", + ] + ), + TestParameters( + title: "visionOS App extension", + results: BuildSettingsProvider.targetDefault(variant: .release, platform: .visionOS, product: .appExtension, swift: true), + expectedOutput: [ + "CODE_SIGN_IDENTITY": "iPhone Developer", + "LD_RUNPATH_SEARCH_PATHS": [ + "$(inherited)", + "@executable_path/Frameworks", + "@executable_path/../../Frameworks", + ], + "SDKROOT": "xros", + "SWIFT_COMPILATION_MODE": "wholemodule", + "SWIFT_OPTIMIZATION_LEVEL": "-Owholemodule", + "TARGETED_DEVICE_FAMILY": "1,2,7", + ] + ), + TestParameters( + title: "iOS Unit tests", + results: BuildSettingsProvider.targetDefault(variant: .debug, platform: .iOS, product: .unitTests, swift: true), + expectedOutput: [ + "CODE_SIGN_IDENTITY": "iPhone Developer", + "SDKROOT": "iphoneos", + "LD_RUNPATH_SEARCH_PATHS": [ + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ], + "SWIFT_ACTIVE_COMPILATION_CONDITIONS": ["$(inherited)", "DEBUG"], + "SWIFT_COMPILATION_MODE": "singlefile", + "SWIFT_OPTIMIZATION_LEVEL": "-Onone", + "TARGETED_DEVICE_FAMILY": "1,2", + ] + ), + TestParameters( + title: "iOS UI tests", + results: BuildSettingsProvider.targetDefault(variant: .debug, platform: .iOS, product: .uiTests, swift: true), + expectedOutput: [ + "CODE_SIGN_IDENTITY": "iPhone Developer", + "SDKROOT": "iphoneos", + "LD_RUNPATH_SEARCH_PATHS": [ + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ], + "SWIFT_ACTIVE_COMPILATION_CONDITIONS": ["$(inherited)", "DEBUG"], + "SWIFT_COMPILATION_MODE": "singlefile", + "SWIFT_OPTIMIZATION_LEVEL": "-Onone", + "TARGETED_DEVICE_FAMILY": "1,2", + ] + ), + TestParameters( + title: "macOS Unit tests", + results: BuildSettingsProvider.targetDefault(variant: .debug, platform: .macOS, product: .unitTests, swift: true), + expectedOutput: [ + "CODE_SIGN_IDENTITY": "-", + "SDKROOT": "macosx", + "LD_RUNPATH_SEARCH_PATHS": [ + "$(inherited)", + "@executable_path/../Frameworks", + "@loader_path/../Frameworks", + ], + "SWIFT_ACTIVE_COMPILATION_CONDITIONS": ["$(inherited)", "DEBUG"], + "SWIFT_COMPILATION_MODE": "singlefile", + "SWIFT_OPTIMIZATION_LEVEL": "-Onone", + ] + ), + TestParameters( + title: "tvOS Unit tests", + results: BuildSettingsProvider.targetDefault(variant: .debug, platform: .tvOS, product: .unitTests, swift: true), + expectedOutput: [ + "SDKROOT": "appletvos", + "LD_RUNPATH_SEARCH_PATHS": [ + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ], + "SWIFT_ACTIVE_COMPILATION_CONDITIONS": ["$(inherited)", "DEBUG"], + "SWIFT_COMPILATION_MODE": "singlefile", + "SWIFT_OPTIMIZATION_LEVEL": "-Onone", + "TARGETED_DEVICE_FAMILY": "3", + ] + ), + TestParameters( + title: "visionOS Unit tests", + results: BuildSettingsProvider.targetDefault(variant: .debug, platform: .visionOS, product: .unitTests, swift: true), + expectedOutput: [ + "CODE_SIGN_IDENTITY": "iPhone Developer", + "SDKROOT": "xros", + "LD_RUNPATH_SEARCH_PATHS": [ + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ], + "SWIFT_ACTIVE_COMPILATION_CONDITIONS": ["$(inherited)", "DEBUG"], + "SWIFT_COMPILATION_MODE": "singlefile", + "SWIFT_OPTIMIZATION_LEVEL": "-Onone", + "TARGETED_DEVICE_FAMILY": "1,2,7", + ] + ), + TestParameters( + title: "visionOS UI tests", + results: BuildSettingsProvider.targetDefault(variant: .debug, platform: .visionOS, product: .uiTests, swift: true), + expectedOutput: [ + "CODE_SIGN_IDENTITY": "iPhone Developer", + "SDKROOT": "xros", + "LD_RUNPATH_SEARCH_PATHS": [ + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ], + "SWIFT_ACTIVE_COMPILATION_CONDITIONS": ["$(inherited)", "DEBUG"], + "SWIFT_COMPILATION_MODE": "singlefile", + "SWIFT_OPTIMIZATION_LEVEL": "-Onone", + "TARGETED_DEVICE_FAMILY": "1,2,7", + ] + ), ] - - // Then - XCTAssertEqual(results, expected) - } - - func test_targetSettings_iosFramework() { - // Given / When - let results = BuildSettingsProvider.targetDefault(variant: .release, - platform: .iOS, - product: .framework, - swift: true) - let expected: BuildSettings = [ - "CODE_SIGN_IDENTITY": "", - "CURRENT_PROJECT_VERSION": "1", - "DEFINES_MODULE": "YES", - "DYLIB_COMPATIBILITY_VERSION": "1", - "DYLIB_CURRENT_VERSION": "1", - "DYLIB_INSTALL_NAME_BASE": "@rpath", - "INSTALL_PATH": "$(LOCAL_LIBRARY_DIR)/Frameworks", - "LD_RUNPATH_SEARCH_PATHS": [ - "$(inherited)", - "@executable_path/Frameworks", - "@loader_path/Frameworks", - ], - "PRODUCT_NAME": "$(TARGET_NAME:c99extidentifier)", - "SDKROOT": "iphoneos", - "SKIP_INSTALL": "YES", - "SWIFT_COMPILATION_MODE": "wholemodule", - "SWIFT_OPTIMIZATION_LEVEL": "-Owholemodule", - "TARGETED_DEVICE_FAMILY": "1,2", - "VERSIONING_SYSTEM": "apple-generic", - "VERSION_INFO_PREFIX": "", - ] - - // Then - XCTAssertEqual(results, expected) - } - - func test_targetSettings_iosExtension() { - // Given / When - let results = BuildSettingsProvider.targetDefault(variant: .release, - platform: .iOS, - product: .appExtension, - swift: true) - let expected: BuildSettings = [ - "CODE_SIGN_IDENTITY": "iPhone Developer", - "LD_RUNPATH_SEARCH_PATHS": [ - "$(inherited)", - "@executable_path/Frameworks", - "@executable_path/../../Frameworks", - ], - "SDKROOT": "iphoneos", - "SWIFT_COMPILATION_MODE": "wholemodule", - "SWIFT_OPTIMIZATION_LEVEL": "-Owholemodule", - "TARGETED_DEVICE_FAMILY": "1,2", - ] - // Then - XCTAssertEqual(results, expected) - } - - func test_targetSettings_macOSAplication() { - // Given / When - let results = BuildSettingsProvider.targetDefault(variant: .release, - platform: .macOS, - product: .application, - swift: true) - - let expected: BuildSettings = [ - "ASSETCATALOG_COMPILER_APPICON_NAME": "AppIcon", - "ENABLE_PREVIEWS": "YES", - "CODE_SIGN_IDENTITY": "-", - "COMBINE_HIDPI_IMAGES": "YES", - "LD_RUNPATH_SEARCH_PATHS": [ - "$(inherited)", - "@executable_path/../Frameworks", - ], - "SDKROOT": "macosx", - "SWIFT_COMPILATION_MODE": "wholemodule", - "SWIFT_OPTIMIZATION_LEVEL": "-Owholemodule", - ] - // Then - XCTAssertEqual(results, expected) - } - - func test_targetSettings_tvOSAplication() { - // Given / When - let results = BuildSettingsProvider.targetDefault(variant: .release, - platform: .tvOS, - product: .application, - swift: true) - - let expected: BuildSettings = [ - "ASSETCATALOG_COMPILER_APPICON_NAME": "App Icon & Top Shelf Image", - "ENABLE_PREVIEWS": "YES", - "ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME": "LaunchImage", - "LD_RUNPATH_SEARCH_PATHS": [ - "$(inherited)", - "@executable_path/Frameworks", - ], - "SDKROOT": "appletvos", - "SWIFT_COMPILATION_MODE": "wholemodule", - "SWIFT_OPTIMIZATION_LEVEL": "-Owholemodule", - "TARGETED_DEVICE_FAMILY": "3", - ] - - // Then - XCTAssertEqual(results, expected) - } - - func test_targetSettings_watchOSAplication() { - // Given / When - let results = BuildSettingsProvider.targetDefault(variant: .release, - platform: .watchOS, - product: .application, - swift: true) - - let expected: BuildSettings = [ - "ASSETCATALOG_COMPILER_APPICON_NAME": "AppIcon", - "ENABLE_PREVIEWS": "YES", - "LD_RUNPATH_SEARCH_PATHS": ["$(inherited)", "@executable_path/Frameworks"], - "SDKROOT": "watchos", - "SKIP_INSTALL": "YES", - "SWIFT_COMPILATION_MODE": "wholemodule", - "SWIFT_OPTIMIZATION_LEVEL": "-Owholemodule", - "TARGETED_DEVICE_FAMILY": "4", - ] - - XCTAssertEqual(results, expected) - } - - func test_targetSettings_watchOSFramework() { - // Given / When - let results = BuildSettingsProvider.targetDefault(variant: .release, - platform: .watchOS, - product: .framework, - swift: true) - - // Then - let expected: BuildSettings = [ - "APPLICATION_EXTENSION_API_ONLY": "YES", - "CODE_SIGN_IDENTITY": "", - "CURRENT_PROJECT_VERSION": "1", - "DEFINES_MODULE": "YES", - "DYLIB_COMPATIBILITY_VERSION": "1", - "DYLIB_CURRENT_VERSION": "1", - "DYLIB_INSTALL_NAME_BASE": "@rpath", - "INSTALL_PATH": "$(LOCAL_LIBRARY_DIR)/Frameworks", - "LD_RUNPATH_SEARCH_PATHS": [ - "$(inherited)", - "@executable_path/Frameworks", - "@loader_path/Frameworks", - ], - "PRODUCT_NAME": "$(TARGET_NAME:c99extidentifier)", - "SDKROOT": "watchos", - "SKIP_INSTALL": "YES", - "SWIFT_COMPILATION_MODE": "wholemodule", - "SWIFT_OPTIMIZATION_LEVEL": "-Owholemodule", - "TARGETED_DEVICE_FAMILY": "4", - "VERSIONING_SYSTEM": "apple-generic", - "VERSION_INFO_PREFIX": "", - ] - - XCTAssertEqual(results, expected) - } - - func test_targetSettings_watchOSExtension() { - // Given / When - let results = BuildSettingsProvider.targetDefault(variant: .release, - platform: .watchOS, - product: .appExtension, - swift: true) - - // Then - let expected: BuildSettings = [ - "LD_RUNPATH_SEARCH_PATHS": [ - "$(inherited)", - "@executable_path/Frameworks", - "@executable_path/../../Frameworks", - "@executable_path/../../../../Frameworks", - ], - "SDKROOT": "watchos", - "SWIFT_COMPILATION_MODE": "wholemodule", - "SWIFT_OPTIMIZATION_LEVEL": "-Owholemodule", - "TARGETED_DEVICE_FAMILY": "4", - ] - - XCTAssertEqual(results, expected) - } - - func test_targetSettings_visionOSAplication() { - // Given / When - let results = BuildSettingsProvider.targetDefault(variant: .release, - platform: .visionOS, - product: .application, - swift: true) - - // Then - let expected: BuildSettings = [ - "CODE_SIGN_IDENTITY": "iPhone Developer", - "ASSETCATALOG_COMPILER_APPICON_NAME": "AppIcon", - "ENABLE_PREVIEWS": "YES", - "LD_RUNPATH_SEARCH_PATHS": [ - "$(inherited)", - "@executable_path/Frameworks", - ], - "SDKROOT": "xros", - "SWIFT_COMPILATION_MODE": "wholemodule", - "SWIFT_OPTIMIZATION_LEVEL": "-Owholemodule", - "TARGETED_DEVICE_FAMILY": "1,2,7", - ] - - XCTAssertEqual(results, expected) - } - - func test_targetSettings_visionOSFramework() { - // Given / When - let results = BuildSettingsProvider.targetDefault(variant: .release, - platform: .visionOS, - product: .framework, - swift: true) - - // Then - let expected: BuildSettings = [ - "CODE_SIGN_IDENTITY": "", - "CURRENT_PROJECT_VERSION": "1", - "DEFINES_MODULE": "YES", - "DYLIB_COMPATIBILITY_VERSION": "1", - "DYLIB_CURRENT_VERSION": "1", - "DYLIB_INSTALL_NAME_BASE": "@rpath", - "INSTALL_PATH": "$(LOCAL_LIBRARY_DIR)/Frameworks", - "LD_RUNPATH_SEARCH_PATHS": [ - "$(inherited)", - "@executable_path/Frameworks", - "@loader_path/Frameworks", - ], - "PRODUCT_NAME": "$(TARGET_NAME:c99extidentifier)", - "SDKROOT": "xros", - "SKIP_INSTALL": "YES", - "SWIFT_COMPILATION_MODE": "wholemodule", - "SWIFT_OPTIMIZATION_LEVEL": "-Owholemodule", - "TARGETED_DEVICE_FAMILY": "1,2,7", - "VERSIONING_SYSTEM": "apple-generic", - "VERSION_INFO_PREFIX": "", - ] - - XCTAssertEqual(results, expected) - } - - func test_targetSettings_visionOSExtension() { - // Given / When - let results = BuildSettingsProvider.targetDefault(variant: .release, - platform: .visionOS, - product: .appExtension, - swift: true) - - // Then - let expected: BuildSettings = [ - "CODE_SIGN_IDENTITY": "iPhone Developer", - "LD_RUNPATH_SEARCH_PATHS": [ - "$(inherited)", - "@executable_path/Frameworks", - "@executable_path/../../Frameworks", - ], - "SDKROOT": "xros", - "SWIFT_COMPILATION_MODE": "wholemodule", - "SWIFT_OPTIMIZATION_LEVEL": "-Owholemodule", - "TARGETED_DEVICE_FAMILY": "1,2,7", - ] - - XCTAssertEqual(results, expected) - } - - func test_targetSettings_iOSUnitTests() { - // Given / When - let results = BuildSettingsProvider.targetDefault(variant: .debug, - platform: .iOS, - product: .unitTests, - swift: true) - - let expected: BuildSettings = [ - "CODE_SIGN_IDENTITY": "iPhone Developer", - "SDKROOT": "iphoneos", - "LD_RUNPATH_SEARCH_PATHS": [ - "$(inherited)", - "@executable_path/Frameworks", - "@loader_path/Frameworks", - ], - "SWIFT_ACTIVE_COMPILATION_CONDITIONS": ["$(inherited)", "DEBUG"], - "SWIFT_COMPILATION_MODE": "singlefile", - "SWIFT_OPTIMIZATION_LEVEL": "-Onone", - "TARGETED_DEVICE_FAMILY": "1,2", - ] - - // Then - XCTAssertEqual(results, expected) - } - - func test_targetSettings_iOSUITests() { - // Given / When - let results = BuildSettingsProvider.targetDefault(variant: .debug, - platform: .iOS, - product: .uiTests, - swift: true) - let expected: BuildSettings = [ - "CODE_SIGN_IDENTITY": "iPhone Developer", - "SDKROOT": "iphoneos", - "LD_RUNPATH_SEARCH_PATHS": [ - "$(inherited)", - "@executable_path/Frameworks", - "@loader_path/Frameworks", - ], - "SWIFT_ACTIVE_COMPILATION_CONDITIONS": ["$(inherited)", "DEBUG"], - "SWIFT_COMPILATION_MODE": "singlefile", - "SWIFT_OPTIMIZATION_LEVEL": "-Onone", - "TARGETED_DEVICE_FAMILY": "1,2", - ] - - // Then - XCTAssertEqual(results, expected) - } - - func test_targetSettings_macOSUnitTests() { - // Given / When - let results = BuildSettingsProvider.targetDefault(variant: .debug, - platform: .macOS, - product: .unitTests, - swift: true) - - let expected: BuildSettings = [ - "CODE_SIGN_IDENTITY": "-", - "SDKROOT": "macosx", - "LD_RUNPATH_SEARCH_PATHS": [ - "$(inherited)", - "@executable_path/../Frameworks", - "@loader_path/../Frameworks", - ], - "SWIFT_ACTIVE_COMPILATION_CONDITIONS": ["$(inherited)", "DEBUG"], - "SWIFT_COMPILATION_MODE": "singlefile", - "SWIFT_OPTIMIZATION_LEVEL": "-Onone", - ] - - // Then - XCTAssertEqual(results, expected) - } - - func test_targetSettings_tvOSUnitTests() { - // Given / When - let results = BuildSettingsProvider.targetDefault(variant: .debug, - platform: .tvOS, - product: .unitTests, - swift: true) - let expected: BuildSettings = [ - "SDKROOT": "appletvos", - "LD_RUNPATH_SEARCH_PATHS": [ - "$(inherited)", - "@executable_path/Frameworks", - "@loader_path/Frameworks", - ], - "SWIFT_ACTIVE_COMPILATION_CONDITIONS": ["$(inherited)", "DEBUG"], - "SWIFT_COMPILATION_MODE": "singlefile", - "SWIFT_OPTIMIZATION_LEVEL": "-Onone", - "TARGETED_DEVICE_FAMILY": "3", - ] - - // Then - XCTAssertEqual(results, expected) + ) + func targetSettings(parameters: TestParameters) { + // Given / When / Then + #expect(parameters.results == parameters.expectedOutput) } - func test_targetSettings_visionOSUnitTests() { - // Given / When - let results = BuildSettingsProvider.targetDefault(variant: .debug, - platform: .visionOS, - product: .unitTests, - swift: true) - - // Then - let expected: BuildSettings = [ - "CODE_SIGN_IDENTITY": "iPhone Developer", - "SDKROOT": "xros", - "LD_RUNPATH_SEARCH_PATHS": [ - "$(inherited)", - "@executable_path/Frameworks", - "@loader_path/Frameworks", - ], - "SWIFT_ACTIVE_COMPILATION_CONDITIONS": ["$(inherited)", "DEBUG"], - "SWIFT_COMPILATION_MODE": "singlefile", - "SWIFT_OPTIMIZATION_LEVEL": "-Onone", - "TARGETED_DEVICE_FAMILY": "1,2,7", - ] - - XCTAssertEqual(results, expected) - } - - func test_targetSettings_visionOSUITests() { - // Given / When - let results = BuildSettingsProvider.targetDefault(variant: .debug, - platform: .visionOS, - product: .uiTests, - swift: true) - - // Then - let expected: BuildSettings = [ - "CODE_SIGN_IDENTITY": "iPhone Developer", - "SDKROOT": "xros", - "LD_RUNPATH_SEARCH_PATHS": [ - "$(inherited)", - "@executable_path/Frameworks", - "@loader_path/Frameworks", - ], - "SWIFT_ACTIVE_COMPILATION_CONDITIONS": ["$(inherited)", "DEBUG"], - "SWIFT_COMPILATION_MODE": "singlefile", - "SWIFT_OPTIMIZATION_LEVEL": "-Onone", - "TARGETED_DEVICE_FAMILY": "1,2,7", - ] + struct TestParameters: CustomTestStringConvertible { + let title: String + let results: BuildSettings + let expectedOutput: BuildSettings - XCTAssertEqual(results, expected) + var testDescription: String { + title + } } } From c68412f3ef6d87d613779997811805d3657ba763 Mon Sep 17 00:00:00 2001 From: fortmarek <9371695+fortmarek@users.noreply.github.com> Date: Mon, 7 Apr 2025 20:18:31 +0000 Subject: [PATCH 452/678] [Release] XcodeProj 9.0.1 --- CHANGELOG.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7742c76bf..7c46499b7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,16 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [9.0.1] - 2025-04-07 +### Details +#### Bug Fixes +- Add missing global accent color name build setting for apps by @damien-rivet in [#920](https://github.com/tuist/XcodeProj/pull/920) + +#### Documentation +- Add bryansum as a contributor for code by @allcontributors[bot] in [#899](https://github.com/tuist/XcodeProj/pull/899) + +## New Contributors +* @damien-rivet made their first contribution in [#920](https://github.com/tuist/XcodeProj/pull/920) ## [9.0.0] - 2025-03-17 ### Details #### Refactor @@ -131,6 +141,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Disable the renovatebot dashboard by @pepicrft in [#840](https://github.com/tuist/XcodeProj/pull/840) - Set up SwiftLint and SwiftFormat, run them against the project, and run them as part of the CI workflows by @pepicrft in [#836](https://github.com/tuist/XcodeProj/pull/836) +[9.0.1]: https://github.com/tuist/XcodeProj/compare/9.0.0..9.0.1 [9.0.0]: https://github.com/tuist/XcodeProj/compare/8.27.7..9.0.0 [8.27.7]: https://github.com/tuist/XcodeProj/compare/8.27.6..8.27.7 [8.27.6]: https://github.com/tuist/XcodeProj/compare/8.27.5..8.27.6 From e3cbc98c40a9305f8564b560ca650deb51a60aaa Mon Sep 17 00:00:00 2001 From: Mouad BENJRINIJA Date: Mon, 7 Apr 2025 21:32:39 +0100 Subject: [PATCH 453/678] fix: allow empty `PBXProject.TargetAttributes` (#924) * allow empty TargetAttributes * fix unit tests * fix unit test name --- Package.resolved | 7 ++++--- Sources/XcodeProj/Objects/Project/PBXProject.swift | 4 +--- .../XcodeProjTests/Objects/Project/PBXProjectTests.swift | 8 +++----- 3 files changed, 8 insertions(+), 11 deletions(-) diff --git a/Package.resolved b/Package.resolved index cb0282427..8fbe88542 100644 --- a/Package.resolved +++ b/Package.resolved @@ -1,12 +1,13 @@ { + "originHash" : "8a13a61314cb0e10f1d22dddaabfebd1ab407a7b9ab06aa42fc1e38041a202a5", "pins" : [ { "identity" : "aexml", "kind" : "remoteSourceControl", "location" : "https://github.com/tadija/AEXML.git", "state" : { - "revision" : "38f7d00b23ecd891e1ee656fa6aeebd6ba04ecc3", - "version" : "4.6.1" + "revision" : "db806756c989760b35108146381535aec231092b", + "version" : "4.7.0" } }, { @@ -28,5 +29,5 @@ } } ], - "version" : 2 + "version" : 3 } diff --git a/Sources/XcodeProj/Objects/Project/PBXProject.swift b/Sources/XcodeProj/Objects/Project/PBXProject.swift index 85b3cae41..1e0444ebc 100644 --- a/Sources/XcodeProj/Objects/Project/PBXProject.swift +++ b/Sources/XcodeProj/Objects/Project/PBXProject.swift @@ -572,9 +572,7 @@ extension PBXProject: PlistSerializable { plistTargetAttributes[reference.value] = value } - if !plistTargetAttributes.isEmpty { - plistAttributes[PBXProject.targetAttributesKey] = .attributeDictionary(plistTargetAttributes) - } + plistAttributes[PBXProject.targetAttributesKey] = .attributeDictionary(plistTargetAttributes) dictionary["attributes"] = plistAttributes.plist() diff --git a/Tests/XcodeProjTests/Objects/Project/PBXProjectTests.swift b/Tests/XcodeProjTests/Objects/Project/PBXProjectTests.swift index 4d767bd15..1d1b8cf20 100644 --- a/Tests/XcodeProjTests/Objects/Project/PBXProjectTests.swift +++ b/Tests/XcodeProjTests/Objects/Project/PBXProjectTests.swift @@ -66,7 +66,7 @@ final class PBXProjectTests: XCTestCase { XCTAssertEqual(attributes, expectedAttributes) } - func test_plistKeyAndValue_doesntReturnTargetAttributes_when_itsEmpty() throws { + func test_plistKeyAndValue_returnsEmptyTargetAttributes_when_itsEmpty() throws { // Given let target = PBXTarget(name: "") target.reference.fix("app") @@ -81,14 +81,12 @@ final class PBXProjectTests: XCTestCase { minimizedProjectReferenceProxies: nil, mainGroup: PBXGroup()) - project.setTargetAttributes(["custom": "abc", "TestTargetID": .targetReference(testTarget)], target: target) - // When let plist = try project.plistKeyAndValue(proj: PBXProj(), reference: "") // Then - let attributes: [CommentedString: PlistValue]? = plist.value.dictionary?["TargetAttributes"]?.dictionary - XCTAssertNil(attributes) + let attributes = plist.value.dictionary?["attributes"]?.dictionary?["TargetAttributes"]?.dictionary + XCTAssertEqual(attributes, [:]) } func test_addLocalSwiftPackage() throws { From ed88497ccc09558900206d29fecfa20a5bcbe57f Mon Sep 17 00:00:00 2001 From: fortmarek <9371695+fortmarek@users.noreply.github.com> Date: Mon, 7 Apr 2025 20:33:04 +0000 Subject: [PATCH 454/678] [Release] XcodeProj 9.0.2 --- CHANGELOG.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7c46499b7..45095dbf3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [9.0.2] - 2025-04-07 +### Details +#### Bug Fixes +- Allow empty `PBXProject.TargetAttributes` by @MouadBenjrinija in [#924](https://github.com/tuist/XcodeProj/pull/924) + +## New Contributors +* @MouadBenjrinija made their first contribution in [#924](https://github.com/tuist/XcodeProj/pull/924) ## [9.0.1] - 2025-04-07 ### Details #### Bug Fixes @@ -141,6 +148,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Disable the renovatebot dashboard by @pepicrft in [#840](https://github.com/tuist/XcodeProj/pull/840) - Set up SwiftLint and SwiftFormat, run them against the project, and run them as part of the CI workflows by @pepicrft in [#836](https://github.com/tuist/XcodeProj/pull/836) +[9.0.2]: https://github.com/tuist/XcodeProj/compare/9.0.1..9.0.2 [9.0.1]: https://github.com/tuist/XcodeProj/compare/9.0.0..9.0.1 [9.0.0]: https://github.com/tuist/XcodeProj/compare/8.27.7..9.0.0 [8.27.7]: https://github.com/tuist/XcodeProj/compare/8.27.6..8.27.7 From e8787517677359746a25bf144bb134e5acd09374 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 8 Apr 2025 02:24:27 +0000 Subject: [PATCH 455/678] chore(deps): update dependency tuist to v4.47.0 (#925) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise.toml b/.mise.toml index 87c676e08..96869f7e4 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,5 +1,5 @@ [tools] swiftformat = "0.54.3" -tuist = "4.46.1" +tuist = "4.47.0" swiftlint = "0.55.1" "git-cliff" = "2.4.0" From bcb51de72595ae1db5dceb3a48e48ad35621eee1 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 14 Apr 2025 23:42:10 +0000 Subject: [PATCH 456/678] chore(deps): update dependency tuist to v4.48.1 (#926) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise.toml b/.mise.toml index 96869f7e4..73b15d532 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,5 +1,5 @@ [tools] swiftformat = "0.54.3" -tuist = "4.47.0" +tuist = "4.48.1" swiftlint = "0.55.1" "git-cliff" = "2.4.0" From df030e7139e27a7affbb81727d2381c0d3511b88 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 24 Apr 2025 02:23:43 +0000 Subject: [PATCH 457/678] chore(deps): update dependency tuist to v4.48.2 (#929) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise.toml b/.mise.toml index 73b15d532..5de19db4d 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,5 +1,5 @@ [tools] swiftformat = "0.54.3" -tuist = "4.48.1" +tuist = "4.48.2" swiftlint = "0.55.1" "git-cliff" = "2.4.0" From 7ee29038b4c00154c93567a079a81bb186ca17dc Mon Sep 17 00:00:00 2001 From: Nikita Vasilev Date: Mon, 28 Apr 2025 12:38:26 +0500 Subject: [PATCH 458/678] feat: implement support for the App Clip's URL (#927) --- Fixtures/Schemes/AppClip.xcscheme | 80 ++++++++++++++ .../Scheme/XCScheme+LaunchAction.swift | 19 +++- .../XcodeProjTests/Scheme/XCSchemeTests.swift | 104 ++++++++++++++++++ 3 files changed, 199 insertions(+), 4 deletions(-) create mode 100644 Fixtures/Schemes/AppClip.xcscheme diff --git a/Fixtures/Schemes/AppClip.xcscheme b/Fixtures/Schemes/AppClip.xcscheme new file mode 100644 index 000000000..0fcd6b540 --- /dev/null +++ b/Fixtures/Schemes/AppClip.xcscheme @@ -0,0 +1,80 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Sources/XcodeProj/Scheme/XCScheme+LaunchAction.swift b/Sources/XcodeProj/Scheme/XCScheme+LaunchAction.swift index 889898230..f484cc9a6 100644 --- a/Sources/XcodeProj/Scheme/XCScheme+LaunchAction.swift +++ b/Sources/XcodeProj/Scheme/XCScheme+LaunchAction.swift @@ -84,6 +84,7 @@ public extension XCScheme { // To enable the option in Xcode: defaults write com.apple.dt.Xcode IDEDebuggerFeatureSetting 12 public var customLaunchCommand: String? public var customLLDBInitFile: String? + public var appClipInvocationURLString: String? // MARK: - Init @@ -126,7 +127,8 @@ public extension XCScheme { launchAutomaticallySubstyle: String? = nil, storeKitConfigurationFileReference: StoreKitConfigurationFileReference? = nil, customLaunchCommand: String? = nil, - customLLDBInitFile: String? = nil) { + customLLDBInitFile: String? = nil, + appClipInvocationURLString: String? = nil) { self.runnable = runnable self.macroExpansion = macroExpansion self.buildConfiguration = buildConfiguration @@ -165,6 +167,7 @@ public extension XCScheme { self.storeKitConfigurationFileReference = storeKitConfigurationFileReference self.customLaunchCommand = customLaunchCommand self.customLLDBInitFile = customLLDBInitFile + self.appClipInvocationURLString = appClipInvocationURLString super.init(preActions, postActions) } @@ -210,7 +213,8 @@ public extension XCScheme { launchAutomaticallySubstyle: String? = nil, storeKitConfigurationFileReference: StoreKitConfigurationFileReference? = nil, customLaunchCommand: String? = nil, - customLLDBInitFile: String? = nil + customLLDBInitFile: String? = nil, + appClipInvocationURLString: String? = nil ) { self.init( runnable: pathRunnable, @@ -252,7 +256,8 @@ public extension XCScheme { launchAutomaticallySubstyle: launchAutomaticallySubstyle, storeKitConfigurationFileReference: storeKitConfigurationFileReference, customLaunchCommand: customLaunchCommand, - customLLDBInitFile: customLLDBInitFile + customLLDBInitFile: customLLDBInitFile, + appClipInvocationURLString: appClipInvocationURLString ) } @@ -338,6 +343,8 @@ public extension XCScheme { customWorkingDirectory = elementCustomWorkingDirectory } + appClipInvocationURLString = element.attributes["appClipInvocationURLString"] + try super.init(element: element) } @@ -404,6 +411,9 @@ public extension XCScheme { if let customWorkingDirectory { attributes["customWorkingDirectory"] = customWorkingDirectory } + if let appClipInvocationURLString { + attributes["appClipInvocationURLString"] = appClipInvocationURLString + } return attributes } @@ -513,7 +523,8 @@ public extension XCScheme { launchAutomaticallySubstyle == rhs.launchAutomaticallySubstyle && storeKitConfigurationFileReference == rhs.storeKitConfigurationFileReference && customLaunchCommand == rhs.customLaunchCommand && - customLLDBInitFile == rhs.customLLDBInitFile + customLLDBInitFile == rhs.customLLDBInitFile && + appClipInvocationURLString == rhs.appClipInvocationURLString } } } diff --git a/Tests/XcodeProjTests/Scheme/XCSchemeTests.swift b/Tests/XcodeProjTests/Scheme/XCSchemeTests.swift index 70058b778..3e9aa9f5b 100644 --- a/Tests/XcodeProjTests/Scheme/XCSchemeTests.swift +++ b/Tests/XcodeProjTests/Scheme/XCSchemeTests.swift @@ -21,6 +21,14 @@ final class XCSchemeIntegrationTests: XCTestCase { initModel: XCScheme.init(path:)) } + func test_read_appClipScheme() { + let subject = try? XCScheme(path: appClipScheme) + XCTAssertNotNil(subject) + if let subject { + assert(appClip: subject) + } + } + func test_read_runnableWithoutBuildableReferenceScheme() { let subject = try? XCScheme(path: runnableWithoutBuildableReferenceSchemePath) @@ -586,6 +594,7 @@ final class XCSchemeIntegrationTests: XCTestCase { XCTAssertEqual(scheme.launchAction?.disablePerformanceAntipatternChecker, false) XCTAssertEqual(scheme.launchAction?.stopOnEveryMainThreadCheckerIssue, false) XCTAssertEqual(scheme.launchAction?.additionalOptions.isEmpty, true) + XCTAssertEqual(scheme.launchAction?.appClipInvocationURLString, nil) let launchEnvironmentVariables = XCTAssertNotNilAndUnwrap(scheme.launchAction?.environmentVariables) XCTAssertEqual(launchEnvironmentVariables.count, 1) @@ -679,6 +688,7 @@ final class XCSchemeIntegrationTests: XCTestCase { XCTAssertEqual(scheme.launchAction?.macroExpansion?.blueprintName, "core-ava") XCTAssertEqual(scheme.launchAction?.macroExpansion?.referencedContainer, "container:core-ava.xcodeproj") XCTAssertNil(scheme.launchAction?.environmentVariables) + XCTAssertNil(scheme.launchAction?.appClipInvocationURLString) // Profile action XCTAssertEqual(scheme.profileAction?.runnable?.runnableDebuggingMode, "0") @@ -769,6 +779,7 @@ final class XCSchemeIntegrationTests: XCTestCase { XCTAssertEqual(scheme.launchAction?.stopOnEveryMainThreadCheckerIssue, false) XCTAssertEqual(scheme.launchAction?.additionalOptions.isEmpty, true) XCTAssertNil(scheme.launchAction?.storeKitConfigurationFileReference) + XCTAssertNil(scheme.launchAction?.appClipInvocationURLString) let launchEnvironmentVariables = XCTAssertNotNilAndUnwrap(scheme.launchAction?.environmentVariables) XCTAssertEqual(launchEnvironmentVariables.count, 1) @@ -797,6 +808,95 @@ final class XCSchemeIntegrationTests: XCTestCase { XCTAssertNil(scheme.archiveAction?.customArchiveName) } + private func assert(appClip scheme: XCScheme) { + XCTAssertEqual(scheme.version, "1.7") + XCTAssertEqual(scheme.lastUpgradeVersion, "1600", "\(scheme.lastUpgradeVersion!) not equals 1600") + + // Build action + XCTAssertTrue(scheme.buildAction?.parallelizeBuild == true) + XCTAssertTrue(scheme.buildAction?.buildImplicitDependencies == true) + XCTAssertNil(scheme.buildAction?.runPostActionsOnFailure) + XCTAssertEqual(scheme.buildAction?.buildActionEntries.count, 1) + XCTAssertTrue(scheme.buildAction?.buildActionEntries[0].buildFor.contains(.testing) == true) + XCTAssertTrue(scheme.buildAction?.buildActionEntries[0].buildFor.contains(.running) == true) + XCTAssertTrue(scheme.buildAction?.buildActionEntries[0].buildFor.contains(.profiling) == true) + XCTAssertTrue(scheme.buildAction?.buildActionEntries[0].buildFor.contains(.archiving) == true) + XCTAssertTrue(scheme.buildAction?.buildActionEntries[0].buildFor.contains(.analyzing) == true) + XCTAssertEqual(scheme.buildAction?.buildActionEntries[0].buildableReference.buildableIdentifier, "primary") + XCTAssertEqual(scheme.buildAction?.buildActionEntries[0].buildableReference.blueprintIdentifier, "5CC725022DA91FB6004D43D4") + XCTAssertEqual(scheme.buildAction?.buildActionEntries[0].buildableReference.buildableName, "app_clip.app") + XCTAssertEqual(scheme.buildAction?.buildActionEntries[0].buildableReference.blueprintName, "app_clip") + XCTAssertEqual(scheme.buildAction?.buildActionEntries[0].buildableReference.referencedContainer, "container:example.xcodeproj") + + // Test action + XCTAssertEqual(scheme.testAction?.buildConfiguration, "Debug") + XCTAssertEqual(scheme.testAction?.selectedDebuggerIdentifier, "Xcode.DebuggerFoundation.Debugger.LLDB") + XCTAssertEqual(scheme.testAction?.selectedLauncherIdentifier, "Xcode.DebuggerFoundation.Launcher.LLDB") + XCTAssertTrue(scheme.testAction?.shouldUseLaunchSchemeArgsEnv == true) + XCTAssertTrue(scheme.testAction?.codeCoverageEnabled == false) + XCTAssertEqual(scheme.testAction?.onlyGenerateCoverageForSpecifiedTargets, nil) + XCTAssertNil(scheme.testAction?.macroExpansion) + XCTAssertEqual(scheme.testAction?.enableAddressSanitizer, false) + XCTAssertEqual(scheme.testAction?.enableASanStackUseAfterReturn, false) + XCTAssertEqual(scheme.testAction?.enableThreadSanitizer, false) + XCTAssertEqual(scheme.testAction?.enableUBSanitizer, false) + XCTAssertEqual(scheme.testAction?.disableMainThreadChecker, false) + XCTAssertEqual(scheme.testAction?.additionalOptions.isEmpty, true) + XCTAssertNil(scheme.testAction?.commandlineArguments) + XCTAssertNil(scheme.testAction?.environmentVariables) + + // Launch action + XCTAssertEqual(scheme.launchAction?.selectedDebuggerIdentifier, XCScheme.defaultDebugger) + XCTAssertEqual(scheme.launchAction?.selectedLauncherIdentifier, XCScheme.defaultLauncher) + XCTAssertEqual(scheme.launchAction?.buildConfiguration, "Debug") + XCTAssertEqual(scheme.launchAction?.launchStyle, XCScheme.LaunchAction.Style.auto) + XCTAssertNil(scheme.launchAction?.askForAppToLaunch) + XCTAssertNil(scheme.launchAction?.customWorkingDirectory) + XCTAssertTrue(scheme.launchAction?.useCustomWorkingDirectory == false) + XCTAssertTrue(scheme.launchAction?.ignoresPersistentStateOnLaunch == false) + XCTAssertTrue(scheme.launchAction?.debugDocumentVersioning == true) + XCTAssertEqual(scheme.launchAction?.debugServiceExtension, XCScheme.LaunchAction.defaultDebugServiceExtension) + XCTAssertTrue(scheme.launchAction?.allowLocationSimulation == true) + XCTAssertNil(scheme.launchAction?.locationScenarioReference) + XCTAssertNil(scheme.launchAction?.commandlineArguments) + XCTAssertEqual(scheme.launchAction?.enableAddressSanitizer, false) + XCTAssertEqual(scheme.launchAction?.enableASanStackUseAfterReturn, false) + XCTAssertEqual(scheme.launchAction?.enableThreadSanitizer, false) + XCTAssertEqual(scheme.launchAction?.stopOnEveryThreadSanitizerIssue, false) + XCTAssertEqual(scheme.launchAction?.enableUBSanitizer, false) + XCTAssertEqual(scheme.launchAction?.stopOnEveryUBSanitizerIssue, false) + XCTAssertEqual(scheme.launchAction?.disableMainThreadChecker, false) + XCTAssertEqual(scheme.launchAction?.disablePerformanceAntipatternChecker, false) + XCTAssertEqual(scheme.launchAction?.stopOnEveryMainThreadCheckerIssue, false) + XCTAssertEqual(scheme.launchAction?.additionalOptions.isEmpty, true) + XCTAssertNil(scheme.launchAction?.storeKitConfigurationFileReference) + XCTAssertNil(scheme.launchAction?.macroExpansion?.referencedContainer) + XCTAssertNil(scheme.launchAction?.environmentVariables) + XCTAssertEqual(scheme.launchAction?.appClipInvocationURLString, "https://example.com/") + + // Profile action + XCTAssertEqual(scheme.profileAction?.runnable?.runnableDebuggingMode, "0") + XCTAssertEqual(scheme.profileAction?.runnable?.buildableReference?.referencedContainer, "container:example.xcodeproj") + XCTAssertEqual(scheme.profileAction?.buildConfiguration, "Release") + XCTAssertTrue(scheme.profileAction?.shouldUseLaunchSchemeArgsEnv == true) + XCTAssertEqual(scheme.profileAction?.savedToolIdentifier, "") + XCTAssertNil(scheme.profileAction?.customWorkingDirectory) + XCTAssertTrue(scheme.profileAction?.useCustomWorkingDirectory == false) + XCTAssertTrue(scheme.profileAction?.debugDocumentVersioning == true) + XCTAssertNil(scheme.profileAction?.askForAppToLaunch) + XCTAssertNil(scheme.profileAction?.commandlineArguments) + XCTAssertNil(scheme.profileAction?.environmentVariables) + XCTAssertNil(scheme.profileAction?.launchAutomaticallySubstyle) + + // Analyze action + XCTAssertEqual(scheme.analyzeAction?.buildConfiguration, "Debug") + + // Archive action + XCTAssertEqual(scheme.archiveAction?.buildConfiguration, "Release") + XCTAssertTrue(scheme.archiveAction?.revealArchiveInOrganizer == true) + XCTAssertNil(scheme.archiveAction?.customArchiveName) + } + private func buildableReferenceWithStringBluePrint(name: String = "App") throws -> XCScheme.BuildableReference { // To allow performing comparisons when serializing / deserializing we need a // buildable reference that contains a `.string` blue print @@ -842,4 +942,8 @@ final class XCSchemeIntegrationTests: XCTestCase { private var buildArchitecturesSchemePath: Path { fixturesPath() + "Schemes/BuildArchitectures.xcscheme" } + + private var appClipScheme: Path { + fixturesPath() + "Schemes/AppClip.xcscheme" + } } From 7ed0fcca4ebfe065dd4abf6a4075727d525cfbaf Mon Sep 17 00:00:00 2001 From: fortmarek <9371695+fortmarek@users.noreply.github.com> Date: Mon, 28 Apr 2025 07:39:04 +0000 Subject: [PATCH 459/678] [Release] XcodeProj 9.1.0 --- CHANGELOG.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 45095dbf3..896c2a899 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [9.1.0] - 2025-04-28 +### Details +#### Features +- Implement support for the App Clip's URL by @ns-vasilev in [#927](https://github.com/tuist/XcodeProj/pull/927) + +## New Contributors +* @ns-vasilev made their first contribution in [#927](https://github.com/tuist/XcodeProj/pull/927) ## [9.0.2] - 2025-04-07 ### Details #### Bug Fixes @@ -148,6 +155,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Disable the renovatebot dashboard by @pepicrft in [#840](https://github.com/tuist/XcodeProj/pull/840) - Set up SwiftLint and SwiftFormat, run them against the project, and run them as part of the CI workflows by @pepicrft in [#836](https://github.com/tuist/XcodeProj/pull/836) +[9.1.0]: https://github.com/tuist/XcodeProj/compare/9.0.2..9.1.0 [9.0.2]: https://github.com/tuist/XcodeProj/compare/9.0.1..9.0.2 [9.0.1]: https://github.com/tuist/XcodeProj/compare/9.0.0..9.0.1 [9.0.0]: https://github.com/tuist/XcodeProj/compare/8.27.7..9.0.0 From 95d72ff58cbeb725c7c7f8dae61cec5ddf62046e Mon Sep 17 00:00:00 2001 From: Econa77 Date: Tue, 29 Apr 2025 17:04:20 +0900 Subject: [PATCH 460/678] feat: add fileSystemSynchronized properties to public helpers (#928) * Add fileSystemSynchronized properties * Addressed lint --- Sources/XcodeProj/Objects/Project/PBXProj.swift | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Sources/XcodeProj/Objects/Project/PBXProj.swift b/Sources/XcodeProj/Objects/Project/PBXProj.swift index c8faeb274..700add6b7 100644 --- a/Sources/XcodeProj/Objects/Project/PBXProj.swift +++ b/Sources/XcodeProj/Objects/Project/PBXProj.swift @@ -177,6 +177,14 @@ public extension PBXProj { var sourcesBuildPhases: [PBXSourcesBuildPhase] { Array(objects.sourcesBuildPhases.values) } var carbonResourcesBuildPhases: [PBXRezBuildPhase] { Array(objects.carbonResourcesBuildPhases.values) } var buildPhases: [PBXBuildPhase] { Array(objects.buildPhases.values) } + var fileSystemSynchronizedRootGroups: [PBXFileSystemSynchronizedRootGroup] { Array(objects.fileSystemSynchronizedRootGroups.values) } + var fileSystemSynchronizedBuildFileExceptionSets: [PBXFileSystemSynchronizedBuildFileExceptionSet] { + Array(objects.fileSystemSynchronizedBuildFileExceptionSets.values) + } + + var fileSystemSynchronizedGroupBuildPhaseMembershipExceptionSet: [PBXFileSystemSynchronizedGroupBuildPhaseMembershipExceptionSet] { + Array(objects.fileSystemSynchronizedGroupBuildPhaseMembershipExceptionSet.values) + } /// Returns root project. func rootProject() throws -> PBXProject? { From aeae32ce96f50bf5f9344d204d9a877b227b9de8 Mon Sep 17 00:00:00 2001 From: fortmarek <9371695+fortmarek@users.noreply.github.com> Date: Tue, 29 Apr 2025 08:04:57 +0000 Subject: [PATCH 461/678] [Release] XcodeProj 9.2.0 --- CHANGELOG.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 896c2a899..da2f18118 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [9.2.0] - 2025-04-29 +### Details +#### Features +- Add fileSystemSynchronized properties to public helpers by @Econa77 in [#928](https://github.com/tuist/XcodeProj/pull/928) + +## New Contributors +* @Econa77 made their first contribution in [#928](https://github.com/tuist/XcodeProj/pull/928) ## [9.1.0] - 2025-04-28 ### Details #### Features @@ -155,6 +162,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Disable the renovatebot dashboard by @pepicrft in [#840](https://github.com/tuist/XcodeProj/pull/840) - Set up SwiftLint and SwiftFormat, run them against the project, and run them as part of the CI workflows by @pepicrft in [#836](https://github.com/tuist/XcodeProj/pull/836) +[9.2.0]: https://github.com/tuist/XcodeProj/compare/9.1.0..9.2.0 [9.1.0]: https://github.com/tuist/XcodeProj/compare/9.0.2..9.1.0 [9.0.2]: https://github.com/tuist/XcodeProj/compare/9.0.1..9.0.2 [9.0.1]: https://github.com/tuist/XcodeProj/compare/9.0.0..9.0.1 From 564a9d1bcecf56cb1dd8507dc6f5b40c705edf0c Mon Sep 17 00:00:00 2001 From: Tamar Milchtaich Lavi <49520876+TamarMilchtaich@users.noreply.github.com> Date: Wed, 30 Apr 2025 11:32:10 +0300 Subject: [PATCH 462/678] feat(PBXFileReference): add expectedSignature property (#913) * feat(PBXFileReference): add expectedSignature property * Set up Swift with the v3 of the action, which uses swiftly under the hood * Pass the specific commit since the changes haven't been released yet * Use Mise to install Swift --------- Co-authored-by: Pedro --- .github/workflows/xcodeproj.yml | 8 ++------ .../XcodeProj/Objects/Files/PBXFileReference.swift | 11 +++++++++++ 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/.github/workflows/xcodeproj.yml b/.github/workflows/xcodeproj.yml index 591f2df6c..14bdb8601 100644 --- a/.github/workflows/xcodeproj.yml +++ b/.github/workflows/xcodeproj.yml @@ -30,9 +30,7 @@ jobs: steps: - uses: actions/checkout@v3 - uses: jdx/mise-action@v2 - - uses: swift-actions/setup-swift@v2 - with: - swift-version: "6.0.2" + - run: mise use swift@6.0.2 - name: Build run: swift build --configuration release test: @@ -50,9 +48,7 @@ jobs: steps: - uses: actions/checkout@v3 - uses: jdx/mise-action@v2 - - uses: swift-actions/setup-swift@v2 - with: - swift-version: "6.0.2" + - run: mise use swift@6.0.2 - run: | git config --global user.email 'xcodeproj@tuist.dev' git config --global user.name 'xcodeproj' diff --git a/Sources/XcodeProj/Objects/Files/PBXFileReference.swift b/Sources/XcodeProj/Objects/Files/PBXFileReference.swift index 9595e2536..f596f32cc 100644 --- a/Sources/XcodeProj/Objects/Files/PBXFileReference.swift +++ b/Sources/XcodeProj/Objects/Files/PBXFileReference.swift @@ -15,6 +15,9 @@ public final class PBXFileReference: PBXFileElement { /// Derived file type. For a file named "foo.swift" this value would be "sourcecode.swift" public var lastKnownFileType: String? + /// The XCFramework's expected code signature. `nil` if not an XCFramework reference or if the XCFramework is not signed. + public var expectedSignature: String? + /// Line ending type for the file public var lineEnding: UInt? @@ -44,6 +47,7 @@ public final class PBXFileReference: PBXFileElement { /// - indentWidth: the number of positions to indent blocks of code /// - tabWidth: the visual width of tab characters /// - lineEnding: the line ending type for the file. + /// - expectedSignature: code signature for signed XCFrameworks, `nil` otherwise. /// - languageSpecificationIdentifier: legacy programming language identifier. /// - xcLanguageSpecificationIdentifier: the programming language identifier. /// - plistStructureDefinitionIdentifier: the plist organizational family identifier. @@ -59,6 +63,7 @@ public final class PBXFileReference: PBXFileElement { indentWidth: UInt? = nil, tabWidth: UInt? = nil, lineEnding: UInt? = nil, + expectedSignature: String? = nil, languageSpecificationIdentifier: String? = nil, xcLanguageSpecificationIdentifier: String? = nil, plistStructureDefinitionIdentifier: String? = nil) { @@ -66,6 +71,7 @@ public final class PBXFileReference: PBXFileElement { self.explicitFileType = explicitFileType self.lastKnownFileType = lastKnownFileType self.lineEnding = lineEnding + self.expectedSignature = expectedSignature self.languageSpecificationIdentifier = languageSpecificationIdentifier self.xcLanguageSpecificationIdentifier = xcLanguageSpecificationIdentifier self.plistStructureDefinitionIdentifier = plistStructureDefinitionIdentifier @@ -86,6 +92,7 @@ public final class PBXFileReference: PBXFileElement { case explicitFileType case lastKnownFileType case lineEnding + case expectedSignature case languageSpecificationIdentifier case xcLanguageSpecificationIdentifier case plistStructureDefinitionIdentifier @@ -97,6 +104,7 @@ public final class PBXFileReference: PBXFileElement { explicitFileType = try container.decodeIfPresent(.explicitFileType) lastKnownFileType = try container.decodeIfPresent(.lastKnownFileType) lineEnding = try container.decodeIntIfPresent(.lineEnding) + expectedSignature = try container.decodeIfPresent(.expectedSignature) languageSpecificationIdentifier = try container.decodeIfPresent(.languageSpecificationIdentifier) xcLanguageSpecificationIdentifier = try container.decodeIfPresent(.xcLanguageSpecificationIdentifier) plistStructureDefinitionIdentifier = try container.decodeIfPresent(.plistStructureDefinitionIdentifier) @@ -122,6 +130,9 @@ public final class PBXFileReference: PBXFileElement { if let lineEnding { dictionary["lineEnding"] = .string(CommentedString("\(lineEnding)")) } + if let expectedSignature { + dictionary["expectedSignature"] = .string(CommentedString(expectedSignature)) + } if let languageSpecificationIdentifier { dictionary["languageSpecificationIdentifier"] = .string(CommentedString(languageSpecificationIdentifier)) } From d24584154c90a5144fd1a74439371342dd42162f Mon Sep 17 00:00:00 2001 From: pepicrft <663605+pepicrft@users.noreply.github.com> Date: Wed, 30 Apr 2025 08:32:45 +0000 Subject: [PATCH 463/678] [Release] XcodeProj 9.3.0 --- CHANGELOG.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index da2f18118..14f289221 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [9.3.0] - 2025-04-30 +### Details +#### Features +- Add expectedSignature property by @TamarMilchtaich in [#913](https://github.com/tuist/XcodeProj/pull/913) + +## New Contributors +* @TamarMilchtaich made their first contribution in [#913](https://github.com/tuist/XcodeProj/pull/913) ## [9.2.0] - 2025-04-29 ### Details #### Features @@ -162,6 +169,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Disable the renovatebot dashboard by @pepicrft in [#840](https://github.com/tuist/XcodeProj/pull/840) - Set up SwiftLint and SwiftFormat, run them against the project, and run them as part of the CI workflows by @pepicrft in [#836](https://github.com/tuist/XcodeProj/pull/836) +[9.3.0]: https://github.com/tuist/XcodeProj/compare/9.2.0..9.3.0 [9.2.0]: https://github.com/tuist/XcodeProj/compare/9.1.0..9.2.0 [9.1.0]: https://github.com/tuist/XcodeProj/compare/9.0.2..9.1.0 [9.0.2]: https://github.com/tuist/XcodeProj/compare/9.0.1..9.0.2 From a375a871c5c2334ac7c00ac9dab017bb6fd344a9 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 5 May 2025 19:15:48 +0000 Subject: [PATCH 464/678] chore(deps): update dependency tuist to v4.49.0 (#932) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise.toml b/.mise.toml index 5de19db4d..5b0de49ee 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,5 +1,5 @@ [tools] swiftformat = "0.54.3" -tuist = "4.48.2" +tuist = "4.49.0" swiftlint = "0.55.1" "git-cliff" = "2.4.0" From 3e0f94e5ff77392a47eecc4b4dd32724c7b457b8 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 7 May 2025 00:12:30 +0000 Subject: [PATCH 465/678] chore(deps): update dependency tuist to v4.49.1 (#933) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise.toml b/.mise.toml index 5b0de49ee..c3a9cb980 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,5 +1,5 @@ [tools] swiftformat = "0.54.3" -tuist = "4.49.0" +tuist = "4.49.1" swiftlint = "0.55.1" "git-cliff" = "2.4.0" From 05e0514d86dc7bf5d67bb6a59f5eedf0586330d3 Mon Sep 17 00:00:00 2001 From: rw-garmin <164553849+rw-garmin@users.noreply.github.com> Date: Thu, 15 May 2025 01:30:19 -0500 Subject: [PATCH 466/678] feat: add .apinotes support (#931) --- Sources/XcodeProj/Project/Xcode.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/XcodeProj/Project/Xcode.swift b/Sources/XcodeProj/Project/Xcode.swift index 907fc5a00..44ab18058 100644 --- a/Sources/XcodeProj/Project/Xcode.swift +++ b/Sources/XcodeProj/Project/Xcode.swift @@ -60,7 +60,7 @@ public enum Xcode { public static let inheritedKeywords = ["${inherited}", "$(inherited)"] /// Header files extensions. - public static let headersExtensions = [".h", ".hh", ".hpp", ".ipp", ".tpp", ".hxx", ".def", ".inl", ".inc", ".pch"] + public static let headersExtensions = [".h", ".hh", ".hpp", ".ipp", ".tpp", ".hxx", ".def", ".inl", ".inc", ".pch", ".apinotes"] /// Supported values. public enum Supported { From f56501ae7c8f8ba10e9d74b5cd52b061cf9fcba1 Mon Sep 17 00:00:00 2001 From: fortmarek <9371695+fortmarek@users.noreply.github.com> Date: Thu, 15 May 2025 06:31:05 +0000 Subject: [PATCH 467/678] [Release] XcodeProj 9.4.0 --- CHANGELOG.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 14f289221..2dd6b657d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [9.4.0] - 2025-05-15 +### Details +#### Features +- Add .apinotes support by @rw-garmin in [#931](https://github.com/tuist/XcodeProj/pull/931) + +## New Contributors +* @rw-garmin made their first contribution in [#931](https://github.com/tuist/XcodeProj/pull/931) ## [9.3.0] - 2025-04-30 ### Details #### Features @@ -169,6 +176,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Disable the renovatebot dashboard by @pepicrft in [#840](https://github.com/tuist/XcodeProj/pull/840) - Set up SwiftLint and SwiftFormat, run them against the project, and run them as part of the CI workflows by @pepicrft in [#836](https://github.com/tuist/XcodeProj/pull/836) +[9.4.0]: https://github.com/tuist/XcodeProj/compare/9.3.0..9.4.0 [9.3.0]: https://github.com/tuist/XcodeProj/compare/9.2.0..9.3.0 [9.2.0]: https://github.com/tuist/XcodeProj/compare/9.1.0..9.2.0 [9.1.0]: https://github.com/tuist/XcodeProj/compare/9.0.2..9.1.0 From 48a0fdb29dddbbcc3f6ee71447299fbf249d9596 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 15 May 2025 16:13:45 +0000 Subject: [PATCH 468/678] chore(deps): update dependency tuist to v4.50.0 (#935) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise.toml b/.mise.toml index c3a9cb980..345026d33 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,5 +1,5 @@ [tools] swiftformat = "0.54.3" -tuist = "4.49.1" +tuist = "4.50.0" swiftlint = "0.55.1" "git-cliff" = "2.4.0" From dee1078dbe243aafb1a94f8db9a44577fdad1a36 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 15 May 2025 22:25:20 +0000 Subject: [PATCH 469/678] chore(deps): update dependency tuist to v4.50.1 (#936) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise.toml b/.mise.toml index 345026d33..b433b799c 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,5 +1,5 @@ [tools] swiftformat = "0.54.3" -tuist = "4.50.0" +tuist = "4.50.1" swiftlint = "0.55.1" "git-cliff" = "2.4.0" From 23e5ae70d1577e0eb0ef431f366c3209e8fb82bf Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Fri, 16 May 2025 15:43:32 +0200 Subject: [PATCH 470/678] docs: add mikhailmulyar as a contributor for code (#938) * docs: update README.md [skip ci] * docs: update .all-contributorsrc [skip ci] --------- Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com> --- .all-contributorsrc | 9 +++++++++ README.md | 3 ++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/.all-contributorsrc b/.all-contributorsrc index 31098a309..a6e7f81fd 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -409,6 +409,15 @@ "contributions": [ "code" ] + }, + { + "login": "mikhailmulyar", + "name": "Mikhail", + "avatar_url": "https://avatars.githubusercontent.com/u/2234720?v=4", + "profile": "https://github.com/mikhailmulyar", + "contributions": [ + "code" + ] } ], "contributorsPerLine": 7, diff --git a/README.md b/README.md index 3d169855d..a96d0f57f 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # XcodeProj -[![All Contributors](https://img.shields.io/badge/all_contributors-45-orange.svg?style=flat-square)](#contributors-) +[![All Contributors](https://img.shields.io/badge/all_contributors-46-orange.svg?style=flat-square)](#contributors-) [![Swift Package Manager](https://img.shields.io/badge/swift%20package%20manager-compatible-brightgreen.svg)](https://swift.org/package-manager/) @@ -191,6 +191,7 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d George Navarro
George Navarro

💻 Maxim
Maxim

💻 Bryan Summersett
Bryan Summersett

💻 + Mikhail
Mikhail

💻 From 5dce1ee463c7070e2c2f9f137ae021b8aa0a04dd Mon Sep 17 00:00:00 2001 From: Trent Guillory <137322263+trentguillory-gc@users.noreply.github.com> Date: Mon, 19 May 2025 02:14:08 -0500 Subject: [PATCH 471/678] refactor: make XCScheme static path functions public (#940) * Make XCScheme static path functions public. * Move public marker to extension, from methods --- Sources/XcodeProj/Scheme/XCScheme.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/XcodeProj/Scheme/XCScheme.swift b/Sources/XcodeProj/Scheme/XCScheme.swift index a3043a93f..41013fb62 100644 --- a/Sources/XcodeProj/Scheme/XCScheme.swift +++ b/Sources/XcodeProj/Scheme/XCScheme.swift @@ -144,7 +144,7 @@ public final class XCScheme: Writable, Equatable { } } -extension XCScheme { +public extension XCScheme { /// Returns schemes folder path relative to the given path. /// /// - Parameter path: parent folder of schemes folder (xcshareddata or xcuserdata) From 6783abd2ec171e254f3d4aedb2efa1cc73fea414 Mon Sep 17 00:00:00 2001 From: fortmarek <9371695+fortmarek@users.noreply.github.com> Date: Mon, 19 May 2025 07:14:41 +0000 Subject: [PATCH 472/678] [Release] XcodeProj 9.4.1 --- CHANGELOG.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2dd6b657d..078ad2c3a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,16 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [9.4.1] - 2025-05-19 +### Details +#### Documentation +- Add mikhailmulyar as a contributor for code by @allcontributors[bot] in [#938](https://github.com/tuist/XcodeProj/pull/938) + +#### Refactor +- Make XCScheme static path functions public by @trentguillory-gc in [#940](https://github.com/tuist/XcodeProj/pull/940) + +## New Contributors +* @trentguillory-gc made their first contribution in [#940](https://github.com/tuist/XcodeProj/pull/940) ## [9.4.0] - 2025-05-15 ### Details #### Features @@ -176,6 +186,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Disable the renovatebot dashboard by @pepicrft in [#840](https://github.com/tuist/XcodeProj/pull/840) - Set up SwiftLint and SwiftFormat, run them against the project, and run them as part of the CI workflows by @pepicrft in [#836](https://github.com/tuist/XcodeProj/pull/836) +[9.4.1]: https://github.com/tuist/XcodeProj/compare/9.4.0..9.4.1 [9.4.0]: https://github.com/tuist/XcodeProj/compare/9.3.0..9.4.0 [9.3.0]: https://github.com/tuist/XcodeProj/compare/9.2.0..9.3.0 [9.2.0]: https://github.com/tuist/XcodeProj/compare/9.1.0..9.2.0 From 73d818d313bc399770be8094b3b8853cdbf30466 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 20 May 2025 01:50:08 +0000 Subject: [PATCH 473/678] chore(deps): update dependency tuist to v4.50.2 (#941) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise.toml b/.mise.toml index b433b799c..b18aa735e 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,5 +1,5 @@ [tools] swiftformat = "0.54.3" -tuist = "4.50.1" +tuist = "4.50.2" swiftlint = "0.55.1" "git-cliff" = "2.4.0" From 7077226dc24643677598b4e363e5cb33ae949167 Mon Sep 17 00:00:00 2001 From: Mikhail Date: Tue, 20 May 2025 17:26:38 +0300 Subject: [PATCH 474/678] fix: Align the sorting of project references with Xcode 16 (#937) * IOSC-12423 do sort projectReferences as Xcode 16 do * IOSC-12423 comment fatalError to publish code to co * Make the sorting stricter * Added tests for Xcode 16 projects sorting * Fix lint issues --------- Co-authored-by: Maxim Kholyavkin Co-authored-by: Pedro Co-authored-by: Mikhail Mulyar --- .../Sources/AppDelegate.swift | 16 + .../Test.xcodeproj/project.pbxproj | 450 ++++++++++++++++++ .../xcshareddata/xcschemes/App.xcscheme | 79 +++ .../Wrong.xcodeproj/project.pbxproj | 450 ++++++++++++++++++ .../xcshareddata/xcschemes/App.xcscheme | 79 +++ .../Objects/Project/PBXProjEncoder.swift | 20 + .../Objects/Project/PBXProjEncoderTests.swift | 18 + Tests/XcodeProjTests/Tests/Fixtures.swift | 5 + 8 files changed, 1117 insertions(+) create mode 100644 Fixtures/Xcode16ProjectReferenceOrder/Sources/AppDelegate.swift create mode 100644 Fixtures/Xcode16ProjectReferenceOrder/Test.xcodeproj/project.pbxproj create mode 100644 Fixtures/Xcode16ProjectReferenceOrder/Test.xcodeproj/xcshareddata/xcschemes/App.xcscheme create mode 100644 Fixtures/Xcode16ProjectReferenceOrder/Wrong.xcodeproj/project.pbxproj create mode 100644 Fixtures/Xcode16ProjectReferenceOrder/Wrong.xcodeproj/xcshareddata/xcschemes/App.xcscheme diff --git a/Fixtures/Xcode16ProjectReferenceOrder/Sources/AppDelegate.swift b/Fixtures/Xcode16ProjectReferenceOrder/Sources/AppDelegate.swift new file mode 100644 index 000000000..6cf500afb --- /dev/null +++ b/Fixtures/Xcode16ProjectReferenceOrder/Sources/AppDelegate.swift @@ -0,0 +1,16 @@ +import Framework1 +import Framework2 +import UIKit + +@main +class AppDelegate: UIResponder, UIApplicationDelegate { + var window: UIWindow? + + func applicationDidFinishLaunching(_: UIApplication) { + print(hello()) + } + + func hello() -> String { + "AppDelegate.hello()" + } +} diff --git a/Fixtures/Xcode16ProjectReferenceOrder/Test.xcodeproj/project.pbxproj b/Fixtures/Xcode16ProjectReferenceOrder/Test.xcodeproj/project.pbxproj new file mode 100644 index 000000000..b9b45f9a9 --- /dev/null +++ b/Fixtures/Xcode16ProjectReferenceOrder/Test.xcodeproj/project.pbxproj @@ -0,0 +1,450 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 56; + objects = { + +/* Begin PBXBuildFile section */ + 3108C05C7B0C4FD6AC077294 /* Framework2.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 6D728BF5C49E97251DA378AE /* Framework2.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; + 5D8C48ABB7D5D013DDBD67AA /* Framework1.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0FCDEDB6CEA64BD069DC9EA9 /* Framework1.framework */; }; + C2317A164A6A4F635FE4CCD7 /* Framework1.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 0FCDEDB6CEA64BD069DC9EA9 /* Framework1.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; + C57CB036110A3D5DCC9E437A /* Framework2.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6D728BF5C49E97251DA378AE /* Framework2.framework */; }; + D2AE54DED6608D5B956A5E45 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 020631B5E0BB47399A2CE86B /* AppDelegate.swift */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 063E6B9654162D044FC79E65 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 08931D1475E84509040F7FEA /* Framework2.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = C779969BD4C211DD5C3B641C; + remoteInfo = Framework2; + }; + 811B516259EFC3D33371D664 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 87A3E8A0727A99EE88ED4E64 /* Framework1.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = E44C53B0829E6D20396C5BB6; + remoteInfo = Framework1; + }; + CA6C894E871DDE6DC2017E72 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 08931D1475E84509040F7FEA /* Framework2.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = DC40FA3F02AF8EB1A758B163; + remoteInfo = Framework2; + }; + E6EBF03BE94A8028ED821B7B /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 87A3E8A0727A99EE88ED4E64 /* Framework1.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = 006F8DE332EBBD68331EC394; + remoteInfo = Framework1; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXCopyFilesBuildPhase section */ + BF31C3A479ECD7CBA0640A2F /* Embed Frameworks */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 10; + files = ( + C2317A164A6A4F635FE4CCD7 /* Framework1.framework in Embed Frameworks */, + 3108C05C7B0C4FD6AC077294 /* Framework2.framework in Embed Frameworks */, + ); + name = "Embed Frameworks"; + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXCopyFilesBuildPhase section */ + +/* Begin PBXFileReference section */ + 020631B5E0BB47399A2CE86B /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + 08931D1475E84509040F7FEA /* Framework2.xcodeproj */ = {isa = PBXFileReference; explicitFileType = "wrapper.pb-project"; includeInIndex = 0; name = Framework2.xcodeproj; path = ../Framework2/Framework2.xcodeproj; sourceTree = SOURCE_ROOT; }; + 0FCDEDB6CEA64BD069DC9EA9 /* Framework1.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Framework1.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 6D728BF5C49E97251DA378AE /* Framework2.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Framework2.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 87A3E8A0727A99EE88ED4E64 /* Framework1.xcodeproj */ = {isa = PBXFileReference; explicitFileType = "wrapper.pb-project"; includeInIndex = 0; name = Framework1.xcodeproj; path = ../Framework1/Framework1.xcodeproj; sourceTree = SOURCE_ROOT; }; + E203E65EDD1A90FCBAA42C9E /* App.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = App.app; sourceTree = BUILT_PRODUCTS_DIR; }; + F09268C492FF78A6C82868C6 /* App-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist; path = "App-Info.plist"; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + B27C7CF4B617049554976EFD /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 5D8C48ABB7D5D013DDBD67AA /* Framework1.framework in Frameworks */, + C57CB036110A3D5DCC9E437A /* Framework2.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 0767F0D2E9F7C0B23673A1B1 = { + isa = PBXGroup; + children = ( + C7A7B9165A3588E4002596F4 /* Project */, + 67F182DC08786FF3C82D39E8 /* Frameworks */, + 73B13978C93862E5AD69BCC8 /* Products */, + ); + sourceTree = ""; + }; + 15ACBAE4CF0A973AED8CC371 /* Products */ = { + isa = PBXGroup; + children = ( + BBE8CAF8BA821ED44E58C6F5 /* Framework2.framework */, + ); + name = Products; + sourceTree = ""; + }; + 20C83B4860AC239B5E5FDF3C /* InfoPlists */ = { + isa = PBXGroup; + children = ( + F09268C492FF78A6C82868C6 /* App-Info.plist */, + ); + path = InfoPlists; + sourceTree = ""; + }; + 30CD57449DD0BAD1F51809C3 /* Products */ = { + isa = PBXGroup; + children = ( + F8CBE43B9129D34973556D4F /* Framework1.framework */, + ); + name = Products; + sourceTree = ""; + }; + 67F182DC08786FF3C82D39E8 /* Frameworks */ = { + isa = PBXGroup; + children = ( + ); + name = Frameworks; + sourceTree = ""; + }; + 6BB3FD9AE4757E7AE14C43B7 /* Sources */ = { + isa = PBXGroup; + children = ( + 020631B5E0BB47399A2CE86B /* AppDelegate.swift */, + ); + path = Sources; + sourceTree = ""; + }; + 73B13978C93862E5AD69BCC8 /* Products */ = { + isa = PBXGroup; + children = ( + E203E65EDD1A90FCBAA42C9E /* App.app */, + 0FCDEDB6CEA64BD069DC9EA9 /* Framework1.framework */, + 6D728BF5C49E97251DA378AE /* Framework2.framework */, + ); + name = Products; + sourceTree = ""; + }; + C7A7B9165A3588E4002596F4 /* Project */ = { + isa = PBXGroup; + children = ( + 6BB3FD9AE4757E7AE14C43B7 /* Sources */, + ); + name = Project; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 8359F535E312088875AB7F4E /* App */ = { + isa = PBXNativeTarget; + buildConfigurationList = BAA38452720711B406475F28 /* Build configuration list for PBXNativeTarget "App" */; + buildPhases = ( + 2053EE4C6238D6C3AEB2ADB3 /* Sources */, + F1BC716AD69EACCBD2A2DDBC /* Resources */, + BF31C3A479ECD7CBA0640A2F /* Embed Frameworks */, + B27C7CF4B617049554976EFD /* Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + 58FB5C08E20463C938366127 /* PBXTargetDependency */, + CD591349E38A6A3EB5AA81DD /* PBXTargetDependency */, + ); + name = App; + packageProductDependencies = ( + ); + productName = App; + productReference = E203E65EDD1A90FCBAA42C9E /* App.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 22E4F0B4EBDBD2631840392B /* Project object */ = { + isa = PBXProject; + attributes = { + BuildIndependentTargetsInParallel = YES; + }; + buildConfigurationList = C94346B8B75719D8319921C2 /* Build configuration list for PBXProject "Test" */; + compatibilityVersion = "Xcode 14.0"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + Base, + en, + ); + mainGroup = 0767F0D2E9F7C0B23673A1B1; + productRefGroup = 73B13978C93862E5AD69BCC8 /* Products */; + projectDirPath = ""; + projectReferences = ( + { + ProductGroup = 30CD57449DD0BAD1F51809C3 /* Products */; + ProjectRef = 87A3E8A0727A99EE88ED4E64 /* Framework1.xcodeproj */; + }, + { + ProductGroup = 15ACBAE4CF0A973AED8CC371 /* Products */; + ProjectRef = 08931D1475E84509040F7FEA /* Framework2.xcodeproj */; + }, + ); + projectRoot = ""; + targets = ( + 8359F535E312088875AB7F4E /* App */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXReferenceProxy section */ + BBE8CAF8BA821ED44E58C6F5 /* Framework2.framework */ = { + isa = PBXReferenceProxy; + fileType = wrapper.framework; + path = Framework2.framework; + remoteRef = 063E6B9654162D044FC79E65 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + F8CBE43B9129D34973556D4F /* Framework1.framework */ = { + isa = PBXReferenceProxy; + fileType = wrapper.framework; + path = Framework1.framework; + remoteRef = 811B516259EFC3D33371D664 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; +/* End PBXReferenceProxy section */ + +/* Begin PBXResourcesBuildPhase section */ + F1BC716AD69EACCBD2A2DDBC /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 2053EE4C6238D6C3AEB2ADB3 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + D2AE54DED6608D5B956A5E45 /* AppDelegate.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 58FB5C08E20463C938366127 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = Framework2; + targetProxy = CA6C894E871DDE6DC2017E72 /* PBXContainerItemProxy */; + }; + CD591349E38A6A3EB5AA81DD /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = Framework1; + targetProxy = E6EBF03BE94A8028ED821B7B /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin XCBuildConfiguration section */ + 0B98A64D6F621FDCEEA0CE44 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_IDENTITY = "iPhone Developer"; + ENABLE_PREVIEWS = YES; + INFOPLIST_FILE = "Derived/InfoPlists/App-Info.plist"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = io.tuist.App; + PRODUCT_NAME = App; + SDKROOT = iphoneos; + SUPPORTS_MACCATALYST = NO; + SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = YES; + SUPPORTS_XR_DESIGNED_FOR_IPHONE_IPAD = NO; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) DEBUG"; + SWIFT_COMPILATION_MODE = singlefile; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + 58BAFCCFAE3AD62113BBEDEF /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + DEAD_CODE_STRIPPING = YES; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Debug; + }; + 5904C1CCA86A83838723C772 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + DEAD_CODE_STRIPPING = YES; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + MTL_ENABLE_DEBUG_INFO = NO; + PRODUCT_NAME = "$(TARGET_NAME)"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 5E15950A8DD3B82ED1ED7849 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_IDENTITY = "iPhone Developer"; + ENABLE_PREVIEWS = YES; + INFOPLIST_FILE = "Derived/InfoPlists/App-Info.plist"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = io.tuist.App; + PRODUCT_NAME = App; + SDKROOT = iphoneos; + SUPPORTS_MACCATALYST = NO; + SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = YES; + SUPPORTS_XR_DESIGNED_FOR_IPHONE_IPAD = NO; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + BAA38452720711B406475F28 /* Build configuration list for PBXNativeTarget "App" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 0B98A64D6F621FDCEEA0CE44 /* Debug */, + 5E15950A8DD3B82ED1ED7849 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + C94346B8B75719D8319921C2 /* Build configuration list for PBXProject "Test" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 58BAFCCFAE3AD62113BBEDEF /* Debug */, + 5904C1CCA86A83838723C772 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 22E4F0B4EBDBD2631840392B /* Project object */; +} diff --git a/Fixtures/Xcode16ProjectReferenceOrder/Test.xcodeproj/xcshareddata/xcschemes/App.xcscheme b/Fixtures/Xcode16ProjectReferenceOrder/Test.xcodeproj/xcshareddata/xcschemes/App.xcscheme new file mode 100644 index 000000000..aefdccd72 --- /dev/null +++ b/Fixtures/Xcode16ProjectReferenceOrder/Test.xcodeproj/xcshareddata/xcschemes/App.xcscheme @@ -0,0 +1,79 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Fixtures/Xcode16ProjectReferenceOrder/Wrong.xcodeproj/project.pbxproj b/Fixtures/Xcode16ProjectReferenceOrder/Wrong.xcodeproj/project.pbxproj new file mode 100644 index 000000000..41041dc4b --- /dev/null +++ b/Fixtures/Xcode16ProjectReferenceOrder/Wrong.xcodeproj/project.pbxproj @@ -0,0 +1,450 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 56; + objects = { + +/* Begin PBXBuildFile section */ + 3108C05C7B0C4FD6AC077294 /* Framework2.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 6D728BF5C49E97251DA378AE /* Framework2.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; + 5D8C48ABB7D5D013DDBD67AA /* Framework1.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0FCDEDB6CEA64BD069DC9EA9 /* Framework1.framework */; }; + C2317A164A6A4F635FE4CCD7 /* Framework1.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 0FCDEDB6CEA64BD069DC9EA9 /* Framework1.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; + C57CB036110A3D5DCC9E437A /* Framework2.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6D728BF5C49E97251DA378AE /* Framework2.framework */; }; + D2AE54DED6608D5B956A5E45 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 020631B5E0BB47399A2CE86B /* AppDelegate.swift */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 063E6B9654162D044FC79E65 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 08931D1475E84509040F7FEA /* Framework2.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = C779969BD4C211DD5C3B641C; + remoteInfo = Framework2; + }; + 811B516259EFC3D33371D664 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 87A3E8A0727A99EE88ED4E64 /* Framework1.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = E44C53B0829E6D20396C5BB6; + remoteInfo = Framework1; + }; + CA6C894E871DDE6DC2017E72 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 08931D1475E84509040F7FEA /* Framework2.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = DC40FA3F02AF8EB1A758B163; + remoteInfo = Framework2; + }; + E6EBF03BE94A8028ED821B7B /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 87A3E8A0727A99EE88ED4E64 /* Framework1.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = 006F8DE332EBBD68331EC394; + remoteInfo = Framework1; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXCopyFilesBuildPhase section */ + BF31C3A479ECD7CBA0640A2F /* Embed Frameworks */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 10; + files = ( + C2317A164A6A4F635FE4CCD7 /* Framework1.framework in Embed Frameworks */, + 3108C05C7B0C4FD6AC077294 /* Framework2.framework in Embed Frameworks */, + ); + name = "Embed Frameworks"; + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXCopyFilesBuildPhase section */ + +/* Begin PBXFileReference section */ + 020631B5E0BB47399A2CE86B /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + 08931D1475E84509040F7FEA /* Framework2.xcodeproj */ = {isa = PBXFileReference; explicitFileType = "wrapper.pb-project"; includeInIndex = 0; name = Framework2.xcodeproj; path = ../Framework2/Framework2.xcodeproj; sourceTree = SOURCE_ROOT; }; + 0FCDEDB6CEA64BD069DC9EA9 /* Framework1.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Framework1.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 6D728BF5C49E97251DA378AE /* Framework2.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Framework2.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 87A3E8A0727A99EE88ED4E64 /* Framework1.xcodeproj */ = {isa = PBXFileReference; explicitFileType = "wrapper.pb-project"; includeInIndex = 0; name = Framework1.xcodeproj; path = ../Framework1/Framework1.xcodeproj; sourceTree = SOURCE_ROOT; }; + E203E65EDD1A90FCBAA42C9E /* App.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = App.app; sourceTree = BUILT_PRODUCTS_DIR; }; + F09268C492FF78A6C82868C6 /* App-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist; path = "App-Info.plist"; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + B27C7CF4B617049554976EFD /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 5D8C48ABB7D5D013DDBD67AA /* Framework1.framework in Frameworks */, + C57CB036110A3D5DCC9E437A /* Framework2.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 0767F0D2E9F7C0B23673A1B1 = { + isa = PBXGroup; + children = ( + C7A7B9165A3588E4002596F4 /* Project */, + 67F182DC08786FF3C82D39E8 /* Frameworks */, + 73B13978C93862E5AD69BCC8 /* Products */, + ); + sourceTree = ""; + }; + 15ACBAE4CF0A973AED8CC371 /* Products */ = { + isa = PBXGroup; + children = ( + BBE8CAF8BA821ED44E58C6F5 /* Framework2.framework */, + ); + name = Products; + sourceTree = ""; + }; + 20C83B4860AC239B5E5FDF3C /* InfoPlists */ = { + isa = PBXGroup; + children = ( + F09268C492FF78A6C82868C6 /* App-Info.plist */, + ); + path = InfoPlists; + sourceTree = ""; + }; + 30CD57449DD0BAD1F51809C3 /* Products */ = { + isa = PBXGroup; + children = ( + F8CBE43B9129D34973556D4F /* Framework1.framework */, + ); + name = Products; + sourceTree = ""; + }; + 67F182DC08786FF3C82D39E8 /* Frameworks */ = { + isa = PBXGroup; + children = ( + ); + name = Frameworks; + sourceTree = ""; + }; + 6BB3FD9AE4757E7AE14C43B7 /* Sources */ = { + isa = PBXGroup; + children = ( + 020631B5E0BB47399A2CE86B /* AppDelegate.swift */, + ); + path = Sources; + sourceTree = ""; + }; + 73B13978C93862E5AD69BCC8 /* Products */ = { + isa = PBXGroup; + children = ( + E203E65EDD1A90FCBAA42C9E /* App.app */, + 0FCDEDB6CEA64BD069DC9EA9 /* Framework1.framework */, + 6D728BF5C49E97251DA378AE /* Framework2.framework */, + ); + name = Products; + sourceTree = ""; + }; + C7A7B9165A3588E4002596F4 /* Project */ = { + isa = PBXGroup; + children = ( + 6BB3FD9AE4757E7AE14C43B7 /* Sources */, + ); + name = Project; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 8359F535E312088875AB7F4E /* App */ = { + isa = PBXNativeTarget; + buildConfigurationList = BAA38452720711B406475F28 /* Build configuration list for PBXNativeTarget "App" */; + buildPhases = ( + 2053EE4C6238D6C3AEB2ADB3 /* Sources */, + F1BC716AD69EACCBD2A2DDBC /* Resources */, + BF31C3A479ECD7CBA0640A2F /* Embed Frameworks */, + B27C7CF4B617049554976EFD /* Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + 58FB5C08E20463C938366127 /* PBXTargetDependency */, + CD591349E38A6A3EB5AA81DD /* PBXTargetDependency */, + ); + name = App; + packageProductDependencies = ( + ); + productName = App; + productReference = E203E65EDD1A90FCBAA42C9E /* App.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 22E4F0B4EBDBD2631840392B /* Project object */ = { + isa = PBXProject; + attributes = { + BuildIndependentTargetsInParallel = YES; + }; + buildConfigurationList = C94346B8B75719D8319921C2 /* Build configuration list for PBXProject "MainApp" */; + compatibilityVersion = "Xcode 14.0"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + Base, + en, + ); + mainGroup = 0767F0D2E9F7C0B23673A1B1; + productRefGroup = 73B13978C93862E5AD69BCC8 /* Products */; + projectDirPath = ""; + projectReferences = ( + { + ProductGroup = 15ACBAE4CF0A973AED8CC371 /* Products */; + ProjectRef = 08931D1475E84509040F7FEA /* Framework2.xcodeproj */; + }, + { + ProductGroup = 30CD57449DD0BAD1F51809C3 /* Products */; + ProjectRef = 87A3E8A0727A99EE88ED4E64 /* Framework1.xcodeproj */; + }, + ); + projectRoot = ""; + targets = ( + 8359F535E312088875AB7F4E /* App */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXReferenceProxy section */ + BBE8CAF8BA821ED44E58C6F5 /* Framework2.framework */ = { + isa = PBXReferenceProxy; + fileType = wrapper.framework; + path = Framework2.framework; + remoteRef = 063E6B9654162D044FC79E65 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + F8CBE43B9129D34973556D4F /* Framework1.framework */ = { + isa = PBXReferenceProxy; + fileType = wrapper.framework; + path = Framework1.framework; + remoteRef = 811B516259EFC3D33371D664 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; +/* End PBXReferenceProxy section */ + +/* Begin PBXResourcesBuildPhase section */ + F1BC716AD69EACCBD2A2DDBC /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 2053EE4C6238D6C3AEB2ADB3 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + D2AE54DED6608D5B956A5E45 /* AppDelegate.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 58FB5C08E20463C938366127 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = Framework2; + targetProxy = CA6C894E871DDE6DC2017E72 /* PBXContainerItemProxy */; + }; + CD591349E38A6A3EB5AA81DD /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = Framework1; + targetProxy = E6EBF03BE94A8028ED821B7B /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin XCBuildConfiguration section */ + 0B98A64D6F621FDCEEA0CE44 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_IDENTITY = "iPhone Developer"; + ENABLE_PREVIEWS = YES; + INFOPLIST_FILE = "Derived/InfoPlists/App-Info.plist"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = io.tuist.App; + PRODUCT_NAME = App; + SDKROOT = iphoneos; + SUPPORTS_MACCATALYST = NO; + SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = YES; + SUPPORTS_XR_DESIGNED_FOR_IPHONE_IPAD = NO; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) DEBUG"; + SWIFT_COMPILATION_MODE = singlefile; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + 58BAFCCFAE3AD62113BBEDEF /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + DEAD_CODE_STRIPPING = YES; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Debug; + }; + 5904C1CCA86A83838723C772 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + DEAD_CODE_STRIPPING = YES; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + MTL_ENABLE_DEBUG_INFO = NO; + PRODUCT_NAME = "$(TARGET_NAME)"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 5E15950A8DD3B82ED1ED7849 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_IDENTITY = "iPhone Developer"; + ENABLE_PREVIEWS = YES; + INFOPLIST_FILE = "Derived/InfoPlists/App-Info.plist"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = io.tuist.App; + PRODUCT_NAME = App; + SDKROOT = iphoneos; + SUPPORTS_MACCATALYST = NO; + SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = YES; + SUPPORTS_XR_DESIGNED_FOR_IPHONE_IPAD = NO; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + BAA38452720711B406475F28 /* Build configuration list for PBXNativeTarget "App" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 0B98A64D6F621FDCEEA0CE44 /* Debug */, + 5E15950A8DD3B82ED1ED7849 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + C94346B8B75719D8319921C2 /* Build configuration list for PBXProject "MainApp" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 58BAFCCFAE3AD62113BBEDEF /* Debug */, + 5904C1CCA86A83838723C772 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 22E4F0B4EBDBD2631840392B /* Project object */; +} diff --git a/Fixtures/Xcode16ProjectReferenceOrder/Wrong.xcodeproj/xcshareddata/xcschemes/App.xcscheme b/Fixtures/Xcode16ProjectReferenceOrder/Wrong.xcodeproj/xcshareddata/xcschemes/App.xcscheme new file mode 100644 index 000000000..aefdccd72 --- /dev/null +++ b/Fixtures/Xcode16ProjectReferenceOrder/Wrong.xcodeproj/xcshareddata/xcschemes/App.xcscheme @@ -0,0 +1,79 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Sources/XcodeProj/Objects/Project/PBXProjEncoder.swift b/Sources/XcodeProj/Objects/Project/PBXProjEncoder.swift index bfbb4adec..fa8710ffc 100644 --- a/Sources/XcodeProj/Objects/Project/PBXProjEncoder.swift +++ b/Sources/XcodeProj/Objects/Project/PBXProjEncoder.swift @@ -54,6 +54,7 @@ final class PBXProjEncoder { sort(buildPhases: proj.objects.resourcesBuildPhases, outputSettings: outputSettings) sort(buildPhases: proj.objects.sourcesBuildPhases, outputSettings: outputSettings) sort(navigatorGroups: proj.objects.groups, outputSettings: outputSettings) + sortProjectReferences(for: proj.projects, outputSettings: outputSettings) var output = [String]() var stateHolder = StateHolder() @@ -474,4 +475,23 @@ final class PBXProjEncoder { navigatorGroups.values.forEach { $0.children = $0.children.sorted(by: sort) } } } + + private func sortProjectReferences(for projects: [PBXProject], outputSettings: PBXOutputSettings) { + guard outputSettings.projReferenceFormat == .xcode else { + return + } + + for project in projects { + /// The project references are sorted alphabetically based on the name of the project it's being referenced. + project.projectReferences = project.projectReferences.sorted(by: { lhs, rhs in + let lProjectRef = lhs["ProjectRef"]! + let lFile: PBXFileElement = lProjectRef.getObject()! + let rProjectRef = rhs["ProjectRef"]! + let rFile: PBXFileElement = rProjectRef.getObject()! + let lName = lFile.name! + let rName = rFile.name! + return lName.compare(rName, options: .caseInsensitive) == .orderedAscending + }) + } + } } diff --git a/Tests/XcodeProjTests/Objects/Project/PBXProjEncoderTests.swift b/Tests/XcodeProjTests/Objects/Project/PBXProjEncoderTests.swift index 4fb2b6ec0..61bf70205 100644 --- a/Tests/XcodeProjTests/Objects/Project/PBXProjEncoderTests.swift +++ b/Tests/XcodeProjTests/Objects/Project/PBXProjEncoderTests.swift @@ -341,6 +341,20 @@ line = lines.validate(line: "/* End PBXFileSystemSynchronizedGroupBuildPhaseMembershipExceptionSet section */", after: line) } + // MARK: - Projects + + func test_ProjectReferenceOrder() throws { + try loadProjectWithWrongProjectReferencesOrder() + + let lines = lines(fromFile: encodeProject()) + + let beginGroup = lines.findLine("/* Begin PBXProject section */") + let beginReferences = lines.findLine("projectReferences = (", after: beginGroup) + let endReferences = lines.findLine(");", after: beginReferences) + let firstReferenceLine = lines.validate(line: "ProjectRef = 87A3E8A0727A99EE88ED4E64 /* Framework1.xcodeproj */;", betweenLine: beginReferences, andLine: endReferences) + lines.validate(line: "ProjectRef = 08931D1475E84509040F7FEA /* Framework2.xcodeproj */;", betweenLine: firstReferenceLine, andLine: endReferences) + } + // MARK: - Build phases func test_build_phase_sources_unsorted_when_iOSProject() throws { @@ -536,6 +550,10 @@ private func loadProjectWithRelativeXCLocalSwiftPackageReference() throws { proj = try PBXProj(data: iosProjectWithRelativeXCLocalSwiftPackageReferences()) } + + private func loadProjectWithWrongProjectReferencesOrder() throws { + proj = try PBXProj(data: projectWithWrongProjectReferencesOrder()) + } } // MARK: - Line validations diff --git a/Tests/XcodeProjTests/Tests/Fixtures.swift b/Tests/XcodeProjTests/Tests/Fixtures.swift index 7fbb031de..59d386bd3 100644 --- a/Tests/XcodeProjTests/Tests/Fixtures.swift +++ b/Tests/XcodeProjTests/Tests/Fixtures.swift @@ -40,3 +40,8 @@ func iosProjectWithXCLocalSwiftPackageReferences() throws -> Data { let iosProjectWithXCLocalSwiftPackageReference = fixturesPath() + "iOS/ProjectWithXCLocalSwiftPackageReferences.xcodeproj/project.pbxproj" return try Data(contentsOf: iosProjectWithXCLocalSwiftPackageReference.url) } + +func projectWithWrongProjectReferencesOrder() throws -> Data { + let iosProjectWithProjectReferences = fixturesPath() + "Xcode16ProjectReferenceOrder/Wrong.xcodeproj/project.pbxproj" + return try Data(contentsOf: iosProjectWithProjectReferences.url) +} From 4488984883071307a9136251e7ccf06a41b6258d Mon Sep 17 00:00:00 2001 From: pepicrft <663605+pepicrft@users.noreply.github.com> Date: Tue, 20 May 2025 14:27:05 +0000 Subject: [PATCH 475/678] [Release] XcodeProj 9.4.2 --- CHANGELOG.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 078ad2c3a..99f7af053 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [9.4.2] - 2025-05-20 +### Details +#### Bug Fixes +- Align the sorting of project references with Xcode 16 by @mikhailmulyar in [#937](https://github.com/tuist/XcodeProj/pull/937) + +## New Contributors +* @mikhailmulyar made their first contribution in [#937](https://github.com/tuist/XcodeProj/pull/937) ## [9.4.1] - 2025-05-19 ### Details #### Documentation @@ -186,6 +193,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Disable the renovatebot dashboard by @pepicrft in [#840](https://github.com/tuist/XcodeProj/pull/840) - Set up SwiftLint and SwiftFormat, run them against the project, and run them as part of the CI workflows by @pepicrft in [#836](https://github.com/tuist/XcodeProj/pull/836) +[9.4.2]: https://github.com/tuist/XcodeProj/compare/9.4.1..9.4.2 [9.4.1]: https://github.com/tuist/XcodeProj/compare/9.4.0..9.4.1 [9.4.0]: https://github.com/tuist/XcodeProj/compare/9.3.0..9.4.0 [9.3.0]: https://github.com/tuist/XcodeProj/compare/9.2.0..9.3.0 From fd79665a5b5f910032619def6d63f1f3ed0798c1 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 3 Jun 2025 17:45:41 +0000 Subject: [PATCH 476/678] chore(deps): update dependency tuist to v4.51.0 (#942) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise.toml b/.mise.toml index b18aa735e..eb2acd12d 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,5 +1,5 @@ [tools] swiftformat = "0.54.3" -tuist = "4.50.2" +tuist = "4.51.0" swiftlint = "0.55.1" "git-cliff" = "2.4.0" From af105ddd9c49bd379b635f0e40745d6090ab0cee Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 4 Jun 2025 14:53:57 +0000 Subject: [PATCH 477/678] chore(deps): update dependency tuist to v4.51.1 (#943) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise.toml b/.mise.toml index eb2acd12d..92e34e1da 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,5 +1,5 @@ [tools] swiftformat = "0.54.3" -tuist = "4.51.0" +tuist = "4.51.1" swiftlint = "0.55.1" "git-cliff" = "2.4.0" From 6b0df206d37d784d3952d1248225d12f94c288dd Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 4 Jun 2025 21:22:06 +0000 Subject: [PATCH 478/678] chore(deps): update dependency tuist to v4.51.2 (#944) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise.toml b/.mise.toml index 92e34e1da..7471ee13a 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,5 +1,5 @@ [tools] swiftformat = "0.54.3" -tuist = "4.51.1" +tuist = "4.51.2" swiftlint = "0.55.1" "git-cliff" = "2.4.0" From b719fb43f75c19e9e9111444cf84cee40c524912 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 6 Jun 2025 22:01:26 +0000 Subject: [PATCH 479/678] chore(deps): update dependency tuist to v4.52.0 (#945) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise.toml b/.mise.toml index 7471ee13a..b93b8ddbf 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,5 +1,5 @@ [tools] swiftformat = "0.54.3" -tuist = "4.51.2" +tuist = "4.52.0" swiftlint = "0.55.1" "git-cliff" = "2.4.0" From 7591354b53dad2f3842b1e31bca75f9122eb39f9 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 10 Jun 2025 22:23:02 +0000 Subject: [PATCH 480/678] chore(deps): update dependency tuist to v4.52.1 (#946) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise.toml b/.mise.toml index b93b8ddbf..64445f54b 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,5 +1,5 @@ [tools] swiftformat = "0.54.3" -tuist = "4.52.0" +tuist = "4.52.1" swiftlint = "0.55.1" "git-cliff" = "2.4.0" From 1af4ebf3e9a0ccb23f0b8fa1da0589d93f5d8714 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 11 Jun 2025 16:26:01 +0200 Subject: [PATCH 481/678] chore(deps): update stefanzweifel/git-auto-commit-action action to v6 (#947) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b62a1336d..972c86f54 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -71,7 +71,7 @@ jobs: run: git cliff 8.22.0.. --bump -o CHANGELOG.md - name: Commit changes id: auto-commit-action - uses: stefanzweifel/git-auto-commit-action@v5 + uses: stefanzweifel/git-auto-commit-action@v6 if: env.should-release == 'true' with: commit_options: "--allow-empty" From f884cdc81860c274ca4cd3a501bf9c45954cd6dc Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 11 Jun 2025 20:28:58 +0000 Subject: [PATCH 482/678] chore(deps): update dependency tuist to v4.52.2 (#948) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise.toml b/.mise.toml index 64445f54b..9b623ef87 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,5 +1,5 @@ [tools] swiftformat = "0.54.3" -tuist = "4.52.1" +tuist = "4.52.2" swiftlint = "0.55.1" "git-cliff" = "2.4.0" From 66c57bae915c23cf7fcd02f7026f0bc074a1331e Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 12 Jun 2025 22:03:32 +0000 Subject: [PATCH 483/678] chore(deps): update dependency tuist to v4.53.0 (#949) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise.toml b/.mise.toml index 9b623ef87..aa9e10bc1 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,5 +1,5 @@ [tools] swiftformat = "0.54.3" -tuist = "4.52.2" +tuist = "4.53.0" swiftlint = "0.55.1" "git-cliff" = "2.4.0" From c41693ac43b45ff475b6c0c198fc6cb19f64b474 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 13 Jun 2025 18:39:21 +0000 Subject: [PATCH 484/678] chore(deps): update dependency tuist to v4.53.3 (#950) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise.toml b/.mise.toml index aa9e10bc1..df2dc45db 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,5 +1,5 @@ [tools] swiftformat = "0.54.3" -tuist = "4.53.0" +tuist = "4.53.3" swiftlint = "0.55.1" "git-cliff" = "2.4.0" From e5a027ccd4ee9853dd1a35d024bd9460ac4b6d1d Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 16 Jun 2025 22:11:22 +0000 Subject: [PATCH 485/678] chore(deps): update dependency tuist to v4.53.4 (#951) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise.toml b/.mise.toml index df2dc45db..02fb75167 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,5 +1,5 @@ [tools] swiftformat = "0.54.3" -tuist = "4.53.3" +tuist = "4.53.4" swiftlint = "0.55.1" "git-cliff" = "2.4.0" From 870aa245c00d99c1afaf678a68e1ed1b1499f8f7 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 19 Jun 2025 18:26:10 +0000 Subject: [PATCH 486/678] chore(deps): update dependency tuist to v4.54.0 (#952) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise.toml b/.mise.toml index 02fb75167..0a1e89b63 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,5 +1,5 @@ [tools] swiftformat = "0.54.3" -tuist = "4.53.4" +tuist = "4.54.0" swiftlint = "0.55.1" "git-cliff" = "2.4.0" From 5b3cc97b2ff719b614177a705ef5fa2fe780497c Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 21 Jun 2025 00:11:34 +0000 Subject: [PATCH 487/678] chore(deps): update dependency tuist to v4.54.3 (#953) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise.toml b/.mise.toml index 0a1e89b63..1b8f2bea1 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,5 +1,5 @@ [tools] swiftformat = "0.54.3" -tuist = "4.54.0" +tuist = "4.54.3" swiftlint = "0.55.1" "git-cliff" = "2.4.0" From 23f6974614e2fba3d8f4521256f40c3b337c8613 Mon Sep 17 00:00:00 2001 From: fess Date: Wed, 25 Jun 2025 16:15:31 +0100 Subject: [PATCH 488/678] fix: SWIFT_OPTIMIZATION_LEVEL -O not -Owholemodule (#954) --- .../project.pbxproj | 2 +- .../Test.xcodeproj/project.pbxproj | 2 +- .../Wrong.xcodeproj/project.pbxproj | 2 +- .../BuildSettings.xcodeproj/project.pbxproj | 2 +- .../iOS/Project.xcodeproj/project.pbxproj | 2 +- .../project.pbxproj | 2 +- .../project.pbxproj | 2 +- .../project.pbxproj | 2 +- .../Utils/BuildSettingsProvider.swift | 2 +- .../Utils/BuildSettingsProviderTests.swift | 22 +++++++++---------- 10 files changed, 20 insertions(+), 20 deletions(-) diff --git a/Fixtures/WithoutWorkspace/WithoutWorkspace.xcodeproj/project.pbxproj b/Fixtures/WithoutWorkspace/WithoutWorkspace.xcodeproj/project.pbxproj index c49e88a39..d364afeda 100644 --- a/Fixtures/WithoutWorkspace/WithoutWorkspace.xcodeproj/project.pbxproj +++ b/Fixtures/WithoutWorkspace/WithoutWorkspace.xcodeproj/project.pbxproj @@ -359,7 +359,7 @@ "watchsimulator", ); SWIFT_ACTIVE_COMPILATION_CONDITIONS = "SWIFT_PACKAGE"; - SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + SWIFT_OPTIMIZATION_LEVEL = "-O"; USE_HEADERMAP = "NO"; }; name = "Release"; diff --git a/Fixtures/Xcode16ProjectReferenceOrder/Test.xcodeproj/project.pbxproj b/Fixtures/Xcode16ProjectReferenceOrder/Test.xcodeproj/project.pbxproj index b9b45f9a9..86898189c 100644 --- a/Fixtures/Xcode16ProjectReferenceOrder/Test.xcodeproj/project.pbxproj +++ b/Fixtures/Xcode16ProjectReferenceOrder/Test.xcodeproj/project.pbxproj @@ -417,7 +417,7 @@ SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = YES; SUPPORTS_XR_DESIGNED_FOR_IPHONE_IPAD = NO; SWIFT_COMPILATION_MODE = wholemodule; - SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + SWIFT_OPTIMIZATION_LEVEL = "-O"; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; }; diff --git a/Fixtures/Xcode16ProjectReferenceOrder/Wrong.xcodeproj/project.pbxproj b/Fixtures/Xcode16ProjectReferenceOrder/Wrong.xcodeproj/project.pbxproj index 41041dc4b..342173cf6 100644 --- a/Fixtures/Xcode16ProjectReferenceOrder/Wrong.xcodeproj/project.pbxproj +++ b/Fixtures/Xcode16ProjectReferenceOrder/Wrong.xcodeproj/project.pbxproj @@ -417,7 +417,7 @@ SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = YES; SUPPORTS_XR_DESIGNED_FOR_IPHONE_IPAD = NO; SWIFT_COMPILATION_MODE = wholemodule; - SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + SWIFT_OPTIMIZATION_LEVEL = "-O"; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; }; diff --git a/Fixtures/iOS/BuildSettings.xcodeproj/project.pbxproj b/Fixtures/iOS/BuildSettings.xcodeproj/project.pbxproj index 59c5ef482..41985dc88 100644 --- a/Fixtures/iOS/BuildSettings.xcodeproj/project.pbxproj +++ b/Fixtures/iOS/BuildSettings.xcodeproj/project.pbxproj @@ -94,7 +94,7 @@ IPHONEOS_DEPLOYMENT_TARGET = 11.2; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; - SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + SWIFT_OPTIMIZATION_LEVEL = "-O"; VALIDATE_PRODUCT = YES; a = a; a_escapedNewLine_a = "a\\na"; diff --git a/Fixtures/iOS/Project.xcodeproj/project.pbxproj b/Fixtures/iOS/Project.xcodeproj/project.pbxproj index 226781f1e..c4b6b20ee 100644 --- a/Fixtures/iOS/Project.xcodeproj/project.pbxproj +++ b/Fixtures/iOS/Project.xcodeproj/project.pbxproj @@ -439,7 +439,7 @@ IPHONEOS_DEPLOYMENT_TARGET = 10.3; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; - SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + SWIFT_OPTIMIZATION_LEVEL = "-O"; VALIDATE_PRODUCT = YES; }; name = Release; diff --git a/Fixtures/iOS/ProjectWithRelativeXCLocalSwiftPackageReference/ProjectWithRelativeXCLocalSwiftPackageReference.xcodeproj/project.pbxproj b/Fixtures/iOS/ProjectWithRelativeXCLocalSwiftPackageReference/ProjectWithRelativeXCLocalSwiftPackageReference.xcodeproj/project.pbxproj index 57ca00488..9db1d6fa2 100644 --- a/Fixtures/iOS/ProjectWithRelativeXCLocalSwiftPackageReference/ProjectWithRelativeXCLocalSwiftPackageReference.xcodeproj/project.pbxproj +++ b/Fixtures/iOS/ProjectWithRelativeXCLocalSwiftPackageReference/ProjectWithRelativeXCLocalSwiftPackageReference.xcodeproj/project.pbxproj @@ -351,7 +351,7 @@ IPHONEOS_DEPLOYMENT_TARGET = 10.3; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; - SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + SWIFT_OPTIMIZATION_LEVEL = "-O"; VALIDATE_PRODUCT = YES; }; name = Release; diff --git a/Fixtures/iOS/ProjectWithXCLocalSwiftPackageReference.xcodeproj/project.pbxproj b/Fixtures/iOS/ProjectWithXCLocalSwiftPackageReference.xcodeproj/project.pbxproj index a101d05e0..4929f97c1 100644 --- a/Fixtures/iOS/ProjectWithXCLocalSwiftPackageReference.xcodeproj/project.pbxproj +++ b/Fixtures/iOS/ProjectWithXCLocalSwiftPackageReference.xcodeproj/project.pbxproj @@ -442,7 +442,7 @@ IPHONEOS_DEPLOYMENT_TARGET = 10.3; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; - SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + SWIFT_OPTIMIZATION_LEVEL = "-O"; VALIDATE_PRODUCT = YES; }; name = Release; diff --git a/Fixtures/iOS/ProjectWithXCLocalSwiftPackageReferences.xcodeproj/project.pbxproj b/Fixtures/iOS/ProjectWithXCLocalSwiftPackageReferences.xcodeproj/project.pbxproj index d0be14065..4ce8b12e6 100644 --- a/Fixtures/iOS/ProjectWithXCLocalSwiftPackageReferences.xcodeproj/project.pbxproj +++ b/Fixtures/iOS/ProjectWithXCLocalSwiftPackageReferences.xcodeproj/project.pbxproj @@ -442,7 +442,7 @@ IPHONEOS_DEPLOYMENT_TARGET = 10.3; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; - SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + SWIFT_OPTIMIZATION_LEVEL = "-O"; VALIDATE_PRODUCT = YES; }; name = Release; diff --git a/Sources/XcodeProj/Utils/BuildSettingsProvider.swift b/Sources/XcodeProj/Utils/BuildSettingsProvider.swift index f6cd0e01d..615b77111 100644 --- a/Sources/XcodeProj/Utils/BuildSettingsProvider.swift +++ b/Sources/XcodeProj/Utils/BuildSettingsProvider.swift @@ -358,7 +358,7 @@ public class BuildSettingsProvider { ] case .release: [ - "SWIFT_OPTIMIZATION_LEVEL": "-Owholemodule", + "SWIFT_OPTIMIZATION_LEVEL": "-O", "SWIFT_COMPILATION_MODE": "wholemodule", ] default: diff --git a/Tests/XcodeProjTests/Utils/BuildSettingsProviderTests.swift b/Tests/XcodeProjTests/Utils/BuildSettingsProviderTests.swift index 5c3acfcf3..9c0bcb857 100644 --- a/Tests/XcodeProjTests/Utils/BuildSettingsProviderTests.swift +++ b/Tests/XcodeProjTests/Utils/BuildSettingsProviderTests.swift @@ -21,7 +21,7 @@ struct BuildSettingProviderTests { ], "SDKROOT": "iphoneos", "SWIFT_COMPILATION_MODE": "wholemodule", - "SWIFT_OPTIMIZATION_LEVEL": "-Owholemodule", + "SWIFT_OPTIMIZATION_LEVEL": "-O", "TARGETED_DEVICE_FAMILY": "1,2", ] ), @@ -45,7 +45,7 @@ struct BuildSettingProviderTests { "SDKROOT": "iphoneos", "SKIP_INSTALL": "YES", "SWIFT_COMPILATION_MODE": "wholemodule", - "SWIFT_OPTIMIZATION_LEVEL": "-Owholemodule", + "SWIFT_OPTIMIZATION_LEVEL": "-O", "TARGETED_DEVICE_FAMILY": "1,2", "VERSIONING_SYSTEM": "apple-generic", "VERSION_INFO_PREFIX": "", @@ -63,7 +63,7 @@ struct BuildSettingProviderTests { ], "SDKROOT": "iphoneos", "SWIFT_COMPILATION_MODE": "wholemodule", - "SWIFT_OPTIMIZATION_LEVEL": "-Owholemodule", + "SWIFT_OPTIMIZATION_LEVEL": "-O", "TARGETED_DEVICE_FAMILY": "1,2", ] ), @@ -82,7 +82,7 @@ struct BuildSettingProviderTests { ], "SDKROOT": "macosx", "SWIFT_COMPILATION_MODE": "wholemodule", - "SWIFT_OPTIMIZATION_LEVEL": "-Owholemodule", + "SWIFT_OPTIMIZATION_LEVEL": "-O", ] ), TestParameters( @@ -99,7 +99,7 @@ struct BuildSettingProviderTests { ], "SDKROOT": "appletvos", "SWIFT_COMPILATION_MODE": "wholemodule", - "SWIFT_OPTIMIZATION_LEVEL": "-Owholemodule", + "SWIFT_OPTIMIZATION_LEVEL": "-O", "TARGETED_DEVICE_FAMILY": "3", ] ), @@ -117,7 +117,7 @@ struct BuildSettingProviderTests { "SDKROOT": "watchos", "SKIP_INSTALL": "YES", "SWIFT_COMPILATION_MODE": "wholemodule", - "SWIFT_OPTIMIZATION_LEVEL": "-Owholemodule", + "SWIFT_OPTIMIZATION_LEVEL": "-O", "TARGETED_DEVICE_FAMILY": "4", ] ), @@ -142,7 +142,7 @@ struct BuildSettingProviderTests { "SDKROOT": "watchos", "SKIP_INSTALL": "YES", "SWIFT_COMPILATION_MODE": "wholemodule", - "SWIFT_OPTIMIZATION_LEVEL": "-Owholemodule", + "SWIFT_OPTIMIZATION_LEVEL": "-O", "TARGETED_DEVICE_FAMILY": "4", "VERSIONING_SYSTEM": "apple-generic", "VERSION_INFO_PREFIX": "", @@ -160,7 +160,7 @@ struct BuildSettingProviderTests { ], "SDKROOT": "watchos", "SWIFT_COMPILATION_MODE": "wholemodule", - "SWIFT_OPTIMIZATION_LEVEL": "-Owholemodule", + "SWIFT_OPTIMIZATION_LEVEL": "-O", "TARGETED_DEVICE_FAMILY": "4", ] ), @@ -178,7 +178,7 @@ struct BuildSettingProviderTests { ], "SDKROOT": "xros", "SWIFT_COMPILATION_MODE": "wholemodule", - "SWIFT_OPTIMIZATION_LEVEL": "-Owholemodule", + "SWIFT_OPTIMIZATION_LEVEL": "-O", "TARGETED_DEVICE_FAMILY": "1,2,7", ] ), @@ -202,7 +202,7 @@ struct BuildSettingProviderTests { "SDKROOT": "xros", "SKIP_INSTALL": "YES", "SWIFT_COMPILATION_MODE": "wholemodule", - "SWIFT_OPTIMIZATION_LEVEL": "-Owholemodule", + "SWIFT_OPTIMIZATION_LEVEL": "-O", "TARGETED_DEVICE_FAMILY": "1,2,7", "VERSIONING_SYSTEM": "apple-generic", "VERSION_INFO_PREFIX": "", @@ -220,7 +220,7 @@ struct BuildSettingProviderTests { ], "SDKROOT": "xros", "SWIFT_COMPILATION_MODE": "wholemodule", - "SWIFT_OPTIMIZATION_LEVEL": "-Owholemodule", + "SWIFT_OPTIMIZATION_LEVEL": "-O", "TARGETED_DEVICE_FAMILY": "1,2,7", ] ), From 9799bb429fda8e360f4c535af1716bebc89fb235 Mon Sep 17 00:00:00 2001 From: pepicrft <663605+pepicrft@users.noreply.github.com> Date: Wed, 25 Jun 2025 15:16:25 +0000 Subject: [PATCH 489/678] [Release] XcodeProj 9.4.3 --- CHANGELOG.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 99f7af053..5f55b3087 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [9.4.3] - 2025-06-25 +### Details +#### Bug Fixes +- SWIFT_OPTIMIZATION_LEVEL -O not -Owholemodule by @stefanfessler in [#954](https://github.com/tuist/XcodeProj/pull/954) + +## New Contributors +* @stefanfessler made their first contribution in [#954](https://github.com/tuist/XcodeProj/pull/954) ## [9.4.2] - 2025-05-20 ### Details #### Bug Fixes @@ -193,6 +200,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Disable the renovatebot dashboard by @pepicrft in [#840](https://github.com/tuist/XcodeProj/pull/840) - Set up SwiftLint and SwiftFormat, run them against the project, and run them as part of the CI workflows by @pepicrft in [#836](https://github.com/tuist/XcodeProj/pull/836) +[9.4.3]: https://github.com/tuist/XcodeProj/compare/9.4.2..9.4.3 [9.4.2]: https://github.com/tuist/XcodeProj/compare/9.4.1..9.4.2 [9.4.1]: https://github.com/tuist/XcodeProj/compare/9.4.0..9.4.1 [9.4.0]: https://github.com/tuist/XcodeProj/compare/9.3.0..9.4.0 From 12d35a6441d0209ab05eb092da05bcc7b5586a05 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sun, 29 Jun 2025 17:26:05 +0000 Subject: [PATCH 490/678] chore(deps): update dependency tuist to v4.55.0 (#955) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise.toml b/.mise.toml index 1b8f2bea1..6b0bf28a7 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,5 +1,5 @@ [tools] swiftformat = "0.54.3" -tuist = "4.54.3" +tuist = "4.55.0" swiftlint = "0.55.1" "git-cliff" = "2.4.0" From 4280d2e0b3ebfa3075f5045d4c2f5d87e65d9e2b Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 30 Jun 2025 20:53:03 +0000 Subject: [PATCH 491/678] chore(deps): update dependency tuist to v4.55.2 (#956) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise.toml b/.mise.toml index 6b0bf28a7..fece92142 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,5 +1,5 @@ [tools] swiftformat = "0.54.3" -tuist = "4.55.0" +tuist = "4.55.2" swiftlint = "0.55.1" "git-cliff" = "2.4.0" From 55ed9678dbbf287abced39d8652375d0f8ff9006 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 2 Jul 2025 23:12:39 +0000 Subject: [PATCH 492/678] chore(deps): update dependency tuist to v4.55.5 (#957) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise.toml b/.mise.toml index fece92142..8c02b8291 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,5 +1,5 @@ [tools] swiftformat = "0.54.3" -tuist = "4.55.2" +tuist = "4.55.5" swiftlint = "0.55.1" "git-cliff" = "2.4.0" From bcd020f6f9bd8d836a8d5555e9f7c5c53c2e1faa Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 4 Jul 2025 02:37:50 +0000 Subject: [PATCH 493/678] chore(deps): update dependency tuist to v4.55.6 (#958) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise.toml b/.mise.toml index 8c02b8291..f64730d3e 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,5 +1,5 @@ [tools] swiftformat = "0.54.3" -tuist = "4.55.5" +tuist = "4.55.6" swiftlint = "0.55.1" "git-cliff" = "2.4.0" From 6f6c9798a1bcf7f8ab0fa6cf956f9fb98823221b Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 25 Jul 2025 22:51:37 +0000 Subject: [PATCH 494/678] chore(deps): update dependency tuist to v4.55.9 (#960) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise.toml b/.mise.toml index f64730d3e..1cd9e37c8 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,5 +1,5 @@ [tools] swiftformat = "0.54.3" -tuist = "4.55.6" +tuist = "4.55.9" swiftlint = "0.55.1" "git-cliff" = "2.4.0" From da98243ad87eddbb2324d9cc28a60fd57875bb55 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 26 Jul 2025 16:44:00 +0000 Subject: [PATCH 495/678] chore(deps): update dependency tuist to v4.56.0 (#961) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise.toml b/.mise.toml index 1cd9e37c8..f98cda5c8 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,5 +1,5 @@ [tools] swiftformat = "0.54.3" -tuist = "4.55.9" +tuist = "4.56.0" swiftlint = "0.55.1" "git-cliff" = "2.4.0" From eea1743e4949459026a86838ece3d19a5e956392 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 29 Jul 2025 17:35:22 +0000 Subject: [PATCH 496/678] chore(deps): update dependency tuist to v4.56.1 (#962) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise.toml b/.mise.toml index f98cda5c8..86d70d603 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,5 +1,5 @@ [tools] swiftformat = "0.54.3" -tuist = "4.56.0" +tuist = "4.56.1" swiftlint = "0.55.1" "git-cliff" = "2.4.0" From 6748ce672dbd360183322afad1ae104140953a09 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 1 Aug 2025 17:48:03 +0000 Subject: [PATCH 497/678] chore(deps): update dependency tuist to v4.57.0 (#963) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise.toml b/.mise.toml index 86d70d603..bd4d17663 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,5 +1,5 @@ [tools] swiftformat = "0.54.3" -tuist = "4.56.1" +tuist = "4.57.0" swiftlint = "0.55.1" "git-cliff" = "2.4.0" From 5875dc73abba16d4e7d94b403f38a3a4f288a5a0 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sun, 3 Aug 2025 21:43:11 +0000 Subject: [PATCH 498/678] chore(deps): update dependency tuist to v4.57.1 (#964) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise.toml b/.mise.toml index bd4d17663..57ed4e4d4 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,5 +1,5 @@ [tools] swiftformat = "0.54.3" -tuist = "4.57.0" +tuist = "4.57.1" swiftlint = "0.55.1" "git-cliff" = "2.4.0" From 006df85e06ab1879fcbca3643556799498e4246d Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 5 Aug 2025 21:33:07 +0000 Subject: [PATCH 499/678] chore(deps): update dependency tuist to v4.58.0 (#965) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise.toml b/.mise.toml index 57ed4e4d4..57e709a80 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,5 +1,5 @@ [tools] swiftformat = "0.54.3" -tuist = "4.57.1" +tuist = "4.58.0" swiftlint = "0.55.1" "git-cliff" = "2.4.0" From 537cc012a4dccd5403464595bab197817cd03226 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 6 Aug 2025 21:33:29 +0000 Subject: [PATCH 500/678] chore(deps): update dependency tuist to v4.58.1 (#966) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise.toml b/.mise.toml index 57e709a80..87ba237c1 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,5 +1,5 @@ [tools] swiftformat = "0.54.3" -tuist = "4.58.0" +tuist = "4.58.1" swiftlint = "0.55.1" "git-cliff" = "2.4.0" From a6daf9a798b8099b17bdec0f8197583018ca0327 Mon Sep 17 00:00:00 2001 From: ToMark1881 Date: Fri, 8 Aug 2025 15:04:38 +0300 Subject: [PATCH 501/678] feat: possibility to get child group using path (#959) * added feature to get child group using path * unit tests for group(with path), iosProjectWithExtensionsData fixture * lint cleanup, path tests in separate file with #if * lint code style updates * code spacing lint update --- .../XcodeProj/Objects/Files/PBXGroup.swift | 10 +++++++ .../Objects/Files/PBXGroupTests+Path.swift | 30 +++++++++++++++++++ Tests/XcodeProjTests/Tests/Fixtures.swift | 5 ++++ 3 files changed, 45 insertions(+) create mode 100644 Tests/XcodeProjTests/Objects/Files/PBXGroupTests+Path.swift diff --git a/Sources/XcodeProj/Objects/Files/PBXGroup.swift b/Sources/XcodeProj/Objects/Files/PBXGroup.swift index 24b618064..c720a1a9d 100644 --- a/Sources/XcodeProj/Objects/Files/PBXGroup.swift +++ b/Sources/XcodeProj/Objects/Files/PBXGroup.swift @@ -116,6 +116,16 @@ public extension PBXGroup { .first(where: { $0.name == name }) } + /// Returns group with the given path contained in the given parent group. + /// + /// - Parameter path: path name. + /// - Returns: group with the given path contained in the given parent group. + func group(with path: String) -> PBXGroup? { + childrenReferences + .objects() + .first(where: { ($0 as? PBXFileElement)?.path == path }) as? PBXGroup + } + /// Returns the synchronized root group with the given name contained in the given parent group. /// /// - Parameter groupName: group name. diff --git a/Tests/XcodeProjTests/Objects/Files/PBXGroupTests+Path.swift b/Tests/XcodeProjTests/Objects/Files/PBXGroupTests+Path.swift new file mode 100644 index 000000000..eb30de385 --- /dev/null +++ b/Tests/XcodeProjTests/Objects/Files/PBXGroupTests+Path.swift @@ -0,0 +1,30 @@ +#if os(macOS) || (os(Linux) && compiler(>=6.1)) + + import Foundation + import PathKit + import XcodeProj + import XCTest + + extension PBXGroupTests { + func test_takingGroupWithSpecificPath() throws { + let proj = try PBXProj(data: iosProjectWithExtensionsData()) + let mainGroup = proj.rootObject?.mainGroup + XCTAssertNotNil(mainGroup) + + let mainAppGroup = mainGroup?.group(with: "AppWithExtensions") + XCTAssertNotNil(mainAppGroup) + + let nilGroup = mainGroup?.group(with: "Not_Existing") + XCTAssertNil(nilGroup) + } + + func test_takingCreatedGroupWithSpecificPath() throws { + let proj = try PBXProj(data: iosProjectData()) + let mainGroup = proj.rootObject?.mainGroup + XCTAssertNil(mainGroup?.group(with: "group")) + + try mainGroup?.addGroup(named: "group") + XCTAssertNotNil(mainGroup?.group(with: "group")) + } + } +#endif diff --git a/Tests/XcodeProjTests/Tests/Fixtures.swift b/Tests/XcodeProjTests/Tests/Fixtures.swift index 59d386bd3..ed9dfe919 100644 --- a/Tests/XcodeProjTests/Tests/Fixtures.swift +++ b/Tests/XcodeProjTests/Tests/Fixtures.swift @@ -16,6 +16,11 @@ func iosProjectData() throws -> Data { return try Data(contentsOf: iosProject.url) } +func iosProjectWithExtensionsData() throws -> Data { + let iosProjectWithExtensions = fixturesPath() + "iOS/AppWithExtensions/AppWithExtensions.xcodeproj/project.pbxproj" + return try Data(contentsOf: iosProjectWithExtensions.url) +} + func fileSharedAcrossTargetsData() throws -> Data { let fileSharedAcrossTargetsProject = fixturesPath() + "FileSharedAcrossTargets/FileSharedAcrossTargets.xcodeproj/project.pbxproj" return try Data(contentsOf: fileSharedAcrossTargetsProject.url) From e1f2a4365669e02272b2f381b13a2378b15fb485 Mon Sep 17 00:00:00 2001 From: fortmarek <9371695+fortmarek@users.noreply.github.com> Date: Fri, 8 Aug 2025 12:05:08 +0000 Subject: [PATCH 502/678] [Release] XcodeProj 9.5.0 --- CHANGELOG.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5f55b3087..073723049 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [9.5.0] - 2025-08-08 +### Details +#### Features +- Possibility to get child group using path by @ToMark1881 in [#959](https://github.com/tuist/XcodeProj/pull/959) + +## New Contributors +* @ToMark1881 made their first contribution in [#959](https://github.com/tuist/XcodeProj/pull/959) ## [9.4.3] - 2025-06-25 ### Details #### Bug Fixes @@ -200,6 +207,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Disable the renovatebot dashboard by @pepicrft in [#840](https://github.com/tuist/XcodeProj/pull/840) - Set up SwiftLint and SwiftFormat, run them against the project, and run them as part of the CI workflows by @pepicrft in [#836](https://github.com/tuist/XcodeProj/pull/836) +[9.5.0]: https://github.com/tuist/XcodeProj/compare/9.4.3..9.5.0 [9.4.3]: https://github.com/tuist/XcodeProj/compare/9.4.2..9.4.3 [9.4.2]: https://github.com/tuist/XcodeProj/compare/9.4.1..9.4.2 [9.4.1]: https://github.com/tuist/XcodeProj/compare/9.4.0..9.4.1 From b191f16ae07924fda54b81d96e6999165e1155fe Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 8 Aug 2025 17:28:34 +0000 Subject: [PATCH 503/678] chore(deps): update dependency tuist to v4.59.1 (#967) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise.toml b/.mise.toml index 87ba237c1..ef8575e28 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,5 +1,5 @@ [tools] swiftformat = "0.54.3" -tuist = "4.58.1" +tuist = "4.59.1" swiftlint = "0.55.1" "git-cliff" = "2.4.0" From a9512e060c168c9bbb9771b97d4da2852873efd0 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 9 Aug 2025 21:31:10 +0000 Subject: [PATCH 504/678] chore(deps): update dependency tuist to v4.59.2 (#968) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise.toml b/.mise.toml index ef8575e28..fb4c9f673 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,5 +1,5 @@ [tools] swiftformat = "0.54.3" -tuist = "4.59.1" +tuist = "4.59.2" swiftlint = "0.55.1" "git-cliff" = "2.4.0" From 46f93eb898a9be7d48fce5d720653369cc66d43f Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 11 Aug 2025 17:55:14 +0000 Subject: [PATCH 505/678] chore(deps): update actions/checkout digest to 08eba0b (#969) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 972c86f54..e7d2a7fbb 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -23,7 +23,7 @@ jobs: timeout-minutes: 15 if: "!startsWith(github.event.head_commit.message, '[Release]')" steps: - - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 + - uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4 with: fetch-depth: 0 - uses: jdx/mise-action@v2 From 8d438df9ad33b80ccf5b558fbc2b6618b9059c12 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 15 Aug 2025 01:48:11 +0000 Subject: [PATCH 506/678] chore(deps): update dependency tuist to v4.61.0 (#971) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise.toml b/.mise.toml index fb4c9f673..80e70b1ac 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,5 +1,5 @@ [tools] swiftformat = "0.54.3" -tuist = "4.59.2" +tuist = "4.61.0" swiftlint = "0.55.1" "git-cliff" = "2.4.0" From 09f355a5fc07fb519b72f0385fb629ec78543d32 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 15 Aug 2025 21:47:57 +0000 Subject: [PATCH 507/678] chore(deps): update dependency tuist to v4.61.2 (#972) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise.toml b/.mise.toml index 80e70b1ac..44fde9646 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,5 +1,5 @@ [tools] swiftformat = "0.54.3" -tuist = "4.61.0" +tuist = "4.61.2" swiftlint = "0.55.1" "git-cliff" = "2.4.0" From c9a051d180eee86c6ae950975c000b011ad87cea Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 19 Aug 2025 01:45:47 +0000 Subject: [PATCH 508/678] chore(deps): update dependency tuist to v4.63.2 (#973) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise.toml b/.mise.toml index 44fde9646..2e6a17361 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,5 +1,5 @@ [tools] swiftformat = "0.54.3" -tuist = "4.61.2" +tuist = "4.63.2" swiftlint = "0.55.1" "git-cliff" = "2.4.0" From 37b79a7ec23c79a7f3d15099c60b7a0576c7c912 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 20 Aug 2025 10:06:12 +0000 Subject: [PATCH 509/678] chore(deps): update dependency tuist to v4.64.0 (#975) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise.toml b/.mise.toml index 2e6a17361..a1ab5acf7 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,5 +1,5 @@ [tools] swiftformat = "0.54.3" -tuist = "4.63.2" +tuist = "4.64.0" swiftlint = "0.55.1" "git-cliff" = "2.4.0" From 576dba63d5bb5b5f41efb722c67946bad2c3305e Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 21 Aug 2025 22:41:39 +0000 Subject: [PATCH 510/678] chore(deps): update dependency tuist to v4.64.1 (#976) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise.toml b/.mise.toml index a1ab5acf7..667686300 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,5 +1,5 @@ [tools] swiftformat = "0.54.3" -tuist = "4.64.0" +tuist = "4.64.1" swiftlint = "0.55.1" "git-cliff" = "2.4.0" From 6d58e9633fe6fd78ea53a2f66c3eabdfc4bac342 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 22 Aug 2025 19:02:36 +0000 Subject: [PATCH 511/678] chore(deps): update dependency tuist to v4.65.0 (#977) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise.toml b/.mise.toml index 667686300..0284e9100 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,5 +1,5 @@ [tools] swiftformat = "0.54.3" -tuist = "4.64.1" +tuist = "4.65.0" swiftlint = "0.55.1" "git-cliff" = "2.4.0" From a20006ae16944ae99341f9fca8b339a741032ebc Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 2 Oct 2025 20:31:49 +0000 Subject: [PATCH 512/678] chore(deps): update dependency tuist to v4.81.1 (#978) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise.toml b/.mise.toml index 0284e9100..325585368 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,5 +1,5 @@ [tools] swiftformat = "0.54.3" -tuist = "4.65.0" +tuist = "4.81.1" swiftlint = "0.55.1" "git-cliff" = "2.4.0" From b274dc1961bcc6e6eeb15393b85de5d9e73572b8 Mon Sep 17 00:00:00 2001 From: Karl Puusepp <3533063+karlpuusepp@users.noreply.github.com> Date: Mon, 6 Oct 2025 13:08:07 +0300 Subject: [PATCH 513/678] feat: speed up object parsing (#980) `PBXObject.isa` can be quite expensive in a hot loop, as it internally calls `Mirror` to describe the type. Parsing large projects can be considerably faster by inlining the type name as a raw string. --- .../Project/PBXObjectDictionaryEntry.swift | 58 +++++++++---------- 1 file changed, 29 insertions(+), 29 deletions(-) diff --git a/Sources/XcodeProj/Objects/Project/PBXObjectDictionaryEntry.swift b/Sources/XcodeProj/Objects/Project/PBXObjectDictionaryEntry.swift index d2a541bf7..8df892ce0 100644 --- a/Sources/XcodeProj/Objects/Project/PBXObjectDictionaryEntry.swift +++ b/Sources/XcodeProj/Objects/Project/PBXObjectDictionaryEntry.swift @@ -12,35 +12,35 @@ struct PBXObjectDictionaryEntry: Decodable { let isa = try container.decode(String.self, forKey: .isa) object = switch isa { - case PBXFileElement.isa: try PBXFileElement(from: decoder) - case PBXBuildFile.isa: try PBXBuildFile(from: decoder) - case PBXFileReference.isa: try PBXFileReference(from: decoder) - case PBXLegacyTarget.isa: try PBXLegacyTarget(from: decoder) - case PBXNativeTarget.isa: try PBXNativeTarget(from: decoder) - case PBXAggregateTarget.isa: try PBXAggregateTarget(from: decoder) - case PBXProject.isa: try PBXProject(from: decoder) - case PBXGroup.isa: try PBXGroup(from: decoder) - case PBXHeadersBuildPhase.isa: try PBXHeadersBuildPhase(from: decoder) - case PBXFrameworksBuildPhase.isa: try PBXFrameworksBuildPhase(from: decoder) - case XCConfigurationList.isa: try XCConfigurationList(from: decoder) - case PBXResourcesBuildPhase.isa: try PBXResourcesBuildPhase(from: decoder) - case PBXShellScriptBuildPhase.isa: try PBXShellScriptBuildPhase(from: decoder) - case PBXSourcesBuildPhase.isa: try PBXSourcesBuildPhase(from: decoder) - case PBXTargetDependency.isa: try PBXTargetDependency(from: decoder) - case PBXVariantGroup.isa: try PBXVariantGroup(from: decoder) - case XCBuildConfiguration.isa: try XCBuildConfiguration(from: decoder) - case PBXCopyFilesBuildPhase.isa: try PBXCopyFilesBuildPhase(from: decoder) - case PBXContainerItemProxy.isa: try PBXContainerItemProxy(from: decoder) - case PBXReferenceProxy.isa: try PBXReferenceProxy(from: decoder) - case XCVersionGroup.isa: try XCVersionGroup(from: decoder) - case PBXRezBuildPhase.isa: try PBXRezBuildPhase(from: decoder) - case PBXBuildRule.isa: try PBXBuildRule(from: decoder) - case XCRemoteSwiftPackageReference.isa: try XCRemoteSwiftPackageReference(from: decoder) - case XCLocalSwiftPackageReference.isa: try XCLocalSwiftPackageReference(from: decoder) - case XCSwiftPackageProductDependency.isa: try XCSwiftPackageProductDependency(from: decoder) - case PBXFileSystemSynchronizedRootGroup.isa: try PBXFileSystemSynchronizedRootGroup(from: decoder) - case PBXFileSystemSynchronizedBuildFileExceptionSet.isa: try PBXFileSystemSynchronizedBuildFileExceptionSet(from: decoder) - case PBXFileSystemSynchronizedGroupBuildPhaseMembershipExceptionSet.isa: try PBXFileSystemSynchronizedGroupBuildPhaseMembershipExceptionSet(from: decoder) + case "PBXFileElement": try PBXFileElement(from: decoder) + case "PBXBuildFile": try PBXBuildFile(from: decoder) + case "PBXFileReference": try PBXFileReference(from: decoder) + case "PBXLegacyTarget": try PBXLegacyTarget(from: decoder) + case "PBXNativeTarget": try PBXNativeTarget(from: decoder) + case "PBXAggregateTarget": try PBXAggregateTarget(from: decoder) + case "PBXProject": try PBXProject(from: decoder) + case "PBXGroup": try PBXGroup(from: decoder) + case "PBXHeadersBuildPhase": try PBXHeadersBuildPhase(from: decoder) + case "PBXFrameworksBuildPhase": try PBXFrameworksBuildPhase(from: decoder) + case "XCConfigurationList": try XCConfigurationList(from: decoder) + case "PBXResourcesBuildPhase": try PBXResourcesBuildPhase(from: decoder) + case "PBXShellScriptBuildPhase": try PBXShellScriptBuildPhase(from: decoder) + case "PBXSourcesBuildPhase": try PBXSourcesBuildPhase(from: decoder) + case "PBXTargetDependency": try PBXTargetDependency(from: decoder) + case "PBXVariantGroup": try PBXVariantGroup(from: decoder) + case "XCBuildConfiguration": try XCBuildConfiguration(from: decoder) + case "PBXCopyFilesBuildPhase": try PBXCopyFilesBuildPhase(from: decoder) + case "PBXContainerItemProxy": try PBXContainerItemProxy(from: decoder) + case "PBXReferenceProxy": try PBXReferenceProxy(from: decoder) + case "XCVersionGroup": try XCVersionGroup(from: decoder) + case "PBXRezBuildPhase": try PBXRezBuildPhase(from: decoder) + case "PBXBuildRule": try PBXBuildRule(from: decoder) + case "XCRemoteSwiftPackageReference": try XCRemoteSwiftPackageReference(from: decoder) + case "XCLocalSwiftPackageReference": try XCLocalSwiftPackageReference(from: decoder) + case "XCSwiftPackageProductDependency": try XCSwiftPackageProductDependency(from: decoder) + case "PBXFileSystemSynchronizedRootGroup": try PBXFileSystemSynchronizedRootGroup(from: decoder) + case "PBXFileSystemSynchronizedBuildFileExceptionSet": try PBXFileSystemSynchronizedBuildFileExceptionSet(from: decoder) + case "PBXFileSystemSynchronizedGroupBuildPhaseMembershipExceptionSet": try PBXFileSystemSynchronizedGroupBuildPhaseMembershipExceptionSet(from: decoder) default: throw PBXObjectError.unknownElement(isa) } From a0cbb0174e71dba41c1bb572e8cd1fb6138daa03 Mon Sep 17 00:00:00 2001 From: fortmarek <9371695+fortmarek@users.noreply.github.com> Date: Mon, 6 Oct 2025 10:08:35 +0000 Subject: [PATCH 514/678] [Release] XcodeProj 9.6.0 --- CHANGELOG.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 073723049..cf6d37f82 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [9.6.0] - 2025-10-06 +### Details +#### Features +- Speed up object parsing by @karlpuusepp in [#980](https://github.com/tuist/XcodeProj/pull/980) + +## New Contributors +* @karlpuusepp made their first contribution in [#980](https://github.com/tuist/XcodeProj/pull/980) ## [9.5.0] - 2025-08-08 ### Details #### Features @@ -207,6 +214,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Disable the renovatebot dashboard by @pepicrft in [#840](https://github.com/tuist/XcodeProj/pull/840) - Set up SwiftLint and SwiftFormat, run them against the project, and run them as part of the CI workflows by @pepicrft in [#836](https://github.com/tuist/XcodeProj/pull/836) +[9.6.0]: https://github.com/tuist/XcodeProj/compare/9.5.0..9.6.0 [9.5.0]: https://github.com/tuist/XcodeProj/compare/9.4.3..9.5.0 [9.4.3]: https://github.com/tuist/XcodeProj/compare/9.4.2..9.4.3 [9.4.2]: https://github.com/tuist/XcodeProj/compare/9.4.1..9.4.2 From d3a984549312d279050bd19392da8512cc3ce94c Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 6 Oct 2025 16:29:22 +0000 Subject: [PATCH 515/678] chore(deps): update dependency tuist to v4.82.1 (#981) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise.toml b/.mise.toml index 325585368..724ddb1b4 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,5 +1,5 @@ [tools] swiftformat = "0.54.3" -tuist = "4.81.1" +tuist = "4.82.1" swiftlint = "0.55.1" "git-cliff" = "2.4.0" From ba081068892cbe2cbc4b65fb9cb4b558c848bd0b Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 7 Oct 2025 01:46:01 +0000 Subject: [PATCH 516/678] chore(deps): update dependency tuist to v4.82.3 (#982) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise.toml b/.mise.toml index 724ddb1b4..12832120b 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,5 +1,5 @@ [tools] swiftformat = "0.54.3" -tuist = "4.82.1" +tuist = "4.82.3" swiftlint = "0.55.1" "git-cliff" = "2.4.0" From 7afe68104fb816db1bd6e63fff30cc45a06d22ef Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 8 Oct 2025 04:11:01 +0000 Subject: [PATCH 517/678] chore(deps): update dependency tuist to v4.83.0 (#983) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise.toml b/.mise.toml index 12832120b..2f8e8453a 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,5 +1,5 @@ [tools] swiftformat = "0.54.3" -tuist = "4.82.3" +tuist = "4.83.0" swiftlint = "0.55.1" "git-cliff" = "2.4.0" From db5e3caac7407ffd712d58f554e72162fde6908f Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 14 Oct 2025 01:02:40 +0000 Subject: [PATCH 518/678] chore(deps): update dependency tuist to v4.84.2 (#986) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise.toml b/.mise.toml index 2f8e8453a..b90e9cfeb 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,5 +1,5 @@ [tools] swiftformat = "0.54.3" -tuist = "4.83.0" +tuist = "4.84.2" swiftlint = "0.55.1" "git-cliff" = "2.4.0" From f7c7772443f5782866f3a6a8a12a2463c4c1e1e0 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 15 Oct 2025 02:00:46 +0000 Subject: [PATCH 519/678] chore(deps): update dependency tuist to v4.85.1 (#988) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise.toml b/.mise.toml index b90e9cfeb..6e2206004 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,5 +1,5 @@ [tools] swiftformat = "0.54.3" -tuist = "4.84.2" +tuist = "4.85.1" swiftlint = "0.55.1" "git-cliff" = "2.4.0" From a6328b66b3ecffe6751e1522b4a2233e11d5d609 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 15 Oct 2025 21:28:24 +0000 Subject: [PATCH 520/678] chore(deps): update dependency tuist to v4.86.3 (#989) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise.toml b/.mise.toml index 6e2206004..26d839171 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,5 +1,5 @@ [tools] swiftformat = "0.54.3" -tuist = "4.85.1" +tuist = "4.86.3" swiftlint = "0.55.1" "git-cliff" = "2.4.0" From 0c5a74abf31aa8c4dcca8c236bc91ef19dba87a4 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 17 Oct 2025 19:38:04 +0000 Subject: [PATCH 521/678] chore(deps): update dependency tuist to v4.88.0 (#990) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise.toml b/.mise.toml index 26d839171..bc0fa9289 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,5 +1,5 @@ [tools] swiftformat = "0.54.3" -tuist = "4.86.3" +tuist = "4.88.0" swiftlint = "0.55.1" "git-cliff" = "2.4.0" From c1e2af961928c74ff4390e493d287b1edb4227ad Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 20 Oct 2025 15:06:27 +0000 Subject: [PATCH 522/678] chore(deps): update dependency tuist to v4.88.1 (#991) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise.toml b/.mise.toml index bc0fa9289..0b11d8a95 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,5 +1,5 @@ [tools] swiftformat = "0.54.3" -tuist = "4.88.0" +tuist = "4.88.1" swiftlint = "0.55.1" "git-cliff" = "2.4.0" From db1ed162d4c3937955bc1f2c757e42d5488226b7 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 22 Oct 2025 11:13:23 +0000 Subject: [PATCH 523/678] chore(deps): update dependency tuist to v4.89.0 (#992) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise.toml b/.mise.toml index 0b11d8a95..6fd04a345 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,5 +1,5 @@ [tools] swiftformat = "0.54.3" -tuist = "4.88.1" +tuist = "4.89.0" swiftlint = "0.55.1" "git-cliff" = "2.4.0" From 10ee5a1c6f2b4eb2e60d351d1b5ccec9ad5468d1 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 24 Oct 2025 05:33:25 +0000 Subject: [PATCH 524/678] chore(deps): update dependency tuist to v4.90.0 (#993) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise.toml b/.mise.toml index 6fd04a345..610d019eb 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,5 +1,5 @@ [tools] swiftformat = "0.54.3" -tuist = "4.89.0" +tuist = "4.90.0" swiftlint = "0.55.1" "git-cliff" = "2.4.0" From 6c18ec50d8232b5e7ea9f99dc534607b0250427c Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 29 Oct 2025 03:34:52 +0000 Subject: [PATCH 525/678] chore(deps): update dependency tuist to v4.91.1 (#994) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise.toml b/.mise.toml index 610d019eb..ac4b6ea51 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,5 +1,5 @@ [tools] swiftformat = "0.54.3" -tuist = "4.90.0" +tuist = "4.91.1" swiftlint = "0.55.1" "git-cliff" = "2.4.0" From 78ef11ddd2c467db5307986ababf49d2c1d0e467 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 30 Oct 2025 04:55:06 +0000 Subject: [PATCH 526/678] chore(deps): update dependency tuist to v4.94.0 (#995) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise.toml b/.mise.toml index ac4b6ea51..3124c4143 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,5 +1,5 @@ [tools] swiftformat = "0.54.3" -tuist = "4.91.1" +tuist = "4.94.0" swiftlint = "0.55.1" "git-cliff" = "2.4.0" From ce4f8c4df2d2d9a20cc1f4811ada66dc1696bd5c Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 31 Oct 2025 04:50:24 +0000 Subject: [PATCH 527/678] chore(deps): update dependency tuist to v4.95.0 (#996) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise.toml b/.mise.toml index 3124c4143..aa91cf5ea 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,5 +1,5 @@ [tools] swiftformat = "0.54.3" -tuist = "4.94.0" +tuist = "4.95.0" swiftlint = "0.55.1" "git-cliff" = "2.4.0" From 65195d8f798c77bf0388ed5a4a7e193b9b416c7f Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 1 Nov 2025 00:11:59 +0000 Subject: [PATCH 528/678] chore(deps): update dependency tuist to v4.97.1 (#997) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise.toml b/.mise.toml index aa91cf5ea..c7e65c9ab 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,5 +1,5 @@ [tools] swiftformat = "0.54.3" -tuist = "4.95.0" +tuist = "4.97.1" swiftlint = "0.55.1" "git-cliff" = "2.4.0" From 0ebb52642512ad5c97170b3cc99106ffefd9ba8f Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 1 Nov 2025 21:35:54 +0000 Subject: [PATCH 529/678] chore(deps): update dependency tuist to v4.97.2 (#998) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise.toml b/.mise.toml index c7e65c9ab..b846f5454 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,5 +1,5 @@ [tools] swiftformat = "0.54.3" -tuist = "4.97.1" +tuist = "4.97.2" swiftlint = "0.55.1" "git-cliff" = "2.4.0" From d9804b91865153fc3c39262848034898cfde5c18 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 3 Nov 2025 22:40:39 +0000 Subject: [PATCH 530/678] chore(deps): update dependency tuist to v4.98.0 (#999) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise.toml b/.mise.toml index b846f5454..dc3e230b7 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,5 +1,5 @@ [tools] swiftformat = "0.54.3" -tuist = "4.97.2" +tuist = "4.98.0" swiftlint = "0.55.1" "git-cliff" = "2.4.0" From ab2ed3f27ca78f6a9f7bb48a66f1fdc414a1fe15 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 4 Nov 2025 23:09:10 +0000 Subject: [PATCH 531/678] chore(deps): update dependency tuist to v4.99.0 (#1000) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise.toml b/.mise.toml index dc3e230b7..1ad4a8077 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,5 +1,5 @@ [tools] swiftformat = "0.54.3" -tuist = "4.98.0" +tuist = "4.99.0" swiftlint = "0.55.1" "git-cliff" = "2.4.0" From 6b27404b6aa3481b7676cc257bb99cfc5f119406 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 6 Nov 2025 01:56:14 +0000 Subject: [PATCH 532/678] chore(deps): update dependency tuist to v4.99.2 (#1001) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise.toml b/.mise.toml index 1ad4a8077..d8fbc3262 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,5 +1,5 @@ [tools] swiftformat = "0.54.3" -tuist = "4.99.0" +tuist = "4.99.2" swiftlint = "0.55.1" "git-cliff" = "2.4.0" From e8909a06c86992073dc3fadbc2855ada7f9639ac Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 7 Nov 2025 21:36:39 +0000 Subject: [PATCH 533/678] chore(deps): update dependency tuist to v4.101.0 (#1002) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise.toml b/.mise.toml index d8fbc3262..825c53b6d 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,5 +1,5 @@ [tools] swiftformat = "0.54.3" -tuist = "4.99.2" +tuist = "4.101.0" swiftlint = "0.55.1" "git-cliff" = "2.4.0" From 85607d671edaf52d6a96a57a174550180f482f1b Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 11 Nov 2025 04:30:29 +0000 Subject: [PATCH 534/678] chore(deps): update dependency tuist to v4.102.0 (#1003) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise.toml b/.mise.toml index 825c53b6d..c6d6d11a6 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,5 +1,5 @@ [tools] swiftformat = "0.54.3" -tuist = "4.101.0" +tuist = "4.102.0" swiftlint = "0.55.1" "git-cliff" = "2.4.0" From 3ff23d01a3be355e2ecf7769aed9cc229fdcf00d Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 12 Nov 2025 01:52:51 +0000 Subject: [PATCH 535/678] chore(deps): update dependency tuist to v4.103.0 (#1005) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise.toml b/.mise.toml index c6d6d11a6..da0c2a6e1 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,5 +1,5 @@ [tools] swiftformat = "0.54.3" -tuist = "4.102.0" +tuist = "4.103.0" swiftlint = "0.55.1" "git-cliff" = "2.4.0" From f86a84c33b7c2ebfeeed1054d2b40ba7f960b52e Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 13 Nov 2025 01:38:55 +0000 Subject: [PATCH 536/678] chore(deps): update dependency tuist to v4.104.1 (#1006) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise.toml b/.mise.toml index da0c2a6e1..63977a3d8 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,5 +1,5 @@ [tools] swiftformat = "0.54.3" -tuist = "4.103.0" +tuist = "4.104.1" swiftlint = "0.55.1" "git-cliff" = "2.4.0" From 48c59a0767b5f628e2765b6458b338d9a3924db5 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 14 Nov 2025 04:31:44 +0000 Subject: [PATCH 537/678] chore(deps): update dependency tuist to v4.104.4 (#1007) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise.toml b/.mise.toml index 63977a3d8..20a50f176 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,5 +1,5 @@ [tools] swiftformat = "0.54.3" -tuist = "4.104.1" +tuist = "4.104.4" swiftlint = "0.55.1" "git-cliff" = "2.4.0" From 3bd916033bf1241a442842335b986a9dcad80f2a Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 14 Nov 2025 23:58:25 +0000 Subject: [PATCH 538/678] chore(deps): update dependency tuist to v4.104.6 (#1008) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise.toml b/.mise.toml index 20a50f176..5545f1cbb 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,5 +1,5 @@ [tools] swiftformat = "0.54.3" -tuist = "4.104.4" +tuist = "4.104.6" swiftlint = "0.55.1" "git-cliff" = "2.4.0" From cc6b66a99d9273d852bba54bca0ad5829bd069fd Mon Sep 17 00:00:00 2001 From: Wojciech Kulik <3128467+wojciech-kulik@users.noreply.github.com> Date: Mon, 17 Nov 2025 11:29:45 +0100 Subject: [PATCH 539/678] update README (#1009) --- README.md | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index a96d0f57f..d12950ef1 100644 --- a/README.md +++ b/README.md @@ -26,16 +26,17 @@ XcodeProj is a library written in Swift for parsing and working with Xcode proje ## Projects Using XcodeProj -| Project | Repository | -| --------------- | -------------------------------------------------------------------------------------------- | -| ProjLint | [github.com/JamitLabs/ProjLint](https://github.com/JamitLabs/ProjLint) | -| rules_xcodeproj | [github.com/buildbuddy-io/rules_xcodeproj](https://github.com/buildbuddy-io/rules_xcodeproj) | -| Rugby | [github.com/swiftyfinch/Rugby](https://github.com/swiftyfinch/Rugby) | -| Sourcery | [github.com/krzysztofzablocki/Sourcery](https://github.com/krzysztofzablocki/Sourcery) | -| Tuist | [github.com/tuist/tuist](https://github.com/tuist/tuist) | -| XcodeGen | [github.com/yonaskolb/XcodeGen](https://github.com/yonaskolb/XcodeGen) | -| xspm | [gitlab.com/Pyroh/xspm](https://gitlab.com/Pyroh/xspm) | -| Privacy Manifest| [github.com/stelabouras/privacy-manifest](https://github.com/stelabouras/privacy-manifest) | +| Project | Repository | +| --------------- | ------------------------------------------------------------------------------------------------ | +| ProjLint | [github.com/JamitLabs/ProjLint](https://github.com/JamitLabs/ProjLint) | +| rules_xcodeproj | [github.com/buildbuddy-io/rules_xcodeproj](https://github.com/buildbuddy-io/rules_xcodeproj) | +| Rugby | [github.com/swiftyfinch/Rugby](https://github.com/swiftyfinch/Rugby) | +| Sourcery | [github.com/krzysztofzablocki/Sourcery](https://github.com/krzysztofzablocki/Sourcery) | +| Tuist | [github.com/tuist/tuist](https://github.com/tuist/tuist) | +| XcodeGen | [github.com/yonaskolb/XcodeGen](https://github.com/yonaskolb/XcodeGen) | +| xspm | [gitlab.com/Pyroh/xspm](https://gitlab.com/Pyroh/xspm) | +| Privacy Manifest| [github.com/stelabouras/privacy-manifest](https://github.com/stelabouras/privacy-manifest) | +| XcodeProjectCLI | [github.com/wojciech-kulik/XcodeProjectCLI](https://github.com/wojciech-kulik/XcodeProjectCLI) | If you are also leveraging XcodeProj in your project, feel free to open a PR to include it in the list above. From 7c999da198db82d3d8acfcd6af3a6ead0583e85a Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 19 Nov 2025 20:48:21 +0000 Subject: [PATCH 540/678] chore(deps): update actions/checkout digest to 34e1148 (#1010) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e7d2a7fbb..03edbf62d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -23,7 +23,7 @@ jobs: timeout-minutes: 15 if: "!startsWith(github.event.head_commit.message, '[Release]')" steps: - - uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4 + - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 with: fetch-depth: 0 - uses: jdx/mise-action@v2 From 75a92b2400c11a3d50f7d48c234a183b1051b105 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 20 Nov 2025 01:07:22 +0000 Subject: [PATCH 541/678] chore(deps): update dependency tuist to v4.104.7 (#1011) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise.toml b/.mise.toml index 5545f1cbb..35c114921 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,5 +1,5 @@ [tools] swiftformat = "0.54.3" -tuist = "4.104.6" +tuist = "4.104.7" swiftlint = "0.55.1" "git-cliff" = "2.4.0" From e79bc23d626df9c26d6693f2af2efa10a3f35c33 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 25 Nov 2025 05:13:01 +0000 Subject: [PATCH 542/678] chore(deps): update dependency tuist to v4.106.3 (#1012) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise.toml b/.mise.toml index 35c114921..e00548ae9 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,5 +1,5 @@ [tools] swiftformat = "0.54.3" -tuist = "4.104.7" +tuist = "4.106.3" swiftlint = "0.55.1" "git-cliff" = "2.4.0" From f7fffac2f027a5dfeb3f9590bdcabe191d982923 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 25 Nov 2025 21:29:53 +0000 Subject: [PATCH 543/678] chore(deps): update dependency tuist to v4.107.2 (#1017) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise.toml b/.mise.toml index e00548ae9..e1e54a381 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,5 +1,5 @@ [tools] swiftformat = "0.54.3" -tuist = "4.106.3" +tuist = "4.107.2" swiftlint = "0.55.1" "git-cliff" = "2.4.0" From da0c60baff4484d0812d8c41dc3d44db20da48d1 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 27 Nov 2025 02:58:16 +0000 Subject: [PATCH 544/678] chore(deps): update dependency tuist to v4.108.1 (#1019) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise.toml b/.mise.toml index e1e54a381..d752b89ab 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,5 +1,5 @@ [tools] swiftformat = "0.54.3" -tuist = "4.107.2" +tuist = "4.108.1" swiftlint = "0.55.1" "git-cliff" = "2.4.0" From 97f8e25dc665e1439fdc1ea7f0f345611b9397f0 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 27 Nov 2025 21:55:59 +0000 Subject: [PATCH 545/678] chore(deps): update dependency tuist to v4.109.1 (#1020) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise.toml b/.mise.toml index d752b89ab..f8de5a0d3 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,5 +1,5 @@ [tools] swiftformat = "0.54.3" -tuist = "4.108.1" +tuist = "4.109.1" swiftlint = "0.55.1" "git-cliff" = "2.4.0" From c93daf2d55df3b6489b08822ce2e73d101c61e65 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sun, 30 Nov 2025 16:59:49 +0000 Subject: [PATCH 546/678] chore(deps): update dependency tuist to v4.109.2 (#1021) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise.toml b/.mise.toml index f8de5a0d3..c4d6adc83 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,5 +1,5 @@ [tools] swiftformat = "0.54.3" -tuist = "4.109.1" +tuist = "4.109.2" swiftlint = "0.55.1" "git-cliff" = "2.4.0" From 580ef31853beb0993edf71e01237bc4a91db2937 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 1 Dec 2025 20:40:27 +0000 Subject: [PATCH 547/678] chore(deps): update dependency tuist to v4.110.1 (#1022) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise.toml b/.mise.toml index c4d6adc83..c8a3721e0 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,5 +1,5 @@ [tools] swiftformat = "0.54.3" -tuist = "4.109.2" +tuist = "4.110.1" swiftlint = "0.55.1" "git-cliff" = "2.4.0" From d8b984ff6d05546a05ccd2652f2cbfb1bde58097 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 2 Dec 2025 13:58:41 +0000 Subject: [PATCH 548/678] chore(deps): update dependency tuist to v4.110.3 (#1023) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise.toml b/.mise.toml index c8a3721e0..a8904a52f 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,5 +1,5 @@ [tools] swiftformat = "0.54.3" -tuist = "4.110.1" +tuist = "4.110.3" swiftlint = "0.55.1" "git-cliff" = "2.4.0" From d735b038fb5d204d2502d6c9f8fef1aaef718327 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 5 Dec 2025 02:30:37 +0000 Subject: [PATCH 549/678] chore(deps): update dependency tuist to v4.111.1 (#1024) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise.toml b/.mise.toml index a8904a52f..6df68c04d 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,5 +1,5 @@ [tools] swiftformat = "0.54.3" -tuist = "4.110.3" +tuist = "4.111.1" swiftlint = "0.55.1" "git-cliff" = "2.4.0" From 7bc1562470ff4f0480d7edf2b61d7e3172f549d7 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 9 Dec 2025 20:41:24 +0000 Subject: [PATCH 550/678] chore(deps): update dependency tuist to v4.112.0 (#1025) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise.toml b/.mise.toml index 6df68c04d..89cd4ddd3 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,5 +1,5 @@ [tools] swiftformat = "0.54.3" -tuist = "4.111.1" +tuist = "4.112.0" swiftlint = "0.55.1" "git-cliff" = "2.4.0" From 85bddf87b4ba9c4aed7a54d5028ac8f7296f5173 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 10 Dec 2025 21:35:12 +0000 Subject: [PATCH 551/678] chore(deps): update dependency tuist to v4.113.0 (#1026) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise.toml b/.mise.toml index 89cd4ddd3..4505c02bd 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,5 +1,5 @@ [tools] swiftformat = "0.54.3" -tuist = "4.112.0" +tuist = "4.113.0" swiftlint = "0.55.1" "git-cliff" = "2.4.0" From a70402d26642041302df0bb42e8b0c182d6b88f9 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 11 Dec 2025 16:29:54 +0000 Subject: [PATCH 552/678] chore(deps): update dependency tuist to v4.113.1 (#1027) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise.toml b/.mise.toml index 4505c02bd..15ad47295 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,5 +1,5 @@ [tools] swiftformat = "0.54.3" -tuist = "4.113.0" +tuist = "4.113.1" swiftlint = "0.55.1" "git-cliff" = "2.4.0" From ee5d66ed626d5dce12887aae58451cc69f237365 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 12 Dec 2025 03:10:53 +0000 Subject: [PATCH 553/678] chore(deps): update dependency tuist to v4.115.0 (#1028) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise.toml b/.mise.toml index 15ad47295..ce95c8810 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,5 +1,5 @@ [tools] swiftformat = "0.54.3" -tuist = "4.113.1" +tuist = "4.115.0" swiftlint = "0.55.1" "git-cliff" = "2.4.0" From 38f07b3b2dea8a2cd94ff38f6a29eb4a4a15eb20 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 12 Dec 2025 13:04:22 +0000 Subject: [PATCH 554/678] chore(deps): update dependency tuist to v4.115.1 (#1029) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise.toml b/.mise.toml index ce95c8810..e5ca1a86e 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,5 +1,5 @@ [tools] swiftformat = "0.54.3" -tuist = "4.115.0" +tuist = "4.115.1" swiftlint = "0.55.1" "git-cliff" = "2.4.0" From 4f1a803fa03bfb22a3ed95ed8f4ea8d4ef2eeecf Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 17 Dec 2025 02:08:55 +0000 Subject: [PATCH 555/678] chore(deps): update dependency tuist to v4.116.1 (#1030) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise.toml b/.mise.toml index e5ca1a86e..d22a93ec9 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,5 +1,5 @@ [tools] swiftformat = "0.54.3" -tuist = "4.115.1" +tuist = "4.116.1" swiftlint = "0.55.1" "git-cliff" = "2.4.0" From fdfb9821ec07963d518dc472735731be443c3fd4 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 17 Dec 2025 18:24:29 +0000 Subject: [PATCH 556/678] chore(deps): update dependency tuist to v4.116.2 (#1031) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise.toml b/.mise.toml index d22a93ec9..f400e8842 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,5 +1,5 @@ [tools] swiftformat = "0.54.3" -tuist = "4.116.1" +tuist = "4.116.2" swiftlint = "0.55.1" "git-cliff" = "2.4.0" From 1e7963c84bb54462d10bc2594f1092193964ac0f Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 18 Dec 2025 21:27:04 +0000 Subject: [PATCH 557/678] chore(deps): update dependency tuist to v4.117.0 (#1032) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise.toml b/.mise.toml index f400e8842..802738d56 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,5 +1,5 @@ [tools] swiftformat = "0.54.3" -tuist = "4.116.2" +tuist = "4.117.0" swiftlint = "0.55.1" "git-cliff" = "2.4.0" From 43e97922257d3d30a16c158ae70f93654afd94c8 Mon Sep 17 00:00:00 2001 From: mirkokg Date: Fri, 19 Dec 2025 17:06:02 +0100 Subject: [PATCH 558/678] feat: Handle references for exception sets in Synchronized Groups (#1014) * Handle references for exception sets in Synchronized Groups Generate permanent references for PBXFileSystemSynchronizedExceptionSet objects, including build file and build phase exception sets. Updates tests to verify that references for exception sets are correctly converted to permanent values. * Update ReferenceGeneratorTests.swift Remove empty space * Update ReferenceGenerator.swift Format code --- .../XcodeProj/Utils/ReferenceGenerator.swift | 29 +++++++++ .../Utils/ReferenceGeneratorTests.swift | 62 ++++++++++++++++++- 2 files changed, 89 insertions(+), 2 deletions(-) diff --git a/Sources/XcodeProj/Utils/ReferenceGenerator.swift b/Sources/XcodeProj/Utils/ReferenceGenerator.swift index 01f0267e9..b197c55f4 100644 --- a/Sources/XcodeProj/Utils/ReferenceGenerator.swift +++ b/Sources/XcodeProj/Utils/ReferenceGenerator.swift @@ -176,6 +176,35 @@ final class ReferenceGenerator: ReferenceGenerating { } fixReference(for: synchronizedRootGroup, identifiers: identifiers) + + // Generate references for exception sets + if let exceptions = synchronizedRootGroup.exceptions { + try exceptions.forEach { exception in + try generateExceptionSetReferences(exception, identifiers: identifiers) + } + } + } + + /// Generates the reference for an exception set object. + /// + /// - Parameters: + /// - exceptionSet: exception set instance. + /// - identifiers: list of identifiers. + private func generateExceptionSetReferences(_ exceptionSet: PBXFileSystemSynchronizedExceptionSet, + identifiers: [String]) throws { + var identifiers = identifiers + + if let buildFileException = exceptionSet as? PBXFileSystemSynchronizedBuildFileExceptionSet { + if let target = buildFileException.target { + identifiers.append(target.reference.value) + } + fixReference(for: buildFileException, identifiers: identifiers) + } else if let buildPhaseException = exceptionSet as? PBXFileSystemSynchronizedGroupBuildPhaseMembershipExceptionSet { + if let buildPhase = buildPhaseException.buildPhase { + identifiers.append(buildPhase.reference.value) + } + fixReference(for: buildPhaseException, identifiers: identifiers) + } } /// Generates the reference for a configuration list object. diff --git a/Tests/XcodeProjTests/Utils/ReferenceGeneratorTests.swift b/Tests/XcodeProjTests/Utils/ReferenceGeneratorTests.swift index af3a2f1b1..a09c79cb1 100644 --- a/Tests/XcodeProjTests/Utils/ReferenceGeneratorTests.swift +++ b/Tests/XcodeProjTests/Utils/ReferenceGeneratorTests.swift @@ -98,6 +98,63 @@ class ReferenceGeneratorTests: XCTestCase { XCTAssert(!syncedGroup.reference.temporary) } + + func test_projectWithFilesystemSynchronizedRootGroupWithExceptions_convertsReferencesToPermanent() throws { + let project = PBXProj(rootObject: nil, objectVersion: 0, archiveVersion: 0, classes: [:], objects: []) + let pbxProject = project.makeProject() + + let target = project.makeTarget() + pbxProject.targets.append(target) + + let buildFileException = PBXFileSystemSynchronizedBuildFileExceptionSet( + target: target, + membershipExceptions: ["Info.plist"], + publicHeaders: nil, + privateHeaders: nil, + additionalCompilerFlagsByRelativePath: nil, + attributesByRelativePath: nil + ) + project.add(object: buildFileException) + + let syncedGroup = project.makeSynchronizedRootGroup(exceptions: [buildFileException]) + target.fileSystemSynchronizedGroups = [syncedGroup] + + let referenceGenerator = ReferenceGenerator(outputSettings: PBXOutputSettings()) + try referenceGenerator.generateReferences(proj: project) + + XCTAssert(!syncedGroup.reference.temporary, "Synced group reference should not be temporary") + XCTAssert(!buildFileException.reference.temporary, "Build file exception reference should not be temporary") + XCTAssertFalse(buildFileException.reference.value.hasPrefix("TEMP_"), "Build file exception reference should not have TEMP_ prefix") + } + + func test_projectWithFilesystemSynchronizedRootGroupWithBuildPhaseException_convertsReferencesToPermanent() throws { + let project = PBXProj(rootObject: nil, objectVersion: 0, archiveVersion: 0, classes: [:], objects: []) + let pbxProject = project.makeProject() + + let target = project.makeTarget() + pbxProject.targets.append(target) + + let buildPhase = PBXSourcesBuildPhase() + project.add(object: buildPhase) + target.buildPhases.append(buildPhase) + + let buildPhaseException = PBXFileSystemSynchronizedGroupBuildPhaseMembershipExceptionSet( + buildPhase: buildPhase, + membershipExceptions: ["ExcludedFile.swift"], + attributesByRelativePath: nil + ) + project.add(object: buildPhaseException) + + let syncedGroup = project.makeSynchronizedRootGroup(exceptions: [buildPhaseException]) + target.fileSystemSynchronizedGroups = [syncedGroup] + + let referenceGenerator = ReferenceGenerator(outputSettings: PBXOutputSettings()) + try referenceGenerator.generateReferences(proj: project) + + XCTAssert(!syncedGroup.reference.temporary, "Synced group reference should not be temporary") + XCTAssert(!buildPhaseException.reference.temporary, "Build phase exception reference should not be temporary") + XCTAssertFalse(buildPhaseException.reference.value.hasPrefix("TEMP_"), "Build phase exception reference should not have TEMP_ prefix") + } } private extension PBXProj { @@ -192,11 +249,12 @@ private extension PBXProj { return target } - func makeSynchronizedRootGroup() -> PBXFileSystemSynchronizedRootGroup { + func makeSynchronizedRootGroup(exceptions: [PBXFileSystemSynchronizedExceptionSet] = []) -> PBXFileSystemSynchronizedRootGroup { let syncedGroup = PBXFileSystemSynchronizedRootGroup( sourceTree: .group, path: "SyncedPath", - name: "SyncedGroup" + name: "SyncedGroup", + exceptions: exceptions ) add(object: syncedGroup) rootObject!.mainGroup.children.append(syncedGroup) From a6ac51d54b5676f789a5d381a5607ddab5a07168 Mon Sep 17 00:00:00 2001 From: pepicrft <663605+pepicrft@users.noreply.github.com> Date: Fri, 19 Dec 2025 16:06:32 +0000 Subject: [PATCH 559/678] [Release] XcodeProj 9.7.0 --- CHANGELOG.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index cf6d37f82..f3b0af706 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [9.7.0] - 2025-12-19 +### Details +#### Features +- Handle references for exception sets in Synchronized Groups by @mirkokg in [#1014](https://github.com/tuist/XcodeProj/pull/1014) + +## New Contributors +* @mirkokg made their first contribution in [#1014](https://github.com/tuist/XcodeProj/pull/1014) ## [9.6.0] - 2025-10-06 ### Details #### Features @@ -214,6 +221,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Disable the renovatebot dashboard by @pepicrft in [#840](https://github.com/tuist/XcodeProj/pull/840) - Set up SwiftLint and SwiftFormat, run them against the project, and run them as part of the CI workflows by @pepicrft in [#836](https://github.com/tuist/XcodeProj/pull/836) +[9.7.0]: https://github.com/tuist/XcodeProj/compare/9.6.0..9.7.0 [9.6.0]: https://github.com/tuist/XcodeProj/compare/9.5.0..9.6.0 [9.5.0]: https://github.com/tuist/XcodeProj/compare/9.4.3..9.5.0 [9.4.3]: https://github.com/tuist/XcodeProj/compare/9.4.2..9.4.3 From b30f20fb2ad6542a6aa08cf949b0aaabe0a52efc Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 19 Dec 2025 21:11:16 +0000 Subject: [PATCH 560/678] chore(deps): update dependency tuist to v4.118.0 (#1033) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise.toml b/.mise.toml index 802738d56..fa5126947 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,5 +1,5 @@ [tools] swiftformat = "0.54.3" -tuist = "4.117.0" +tuist = "4.118.0" swiftlint = "0.55.1" "git-cliff" = "2.4.0" From 59f6e6453cd820bee7c07fbf4939eba472f77ec1 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 22 Dec 2025 09:45:39 +0100 Subject: [PATCH 561/678] chore(deps): update jdx/mise-action action to v3 (#974) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .github/workflows/release.yml | 2 +- .github/workflows/xcodeproj.yml | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 03edbf62d..ecabc02b1 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -26,7 +26,7 @@ jobs: - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 with: fetch-depth: 0 - - uses: jdx/mise-action@v2 + - uses: jdx/mise-action@v3 with: experimental: true - name: Check if there are releasable changes diff --git a/.github/workflows/xcodeproj.yml b/.github/workflows/xcodeproj.yml index 14bdb8601..1b545ad00 100644 --- a/.github/workflows/xcodeproj.yml +++ b/.github/workflows/xcodeproj.yml @@ -21,7 +21,7 @@ jobs: runs-on: macos-latest steps: - uses: actions/checkout@v3 - - uses: jdx/mise-action@v2 + - uses: jdx/mise-action@v3 - name: Build run: mise run build build-linux: @@ -29,7 +29,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - - uses: jdx/mise-action@v2 + - uses: jdx/mise-action@v3 - run: mise use swift@6.0.2 - name: Build run: swift build --configuration release @@ -38,7 +38,7 @@ jobs: runs-on: macos-latest steps: - uses: actions/checkout@v3 - - uses: jdx/mise-action@v2 + - uses: jdx/mise-action@v3 - name: Run tests run: mise run test @@ -47,7 +47,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - - uses: jdx/mise-action@v2 + - uses: jdx/mise-action@v3 - run: mise use swift@6.0.2 - run: | git config --global user.email 'xcodeproj@tuist.dev' @@ -61,5 +61,5 @@ jobs: runs-on: macos-latest steps: - uses: actions/checkout@v3 - - uses: jdx/mise-action@v2 + - uses: jdx/mise-action@v3 - run: mise run lint From ac014c81119930a94e8c6e840d5a0ca0f281aca5 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 22 Dec 2025 09:45:51 +0100 Subject: [PATCH 562/678] chore(deps): update stefanzweifel/git-auto-commit-action action to v7 (#985) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ecabc02b1..ffa63d1d9 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -71,7 +71,7 @@ jobs: run: git cliff 8.22.0.. --bump -o CHANGELOG.md - name: Commit changes id: auto-commit-action - uses: stefanzweifel/git-auto-commit-action@v6 + uses: stefanzweifel/git-auto-commit-action@v7 if: env.should-release == 'true' with: commit_options: "--allow-empty" From 95914682f4e1a009145f2b3eb121d1a5d566963f Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 22 Dec 2025 09:47:30 +0100 Subject: [PATCH 563/678] chore(deps): update actions/checkout action to v6 (#1013) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .github/workflows/conventional-pr.yml | 2 +- .github/workflows/release.yml | 2 +- .github/workflows/xcodeproj.yml | 10 +++++----- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/conventional-pr.yml b/.github/workflows/conventional-pr.yml index ba4a1e53f..ba43b8f6f 100644 --- a/.github/workflows/conventional-pr.yml +++ b/.github/workflows/conventional-pr.yml @@ -12,7 +12,7 @@ jobs: lint-pr: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v6 - uses: CondeNast/conventional-pull-request-action@v0.2.0 with: commitTitleMatch: false diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ffa63d1d9..6d0adc0fb 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -23,7 +23,7 @@ jobs: timeout-minutes: 15 if: "!startsWith(github.event.head_commit.message, '[Release]')" steps: - - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 + - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6 with: fetch-depth: 0 - uses: jdx/mise-action@v3 diff --git a/.github/workflows/xcodeproj.yml b/.github/workflows/xcodeproj.yml index 1b545ad00..3708202c4 100644 --- a/.github/workflows/xcodeproj.yml +++ b/.github/workflows/xcodeproj.yml @@ -20,7 +20,7 @@ jobs: name: Build (macOS) runs-on: macos-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v6 - uses: jdx/mise-action@v3 - name: Build run: mise run build @@ -28,7 +28,7 @@ jobs: name: Build (Linux) runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v6 - uses: jdx/mise-action@v3 - run: mise use swift@6.0.2 - name: Build @@ -37,7 +37,7 @@ jobs: name: Test (macOS / Xcode) runs-on: macos-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v6 - uses: jdx/mise-action@v3 - name: Run tests run: mise run test @@ -46,7 +46,7 @@ jobs: name: Test (Linux) runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v6 - uses: jdx/mise-action@v3 - run: mise use swift@6.0.2 - run: | @@ -60,6 +60,6 @@ jobs: name: Lint runs-on: macos-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v6 - uses: jdx/mise-action@v3 - run: mise run lint From e45e4d7911d1e59ade54395085648b33bd2d96d7 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 22 Dec 2025 20:54:33 +0000 Subject: [PATCH 564/678] chore(deps): update dependency tuist to v4.118.1 (#1035) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise.toml b/.mise.toml index fa5126947..f9f902be2 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,5 +1,5 @@ [tools] swiftformat = "0.54.3" -tuist = "4.118.0" +tuist = "4.118.1" swiftlint = "0.55.1" "git-cliff" = "2.4.0" From bc3ec5082d9209242342ca65ea2ef05ff422baba Mon Sep 17 00:00:00 2001 From: Michael Date: Fri, 26 Dec 2025 10:40:09 +0200 Subject: [PATCH 565/678] fix: support for shellScript in the Xcode 16 format (#1018) * fix https://github.com/tuist/XcodeProj/issues/921 * fix wrong indentation * improve formatting for Either.swift * remove Either and avoid introducing a breaking change for PBXShellScriptBuildPhase --------- Co-authored-by: Michalis Karagiorgos --- .../Test.xcodeproj/project.pbxproj | 61 +++++++++---------- .../xcshareddata/xcschemes/App.xcscheme | 2 +- .../BuildPhase/PBXShellScriptBuildPhase.swift | 7 ++- .../PBXShellScriptBuildPhaseTests.swift | 10 --- .../Objects/Project/PBXProjEncoderTests.swift | 4 ++ Tests/XcodeProjTests/Tests/Fixtures.swift | 5 ++ 6 files changed, 45 insertions(+), 44 deletions(-) diff --git a/Fixtures/Xcode16ProjectReferenceOrder/Test.xcodeproj/project.pbxproj b/Fixtures/Xcode16ProjectReferenceOrder/Test.xcodeproj/project.pbxproj index 86898189c..9194eb0ae 100644 --- a/Fixtures/Xcode16ProjectReferenceOrder/Test.xcodeproj/project.pbxproj +++ b/Fixtures/Xcode16ProjectReferenceOrder/Test.xcodeproj/project.pbxproj @@ -3,7 +3,7 @@ archiveVersion = 1; classes = { }; - objectVersion = 56; + objectVersion = 90; objects = { /* Begin PBXBuildFile section */ @@ -48,15 +48,13 @@ /* Begin PBXCopyFilesBuildPhase section */ BF31C3A479ECD7CBA0640A2F /* Embed Frameworks */ = { isa = PBXCopyFilesBuildPhase; - buildActionMask = 2147483647; dstPath = ""; - dstSubfolderSpec = 10; + dstSubfolder = Frameworks; files = ( C2317A164A6A4F635FE4CCD7 /* Framework1.framework in Embed Frameworks */, 3108C05C7B0C4FD6AC077294 /* Framework2.framework in Embed Frameworks */, ); name = "Embed Frameworks"; - runOnlyForDeploymentPostprocessing = 0; }; /* End PBXCopyFilesBuildPhase section */ @@ -67,18 +65,15 @@ 6D728BF5C49E97251DA378AE /* Framework2.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Framework2.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 87A3E8A0727A99EE88ED4E64 /* Framework1.xcodeproj */ = {isa = PBXFileReference; explicitFileType = "wrapper.pb-project"; includeInIndex = 0; name = Framework1.xcodeproj; path = ../Framework1/Framework1.xcodeproj; sourceTree = SOURCE_ROOT; }; E203E65EDD1A90FCBAA42C9E /* App.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = App.app; sourceTree = BUILT_PRODUCTS_DIR; }; - F09268C492FF78A6C82868C6 /* App-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist; path = "App-Info.plist"; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ B27C7CF4B617049554976EFD /* Frameworks */ = { isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; files = ( 5D8C48ABB7D5D013DDBD67AA /* Framework1.framework in Frameworks */, C57CB036110A3D5DCC9E437A /* Framework2.framework in Frameworks */, ); - runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ @@ -100,14 +95,6 @@ name = Products; sourceTree = ""; }; - 20C83B4860AC239B5E5FDF3C /* InfoPlists */ = { - isa = PBXGroup; - children = ( - F09268C492FF78A6C82868C6 /* App-Info.plist */, - ); - path = InfoPlists; - sourceTree = ""; - }; 30CD57449DD0BAD1F51809C3 /* Products */ = { isa = PBXGroup; children = ( @@ -160,6 +147,7 @@ F1BC716AD69EACCBD2A2DDBC /* Resources */, BF31C3A479ECD7CBA0640A2F /* Embed Frameworks */, B27C7CF4B617049554976EFD /* Frameworks */, + 0579081E2ED74460006A6AFB /* custom script */, ); buildRules = ( ); @@ -168,8 +156,6 @@ CD591349E38A6A3EB5AA81DD /* PBXTargetDependency */, ); name = App; - packageProductDependencies = ( - ); productName = App; productReference = E203E65EDD1A90FCBAA42C9E /* App.app */; productType = "com.apple.product-type.application"; @@ -181,9 +167,9 @@ isa = PBXProject; attributes = { BuildIndependentTargetsInParallel = YES; + LastUpgradeCheck = 1640; }; buildConfigurationList = C94346B8B75719D8319921C2 /* Build configuration list for PBXProject "Test" */; - compatibilityVersion = "Xcode 14.0"; developmentRegion = en; hasScannedForEncodings = 0; knownRegions = ( @@ -191,6 +177,7 @@ en, ); mainGroup = 0767F0D2E9F7C0B23673A1B1; + preferredProjectObjectVersion = 90; productRefGroup = 73B13978C93862E5AD69BCC8 /* Products */; projectDirPath = ""; projectReferences = ( @@ -230,21 +217,31 @@ /* Begin PBXResourcesBuildPhase section */ F1BC716AD69EACCBD2A2DDBC /* Resources */ = { isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; files = ( ); - runOnlyForDeploymentPostprocessing = 0; }; /* End PBXResourcesBuildPhase section */ +/* Begin PBXShellScriptBuildPhase section */ + 0579081E2ED74460006A6AFB /* custom script */ = { + isa = PBXShellScriptBuildPhase; + name = "custom script"; + shellPath = /bin/sh; + shellScript = ( + "# comment", + "ls -la", + "ls -la", + "", + ); + }; +/* End PBXShellScriptBuildPhase section */ + /* Begin PBXSourcesBuildPhase section */ 2053EE4C6238D6C3AEB2ADB3 /* Sources */ = { isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; files = ( D2AE54DED6608D5B956A5E45 /* AppDelegate.swift in Sources */, ); - runOnlyForDeploymentPostprocessing = 0; }; /* End PBXSourcesBuildPhase section */ @@ -262,7 +259,7 @@ /* End PBXTargetDependency section */ /* Begin XCBuildConfiguration section */ - 0B98A64D6F621FDCEEA0CE44 /* Debug */ = { + 0B98A64D6F621FDCEEA0CE44 /* Debug configuration for PBXNativeTarget "App" */ = { isa = XCBuildConfiguration; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; @@ -287,7 +284,7 @@ }; name = Debug; }; - 58BAFCCFAE3AD62113BBEDEF /* Debug */ = { + 58BAFCCFAE3AD62113BBEDEF /* Debug configuration for PBXProject "Test" */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; @@ -326,6 +323,7 @@ DEBUG_INFORMATION_FORMAT = dwarf; ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_TESTABILITY = YES; + ENABLE_USER_SCRIPT_SANDBOXING = YES; GCC_C_LANGUAGE_STANDARD = gnu11; GCC_DYNAMIC_NO_PIC = NO; GCC_NO_COMMON_BLOCKS = YES; @@ -346,7 +344,7 @@ }; name = Debug; }; - 5904C1CCA86A83838723C772 /* Release */ = { + 5904C1CCA86A83838723C772 /* Release configuration for PBXProject "Test" */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; @@ -385,6 +383,7 @@ DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; ENABLE_NS_ASSERTIONS = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_USER_SCRIPT_SANDBOXING = YES; GCC_C_LANGUAGE_STANDARD = gnu11; GCC_NO_COMMON_BLOCKS = YES; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; @@ -399,7 +398,7 @@ }; name = Release; }; - 5E15950A8DD3B82ED1ED7849 /* Release */ = { + 5E15950A8DD3B82ED1ED7849 /* Release configuration for PBXNativeTarget "App" */ = { isa = XCBuildConfiguration; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; @@ -429,19 +428,17 @@ BAA38452720711B406475F28 /* Build configuration list for PBXNativeTarget "App" */ = { isa = XCConfigurationList; buildConfigurations = ( - 0B98A64D6F621FDCEEA0CE44 /* Debug */, - 5E15950A8DD3B82ED1ED7849 /* Release */, + 0B98A64D6F621FDCEEA0CE44 /* Debug configuration for PBXNativeTarget "App" */, + 5E15950A8DD3B82ED1ED7849 /* Release configuration for PBXNativeTarget "App" */, ); - defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; C94346B8B75719D8319921C2 /* Build configuration list for PBXProject "Test" */ = { isa = XCConfigurationList; buildConfigurations = ( - 58BAFCCFAE3AD62113BBEDEF /* Debug */, - 5904C1CCA86A83838723C772 /* Release */, + 58BAFCCFAE3AD62113BBEDEF /* Debug configuration for PBXProject "Test" */, + 5904C1CCA86A83838723C772 /* Release configuration for PBXProject "Test" */, ); - defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; /* End XCConfigurationList section */ diff --git a/Fixtures/Xcode16ProjectReferenceOrder/Test.xcodeproj/xcshareddata/xcschemes/App.xcscheme b/Fixtures/Xcode16ProjectReferenceOrder/Test.xcodeproj/xcshareddata/xcschemes/App.xcscheme index aefdccd72..fc8b076c1 100644 --- a/Fixtures/Xcode16ProjectReferenceOrder/Test.xcodeproj/xcshareddata/xcschemes/App.xcscheme +++ b/Fixtures/Xcode16ProjectReferenceOrder/Test.xcodeproj/xcshareddata/xcschemes/App.xcscheme @@ -1,6 +1,6 @@ [String: Any] { - [ - "files": ["files"], - "inputPaths": ["input"], - "outputPaths": ["output"], - "shellPath": "shellPath", - "shellScript": "shellScript", - ] - } } diff --git a/Tests/XcodeProjTests/Objects/Project/PBXProjEncoderTests.swift b/Tests/XcodeProjTests/Objects/Project/PBXProjEncoderTests.swift index 61bf70205..af5233ce0 100644 --- a/Tests/XcodeProjTests/Objects/Project/PBXProjEncoderTests.swift +++ b/Tests/XcodeProjTests/Objects/Project/PBXProjEncoderTests.swift @@ -554,6 +554,10 @@ private func loadProjectWithWrongProjectReferencesOrder() throws { proj = try PBXProj(data: projectWithWrongProjectReferencesOrder()) } + + private func loadProjectWithShellScriptBuildPhase() throws { + proj = try PBXProj(data: projectWithCustomShellScript()) + } } // MARK: - Line validations diff --git a/Tests/XcodeProjTests/Tests/Fixtures.swift b/Tests/XcodeProjTests/Tests/Fixtures.swift index ed9dfe919..32a0e24fd 100644 --- a/Tests/XcodeProjTests/Tests/Fixtures.swift +++ b/Tests/XcodeProjTests/Tests/Fixtures.swift @@ -50,3 +50,8 @@ func projectWithWrongProjectReferencesOrder() throws -> Data { let iosProjectWithProjectReferences = fixturesPath() + "Xcode16ProjectReferenceOrder/Wrong.xcodeproj/project.pbxproj" return try Data(contentsOf: iosProjectWithProjectReferences.url) } + +func projectWithCustomShellScript() throws -> Data { + let iosProjectWithShellScript = fixturesPath() + "Xcode16ProjectReferenceOrder/Test.xcodeproj/project.pbxproj" + return try Data(contentsOf: iosProjectWithShellScript.url) +} From 1cf10b32c53e003994f27bb3d37e20dcb941179d Mon Sep 17 00:00:00 2001 From: pepicrft <663605+pepicrft@users.noreply.github.com> Date: Fri, 26 Dec 2025 08:40:34 +0000 Subject: [PATCH 566/678] [Release] XcodeProj 9.7.1 --- CHANGELOG.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index f3b0af706..cc4805981 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [9.7.1] - 2025-12-26 +### Details +#### Bug Fixes +- Support for shellScript in the Xcode 16 format by @michaelversus in [#1018](https://github.com/tuist/XcodeProj/pull/1018) + +## New Contributors +* @michaelversus made their first contribution in [#1018](https://github.com/tuist/XcodeProj/pull/1018) ## [9.7.0] - 2025-12-19 ### Details #### Features @@ -221,6 +228,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Disable the renovatebot dashboard by @pepicrft in [#840](https://github.com/tuist/XcodeProj/pull/840) - Set up SwiftLint and SwiftFormat, run them against the project, and run them as part of the CI workflows by @pepicrft in [#836](https://github.com/tuist/XcodeProj/pull/836) +[9.7.1]: https://github.com/tuist/XcodeProj/compare/9.7.0..9.7.1 [9.7.0]: https://github.com/tuist/XcodeProj/compare/9.6.0..9.7.0 [9.6.0]: https://github.com/tuist/XcodeProj/compare/9.5.0..9.6.0 [9.5.0]: https://github.com/tuist/XcodeProj/compare/9.4.3..9.5.0 From 737c21e8739f3a1f0ae6cc4eb2dcd79fcccfc736 Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Fri, 26 Dec 2025 09:41:35 +0100 Subject: [PATCH 567/678] docs: add michaelversus as a contributor for code (#1036) * docs: update README.md [skip ci] * docs: update .all-contributorsrc [skip ci] --------- Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com> --- .all-contributorsrc | 9 +++++++++ README.md | 3 ++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/.all-contributorsrc b/.all-contributorsrc index a6e7f81fd..e940ed957 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -418,6 +418,15 @@ "contributions": [ "code" ] + }, + { + "login": "michaelversus", + "name": "Michael", + "avatar_url": "https://avatars.githubusercontent.com/u/10232018?v=4", + "profile": "https://github.com/michaelversus", + "contributions": [ + "code" + ] } ], "contributorsPerLine": 7, diff --git a/README.md b/README.md index d12950ef1..87e12e720 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # XcodeProj -[![All Contributors](https://img.shields.io/badge/all_contributors-46-orange.svg?style=flat-square)](#contributors-) +[![All Contributors](https://img.shields.io/badge/all_contributors-47-orange.svg?style=flat-square)](#contributors-) [![Swift Package Manager](https://img.shields.io/badge/swift%20package%20manager-compatible-brightgreen.svg)](https://swift.org/package-manager/) @@ -193,6 +193,7 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d Maxim
Maxim

💻 Bryan Summersett
Bryan Summersett

💻 Mikhail
Mikhail

💻 + Michael
Michael

💻 From 04adec365c9c10c66b8d59f1a6683b59b530ddb7 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 30 Dec 2025 21:46:34 +0000 Subject: [PATCH 568/678] chore(deps): update dependency tuist to v4.119.1 (#1039) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise.toml b/.mise.toml index f9f902be2..0898e8082 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,5 +1,5 @@ [tools] swiftformat = "0.54.3" -tuist = "4.118.1" +tuist = "4.119.1" swiftlint = "0.55.1" "git-cliff" = "2.4.0" From 31712ec42e9cbc46e7fd25ea55c2730cb3476097 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 30 Dec 2025 21:46:50 +0000 Subject: [PATCH 569/678] [Release] XcodeProj 9.7.2 --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index cc4805981..69abf1ce7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,11 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [9.7.2] - 2025-12-30 +### Details +#### Documentation +- Add michaelversus as a contributor for code by @allcontributors[bot] in [#1036](https://github.com/tuist/XcodeProj/pull/1036) + ## [9.7.1] - 2025-12-26 ### Details #### Bug Fixes @@ -228,6 +233,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Disable the renovatebot dashboard by @pepicrft in [#840](https://github.com/tuist/XcodeProj/pull/840) - Set up SwiftLint and SwiftFormat, run them against the project, and run them as part of the CI workflows by @pepicrft in [#836](https://github.com/tuist/XcodeProj/pull/836) +[9.7.2]: https://github.com/tuist/XcodeProj/compare/9.7.1..9.7.2 [9.7.1]: https://github.com/tuist/XcodeProj/compare/9.7.0..9.7.1 [9.7.0]: https://github.com/tuist/XcodeProj/compare/9.6.0..9.7.0 [9.6.0]: https://github.com/tuist/XcodeProj/compare/9.5.0..9.6.0 From 29fb542cace6c52e104bb87ba4ca9e6edfc50a00 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 31 Jan 2026 13:10:10 +0000 Subject: [PATCH 570/678] chore(deps): update dependency tuist to v4.134.0 (#1040) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise.toml b/.mise.toml index 0898e8082..607bb3dde 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,5 +1,5 @@ [tools] swiftformat = "0.54.3" -tuist = "4.119.1" +tuist = "4.134.0" swiftlint = "0.55.1" "git-cliff" = "2.4.0" From bd84e8b76677540749111423ffa31b4188706b41 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 31 Jan 2026 17:14:25 +0000 Subject: [PATCH 571/678] chore(deps): update dependency swiftlint to v0.63.2 (#1042) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise.toml b/.mise.toml index 607bb3dde..22eae9f96 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,5 +1,5 @@ [tools] swiftformat = "0.54.3" tuist = "4.134.0" -swiftlint = "0.55.1" +swiftlint = "0.63.2" "git-cliff" = "2.4.0" From 936fcada7e304e6e7e8b46953e63aa04f7a85df1 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 2 Feb 2026 22:27:29 +0000 Subject: [PATCH 572/678] chore(deps): update dependency tuist to v4.135.2 (#1045) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise.toml b/.mise.toml index 22eae9f96..5c230c7b8 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,5 +1,5 @@ [tools] swiftformat = "0.54.3" -tuist = "4.134.0" +tuist = "4.135.2" swiftlint = "0.63.2" "git-cliff" = "2.4.0" From b869d607e796a688b2a78aebe5fe5c1cf0b5d1ed Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 3 Feb 2026 13:04:58 +0000 Subject: [PATCH 573/678] chore(deps): update dependency tuist to v4.136.0 (#1046) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise.toml b/.mise.toml index 5c230c7b8..b2bdd19a0 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,5 +1,5 @@ [tools] swiftformat = "0.54.3" -tuist = "4.135.2" +tuist = "4.136.0" swiftlint = "0.63.2" "git-cliff" = "2.4.0" From aa968f46bc829e07cfde6ede40ff5a07ae388b12 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 3 Feb 2026 21:10:56 +0000 Subject: [PATCH 574/678] chore(deps): update actions/checkout digest to de0fac2 (#1047) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6d0adc0fb..7789695f7 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -23,7 +23,7 @@ jobs: timeout-minutes: 15 if: "!startsWith(github.event.head_commit.message, '[Release]')" steps: - - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6 + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 with: fetch-depth: 0 - uses: jdx/mise-action@v3 From 0d13fd4ec5dec0e8d82741b0fb38aa4502b53af6 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 4 Feb 2026 01:58:32 +0000 Subject: [PATCH 575/678] chore(deps): update dependency tuist to v4.137.0 (#1048) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise.toml b/.mise.toml index b2bdd19a0..4107f766a 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,5 +1,5 @@ [tools] swiftformat = "0.54.3" -tuist = "4.136.0" +tuist = "4.137.0" swiftlint = "0.63.2" "git-cliff" = "2.4.0" From aa1c360161827c1d09966177451e7f3b6adef55f Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 4 Feb 2026 22:00:40 +0000 Subject: [PATCH 576/678] chore(deps): update dependency tuist to v4.138.0 (#1049) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise.toml b/.mise.toml index 4107f766a..4114d6f66 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,5 +1,5 @@ [tools] swiftformat = "0.54.3" -tuist = "4.137.0" +tuist = "4.138.0" swiftlint = "0.63.2" "git-cliff" = "2.4.0" From 999d42c359b84354bb1dcb9701973713a8dd6952 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 6 Feb 2026 05:48:30 +0000 Subject: [PATCH 577/678] chore(deps): update dependency tuist to v4.140.0 (#1050) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise.toml b/.mise.toml index 4114d6f66..ff4ea3a6a 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,5 +1,5 @@ [tools] swiftformat = "0.54.3" -tuist = "4.138.0" +tuist = "4.140.0" swiftlint = "0.63.2" "git-cliff" = "2.4.0" From a44d4781462fc7742511a0d48b10868fe8e0fe91 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 6 Feb 2026 21:10:35 +0000 Subject: [PATCH 578/678] chore(deps): update dependency tuist to v4.140.2 (#1051) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise.toml b/.mise.toml index ff4ea3a6a..39a8865e0 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,5 +1,5 @@ [tools] swiftformat = "0.54.3" -tuist = "4.140.0" +tuist = "4.140.2" swiftlint = "0.63.2" "git-cliff" = "2.4.0" From 80c3332da00bf78fe763ba5b491f05304635a0e9 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 7 Feb 2026 17:32:47 +0000 Subject: [PATCH 579/678] chore(deps): update dependency tuist to v4.141.0 (#1052) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise.toml b/.mise.toml index 39a8865e0..891fb3a03 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,5 +1,5 @@ [tools] swiftformat = "0.54.3" -tuist = "4.140.2" +tuist = "4.141.0" swiftlint = "0.63.2" "git-cliff" = "2.4.0" From 8704e7796405a6dfb2afcb125411c336f86d6c12 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 10 Feb 2026 05:57:20 +0000 Subject: [PATCH 580/678] chore(deps): update dependency tuist to v4.142.0 (#1053) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise.toml b/.mise.toml index 891fb3a03..73e661fc3 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,5 +1,5 @@ [tools] swiftformat = "0.54.3" -tuist = "4.141.0" +tuist = "4.142.0" swiftlint = "0.63.2" "git-cliff" = "2.4.0" From 23825407d7aa05f0ed577cb83ed72034999ecaff Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 10 Feb 2026 18:15:24 +0000 Subject: [PATCH 581/678] chore(deps): update dependency tuist to v4.142.1 (#1054) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise.toml b/.mise.toml index 73e661fc3..2c93e20a4 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,5 +1,5 @@ [tools] swiftformat = "0.54.3" -tuist = "4.142.0" +tuist = "4.142.1" swiftlint = "0.63.2" "git-cliff" = "2.4.0" From 5b4d105d7f6f5e14493c2f4193ddd523df30f419 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 11 Feb 2026 13:05:16 +0000 Subject: [PATCH 582/678] chore(deps): update dependency tuist to v4.143.0 (#1057) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise.toml b/.mise.toml index 2c93e20a4..32f2c43a9 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,5 +1,5 @@ [tools] swiftformat = "0.54.3" -tuist = "4.142.1" +tuist = "4.143.0" swiftlint = "0.63.2" "git-cliff" = "2.4.0" From 4bb99d8011ea9b7435dbbfdb4bc0cf9e81c39b3a Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 12 Feb 2026 23:02:38 +0000 Subject: [PATCH 583/678] chore(deps): update dependency tuist to v4.145.0 (#1058) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise.toml b/.mise.toml index 32f2c43a9..329bde518 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,5 +1,5 @@ [tools] swiftformat = "0.54.3" -tuist = "4.143.0" +tuist = "4.145.0" swiftlint = "0.63.2" "git-cliff" = "2.4.0" From c52d5d18089abef83d755a6ce536acd609b5e9eb Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 14 Feb 2026 05:53:46 +0000 Subject: [PATCH 584/678] chore(deps): update dependency tuist to v4.146.0 (#1059) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise.toml b/.mise.toml index 329bde518..ac3862bc5 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,5 +1,5 @@ [tools] swiftformat = "0.54.3" -tuist = "4.145.0" +tuist = "4.146.0" swiftlint = "0.63.2" "git-cliff" = "2.4.0" From 3f649ac0ba4387bb44956985346db96c53d3d92f Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 16 Feb 2026 22:31:24 +0000 Subject: [PATCH 585/678] chore(deps): update dependency tuist to v4.146.2 (#1060) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise.toml b/.mise.toml index ac3862bc5..794102f7c 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,5 +1,5 @@ [tools] swiftformat = "0.54.3" -tuist = "4.146.0" +tuist = "4.146.2" swiftlint = "0.63.2" "git-cliff" = "2.4.0" From 38de1820bf426bd98b11afe401a54bc0ac00fcce Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 18 Feb 2026 22:08:27 +0000 Subject: [PATCH 586/678] chore(deps): update dependency tuist to v4.148.1 (#1061) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise.toml b/.mise.toml index 794102f7c..ee52828ec 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,5 +1,5 @@ [tools] swiftformat = "0.54.3" -tuist = "4.146.2" +tuist = "4.148.1" swiftlint = "0.63.2" "git-cliff" = "2.4.0" From 00f0780ea8e1d67d1516761318cfc48e8ca0f795 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 19 Feb 2026 13:27:46 +0000 Subject: [PATCH 587/678] chore(deps): update dependency tuist to v4.148.2 (#1062) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise.toml b/.mise.toml index ee52828ec..3d82c66cf 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,5 +1,5 @@ [tools] swiftformat = "0.54.3" -tuist = "4.148.1" +tuist = "4.148.2" swiftlint = "0.63.2" "git-cliff" = "2.4.0" From 5b968953166da86a1b62b884ab2cc8fd5c976871 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 20 Feb 2026 00:32:56 +0000 Subject: [PATCH 588/678] chore(deps): update dependency tuist to v4.148.4 (#1063) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise.toml b/.mise.toml index 3d82c66cf..34a6a4b79 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,5 +1,5 @@ [tools] swiftformat = "0.54.3" -tuist = "4.148.2" +tuist = "4.148.4" swiftlint = "0.63.2" "git-cliff" = "2.4.0" From 15e6db137386f1879a24d8492f5f5bb4bbbc8748 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Fo=C5=99t?= Date: Fri, 20 Feb 2026 12:00:31 +0100 Subject: [PATCH 589/678] feat: add platformFiltersByRelativePath to PBXFileSystemSynchronizedBuildFileExceptionSet (#1065) Support per-file platform filters on synchronized build file exception sets, following the same pattern as the existing attributesByRelativePath property. This maps relative file paths to arrays of platform filter strings (e.g. "ios", "tvos"), enabling multi-platform targets with platform-specific resources in buildable folders. Co-authored-by: Claude Opus 4.6 --- ...temSynchronizedBuildFileExceptionSet.swift | 16 +++++- .../Objects/Sourcery/Equality.generated.swift | 1 + ...onizedBuildFileExceptionSet+Fixtures.swift | 6 ++- ...nchronizedBuildFileExceptionSetTests.swift | 49 +++++++++++++++++++ 4 files changed, 69 insertions(+), 3 deletions(-) diff --git a/Sources/XcodeProj/Objects/Files/PBXFileSystemSynchronizedBuildFileExceptionSet.swift b/Sources/XcodeProj/Objects/Files/PBXFileSystemSynchronizedBuildFileExceptionSet.swift index c375f16d0..e007bb879 100644 --- a/Sources/XcodeProj/Objects/Files/PBXFileSystemSynchronizedBuildFileExceptionSet.swift +++ b/Sources/XcodeProj/Objects/Files/PBXFileSystemSynchronizedBuildFileExceptionSet.swift @@ -25,6 +25,11 @@ public class PBXFileSystemSynchronizedBuildFileExceptionSet: PBXFileSystemSynchr /// This is used for example when linking frameworks to specify that they are optional with the attribute "Weak" public var attributesByRelativePath: [String: [String]]? + /// Platform filters by relative path. + /// Every item in the list is the relative path inside the root synchronized group. + /// The value is the list of platform filters (e.g. "ios", "tvos") that the file should be included for. + public var platformFiltersByRelativePath: [String: [String]]? + var targetReference: PBXObjectReference public var target: PBXTarget! { @@ -43,13 +48,15 @@ public class PBXFileSystemSynchronizedBuildFileExceptionSet: PBXFileSystemSynchr publicHeaders: [String]?, privateHeaders: [String]?, additionalCompilerFlagsByRelativePath: [String: String]?, - attributesByRelativePath: [String: [String]]?) { + attributesByRelativePath: [String: [String]]?, + platformFiltersByRelativePath: [String: [String]]? = nil) { targetReference = target.reference self.membershipExceptions = membershipExceptions self.publicHeaders = publicHeaders self.privateHeaders = privateHeaders self.additionalCompilerFlagsByRelativePath = additionalCompilerFlagsByRelativePath self.attributesByRelativePath = attributesByRelativePath + self.platformFiltersByRelativePath = platformFiltersByRelativePath super.init() } @@ -62,6 +69,7 @@ public class PBXFileSystemSynchronizedBuildFileExceptionSet: PBXFileSystemSynchr case privateHeaders case additionalCompilerFlagsByRelativePath case attributesByRelativePath + case platformFiltersByRelativePath } public required init(from decoder: Decoder) throws { @@ -75,6 +83,7 @@ public class PBXFileSystemSynchronizedBuildFileExceptionSet: PBXFileSystemSynchr privateHeaders = try container.decodeIfPresent(.privateHeaders) additionalCompilerFlagsByRelativePath = try container.decodeIfPresent(.additionalCompilerFlagsByRelativePath) attributesByRelativePath = try container.decodeIfPresent(.attributesByRelativePath) + platformFiltersByRelativePath = try container.decodeIfPresent(.platformFiltersByRelativePath) try super.init(from: decoder) } @@ -109,6 +118,11 @@ public class PBXFileSystemSynchronizedBuildFileExceptionSet: PBXFileSystemSynchr (CommentedString(key), .array(value.map { .string(CommentedString($0)) })) })) } + if let platformFiltersByRelativePath { + dictionary["platformFiltersByRelativePath"] = .dictionary(Dictionary(uniqueKeysWithValues: platformFiltersByRelativePath.map { key, value in + (CommentedString(key), .array(value.map { .string(CommentedString($0)) })) + })) + } dictionary["target"] = .string(CommentedString(target.reference.value, comment: target.name)) return (key: CommentedString(reference, comment: "PBXFileSystemSynchronizedBuildFileExceptionSet"), value: .dictionary(dictionary)) } diff --git a/Sources/XcodeProj/Objects/Sourcery/Equality.generated.swift b/Sources/XcodeProj/Objects/Sourcery/Equality.generated.swift index cd69699a9..016c323ca 100644 --- a/Sources/XcodeProj/Objects/Sourcery/Equality.generated.swift +++ b/Sources/XcodeProj/Objects/Sourcery/Equality.generated.swift @@ -319,6 +319,7 @@ extension PBXFileSystemSynchronizedBuildFileExceptionSet { if targetReference != rhs.targetReference { return false } if publicHeaders != rhs.publicHeaders { return false } if privateHeaders != rhs.privateHeaders { return false } + if platformFiltersByRelativePath != rhs.platformFiltersByRelativePath { return false } return super.isEqual(to: rhs) } } diff --git a/Tests/XcodeProjTests/Objects/Files/PBXFileSystemSynchronizedBuildFileExceptionSet+Fixtures.swift b/Tests/XcodeProjTests/Objects/Files/PBXFileSystemSynchronizedBuildFileExceptionSet+Fixtures.swift index 17e0b1f0d..bda5f78ea 100644 --- a/Tests/XcodeProjTests/Objects/Files/PBXFileSystemSynchronizedBuildFileExceptionSet+Fixtures.swift +++ b/Tests/XcodeProjTests/Objects/Files/PBXFileSystemSynchronizedBuildFileExceptionSet+Fixtures.swift @@ -6,12 +6,14 @@ extension PBXFileSystemSynchronizedBuildFileExceptionSet { publicHeaders: [String]? = [], privateHeaders: [String]? = [], additionalCompilerFlagsByRelativePath: [String: String]? = nil, - attributesByRelativePath: [String: [String]]? = nil) -> PBXFileSystemSynchronizedBuildFileExceptionSet { + attributesByRelativePath: [String: [String]]? = nil, + platformFiltersByRelativePath: [String: [String]]? = nil) -> PBXFileSystemSynchronizedBuildFileExceptionSet { PBXFileSystemSynchronizedBuildFileExceptionSet(target: target, membershipExceptions: membershipExceptions, publicHeaders: publicHeaders, privateHeaders: privateHeaders, additionalCompilerFlagsByRelativePath: additionalCompilerFlagsByRelativePath, - attributesByRelativePath: attributesByRelativePath) + attributesByRelativePath: attributesByRelativePath, + platformFiltersByRelativePath: platformFiltersByRelativePath) } } diff --git a/Tests/XcodeProjTests/Objects/Files/PBXFileSystemSynchronizedBuildFileExceptionSetTests.swift b/Tests/XcodeProjTests/Objects/Files/PBXFileSystemSynchronizedBuildFileExceptionSetTests.swift index 842954846..0ef9fda58 100644 --- a/Tests/XcodeProjTests/Objects/Files/PBXFileSystemSynchronizedBuildFileExceptionSetTests.swift +++ b/Tests/XcodeProjTests/Objects/Files/PBXFileSystemSynchronizedBuildFileExceptionSetTests.swift @@ -26,4 +26,53 @@ final class PBXFileSystemSynchronizedBuildFileExceptionSetTests: XCTestCase { let another = PBXFileSystemSynchronizedBuildFileExceptionSet.fixture(target: target) XCTAssertEqual(subject, another) } + + func test_equal_withDifferentPlatformFilters_returnsNotEqual() { + let one = PBXFileSystemSynchronizedBuildFileExceptionSet.fixture( + target: target, + platformFiltersByRelativePath: ["file.swift": ["ios"]] + ) + let another = PBXFileSystemSynchronizedBuildFileExceptionSet.fixture( + target: target, + platformFiltersByRelativePath: ["file.swift": ["tvos"]] + ) + XCTAssertNotEqual(one, another) + } + + func test_plistKeyAndValue_platformFiltersByRelativePath_serializesCorrectly() throws { + let proj = PBXProj() + let exceptionSet = PBXFileSystemSynchronizedBuildFileExceptionSet.fixture( + target: target, + platformFiltersByRelativePath: [ + "Resources/ios_only.mp4": ["ios"], + "Resources/multi.mp4": ["ios", "tvos"], + ] + ) + proj.add(object: exceptionSet) + + let (_, plistValue) = try exceptionSet.plistKeyAndValue(proj: proj, reference: "ref") + + let dict = try XCTUnwrap(plistValue.dictionary?[CommentedString("platformFiltersByRelativePath")]?.dictionary) + XCTAssertEqual( + dict[CommentedString("Resources/ios_only.mp4")], + .array([.string(CommentedString("ios"))]) + ) + XCTAssertEqual( + dict[CommentedString("Resources/multi.mp4")], + .array([.string(CommentedString("ios")), .string(CommentedString("tvos"))]) + ) + } + + func test_plistKeyAndValue_platformFiltersByRelativePath_omittedWhenNil() throws { + let proj = PBXProj() + let exceptionSet = PBXFileSystemSynchronizedBuildFileExceptionSet.fixture( + target: target, + platformFiltersByRelativePath: nil + ) + proj.add(object: exceptionSet) + + let (_, plistValue) = try exceptionSet.plistKeyAndValue(proj: proj, reference: "ref") + + XCTAssertNil(plistValue.dictionary?[CommentedString("platformFiltersByRelativePath")]) + } } From a41b0637a995d81e086ce7ec9a50d469a542115c Mon Sep 17 00:00:00 2001 From: fortmarek <9371695+fortmarek@users.noreply.github.com> Date: Fri, 20 Feb 2026 11:00:50 +0000 Subject: [PATCH 590/678] [Release] XcodeProj 9.8.0 --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 69abf1ce7..0ac59b719 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,11 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [9.8.0] - 2026-02-20 +### Details +#### Features +- Add platformFiltersByRelativePath to PBXFileSystemSynchronizedBuildFileExceptionSet by @fortmarek in [#1065](https://github.com/tuist/XcodeProj/pull/1065) + ## [9.7.2] - 2025-12-30 ### Details #### Documentation @@ -233,6 +238,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Disable the renovatebot dashboard by @pepicrft in [#840](https://github.com/tuist/XcodeProj/pull/840) - Set up SwiftLint and SwiftFormat, run them against the project, and run them as part of the CI workflows by @pepicrft in [#836](https://github.com/tuist/XcodeProj/pull/836) +[9.8.0]: https://github.com/tuist/XcodeProj/compare/9.7.2..9.8.0 [9.7.2]: https://github.com/tuist/XcodeProj/compare/9.7.1..9.7.2 [9.7.1]: https://github.com/tuist/XcodeProj/compare/9.7.0..9.7.1 [9.7.0]: https://github.com/tuist/XcodeProj/compare/9.6.0..9.7.0 From e5e0f1b0db4d8cbaedc55d9c14bbdf48d9dfe6ca Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 20 Feb 2026 17:04:05 +0000 Subject: [PATCH 591/678] chore(deps): update dependency tuist to v4.150.0 (#1064) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise.toml b/.mise.toml index 34a6a4b79..106f57eed 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,5 +1,5 @@ [tools] swiftformat = "0.54.3" -tuist = "4.148.4" +tuist = "4.150.0" swiftlint = "0.63.2" "git-cliff" = "2.4.0" From 8aed1735f8522a2e1ae8fe6cc9466bde3e70f12b Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 23 Feb 2026 21:20:01 +0000 Subject: [PATCH 592/678] chore(deps): update dependency tuist to v4.151.1 (#1068) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise.toml b/.mise.toml index 106f57eed..eb1872eb5 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,5 +1,5 @@ [tools] swiftformat = "0.54.3" -tuist = "4.150.0" +tuist = "4.151.1" swiftlint = "0.63.2" "git-cliff" = "2.4.0" From 54b7205c292fe28e3a818f38d3270b579d71586e Mon Sep 17 00:00:00 2001 From: "Mateusz Kosikowski, PhD" Date: Tue, 24 Feb 2026 09:04:20 +0000 Subject: [PATCH 593/678] feat: add delete support for XCLocalSwiftPackageReference (#1044) * Add delete support for XCLocalSwiftPackageReference The delete method in PBXObjects was missing support for XCLocalSwiftPackageReference, causing local package references to remain as orphaned objects in the pbxproj when switching from local back to remote packages. This adds handling for localSwiftPackageReferences in the delete method, matching the existing pattern for remoteSwiftPackageReferences. * Add tests for XCLocalSwiftPackageReference add/delete operations Tests verify that: - Adding a local package reference to PBXProj works correctly - Deleting a local package reference removes it from PBXProj - Deleting one of multiple local packages removes only the correct one - Deleting an object not in the project is a no-op --------- Co-authored-by: Kosikowski <8352262+Kosikowski@users.noreply.github.com> --- .../Objects/Project/PBXObjects.swift | 2 + .../XCLocalSwiftPackageReferenceTests.swift | 70 +++++++++++++++++++ 2 files changed, 72 insertions(+) diff --git a/Sources/XcodeProj/Objects/Project/PBXObjects.swift b/Sources/XcodeProj/Objects/Project/PBXObjects.swift index 70083a779..67388444b 100644 --- a/Sources/XcodeProj/Objects/Project/PBXObjects.swift +++ b/Sources/XcodeProj/Objects/Project/PBXObjects.swift @@ -298,6 +298,8 @@ class PBXObjects: Equatable { return _buildRules.remove(at: index).value } else if let index = remoteSwiftPackageReferences.index(forKey: reference) { return _remoteSwiftPackageReferences.remove(at: index).value + } else if let index = localSwiftPackageReferences.index(forKey: reference) { + return _localSwiftPackageReferences.remove(at: index).value } else if let index = swiftPackageProductDependencies.index(forKey: reference) { return _swiftPackageProductDependencies.remove(at: index).value } else if let index = fileSystemSynchronizedRootGroups.index(forKey: reference) { diff --git a/Tests/XcodeProjTests/Objects/SwiftPackage/XCLocalSwiftPackageReferenceTests.swift b/Tests/XcodeProjTests/Objects/SwiftPackage/XCLocalSwiftPackageReferenceTests.swift index 17d28f42e..1ad9d94f4 100644 --- a/Tests/XcodeProjTests/Objects/SwiftPackage/XCLocalSwiftPackageReferenceTests.swift +++ b/Tests/XcodeProjTests/Objects/SwiftPackage/XCLocalSwiftPackageReferenceTests.swift @@ -51,4 +51,74 @@ final class XCLocalSwiftPackageReferenceTests: XCTestCase { // Then XCTAssertEqual(subject.name, "tuist/xcodeproj") } + + // MARK: - Add/Delete Tests + + func test_add_addsObjectToPBXProj() { + // Given + let proj = PBXProj.fixture(rootObject: nil, objects: []) + let localPackage = XCLocalSwiftPackageReference(relativePath: "../MyPackage") + + // When + proj.add(object: localPackage) + + // Then + XCTAssertEqual(proj.objects.localSwiftPackageReferences.count, 1) + XCTAssertEqual(proj.objects.localSwiftPackageReferences.values.first?.relativePath, "../MyPackage") + } + + func test_delete_removesObjectFromPBXProj() { + // Given + let proj = PBXProj.fixture(rootObject: nil, objects: []) + let localPackage = XCLocalSwiftPackageReference(relativePath: "../MyPackage") + proj.add(object: localPackage) + + // Verify it was added + XCTAssertEqual(proj.objects.localSwiftPackageReferences.count, 1) + + // When + proj.delete(object: localPackage) + + // Then + XCTAssertEqual(proj.objects.localSwiftPackageReferences.count, 0) + } + + func test_delete_removesCorrectObject_whenMultipleExist() { + // Given + let proj = PBXProj.fixture(rootObject: nil, objects: []) + let localPackage1 = XCLocalSwiftPackageReference(relativePath: "../Package1") + let localPackage2 = XCLocalSwiftPackageReference(relativePath: "../Package2") + let localPackage3 = XCLocalSwiftPackageReference(relativePath: "../Package3") + proj.add(object: localPackage1) + proj.add(object: localPackage2) + proj.add(object: localPackage3) + + // Verify all were added + XCTAssertEqual(proj.objects.localSwiftPackageReferences.count, 3) + + // When - delete the middle one + proj.delete(object: localPackage2) + + // Then + XCTAssertEqual(proj.objects.localSwiftPackageReferences.count, 2) + let remainingPaths = proj.objects.localSwiftPackageReferences.values.map(\.relativePath) + XCTAssertTrue(remainingPaths.contains("../Package1")) + XCTAssertTrue(remainingPaths.contains("../Package3")) + XCTAssertFalse(remainingPaths.contains("../Package2")) + } + + func test_delete_doesNothing_whenObjectNotInProj() { + // Given + let proj = PBXProj.fixture(rootObject: nil, objects: []) + let addedPackage = XCLocalSwiftPackageReference(relativePath: "../AddedPackage") + let notAddedPackage = XCLocalSwiftPackageReference(relativePath: "../NotAddedPackage") + proj.add(object: addedPackage) + + // When - try to delete an object that was never added + proj.delete(object: notAddedPackage) + + // Then - the added package should still be there + XCTAssertEqual(proj.objects.localSwiftPackageReferences.count, 1) + XCTAssertEqual(proj.objects.localSwiftPackageReferences.values.first?.relativePath, "../AddedPackage") + } } From 77ee0721798186f71b7ee8f7e29be8495d28360f Mon Sep 17 00:00:00 2001 From: fortmarek <9371695+fortmarek@users.noreply.github.com> Date: Tue, 24 Feb 2026 09:04:38 +0000 Subject: [PATCH 594/678] [Release] XcodeProj 9.9.0 --- CHANGELOG.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0ac59b719..4f61fd562 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [9.9.0] - 2026-02-24 +### Details +#### Features +- Add delete support for XCLocalSwiftPackageReference by @Kosikowski in [#1044](https://github.com/tuist/XcodeProj/pull/1044) + +## New Contributors +* @Kosikowski made their first contribution in [#1044](https://github.com/tuist/XcodeProj/pull/1044) ## [9.8.0] - 2026-02-20 ### Details #### Features @@ -238,6 +245,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Disable the renovatebot dashboard by @pepicrft in [#840](https://github.com/tuist/XcodeProj/pull/840) - Set up SwiftLint and SwiftFormat, run them against the project, and run them as part of the CI workflows by @pepicrft in [#836](https://github.com/tuist/XcodeProj/pull/836) +[9.9.0]: https://github.com/tuist/XcodeProj/compare/9.8.0..9.9.0 [9.8.0]: https://github.com/tuist/XcodeProj/compare/9.7.2..9.8.0 [9.7.2]: https://github.com/tuist/XcodeProj/compare/9.7.1..9.7.2 [9.7.1]: https://github.com/tuist/XcodeProj/compare/9.7.0..9.7.1 From 64d256d3a5b65e5fae1f781a9def822348bdb2c1 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 24 Feb 2026 23:04:15 +0000 Subject: [PATCH 595/678] chore(deps): update dependency tuist to v4.152.0 (#1069) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise.toml b/.mise.toml index eb1872eb5..ee368e747 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,5 +1,5 @@ [tools] swiftformat = "0.54.3" -tuist = "4.151.1" +tuist = "4.152.0" swiftlint = "0.63.2" "git-cliff" = "2.4.0" From 0af488cbdb7237cefe4291435ccfc6e680da905a Mon Sep 17 00:00:00 2001 From: Kirill Gusev <115743784+myaumura@users.noreply.github.com> Date: Thu, 26 Feb 2026 19:58:45 +0300 Subject: [PATCH 596/678] feat: Added support for Xcode 26's `dstSubfolder` (#1038) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: Added dstSubfolder * fix: preserve PBXCopyFilesBuildPhase source compatibility and round-trip --------- Co-authored-by: Pedro Piñera --- .../BuildPhase/PBXCopyFilesBuildPhase.swift | 71 +++++++++++++++++++ .../Objects/Sourcery/Equality.generated.swift | 1 + .../PBXCopyFilesBuildPhaseTests.swift | 43 +++++++++++ 3 files changed, 115 insertions(+) diff --git a/Sources/XcodeProj/Objects/BuildPhase/PBXCopyFilesBuildPhase.swift b/Sources/XcodeProj/Objects/BuildPhase/PBXCopyFilesBuildPhase.swift index 0fa51e1cf..58f8817bf 100644 --- a/Sources/XcodeProj/Objects/BuildPhase/PBXCopyFilesBuildPhase.swift +++ b/Sources/XcodeProj/Objects/BuildPhase/PBXCopyFilesBuildPhase.swift @@ -16,6 +16,67 @@ public final class PBXCopyFilesBuildPhase: PBXBuildPhase { case other } + public enum DstSubfolder: Equatable, Decodable { + case absolutePath + case productsDirectory + case wrapper + case executables + case resources + case javaResources + case frameworks + case sharedFrameworks + case sharedSupport + case plugins + case other + case product + case none + case unknown(String) + + public init(rawValue: String) { + switch rawValue { + case "AbsolutePath": self = .absolutePath + case "ProductsDirectory": self = .productsDirectory + case "Wrapper": self = .wrapper + case "Executables": self = .executables + case "Resources": self = .resources + case "JavaResources": self = .javaResources + case "Frameworks": self = .frameworks + case "SharedFrameworks": self = .sharedFrameworks + case "SharedSupport": self = .sharedSupport + case "PlugIns": self = .plugins + case "Other": self = .other + case "Product": self = .product + case "None": self = .none + default: self = .unknown(rawValue) + } + } + + public var rawValue: String { + switch self { + case .absolutePath: "AbsolutePath" + case .productsDirectory: "ProductsDirectory" + case .wrapper: "Wrapper" + case .executables: "Executables" + case .resources: "Resources" + case .javaResources: "JavaResources" + case .frameworks: "Frameworks" + case .sharedFrameworks: "SharedFrameworks" + case .sharedSupport: "SharedSupport" + case .plugins: "PlugIns" + case .other: "Other" + case .product: "Product" + case .none: "None" + case let .unknown(rawValue): rawValue + } + } + + public init(from decoder: Decoder) throws { + let container = try decoder.singleValueContainer() + let rawValue = try container.decode(String.self) + self = .init(rawValue: rawValue) + } + } + // MARK: - Attributes /// Element destination path @@ -24,6 +85,8 @@ public final class PBXCopyFilesBuildPhase: PBXBuildPhase { /// Element destination subfolder spec public var dstSubfolderSpec: SubFolder? + public var dstSubfolder: DstSubfolder? + /// Copy files build phase name public var name: String? @@ -38,17 +101,20 @@ public final class PBXCopyFilesBuildPhase: PBXBuildPhase { /// - Parameters: /// - dstPath: Destination path. /// - dstSubfolderSpec: Destination subfolder spec. + /// - dstSubfolder: Destination subfolder. /// - buildActionMask: Build action mask. /// - files: Build files to copy. /// - runOnlyForDeploymentPostprocessing: Run only for deployment post processing. public init(dstPath: String? = nil, dstSubfolderSpec: SubFolder? = nil, + dstSubfolder: DstSubfolder? = nil, name: String? = nil, buildActionMask: UInt = defaultBuildActionMask, files: [PBXBuildFile] = [], runOnlyForDeploymentPostprocessing: Bool = false) { self.dstPath = dstPath self.dstSubfolderSpec = dstSubfolderSpec + self.dstSubfolder = dstSubfolder self.name = name super.init(files: files, buildActionMask: buildActionMask, @@ -61,6 +127,7 @@ public final class PBXCopyFilesBuildPhase: PBXBuildPhase { fileprivate enum CodingKeys: String, CodingKey { case dstPath case dstSubfolderSpec + case dstSubfolder case name } @@ -68,6 +135,7 @@ public final class PBXCopyFilesBuildPhase: PBXBuildPhase { let container = try decoder.container(keyedBy: CodingKeys.self) dstPath = try container.decodeIfPresent(.dstPath) dstSubfolderSpec = try container.decodeIntIfPresent(.dstSubfolderSpec).flatMap(SubFolder.init) + dstSubfolder = try container.decodeIfPresent(.dstSubfolder) name = try container.decodeIfPresent(.name) try super.init(from: decoder) } @@ -93,6 +161,9 @@ extension PBXCopyFilesBuildPhase: PlistSerializable { if let dstSubfolderSpec { dictionary["dstSubfolderSpec"] = .string(CommentedString("\(dstSubfolderSpec.rawValue)")) } + if let dstSubfolder { + dictionary["dstSubfolder"] = .string(CommentedString("\(dstSubfolder.rawValue)")) + } return (key: CommentedString(reference, comment: name ?? "CopyFiles"), value: .dictionary(dictionary)) } } diff --git a/Sources/XcodeProj/Objects/Sourcery/Equality.generated.swift b/Sources/XcodeProj/Objects/Sourcery/Equality.generated.swift index 016c323ca..49fe28bb7 100644 --- a/Sources/XcodeProj/Objects/Sourcery/Equality.generated.swift +++ b/Sources/XcodeProj/Objects/Sourcery/Equality.generated.swift @@ -75,6 +75,7 @@ extension PBXCopyFilesBuildPhase { func isEqual(to rhs: PBXCopyFilesBuildPhase) -> Bool { if dstPath != rhs.dstPath { return false } if dstSubfolderSpec != rhs.dstSubfolderSpec { return false } + if dstSubfolder != rhs.dstSubfolder { return false } if name != rhs.name { return false } return super.isEqual(to: rhs) } diff --git a/Tests/XcodeProjTests/Objects/BuildPhase/PBXCopyFilesBuildPhaseTests.swift b/Tests/XcodeProjTests/Objects/BuildPhase/PBXCopyFilesBuildPhaseTests.swift index 9d1d6c506..e809f2952 100644 --- a/Tests/XcodeProjTests/Objects/BuildPhase/PBXCopyFilesBuildPhaseTests.swift +++ b/Tests/XcodeProjTests/Objects/BuildPhase/PBXCopyFilesBuildPhaseTests.swift @@ -76,6 +76,29 @@ final class PBXCopyFilesBuildPhaseTests: XCTestCase { } catch {} } + func test_init_decodesDstSubfolder() { + var dictionary = testDictionary() + dictionary["dstSubfolder"] = "Frameworks" + let data = try! JSONSerialization.data(withJSONObject: dictionary, options: []) + let decoder = XcodeprojJSONDecoder() + do { + let phase = try decoder.decode(PBXCopyFilesBuildPhase.self, from: data) + XCTAssertEqual(phase.dstSubfolder, .frameworks) + } catch {} + } + + func test_init_decodesUnknownDstSubfolder() { + var dictionary = testDictionary() + dictionary["dstSubfolder"] = "InvalidSubfolder" + let data = try! JSONSerialization.data(withJSONObject: dictionary, options: []) + let decoder = XcodeprojJSONDecoder() + do { + let phase = try decoder.decode(PBXCopyFilesBuildPhase.self, from: data) + XCTAssertEqual(phase.dstSubfolder, .unknown("InvalidSubfolder")) + XCTAssertEqual(phase.dstSubfolder?.rawValue, "InvalidSubfolder") + } catch {} + } + func test_init_fails_whenFilesIsMissing() { var dictionary = testDictionary() dictionary.removeValue(forKey: "files") @@ -102,6 +125,26 @@ final class PBXCopyFilesBuildPhaseTests: XCTestCase { XCTAssertEqual(PBXCopyFilesBuildPhase.isa, "PBXCopyFilesBuildPhase") } + func test_equal_whenDstSubfolderIsDifferent_returnsFalse() { + let lhs = PBXCopyFilesBuildPhase(dstPath: "dstPath", + dstSubfolderSpec: .frameworks, + dstSubfolder: .frameworks, + name: "Copy") + let rhs = PBXCopyFilesBuildPhase(dstPath: "dstPath", + dstSubfolderSpec: .frameworks, + dstSubfolder: .resources, + name: "Copy") + XCTAssertNotEqual(lhs, rhs) + } + + func test_write_preservesUnknownDstSubfolderRawValue() throws { + let subject = PBXCopyFilesBuildPhase(dstSubfolder: .unknown("InvalidSubfolder")) + let proj = PBXProj.fixture() + let (_, plistValue) = try subject.plistKeyAndValue(proj: proj, reference: "ref") + + XCTAssertEqual(plistValue.dictionary?["dstSubfolder"]?.string, "InvalidSubfolder") + } + func testDictionary() -> [String: Any] { [ "dstPath": "dstPath", From 01fbdd7ac96428c019c44f84e613c9bef9b4a3a2 Mon Sep 17 00:00:00 2001 From: pepicrft <663605+pepicrft@users.noreply.github.com> Date: Thu, 26 Feb 2026 16:59:05 +0000 Subject: [PATCH 597/678] [Release] XcodeProj 9.10.0 --- CHANGELOG.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4f61fd562..d5bc1842c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [9.10.0] - 2026-02-26 +### Details +#### Features +- Added support for Xcode 26's `dstSubfolder` by @myaumura in [#1038](https://github.com/tuist/XcodeProj/pull/1038) + +## New Contributors +* @myaumura made their first contribution in [#1038](https://github.com/tuist/XcodeProj/pull/1038) ## [9.9.0] - 2026-02-24 ### Details #### Features @@ -245,6 +252,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Disable the renovatebot dashboard by @pepicrft in [#840](https://github.com/tuist/XcodeProj/pull/840) - Set up SwiftLint and SwiftFormat, run them against the project, and run them as part of the CI workflows by @pepicrft in [#836](https://github.com/tuist/XcodeProj/pull/836) +[9.10.0]: https://github.com/tuist/XcodeProj/compare/9.9.0..9.10.0 [9.9.0]: https://github.com/tuist/XcodeProj/compare/9.8.0..9.9.0 [9.8.0]: https://github.com/tuist/XcodeProj/compare/9.7.2..9.8.0 [9.7.2]: https://github.com/tuist/XcodeProj/compare/9.7.1..9.7.2 From 2832e796713199c71d01a2a12632cd5900a5c63d Mon Sep 17 00:00:00 2001 From: Christian Date: Thu, 26 Feb 2026 20:12:35 +0300 Subject: [PATCH 598/678] perf: optimized validString in CommentedString (#1067) * Optimized CommentedString * updated minimum macos version in Package.swift * remove macos version check and make variable names more meaningful * fix lint issues --- Package.swift | 1 + .../XcodeProj/Utils/Collection+Extras.swift | 34 ++++ Sources/XcodeProj/Utils/CommentedString.swift | 185 ++++++++++++++---- 3 files changed, 186 insertions(+), 34 deletions(-) create mode 100644 Sources/XcodeProj/Utils/Collection+Extras.swift diff --git a/Package.swift b/Package.swift index fe5447e8e..acc91a1be 100644 --- a/Package.swift +++ b/Package.swift @@ -4,6 +4,7 @@ import PackageDescription let package = Package( name: "XcodeProj", + platforms: [.macOS(.v11)], products: [ .library(name: "XcodeProj", targets: ["XcodeProj"]), ], diff --git a/Sources/XcodeProj/Utils/Collection+Extras.swift b/Sources/XcodeProj/Utils/Collection+Extras.swift new file mode 100644 index 000000000..c332d2ce3 --- /dev/null +++ b/Sources/XcodeProj/Utils/Collection+Extras.swift @@ -0,0 +1,34 @@ +extension Collection where Element: BinaryInteger, Index == Int { + @inlinable + @inline(__always) + func containsCString(_ cString: T) -> Bool where T.Element: BinaryInteger, T.Index == Int { + guard !cString.isEmpty else { return true } + + // Drop null terminator if present + let subarrayCount = cString.last == 0 + ? cString.count - 1 + : cString.count + + guard subarrayCount <= count else { return false } + + let lastSubarrayStartingPos = count - subarrayCount + var i = 0 + while i <= lastSubarrayStartingPos { + var match = true + var j = 0 + while j < subarrayCount { + if self[i + j] != cString[j] { + match = false + break + } + j += 1 + } + if match { + return true + } + + i += 1 + } + return false + } +} diff --git a/Sources/XcodeProj/Utils/CommentedString.swift b/Sources/XcodeProj/Utils/CommentedString.swift index 2420f8e05..278214517 100644 --- a/Sources/XcodeProj/Utils/CommentedString.swift +++ b/Sources/XcodeProj/Utils/CommentedString.swift @@ -1,5 +1,31 @@ import Foundation +private extension UInt8 { + static let tab: UInt8 = 9 // '\t' + static let newline: UInt8 = 10 // '\n' + static let backslash: UInt8 = 92 // '\' + static let underscore: UInt8 = 95 // '_' + static let doubleQuotes: UInt8 = 34 // '"' + static let dollar: UInt8 = 36 // '$' + static let slash: UInt8 = 47 // '/' + + static let dot: UInt8 = 46 // '.' + static let nine: UInt8 = 57 // '9' + + static let capitalA: UInt8 = 65 // 'A' + static let capitalZ: UInt8 = 90 // 'Z' + + static let smallA: UInt8 = 97 // 'a' + static let smallN: UInt8 = 110 // 'n' + static let smallT: UInt8 = 116 // 't' + static let smallZ: UInt8 = 122 // 'z' +} + +private extension ContiguousArray { + static let slashesUTF8CString = "//".utf8CString + static let threeUnderscoresUTF8CString = "___".utf8CString +} + /// String that includes a comment struct CommentedString { /// Entity string value. @@ -18,19 +44,6 @@ struct CommentedString { self.comment = comment } - /// Set of characters that are invalid. - private static let invalidCharacters: CharacterSet = { - var invalidSet = CharacterSet(charactersIn: "_$") - invalidSet.insert(charactersIn: UnicodeScalar(".") ... UnicodeScalar("9")) - invalidSet.insert(charactersIn: UnicodeScalar("A") ... UnicodeScalar("Z")) - invalidSet.insert(charactersIn: UnicodeScalar("a") ... UnicodeScalar("z")) - invalidSet.invert() - return invalidSet - }() - - /// Set of characters that are invalid. - private static let specialCheckCharacters = CharacterSet(charactersIn: "_/") - /// Returns a valid string for Xcode projects. var validString: String { switch string { @@ -40,31 +53,31 @@ struct CommentedString { default: break } - if string.rangeOfCharacter(from: CommentedString.invalidCharacters) == nil { - if string.rangeOfCharacter(from: CommentedString.specialCheckCharacters) == nil { - return string - } else if !string.contains("//"), !string.contains("___") { - return string + var str = string + return str.withUTF8 { buffer -> String in + let containsInvalidCharacters = buffer.containsInvalidCharacters + + if !containsInvalidCharacters() { + let containsSpecialCheckCharacters = buffer.containsSpecialCheckCharacters() + + if !containsSpecialCheckCharacters { + return string + } else if !buffer.containsCString(ContiguousArray.slashesUTF8CString), + !buffer.containsCString(ContiguousArray.threeUnderscoresUTF8CString) { + return string + } } - } - let escaped = string.reduce(into: "") { escaped, character in - // As an optimization, only look at the first scalar. This means we're doing a numeric comparison instead - // of comparing arbitrary-length characters. This is safe because all our cases are a single scalar. - switch character.unicodeScalars.first { - case "\\": - escaped.append("\\\\") - case "\"": - escaped.append("\\\"") - case "\t": - escaped.append("\\t") - case "\n": - escaped.append("\\n") - default: - escaped.append(character) + // calculate exact size + let escapedCapacity = buffer.escapedCommentCapacity() + + // write directly into String storage + return String(unsafeUninitializedCapacity: escapedCapacity) { stringBuffer in + stringBuffer.fillValidString(from: buffer) + + return escapedCapacity } } - return "\"\(escaped)\"" } } @@ -95,3 +108,107 @@ extension CommentedString: ExpressibleByStringLiteral { self.init(value) } } + +// MARK: - Private + +private extension UnsafeMutableBufferPointer { + /// Fills preallocated `UnsafeBufferPointer` + func fillValidString(from buffer: UnsafeBufferPointer) { + var outIndex = 0 + + self[outIndex] = .doubleQuotes + outIndex += 1 + + for character in buffer { + switch character { + case .backslash: + self[outIndex] = .backslash + self[outIndex + 1] = .backslash + outIndex += 2 + + case .doubleQuotes: + self[outIndex] = .backslash + self[outIndex + 1] = .doubleQuotes + outIndex += 2 + + case .tab: + self[outIndex] = .backslash + self[outIndex + 1] = .smallT + outIndex += 2 + + case .newline: + self[outIndex] = .backslash + self[outIndex + 1] = .smallN + outIndex += 2 + + default: + self[outIndex] = character + outIndex += 1 + } + } + + self[outIndex] = .doubleQuotes + } +} + +private extension UnsafeBufferPointer { + /// Valid characters are: + /// 1. `_` and `$` + /// 2. `.`...`9` + /// 3. `A`...`Z` + /// 4. `a`...`z` + func containsInvalidCharacters() -> Bool { + for character in self { + // character == '_' || character == '$' + if character == .underscore || character == .dollar { + continue + } + // character >= '.' && character <= '9' + if character >= .dot, character <= .nine { + continue + } + // character >= 'A' && character <= 'Z' + if character >= .capitalA, character <= .capitalZ { + continue + } + // character >= 'a' && character <= 'z' + if character >= .smallA, character <= .smallZ { + continue + } + + return true + } + + return false + } + + /// Special check characters are `_` and `/` + func containsSpecialCheckCharacters() -> Bool { + for character in self { + if character == .underscore || character == .slash { + return true + } + } + + return false + } + + /// Calculates escaped string size + /// Basically, `count + count(where: { [.backslash, .doubleQuotes, .tab, .newline].contains($0) }` + func escapedCommentCapacity() -> Int { + var escapeCount = 0 + + for character in self { + switch character { + case .backslash, .doubleQuotes, .tab, .newline: + escapeCount += 1 // each adds one extra byte + default: + break + } + } + + return count // original bytes + + escapeCount // extra escape bytes + + 2 // surrounding quotes + } +} From 01bb77000bc8c23a09ea2058f4954612f03cb705 Mon Sep 17 00:00:00 2001 From: fortmarek <9371695+fortmarek@users.noreply.github.com> Date: Thu, 26 Feb 2026 17:12:57 +0000 Subject: [PATCH 599/678] [Release] XcodeProj 9.10.1 --- CHANGELOG.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d5bc1842c..1ade24a9a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [9.10.1] - 2026-02-26 +### Details +#### Performance +- Optimized validString in CommentedString by @ChrisBenua in [#1067](https://github.com/tuist/XcodeProj/pull/1067) + +## New Contributors +* @ChrisBenua made their first contribution in [#1067](https://github.com/tuist/XcodeProj/pull/1067) ## [9.10.0] - 2026-02-26 ### Details #### Features @@ -252,6 +259,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Disable the renovatebot dashboard by @pepicrft in [#840](https://github.com/tuist/XcodeProj/pull/840) - Set up SwiftLint and SwiftFormat, run them against the project, and run them as part of the CI workflows by @pepicrft in [#836](https://github.com/tuist/XcodeProj/pull/836) +[9.10.1]: https://github.com/tuist/XcodeProj/compare/9.10.0..9.10.1 [9.10.0]: https://github.com/tuist/XcodeProj/compare/9.9.0..9.10.0 [9.9.0]: https://github.com/tuist/XcodeProj/compare/9.8.0..9.9.0 [9.8.0]: https://github.com/tuist/XcodeProj/compare/9.7.2..9.8.0 From 033b717624cbbe2dc3dcc8016c8b53986956276b Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 28 Feb 2026 21:39:13 +0000 Subject: [PATCH 600/678] chore(deps): update dependency tuist to v4.153.0 (#1070) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise.toml b/.mise.toml index ee368e747..dbdc1839a 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,5 +1,5 @@ [tools] swiftformat = "0.54.3" -tuist = "4.152.0" +tuist = "4.153.0" swiftlint = "0.63.2" "git-cliff" = "2.4.0" From b62b25549fe19ba478d4941ee788ca20000d61b7 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 3 Mar 2026 05:20:57 +0000 Subject: [PATCH 601/678] chore(deps): update dependency tuist to v4.153.1 (#1071) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise.toml b/.mise.toml index dbdc1839a..ceca074a5 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,5 +1,5 @@ [tools] swiftformat = "0.54.3" -tuist = "4.153.0" +tuist = "4.153.1" swiftlint = "0.63.2" "git-cliff" = "2.4.0" From 7ef50d01e272a363686ac46bd45b872618d11d52 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 4 Mar 2026 17:31:32 +0000 Subject: [PATCH 602/678] chore(deps): update dependency tuist to v4.154.5 (#1072) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise.toml b/.mise.toml index ceca074a5..5635ab891 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,5 +1,5 @@ [tools] swiftformat = "0.54.3" -tuist = "4.153.1" +tuist = "4.154.5" swiftlint = "0.63.2" "git-cliff" = "2.4.0" From 8f621560d1459a802758cc4cf24924ae4083448f Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 5 Mar 2026 01:02:19 +0000 Subject: [PATCH 603/678] chore(deps): update dependency tuist to v4.155.0 (#1073) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise.toml b/.mise.toml index 5635ab891..e006f3899 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,5 +1,5 @@ [tools] swiftformat = "0.54.3" -tuist = "4.154.5" +tuist = "4.155.0" swiftlint = "0.63.2" "git-cliff" = "2.4.0" From 2d95c03a10ee40ef4f092df4f68da17e7dcb7a5f Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 5 Mar 2026 23:35:56 +0000 Subject: [PATCH 604/678] chore(deps): update dependency tuist to v4.155.1 (#1074) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise.toml b/.mise.toml index e006f3899..a9a729319 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,5 +1,5 @@ [tools] swiftformat = "0.54.3" -tuist = "4.155.0" +tuist = "4.155.1" swiftlint = "0.63.2" "git-cliff" = "2.4.0" From 26ffeace1ad4592a56189dea48c69506fba79817 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 7 Mar 2026 02:56:42 +0000 Subject: [PATCH 605/678] chore(deps): update dependency tuist to v4.155.3 (#1075) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise.toml b/.mise.toml index a9a729319..a6a81d35d 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,5 +1,5 @@ [tools] swiftformat = "0.54.3" -tuist = "4.155.1" +tuist = "4.155.3" swiftlint = "0.63.2" "git-cliff" = "2.4.0" From 518eace2d51056afe97d9ff6f68b1a049bd8f1a8 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 9 Mar 2026 21:58:33 +0000 Subject: [PATCH 606/678] chore(deps): update dependency tuist to v4.155.4 (#1076) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise.toml b/.mise.toml index a6a81d35d..c6ead4b65 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,5 +1,5 @@ [tools] swiftformat = "0.54.3" -tuist = "4.155.3" +tuist = "4.155.4" swiftlint = "0.63.2" "git-cliff" = "2.4.0" From c8895bec24965d9d325a6a47134f7b0eb8c88391 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 11 Mar 2026 03:38:46 +0000 Subject: [PATCH 607/678] chore(deps): update dependency tuist to v4.156.0 (#1077) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise.toml b/.mise.toml index c6ead4b65..226ace3ea 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,5 +1,5 @@ [tools] swiftformat = "0.54.3" -tuist = "4.155.4" +tuist = "4.156.0" swiftlint = "0.63.2" "git-cliff" = "2.4.0" From dc1c89fe4d933aa113f06058578e6c70c2874798 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 13 Mar 2026 01:55:03 +0000 Subject: [PATCH 608/678] chore(deps): update dependency tuist to v4.157.3 (#1079) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise.toml b/.mise.toml index 226ace3ea..fcd5953e6 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,5 +1,5 @@ [tools] swiftformat = "0.54.3" -tuist = "4.156.0" +tuist = "4.157.3" swiftlint = "0.63.2" "git-cliff" = "2.4.0" From 87d440ca90e26d59c79aaad7690e62a639da02aa Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 13 Mar 2026 22:33:19 +0000 Subject: [PATCH 609/678] chore(deps): update dependency tuist to v4.158.2 (#1080) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise.toml b/.mise.toml index fcd5953e6..5542c47f2 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,5 +1,5 @@ [tools] swiftformat = "0.54.3" -tuist = "4.157.3" +tuist = "4.158.2" swiftlint = "0.63.2" "git-cliff" = "2.4.0" From 0e7ec2812f3ff17501f769e4d7526c358bce2a38 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 18 Mar 2026 01:40:23 +0000 Subject: [PATCH 610/678] chore(deps): update dependency tuist to v4.160.0 (#1082) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise.toml b/.mise.toml index 5542c47f2..2af71bf54 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,5 +1,5 @@ [tools] swiftformat = "0.54.3" -tuist = "4.158.2" +tuist = "4.160.0" swiftlint = "0.63.2" "git-cliff" = "2.4.0" From f1cae489876df851293045a4f78a8ac257ee037b Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 19 Mar 2026 01:43:17 +0000 Subject: [PATCH 611/678] chore(deps): update dependency tuist to v4.161.0 (#1083) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise.toml b/.mise.toml index 2af71bf54..b57298069 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,5 +1,5 @@ [tools] swiftformat = "0.54.3" -tuist = "4.160.0" +tuist = "4.161.0" swiftlint = "0.63.2" "git-cliff" = "2.4.0" From 0e11a4f3c487e85c3bd49558149ced99c9257b5f Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 20 Mar 2026 01:00:55 +0000 Subject: [PATCH 612/678] chore(deps): update dependency tuist to v4.162.0 (#1084) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise.toml b/.mise.toml index b57298069..f2d468fc0 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,5 +1,5 @@ [tools] swiftformat = "0.54.3" -tuist = "4.161.0" +tuist = "4.162.0" swiftlint = "0.63.2" "git-cliff" = "2.4.0" From 7b9dfcff9a3f904fd4f4bf20aad8a27f83649e45 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 20 Mar 2026 21:50:29 +0000 Subject: [PATCH 613/678] chore(deps): update dependency tuist to v4.162.1 (#1085) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise.toml b/.mise.toml index f2d468fc0..1fa93f74f 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,5 +1,5 @@ [tools] swiftformat = "0.54.3" -tuist = "4.162.0" +tuist = "4.162.1" swiftlint = "0.63.2" "git-cliff" = "2.4.0" From a4aed3ff3b1e179911c7b10c99eeaf8cc92d791c Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 24 Mar 2026 00:32:36 +0000 Subject: [PATCH 614/678] chore(deps): update dependency tuist to v4.163.1 (#1086) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise.toml b/.mise.toml index 1fa93f74f..bf279d3ae 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,5 +1,5 @@ [tools] swiftformat = "0.54.3" -tuist = "4.162.1" +tuist = "4.163.1" swiftlint = "0.63.2" "git-cliff" = "2.4.0" From d6d6a5cb4f4420e60e9e6ff70012c2b84401540c Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 24 Mar 2026 20:55:02 +0000 Subject: [PATCH 615/678] chore(deps): update dependency tuist to v4.166.0 (#1087) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise.toml b/.mise.toml index bf279d3ae..9d3017490 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,5 +1,5 @@ [tools] swiftformat = "0.54.3" -tuist = "4.163.1" +tuist = "4.166.0" swiftlint = "0.63.2" "git-cliff" = "2.4.0" From 8f9587fadc49e969642d24501bb60fb516c78827 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 25 Mar 2026 18:33:04 +0000 Subject: [PATCH 616/678] chore(deps): update dependency tuist to v4.167.0 (#1088) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise.toml b/.mise.toml index 9d3017490..d752844b7 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,5 +1,5 @@ [tools] swiftformat = "0.54.3" -tuist = "4.166.0" +tuist = "4.167.0" swiftlint = "0.63.2" "git-cliff" = "2.4.0" From 75a19775c4b2c0f96c30ef7162fc6a87be5c7278 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 26 Mar 2026 01:48:03 +0000 Subject: [PATCH 617/678] chore(deps): update dependency tuist to v4.168.0 (#1089) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise.toml b/.mise.toml index d752844b7..fb339231a 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,5 +1,5 @@ [tools] swiftformat = "0.54.3" -tuist = "4.167.0" +tuist = "4.168.0" swiftlint = "0.63.2" "git-cliff" = "2.4.0" From 89a4ceb9f33d1baee06c9ef72f4ccb984a47a1e3 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 26 Mar 2026 13:17:42 +0000 Subject: [PATCH 618/678] chore(deps): update dependency tuist to v4.169.0 (#1090) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise.toml b/.mise.toml index fb339231a..1f1c81927 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,5 +1,5 @@ [tools] swiftformat = "0.54.3" -tuist = "4.168.0" +tuist = "4.169.0" swiftlint = "0.63.2" "git-cliff" = "2.4.0" From 49a06bae70aa2debe9f66804eca5a6f351c2a7f9 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 26 Mar 2026 21:35:54 +0000 Subject: [PATCH 619/678] chore(deps): update dependency tuist to v4.169.1 (#1091) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise.toml b/.mise.toml index 1f1c81927..e96f7bccf 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,5 +1,5 @@ [tools] swiftformat = "0.54.3" -tuist = "4.169.0" +tuist = "4.169.1" swiftlint = "0.63.2" "git-cliff" = "2.4.0" From b8c2e918491093744ea28aed06e8bf5a0b4bdf7c Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 28 Mar 2026 01:17:15 +0000 Subject: [PATCH 620/678] chore(deps): update dependency tuist to v4.169.2 (#1092) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise.toml b/.mise.toml index e96f7bccf..f69de2e87 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,5 +1,5 @@ [tools] swiftformat = "0.54.3" -tuist = "4.169.1" +tuist = "4.169.2" swiftlint = "0.63.2" "git-cliff" = "2.4.0" From 274b63a37d68c354f5f2d649a34f473049319721 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 30 Mar 2026 00:59:52 +0000 Subject: [PATCH 621/678] chore(deps): update dependency tuist to v4.170.0 (#1094) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise.toml b/.mise.toml index f69de2e87..fb4655d91 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,5 +1,5 @@ [tools] swiftformat = "0.54.3" -tuist = "4.169.2" +tuist = "4.170.0" swiftlint = "0.63.2" "git-cliff" = "2.4.0" From 181e60e418eb3cb1afba9381d8d617d6a5a4ce94 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 30 Mar 2026 20:57:38 +0000 Subject: [PATCH 622/678] chore(deps): update dependency tuist to v4.171.2 (#1095) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise.toml b/.mise.toml index fb4655d91..370bd7e0b 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,5 +1,5 @@ [tools] swiftformat = "0.54.3" -tuist = "4.170.0" +tuist = "4.171.2" swiftlint = "0.63.2" "git-cliff" = "2.4.0" From c6348bcb27102fa7221e758c4f2ae1b1bbee2fb2 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 1 Apr 2026 01:21:33 +0000 Subject: [PATCH 623/678] chore(deps): update dependency tuist to v4.172.0 (#1096) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise.toml b/.mise.toml index 370bd7e0b..2b913cebe 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,5 +1,5 @@ [tools] swiftformat = "0.54.3" -tuist = "4.171.2" +tuist = "4.172.0" swiftlint = "0.63.2" "git-cliff" = "2.4.0" From 1c18994aefcd16c43b5335925ab02d21c19eeeef Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 1 Apr 2026 12:47:48 +0000 Subject: [PATCH 624/678] chore(deps): update dependency tuist to v4.172.1 (#1097) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise.toml b/.mise.toml index 2b913cebe..046d6bbac 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,5 +1,5 @@ [tools] swiftformat = "0.54.3" -tuist = "4.172.0" +tuist = "4.172.1" swiftlint = "0.63.2" "git-cliff" = "2.4.0" From 64910e8a8ee9e078cbdd61943940e3a1d6ccd442 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 2 Apr 2026 05:17:02 +0000 Subject: [PATCH 625/678] chore(deps): update dependency tuist to v4.174.1 (#1098) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise.toml b/.mise.toml index 046d6bbac..f3586744b 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,5 +1,5 @@ [tools] swiftformat = "0.54.3" -tuist = "4.172.1" +tuist = "4.174.1" swiftlint = "0.63.2" "git-cliff" = "2.4.0" From 9a7bc7a13002b99609a35588e30c5f81d663c036 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 2 Apr 2026 16:54:38 +0000 Subject: [PATCH 626/678] chore(deps): update dependency tuist to v4.174.2 (#1099) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise.toml b/.mise.toml index f3586744b..d3485a3ec 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,5 +1,5 @@ [tools] swiftformat = "0.54.3" -tuist = "4.174.1" +tuist = "4.174.2" swiftlint = "0.63.2" "git-cliff" = "2.4.0" From 9229b1aaf2ee3a7df8392ab08b180aa82d23fc00 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 8 Apr 2026 00:44:05 +0000 Subject: [PATCH 627/678] chore(deps): update dependency tuist to v4.175.0 (#1101) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise.toml b/.mise.toml index d3485a3ec..b9844b32d 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,5 +1,5 @@ [tools] swiftformat = "0.54.3" -tuist = "4.174.2" +tuist = "4.175.0" swiftlint = "0.63.2" "git-cliff" = "2.4.0" From af0232bb927f7ec184e6a228ab1bcdc817d4d107 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 9 Apr 2026 01:19:27 +0000 Subject: [PATCH 628/678] chore(deps): update dependency tuist to v4.176.2 (#1102) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise.toml b/.mise.toml index b9844b32d..e59d2bbf4 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,5 +1,5 @@ [tools] swiftformat = "0.54.3" -tuist = "4.175.0" +tuist = "4.176.2" swiftlint = "0.63.2" "git-cliff" = "2.4.0" From 14806e7f88ad0256d88b9fa9dbc17864f196c5fe Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 9 Apr 2026 13:21:01 +0000 Subject: [PATCH 629/678] chore(deps): update dependency tuist to v4.176.4 (#1103) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise.toml b/.mise.toml index e59d2bbf4..0fbfde521 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,5 +1,5 @@ [tools] swiftformat = "0.54.3" -tuist = "4.176.2" +tuist = "4.176.4" swiftlint = "0.63.2" "git-cliff" = "2.4.0" From 40e60ff84cda2c8bfbaf36b81184a54f5349096b Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 9 Apr 2026 20:32:07 +0000 Subject: [PATCH 630/678] chore(deps): update dependency tuist to v4.178.0 (#1104) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise.toml b/.mise.toml index 0fbfde521..9a94037e5 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,5 +1,5 @@ [tools] swiftformat = "0.54.3" -tuist = "4.176.4" +tuist = "4.178.0" swiftlint = "0.63.2" "git-cliff" = "2.4.0" From fcd9c0864aa910993c50b489d47a89acb70e43a8 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 10 Apr 2026 13:56:41 +0000 Subject: [PATCH 631/678] chore(deps): update dependency tuist to v4.178.1 (#1105) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise.toml b/.mise.toml index 9a94037e5..ae973545e 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,5 +1,5 @@ [tools] swiftformat = "0.54.3" -tuist = "4.178.0" +tuist = "4.178.1" swiftlint = "0.63.2" "git-cliff" = "2.4.0" From da669feea7ce1da071a863576644003414e0bec8 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 10 Apr 2026 21:28:57 +0000 Subject: [PATCH 632/678] chore(deps): update dependency tuist to v4.179.0 (#1106) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise.toml b/.mise.toml index ae973545e..584089b8a 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,5 +1,5 @@ [tools] swiftformat = "0.54.3" -tuist = "4.178.1" +tuist = "4.179.0" swiftlint = "0.63.2" "git-cliff" = "2.4.0" From d0f3c48210819c44e8155c1953863b1328d7aa3f Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 11 Apr 2026 09:14:09 +0000 Subject: [PATCH 633/678] chore(deps): update dependency tuist to v4.179.1 (#1107) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise.toml b/.mise.toml index 584089b8a..eeb8791ae 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,5 +1,5 @@ [tools] swiftformat = "0.54.3" -tuist = "4.179.0" +tuist = "4.179.1" swiftlint = "0.63.2" "git-cliff" = "2.4.0" From c60786d54233daa125ab006123d34b035f38c9c8 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 11 Apr 2026 16:57:59 +0000 Subject: [PATCH 634/678] chore(deps): update dependency tuist to v4.179.3 (#1108) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise.toml b/.mise.toml index eeb8791ae..5e8d6b561 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,5 +1,5 @@ [tools] swiftformat = "0.54.3" -tuist = "4.179.1" +tuist = "4.179.3" swiftlint = "0.63.2" "git-cliff" = "2.4.0" From 46fb0d788c4bc7fbc836133aa4b1ccfb90a3e093 Mon Sep 17 00:00:00 2001 From: Kyle Hammond Date: Sun, 12 Apr 2026 14:02:50 -0500 Subject: [PATCH 635/678] feat: add optional debugAsWhichUser to XCScheme.LaunchAction (#1100) * Add optional debugAsWhichUser to XCScheme.LaunchAction properties. * fix: remove trailing whitespace in XCSchemeTests Co-Authored-By: Claude Opus 4.6 (1M context) --------- Co-authored-by: fortmarek Co-authored-by: Claude Opus 4.6 (1M context) --- Fixtures/Schemes/DebugAsRoot.xcscheme | 79 +++++++++++++++++++ .../Extensions/AEXML+XcodeFormat.swift | 1 + .../Scheme/XCScheme+LaunchAction.swift | 18 ++++- .../XcodeProjTests/Scheme/XCSchemeTests.swift | 25 ++++++ 4 files changed, 119 insertions(+), 4 deletions(-) create mode 100644 Fixtures/Schemes/DebugAsRoot.xcscheme diff --git a/Fixtures/Schemes/DebugAsRoot.xcscheme b/Fixtures/Schemes/DebugAsRoot.xcscheme new file mode 100644 index 000000000..17c540ce6 --- /dev/null +++ b/Fixtures/Schemes/DebugAsRoot.xcscheme @@ -0,0 +1,79 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Sources/XcodeProj/Extensions/AEXML+XcodeFormat.swift b/Sources/XcodeProj/Extensions/AEXML+XcodeFormat.swift index 810170332..85f5bf96d 100644 --- a/Sources/XcodeProj/Extensions/AEXML+XcodeFormat.swift +++ b/Sources/XcodeProj/Extensions/AEXML+XcodeFormat.swift @@ -62,6 +62,7 @@ let attributesOrder: [String: [String]] = [ "enableGPUFrameCaptureMode", "enableGPUValidationMode", "allowLocationSimulation", + "debugAsWhichUser", "storeKitConfigurationFileReference", ], "ProfileAction": [ diff --git a/Sources/XcodeProj/Scheme/XCScheme+LaunchAction.swift b/Sources/XcodeProj/Scheme/XCScheme+LaunchAction.swift index f484cc9a6..5f73777bc 100644 --- a/Sources/XcodeProj/Scheme/XCScheme+LaunchAction.swift +++ b/Sources/XcodeProj/Scheme/XCScheme+LaunchAction.swift @@ -85,6 +85,7 @@ public extension XCScheme { public var customLaunchCommand: String? public var customLLDBInitFile: String? public var appClipInvocationURLString: String? + public var debugAsWhichUser: String? // MARK: - Init @@ -128,7 +129,8 @@ public extension XCScheme { storeKitConfigurationFileReference: StoreKitConfigurationFileReference? = nil, customLaunchCommand: String? = nil, customLLDBInitFile: String? = nil, - appClipInvocationURLString: String? = nil) { + appClipInvocationURLString: String? = nil, + debugAsWhichUser: String? = nil) { self.runnable = runnable self.macroExpansion = macroExpansion self.buildConfiguration = buildConfiguration @@ -168,6 +170,7 @@ public extension XCScheme { self.customLaunchCommand = customLaunchCommand self.customLLDBInitFile = customLLDBInitFile self.appClipInvocationURLString = appClipInvocationURLString + self.debugAsWhichUser = debugAsWhichUser super.init(preActions, postActions) } @@ -214,7 +217,8 @@ public extension XCScheme { storeKitConfigurationFileReference: StoreKitConfigurationFileReference? = nil, customLaunchCommand: String? = nil, customLLDBInitFile: String? = nil, - appClipInvocationURLString: String? = nil + appClipInvocationURLString: String? = nil, + debugAsWhichUser: String? = nil ) { self.init( runnable: pathRunnable, @@ -257,7 +261,8 @@ public extension XCScheme { storeKitConfigurationFileReference: storeKitConfigurationFileReference, customLaunchCommand: customLaunchCommand, customLLDBInitFile: customLLDBInitFile, - appClipInvocationURLString: appClipInvocationURLString + appClipInvocationURLString: appClipInvocationURLString, + debugAsWhichUser: debugAsWhichUser ) } @@ -344,6 +349,7 @@ public extension XCScheme { } appClipInvocationURLString = element.attributes["appClipInvocationURLString"] + debugAsWhichUser = element.attributes["debugAsWhichUser"] try super.init(element: element) } @@ -414,6 +420,9 @@ public extension XCScheme { if let appClipInvocationURLString { attributes["appClipInvocationURLString"] = appClipInvocationURLString } + if let debugAsWhichUser { + attributes["debugAsWhichUser"] = debugAsWhichUser + } return attributes } @@ -524,7 +533,8 @@ public extension XCScheme { storeKitConfigurationFileReference == rhs.storeKitConfigurationFileReference && customLaunchCommand == rhs.customLaunchCommand && customLLDBInitFile == rhs.customLLDBInitFile && - appClipInvocationURLString == rhs.appClipInvocationURLString + appClipInvocationURLString == rhs.appClipInvocationURLString && + debugAsWhichUser == rhs.debugAsWhichUser } } } diff --git a/Tests/XcodeProjTests/Scheme/XCSchemeTests.swift b/Tests/XcodeProjTests/Scheme/XCSchemeTests.swift index 3e9aa9f5b..160d1f78c 100644 --- a/Tests/XcodeProjTests/Scheme/XCSchemeTests.swift +++ b/Tests/XcodeProjTests/Scheme/XCSchemeTests.swift @@ -73,6 +73,27 @@ final class XCSchemeIntegrationTests: XCTestCase { assertion: { assert(minimalScheme: $1) }) } + func test_read_debugAsRootScheme() throws { + let subject = try XCScheme(path: debugAsRootSchemePath) + + XCTAssertNotNil(subject.launchAction) + XCTAssertEqual(subject.launchAction?.debugAsWhichUser, "root") + } + + func test_write_debugAsRootScheme() throws { + try testWrite(from: debugAsRootSchemePath, + initModel: { try? XCScheme(path: $0) }, + modify: { $0 }, + assertion: { _, scheme in + XCTAssertEqual(scheme.launchAction?.debugAsWhichUser, "root") + }) + } + + func test_read_write_debugAsRootScheme_produces_no_diff() throws { + try testReadWriteProducesNoDiff(from: debugAsRootSchemePath, + initModel: XCScheme.init(path:)) + } + func test_write_testableReferenceDefaultAttributesValuesAreOmitted() { let reference = XCScheme.TestableReference( skipped: false, @@ -946,4 +967,8 @@ final class XCSchemeIntegrationTests: XCTestCase { private var appClipScheme: Path { fixturesPath() + "Schemes/AppClip.xcscheme" } + + private var debugAsRootSchemePath: Path { + fixturesPath() + "Schemes/DebugAsRoot.xcscheme" + } } From 7dbe497dd963b6b29622b13711aa9a156e362ba5 Mon Sep 17 00:00:00 2001 From: fortmarek <9371695+fortmarek@users.noreply.github.com> Date: Sun, 12 Apr 2026 19:03:12 +0000 Subject: [PATCH 636/678] [Release] XcodeProj 9.11.0 --- CHANGELOG.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1ade24a9a..57fdbb1c5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [9.11.0] - 2026-04-12 +### Details +#### Features +- Add optional debugAsWhichUser to XCScheme.LaunchAction by @macblazer in [#1100](https://github.com/tuist/XcodeProj/pull/1100) + +## New Contributors +* @macblazer made their first contribution in [#1100](https://github.com/tuist/XcodeProj/pull/1100) ## [9.10.1] - 2026-02-26 ### Details #### Performance @@ -259,6 +266,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Disable the renovatebot dashboard by @pepicrft in [#840](https://github.com/tuist/XcodeProj/pull/840) - Set up SwiftLint and SwiftFormat, run them against the project, and run them as part of the CI workflows by @pepicrft in [#836](https://github.com/tuist/XcodeProj/pull/836) +[9.11.0]: https://github.com/tuist/XcodeProj/compare/9.10.1..9.11.0 [9.10.1]: https://github.com/tuist/XcodeProj/compare/9.10.0..9.10.1 [9.10.0]: https://github.com/tuist/XcodeProj/compare/9.9.0..9.10.0 [9.9.0]: https://github.com/tuist/XcodeProj/compare/9.8.0..9.9.0 From 7133f98ec69db70146a0df6b05d9bb4b79b7ddab Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 13 Apr 2026 01:52:31 +0000 Subject: [PATCH 637/678] chore(deps): update dependency tuist to v4.180.0 (#1110) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise.toml b/.mise.toml index 5e8d6b561..44e679ab8 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,5 +1,5 @@ [tools] swiftformat = "0.54.3" -tuist = "4.179.3" +tuist = "4.180.0" swiftlint = "0.63.2" "git-cliff" = "2.4.0" From a7c33066d702b1a158c124aeb6f4f3eac9f54fc3 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 17 Apr 2026 00:15:49 +0000 Subject: [PATCH 638/678] chore(deps): update dependency tuist to v4.181.0 (#1111) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise.toml b/.mise.toml index 44e679ab8..8714a4129 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,5 +1,5 @@ [tools] swiftformat = "0.54.3" -tuist = "4.180.0" +tuist = "4.181.0" swiftlint = "0.63.2" "git-cliff" = "2.4.0" From 620edf061456d2688778ee2f9736ce92e00f5982 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 17 Apr 2026 21:52:59 +0000 Subject: [PATCH 639/678] chore(deps): update dependency tuist to v4.182.0 (#1112) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise.toml b/.mise.toml index 8714a4129..cea0a51fd 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,5 +1,5 @@ [tools] swiftformat = "0.54.3" -tuist = "4.181.0" +tuist = "4.182.0" swiftlint = "0.63.2" "git-cliff" = "2.4.0" From 15bfbf561e2fe634cdb0ca2928c71d8b3230ab06 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 21 Apr 2026 23:48:17 +0000 Subject: [PATCH 640/678] chore(deps): update dependency tuist to v4.183.0 (#1115) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise.toml b/.mise.toml index cea0a51fd..b374b4644 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,5 +1,5 @@ [tools] swiftformat = "0.54.3" -tuist = "4.182.0" +tuist = "4.183.0" swiftlint = "0.63.2" "git-cliff" = "2.4.0" From 4c64ddb06792457875f98409069a7461ce890edb Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 23 Apr 2026 01:32:57 +0000 Subject: [PATCH 641/678] chore(deps): update dependency tuist to v4.184.1 (#1116) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise.toml b/.mise.toml index b374b4644..4771f9928 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,5 +1,5 @@ [tools] swiftformat = "0.54.3" -tuist = "4.183.0" +tuist = "4.184.1" swiftlint = "0.63.2" "git-cliff" = "2.4.0" From 4879be1a296968d0dc61ddd27ce28b30ea3c9302 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 23 Apr 2026 21:19:26 +0000 Subject: [PATCH 642/678] chore(deps): update dependency tuist to v4.185.1 (#1117) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise.toml b/.mise.toml index 4771f9928..3fc6715ef 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,5 +1,5 @@ [tools] swiftformat = "0.54.3" -tuist = "4.184.1" +tuist = "4.185.1" swiftlint = "0.63.2" "git-cliff" = "2.4.0" From 2fa8566956a1917decbea39b9f6c28a4ad5ecd9d Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 24 Apr 2026 21:20:17 +0000 Subject: [PATCH 643/678] chore(deps): update dependency tuist to v4.186.2 (#1118) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise.toml b/.mise.toml index 3fc6715ef..efc4824d6 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,5 +1,5 @@ [tools] swiftformat = "0.54.3" -tuist = "4.185.1" +tuist = "4.186.2" swiftlint = "0.63.2" "git-cliff" = "2.4.0" From ad19f8aadf9d46ed6bc8202c2f072cbf693a0ce5 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 27 Apr 2026 23:48:55 +0000 Subject: [PATCH 644/678] chore(deps): update dependency tuist to v4.188.3 (#1119) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise.toml b/.mise.toml index efc4824d6..90366105a 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,5 +1,5 @@ [tools] swiftformat = "0.54.3" -tuist = "4.186.2" +tuist = "4.188.3" swiftlint = "0.63.2" "git-cliff" = "2.4.0" From 6c2e6b045cc60b256cc685bfcfadded9180382b8 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 28 Apr 2026 22:01:53 +0000 Subject: [PATCH 645/678] chore(deps): update dependency tuist to v4.190.0 (#1120) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise.toml b/.mise.toml index 90366105a..9ffa7c54a 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,5 +1,5 @@ [tools] swiftformat = "0.54.3" -tuist = "4.188.3" +tuist = "4.190.0" swiftlint = "0.63.2" "git-cliff" = "2.4.0" From aff591e3a8367582851e489fbc45c8662c6b983e Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 29 Apr 2026 20:07:09 +0000 Subject: [PATCH 646/678] chore(deps): update dependency git-cliff to v2.13.1 (#1121) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise.toml b/.mise.toml index 9ffa7c54a..d71ee7f82 100644 --- a/.mise.toml +++ b/.mise.toml @@ -2,4 +2,4 @@ swiftformat = "0.54.3" tuist = "4.190.0" swiftlint = "0.63.2" -"git-cliff" = "2.4.0" +"git-cliff" = "2.13.1" From 0beb110d1c0127f492a4b176c0bc3acf23bb6d70 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 30 Apr 2026 05:44:21 +0000 Subject: [PATCH 647/678] chore(deps): update dependency tuist to v4.191.1 (#1122) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise.toml b/.mise.toml index d71ee7f82..a9e1b5992 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,5 +1,5 @@ [tools] swiftformat = "0.54.3" -tuist = "4.190.0" +tuist = "4.191.1" swiftlint = "0.63.2" "git-cliff" = "2.13.1" From 1ff2fa56e1d8fa3732e876ce683b1914867e342c Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 30 Apr 2026 22:28:28 +0000 Subject: [PATCH 648/678] chore(deps): update dependency tuist to v4.191.4 (#1123) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise.toml b/.mise.toml index a9e1b5992..6e9826ce0 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,5 +1,5 @@ [tools] swiftformat = "0.54.3" -tuist = "4.191.1" +tuist = "4.191.4" swiftlint = "0.63.2" "git-cliff" = "2.13.1" From b1896bda9cec13c83ecaf95d4faad9a8c1427c84 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 1 May 2026 16:51:41 +0000 Subject: [PATCH 649/678] chore(deps): update dependency tuist to v4.191.5 (#1124) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise.toml b/.mise.toml index 6e9826ce0..d0f472396 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,5 +1,5 @@ [tools] swiftformat = "0.54.3" -tuist = "4.191.4" +tuist = "4.191.5" swiftlint = "0.63.2" "git-cliff" = "2.13.1" From 50c6cdc55d4387876c01100c9c6e71f5146177b7 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 4 May 2026 16:56:44 +0000 Subject: [PATCH 650/678] chore(deps): update dependency tuist to v4.191.6 (#1125) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise.toml b/.mise.toml index d0f472396..9b97bac0c 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,5 +1,5 @@ [tools] swiftformat = "0.54.3" -tuist = "4.191.5" +tuist = "4.191.6" swiftlint = "0.63.2" "git-cliff" = "2.13.1" From e5c356f944b0888b0a1eafa869bab68fbc9f0c03 Mon Sep 17 00:00:00 2001 From: johnrbent Date: Tue, 5 May 2026 05:02:48 -0400 Subject: [PATCH 651/678] feat: support new Xcode 16 XCBuildConfiguration format (#1037) * Fix indentation in .editorconfig * Add Xcode 16 support to XCBuildConfiguration * Add tests, fix issue with comment generation * Remove file headers from test project * Address review feedback on Xcode 16 build configuration support - Revert unrelated `.editorconfig` indent_size change - Split XCBuildConfiguration init into two dedicated initializers (legacy PBXGroup form + Xcode 16 anchor/relative-path form) to make the mutually-exclusive reference styles explicit and document them - Reject partial anchor data in the decoder with DecodingError.dataCorrupted instead of silently dropping the field - Fix doc-comment typos - Add tests covering the partial-anchor-data decoder failure paths Co-Authored-By: Claude Opus 4.7 (1M context) * Revert decoder partial-anchor-data error Fall back to the original behaviour: if only one of `baseConfigurationReferenceAnchor` and `baseConfigurationReferenceRelativePath` is present, silently skip them and try `baseConfigurationReference` instead, rather than throwing. Drop the two tests that asserted the removed throwing behaviour. Co-Authored-By: Claude Opus 4.7 (1M context) --------- Co-authored-by: fortmarek Co-authored-by: Claude Opus 4.7 (1M context) --- .../project.pbxproj | 341 ++++++++++++++++++ .../AccentColor.colorset/Contents.json | 11 + .../AppIcon.appiconset/Contents.json | 35 ++ .../Assets.xcassets/Contents.json | 6 + .../Configs/DevConfig.xcconfig | 3 + .../Configs/ReleaseConfig.xcconfig | 3 + .../Configs/TargetConfig.xcconfig | 1 + .../ContentView.swift | 17 + .../Xcode16BuildConfigurationsApp.swift | 10 + .../Configuration/XCBuildConfiguration.swift | 78 +++- .../XCBuildConfigurationTests.swift | 15 + .../Objects/Project/PBXProjEncoderTests.swift | 33 ++ Tests/XcodeProjTests/Tests/Fixtures.swift | 5 + 13 files changed, 550 insertions(+), 8 deletions(-) create mode 100644 Fixtures/Xcode16BuildConfigurations/Xcode16BuildConfigurations.xcodeproj/project.pbxproj create mode 100644 Fixtures/Xcode16BuildConfigurations/Xcode16BuildConfigurations/Assets.xcassets/AccentColor.colorset/Contents.json create mode 100644 Fixtures/Xcode16BuildConfigurations/Xcode16BuildConfigurations/Assets.xcassets/AppIcon.appiconset/Contents.json create mode 100644 Fixtures/Xcode16BuildConfigurations/Xcode16BuildConfigurations/Assets.xcassets/Contents.json create mode 100644 Fixtures/Xcode16BuildConfigurations/Xcode16BuildConfigurations/Configs/DevConfig.xcconfig create mode 100644 Fixtures/Xcode16BuildConfigurations/Xcode16BuildConfigurations/Configs/ReleaseConfig.xcconfig create mode 100644 Fixtures/Xcode16BuildConfigurations/Xcode16BuildConfigurations/Configs/TargetConfig.xcconfig create mode 100644 Fixtures/Xcode16BuildConfigurations/Xcode16BuildConfigurations/ContentView.swift create mode 100644 Fixtures/Xcode16BuildConfigurations/Xcode16BuildConfigurations/Xcode16BuildConfigurationsApp.swift diff --git a/Fixtures/Xcode16BuildConfigurations/Xcode16BuildConfigurations.xcodeproj/project.pbxproj b/Fixtures/Xcode16BuildConfigurations/Xcode16BuildConfigurations.xcodeproj/project.pbxproj new file mode 100644 index 000000000..fbb1bc5f0 --- /dev/null +++ b/Fixtures/Xcode16BuildConfigurations/Xcode16BuildConfigurations.xcodeproj/project.pbxproj @@ -0,0 +1,341 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 77; + objects = { + +/* Begin PBXFileReference section */ + 918309852EFB16F800EE08DF /* Xcode16BuildConfigurations.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Xcode16BuildConfigurations.app; sourceTree = BUILT_PRODUCTS_DIR; }; +/* End PBXFileReference section */ + +/* Begin PBXFileSystemSynchronizedRootGroup section */ + 918309872EFB16F800EE08DF /* Xcode16BuildConfigurations */ = { + isa = PBXFileSystemSynchronizedRootGroup; + path = Xcode16BuildConfigurations; + sourceTree = ""; + }; +/* End PBXFileSystemSynchronizedRootGroup section */ + +/* Begin PBXFrameworksBuildPhase section */ + 918309822EFB16F800EE08DF /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 9183097C2EFB16F800EE08DF = { + isa = PBXGroup; + children = ( + 918309872EFB16F800EE08DF /* Xcode16BuildConfigurations */, + 918309862EFB16F800EE08DF /* Products */, + ); + sourceTree = ""; + }; + 918309862EFB16F800EE08DF /* Products */ = { + isa = PBXGroup; + children = ( + 918309852EFB16F800EE08DF /* Xcode16BuildConfigurations.app */, + ); + name = Products; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 918309842EFB16F800EE08DF /* Xcode16BuildConfigurations */ = { + isa = PBXNativeTarget; + buildConfigurationList = 918309902EFB16F800EE08DF /* Build configuration list for PBXNativeTarget "Xcode16BuildConfigurations" */; + buildPhases = ( + 918309812EFB16F800EE08DF /* Sources */, + 918309822EFB16F800EE08DF /* Frameworks */, + 918309832EFB16F800EE08DF /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + fileSystemSynchronizedGroups = ( + 918309872EFB16F800EE08DF /* Xcode16BuildConfigurations */, + ); + name = Xcode16BuildConfigurations; + packageProductDependencies = ( + ); + productName = Xcode16BuildConfigurations; + productReference = 918309852EFB16F800EE08DF /* Xcode16BuildConfigurations.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 9183097D2EFB16F800EE08DF /* Project object */ = { + isa = PBXProject; + attributes = { + BuildIndependentTargetsInParallel = 1; + LastSwiftUpdateCheck = 2610; + LastUpgradeCheck = 2610; + TargetAttributes = { + 918309842EFB16F800EE08DF = { + CreatedOnToolsVersion = 26.1; + }; + }; + }; + buildConfigurationList = 918309802EFB16F800EE08DF /* Build configuration list for PBXProject "Xcode16BuildConfigurations" */; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 9183097C2EFB16F800EE08DF; + minimizedProjectReferenceProxies = 1; + preferredProjectObjectVersion = 77; + productRefGroup = 918309862EFB16F800EE08DF /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 918309842EFB16F800EE08DF /* Xcode16BuildConfigurations */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 918309832EFB16F800EE08DF /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 918309812EFB16F800EE08DF /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin XCBuildConfiguration section */ + 9183098E2EFB16F800EE08DF /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReferenceAnchor = 918309872EFB16F800EE08DF /* Xcode16BuildConfigurations */; + baseConfigurationReferenceRelativePath = Configs/DevConfig.xcconfig; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + ENABLE_USER_SCRIPT_SANDBOXING = YES; + GCC_C_LANGUAGE_STANDARD = gnu17; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 26.1; + LOCALIZATION_PREFERS_STRING_CATALOGS = YES; + MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; + MTL_FAST_MATH = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = "DEBUG $(inherited)"; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + }; + name = Debug; + }; + 9183098F2EFB16F800EE08DF /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReferenceAnchor = 918309872EFB16F800EE08DF /* Xcode16BuildConfigurations */; + baseConfigurationReferenceRelativePath = Configs/ReleaseConfig.xcconfig; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_USER_SCRIPT_SANDBOXING = YES; + GCC_C_LANGUAGE_STANDARD = gnu17; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 26.1; + LOCALIZATION_PREFERS_STRING_CATALOGS = YES; + MTL_ENABLE_DEBUG_INFO = NO; + MTL_FAST_MATH = YES; + SDKROOT = iphoneos; + SWIFT_COMPILATION_MODE = wholemodule; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 918309912EFB16F800EE08DF /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReferenceAnchor = 918309872EFB16F800EE08DF /* Xcode16BuildConfigurations */; + baseConfigurationReferenceRelativePath = Configs/TargetConfig.xcconfig; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + ENABLE_PREVIEWS = YES; + GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES; + INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; + INFOPLIST_KEY_UILaunchScreen_Generation = YES; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = com.example.Xcode16BuildConfigurations; + PRODUCT_NAME = "$(TARGET_NAME)"; + STRING_CATALOG_GENERATE_SYMBOLS = YES; + SWIFT_APPROACHABLE_CONCURRENCY = YES; + SWIFT_DEFAULT_ACTOR_ISOLATION = MainActor; + SWIFT_EMIT_LOC_STRINGS = YES; + SWIFT_UPCOMING_FEATURE_MEMBER_IMPORT_VISIBILITY = YES; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + 918309922EFB16F800EE08DF /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReferenceAnchor = 918309872EFB16F800EE08DF /* Xcode16BuildConfigurations */; + baseConfigurationReferenceRelativePath = Configs/TargetConfig.xcconfig; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + ENABLE_PREVIEWS = YES; + GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES; + INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; + INFOPLIST_KEY_UILaunchScreen_Generation = YES; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = com.example.Xcode16BuildConfigurations; + PRODUCT_NAME = "$(TARGET_NAME)"; + STRING_CATALOG_GENERATE_SYMBOLS = YES; + SWIFT_APPROACHABLE_CONCURRENCY = YES; + SWIFT_DEFAULT_ACTOR_ISOLATION = MainActor; + SWIFT_EMIT_LOC_STRINGS = YES; + SWIFT_UPCOMING_FEATURE_MEMBER_IMPORT_VISIBILITY = YES; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 918309802EFB16F800EE08DF /* Build configuration list for PBXProject "Xcode16BuildConfigurations" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 9183098E2EFB16F800EE08DF /* Debug */, + 9183098F2EFB16F800EE08DF /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 918309902EFB16F800EE08DF /* Build configuration list for PBXNativeTarget "Xcode16BuildConfigurations" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 918309912EFB16F800EE08DF /* Debug */, + 918309922EFB16F800EE08DF /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 9183097D2EFB16F800EE08DF /* Project object */; +} diff --git a/Fixtures/Xcode16BuildConfigurations/Xcode16BuildConfigurations/Assets.xcassets/AccentColor.colorset/Contents.json b/Fixtures/Xcode16BuildConfigurations/Xcode16BuildConfigurations/Assets.xcassets/AccentColor.colorset/Contents.json new file mode 100644 index 000000000..eb8789700 --- /dev/null +++ b/Fixtures/Xcode16BuildConfigurations/Xcode16BuildConfigurations/Assets.xcassets/AccentColor.colorset/Contents.json @@ -0,0 +1,11 @@ +{ + "colors" : [ + { + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Fixtures/Xcode16BuildConfigurations/Xcode16BuildConfigurations/Assets.xcassets/AppIcon.appiconset/Contents.json b/Fixtures/Xcode16BuildConfigurations/Xcode16BuildConfigurations/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 000000000..230588010 --- /dev/null +++ b/Fixtures/Xcode16BuildConfigurations/Xcode16BuildConfigurations/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,35 @@ +{ + "images" : [ + { + "idiom" : "universal", + "platform" : "ios", + "size" : "1024x1024" + }, + { + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "dark" + } + ], + "idiom" : "universal", + "platform" : "ios", + "size" : "1024x1024" + }, + { + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "tinted" + } + ], + "idiom" : "universal", + "platform" : "ios", + "size" : "1024x1024" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Fixtures/Xcode16BuildConfigurations/Xcode16BuildConfigurations/Assets.xcassets/Contents.json b/Fixtures/Xcode16BuildConfigurations/Xcode16BuildConfigurations/Assets.xcassets/Contents.json new file mode 100644 index 000000000..73c00596a --- /dev/null +++ b/Fixtures/Xcode16BuildConfigurations/Xcode16BuildConfigurations/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Fixtures/Xcode16BuildConfigurations/Xcode16BuildConfigurations/Configs/DevConfig.xcconfig b/Fixtures/Xcode16BuildConfigurations/Xcode16BuildConfigurations/Configs/DevConfig.xcconfig new file mode 100644 index 000000000..0abfe77dc --- /dev/null +++ b/Fixtures/Xcode16BuildConfigurations/Xcode16BuildConfigurations/Configs/DevConfig.xcconfig @@ -0,0 +1,3 @@ +API_BASE_URL = api.staging.example.com +ASSETCATALOG_COMPILER_OPTIMIZATION = speed +TARGETED_DEVICE_FAMILY = 1 diff --git a/Fixtures/Xcode16BuildConfigurations/Xcode16BuildConfigurations/Configs/ReleaseConfig.xcconfig b/Fixtures/Xcode16BuildConfigurations/Xcode16BuildConfigurations/Configs/ReleaseConfig.xcconfig new file mode 100644 index 000000000..56375b0d1 --- /dev/null +++ b/Fixtures/Xcode16BuildConfigurations/Xcode16BuildConfigurations/Configs/ReleaseConfig.xcconfig @@ -0,0 +1,3 @@ +API_BASE_URL = api.example.com +ASSETCATALOG_COMPILER_OPTIMIZATION = space +TARGETED_DEVICE_FAMILY = 1 diff --git a/Fixtures/Xcode16BuildConfigurations/Xcode16BuildConfigurations/Configs/TargetConfig.xcconfig b/Fixtures/Xcode16BuildConfigurations/Xcode16BuildConfigurations/Configs/TargetConfig.xcconfig new file mode 100644 index 000000000..565be09fe --- /dev/null +++ b/Fixtures/Xcode16BuildConfigurations/Xcode16BuildConfigurations/Configs/TargetConfig.xcconfig @@ -0,0 +1 @@ +TARGETED_DEVICE_FAMILY = 1,2 diff --git a/Fixtures/Xcode16BuildConfigurations/Xcode16BuildConfigurations/ContentView.swift b/Fixtures/Xcode16BuildConfigurations/Xcode16BuildConfigurations/ContentView.swift new file mode 100644 index 000000000..b000a7e46 --- /dev/null +++ b/Fixtures/Xcode16BuildConfigurations/Xcode16BuildConfigurations/ContentView.swift @@ -0,0 +1,17 @@ +import SwiftUI + +struct ContentView: View { + var body: some View { + VStack { + Image(systemName: "globe") + .imageScale(.large) + .foregroundStyle(.tint) + Text("Hello, world!") + } + .padding() + } +} + +#Preview { + ContentView() +} diff --git a/Fixtures/Xcode16BuildConfigurations/Xcode16BuildConfigurations/Xcode16BuildConfigurationsApp.swift b/Fixtures/Xcode16BuildConfigurations/Xcode16BuildConfigurations/Xcode16BuildConfigurationsApp.swift new file mode 100644 index 000000000..152617081 --- /dev/null +++ b/Fixtures/Xcode16BuildConfigurations/Xcode16BuildConfigurations/Xcode16BuildConfigurationsApp.swift @@ -0,0 +1,10 @@ +import SwiftUI + +@main +struct Xcode16BuildConfigurationsApp: App { + var body: some Scene { + WindowGroup { + ContentView() + } + } +} diff --git a/Sources/XcodeProj/Objects/Configuration/XCBuildConfiguration.swift b/Sources/XcodeProj/Objects/Configuration/XCBuildConfiguration.swift index 159dc201c..ac4d62f9e 100644 --- a/Sources/XcodeProj/Objects/Configuration/XCBuildConfiguration.swift +++ b/Sources/XcodeProj/Objects/Configuration/XCBuildConfiguration.swift @@ -4,10 +4,10 @@ import Foundation public final class XCBuildConfiguration: PBXObject { // MARK: - Attributes - /// Base xcconfig file reference. + /// Base xcconfig file reference if the file belongs to a ``PBXGroup``. var baseConfigurationReference: PBXObjectReference? - /// Base xcconfig file reference. + /// Base xcconfig file reference if the file belongs to a ``PBXGroup``. public var baseConfiguration: PBXFileReference? { get { baseConfigurationReference?.getObject() @@ -19,6 +19,24 @@ public final class XCBuildConfiguration: PBXObject { } } + /// Reference to a ``PBXFileSystemSynchronizedRootGroup`` containing the base xcconfig file. + var baseConfigurationReferenceAnchor: PBXObjectReference? + + /// Base xcconfig file path relative to the `baseConfigurationAnchor`. + public var baseConfigurationReferenceRelativePath: String? + + /// ``PBXFileSystemSynchronizedRootGroup`` containing the base xcconfig file. + public var baseConfigurationAnchor: PBXFileSystemSynchronizedRootGroup? { + get { + baseConfigurationReferenceAnchor?.getObject() + } + set { + if let newValue { + baseConfigurationReferenceAnchor = newValue.reference + } + } + } + /// A map of build settings. public var buildSettings: BuildSettings @@ -27,12 +45,18 @@ public final class XCBuildConfiguration: PBXObject { // MARK: - Init - /// Initializes a build configuration. + /// Initializes a build configuration whose base xcconfig (if any) lives in a ``PBXGroup``. /// /// - Parameters: /// - name: build configuration name. - /// - baseConfiguration: base configuration. + /// - baseConfiguration: base xcconfig file reference belonging to a ``PBXGroup``. /// - buildSettings: dictionary that contains the build settings for this configuration. + /// + /// - Important: + /// If the base xcconfig file lives inside a ``PBXFileSystemSynchronizedRootGroup`` (Xcode 16+), use + /// ``init(name:baseConfigurationAnchor:baseConfigurationRelativePath:buildSettings:)`` instead. The two + /// reference styles are mutually exclusive: a single configuration cannot use both `baseConfiguration` and + /// the anchor/relative-path pair. public init(name: String, baseConfiguration: PBXFileReference? = nil, buildSettings: BuildSettings = [:]) { @@ -42,10 +66,36 @@ public final class XCBuildConfiguration: PBXObject { super.init() } + /// Initializes a build configuration whose base xcconfig lives inside a ``PBXFileSystemSynchronizedRootGroup``. + /// + /// - Parameters: + /// - name: build configuration name. + /// - baseConfigurationAnchor: the file system synchronized root group that contains the base xcconfig file as a descendant. + /// - baseConfigurationRelativePath: relative path from `baseConfigurationAnchor` to the base xcconfig file. + /// - buildSettings: dictionary that contains the build settings for this configuration. + /// + /// - Important: + /// This initializer is for the Xcode 16+ representation, where xcconfig files inside a synchronized root + /// group are referenced by an anchor + relative path pair. If the base xcconfig file belongs to a regular + /// ``PBXGroup``, use ``init(name:baseConfiguration:buildSettings:)`` instead. The two reference styles are + /// mutually exclusive: a single configuration cannot use both `baseConfiguration` and the anchor/relative-path pair. + public init(name: String, + baseConfigurationAnchor: PBXFileSystemSynchronizedRootGroup, + baseConfigurationRelativePath: String, + buildSettings: BuildSettings = [:]) { + baseConfigurationReferenceAnchor = baseConfigurationAnchor.reference + baseConfigurationReferenceRelativePath = baseConfigurationRelativePath + self.buildSettings = buildSettings + self.name = name + super.init() + } + // MARK: - Decodable fileprivate enum CodingKeys: String, CodingKey { case baseConfigurationReference + case baseConfigurationReferenceAnchor + case baseConfigurationReferenceRelativePath case buildSettings case name } @@ -54,10 +104,16 @@ public final class XCBuildConfiguration: PBXObject { let objects = decoder.context.objects let objectReferenceRepository = decoder.context.objectReferenceRepository let container = try decoder.container(keyedBy: CodingKeys.self) - if let baseConfigurationReference: String = try container.decodeIfPresent(.baseConfigurationReference) { + // Configuration files may be referenced either by a pair of (PBXFileSystemSynchronizedRootGroup, relative path) + // when the xcconfig lives inside a synchronized root group (Xcode 16+), or by a PBXFileReference when it + // belongs to a regular PBXGroup. + if let baseConfigurationReferenceAnchor: String = try container.decodeIfPresent(.baseConfigurationReferenceAnchor), + let baseConfigurationReferenceRelativePath: String = try container.decodeIfPresent(.baseConfigurationReferenceRelativePath) + { + self.baseConfigurationReferenceAnchor = objectReferenceRepository.getOrCreate(reference: baseConfigurationReferenceAnchor, objects: objects) + self.baseConfigurationReferenceRelativePath = baseConfigurationReferenceRelativePath + } else if let baseConfigurationReference: String = try container.decodeIfPresent(.baseConfigurationReference) { self.baseConfigurationReference = objectReferenceRepository.getOrCreate(reference: baseConfigurationReference, objects: objects) - } else { - baseConfigurationReference = nil } buildSettings = try container.decode(BuildSettings.self, forKey: .buildSettings) name = try container.decode(.name) @@ -104,7 +160,13 @@ extension XCBuildConfiguration: PlistSerializable { dictionary["isa"] = .string(CommentedString(XCBuildConfiguration.isa)) dictionary["name"] = .string(CommentedString(name)) dictionary["buildSettings"] = buildSettings.plist() - if let baseConfigurationReference { + if let baseConfigurationReferenceAnchor, + let baseConfigurationReferenceRelativePath + { + let synchronizedGroup: PBXFileSystemSynchronizedRootGroup? = baseConfigurationReferenceAnchor.getObject() + dictionary["baseConfigurationReferenceAnchor"] = .string(CommentedString(baseConfigurationReferenceAnchor.value, comment: synchronizedGroup?.path)) + dictionary["baseConfigurationReferenceRelativePath"] = .string(CommentedString(baseConfigurationReferenceRelativePath)) + } else if let baseConfigurationReference { let fileElement: PBXFileElement? = baseConfigurationReference.getObject() dictionary["baseConfigurationReference"] = .string(CommentedString(baseConfigurationReference.value, comment: fileElement?.fileName())) } diff --git a/Tests/XcodeProjTests/Objects/Configuration/XCBuildConfigurationTests.swift b/Tests/XcodeProjTests/Objects/Configuration/XCBuildConfigurationTests.swift index e29ef2d54..64d357f8a 100644 --- a/Tests/XcodeProjTests/Objects/Configuration/XCBuildConfigurationTests.swift +++ b/Tests/XcodeProjTests/Objects/Configuration/XCBuildConfigurationTests.swift @@ -85,6 +85,21 @@ final class XCBuildConfigurationTests: XCTestCase { XCTAssertEqual(subject.buildSettings["OTHER_LDFLAGS"], ["flag1", "flag2", "flag3"]) } + func test_configuration_files_in_synchronized_group() { + let synchronizedGroup = PBXFileSystemSynchronizedRootGroup.fixture(sourceTree: .group, + path: "Xcode16BuildConfigurations", + explicitFileTypes: [:], + exceptions: [], + explicitFolders: []) + let subject = XCBuildConfiguration(name: "Debug", + baseConfigurationAnchor: synchronizedGroup, + baseConfigurationRelativePath: "Configs/DevConfig.xcconfig", + buildSettings: [:]) + XCTAssertNil(subject.baseConfigurationReference) + XCTAssertNotNil(subject.baseConfigurationReferenceAnchor) + XCTAssertNotNil(subject.baseConfigurationReferenceRelativePath) + } + private func testDictionary() -> [String: Any] { [ "baseConfigurationReference": "baseConfigurationReference", diff --git a/Tests/XcodeProjTests/Objects/Project/PBXProjEncoderTests.swift b/Tests/XcodeProjTests/Objects/Project/PBXProjEncoderTests.swift index af5233ce0..aa7424c5e 100644 --- a/Tests/XcodeProjTests/Objects/Project/PBXProjEncoderTests.swift +++ b/Tests/XcodeProjTests/Objects/Project/PBXProjEncoderTests.swift @@ -341,6 +341,35 @@ line = lines.validate(line: "/* End PBXFileSystemSynchronizedGroupBuildPhaseMembershipExceptionSet section */", after: line) } + // MARK: File system synchronized build configuration files + + func test_fileSystemSynchronizedBuildConfigurationFiles() throws { + try loadProjectWithConfigurationFilesInSynchronizedGroup() + let settings = PBXOutputSettings(projNavigatorFileOrder: .byFilenameGroupsFirst) + let lines = lines(fromFile: encodeProject(settings: settings)) + + let beginGroup = lines.findLine("/* Begin XCBuildConfiguration section */") + var line = lines.validate(line: "9183098E2EFB16F800EE08DF /* Debug */ = {", after: beginGroup) + line = lines.validate(line: "isa = XCBuildConfiguration;", after: line) + line = lines.validate(line: "baseConfigurationReferenceAnchor = 918309872EFB16F800EE08DF /* Xcode16BuildConfigurations */;", after: line) + line = lines.validate(line: "baseConfigurationReferenceRelativePath = Configs/DevConfig.xcconfig;", after: line) + + line = lines.validate(line: "9183098F2EFB16F800EE08DF /* Release */ = {", after: line) + line = lines.validate(line: "isa = XCBuildConfiguration;", after: line) + line = lines.validate(line: "baseConfigurationReferenceAnchor = 918309872EFB16F800EE08DF /* Xcode16BuildConfigurations */;", after: line) + line = lines.validate(line: "baseConfigurationReferenceRelativePath = Configs/ReleaseConfig.xcconfig;", after: line) + + line = lines.validate(line: "918309912EFB16F800EE08DF /* Debug */ = {", after: line) + line = lines.validate(line: "isa = XCBuildConfiguration;", after: line) + line = lines.validate(line: "baseConfigurationReferenceAnchor = 918309872EFB16F800EE08DF /* Xcode16BuildConfigurations */;", after: line) + line = lines.validate(line: "baseConfigurationReferenceRelativePath = Configs/TargetConfig.xcconfig;", after: line) + + line = lines.validate(line: "918309922EFB16F800EE08DF /* Release */ = {", after: line) + line = lines.validate(line: "isa = XCBuildConfiguration;", after: line) + line = lines.validate(line: "baseConfigurationReferenceAnchor = 918309872EFB16F800EE08DF /* Xcode16BuildConfigurations */;", after: line) + line = lines.validate(line: "baseConfigurationReferenceRelativePath = Configs/TargetConfig.xcconfig;", after: line) + } + // MARK: - Projects func test_ProjectReferenceOrder() throws { @@ -558,6 +587,10 @@ private func loadProjectWithShellScriptBuildPhase() throws { proj = try PBXProj(data: projectWithCustomShellScript()) } + + private func loadProjectWithConfigurationFilesInSynchronizedGroup() throws { + proj = try PBXProj(data: projectWithConfigurationFilesInSynchronizedGroup()) + } } // MARK: - Line validations diff --git a/Tests/XcodeProjTests/Tests/Fixtures.swift b/Tests/XcodeProjTests/Tests/Fixtures.swift index 32a0e24fd..045a7ce49 100644 --- a/Tests/XcodeProjTests/Tests/Fixtures.swift +++ b/Tests/XcodeProjTests/Tests/Fixtures.swift @@ -55,3 +55,8 @@ func projectWithCustomShellScript() throws -> Data { let iosProjectWithShellScript = fixturesPath() + "Xcode16ProjectReferenceOrder/Test.xcodeproj/project.pbxproj" return try Data(contentsOf: iosProjectWithShellScript.url) } + +func projectWithConfigurationFilesInSynchronizedGroup() throws -> Data { + let projectWithConfigurationFilesInSynchronizedGroup = fixturesPath() + "Xcode16BuildConfigurations/Xcode16BuildConfigurations.xcodeproj/project.pbxproj" + return try Data(contentsOf: projectWithConfigurationFilesInSynchronizedGroup.url) +} From fb79d68bc758cdb00079d72b6c8b899d99f5f15e Mon Sep 17 00:00:00 2001 From: fortmarek <9371695+fortmarek@users.noreply.github.com> Date: Tue, 5 May 2026 09:03:15 +0000 Subject: [PATCH 652/678] [Release] XcodeProj 9.12.0 --- CHANGELOG.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 57fdbb1c5..970e3123d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [9.12.0] - 2026-05-05 +### Details +#### Features +- Support new Xcode 16 XCBuildConfiguration format by @johnrbent in [#1037](https://github.com/tuist/XcodeProj/pull/1037) + +## New Contributors +* @johnrbent made their first contribution in [#1037](https://github.com/tuist/XcodeProj/pull/1037) ## [9.11.0] - 2026-04-12 ### Details #### Features @@ -57,6 +64,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## New Contributors * @mirkokg made their first contribution in [#1014](https://github.com/tuist/XcodeProj/pull/1014) +* @wojciech-kulik made their first contribution in [#1009](https://github.com/tuist/XcodeProj/pull/1009) ## [9.6.0] - 2025-10-06 ### Details #### Features @@ -208,6 +216,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 #### Refactor - Update PathRunnable so that it subclasses Runnable by @georgenavarro in [#883](https://github.com/tuist/XcodeProj/pull/883) +## New Contributors +* @georgenavarro made their first contribution in [#883](https://github.com/tuist/XcodeProj/pull/883) ## [8.24.12] - 2024-12-03 ### Details #### Bug Fixes @@ -246,6 +256,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 #### Bug Fixes - Order for `XCLocalSwiftPackageReference` and `XCRemoteSwiftPackageReference` by @kimdv in [#855](https://github.com/tuist/XcodeProj/pull/855) +## New Contributors +* @kimdv made their first contribution in [#855](https://github.com/tuist/XcodeProj/pull/855) ## [8.23.8] - 2024-09-26 ### Details #### Bug Fixes @@ -266,6 +278,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Disable the renovatebot dashboard by @pepicrft in [#840](https://github.com/tuist/XcodeProj/pull/840) - Set up SwiftLint and SwiftFormat, run them against the project, and run them as part of the CI workflows by @pepicrft in [#836](https://github.com/tuist/XcodeProj/pull/836) +## New Contributors +* @filipracki made their first contribution in [#834](https://github.com/tuist/XcodeProj/pull/834) +[9.12.0]: https://github.com/tuist/XcodeProj/compare/9.11.0..9.12.0 [9.11.0]: https://github.com/tuist/XcodeProj/compare/9.10.1..9.11.0 [9.10.1]: https://github.com/tuist/XcodeProj/compare/9.10.0..9.10.1 [9.10.0]: https://github.com/tuist/XcodeProj/compare/9.9.0..9.10.0 From 03887f680f1e11140b02ee8c3ac8a5ecb588cba5 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 5 May 2026 21:35:36 +0000 Subject: [PATCH 653/678] chore(deps): update dependency tuist to v4.191.8 (#1126) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise.toml b/.mise.toml index 9b97bac0c..1b24b16f9 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,5 +1,5 @@ [tools] swiftformat = "0.54.3" -tuist = "4.191.6" +tuist = "4.191.8" swiftlint = "0.63.2" "git-cliff" = "2.13.1" From b971db6da007f27ffe92f390ce7c24b9fdc4398c Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 7 May 2026 20:44:30 +0000 Subject: [PATCH 654/678] chore(deps): update dependency tuist to v4.192.0 (#1127) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise.toml b/.mise.toml index 1b24b16f9..095bb469a 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,5 +1,5 @@ [tools] swiftformat = "0.54.3" -tuist = "4.191.8" +tuist = "4.192.0" swiftlint = "0.63.2" "git-cliff" = "2.13.1" From 7108162d61771ec4ba74ed2c2845ba7ad99ff22e Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 8 May 2026 20:44:13 +0000 Subject: [PATCH 655/678] chore(deps): update dependency tuist to v4.192.3 (#1128) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise.toml b/.mise.toml index 095bb469a..61a6468ea 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,5 +1,5 @@ [tools] swiftformat = "0.54.3" -tuist = "4.192.0" +tuist = "4.192.3" swiftlint = "0.63.2" "git-cliff" = "2.13.1" From ed9d041626ed5829b8fdd50d9419a511451386af Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 11 May 2026 13:00:29 +0000 Subject: [PATCH 656/678] chore(deps): update dependency tuist to v4.192.4 (#1129) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise.toml b/.mise.toml index 61a6468ea..7bef80a48 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,5 +1,5 @@ [tools] swiftformat = "0.54.3" -tuist = "4.192.3" +tuist = "4.192.4" swiftlint = "0.63.2" "git-cliff" = "2.13.1" From 65021d7778d8037339f02ac61e7f51a904c09bb0 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 12 May 2026 00:48:44 +0000 Subject: [PATCH 657/678] chore(deps): update dependency tuist to v4.193.1 (#1130) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise.toml b/.mise.toml index 7bef80a48..bd3805e63 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,5 +1,5 @@ [tools] swiftformat = "0.54.3" -tuist = "4.192.4" +tuist = "4.193.1" swiftlint = "0.63.2" "git-cliff" = "2.13.1" From 1f95d7474b8217295f82c1167accd78d246fea7a Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 12 May 2026 15:02:51 +0000 Subject: [PATCH 658/678] chore(deps): update dependency tuist to v4.193.2 (#1131) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise.toml b/.mise.toml index bd3805e63..1ae49e4b7 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,5 +1,5 @@ [tools] swiftformat = "0.54.3" -tuist = "4.193.1" +tuist = "4.193.2" swiftlint = "0.63.2" "git-cliff" = "2.13.1" From fbd7c3d475f2bf4f17a045ae42775065da06343a Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 12 May 2026 21:53:53 +0000 Subject: [PATCH 659/678] chore(deps): update dependency tuist to v4.193.3 (#1132) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise.toml b/.mise.toml index 1ae49e4b7..b4c1be6a2 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,5 +1,5 @@ [tools] swiftformat = "0.54.3" -tuist = "4.193.2" +tuist = "4.193.3" swiftlint = "0.63.2" "git-cliff" = "2.13.1" From 51ee8e87c25fe0889f7881b650e54781b9af7201 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 13 May 2026 21:27:11 +0000 Subject: [PATCH 660/678] chore(deps): update dependency tuist to v4.194.0 (#1133) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise.toml b/.mise.toml index b4c1be6a2..48a5feee7 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,5 +1,5 @@ [tools] swiftformat = "0.54.3" -tuist = "4.193.3" +tuist = "4.194.0" swiftlint = "0.63.2" "git-cliff" = "2.13.1" From a878d3d206e87b7c76f81ed6aa5a2d57525d1df1 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 14 May 2026 16:43:33 +0000 Subject: [PATCH 661/678] chore(deps): update dependency tuist to v4.194.1 (#1134) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise.toml b/.mise.toml index 48a5feee7..167325500 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,5 +1,5 @@ [tools] swiftformat = "0.54.3" -tuist = "4.194.0" +tuist = "4.194.1" swiftlint = "0.63.2" "git-cliff" = "2.13.1" From 90294565de40eedf8bbb785b24e48c620c9bf5d0 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 15 May 2026 20:40:19 +0000 Subject: [PATCH 662/678] chore(deps): update dependency tuist to v4.194.4 (#1135) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise.toml b/.mise.toml index 167325500..e6aa34fdd 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,5 +1,5 @@ [tools] swiftformat = "0.54.3" -tuist = "4.194.1" +tuist = "4.194.4" swiftlint = "0.63.2" "git-cliff" = "2.13.1" From 0cad76808bf1bdd93bc94548f50a25c3c4e20227 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 18 May 2026 23:47:42 +0000 Subject: [PATCH 663/678] chore(deps): update dependency tuist to v4.195.1 (#1136) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise.toml b/.mise.toml index e6aa34fdd..b29f4ef9c 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,5 +1,5 @@ [tools] swiftformat = "0.54.3" -tuist = "4.194.4" +tuist = "4.195.1" swiftlint = "0.63.2" "git-cliff" = "2.13.1" From 6e02b173e97b981c7672db7a38ac98ded6ef267f Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 19 May 2026 20:44:04 +0000 Subject: [PATCH 664/678] chore(deps): update dependency tuist to v4.195.2 (#1138) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise.toml b/.mise.toml index b29f4ef9c..6e92910d8 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,5 +1,5 @@ [tools] swiftformat = "0.54.3" -tuist = "4.195.1" +tuist = "4.195.2" swiftlint = "0.63.2" "git-cliff" = "2.13.1" From d48838d524b8b4f1a0acd8d678eb5f81cae95878 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 22 May 2026 01:28:03 +0000 Subject: [PATCH 665/678] chore(deps): update dependency tuist to v4.195.5 (#1139) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise.toml b/.mise.toml index 6e92910d8..51ac86e25 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,5 +1,5 @@ [tools] swiftformat = "0.54.3" -tuist = "4.195.2" +tuist = "4.195.5" swiftlint = "0.63.2" "git-cliff" = "2.13.1" From 7d8db2cc936f10edb801d162e26b6e5c3268c5ed Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 22 May 2026 22:01:28 +0000 Subject: [PATCH 666/678] chore(deps): update dependency tuist to v4.195.6 (#1140) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise.toml b/.mise.toml index 51ac86e25..da9c10c75 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,5 +1,5 @@ [tools] swiftformat = "0.54.3" -tuist = "4.195.5" +tuist = "4.195.6" swiftlint = "0.63.2" "git-cliff" = "2.13.1" From 87aa9936abd6a5dc0965dca273f821ceeca04301 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 26 May 2026 22:49:16 +0000 Subject: [PATCH 667/678] chore(deps): update dependency tuist to v4.195.7 (#1141) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise.toml b/.mise.toml index da9c10c75..b46d73ae6 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,5 +1,5 @@ [tools] swiftformat = "0.54.3" -tuist = "4.195.6" +tuist = "4.195.7" swiftlint = "0.63.2" "git-cliff" = "2.13.1" From cb6af4bfc37fbd51067429dead7a55708d727150 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 27 May 2026 20:53:16 +0000 Subject: [PATCH 668/678] chore(deps): update dependency swiftlint to v0.63.3 (#1142) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise.toml b/.mise.toml index b46d73ae6..6e443e3be 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,5 +1,5 @@ [tools] swiftformat = "0.54.3" tuist = "4.195.7" -swiftlint = "0.63.2" +swiftlint = "0.63.3" "git-cliff" = "2.13.1" From a4544cb671196e639feedf6f27333ed026f79ccd Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 28 May 2026 01:39:23 +0000 Subject: [PATCH 669/678] chore(deps): update dependency tuist to v4.195.9 (#1143) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise.toml b/.mise.toml index 6e443e3be..b692c1241 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,5 +1,5 @@ [tools] swiftformat = "0.54.3" -tuist = "4.195.7" +tuist = "4.195.9" swiftlint = "0.63.3" "git-cliff" = "2.13.1" From 2a65b7faddcada8a28a30004839c3b494f79df7d Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 29 May 2026 16:47:59 +0000 Subject: [PATCH 670/678] chore(deps): update dependency tuist to v4.195.10 (#1144) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise.toml b/.mise.toml index b692c1241..b7d8cb4af 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,5 +1,5 @@ [tools] swiftformat = "0.54.3" -tuist = "4.195.9" +tuist = "4.195.10" swiftlint = "0.63.3" "git-cliff" = "2.13.1" From f1e84bc97f89f500f757bd5f03256e7bf61b979d Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 30 May 2026 01:04:32 +0000 Subject: [PATCH 671/678] chore(deps): update dependency tuist to v4.195.11 (#1145) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise.toml b/.mise.toml index b7d8cb4af..3dac51a45 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,5 +1,5 @@ [tools] swiftformat = "0.54.3" -tuist = "4.195.10" +tuist = "4.195.11" swiftlint = "0.63.3" "git-cliff" = "2.13.1" From 57c2eb429334d40cb81fb2ddf7c6ea5d490b0f3b Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 2 Jun 2026 01:33:30 +0000 Subject: [PATCH 672/678] chore(deps): update dependency tuist to v4.195.12 (#1146) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise.toml b/.mise.toml index 3dac51a45..270dbef6e 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,5 +1,5 @@ [tools] swiftformat = "0.54.3" -tuist = "4.195.11" +tuist = "4.195.12" swiftlint = "0.63.3" "git-cliff" = "2.13.1" From 7604522d2ca20705927e5b344f500ac82a81f323 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 2 Jun 2026 22:59:18 +0000 Subject: [PATCH 673/678] chore(deps): update dependency tuist to v4.195.14 (#1148) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise.toml b/.mise.toml index 270dbef6e..b628e436f 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,5 +1,5 @@ [tools] swiftformat = "0.54.3" -tuist = "4.195.12" +tuist = "4.195.14" swiftlint = "0.63.3" "git-cliff" = "2.13.1" From b8819137bb0d3dbad5970615aaa8f3b76da9539d Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 3 Jun 2026 18:50:49 +0000 Subject: [PATCH 674/678] chore(deps): update actions/checkout digest to df4cb1c (#1149) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7789695f7..d6845f8d1 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -23,7 +23,7 @@ jobs: timeout-minutes: 15 if: "!startsWith(github.event.head_commit.message, '[Release]')" steps: - - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 + - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6 with: fetch-depth: 0 - uses: jdx/mise-action@v3 From 60e94af666938c6073322b5e7ced02e6375304d8 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 3 Jun 2026 21:14:59 +0000 Subject: [PATCH 675/678] chore(deps): update dependency tuist to v4.195.16 (#1150) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise.toml b/.mise.toml index b628e436f..5dd7d2fee 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,5 +1,5 @@ [tools] swiftformat = "0.54.3" -tuist = "4.195.14" +tuist = "4.195.16" swiftlint = "0.63.3" "git-cliff" = "2.13.1" From 5120d2e3121779e1f7482790342c04e93fd1e16d Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 4 Jun 2026 22:51:58 +0000 Subject: [PATCH 676/678] chore(deps): update dependency tuist to v4.195.17 (#1151) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise.toml b/.mise.toml index 5dd7d2fee..2564d3fa8 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,5 +1,5 @@ [tools] swiftformat = "0.54.3" -tuist = "4.195.16" +tuist = "4.195.17" swiftlint = "0.63.3" "git-cliff" = "2.13.1" From b5fc1e34f6d77a1ee411279424c1ce5004abe3ae Mon Sep 17 00:00:00 2001 From: Nuno de Carvalho <4029254+nmcc24@users.noreply.github.com> Date: Fri, 5 Jun 2026 12:43:34 +0100 Subject: [PATCH 677/678] feat: Compatibility with the iOS platform (#1016) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Fix compilation issues on iOS platform Currently, XcodeProj is not compilable on iOS platform. This is an issue when attempting to compile products that have XcodeProj as a (transitive) dependency * Skip tests on iOS platform that utilise unavailable APIs * Update xcodeproj.yml Add iOS simulator build and test stages to github workflow * Fix iOS workflow checks --------- Co-authored-by: Pedro Piñera Buendía --- .github/workflows/xcodeproj.yml | 24 +++++++- .../XcodeProj/Extensions/Path+Extras.swift | 2 +- Sources/XcodeProj/Extensions/String+md5.swift | 2 +- .../Extensions/XCTestCase+Shell.swift | 34 ++++++----- .../Scheme/XCSchemeManagementTests.swift | 60 ++++++++++--------- Tests/XcodeProjTests/Tests/testWrite.swift | 44 +++++++------- 6 files changed, 100 insertions(+), 66 deletions(-) diff --git a/.github/workflows/xcodeproj.yml b/.github/workflows/xcodeproj.yml index 3708202c4..5fe21d62f 100644 --- a/.github/workflows/xcodeproj.yml +++ b/.github/workflows/xcodeproj.yml @@ -33,6 +33,13 @@ jobs: - run: mise use swift@6.0.2 - name: Build run: swift build --configuration release + build-ios: + name: Build (iOS) + runs-on: macos-latest + steps: + - uses: actions/checkout@v6 + - name: Build for iOS Simulator + run: xcodebuild build -scheme XcodeProj -destination 'generic/platform=iOS Simulator' test: name: Test (macOS / Xcode) runs-on: macos-latest @@ -41,7 +48,6 @@ jobs: - uses: jdx/mise-action@v3 - name: Run tests run: mise run test - test-linux: name: Test (Linux) runs-on: ubuntu-latest @@ -55,6 +61,22 @@ jobs: git config --global init.defaultBranch main - name: Test run: swift test + test-ios: + name: Test (iOS / Xcode) + runs-on: macos-latest + steps: + - uses: actions/checkout@v3 + - name: Select iOS Simulator + run: | + simulator_id="$(xcrun simctl list devices available | awk -F '[()]' '/iPhone/ { print $2; exit }')" + if [ -z "$simulator_id" ]; then + echo "No available iPhone simulator found" + xcrun simctl list devices available + exit 1 + fi + echo "IOS_SIMULATOR_ID=$simulator_id" >> "$GITHUB_ENV" + - name: Run tests on iOS Simulator + run: xcodebuild test -scheme XcodeProj -destination "platform=iOS Simulator,id=$IOS_SIMULATOR_ID" lint: name: Lint diff --git a/Sources/XcodeProj/Extensions/Path+Extras.swift b/Sources/XcodeProj/Extensions/Path+Extras.swift index 4b76668eb..6327ac822 100644 --- a/Sources/XcodeProj/Extensions/Path+Extras.swift +++ b/Sources/XcodeProj/Extensions/Path+Extras.swift @@ -6,7 +6,7 @@ import PathKit // MARK: - Path extras. func systemGlob(_ pattern: UnsafePointer!, _ flags: Int32, _ errfunc: (@convention(c) (UnsafePointer?, Int32) -> Int32)!, _ vector_ptr: UnsafeMutablePointer!) -> Int32 { - #if os(macOS) + #if os(macOS) || os(iOS) return Darwin.glob(pattern, flags, errfunc, vector_ptr) #else return Glibc.glob(pattern, flags, errfunc, vector_ptr) diff --git a/Sources/XcodeProj/Extensions/String+md5.swift b/Sources/XcodeProj/Extensions/String+md5.swift index 1c0afa871..04be85b4c 100644 --- a/Sources/XcodeProj/Extensions/String+md5.swift +++ b/Sources/XcodeProj/Extensions/String+md5.swift @@ -31,7 +31,7 @@ extension String { return self } #if canImport(CryptoKit) - if #available(OSX 10.15, *) { + if #available(OSX 10.15, iOS 13.0, *) { return Insecure.MD5.hash(data: data) .withUnsafeBytes { Array($0) }.hexString } else { diff --git a/Tests/XcodeProjTests/Extensions/XCTestCase+Shell.swift b/Tests/XcodeProjTests/Extensions/XCTestCase+Shell.swift index 5ea654b4c..95d8c881c 100644 --- a/Tests/XcodeProjTests/Extensions/XCTestCase+Shell.swift +++ b/Tests/XcodeProjTests/Extensions/XCTestCase+Shell.swift @@ -3,23 +3,27 @@ import Foundation /// Returns the output of running `executable` with `args`. Throws an error if the process exits indicating failure. @discardableResult func checkedOutput(_ executable: String, _ args: [String]) throws -> String? { - let process = Process() - let output = Pipe() + #if os(iOS) + return nil + #else + let process = Process() + let output = Pipe() - if executable.contains("/") { - process.launchPath = executable - } else { - process.launchPath = try checkedOutput("/usr/bin/which", [executable])?.trimmingCharacters(in: .newlines) - } + if executable.contains("/") { + process.launchPath = executable + } else { + process.launchPath = try checkedOutput("/usr/bin/which", [executable])?.trimmingCharacters(in: .newlines) + } - process.arguments = args - process.standardOutput = output - process.launch() - process.waitUntilExit() + process.arguments = args + process.standardOutput = output + process.launch() + process.waitUntilExit() - guard process.terminationStatus == 0 else { - throw NSError(domain: NSPOSIXErrorDomain, code: Int(process.terminationStatus)) - } + guard process.terminationStatus == 0 else { + throw NSError(domain: NSPOSIXErrorDomain, code: Int(process.terminationStatus)) + } - return String(data: output.fileHandleForReading.readDataToEndOfFile(), encoding: .utf8) + return String(data: output.fileHandleForReading.readDataToEndOfFile(), encoding: .utf8) + #endif } diff --git a/Tests/XcodeProjTests/Scheme/XCSchemeManagementTests.swift b/Tests/XcodeProjTests/Scheme/XCSchemeManagementTests.swift index ed33c9749..9a5f719d7 100644 --- a/Tests/XcodeProjTests/Scheme/XCSchemeManagementTests.swift +++ b/Tests/XcodeProjTests/Scheme/XCSchemeManagementTests.swift @@ -45,38 +45,42 @@ final class XCSchemeManagementTests: XCTestCase { } func test_write_produces_no_diff() throws { - let tmpDir = try Path.uniqueTemporary() - defer { - try? tmpDir.delete() - } + #if os(iOS) + throw XCTSkip("'Process' API is unavailable on iOS platform") + #else + let tmpDir = try Path.uniqueTemporary() + defer { + try? tmpDir.delete() + } - try tmpDir.chdir { - // Write - let plistPath = tmpDir + "xcschememanagement.plist" - let subject = XCSchemeManagement( - schemeUserState: [ - .init(name: "Test 0.xcscheme", shared: true, orderHint: 0, isShown: true), - .init(name: "Test 1.xcscheme", shared: true, orderHint: 1, isShown: true), - .init(name: "Test 2.xcscheme", shared: true, orderHint: 2, isShown: false), - .init(name: "Test 3.xcscheme", shared: true, orderHint: 3, isShown: true), - ], - suppressBuildableAutocreation: [ - "E525238B16245A900012E2BA": .init(primary: true), - ] - ) - try subject.write(path: plistPath, override: true) + try tmpDir.chdir { + // Write + let plistPath = tmpDir + "xcschememanagement.plist" + let subject = XCSchemeManagement( + schemeUserState: [ + .init(name: "Test 0.xcscheme", shared: true, orderHint: 0, isShown: true), + .init(name: "Test 1.xcscheme", shared: true, orderHint: 1, isShown: true), + .init(name: "Test 2.xcscheme", shared: true, orderHint: 2, isShown: false), + .init(name: "Test 3.xcscheme", shared: true, orderHint: 3, isShown: true), + ], + suppressBuildableAutocreation: [ + "E525238B16245A900012E2BA": .init(primary: true), + ] + ) + try subject.write(path: plistPath, override: true) - // Create a commit - try checkedOutput("git", ["init"]) - try checkedOutput("git", ["add", "."]) - try checkedOutput("git", ["commit", "-m", "test"]) + // Create a commit + try checkedOutput("git", ["init"]) + try checkedOutput("git", ["add", "."]) + try checkedOutput("git", ["commit", "-m", "test"]) - // Write again - try subject.write(path: plistPath, override: true) + // Write again + try subject.write(path: plistPath, override: true) - let got = try checkedOutput("git", ["status"]) - XCTAssertTrue(got?.contains("nothing to commit") ?? false) - } + let got = try checkedOutput("git", ["status"]) + XCTAssertTrue(got?.contains("nothing to commit") ?? false) + } + #endif } private var xcschememanagementPath: Path { diff --git a/Tests/XcodeProjTests/Tests/testWrite.swift b/Tests/XcodeProjTests/Tests/testWrite.swift index 5362af16d..56b45dd61 100644 --- a/Tests/XcodeProjTests/Tests/testWrite.swift +++ b/Tests/XcodeProjTests/Tests/testWrite.swift @@ -45,28 +45,32 @@ func testReadWriteProducesNoDiff(file _: StaticString = #file, from path: Path, initModel: (Path) throws -> some Writable) throws { - let tmpDir = try Path.uniqueTemporary() - defer { - try? tmpDir.delete() - } + #if os(iOS) + throw XCTSkip("'Process' API is unavailable on iOS platform") + #else + let tmpDir = try Path.uniqueTemporary() + defer { + try? tmpDir.delete() + } - let fileName = path.lastComponent - let tmpPath = tmpDir + fileName - try path.copy(tmpPath) + let fileName = path.lastComponent + let tmpPath = tmpDir + fileName + try path.copy(tmpPath) - try tmpDir.chdir { - // Create a commit - try checkedOutput("git", ["init"]) - try checkedOutput("git", ["add", "."]) - try checkedOutput("git", [ - "-c", "user.email=test@example.com", "-c", "user.name=Test User", - "commit", "-m", "test", - ]) + try tmpDir.chdir { + // Create a commit + try checkedOutput("git", ["init"]) + try checkedOutput("git", ["add", "."]) + try checkedOutput("git", [ + "-c", "user.email=test@example.com", "-c", "user.name=Test User", + "commit", "-m", "test", + ]) - let object = try initModel(tmpPath) - try object.write(path: tmpPath, override: true) + let object = try initModel(tmpPath) + try object.write(path: tmpPath, override: true) - let diff = try XCTUnwrap(checkedOutput("git", ["diff"])) - XCTAssertEqual(diff, "") - } + let diff = try XCTUnwrap(checkedOutput("git", ["diff"])) + XCTAssertEqual(diff, "") + } + #endif } From 621eca8d091cc110a99adc23bb0d6618a65b4544 Mon Sep 17 00:00:00 2001 From: pepicrft <663605+pepicrft@users.noreply.github.com> Date: Fri, 5 Jun 2026 11:43:54 +0000 Subject: [PATCH 678/678] [Release] XcodeProj 9.13.0 --- CHANGELOG.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 970e3123d..3b5ceb00b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [9.13.0] - 2026-06-05 +### Details +#### Features +- Compatibility with the iOS platform by @nmcc24 in [#1016](https://github.com/tuist/XcodeProj/pull/1016) + +## New Contributors +* @nmcc24 made their first contribution in [#1016](https://github.com/tuist/XcodeProj/pull/1016) ## [9.12.0] - 2026-05-05 ### Details #### Features @@ -280,6 +287,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## New Contributors * @filipracki made their first contribution in [#834](https://github.com/tuist/XcodeProj/pull/834) +[9.13.0]: https://github.com/tuist/XcodeProj/compare/9.12.0..9.13.0 [9.12.0]: https://github.com/tuist/XcodeProj/compare/9.11.0..9.12.0 [9.11.0]: https://github.com/tuist/XcodeProj/compare/9.10.1..9.11.0 [9.10.1]: https://github.com/tuist/XcodeProj/compare/9.10.0..9.10.1