From 7db2d2c5265fa325ecb45e92a910159932f9d1a4 Mon Sep 17 00:00:00 2001 From: giginet Date: Tue, 8 Oct 2019 22:52:51 +0900 Subject: [PATCH] Rename to projectDirectory --- Sources/XcodeGenKit/PBXProjGenerator.swift | 4 ++-- Sources/XcodeGenKit/ProjectGenerator.swift | 4 ++-- Sources/XcodeGenKit/SourceGenerator.swift | 8 ++++---- Tests/XcodeGenKitTests/ProjectGeneratorTests.swift | 4 ++-- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Sources/XcodeGenKit/PBXProjGenerator.swift b/Sources/XcodeGenKit/PBXProjGenerator.swift index 8790d24a..1aea1595 100644 --- a/Sources/XcodeGenKit/PBXProjGenerator.swift +++ b/Sources/XcodeGenKit/PBXProjGenerator.swift @@ -24,13 +24,13 @@ public class PBXProjGenerator { var generated = false - public init(project: Project, projectDestinationDirectory: Path?) { + public init(project: Project, projectDirectory: Path?) { self.project = project carthageResolver = CarthageDependencyResolver(project: project) pbxProj = PBXProj(rootObject: nil, objectVersion: project.objectVersion) sourceGenerator = SourceGenerator(project: project, pbxProj: pbxProj, - projectDestinationDirectory: projectDestinationDirectory) + projectDirectory: projectDirectory) } @discardableResult diff --git a/Sources/XcodeGenKit/ProjectGenerator.swift b/Sources/XcodeGenKit/ProjectGenerator.swift index bf68c690..0771608b 100644 --- a/Sources/XcodeGenKit/ProjectGenerator.swift +++ b/Sources/XcodeGenKit/ProjectGenerator.swift @@ -13,11 +13,11 @@ public class ProjectGenerator { self.project = project } - public func generateXcodeProject(to projectDestinationDirectory: Path? = nil) throws -> XcodeProj { + public func generateXcodeProject(to projectDirectory: Path? = nil) throws -> XcodeProj { // generate PBXProj let pbxProjGenerator = PBXProjGenerator(project: project, - projectDestinationDirectory: projectDestinationDirectory) + projectDirectory: projectDirectory) let pbxProj = try pbxProjGenerator.generate() // generate Schemes diff --git a/Sources/XcodeGenKit/SourceGenerator.swift b/Sources/XcodeGenKit/SourceGenerator.swift index aff22a0c..f7197d77 100644 --- a/Sources/XcodeGenKit/SourceGenerator.swift +++ b/Sources/XcodeGenKit/SourceGenerator.swift @@ -13,7 +13,7 @@ struct SourceFile { class SourceGenerator { var rootGroups: Set = [] - private let projectDestinationDirectory: Path? + private let projectDirectory: Path? private var fileReferencesByPath: [String: PBXFileElement] = [:] private var groupsByPath: [Path: PBXGroup] = [:] private var variantGroupsByPath: [Path: PBXVariantGroup] = [:] @@ -31,10 +31,10 @@ class SourceGenerator { private(set) var knownRegions: Set = [] - init(project: Project, pbxProj: PBXProj, projectDestinationDirectory: Path?) { + init(project: Project, pbxProj: PBXProj, projectDirectory: Path?) { self.project = project self.pbxProj = pbxProj - self.projectDestinationDirectory = projectDestinationDirectory + self.projectDirectory = projectDirectory } @discardableResult @@ -289,7 +289,7 @@ class SourceGenerator { let groupName = name ?? path.lastComponent let groupPath: String - switch try? path.relativePath(from: projectDestinationDirectory ?? project.basePath).string { + switch try? path.relativePath(from: projectDirectory ?? project.basePath).string { case .some(let relativePath) where isTopLevelGroup: groupPath = relativePath default: diff --git a/Tests/XcodeGenKitTests/ProjectGeneratorTests.swift b/Tests/XcodeGenKitTests/ProjectGeneratorTests.swift index 85ae81bc..e83e9ec0 100644 --- a/Tests/XcodeGenKitTests/ProjectGeneratorTests.swift +++ b/Tests/XcodeGenKitTests/ProjectGeneratorTests.swift @@ -1016,7 +1016,7 @@ class ProjectGeneratorTests: XCTestCase { ) describe("generateXcodeProject") { - $0.context("without projectDestinationDirectory") { + $0.context("without projectDirectory") { $0.it("generate groups") { let project = Project(name: "test", targets: [frameworkWithSources]) let generator = ProjectGenerator(project: project) @@ -1026,7 +1026,7 @@ class ProjectGeneratorTests: XCTestCase { } } - $0.context("with projectDestinationDirectory") { + $0.context("with projectDirectory") { $0.it("generate groups") { let destinationPath = fixturePath let project = Project(name: "test", targets: [frameworkWithSources])