Skip to content

Commit

Permalink
Fixed spm integration on regular Xcode project (#586)
Browse files Browse the repository at this point in the history
* work with imports.

* fixed imports for Xcode spa consumers

* added exmple project

* carthage workaround

* updated CI
  • Loading branch information
3a4oT authored Jan 6, 2021
1 parent 963b030 commit 543c2bc
Show file tree
Hide file tree
Showing 26 changed files with 835 additions and 40 deletions.
14 changes: 11 additions & 3 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,18 +42,26 @@ jobs:
name: Carthage
runs-on: macOS-latest
env:
# Carthage is broken in Xcode 12 and above https://github.com/Carthage/Carthage/blob/master/Documentation/Xcode12Workaround.md
DEVELOPER_DIR: /Applications/Xcode_11.7.app/Contents/Developer
DEVELOPER_DIR: /Applications/Xcode_12.2.app/Contents/Developer
steps:
- uses: actions/checkout@v2
- name: Carthage
run: make carthage
swift-package-manager:
runs-on: macos-latest
env:
DEVELOPER_DIR: /Applications/Xcode_12.app/Contents/Developer
DEVELOPER_DIR: /Applications/Xcode_12.2.app/Contents/Developer
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Verify that PINRemoteImage can be build by SPM
run: make spm
example-spm-xcode:
runs-on: macos-latest
env:
DEVELOPER_DIR: /Applications/Xcode_12.2.app/Contents/Developer
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Verify that PINRemoteImage can be build by Xcode's SPM integration
run: make example
368 changes: 368 additions & 0 deletions Examples/Example-Xcode-SPM/Example-Xcode-SPM.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,368 @@
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 52;
objects = {

/* Begin PBXBuildFile section */
FB3894CD2577F22F0025252E /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = FB3894CC2577F22F0025252E /* AppDelegate.swift */; };
FB3894CF2577F22F0025252E /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = FB3894CE2577F22F0025252E /* SceneDelegate.swift */; };
FB3894D12577F22F0025252E /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = FB3894D02577F22F0025252E /* ViewController.swift */; };
FB3894D42577F22F0025252E /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = FB3894D22577F22F0025252E /* Main.storyboard */; };
FB3894D62577F2300025252E /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = FB3894D52577F2300025252E /* Assets.xcassets */; };
FB3894D92577F2300025252E /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = FB3894D72577F2300025252E /* LaunchScreen.storyboard */; };
FB3894EE2577F8B40025252E /* PINRemoteImage in Frameworks */ = {isa = PBXBuildFile; productRef = FB3894ED2577F8B40025252E /* PINRemoteImage */; };
/* End PBXBuildFile section */

/* Begin PBXFileReference section */
FB3894C92577F22F0025252E /* Example-Xcode-SPM.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Example-Xcode-SPM.app"; sourceTree = BUILT_PRODUCTS_DIR; };
FB3894CC2577F22F0025252E /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
FB3894CE2577F22F0025252E /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = "<group>"; };
FB3894D02577F22F0025252E /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = "<group>"; };
FB3894D32577F22F0025252E /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
FB3894D52577F2300025252E /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
FB3894D82577F2300025252E /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
FB3894DA2577F2300025252E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
FB3894EB2577F8960025252E /* PINRemoteImage */ = {isa = PBXFileReference; lastKnownFileType = folder; name = PINRemoteImage; path = ../../..; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
FB3894C62577F22F0025252E /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
FB3894EE2577F8B40025252E /* PINRemoteImage in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */

/* Begin PBXGroup section */
FB3894C02577F22F0025252E = {
isa = PBXGroup;
children = (
FB3894CB2577F22F0025252E /* Example-Xcode-SPM */,
FB3894CA2577F22F0025252E /* Products */,
FB3894E42577F4490025252E /* Frameworks */,
);
sourceTree = "<group>";
};
FB3894CA2577F22F0025252E /* Products */ = {
isa = PBXGroup;
children = (
FB3894C92577F22F0025252E /* Example-Xcode-SPM.app */,
);
name = Products;
sourceTree = "<group>";
};
FB3894CB2577F22F0025252E /* Example-Xcode-SPM */ = {
isa = PBXGroup;
children = (
FB3894EB2577F8960025252E /* PINRemoteImage */,
FB3894CC2577F22F0025252E /* AppDelegate.swift */,
FB3894CE2577F22F0025252E /* SceneDelegate.swift */,
FB3894D02577F22F0025252E /* ViewController.swift */,
FB3894D22577F22F0025252E /* Main.storyboard */,
FB3894D52577F2300025252E /* Assets.xcassets */,
FB3894D72577F2300025252E /* LaunchScreen.storyboard */,
FB3894DA2577F2300025252E /* Info.plist */,
);
path = "Example-Xcode-SPM";
sourceTree = "<group>";
};
FB3894E42577F4490025252E /* Frameworks */ = {
isa = PBXGroup;
children = (
);
name = Frameworks;
sourceTree = "<group>";
};
/* End PBXGroup section */

/* Begin PBXNativeTarget section */
FB3894C82577F22F0025252E /* Example-Xcode-SPM */ = {
isa = PBXNativeTarget;
buildConfigurationList = FB3894DD2577F2300025252E /* Build configuration list for PBXNativeTarget "Example-Xcode-SPM" */;
buildPhases = (
FB3894C52577F22F0025252E /* Sources */,
FB3894C62577F22F0025252E /* Frameworks */,
FB3894C72577F22F0025252E /* Resources */,
);
buildRules = (
);
dependencies = (
);
name = "Example-Xcode-SPM";
packageProductDependencies = (
FB3894ED2577F8B40025252E /* PINRemoteImage */,
);
productName = "Example-Xcode-SPM";
productReference = FB3894C92577F22F0025252E /* Example-Xcode-SPM.app */;
productType = "com.apple.product-type.application";
};
/* End PBXNativeTarget section */

/* Begin PBXProject section */
FB3894C12577F22F0025252E /* Project object */ = {
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 1220;
LastUpgradeCheck = 1220;
TargetAttributes = {
FB3894C82577F22F0025252E = {
CreatedOnToolsVersion = 12.2;
};
};
};
buildConfigurationList = FB3894C42577F22F0025252E /* Build configuration list for PBXProject "Example-Xcode-SPM" */;
compatibilityVersion = "Xcode 9.3";
developmentRegion = en;
hasScannedForEncodings = 0;
knownRegions = (
en,
Base,
);
mainGroup = FB3894C02577F22F0025252E;
productRefGroup = FB3894CA2577F22F0025252E /* Products */;
projectDirPath = "";
projectRoot = "";
targets = (
FB3894C82577F22F0025252E /* Example-Xcode-SPM */,
);
};
/* End PBXProject section */

/* Begin PBXResourcesBuildPhase section */
FB3894C72577F22F0025252E /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
FB3894D92577F2300025252E /* LaunchScreen.storyboard in Resources */,
FB3894D62577F2300025252E /* Assets.xcassets in Resources */,
FB3894D42577F22F0025252E /* Main.storyboard in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXResourcesBuildPhase section */

/* Begin PBXSourcesBuildPhase section */
FB3894C52577F22F0025252E /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
FB3894D12577F22F0025252E /* ViewController.swift in Sources */,
FB3894CD2577F22F0025252E /* AppDelegate.swift in Sources */,
FB3894CF2577F22F0025252E /* SceneDelegate.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */

/* Begin PBXVariantGroup section */
FB3894D22577F22F0025252E /* Main.storyboard */ = {
isa = PBXVariantGroup;
children = (
FB3894D32577F22F0025252E /* Base */,
);
name = Main.storyboard;
sourceTree = "<group>";
};
FB3894D72577F2300025252E /* LaunchScreen.storyboard */ = {
isa = PBXVariantGroup;
children = (
FB3894D82577F2300025252E /* Base */,
);
name = LaunchScreen.storyboard;
sourceTree = "<group>";
};
/* End PBXVariantGroup section */

/* Begin XCBuildConfiguration section */
FB3894DB2577F2300025252E /* 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_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;
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 = 14.2;
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;
};
FB3894DC2577F2300025252E /* 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_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;
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 = 14.2;
MTL_ENABLE_DEBUG_INFO = NO;
MTL_FAST_MATH = YES;
SDKROOT = iphoneos;
SWIFT_COMPILATION_MODE = wholemodule;
SWIFT_OPTIMIZATION_LEVEL = "-O";
VALIDATE_PRODUCT = YES;
};
name = Release;
};
FB3894DE2577F2300025252E /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CODE_SIGN_STYLE = Automatic;
INFOPLIST_FILE = "Example-Xcode-SPM/Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
PRODUCT_BUNDLE_IDENTIFIER = "pinterest.Example-Xcode-SPM";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Debug;
};
FB3894DF2577F2300025252E /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CODE_SIGN_STYLE = Automatic;
INFOPLIST_FILE = "Example-Xcode-SPM/Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
PRODUCT_BUNDLE_IDENTIFIER = "pinterest.Example-Xcode-SPM";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Release;
};
/* End XCBuildConfiguration section */

/* Begin XCConfigurationList section */
FB3894C42577F22F0025252E /* Build configuration list for PBXProject "Example-Xcode-SPM" */ = {
isa = XCConfigurationList;
buildConfigurations = (
FB3894DB2577F2300025252E /* Debug */,
FB3894DC2577F2300025252E /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
FB3894DD2577F2300025252E /* Build configuration list for PBXNativeTarget "Example-Xcode-SPM" */ = {
isa = XCConfigurationList;
buildConfigurations = (
FB3894DE2577F2300025252E /* Debug */,
FB3894DF2577F2300025252E /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */

/* Begin XCSwiftPackageProductDependency section */
FB3894ED2577F8B40025252E /* PINRemoteImage */ = {
isa = XCSwiftPackageProductDependency;
productName = PINRemoteImage;
};
/* End XCSwiftPackageProductDependency section */
};
rootObject = FB3894C12577F22F0025252E /* Project object */;
}
Loading

0 comments on commit 543c2bc

Please sign in to comment.