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( .target(
name: "SDWebImage", name: "SDWebImage",
dependencies: [], dependencies: [],
path: ".", path: "SDWebImage",
sources: ["SDWebImage/Core", "SDWebImage/Private"], exclude: ["MapKit"],
publicHeadersPath: "SDWebImage/Core", publicHeadersPath: "Core"
cSettings: [
.headerSearchPath("SDWebImage/Core"),
.headerSearchPath("SDWebImage/Private")
]
), ),
.target( .target(
name: "SDWebImageMapKit", name: "SDWebImageMapKit",
dependencies: ["SDWebImage"], dependencies: ["SDWebImage"],
path: ".", path: "SDWebImage/MapKit"
sources: ["SDWebImage/MapKit"],
publicHeadersPath: "SDWebImage/MapKit",
cSettings: [
.headerSearchPath("SDWebImage/Core"),
.headerSearchPath("SDWebImage/Private")
]
) )
] ]
) )

View File

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