Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option for not linking dependencies #109

Merged
merged 2 commits into from
Oct 26, 2017
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion Sources/ProjectSpec/Target.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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] {
Expand Down Expand Up @@ -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
}
Expand Down
2 changes: 1 addition & 1 deletion Sources/XcodeGenKit/PBXProjGenerator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down