rename includeCarthageRelatedDependencies to findCarthageFrameworks and includeRelated to findFrameworks

This commit is contained in:
yonaskolb
2019-03-24 22:59:29 +11:00
parent 5accd0e095
commit bcbc83dd75
12 changed files with 43 additions and 43 deletions
+3 -3
View File
@@ -33,7 +33,7 @@ public struct Dependency: Equatable {
public enum DependencyType: Equatable {
case target
case framework
case carthage(includeRelated: Bool?)
case carthage(findFrameworks: Bool?)
case sdk
}
}
@@ -54,8 +54,8 @@ extension Dependency: JSONObjectConvertible {
type = .framework
reference = framework
} else if let carthage: String = jsonDictionary.json(atKeyPath: "carthage") {
let includeRelated: Bool? = jsonDictionary.json(atKeyPath: "includeRelated")
type = .carthage(includeRelated: includeRelated)
let findFrameworks: Bool? = jsonDictionary.json(atKeyPath: "findFrameworks")
type = .carthage(findFrameworks: findFrameworks)
reference = carthage
} else if let sdk: String = jsonDictionary.json(atKeyPath: "sdk") {
type = .sdk
+4 -4
View File
@@ -20,7 +20,7 @@ public struct SpecOptions: Equatable {
public var transitivelyLinkDependencies: Bool
public var groupSortPosition: GroupSortPosition
public var generateEmptyDirectories: Bool
public var includeCarthageRelatedDependencies: Bool
public var findCarthageFrameworks: Bool
public enum ValidationType: String {
case missingConfigs
@@ -76,7 +76,7 @@ public struct SpecOptions: Equatable {
transitivelyLinkDependencies: Bool = false,
groupSortPosition: GroupSortPosition = .bottom,
generateEmptyDirectories: Bool = false,
includeCarthageRelatedDependencies: Bool = false
findCarthageFrameworks: Bool = false
) {
self.minimumXcodeGenVersion = minimumXcodeGenVersion
self.carthageBuildPath = carthageBuildPath
@@ -95,7 +95,7 @@ public struct SpecOptions: Equatable {
self.transitivelyLinkDependencies = transitivelyLinkDependencies
self.groupSortPosition = groupSortPosition
self.generateEmptyDirectories = generateEmptyDirectories
self.includeCarthageRelatedDependencies = includeCarthageRelatedDependencies
self.findCarthageFrameworks = findCarthageFrameworks
}
}
@@ -122,7 +122,7 @@ extension SpecOptions: JSONObjectConvertible {
transitivelyLinkDependencies = jsonDictionary.json(atKeyPath: "transitivelyLinkDependencies") ?? false
groupSortPosition = jsonDictionary.json(atKeyPath: "groupSortPosition") ?? .bottom
generateEmptyDirectories = jsonDictionary.json(atKeyPath: "generateEmptyDirectories") ?? false
includeCarthageRelatedDependencies = jsonDictionary.json(atKeyPath: "includeCarthageRelatedDependencies") ?? false
findCarthageFrameworks = jsonDictionary.json(atKeyPath: "findCarthageFrameworks") ?? false
}
}
@@ -53,9 +53,9 @@ public class CarthageDependencyResolver {
let nonExistentDependencies = target.dependencies.filter { !frameworks.contains($0) }
for dependency in nonExistentDependencies {
switch dependency.type {
case .carthage(let includeRelated):
let includeRelated = includeRelated ?? project.options.includeCarthageRelatedDependencies
if includeRelated {
case .carthage(let findFrameworks):
let findFrameworks = findFrameworks ?? project.options.findCarthageFrameworks
if findFrameworks {
relatedDependencies(for: dependency, in: target.platform)
.filter { !frameworks.contains($0) }
.forEach { frameworks.insert($0) }
+3 -3
View File
@@ -576,9 +576,9 @@ public class PBXProjGenerator {
)
targetFrameworkBuildFiles.append(buildFile)
case .carthage(let includeRelated):
let includeRelated = includeRelated ?? project.options.includeCarthageRelatedDependencies
let allDependencies = includeRelated
case .carthage(let findFrameworks):
let findFrameworks = findFrameworks ?? project.options.findCarthageFrameworks
let allDependencies = findFrameworks
? carthageResolver.relatedDependencies(for: dependency, in: target.platform) : [dependency]
allDependencies.forEach { dependency in
// Static libraries can't link or embed dynamic frameworks