Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Archive failures when using header_mappings_dir and Catalyst #10224

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion .rubocop_todo.yml
Expand Up @@ -237,7 +237,7 @@ Lint/UselessAccessModifier:
# Offense count: 373
# Configuration parameters: CountComments, ExcludedMethods.
Metrics/BlockLength:
Max: 1476
Max: 1493

# Offense count: 7099
# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns.
Expand Down
4 changes: 3 additions & 1 deletion CHANGELOG.md
Expand Up @@ -12,7 +12,9 @@ To install release candidates run `[sudo] gem install cocoapods --pre`

##### Bug Fixes

* None.
* Fix errors when archiving a Catalyst app which depends on a pod which uses header_mappings_dir.
[Thomas Goyne](https://github.com/tgoyne)
[#10224](https://github.com/CocoaPods/CocoaPods/pull/10224)

## 1.10.2

Expand Down
Expand Up @@ -9,16 +9,24 @@
/* Begin PBXBuildFile section */
295BB5621CEA95DE00E79F82 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 295BB5611CEA95DE00E79F82 /* AppDelegate.swift */; };
295BB5641CEA95DE00E79F82 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 295BB5631CEA95DE00E79F82 /* Assets.xcassets */; };
44CEACDCCD13E316EE074DA1 /* Pods_App.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AD4F2DCE25281A4C3DAC43C7 /* Pods_App.framework */; };
3F49FDA22566CB6000DB4C28 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 295BB5611CEA95DE00E79F82 /* AppDelegate.swift */; };
3F49FDA62566CB6000DB4C28 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 295BB5631CEA95DE00E79F82 /* Assets.xcassets */; };
44CEACDCCD13E316EE074DA1 /* BuildFile in Frameworks */ = {isa = PBXBuildFile; };
B4B33EF6E0070B20B05555D6 /* Pods_App.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4F60F2D3508AE8ED06682EB7 /* Pods_App.framework */; };
D58F29E1D5E5C3BFD7A7BFBC /* Pods_CatalystApp.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6FD0F347465854673E869234 /* Pods_CatalystApp.framework */; };
/* End PBXBuildFile section */

/* Begin PBXFileReference section */
0DFB53AE16B90D7F289BBEC2 /* Pods-CatalystApp.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-CatalystApp.debug.xcconfig"; path = "Target Support Files/Pods-CatalystApp/Pods-CatalystApp.debug.xcconfig"; sourceTree = "<group>"; };
295BB55E1CEA95DE00E79F82 /* App.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = App.app; sourceTree = BUILT_PRODUCTS_DIR; };
295BB5611CEA95DE00E79F82 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
295BB5631CEA95DE00E79F82 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
295BB5681CEA95DE00E79F82 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
3F49FDAB2566CB6000DB4C28 /* CatalystApp.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = CatalystApp.app; sourceTree = BUILT_PRODUCTS_DIR; };
4F60F2D3508AE8ED06682EB7 /* Pods_App.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_App.framework; sourceTree = BUILT_PRODUCTS_DIR; };
6FD0F347465854673E869234 /* Pods_CatalystApp.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_CatalystApp.framework; sourceTree = BUILT_PRODUCTS_DIR; };
8914945168DAAA34EFE099AF /* Pods-App.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-App.release.xcconfig"; path = "Target Support Files/Pods-App/Pods-App.release.xcconfig"; sourceTree = "<group>"; };
AD4F2DCE25281A4C3DAC43C7 /* Pods_App.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_App.framework; sourceTree = BUILT_PRODUCTS_DIR; };
A695CAA98C383BCC61786E74 /* Pods-CatalystApp.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-CatalystApp.release.xcconfig"; path = "Target Support Files/Pods-CatalystApp/Pods-CatalystApp.release.xcconfig"; sourceTree = "<group>"; };
E1928C2D408B1D2E8B3E2FA3 /* Pods-App.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-App.debug.xcconfig"; path = "Target Support Files/Pods-App/Pods-App.debug.xcconfig"; sourceTree = "<group>"; };
/* End PBXFileReference section */

Expand All @@ -27,7 +35,16 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
44CEACDCCD13E316EE074DA1 /* Pods_App.framework in Frameworks */,
44CEACDCCD13E316EE074DA1 /* BuildFile in Frameworks */,
B4B33EF6E0070B20B05555D6 /* Pods_App.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
3F49FDA32566CB6000DB4C28 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
D58F29E1D5E5C3BFD7A7BFBC /* Pods_CatalystApp.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand All @@ -37,17 +54,18 @@
295BB5551CEA95DE00E79F82 = {
isa = PBXGroup;
children = (
83215639ECD12CBC1F4DC4E3 /* Frameworks */,
295BB5601CEA95DE00E79F82 /* HeaderMappingsDir Example */,
295BB55F1CEA95DE00E79F82 /* Products */,
66AD76830CE2BBB6379CA47B /* Pods */,
83215639ECD12CBC1F4DC4E3 /* Frameworks */,
295BB55F1CEA95DE00E79F82 /* Products */,
);
sourceTree = "<group>";
};
295BB55F1CEA95DE00E79F82 /* Products */ = {
isa = PBXGroup;
children = (
295BB55E1CEA95DE00E79F82 /* App.app */,
3F49FDAB2566CB6000DB4C28 /* CatalystApp.app */,
);
name = Products;
sourceTree = "<group>";
Expand All @@ -67,15 +85,17 @@
children = (
E1928C2D408B1D2E8B3E2FA3 /* Pods-App.debug.xcconfig */,
8914945168DAAA34EFE099AF /* Pods-App.release.xcconfig */,
0DFB53AE16B90D7F289BBEC2 /* Pods-CatalystApp.debug.xcconfig */,
A695CAA98C383BCC61786E74 /* Pods-CatalystApp.release.xcconfig */,
);
name = Pods;
path = Pods;
sourceTree = "<group>";
};
83215639ECD12CBC1F4DC4E3 /* Frameworks */ = {
isa = PBXGroup;
children = (
AD4F2DCE25281A4C3DAC43C7 /* Pods_App.framework */,
4F60F2D3508AE8ED06682EB7 /* Pods_App.framework */,
6FD0F347465854673E869234 /* Pods_CatalystApp.framework */,
);
name = Frameworks;
sourceTree = "<group>";
Expand All @@ -102,6 +122,25 @@
productReference = 295BB55E1CEA95DE00E79F82 /* App.app */;
productType = "com.apple.product-type.application";
};
3F49FD9F2566CB6000DB4C28 /* CatalystApp */ = {
isa = PBXNativeTarget;
buildConfigurationList = 3F49FDA82566CB6000DB4C28 /* Build configuration list for PBXNativeTarget "CatalystApp" */;
buildPhases = (
3F49FDA02566CB6000DB4C28 /* [CP] Check Pods Manifest.lock */,
3F49FDA12566CB6000DB4C28 /* Sources */,
3F49FDA32566CB6000DB4C28 /* Frameworks */,
3F49FDA52566CB6000DB4C28 /* Resources */,
3F49FDA72566CB6000DB4C28 /* [CP] Embed Pods Frameworks */,
);
buildRules = (
);
dependencies = (
);
name = CatalystApp;
productName = "HeaderMappingsDir Example";
productReference = 3F49FDAB2566CB6000DB4C28 /* CatalystApp.app */;
productType = "com.apple.product-type.application";
};
/* End PBXNativeTarget section */

/* Begin PBXProject section */
Expand All @@ -122,6 +161,7 @@
developmentRegion = English;
hasScannedForEncodings = 0;
knownRegions = (
English,
en,
Base,
);
Expand All @@ -131,6 +171,7 @@
projectRoot = "";
targets = (
295BB55D1CEA95DE00E79F82 /* App */,
3F49FD9F2566CB6000DB4C28 /* CatalystApp */,
);
};
/* End PBXProject section */
Expand All @@ -144,9 +185,53 @@
);
runOnlyForDeploymentPostprocessing = 0;
};
3F49FDA52566CB6000DB4C28 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
3F49FDA62566CB6000DB4C28 /* Assets.xcassets in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXResourcesBuildPhase section */

/* Begin PBXShellScriptBuildPhase section */
3F49FDA02566CB6000DB4C28 /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
"${PODS_ROOT}/Manifest.lock",
);
name = "[CP] Check Pods Manifest.lock";
outputPaths = (
"$(DERIVED_FILE_DIR)/Pods-CatalystApp-checkManifestLockResult.txt",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
showEnvVarsInLog = 0;
};
3F49FDA72566CB6000DB4C28 /* [CP] Embed Pods Frameworks */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
"${PODS_ROOT}/Target Support Files/Pods-CatalystApp/Pods-CatalystApp-frameworks.sh",
"${BUILT_PRODUCTS_DIR}/HeaderMappingsDirPod-iOS/HeaderMappingsDirPod.framework",
);
name = "[CP] Embed Pods Frameworks";
outputPaths = (
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/HeaderMappingsDirPod.framework",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-CatalystApp/Pods-CatalystApp-frameworks.sh\"\n";
showEnvVarsInLog = 0;
};
62E9CD52D31153978437D4C2 /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
Expand All @@ -172,7 +257,7 @@
);
inputPaths = (
"${PODS_ROOT}/Target Support Files/Pods-App/Pods-App-frameworks.sh",
"${BUILT_PRODUCTS_DIR}/HeaderMappingsDirPod/HeaderMappingsDirPod.framework",
"${BUILT_PRODUCTS_DIR}/HeaderMappingsDirPod-macOS/HeaderMappingsDirPod.framework",
);
name = "[CP] Embed Pods Frameworks";
outputPaths = (
Expand All @@ -194,6 +279,14 @@
);
runOnlyForDeploymentPostprocessing = 0;
};
3F49FDA12566CB6000DB4C28 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
3F49FDA22566CB6000DB4C28 /* AppDelegate.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */

/* Begin XCBuildConfiguration section */
Expand Down Expand Up @@ -245,7 +338,8 @@
MACOSX_DEPLOYMENT_TARGET = 10.11;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = macosx;
SDKROOT = iphoneos;
SUPPORTED_PLATFORMS = "macosx iphoneos iphonesimulator";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 4.0;
};
Expand Down Expand Up @@ -292,7 +386,8 @@
GCC_WARN_UNUSED_VARIABLE = YES;
MACOSX_DEPLOYMENT_TARGET = 10.11;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = macosx;
SDKROOT = iphoneos;
SUPPORTED_PLATFORMS = "macosx iphoneos iphonesimulator";
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
SWIFT_VERSION = 4.0;
};
Expand All @@ -308,6 +403,9 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.HeaderMappingsDir-Example";
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = macosx;
SUPPORTS_MACCATALYST = YES;
TARGETED_DEVICE_FAMILY = "1,2,4";
};
name = Debug;
};
Expand All @@ -321,6 +419,39 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.HeaderMappingsDir-Example";
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = macosx;
SUPPORTS_MACCATALYST = YES;
TARGETED_DEVICE_FAMILY = "1,2,4";
};
name = Release;
};
3F49FDA92566CB6000DB4C28 /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 0DFB53AE16B90D7F289BBEC2 /* Pods-CatalystApp.debug.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
COMBINE_HIDPI_IMAGES = YES;
INFOPLIST_FILE = "HeaderMappingsDir Example/Info.plist";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.HeaderMappingsDir-Example";
PRODUCT_NAME = "$(TARGET_NAME)";
SUPPORTS_MACCATALYST = YES;
TARGETED_DEVICE_FAMILY = "1,2,4";
};
name = Debug;
};
3F49FDAA2566CB6000DB4C28 /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = A695CAA98C383BCC61786E74 /* Pods-CatalystApp.release.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
COMBINE_HIDPI_IMAGES = YES;
INFOPLIST_FILE = "HeaderMappingsDir Example/Info.plist";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.HeaderMappingsDir-Example";
PRODUCT_NAME = "$(TARGET_NAME)";
SUPPORTS_MACCATALYST = YES;
TARGETED_DEVICE_FAMILY = "1,2,4";
};
name = Release;
};
Expand All @@ -345,6 +476,15 @@
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
3F49FDA82566CB6000DB4C28 /* Build configuration list for PBXNativeTarget "CatalystApp" */ = {
isa = XCConfigurationList;
buildConfigurations = (
3F49FDA92566CB6000DB4C28 /* Debug */,
3F49FDAA2566CB6000DB4C28 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
rootObject = 295BB5561CEA95DE00E79F82 /* Project object */;
Expand Down
@@ -1,10 +1,23 @@
import Cocoa

import HeaderMappingsDirPod
import HeaderMappingsDirPod.Private

#if os(iOS)

import UIKit
@UIApplicationMain
class AppDelegate: NSObject, UIApplicationDelegate {

@IBOutlet weak var window: UIWindow?
}

#else

import Cocoa
@NSApplicationMain
class AppDelegate: NSObject, NSApplicationDelegate {

@IBOutlet weak var window: NSWindow!
}

#endif
Expand Up @@ -22,4 +22,5 @@ Pod::Spec.new do |s|
s.preserve_paths = %w(include)

s.osx.deployment_target = '10.9'
s.ios.deployment_target = '13.0'
end
7 changes: 6 additions & 1 deletion examples/HeaderMappingsDir Example/Podfile
Expand Up @@ -2,12 +2,17 @@ if (repo = ENV['COCOAPODS_SPEC_REPO'])
source "#{repo}"
end

platform :osx, '10.9'
use_frameworks!

workspace 'Examples.xcworkspace'
project 'HeaderMappingsDir Example.xcodeproj'

target 'App' do
platform :osx, '10.9'
pod 'HeaderMappingsDirPod', :path => 'HeaderMappingsDirPod'
end

target 'CatalystApp' do
platform :ios, '13.0'
pod 'HeaderMappingsDirPod', :path => 'HeaderMappingsDirPod'
end
Expand Up @@ -850,7 +850,7 @@ def test_target_swift_debug_hack(test_spec, test_target_bc)
end

# Creates a build phase which links the versioned header folders
# of the OS X into the framework bundle's root root directory.
# of the OS X framework into the framework bundle's root directory.
# This is only necessary because the way how headers are copied
# via custom copy file build phases in combination with
# header_mappings_dir interferes with xcodebuild's expectations
Expand All @@ -862,11 +862,16 @@ def test_target_swift_debug_hack(test_spec, test_target_bc)
# @return [void]
#
def create_build_phase_to_symlink_header_folders(native_target)
return unless target.platform.name == :osx && any_header_mapping_dirs?
# This is required on iOS for Catalyst, which uses macOS framework layouts
return unless (target.platform.name == :osx || target.platform.name == :ios) && any_header_mapping_dirs?

build_phase = native_target.new_shell_script_build_phase('Create Symlinks to Header Folders')
build_phase.shell_script = <<-eos.strip_heredoc
cd "$CONFIGURATION_BUILD_DIR/$WRAPPER_NAME" || exit 1
if [ ! -d Versions ]; then
# Not a versioned framework, so no need to do anything
exit 0
fi

public_path="${PUBLIC_HEADERS_FOLDER_PATH\#\$CONTENTS_FOLDER_PATH/}"
if [ ! -f "$public_path" ]; then
Expand Down