Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Swift 5 #397

Merged
merged 3 commits into from
Apr 2, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ workflows:
jobs:
build:
macos:
xcode: "10.0.0"
xcode: "10.2.0"
steps:
- checkout
- restore_cache:
Expand Down
2 changes: 1 addition & 1 deletion .swift-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4.2
5.0
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## next version

### Added

- **Breaking** Swift 5 support https://github.com/tuist/xcodeproj/pull/397 by @pepibumur.

## 6.7.0

### Changed
Expand Down
6 changes: 3 additions & 3 deletions Cartfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
github "tuist/PathKit" == 0.9.2
github "tadija/AEXML" == 4.3.3
github "kareman/SwiftShell" == 4.1.2
github "kylef/PathKit" == 1.0.0
github "tadija/AEXML" == 4.4.0
github "tuist/shell" == 2.0.1
3 changes: 0 additions & 3 deletions Cartfile.resolved

This file was deleted.

24 changes: 12 additions & 12 deletions Package.resolved
Original file line number Diff line number Diff line change
Expand Up @@ -6,35 +6,35 @@
"repositoryURL": "https://github.com/tadija/AEXML",
"state": {
"branch": null,
"revision": "54bb8ea6fb693dd3f92a89e5fcc19e199fdeedd0",
"version": "4.3.3"
"revision": "e4d517844dd03dac557e35d77a8e9ab438de91a6",
"version": "4.4.0"
}
},
{
"package": "PathKit",
"repositoryURL": "https://github.com/kylef/PathKit",
"state": {
"branch": null,
"revision": "e2f5be30e4c8f531c9c1e8765aa7b71c0a45d7a0",
"version": "0.9.2"
"revision": "73f8e9dca9b7a3078cb79128217dc8f2e585a511",
"version": "1.0.0"
}
},
{
"package": "Spectre",
"repositoryURL": "https://github.com/kylef/Spectre.git",
"package": "Shell",
"repositoryURL": "https://github.com/tuist/Shell",
"state": {
"branch": null,
"revision": "f14ff47f45642aa5703900980b014c2e9394b6e5",
"version": "0.9.0"
"revision": "ab06e1ae3fa52c26b076ff11dde60e950f6bbc7c",
"version": "2.0.1"
}
},
{
"package": "SwiftShell",
"repositoryURL": "https://github.com/kareman/SwiftShell",
"package": "Spectre",
"repositoryURL": "https://github.com/kylef/Spectre.git",
"state": {
"branch": null,
"revision": "beebe43c986d89ea5359ac3adcb42dac94e5e08a",
"version": "4.1.2"
"revision": "f14ff47f45642aa5703900980b014c2e9394b6e5",
"version": "0.9.0"
}
}
]
Expand Down
8 changes: 4 additions & 4 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@ let package = Package(
.library(name: "xcodeproj", targets: ["xcodeproj"]),
],
dependencies: [
.package(url: "https://github.com/tadija/AEXML", .upToNextMinor(from: "4.3.3")),
.package(url: "https://github.com/kylef/PathKit", .upToNextMinor(from: "0.9.2")),
.package(url: "https://github.com/kareman/SwiftShell", .upToNextMinor(from: "4.1.2")),
.package(url: "https://github.com/tadija/AEXML", .upToNextMinor(from: "4.4.0")),
.package(url: "https://github.com/kylef/PathKit", .upToNextMinor(from: "1.0.0")),
.package(url: "https://github.com/tuist/Shell", .upToNextMinor(from: "2.0.1")),
],
targets: [
.target(name: "xcodeproj",
dependencies: [
"PathKit",
"AEXML",
]),
.testTarget(name: "xcodeprojTests", dependencies: ["xcodeproj", "SwiftShell"]),
.testTarget(name: "xcodeprojTests", dependencies: ["xcodeproj", "Shell"]),
]
)
12 changes: 5 additions & 7 deletions Tests/xcodeprojTests/Objects/Files/PBXGroupTests.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Foundation
import PathKit
import SwiftShell
import Shell
import xcodeproj
import XCTest

Expand All @@ -9,7 +9,7 @@ final class PBXGroupTests: XCTestCase {
XCTAssertEqual(PBXGroup.isa, "PBXGroup")
}

func test_addFile_assignParent() {
func test_addFile_assignParent() throws {
let sourceRoot = Path("/")
let project = PBXProj(
rootObject: nil,
Expand All @@ -22,11 +22,9 @@ final class PBXGroupTests: XCTestCase {
sourceTree: .group,
name: "group")
project.add(object: group)
let filePath = "\(Path.temporary.string)/file"
Files.createFile(atPath: filePath, contents: nil, attributes: nil)
let file = try? group.addFile(at: Path(filePath), sourceRoot: sourceRoot)

try! Files.removeItem(atPath: filePath)
let filePath = try Path.uniqueTemporary() + "file"
try Data().write(to: filePath.url)
let file = try? group.addFile(at: filePath, sourceRoot: sourceRoot)
XCTAssertNotNil(file?.parent)
}

Expand Down
18 changes: 13 additions & 5 deletions Tests/xcodeprojTests/Objects/Project/PBXProjIntegrationTests.swift
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
import Foundation
import PathKit
import SwiftShell
import Shell
import XCTest
@testable import xcodeproj

final class PBXProjIntegrationTests: XCTestCase {
var shell: Shell!

override func setUp() {
super.setUp()
shell = Shell()
}

func test_init_initializesTheProjCorrectly() {
let data = try! Data(contentsOf: fixturePath().url)
let decoder = XcodeprojPropertyListDecoder()
Expand Down Expand Up @@ -37,15 +44,16 @@ final class PBXProjIntegrationTests: XCTestCase {

try tmpDir.chdir {
// Create a commit
SwiftShell.run(bash: "git init")
SwiftShell.run(bash: "git add .")
SwiftShell.run(bash: "git commit -m 'test'")
_ = try shell.capture(["git", "init"]).get()
_ = try shell.capture(["git", "add", "."]).get()
_ = try shell.capture(["git", "commit", "-m", "'test'"]).get()

// Read/write the project
let project = try XcodeProj(path: xcodeprojPath)
try project.writePBXProj(path: xcodeprojPath, outputSettings: PBXOutputSettings())

XCTAssertTrue(SwiftShell.run(bash: "git status").stdout.contains("nothing to commit"))
let got = try shell.capture(["git", "status"]).get()
XCTAssertTrue(got.contains("nothing to commit"))
}
}

Expand Down
Loading