Merge pull request #166 from sbarow/master

Add implicit option to framework Dependency
This commit is contained in:
Yonas Kolb
2017-11-21 14:10:49 +01:00
committed by GitHub
3 changed files with 19 additions and 4 deletions
+6
View File
@@ -247,6 +247,12 @@ These only applied to `target` and `framework` 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
**Implicit Framework options**:
This only applies to `framework` dependencies. Implicit framework dependencies are useful in Xcode Workspaces which have multiple `.xcodeproj` that are not embedded within each other yet have a dependency on a framework built in an adjacent `.xcodeproj`. By having `Find Implicit Dependencies` checked within your scheme `Build Options` Xcode can link built frameworks in `BUILT_PRODUCTS_DIR`.
- ⚪️ **implicit**: `Bool` - Whether the framework is an implicit dependency. Defaults to `false` .
**Carthage Dependency**
Carthage frameworks are expected to be in `CARTHAGE_BUILD_PATH/PLATFORM/FRAMEWORK.framework` where:
+7 -2
View File
@@ -17,12 +17,14 @@ public struct Dependency: Equatable {
public var codeSign: Bool = true
public var removeHeaders: Bool = true
public var link: Bool = true
public var implicit: Bool = false
public init(type: DependencyType, reference: String, embed: Bool? = nil, link: Bool = true) {
public init(type: DependencyType, reference: String, embed: Bool? = nil, link: Bool = true, implicit: Bool = false) {
self.type = type
self.reference = reference
self.embed = embed
self.link = link
self.implicit = implicit
}
public enum DependencyType {
@@ -69,7 +71,7 @@ extension Dependency: JSONObjectConvertible {
}
embed = jsonDictionary.json(atKeyPath: "embed")
if let bool: Bool = jsonDictionary.json(atKeyPath: "link") {
link = bool
}
@@ -79,5 +81,8 @@ extension Dependency: JSONObjectConvertible {
if let bool: Bool = jsonDictionary.json(atKeyPath: "removeHeaders") {
removeHeaders = bool
}
if let bool: Bool = jsonDictionary.json(atKeyPath: "implicit") {
implicit = bool
}
}
}
+6 -2
View File
@@ -276,8 +276,12 @@ public class PBXProjGenerator {
}
case .framework:
let fileReference = sourceGenerator.getFileReference(path: Path(dependency.reference), inPath: spec.basePath)
let fileReference: String
if dependency.implicit {
fileReference = sourceGenerator.getFileReference(path: Path(dependency.reference), inPath: spec.basePath, sourceTree: .buildProductsDir)
} else {
fileReference = sourceGenerator.getFileReference(path: Path(dependency.reference), inPath: spec.basePath)
}
let buildFile = PBXBuildFile(reference: referenceGenerator.generate(PBXBuildFile.self, fileReference + target.name), fileRef: fileReference)
addObject(buildFile)