Skip to content

Commit 6df1470

Browse files
committed
Now allowing specifying the exact path of the .xcodeproj, not just the enclosing folder. Detected based on whether the path ends with ".xcodeproj" (uses exact path) or not (uses as enclosing folder, package name as the name of the project).
1 parent 57c869a commit 6df1470

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)