diff --git a/Package.swift b/Package.swift new file mode 100644 index 0000000..625f557 --- /dev/null +++ b/Package.swift @@ -0,0 +1,42 @@ +// swift-tools-version:5.0 +// The swift-tools-version declares the minimum version of Swift required to build this package. + +import PackageDescription + +let package = Package( + name: "SDWebImageFLPlugin", + platforms: [ + .iOS(.v9), + ], + products: [ + // Products define the executables and libraries produced by a package, and make them visible to other packages. + .library( + name: "SDWebImageFLPlugin", + targets: ["SDWebImageFLPlugin"] + ) + ], + dependencies: [ + .package( + url: "https://github.com/SDWebImage/SDWebImage.git", + from: "5.10.0" + ), + .package( + url: "https://github.com/Flipboard/FLAnimatedImage.git", + from: "1.0.11" + ) + ], + targets: [ + // Targets are the basic building blocks of a package. A target can define a module or a test suite. + // Targets can depend on other targets in this package, and on products in packages which this package depends on. + .target( + name: "SDWebImageFLPlugin", + dependencies: ["SDWebImage", "FLAnimatedImage"], + path: "SDWebImageFLPlugin", + sources: ["Classes/FLAnimatedImageBridge"], + publicHeadersPath: "Modules", + cSettings: [ + .headerSearchPath("Modules") + ] + ) + ] +) diff --git a/SDWebImageFLPlugin/Classes/FLAnimatedImageBridge/FLAnimatedImageView+WebCache.h b/SDWebImageFLPlugin/Classes/FLAnimatedImageBridge/FLAnimatedImageView+WebCache.h index a139eaf..177d37f 100644 --- a/SDWebImageFLPlugin/Classes/FLAnimatedImageBridge/FLAnimatedImageView+WebCache.h +++ b/SDWebImageFLPlugin/Classes/FLAnimatedImageBridge/FLAnimatedImageView+WebCache.h @@ -6,8 +6,16 @@ * file that was distributed with this source code. */ +#if __has_include() #import +#else +@import SDWebImage; +#endif +#if __has_include() #import +#else +@import FLAnimatedImage; +#endif #import "SDFLAnimatedImage.h" /** diff --git a/SDWebImageFLPlugin/Classes/FLAnimatedImageBridge/SDFLAnimatedImage.h b/SDWebImageFLPlugin/Classes/FLAnimatedImageBridge/SDFLAnimatedImage.h index b0bea95..a5a20ae 100644 --- a/SDWebImageFLPlugin/Classes/FLAnimatedImageBridge/SDFLAnimatedImage.h +++ b/SDWebImageFLPlugin/Classes/FLAnimatedImageBridge/SDFLAnimatedImage.h @@ -6,8 +6,16 @@ * file that was distributed with this source code. */ -#import +#if __has_include() #import +#else +@import SDWebImage; +#endif +#if __has_include() +#import +#else +@import FLAnimatedImage; +#endif /** * Optimal frame cache size of FLAnimatedImage during initializer. (1.0.11 version later) diff --git a/SDWebImageFLPlugin/Module/SDWebImageFLPlugin.h b/SDWebImageFLPlugin/Module/SDWebImageFLPlugin.h index a486a59..364947c 100644 --- a/SDWebImageFLPlugin/Module/SDWebImageFLPlugin.h +++ b/SDWebImageFLPlugin/Module/SDWebImageFLPlugin.h @@ -13,7 +13,6 @@ #import #import - FOUNDATION_EXPORT double SDWebImageFLPluginVersionNumber; FOUNDATION_EXPORT const unsigned char SDWebImageFLPluginVersionString[];