Skip to content
This repository was archived by the owner on Dec 12, 2021. It is now read-only.

Commit d95e18f

Browse files
committed
Add Swift Package Manager support
1 parent 926453d commit d95e18f

File tree

14 files changed

+80
-22
lines changed

14 files changed

+80
-22
lines changed

.Package.test.swift

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import PackageDescription
2+
3+
let package = Package(
4+
name: "ReactiveAutomaton",
5+
dependencies: [
6+
.Package(url: "https://github.com/ReactiveCocoa/ReactiveSwift.git", majorVersion: 1),
7+
.Package(url: "https://github.com/Quick/Quick", majorVersion: 1),
8+
.Package(url: "https://github.com/Quick/Nimble", majorVersion: 5, minor: 1)
9+
]
10+
)

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ playground.xcworkspace
3434
# Swift Package Manager
3535
#
3636
# Add this line if you want to avoid checking in source code from Swift Package Manager dependencies.
37-
# Packages/
37+
Packages/
3838
.build/
3939

4040
# CocoaPods
@@ -54,7 +54,7 @@ Carthage/Build
5454

5555
# fastlane
5656
#
57-
# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
57+
# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
5858
# screenshots whenever they are needed.
5959
# For more information about the recommended setup visit:
6060
# https://github.com/fastlane/fastlane/blob/master/docs/Gitignore.md

.travis.yml

Lines changed: 27 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,11 @@ env:
33
- LC_CTYPE=en_US.UTF-8
44
- XCPROJ="-workspace ReactiveAutomaton.xcworkspace -scheme ReactiveAutomaton"
55

6+
osx_image: xcode8.2
7+
68
matrix:
79
include:
810
- os: osx
9-
osx_image: xcode8
1011
language: objective-c
1112
script:
1213
- set -o pipefail
@@ -15,16 +16,14 @@ matrix:
1516
- JOB=xcodebuild-macOS
1617

1718
- os: osx
18-
osx_image: xcode8
1919
language: objective-c
2020
script:
2121
- set -o pipefail
22-
- xcodebuild build-for-testing test-without-building -destination 'platform=iOS Simulator,name=iPhone 6s' ENABLE_TESTABILITY=YES $XCPROJ | xcpretty
22+
- xcodebuild build-for-testing test-without-building -destination 'platform=iOS Simulator,name=iPhone 6s,OS=9.0' ENABLE_TESTABILITY=YES $XCPROJ | xcpretty
2323
env:
2424
- JOB=xcodebuild-iOS
2525

2626
- os: osx
27-
osx_image: xcode8
2827
language: objective-c
2928
script:
3029
- set -o pipefail
@@ -33,16 +32,34 @@ matrix:
3332
- JOB=xcodebuild-tvOS
3433

3534
- os: osx
36-
osx_image: xcode8
3735
language: objective-c
3836
script:
3937
- set -o pipefail
4038
- xcodebuild build -destination 'platform=watchOS Simulator,name=Apple Watch - 38mm' $XCPROJ | xcpretty
4139
env:
4240
- JOB=xcodebuild-watchOS
4341

44-
# - os: osx
45-
# osx_image: xcode8
46-
# script:
47-
# - pod lib lint --allow-warnings
48-
# env: JOB=pod-lint
42+
- os: osx
43+
script:
44+
- pod repo update --silent
45+
- pod lib lint --allow-warnings
46+
env: JOB=pod-lint
47+
48+
- os: osx
49+
language: generic
50+
script:
51+
- swift build
52+
env:
53+
- JOB=swiftpm-mac
54+
55+
- os: linux
56+
language: generic
57+
sudo: required
58+
dist: trusty
59+
before_install:
60+
- eval "$(curl -sL https://gist.githubusercontent.com/kylef/5c0475ff02b7c7671d2a/raw/9f442512a46d7a2af7b850d65a7e9bd31edfb09b/swiftenv-install.sh)"
61+
script:
62+
- mv .Package.test.swift Package.swift
63+
- swift build
64+
- swift test
65+
env: JOB=swiftpm-linux

Package.swift

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import PackageDescription
2+
3+
let package = Package(
4+
name: "ReactiveAutomaton",
5+
dependencies: [
6+
.Package(url: "https://github.com/ReactiveCocoa/ReactiveSwift.git", majorVersion: 1)
7+
]
8+
)

ReactiveAutomaton.xcodeproj/project.pbxproj

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
487C0F4B1D0032D80071666D /* NextMappingSpec.swift in Sources */ = {isa = PBXBuildFile; fileRef = 487C0F4A1D0032D80071666D /* NextMappingSpec.swift */; };
2424
487C0F4D1D003B2E0071666D /* AnyMappingSpec.swift in Sources */ = {isa = PBXBuildFile; fileRef = 487C0F4C1D003B2E0071666D /* AnyMappingSpec.swift */; };
2525
48B2D1141CED890D0095F175 /* Mapping+Helper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 48B2D1131CED890D0095F175 /* Mapping+Helper.swift */; };
26-
48C03E951D4094270084B208 /* StrategyLatestSpec.swift in Sources */ = {isa = PBXBuildFile; fileRef = 48C03E751D4093610084B208 /* StrategyLatestSpec.swift */; };
26+
48C03E951D4094270084B208 /* NextMappingLatestSpec.swift in Sources */ = {isa = PBXBuildFile; fileRef = 48C03E751D4093610084B208 /* NextMappingLatestSpec.swift */; };
2727
48F34E801D4072DA00C53CAC /* ReactiveCocoa+FilterMap.swift in Sources */ = {isa = PBXBuildFile; fileRef = 48F34E7F1D4072DA00C53CAC /* ReactiveCocoa+FilterMap.swift */; };
2828
/* End PBXBuildFile section */
2929

@@ -59,11 +59,12 @@
5959
1FAEBD051CDCEFD50046EA72 /* Automaton.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Automaton.swift; sourceTree = "<group>"; };
6060
1FAEBD071CDCF04E0046EA72 /* Reply.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Reply.swift; sourceTree = "<group>"; };
6161
1FAEBD091CDCF0990046EA72 /* Result.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = Result.framework; sourceTree = BUILT_PRODUCTS_DIR; };
62+
1FB0B4FA1E2254A900052073 /* LinuxMain.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LinuxMain.swift; sourceTree = "<group>"; };
6263
487C0F281D00311E0071666D /* Fixtures.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Fixtures.swift; sourceTree = "<group>"; };
6364
487C0F4A1D0032D80071666D /* NextMappingSpec.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NextMappingSpec.swift; sourceTree = "<group>"; };
6465
487C0F4C1D003B2E0071666D /* AnyMappingSpec.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AnyMappingSpec.swift; sourceTree = "<group>"; };
6566
48B2D1131CED890D0095F175 /* Mapping+Helper.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "Mapping+Helper.swift"; sourceTree = "<group>"; };
66-
48C03E751D4093610084B208 /* StrategyLatestSpec.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = StrategyLatestSpec.swift; sourceTree = "<group>"; };
67+
48C03E751D4093610084B208 /* NextMappingLatestSpec.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NextMappingLatestSpec.swift; sourceTree = "<group>"; };
6768
48F34E7F1D4072DA00C53CAC /* ReactiveCocoa+FilterMap.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "ReactiveCocoa+FilterMap.swift"; sourceTree = "<group>"; };
6869
/* End PBXFileReference section */
6970

@@ -128,27 +129,27 @@
128129
name = "project xcconfigs";
129130
sourceTree = "<group>";
130131
};
131-
1F24EB391CDD197B0008028E /* Tests */ = {
132+
1F24EB391CDD197B0008028E /* ReactiveAutomatonTests */ = {
132133
isa = PBXGroup;
133134
children = (
134135
487C0F271D00311E0071666D /* Fixtures */,
135136
1F24EB3B1CDD197B0008028E /* MappingSpec.swift */,
136137
487C0F4A1D0032D80071666D /* NextMappingSpec.swift */,
137138
487C0F4C1D003B2E0071666D /* AnyMappingSpec.swift */,
138139
1FA0AC431DE8AAC7007F01E0 /* StateFuncMappingSpec.swift */,
139-
48C03E751D4093610084B208 /* StrategyLatestSpec.swift */,
140+
48C03E751D4093610084B208 /* NextMappingLatestSpec.swift */,
140141
1F242AFE1D08766900647917 /* TerminatingSpec.swift */,
141142
1F24EB3A1CDD197B0008028E /* Info.plist */,
142143
);
143-
path = Tests;
144+
path = ReactiveAutomatonTests;
144145
sourceTree = "<group>";
145146
};
146147
1FAEBCEB1CDCEF510046EA72 = {
147148
isa = PBXGroup;
148149
children = (
149150
1F24E04D1CDD15980008028E /* Configurations */,
150151
1FAEBD001CDCEF940046EA72 /* Sources */,
151-
1F24EB391CDD197B0008028E /* Tests */,
152+
1FB0B4F91E2254A900052073 /* Tests */,
152153
1FAEBD0D1CDCF0A70046EA72 /* Frameworks */,
153154
1FAEBCF61CDCEF510046EA72 /* Products */,
154155
);
@@ -188,6 +189,15 @@
188189
name = Frameworks;
189190
sourceTree = "<group>";
190191
};
192+
1FB0B4F91E2254A900052073 /* Tests */ = {
193+
isa = PBXGroup;
194+
children = (
195+
1FB0B4FA1E2254A900052073 /* LinuxMain.swift */,
196+
1F24EB391CDD197B0008028E /* ReactiveAutomatonTests */,
197+
);
198+
path = Tests;
199+
sourceTree = "<group>";
200+
};
191201
487C0F271D00311E0071666D /* Fixtures */ = {
192202
isa = PBXGroup;
193203
children = (
@@ -330,7 +340,7 @@
330340
1FA0AC441DE8AAC7007F01E0 /* StateFuncMappingSpec.swift in Sources */,
331341
487C0F4D1D003B2E0071666D /* AnyMappingSpec.swift in Sources */,
332342
487C0F291D00311E0071666D /* Fixtures.swift in Sources */,
333-
48C03E951D4094270084B208 /* StrategyLatestSpec.swift in Sources */,
343+
48C03E951D4094270084B208 /* NextMappingLatestSpec.swift in Sources */,
334344
);
335345
runOnlyForDeploymentPostprocessing = 0;
336346
};
@@ -362,7 +372,7 @@
362372
baseConfigurationReference = 1F24E5731CDD15AF0008028E /* UniversalFramework_Test.xcconfig */;
363373
buildSettings = {
364374
COMBINE_HIDPI_IMAGES = YES;
365-
INFOPLIST_FILE = Tests/Info.plist;
375+
INFOPLIST_FILE = Tests/ReactiveAutomatonTests/Info.plist;
366376
MACOSX_DEPLOYMENT_TARGET = 10.11;
367377
PRODUCT_BUNDLE_IDENTIFIER = com.inamiy.ReactiveAutomatonTests;
368378
PRODUCT_NAME = "$(TARGET_NAME)";
@@ -376,7 +386,7 @@
376386
baseConfigurationReference = 1F24E5731CDD15AF0008028E /* UniversalFramework_Test.xcconfig */;
377387
buildSettings = {
378388
COMBINE_HIDPI_IMAGES = YES;
379-
INFOPLIST_FILE = Tests/Info.plist;
389+
INFOPLIST_FILE = Tests/ReactiveAutomatonTests/Info.plist;
380390
MACOSX_DEPLOYMENT_TARGET = 10.11;
381391
PRODUCT_BUNDLE_IDENTIFIER = com.inamiy.ReactiveAutomatonTests;
382392
PRODUCT_NAME = "$(TARGET_NAME)";

Tests/LinuxMain.swift

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import XCTest
2+
import Quick
3+
4+
@testable import ReactiveAutomatonTests
5+
6+
Quick.QCKMain([
7+
MappingSpec.self,
8+
NextMappingSpec.self,
9+
AnyMappingSpec.self,
10+
StateFuncMappingSpec.self,
11+
NextMappingLatestSpec.self,
12+
TerminatingSpec.self
13+
])

Tests/AnyMappingSpec.swift renamed to Tests/ReactiveAutomatonTests/AnyMappingSpec.swift

File renamed without changes.

Tests/Fixtures/Fixtures.swift renamed to Tests/ReactiveAutomatonTests/Fixtures/Fixtures.swift

File renamed without changes.

Tests/MappingSpec.swift renamed to Tests/ReactiveAutomatonTests/MappingSpec.swift

File renamed without changes.

0 commit comments

Comments
 (0)