From 8911da9a708b546d80316321a6102807eb784782 Mon Sep 17 00:00:00 2001 From: DreamPiggy Date: Thu, 12 Dec 2019 21:14:13 +0800 Subject: [PATCH 1/2] Fix the compatible issue when using the Static Library (CocoaPods) to install SDWebImage, also keep the module import for framework target --- Cartfile.resolved | 2 +- SDWebImagePhotosPlugin/Classes/SDImagePhotosLoader.h | 6 +++++- SDWebImagePhotosPlugin/Classes/SDWebImagePhotosDefine.h | 4 ++++ 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/Cartfile.resolved b/Cartfile.resolved index 98fdac5..45c72b9 100644 --- a/Cartfile.resolved +++ b/Cartfile.resolved @@ -1 +1 @@ -github "SDWebImage/SDWebImage" "5.1.0" +github "SDWebImage/SDWebImage" "5.4.0" diff --git a/SDWebImagePhotosPlugin/Classes/SDImagePhotosLoader.h b/SDWebImagePhotosPlugin/Classes/SDImagePhotosLoader.h index c748aa6..6cdef53 100644 --- a/SDWebImagePhotosPlugin/Classes/SDImagePhotosLoader.h +++ b/SDWebImagePhotosPlugin/Classes/SDImagePhotosLoader.h @@ -6,8 +6,12 @@ * file that was distributed with this source code. */ +#if __has_include() +#import +#else @import SDWebImage; -@import Photos; +#endif +#import /** The imgae loader to load image asset from Photos library. You need to register the loader into manager firstly. Use `@import SDWebImagePhotosPlugin` to import full framework instead of each header. diff --git a/SDWebImagePhotosPlugin/Classes/SDWebImagePhotosDefine.h b/SDWebImagePhotosPlugin/Classes/SDWebImagePhotosDefine.h index d6e9c45..a82e4bb 100644 --- a/SDWebImagePhotosPlugin/Classes/SDWebImagePhotosDefine.h +++ b/SDWebImagePhotosPlugin/Classes/SDWebImagePhotosDefine.h @@ -6,7 +6,11 @@ * file that was distributed with this source code. */ +#if __has_include() +#import +#else @import SDWebImage; +#endif /** * The scheme when identifing the URL is Photos URL From 8141ce85d69abcd738814a002461d3d4b6dfe2ac Mon Sep 17 00:00:00 2001 From: DreamPiggy Date: Fri, 13 Dec 2019 11:53:08 +0800 Subject: [PATCH 2/2] Update the travis-CI script to the latest Xcode 11 --- .travis.yml | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/.travis.yml b/.travis.yml index cb058a0..0493b95 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,5 @@ language: objective-c -osx_image: xcode9.4 +osx_image: xcode11.2 env: global: @@ -15,10 +15,9 @@ notifications: before_install: - env - locale - - gem install cocoapods --no-rdoc --no-ri --no-document --quiet - - gem install xcpretty --no-rdoc --no-ri --no-document --quiet + - gem install cocoapods --no-document --quiet + - gem install xcpretty --no-document --quiet - pod --version - - pod setup --silent > /dev/null - pod repo update --silent - xcpretty --version - xcodebuild -version @@ -32,14 +31,14 @@ script: - echo Build example - pod install --project-directory=Example - - xcodebuild build -workspace Example/SDWebImagePhotosPlugin.xcworkspace -scheme SDWebImagePhotosPlugin-Example -sdk iphonesimulator -destination 'name=iPhone 8' ONLY_ACTIVE_ARCH=NO | xcpretty -c + - xcodebuild build -workspace Example/SDWebImagePhotosPlugin.xcworkspace -scheme SDWebImagePhotosPlugin-Example -destination 'platform=iOS Simulator,name=iPhone 11 Pro' -configuration Debug | xcpretty -c - echo Clean DerivedData + - rm -rf ~/Library/Developer/Xcode/DerivedData/ - mkdir DerivedData - - rm -rf ~/Library/Developer/Xcode/DerivedData - echo Run the tests - - xcodebuild test -workspace Example/SDWebImagePhotosPlugin.xcworkspace -scheme 'SDWebImagePhotosPlugin_Tests' -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 8' -configuration Debug | xcpretty -c + - xcodebuild test -workspace Example/SDWebImagePhotosPlugin.xcworkspace -scheme 'SDWebImagePhotosPlugin_Tests' -destination 'platform=iOS Simulator,name=iPhone 11 Pro' -configuration Debug | xcpretty -c - mv ~/Library/Developer/Xcode/DerivedData/ ./DerivedData/iOS after_success: