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

Commit 9340cfb

Browse files
authored
Merge pull request #10 from DwayneCoussement/master
Add SPM support
2 parents dc676d3 + c67daac commit 9340cfb

File tree

9 files changed

+107
-2
lines changed

9 files changed

+107
-2
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ DerivedData
1919
*.hmap
2020
*.ipa
2121

22+
# SPM
23+
.swiftpm/
24+
2225
# Bundler
2326
.bundle
2427

Package.resolved

Lines changed: 43 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Package.swift

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
// swift-tools-version:5.1
2+
// The swift-tools-version declares the minimum version of Swift required to build this package.
3+
import PackageDescription
4+
5+
let package = Package(
6+
name: "SDWebImageSVGKitPlugin",
7+
platforms: [
8+
.macOS(.v10_11), .iOS(.v13), .tvOS(.v13)
9+
],
10+
products: [
11+
// Products define the executables and libraries produced by a package, and make them visible to other packages.
12+
.library(
13+
name: "SDWebImageSVGKitPlugin",
14+
targets: ["SDWebImageSVGKitPlugin"]),
15+
],
16+
dependencies: [
17+
// Dependencies declare other packages that this package depends on.
18+
// .package(url: /* package url */, from: "1.0.0"),
19+
.package(url: "https://github.com/SDWebImage/SDWebImage.git", from: "5.10.0"),
20+
.package(url: "https://github.com/SVGKit/SVGKit.git", from: "3.0.0")
21+
],
22+
targets: [
23+
// Targets are the basic building blocks of a package. A target can define a module or a test suite.
24+
// Targets can depend on other targets in this package, and on products in packages which this package depends on.
25+
.target(
26+
name: "SDWebImageSVGKitPlugin",
27+
dependencies: ["SDWebImage", "SVGKit"],
28+
path: ".",
29+
sources: ["SDWebImageSVGKitPlugin/Classes"],
30+
publicHeadersPath: "SDWebImageSVGKitPlugin/Classes"
31+
)
32+
]
33+
)

SDWebImageSVGKitPlugin/Classes/SDImageSVGKCoder.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,11 @@
55
// Created by DreamPiggy on 2018/9/27.
66
//
77

8+
#if __has_include(<SDWebImage/SDWebImage.h>)
89
#import <SDWebImage/SDWebImage.h>
10+
#else
11+
@import SDWebImage;
12+
#endif
913

1014
NS_ASSUME_NONNULL_BEGIN
1115

SDWebImageSVGKitPlugin/Classes/SDImageSVGKCoder.m

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,11 @@
88
#import "SDImageSVGKCoder.h"
99
#import "SDSVGKImage.h"
1010
#import "SDWebImageSVGKitDefine.h"
11+
#if __has_include(<SVGKit/SVGKit.h>)
1112
#import <SVGKit/SVGKit.h>
12-
13+
#else
14+
@import SVGKit;
15+
#endif
1316
#define kSVGTagEnd @"</svg>"
1417

1518
@implementation SDImageSVGKCoder

SDWebImageSVGKitPlugin/Classes/SDSVGKImage.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,16 @@
55
// Created by DreamPiggy on 2018/10/10.
66
//
77

8+
#if __has_include(<SDWebImage/SDWebImage.h>)
89
#import <SDWebImage/SDWebImage.h>
10+
#else
11+
@import SDWebImage;
12+
#endif
13+
#if __has_include(<SVGKit/SVGKit.h>)
914
#import <SVGKit/SVGKit.h>
15+
#else
16+
@import SVGKit;
17+
#endif
1018

1119
NS_ASSUME_NONNULL_BEGIN
1220

SDWebImageSVGKitPlugin/Classes/SDWebImageSVGKitDefine.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,11 @@
55
// Created by DreamPiggy on 2018/10/11.
66
//
77

8+
#if __has_include(<SDWebImage/SDWebImage.h>)
89
#import <SDWebImage/SDWebImage.h>
10+
#else
11+
@import SDWebImage;
12+
#endif
913

1014
@class SVGKImage;
1115

SDWebImageSVGKitPlugin/Classes/SDWebImageSVGKitDefine.m

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,11 @@
66
//
77

88
#import "SDWebImageSVGKitDefine.h"
9+
#if __has_include(<SVGKit/SVGKit.h>)
910
#import <SVGKit/SVGKit.h>
10-
11+
#else
12+
@import SVGKit;
13+
#endif
1114
#if SD_UIKIT
1215
void SDAdjustSVGContentMode(SVGKImage * svgImage, UIViewContentMode contentMode, CGSize viewSize) {
1316
NSCParameterAssert(svgImage);

SDWebImageSVGKitPlugin/Classes/SVGKImageView+WebCache.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,11 @@
55
// Created by DreamPiggy on 2018/10/10.
66
//
77

8+
#if __has_include(<SVGKit/SVGKit.h>)
89
#import <SVGKit/SVGKit.h>
10+
#else
11+
@import SVGKit;
12+
#endif
913
#import "SDWebImageSVGKitDefine.h"
1014

1115
NS_ASSUME_NONNULL_BEGIN

0 commit comments

Comments
 (0)