Skip to content

Commit d19b95b

Browse files
committed
Merge pull request #189 from czechboy0/hd/allow_xcodeproj_path
Specify exact path of generated Xcode project
2 parents 538e06a + 6df1470 commit d19b95b

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

Sources/Xcodeproj/generate().swift

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,12 @@ import POSIX
1818
*/
1919
public func generate(path path: String, package: Package, modules: [SwiftModule], products: [Product]) throws -> String {
2020

21-
let rootdir = try mkdir(path, "\(package.name).xcodeproj")
21+
/// If a specific *.xcodeproj path is already passed in, use that.
22+
/// Otherwise treat the path as the desired enclosing folder for
23+
/// the .xcodeproj folder.
24+
let rootdir = path.hasSuffix(".xcodeproj") ? path : Path.join(path, "\(package.name).xcodeproj")
25+
try mkdir(rootdir)
26+
2227
let schemedir = try mkdir(rootdir, "xcshareddata/xcschemes")
2328

2429
////// the pbxproj file describes the project and its targets

0 commit comments

Comments
 (0)