Merge pull request #109 from yonaskolb/ks/link-dependency

Add option for not linking dependencies
This commit is contained in:
Yonas Kolb
2017-10-26 22:16:58 +02:00
committed by GitHub
3 changed files with 8 additions and 2 deletions
+6 -1
View File
@@ -201,6 +201,7 @@ public struct Dependency: Equatable {
public var embed: Bool?
public var codeSign: Bool = true
public var removeHeaders: Bool = true
public var link: Bool = true
public init(type: DependencyType, reference: String, embed: Bool? = nil) {
self.type = type
@@ -219,7 +220,8 @@ public struct Dependency: Equatable {
lhs.type == rhs.type &&
lhs.codeSign == rhs.codeSign &&
lhs.removeHeaders == rhs.removeHeaders &&
lhs.embed == rhs.embed
lhs.embed == rhs.embed &&
lhs.link == rhs.link
}
public var buildSettings: [String: Any] {
@@ -252,6 +254,9 @@ extension Dependency: JSONObjectConvertible {
embed = jsonDictionary.json(atKeyPath: "embed")
if let bool: Bool = jsonDictionary.json(atKeyPath: "link") {
link = bool
}
if let bool: Bool = jsonDictionary.json(atKeyPath: "codeSign") {
codeSign = bool
}
+1 -1
View File
@@ -248,7 +248,7 @@ public class PBXProjGenerator {
addObject(targetDependency)
dependencies.append(targetDependency.reference)
if dependencyTarget.type.isLibrary || dependencyTarget.type.isFramework {
if (dependencyTarget.type.isLibrary || dependencyTarget.type.isFramework) && dependency.link {
let dependencyBuildFile = targetBuildFiles[dependencyTargetName]!
let buildFile = PBXBuildFile(reference: generateUUID(PBXBuildFile.self, dependencyBuildFile.reference + target.name), fileRef: dependencyBuildFile.fileRef)
addObject(buildFile)
+1
View File
@@ -219,6 +219,7 @@ A dependency can be one of a 3 types:
These only applied to `target` and `framework` dependencies.
- ⚪️ **embed**: `Bool` - Whether to embed the dependency. Defaults to true for application target and false for non application targets.
- ⚪️ **link**: `Bool` - Whether to link the dependency. Defaults to true but only static library and dynamic frameworks are linked. This only applies for target dependencies.
- ⚪️ **codeSign**: `Bool` - Whether the `codeSignOnCopy` setting is applied when embedding framework. Defaults to true
- ⚪️ **removeHeaders**: `Bool` - Whether the `removeHeadersOnCopy` setting is applied when embedding the framework. Defaults to true