Try to fix the issue caused by Swift PM 5.2, the `sources` DSL only matches the individual source files, but not folder

This commit is contained in:
DreamPiggy 2020-02-27 11:20:52 +08:00
parent aa7ff6f060
commit c0f796aa77
2 changed files with 6 additions and 20 deletions

View File

@ -30,24 +30,14 @@ let package = Package(
.target(
name: "SDWebImage",
dependencies: [],
path: ".",
sources: ["SDWebImage/Core", "SDWebImage/Private"],
publicHeadersPath: "SDWebImage/Core",
cSettings: [
.headerSearchPath("SDWebImage/Core"),
.headerSearchPath("SDWebImage/Private")
]
path: "SDWebImage",
exclude: ["MapKit"],
publicHeadersPath: "Core"
),
.target(
name: "SDWebImageMapKit",
dependencies: ["SDWebImage"],
path: ".",
sources: ["SDWebImage/MapKit"],
publicHeadersPath: "SDWebImage/MapKit",
cSettings: [
.headerSearchPath("SDWebImage/Core"),
.headerSearchPath("SDWebImage/Private")
]
path: "SDWebImage/MapKit"
)
]
)

View File

@ -10,10 +10,7 @@
#if SD_UIKIT || SD_MAC
#import "objc/runtime.h"
#import "UIView+WebCacheOperation.h"
#import "UIView+WebCache.h"
#import "SDInternalMacros.h"
@implementation MKAnnotationView (WebCache)
@ -55,14 +52,13 @@
context:(nullable SDWebImageContext *)context
progress:(nullable SDImageLoaderProgressBlock)progressBlock
completed:(nullable SDExternalCompletionBlock)completedBlock {
@weakify(self);
__weak typeof(self) wself = self;
[self sd_internalSetImageWithURL:url
placeholderImage:placeholder
options:options
context:context
setImageBlock:^(UIImage * _Nullable image, NSData * _Nullable imageData, SDImageCacheType cacheType, NSURL * _Nullable imageURL) {
@strongify(self);
self.image = image;
wself.image = image;
}
progress:progressBlock
completed:^(UIImage * _Nullable image, NSData * _Nullable data, NSError * _Nullable error, SDImageCacheType cacheType, BOOL finished, NSURL * _Nullable imageURL) {