From 29e7c7a09f7f4b18824d3e7bdead8932ed0444f4 Mon Sep 17 00:00:00 2001 From: 3a4oT Date: Tue, 17 Nov 2020 16:05:38 +0200 Subject: [PATCH 1/5] work with imports. --- Package.swift | 2 +- Source/Classes/AnimatedImages/PINCachedAnimatedImage.m | 2 +- Source/Classes/AnimatedImages/PINWebPAnimatedImage.m | 4 ---- Source/Classes/Categories/NSData+ImageDetectors.m | 6 +----- Source/Classes/Categories/PINImage+WebP.m | 4 ---- Source/Classes/PINDisplayLink.m | 4 ---- Source/Classes/PINRemoteImageDownloadTask.h | 2 +- Source/Classes/PINRemoteImageManager.m | 2 +- Source/Classes/PINRemoteImageTask.h | 2 +- Source/Classes/include/PINCache+PINRemoteImageCaching.h | 2 +- Source/Classes/include/PINRemoteImageMacros.h | 2 +- 11 files changed, 8 insertions(+), 24 deletions(-) diff --git a/Package.swift b/Package.swift index 253a4208..dc2c544a 100644 --- a/Package.swift +++ b/Package.swift @@ -17,7 +17,7 @@ let package = Package( targets: ["PINRemoteImage"]), ], dependencies: [ - .package(url: "https://github.com/pinterest/PINCache.git", from: "3.0.2"), + .package(url: "https://github.com/pinterest/PINCache.git", from: "3.0.3"), .package(name: "libwebp", url: "https://github.com/SDWebImage/libwebp-Xcode", from: "1.1.0"), diff --git a/Source/Classes/AnimatedImages/PINCachedAnimatedImage.m b/Source/Classes/AnimatedImages/PINCachedAnimatedImage.m index 8f410639..ef406a42 100644 --- a/Source/Classes/AnimatedImages/PINCachedAnimatedImage.m +++ b/Source/Classes/AnimatedImages/PINCachedAnimatedImage.m @@ -14,7 +14,7 @@ #import "PINWebPAnimatedImage.h" #endif -#if SWIFT_PACKAGE +#if !__has_include() @import PINOperation; #else #import diff --git a/Source/Classes/AnimatedImages/PINWebPAnimatedImage.m b/Source/Classes/AnimatedImages/PINWebPAnimatedImage.m index da13aa4d..f7cd7c17 100644 --- a/Source/Classes/AnimatedImages/PINWebPAnimatedImage.m +++ b/Source/Classes/AnimatedImages/PINWebPAnimatedImage.m @@ -12,11 +12,7 @@ #import "NSData+ImageDetectors.h" -#if SWIFT_PACKAGE -@import libwebp; -#else #import "webp/demux.h" -#endif @interface PINWebPAnimatedImage () { diff --git a/Source/Classes/Categories/NSData+ImageDetectors.m b/Source/Classes/Categories/NSData+ImageDetectors.m index f58f5571..f290b88f 100644 --- a/Source/Classes/Categories/NSData+ImageDetectors.m +++ b/Source/Classes/Categories/NSData+ImageDetectors.m @@ -9,11 +9,7 @@ #import "NSData+ImageDetectors.h" #if PIN_WEBP - #if SWIFT_PACKAGE - @import libwebp; - #else - #import "webp/demux.h" - #endif +#import "webp/demux.h" #endif @implementation NSData (PINImageDetectors) diff --git a/Source/Classes/Categories/PINImage+WebP.m b/Source/Classes/Categories/PINImage+WebP.m index d2021d3a..a2466a79 100644 --- a/Source/Classes/Categories/PINImage+WebP.m +++ b/Source/Classes/Categories/PINImage+WebP.m @@ -10,11 +10,7 @@ #if PIN_WEBP -#if SWIFT_PACKAGE -@import libwebp; -#else #import "webp/decode.h" -#endif static void releaseData(void *info, const void *data, size_t size) { diff --git a/Source/Classes/PINDisplayLink.m b/Source/Classes/PINDisplayLink.m index 8235265f..4e70d464 100644 --- a/Source/Classes/PINDisplayLink.m +++ b/Source/Classes/PINDisplayLink.m @@ -9,11 +9,7 @@ #if PIN_TARGET_MAC -#if SWIFT_PACKAGE -@import CoreVideo.CVDisplayLink; -#else #import -#endif @interface PINDisplayLink () diff --git a/Source/Classes/PINRemoteImageDownloadTask.h b/Source/Classes/PINRemoteImageDownloadTask.h index bcd434d4..4aed96e4 100644 --- a/Source/Classes/PINRemoteImageDownloadTask.h +++ b/Source/Classes/PINRemoteImageDownloadTask.h @@ -6,7 +6,7 @@ // // -#if SWIFT_PACKAGE +#if !__has_include() @import PINOperation; #else #import diff --git a/Source/Classes/PINRemoteImageManager.m b/Source/Classes/PINRemoteImageManager.m index 5ef8ac17..79415f70 100644 --- a/Source/Classes/PINRemoteImageManager.m +++ b/Source/Classes/PINRemoteImageManager.m @@ -10,7 +10,7 @@ #import -#if SWIFT_PACKAGE +#if !__has_include() @import PINOperation; #else #import diff --git a/Source/Classes/PINRemoteImageTask.h b/Source/Classes/PINRemoteImageTask.h index 8026bfdf..75a4ab34 100644 --- a/Source/Classes/PINRemoteImageTask.h +++ b/Source/Classes/PINRemoteImageTask.h @@ -8,7 +8,7 @@ #import -#if SWIFT_PACKAGE +#if !__has_include() @import PINOperation; #else #import diff --git a/Source/Classes/include/PINCache+PINRemoteImageCaching.h b/Source/Classes/include/PINCache+PINRemoteImageCaching.h index f8a5eb13..a957be97 100644 --- a/Source/Classes/include/PINCache+PINRemoteImageCaching.h +++ b/Source/Classes/include/PINCache+PINRemoteImageCaching.h @@ -6,7 +6,7 @@ // // -#if SWIFT_PACKAGE +#if !__has_include() @import PINCache; #else #import diff --git a/Source/Classes/include/PINRemoteImageMacros.h b/Source/Classes/include/PINRemoteImageMacros.h index 5f5dd8ea..bd580a3a 100644 --- a/Source/Classes/include/PINRemoteImageMacros.h +++ b/Source/Classes/include/PINRemoteImageMacros.h @@ -27,7 +27,7 @@ #endif #ifndef PIN_WEBP - #if __has_include() || __has_include() + #if __has_include() || __has_include() || __has_include("webp/decode.h") #define PIN_WEBP 1 #else #define PIN_WEBP 0 From 35096a232727beab826a433c88320e594bfa72d2 Mon Sep 17 00:00:00 2001 From: 3a4oT Date: Tue, 17 Nov 2020 16:49:23 +0200 Subject: [PATCH 2/5] fixed imports for Xcode spa consumers --- Source/Classes/AnimatedImages/PINCachedAnimatedImage.m | 2 +- Source/Classes/PINRemoteImageDownloadTask.h | 2 +- Source/Classes/PINRemoteImageManager.m | 2 +- Source/Classes/PINRemoteImageTask.h | 2 +- Source/Classes/include/PINCache+PINRemoteImageCaching.h | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Source/Classes/AnimatedImages/PINCachedAnimatedImage.m b/Source/Classes/AnimatedImages/PINCachedAnimatedImage.m index ef406a42..b89701bb 100644 --- a/Source/Classes/AnimatedImages/PINCachedAnimatedImage.m +++ b/Source/Classes/AnimatedImages/PINCachedAnimatedImage.m @@ -15,7 +15,7 @@ #endif #if !__has_include() -@import PINOperation; +#import "PINOperation.h" #else #import #endif diff --git a/Source/Classes/PINRemoteImageDownloadTask.h b/Source/Classes/PINRemoteImageDownloadTask.h index 4aed96e4..fea33ec7 100644 --- a/Source/Classes/PINRemoteImageDownloadTask.h +++ b/Source/Classes/PINRemoteImageDownloadTask.h @@ -7,7 +7,7 @@ // #if !__has_include() -@import PINOperation; +#import "PINOperation.h" #else #import #endif diff --git a/Source/Classes/PINRemoteImageManager.m b/Source/Classes/PINRemoteImageManager.m index 79415f70..57adce8b 100644 --- a/Source/Classes/PINRemoteImageManager.m +++ b/Source/Classes/PINRemoteImageManager.m @@ -11,7 +11,7 @@ #import #if !__has_include() -@import PINOperation; +#import "PINOperation.h" #else #import #endif diff --git a/Source/Classes/PINRemoteImageTask.h b/Source/Classes/PINRemoteImageTask.h index 75a4ab34..4fe778f5 100644 --- a/Source/Classes/PINRemoteImageTask.h +++ b/Source/Classes/PINRemoteImageTask.h @@ -9,7 +9,7 @@ #import #if !__has_include() -@import PINOperation; +#import "PINOperation.h" #else #import #endif diff --git a/Source/Classes/include/PINCache+PINRemoteImageCaching.h b/Source/Classes/include/PINCache+PINRemoteImageCaching.h index a957be97..a1d48822 100644 --- a/Source/Classes/include/PINCache+PINRemoteImageCaching.h +++ b/Source/Classes/include/PINCache+PINRemoteImageCaching.h @@ -7,7 +7,7 @@ // #if !__has_include() -@import PINCache; +#import "PINCache.h" #else #import #endif From 2ad9f4997fa63ec9469103de226b977ed03a86db Mon Sep 17 00:00:00 2001 From: 3a4oT Date: Wed, 2 Dec 2020 19:27:20 +0200 Subject: [PATCH 3/5] added exmple project --- .../project.pbxproj | 368 ++++++++++++++++++ .../contents.xcworkspacedata | 7 + .../xcshareddata/IDEWorkspaceChecks.plist | 8 + .../Example-Xcode-SPM/AppDelegate.swift | 36 ++ .../AccentColor.colorset/Contents.json | 11 + .../AppIcon.appiconset/Contents.json | 98 +++++ .../Assets.xcassets/Contents.json | 6 + .../Base.lproj/LaunchScreen.storyboard | 25 ++ .../Base.lproj/Main.storyboard | 64 +++ .../Example-Xcode-SPM/Info.plist | 66 ++++ .../Example-Xcode-SPM/SceneDelegate.swift | 52 +++ .../Example-Xcode-SPM/ViewController.swift | 31 ++ 12 files changed, 772 insertions(+) create mode 100644 Examples/Example-Xcode-SPM/Example-Xcode-SPM.xcodeproj/project.pbxproj create mode 100644 Examples/Example-Xcode-SPM/Example-Xcode-SPM.xcodeproj/project.xcworkspace/contents.xcworkspacedata create mode 100644 Examples/Example-Xcode-SPM/Example-Xcode-SPM.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist create mode 100644 Examples/Example-Xcode-SPM/Example-Xcode-SPM/AppDelegate.swift create mode 100644 Examples/Example-Xcode-SPM/Example-Xcode-SPM/Assets.xcassets/AccentColor.colorset/Contents.json create mode 100644 Examples/Example-Xcode-SPM/Example-Xcode-SPM/Assets.xcassets/AppIcon.appiconset/Contents.json create mode 100644 Examples/Example-Xcode-SPM/Example-Xcode-SPM/Assets.xcassets/Contents.json create mode 100644 Examples/Example-Xcode-SPM/Example-Xcode-SPM/Base.lproj/LaunchScreen.storyboard create mode 100644 Examples/Example-Xcode-SPM/Example-Xcode-SPM/Base.lproj/Main.storyboard create mode 100644 Examples/Example-Xcode-SPM/Example-Xcode-SPM/Info.plist create mode 100644 Examples/Example-Xcode-SPM/Example-Xcode-SPM/SceneDelegate.swift create mode 100644 Examples/Example-Xcode-SPM/Example-Xcode-SPM/ViewController.swift diff --git a/Examples/Example-Xcode-SPM/Example-Xcode-SPM.xcodeproj/project.pbxproj b/Examples/Example-Xcode-SPM/Example-Xcode-SPM.xcodeproj/project.pbxproj new file mode 100644 index 00000000..0a253ac2 --- /dev/null +++ b/Examples/Example-Xcode-SPM/Example-Xcode-SPM.xcodeproj/project.pbxproj @@ -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 = ""; }; + FB3894CE2577F22F0025252E /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = ""; }; + FB3894D02577F22F0025252E /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; + FB3894D32577F22F0025252E /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + FB3894D52577F2300025252E /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + FB3894D82577F2300025252E /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + FB3894DA2577F2300025252E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + FB3894EB2577F8960025252E /* PINRemoteImage */ = {isa = PBXFileReference; lastKnownFileType = folder; name = PINRemoteImage; path = ../../..; sourceTree = ""; }; +/* 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 = ""; + }; + FB3894CA2577F22F0025252E /* Products */ = { + isa = PBXGroup; + children = ( + FB3894C92577F22F0025252E /* Example-Xcode-SPM.app */, + ); + name = Products; + sourceTree = ""; + }; + 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 = ""; + }; + FB3894E42577F4490025252E /* Frameworks */ = { + isa = PBXGroup; + children = ( + ); + name = Frameworks; + sourceTree = ""; + }; +/* 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 = ""; + }; + FB3894D72577F2300025252E /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + FB3894D82577F2300025252E /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; +/* 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 */; +} diff --git a/Examples/Example-Xcode-SPM/Example-Xcode-SPM.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/Examples/Example-Xcode-SPM/Example-Xcode-SPM.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 00000000..919434a6 --- /dev/null +++ b/Examples/Example-Xcode-SPM/Example-Xcode-SPM.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/Examples/Example-Xcode-SPM/Example-Xcode-SPM.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/Examples/Example-Xcode-SPM/Example-Xcode-SPM.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 00000000..18d98100 --- /dev/null +++ b/Examples/Example-Xcode-SPM/Example-Xcode-SPM.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/Examples/Example-Xcode-SPM/Example-Xcode-SPM/AppDelegate.swift b/Examples/Example-Xcode-SPM/Example-Xcode-SPM/AppDelegate.swift new file mode 100644 index 00000000..911aa4ea --- /dev/null +++ b/Examples/Example-Xcode-SPM/Example-Xcode-SPM/AppDelegate.swift @@ -0,0 +1,36 @@ +// +// AppDelegate.swift +// Example-Xcode-SPM +// +// Created by Petro Rovenskyy on 02.12.2020. +// + +import UIKit + +@main +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/Examples/Example-Xcode-SPM/Example-Xcode-SPM/Assets.xcassets/AccentColor.colorset/Contents.json b/Examples/Example-Xcode-SPM/Example-Xcode-SPM/Assets.xcassets/AccentColor.colorset/Contents.json new file mode 100644 index 00000000..eb878970 --- /dev/null +++ b/Examples/Example-Xcode-SPM/Example-Xcode-SPM/Assets.xcassets/AccentColor.colorset/Contents.json @@ -0,0 +1,11 @@ +{ + "colors" : [ + { + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Examples/Example-Xcode-SPM/Example-Xcode-SPM/Assets.xcassets/AppIcon.appiconset/Contents.json b/Examples/Example-Xcode-SPM/Example-Xcode-SPM/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 00000000..9221b9bb --- /dev/null +++ b/Examples/Example-Xcode-SPM/Example-Xcode-SPM/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/Examples/Example-Xcode-SPM/Example-Xcode-SPM/Assets.xcassets/Contents.json b/Examples/Example-Xcode-SPM/Example-Xcode-SPM/Assets.xcassets/Contents.json new file mode 100644 index 00000000..73c00596 --- /dev/null +++ b/Examples/Example-Xcode-SPM/Example-Xcode-SPM/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Examples/Example-Xcode-SPM/Example-Xcode-SPM/Base.lproj/LaunchScreen.storyboard b/Examples/Example-Xcode-SPM/Example-Xcode-SPM/Base.lproj/LaunchScreen.storyboard new file mode 100644 index 00000000..865e9329 --- /dev/null +++ b/Examples/Example-Xcode-SPM/Example-Xcode-SPM/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Examples/Example-Xcode-SPM/Example-Xcode-SPM/Base.lproj/Main.storyboard b/Examples/Example-Xcode-SPM/Example-Xcode-SPM/Base.lproj/Main.storyboard new file mode 100644 index 00000000..17984893 --- /dev/null +++ b/Examples/Example-Xcode-SPM/Example-Xcode-SPM/Base.lproj/Main.storyboard @@ -0,0 +1,64 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Examples/Example-Xcode-SPM/Example-Xcode-SPM/Info.plist b/Examples/Example-Xcode-SPM/Example-Xcode-SPM/Info.plist new file mode 100644 index 00000000..5b531f7b --- /dev/null +++ b/Examples/Example-Xcode-SPM/Example-Xcode-SPM/Info.plist @@ -0,0 +1,66 @@ + + + + + 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 + UISceneStoryboardFile + Main + + + + + UIApplicationSupportsIndirectInputEvents + + UILaunchStoryboardName + LaunchScreen + UIMainStoryboardFile + Main + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/Examples/Example-Xcode-SPM/Example-Xcode-SPM/SceneDelegate.swift b/Examples/Example-Xcode-SPM/Example-Xcode-SPM/SceneDelegate.swift new file mode 100644 index 00000000..e25f3342 --- /dev/null +++ b/Examples/Example-Xcode-SPM/Example-Xcode-SPM/SceneDelegate.swift @@ -0,0 +1,52 @@ +// +// SceneDelegate.swift +// Example-Xcode-SPM +// +// Created by Petro Rovenskyy on 02.12.2020. +// + +import UIKit + +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). + guard let _ = (scene as? UIWindowScene) else { return } + } + + 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 necessarily 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/Examples/Example-Xcode-SPM/Example-Xcode-SPM/ViewController.swift b/Examples/Example-Xcode-SPM/Example-Xcode-SPM/ViewController.swift new file mode 100644 index 00000000..d548ce53 --- /dev/null +++ b/Examples/Example-Xcode-SPM/Example-Xcode-SPM/ViewController.swift @@ -0,0 +1,31 @@ +// +// ViewController.swift +// Example-Xcode-SPM +// +// Created by Petro Rovenskyy on 02.12.2020. +// + +import UIKit +import PINRemoteImage + +class ViewController: UIViewController { + @IBOutlet weak var info: UILabel! + @IBOutlet weak var imgView: PINAnimatedImageView! + + override func viewDidLoad() { + super.viewDidLoad() + // Do any additional setup after loading the view. + self.info.text = "PINRemoteImage+SPM+Xcode=🥰" + self.imgView.pin_updateWithProgress = true + } + override func viewWillAppear(_ animated: Bool) { + super.viewWillAppear(animated) + guard let imageURL = URL(string: "https://i.pinimg.com/originals/f5/23/f1/f523f141646b613f78566ba964208990.gif") else { + return + } + self.imgView.pin_setImage(from: imageURL) + } + + +} + From 819ce2186420074c1da8b39d202e34d86a899152 Mon Sep 17 00:00:00 2001 From: 3a4oT Date: Wed, 2 Dec 2020 19:35:20 +0200 Subject: [PATCH 4/5] carthage workaround --- .github/workflows/ci.yaml | 5 ++--- Makefile | 9 +++------ carthage.sh | 23 +++++++++++++++++++++++ 3 files changed, 28 insertions(+), 9 deletions(-) create mode 100755 carthage.sh diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index ada28869..0db93003 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -42,8 +42,7 @@ 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 @@ -51,7 +50,7 @@ jobs: 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 diff --git a/Makefile b/Makefile index 7029a5a5..3f763103 100644 --- a/Makefile +++ b/Makefile @@ -21,12 +21,9 @@ test: CODE_SIGNING_REQUIRED=NO | xcpretty carthage: - if [ ${XCODE_MAJOR_VERSION} -gt 11 ] ; then \ - echo "Carthage no longer works in Xcode 12 https://github.com/Carthage/Carthage/blob/master/Documentation/Xcode12Workaround.md"; \ - exit 1; \ - fi - carthage update --no-use-binaries --no-build - carthage build --no-use-binaries --no-skip-current + ##### Apply workaround https://github.com/Carthage/Carthage/issues/3019#issuecomment-734415287 + ./carthage.sh update --no-use-binaries --no-build; \ + ./carthage.sh build --no-skip-current; webp: carthage update --no-use-binaries --no-build diff --git a/carthage.sh b/carthage.sh new file mode 100755 index 00000000..3c342b62 --- /dev/null +++ b/carthage.sh @@ -0,0 +1,23 @@ + +#!/usr/bin/env bash + +# ISSUE: https://github.com/Carthage/Carthage/issues/3019 +# CREDITS: https://github.com/Carthage/Carthage/issues/3019#issuecomment-734415287 +# carthage.sh +# Usage example: ./carthage.sh build --platform iOS + +set -euo pipefail + +xcconfig=$(mktemp /tmp/static.xcconfig.XXXXXX) +trap 'rm -f "$xcconfig"' INT TERM HUP EXIT + +# For Xcode 12 make sure EXCLUDED_ARCHS is set to arm architectures otherwise +# the build will fail on lipo due to duplicate architectures. +for simulator in iphonesimulator appletvsimulator; do + echo "EXCLUDED_ARCHS__EFFECTIVE_PLATFORM_SUFFIX_${simulator}__NATIVE_ARCH_64_BIT_x86_64__XCODE_1200 = arm64 arm64e armv7 armv7s armv6 armv8" >> $xcconfig +done +echo 'EXCLUDED_ARCHS = $(inherited) $(EXCLUDED_ARCHS__EFFECTIVE_PLATFORM_SUFFIX_$(PLATFORM_NAME)__NATIVE_ARCH_64_BIT_$(NATIVE_ARCH_64_BIT)__XCODE_$(XCODE_VERSION_MAJOR))' >> $xcconfig + +export XCODE_XCCONFIG_FILE="$xcconfig" +cat $XCODE_XCCONFIG_FILE +carthage "$@" From 4e11daa1a77e6f98a6e9da292c2c76eb25049a40 Mon Sep 17 00:00:00 2001 From: 3a4oT Date: Wed, 2 Dec 2020 19:49:43 +0200 Subject: [PATCH 5/5] updated CI --- .github/workflows/ci.yaml | 9 +++++++++ Makefile | 19 +++++++++++++++---- 2 files changed, 24 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 0db93003..2c52b9af 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -56,3 +56,12 @@ jobs: 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 diff --git a/Makefile b/Makefile index 3f763103..b3e665f8 100644 --- a/Makefile +++ b/Makefile @@ -2,8 +2,10 @@ PLATFORM="platform=iOS Simulator,name=iPhone 11" SDK="iphonesimulator" SHELL=/bin/bash -o pipefail XCODE_MAJOR_VERSION=$(shell xcodebuild -version | HEAD -n 1 | sed -E 's/Xcode ([0-9]+).*/\1/') +IOS_EXAMPLE_PROJECT="Examples/Example-Xcode-SPM/Example-Xcode-SPM.xcodeproj" +EXAMPLE_SCHEME="Example-Xcode-SPM" -.PHONY: all webp cocoapods test carthage analyze spm +.PHONY: all webp cocoapods test carthage analyze spm example cocoapods: pod lib lint @@ -22,8 +24,8 @@ test: carthage: ##### Apply workaround https://github.com/Carthage/Carthage/issues/3019#issuecomment-734415287 - ./carthage.sh update --no-use-binaries --no-build; \ - ./carthage.sh build --no-skip-current; + ./carthage.sh update --no-use-binaries --no-build; \ + ./carthage.sh build --no-skip-current; webp: carthage update --no-use-binaries --no-build @@ -31,5 +33,14 @@ webp: spm: swift build + +example: + if [ ${XCODE_MAJOR_VERSION} -lt 12 ] ; then \ + echo "Xcode 12 and Swift 5.3 reqiured to build example project"; \ + exit 1; \ + fi + xcodebuild clean build -project ${IOS_EXAMPLE_PROJECT} -scheme ${EXAMPLE_SCHEME} -destination ${PLATFORM} -sdk ${SDK} \ + ONLY_ACTIVE_ARCH=NO \ + CODE_SIGNING_REQUIRED=NO | xcpretty -all: carthage test cocoapods analyze spm \ No newline at end of file +all: carthage test cocoapods analyze spm example \ No newline at end of file