From 0c39b28c0826bda68792b4d55f38d841bc7e9536 Mon Sep 17 00:00:00 2001 From: Yonas Kolb Date: Wed, 21 Mar 2018 11:02:45 +1100 Subject: [PATCH] upgrade to xcproj 4.2.0 --- Package.resolved | 8 ++++---- Sources/XcodeGenKit/SourceGenerator.swift | 4 ++-- Sources/XcodeGenKit/XCProjExtensions.swift | 2 +- .../TestProject/Project.xcodeproj/project.pbxproj | 10 ---------- 4 files changed, 7 insertions(+), 17 deletions(-) diff --git a/Package.resolved b/Package.resolved index 8e6222d8..e78eaac9 100644 --- a/Package.resolved +++ b/Package.resolved @@ -69,8 +69,8 @@ "repositoryURL": "https://github.com/jpsim/Yams.git", "state": { "branch": null, - "revision": "95f45caf07472ec78223ebada45255086a85b01a", - "version": "0.5.0" + "revision": "de06b2c819bb12e95bcdf75075b3336a8890e67c", + "version": "0.6.0" } }, { @@ -78,8 +78,8 @@ "repositoryURL": "https://github.com/xcodeswift/xcproj.git", "state": { "branch": null, - "revision": "723d57707fb18d4e6377ae773f46b1a2ca58d9c0", - "version": "4.1.0" + "revision": "eaddb983150f2eb1d308f4949b8e31d6cae4e7e9", + "version": "4.2.0" } } ] diff --git a/Sources/XcodeGenKit/SourceGenerator.swift b/Sources/XcodeGenKit/SourceGenerator.swift index 617bd53f..79a11ac7 100644 --- a/Sources/XcodeGenKit/SourceGenerator.swift +++ b/Sources/XcodeGenKit/SourceGenerator.swift @@ -219,8 +219,8 @@ class SourceGenerator { } else { let group = PBXVariantGroup( children: [], - name: path.lastComponent, - sourceTree: .group + sourceTree: .group, + name: path.lastComponent ) variantGroup = createObject(id: path.byRemovingBase(path: spec.basePath).string, group) variantGroupsByPath[path] = variantGroup diff --git a/Sources/XcodeGenKit/XCProjExtensions.swift b/Sources/XcodeGenKit/XCProjExtensions.swift index 0d34a446..62b845e4 100644 --- a/Sources/XcodeGenKit/XCProjExtensions.swift +++ b/Sources/XcodeGenKit/XCProjExtensions.swift @@ -8,7 +8,7 @@ extension PBXFileElement { } public var sortOrder: Int { - if self is PBXGroup { + if type(of: self).isa == "PBXGroup" { return 0 } else { return 1 diff --git a/Tests/Fixtures/TestProject/Project.xcodeproj/project.pbxproj b/Tests/Fixtures/TestProject/Project.xcodeproj/project.pbxproj index d7e9c225..9c586dd0 100644 --- a/Tests/Fixtures/TestProject/Project.xcodeproj/project.pbxproj +++ b/Tests/Fixtures/TestProject/Project.xcodeproj/project.pbxproj @@ -756,7 +756,6 @@ runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; shellScript = "echo \"You ran a script\"\n"; - showEnvVarsInLog = 0; }; SSBP_3150067808 /* Carthage */ = { isa = PBXShellScriptBuildPhase; @@ -773,7 +772,6 @@ runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; shellScript = "carthage copy-frameworks\n"; - showEnvVarsInLog = 0; }; SSBP_3886691194 /* MyScript */ = { isa = PBXShellScriptBuildPhase; @@ -788,7 +786,6 @@ runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; shellScript = "echo \"You ran a script\"\n"; - showEnvVarsInLog = 0; }; SSBP_5106020372 /* Strip Unused Architectures from Frameworks */ = { isa = PBXShellScriptBuildPhase; @@ -803,7 +800,6 @@ runOnlyForDeploymentPostprocessing = 1; shellPath = /bin/sh; shellScript = "################################################################################\n#\n# Copyright 2015 Realm Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n################################################################################\n\n# This script strips all non-valid architectures from dynamic libraries in\n# the application's `Frameworks` directory.\n#\n# The following environment variables are required:\n#\n# BUILT_PRODUCTS_DIR\n# FRAMEWORKS_FOLDER_PATH\n# VALID_ARCHS\n# EXPANDED_CODE_SIGN_IDENTITY\n\n\n# Signs a framework with the provided identity\ncode_sign() {\n # Use the current code_sign_identitiy\n echo \"Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}\"\n echo \"/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} --preserve-metadata=identifier,entitlements $1\"\n /usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} --preserve-metadata=identifier,entitlements \"$1\"\n}\n\n# Set working directory to product’s embedded frameworks\ncd \"${BUILT_PRODUCTS_DIR}/${FRAMEWORKS_FOLDER_PATH}\"\n\nif [ \"$ACTION\" = \"install\" ]; then\n echo \"Copy .bcsymbolmap files to .xcarchive\"\n find . -name '*.bcsymbolmap' -type f -exec mv {} \"${CONFIGURATION_BUILD_DIR}\" \\;\nelse\n # Delete *.bcsymbolmap files from framework bundle unless archiving\n find . -name '*.bcsymbolmap' -type f -exec rm -rf \"{}\" +\\;\nfi\n\necho \"Stripping frameworks\"\n\nfor file in $(find . -type f -perm +111); do\n # Skip non-dynamic libraries\n if ! [[ \"$(file \"$file\")\" == *\"dynamically linked shared library\"* ]]; then\n continue\n fi\n # Get architectures for current file\n archs=\"$(lipo -info \"${file}\" | rev | cut -d ':' -f1 | rev)\"\n stripped=\"\"\n for arch in $archs; do\n if ! [[ \"${VALID_ARCHS}\" == *\"$arch\"* ]]; then\n # Strip non-valid architectures in-place\n lipo -remove \"$arch\" -output \"$file\" \"$file\" || exit 1\n stripped=\"$stripped $arch\"\n fi\n done\n if [[ \"$stripped\" != \"\" ]]; then\n echo \"Stripped $file of architectures:$stripped\"\n if [ \"${CODE_SIGNING_REQUIRED}\" == \"YES\" ]; then\n code_sign \"${file}\"\n fi\n fi\ndone\n"; - showEnvVarsInLog = 0; }; SSBP_5954948530 /* Carthage */ = { isa = PBXShellScriptBuildPhase; @@ -820,7 +816,6 @@ runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; shellScript = "carthage copy-frameworks\n"; - showEnvVarsInLog = 0; }; SSBP_6331376344 /* MyScript */ = { isa = PBXShellScriptBuildPhase; @@ -835,7 +830,6 @@ runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; shellScript = "echo \"You ran a script\"\n"; - showEnvVarsInLog = 0; }; SSBP_6451525835 /* Carthage */ = { isa = PBXShellScriptBuildPhase; @@ -852,7 +846,6 @@ runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; shellScript = "carthage copy-frameworks\n"; - showEnvVarsInLog = 0; }; SSBP_8106229290 /* Carthage */ = { isa = PBXShellScriptBuildPhase; @@ -869,7 +862,6 @@ runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; shellScript = "carthage copy-frameworks\n"; - showEnvVarsInLog = 0; }; SSBP_8255377629 /* MyScript */ = { isa = PBXShellScriptBuildPhase; @@ -884,7 +876,6 @@ runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; shellScript = "echo \"You ran a script\"\n"; - showEnvVarsInLog = 0; }; SSBP_8706434794 /* MyScript */ = { isa = PBXShellScriptBuildPhase; @@ -899,7 +890,6 @@ runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; shellScript = "echo \"You ran a script!\"\n"; - showEnvVarsInLog = 0; }; /* End PBXShellScriptBuildPhase section */