Skip to content

Commit fb05e0d

Browse files
authored
Merge pull request #8 from tigerpixel/development
Swift 5.1 and Xcode11
2 parents b0ae706 + 2f35d70 commit fb05e0d

18 files changed

+157
-303
lines changed

.swift-version

Lines changed: 0 additions & 1 deletion
This file was deleted.

.travis.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
osx_image: xcode9
1+
osx_image: xcode11
22
language: objective-c
33

44
before_install:
@@ -15,8 +15,7 @@ script:
1515

1616
- swiftlint
1717

18-
- xcodebuild test -workspace PGNParser.xcworkspace -scheme PGNParser-iOS -destination 'platform=iOS Simulator,OS=latest,name=iPhone 7'
18+
- xcodebuild test -workspace PGNParser.xcworkspace -scheme PGNParser-iOS -destination 'platform=iOS Simulator,OS=latest,name=iPhone 8'
1919
- xcodebuild test -workspace PGNParser.xcworkspace -scheme PGNParser-macOS -destination 'platform=macOS,arch=x86_64'
20-
- xcodebuild test -workspace PGNParser.xcworkspace -scheme PGNParser-tvOS -destination 'platform=tvOS Simulator,name=Apple TV 1080p'
21-
20+
- xcodebuild test -workspace PGNParser.xcworkspace -scheme PGNParser-tvOS -destination 'platform=tvOS Simulator,OS=latest,name=Apple TV 4K'
2221
- xcodebuild -workspace PGNParser.xcworkspace -scheme PGNParser-watchOS

CHANGELOG.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,29 @@
99
* Give the project targets for iOS, Mac, tvOS and watchOS.
1010
* Make the project available to Cocoapods, Carthage and the SPM.
1111

12+
## Version 0.2.0
13+
1214
### *Released 2017-10-01*
1315

1416
* Swift 4 and Xcode 9 updates.
1517
* Swiftlint version update to 0.22.0
1618
* Add failure messages to all XCFail test cases.
1719
* Neaten markdown files.
20+
21+
## Version 0.3.0
22+
23+
### *Released 2019-8-20*
24+
25+
* Swift 5 and Xcode 10.3 updates.
26+
* Swiftlint version update to 0.34.0
27+
* Update to Swift Package Manager to make compatible with Swift 5.
28+
29+
## Version 0.4.0
30+
31+
### *Released 2019-9-31*
32+
33+
* Swift 5.1 and Xcode 11 updates.
34+
* Added all Apple platforms to Swift Package Manager build.
35+
* Promoted Swift Package Manager in the README file.
36+
* Removed unnecessary return statements.
37+
* Swiftlint version update to 0.35.0

PGNParser.podspec

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
Pod::Spec.new do |s|
88
s.name = 'PGNParser'
9-
s.version = '0.2.0'
9+
s.version = '0.4.0'
1010
s.summary = 'A simple way to parse Portable Game Notation into Swift objects.'
1111
s.description = <<-DESC
1212
A simple way to parse Portable Game Notation into Swift objects. Easily parse game strings into Swift objects with just a single call. More work is required to fully suppourt the format. Pull requests for improvements are welcome.
@@ -22,8 +22,9 @@ A simple way to parse Portable Game Notation into Swift objects. Easily parse ga
2222
s.watchos.deployment_target = '2.0'
2323
s.osx.deployment_target = '10.9'
2424
s.tvos.deployment_target = '9.0'
25+
s.swift_version = '5.1'
2526

26-
s.source_files = 'Source/**/*.swift'
27+
s.source_files = 'Sources/**/*.swift'
2728

2829
s.dependency 'Currier'
2930
s.dependency 'ParserCombinator'

PGNParser.xcodeproj/project.pbxproj

Lines changed: 76 additions & 246 deletions
Large diffs are not rendered by default.

PGNParser.xcodeproj/xcshareddata/xcschemes/PGNParser-iOS.xcscheme

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "0900"
3+
LastUpgradeVersion = "1030"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"
@@ -26,7 +26,6 @@
2626
buildConfiguration = "Debug"
2727
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
2828
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
29-
language = ""
3029
shouldUseLaunchSchemeArgsEnv = "YES">
3130
<Testables>
3231
<TestableReference
@@ -56,7 +55,6 @@
5655
buildConfiguration = "Debug"
5756
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
5857
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
59-
language = ""
6058
launchStyle = "0"
6159
useCustomWorkingDirectory = "NO"
6260
ignoresPersistentStateOnLaunch = "NO"

PGNParser.xcodeproj/xcshareddata/xcschemes/PGNParser-macOS.xcscheme

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "0900"
3+
LastUpgradeVersion = "1030"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"
@@ -26,7 +26,6 @@
2626
buildConfiguration = "Debug"
2727
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
2828
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
29-
language = ""
3029
shouldUseLaunchSchemeArgsEnv = "YES">
3130
<Testables>
3231
<TestableReference
@@ -56,7 +55,6 @@
5655
buildConfiguration = "Debug"
5756
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
5857
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
59-
language = ""
6058
launchStyle = "0"
6159
useCustomWorkingDirectory = "NO"
6260
ignoresPersistentStateOnLaunch = "NO"

PGNParser.xcodeproj/xcshareddata/xcschemes/PGNParser-tvOS.xcscheme

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "0900"
3+
LastUpgradeVersion = "1030"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"
@@ -26,7 +26,6 @@
2626
buildConfiguration = "Debug"
2727
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
2828
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
29-
language = ""
3029
shouldUseLaunchSchemeArgsEnv = "YES">
3130
<Testables>
3231
<TestableReference
@@ -56,7 +55,6 @@
5655
buildConfiguration = "Debug"
5756
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
5857
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
59-
language = ""
6058
launchStyle = "0"
6159
useCustomWorkingDirectory = "NO"
6260
ignoresPersistentStateOnLaunch = "NO"

PGNParser.xcodeproj/xcshareddata/xcschemes/PGNParser-watchOS.xcscheme

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "0900"
3+
LastUpgradeVersion = "1030"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"
@@ -26,7 +26,6 @@
2626
buildConfiguration = "Debug"
2727
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
2828
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
29-
language = ""
3029
shouldUseLaunchSchemeArgsEnv = "YES">
3130
<Testables>
3231
<TestableReference
@@ -56,7 +55,6 @@
5655
buildConfiguration = "Debug"
5756
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
5857
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
59-
language = ""
6058
launchStyle = "0"
6159
useCustomWorkingDirectory = "NO"
6260
ignoresPersistentStateOnLaunch = "NO"

PGNParser/Info.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<key>CFBundlePackageType</key>
1616
<string>FMWK</string>
1717
<key>CFBundleShortVersionString</key>
18-
<string>0.2.0</string>
18+
<string>$(MARKETING_VERSION)</string>
1919
<key>CFBundleVersion</key>
2020
<string>$(CURRENT_PROJECT_VERSION)</string>
2121
<key>NSHumanReadableCopyright</key>

Package.swift

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//
1+
// swift-tools-version:5.1
22
// Package.swift
33
// PGNParser
44
//
@@ -12,10 +12,19 @@ import PackageDescription
1212

1313
let package = Package(
1414
name: "PGNParser",
15+
platforms: [
16+
// Other platforms compile as far back as possible by default.
17+
.macOS(.v10_10)
18+
],
19+
products: [
20+
.library(name: "PGNParser", targets: ["PGNParser"])
21+
],
1522
dependencies: [
16-
.Package(url: "https://github.com/tigerpixel/Currier.git",
17-
majorVersion: 1),
18-
.Package(url: "https://github.com/tigerpixel/ParserCombinator.git",
19-
majorVersion: 1)
20-
]
23+
.package(url: "https://github.com/tigerpixel/Currier.git", from: "1.3.0"),
24+
.package(url: "https://github.com/tigerpixel/ParserCombinator.git", from: "2.1.0")
25+
],
26+
targets: [
27+
.target(name: "PGNParser", dependencies: ["Currier", "ParserCombinator"]),
28+
.testTarget(name: "PGNParserTests", dependencies: ["PGNParser"])
29+
]
2130
)

Podfile.lock

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,20 @@
11
PODS:
2-
- Currier (1.1.0)
3-
- ParserCombinator (1.1.0)
2+
- Currier (1.2.0)
3+
- ParserCombinator (2.0.0)
44

55
DEPENDENCIES:
66
- Currier
77
- ParserCombinator
88

9+
SPEC REPOS:
10+
https://github.com/cocoapods/specs.git:
11+
- Currier
12+
- ParserCombinator
13+
914
SPEC CHECKSUMS:
10-
Currier: 3c7592a2f357400608bc5d0c3a691be4ef93c249
11-
ParserCombinator: 9534a29a7bd765f8a424c52c387b7fa562bd3cef
15+
Currier: fed45beb4ae89757c0286a19c6ad042999f5016d
16+
ParserCombinator: 40e377856046169e09acf6ed98114cf41a27a58d
1217

13-
PODFILE CHECKSUM: 752c88f8c29aae8e024fe8d9672533814561a0b4
18+
PODFILE CHECKSUM: badfbff585e0968cf3cec556f0a7b7eead3701b3
1419

15-
COCOAPODS: 1.3.1
20+
COCOAPODS: 1.7.5

README.md

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@ PGNParser is designed to parse [Portable Game Notation](https://en.wikipedia.org
1010

1111
Currently, only the draughts game strings have been implemented. Pull requests are welcome for further features.
1212

13-
Parsing can be enacted by simply making a single call on the draughts move objects.
13+
Parsing can be enacted by simply making a single 'parse' call on the draughts move struct.
1414

1515
A result type will be returned which will contain the resulting move array or details of any failure.
1616

1717
A failure contains an enumeration describing the reason for the failure and usually the token which failed.
1818

19-
The following will parse to on DraughtsMove structure containing a black and a white move.
19+
The following PGN string will parse to a DraughtsMove structure containing a black and a white move.
2020

2121
```swift
2222
let sinlgeMoveTwoPlayers = "1. 9-14 23-18"
@@ -35,14 +35,29 @@ case .failure(let reason):
3535
There are 2 external requirements for this project. Both by Tigerpixel, the same authors.
3636

3737
[Currier](https://github.com/tigerpixel/Currier.git) - A helper for currying functions and initializers which is used with the project.
38+
3839
[ParserCombinator](https://github.com/tigerpixel/ParserCombinator.git) - A General parser combinator which is extended to build PGNParser.
3940

4041
- iOS 8.0+ / macOS 10.9+ / tvOS 9.0+ / watchOS 2.0+
41-
- Xcode 9.0+
42-
- Swift 4.0+
42+
- Xcode 11+
43+
- Swift 5.1+
4344

4445
## Installation
4546

47+
### Swift Package Manager
48+
49+
The [Swift Package Manager](https://swift.org/package-manager) is the official tool for managing the distribution of Swift code. It is currently available for all Apple platforms. It can also be used with Linux but this project does not fully support Linux at this point in time.
50+
51+
If you use it to manage your dependencies, simply add PGNParser to the dependencies value of your Package.swift file.
52+
53+
```swift
54+
dependencies: [
55+
.package(url: "https://github.com/Tigerpixel/PGNParser.git", from: "0.4.0"),
56+
]
57+
```
58+
59+
The Swift Package Manager can resolve sub-dependencies.
60+
4661
### Cocoapods
4762

4863
PGNParser is available through [CocoaPods](http://cocoapods.org). To install it, simply add the following line to your Podfile:
@@ -63,20 +78,6 @@ github "tigerpixel/ParserCombinator"
6378

6479
If you use Carthage to build your dependencies, make sure you have added `PGNParser.framework`, `Currier.framework` and `ParserCombinator.framework` to the "_Linked Frameworks and Libraries_" section of your target, and have included them in your Carthage framework copying build phase.
6580

66-
### Swift Package Manager
67-
68-
The [Swift Package Manager](https://swift.org/package-manager) is the official tool for managing the distribution of Swift code. It is currently available for macOS. It can also be used with Linux but this project does not fully support Linux at this point in time.
69-
70-
If you use it to manage your dependencies, simply add PGNParser to the dependencies value of your Package.swift file.
71-
72-
```swift
73-
dependencies: [
74-
.Package(url: "https://github.com/Tigerpixel/PGNParser.git", majorVersion: 0)
75-
]
76-
```
77-
78-
The Swift Package Manager can resolve sub-dependencies.
79-
8081
### Git Submodule
8182

8283
1. Add the PGNParser repository as a [submodule](https://git-scm.com/book/en/v2/Git-Tools-Submodules) of your application’s repository.

Source/DraughtsMove.swift renamed to Sources/PGNParser/DraughtsMove.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
import ParserCombinator
1010

11-
/// The positions on the board conform to an interger number.
11+
/// The positions on the board conform to an integer number.
1212
typealias BoardPosition = Int
1313

1414
/**
@@ -81,7 +81,7 @@ extension DraughtsMove {
8181
*/
8282
public static func parse(fromPortableGameNotation notation: String) -> ParseResult<[DraughtsMove]> {
8383

84-
return DraughtsNotationParser.portableGameNotation().run(withInput: notation)
84+
DraughtsNotationParser.portableGameNotation().run(withInput: notation)
8585
}
8686

8787
}

Tests/PGNParserTests/DraughtsMoveTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,7 @@ class DraughtsMoveTests: XCTestCase {
398398

399399
func testNoMoves() {
400400

401-
switch DraughtsMove.parse(fromPortableGameNotation:"") {
401+
switch DraughtsMove.parse(fromPortableGameNotation: "") {
402402
case .success:
403403
XCTFail("The parser should fail")
404404

install_swiftlint.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
set -e
88

99
SWIFTLINT_PKG_PATH="/tmp/SwiftLint.pkg"
10-
SWIFTLINT_PKG_URL="https://github.com/realm/SwiftLint/releases/download/0.16.1/SwiftLint.pkg"
10+
SWIFTLINT_PKG_URL="https://github.com/realm/SwiftLint/releases/download/0.35.0/SwiftLint.pkg"
1111

1212
wget --output-document=$SWIFTLINT_PKG_PATH $SWIFTLINT_PKG_URL
1313

podfile

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11

2-
use_frameworks!
3-
42
def shared_pods
53
pod 'Currier'
64
pod 'ParserCombinator'
75
end
86

97
target 'PGNParser-iOS' do
10-
8+
119
platform :ios, '8.0'
1210
shared_pods
1311

0 commit comments

Comments
 (0)