Now I use another DSL to make it compile, this changes include the source code changes. Here it is:
-
SDWebImage/MapKit/MKAnnotationView+WebCache.m, now it can not search the headers inSDWebImage/Private/MyPrivateHeader.h, it now looks like any third party downstream dependency. So I have to duplicated the helper method twice and use some Runtime method call to workaround. I thinktargets in same package, is different from targets outside this pacakge, because the previous one can share the private utils code and header, but last one can notthis cause the issue ? But I found this is common design in most C/C++/ObjC code ?
2.The Package.swift DSL now changes to
targets: [
.target(
name: "SDWebImage",
dependencies: [],
path: "SDWebImage",
exclude: ["MapKit"],
publicHeadersPath: "Core"
),
.target(
name: "SDWebImageMapKit",
dependencies: ["SDWebImage"],
path: "SDWebImage/MapKit"
)
]
Note the publicHeadersPath: "Core" is required, because the Private folder source files, need the file (SDWebImageCompat.h) inside Core folder, they are not independent. Or this will cause compile error
Which I feels a little dissatisfied, this package also support CocoaPods && Carthage project, only SwiftPM need extra source code changes but not only package manager's DSL changes...