Merge pull request #312 from tuist/fix-309
Check to see if contents.xcworkspacedata exists before writing
This commit is contained in:
commit
14f99d2f94
|
@ -27,6 +27,7 @@ Please, check out guidelines: https://keepachangelog.com/en/1.0.0/
|
|||
- Fix Header & Framework search paths override project or xcconfig settings https://github.com/tuist/tuist/pull/301 by @ollieatkinson
|
||||
- Unit tests bundle for an app target compile & run https://github.com/tuist/tuist/pull/300 by @ollieatkinson
|
||||
- `LIBRARY_SEARCH_PATHS` and `SWIFT_INCLUDE_PATHS` are now set https://github.com/tuist/tuist/pull/308 by @kwridan
|
||||
- Fix Generation fails in the event an empty .xcworkspace directory exists https://github.com/tuist/tuist/pull/312 by @ollieatkinson
|
||||
|
||||
## 0.12.0
|
||||
|
||||
|
|
|
@ -118,7 +118,7 @@ final class WorkspaceGenerator: WorkspaceGenerating {
|
|||
private func write(xcworkspace: XCWorkspace, to: AbsolutePath) throws {
|
||||
// If the workspace doesn't exist we can write it because there isn't any
|
||||
// Xcode instance that might depend on it.
|
||||
if !fileHandler.exists(to) {
|
||||
if !fileHandler.exists(to.appending(component: "contents.xcworkspacedata")) {
|
||||
try xcworkspace.write(path: to.path)
|
||||
return
|
||||
}
|
||||
|
|
|
@ -69,6 +69,24 @@ final class WorkspaceGeneratorTests: XCTestCase {
|
|||
])
|
||||
}
|
||||
|
||||
func test_generate_workspaceStructure_noWorkspaceData() throws {
|
||||
let name = "test"
|
||||
|
||||
// Given
|
||||
try fileHandler.createFolder(fileHandler.currentPath.appending(component: "\(name).xcworkspace"))
|
||||
|
||||
let graph = Graph.test(entryPath: path)
|
||||
let workspace = Workspace.test(name: name)
|
||||
|
||||
// When
|
||||
XCTAssertNoThrow(
|
||||
try subject.generate(workspace: workspace,
|
||||
path: path,
|
||||
graph: graph,
|
||||
options: GenerationOptions())
|
||||
)
|
||||
}
|
||||
|
||||
func test_generate_workspaceStructureWithProjects() throws {
|
||||
// Given
|
||||
let target = anyTarget()
|
||||
|
|
Loading…
Reference in New Issue