Skip to content
This repository was archived by the owner on Aug 3, 2022. It is now read-only.

Commit aaa137f

Browse files
authored
Add SPM support (#16)
* Create Package.swift * Update FLAnimatedImageView+WebCache.h * Update SDFLAnimatedImage.h * Update SDWebImageFLPlugin.h
1 parent 4cba51b commit aaa137f

File tree

4 files changed

+59
-2
lines changed

4 files changed

+59
-2
lines changed

Package.swift

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
// swift-tools-version:5.0
2+
// The swift-tools-version declares the minimum version of Swift required to build this package.
3+
4+
import PackageDescription
5+
6+
let package = Package(
7+
name: "SDWebImageFLPlugin",
8+
platforms: [
9+
.iOS(.v9),
10+
],
11+
products: [
12+
// Products define the executables and libraries produced by a package, and make them visible to other packages.
13+
.library(
14+
name: "SDWebImageFLPlugin",
15+
targets: ["SDWebImageFLPlugin"]
16+
)
17+
],
18+
dependencies: [
19+
.package(
20+
url: "https://github.com/SDWebImage/SDWebImage.git",
21+
from: "5.10.0"
22+
),
23+
.package(
24+
url: "https://github.com/Flipboard/FLAnimatedImage.git",
25+
from: "1.0.11"
26+
)
27+
],
28+
targets: [
29+
// Targets are the basic building blocks of a package. A target can define a module or a test suite.
30+
// Targets can depend on other targets in this package, and on products in packages which this package depends on.
31+
.target(
32+
name: "SDWebImageFLPlugin",
33+
dependencies: ["SDWebImage", "FLAnimatedImage"],
34+
path: "SDWebImageFLPlugin",
35+
sources: ["Classes/FLAnimatedImageBridge"],
36+
publicHeadersPath: "Modules",
37+
cSettings: [
38+
.headerSearchPath("Modules")
39+
]
40+
)
41+
]
42+
)

SDWebImageFLPlugin/Classes/FLAnimatedImageBridge/FLAnimatedImageView+WebCache.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,16 @@
66
* file that was distributed with this source code.
77
*/
88

9+
#if __has_include(<SDWebImage/SDWebImage.h>)
910
#import <SDWebImage/SDWebImage.h>
11+
#else
12+
@import SDWebImage;
13+
#endif
14+
#if __has_include(<FLAnimatedImage/FLAnimatedImage.h>)
1015
#import <FLAnimatedImage/FLAnimatedImage.h>
16+
#else
17+
@import FLAnimatedImage;
18+
#endif
1119
#import "SDFLAnimatedImage.h"
1220

1321
/**

SDWebImageFLPlugin/Classes/FLAnimatedImageBridge/SDFLAnimatedImage.h

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,16 @@
66
* file that was distributed with this source code.
77
*/
88

9-
#import <FLAnimatedImage/FLAnimatedImage.h>
9+
#if __has_include(<SDWebImage/SDWebImage.h>)
1010
#import <SDWebImage/SDWebImage.h>
11+
#else
12+
@import SDWebImage;
13+
#endif
14+
#if __has_include(<FLAnimatedImage/FLAnimatedImage.h>)
15+
#import <FLAnimatedImage/FLAnimatedImage.h>
16+
#else
17+
@import FLAnimatedImage;
18+
#endif
1119

1220
/**
1321
* Optimal frame cache size of FLAnimatedImage during initializer. (1.0.11 version later)

SDWebImageFLPlugin/Module/SDWebImageFLPlugin.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
#import <SDWebImageFLPlugin/FLAnimatedImageView+WebCache.h>
1414
#import <SDWebImageFLPlugin/SDFLAnimatedImage.h>
1515

16-
1716
FOUNDATION_EXPORT double SDWebImageFLPluginVersionNumber;
1817
FOUNDATION_EXPORT const unsigned char SDWebImageFLPluginVersionString[];
1918

0 commit comments

Comments
 (0)