diff --git a/.Package.test.swift b/.Package.test.swift new file mode 100644 index 0000000..74a05b2 --- /dev/null +++ b/.Package.test.swift @@ -0,0 +1,10 @@ +import PackageDescription + +let package = Package( + name: "RxAutomaton", + dependencies: [ + .Package(url: "https://github.com/ReactiveX/RxSwift.git", majorVersion: 3), + .Package(url: "https://github.com/Quick/Quick", majorVersion: 1), + .Package(url: "https://github.com/Quick/Nimble", majorVersion: 5, minor: 1) + ] +) diff --git a/.gitignore b/.gitignore index 5e5d5ce..9767142 100644 --- a/.gitignore +++ b/.gitignore @@ -32,9 +32,7 @@ timeline.xctimeline playground.xcworkspace # Swift Package Manager -# -# Add this line if you want to avoid checking in source code from Swift Package Manager dependencies. -# Packages/ +Packages/ .build/ # CocoaPods @@ -54,7 +52,7 @@ Carthage/Build # fastlane # -# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the +# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the # screenshots whenever they are needed. # For more information about the recommended setup visit: # https://github.com/fastlane/fastlane/blob/master/docs/Gitignore.md diff --git a/.travis.yml b/.travis.yml index 307b749..510a918 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,10 +3,11 @@ env: - LC_CTYPE=en_US.UTF-8 - XCPROJ="-workspace RxAutomaton.xcworkspace -scheme RxAutomaton" +osx_image: xcode8.2 + matrix: include: - os: osx - osx_image: xcode8 language: objective-c script: - set -o pipefail @@ -15,16 +16,14 @@ matrix: - JOB=xcodebuild-macOS - os: osx - osx_image: xcode8 language: objective-c script: - set -o pipefail - - xcodebuild build-for-testing test-without-building -destination 'platform=iOS Simulator,name=iPhone 6s' ENABLE_TESTABILITY=YES $XCPROJ | xcpretty + - xcodebuild build-for-testing test-without-building -destination 'platform=iOS Simulator,name=iPhone 6s,OS=9.0' ENABLE_TESTABILITY=YES $XCPROJ | xcpretty env: - JOB=xcodebuild-iOS - os: osx - osx_image: xcode8 language: objective-c script: - set -o pipefail @@ -33,7 +32,6 @@ matrix: - JOB=xcodebuild-tvOS - os: osx - osx_image: xcode8 language: objective-c script: - set -o pipefail @@ -41,8 +39,27 @@ matrix: env: - JOB=xcodebuild-watchOS - # - os: osx - # osx_image: xcode8 - # script: - # - pod lib lint --allow-warnings - # env: JOB=pod-lint + - os: osx + script: + - pod repo update --silent + - pod lib lint --allow-warnings + env: JOB=pod-lint + + - os: osx + language: generic + script: + - swift build + env: + - JOB=swiftpm-mac + + - os: linux + language: generic + sudo: required + dist: trusty + before_install: + - eval "$(curl -sL https://gist.githubusercontent.com/kylef/5c0475ff02b7c7671d2a/raw/9f442512a46d7a2af7b850d65a7e9bd31edfb09b/swiftenv-install.sh)" + script: + - mv .Package.test.swift Package.swift + - swift build + - swift test + env: JOB=swiftpm-linux diff --git a/Package.swift b/Package.swift new file mode 100644 index 0000000..6cdd59c --- /dev/null +++ b/Package.swift @@ -0,0 +1,8 @@ +import PackageDescription + +let package = Package( + name: "RxAutomaton", + dependencies: [ + .Package(url: "https://github.com/ReactiveX/RxSwift.git", majorVersion: 3) + ] +) diff --git a/RxAutomaton.xcodeproj/project.pbxproj b/RxAutomaton.xcodeproj/project.pbxproj index 4a19aae..09d2d9d 100644 --- a/RxAutomaton.xcodeproj/project.pbxproj +++ b/RxAutomaton.xcodeproj/project.pbxproj @@ -75,6 +75,7 @@ /* Begin PBXFileReference section */ 1FA0AC451DE8AC2B007F01E0 /* StateFuncMappingSpec.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = StateFuncMappingSpec.swift; sourceTree = ""; }; + 1FB0B5251E226FA800052073 /* LinuxMain.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LinuxMain.swift; sourceTree = ""; }; 1FCAB4CC1DC7845200EA6EBF /* RxCocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = RxCocoa.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 1FCAB4CE1DC7845700EA6EBF /* Pulsator.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = Pulsator.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 1FCAB4E21DC7947400EA6EBF /* RxTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = RxTest.framework; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -151,6 +152,15 @@ /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ + 1FB0B5241E226FA800052073 /* Tests */ = { + isa = PBXGroup; + children = ( + 1FB0B5251E226FA800052073 /* LinuxMain.swift */, + 488738EA1D61689100BF70F4 /* RxAutomatonTests */, + ); + path = Tests; + sourceTree = ""; + }; 4822CC3E1D61969C00783A77 /* Fixtures */ = { isa = PBXGroup; children = ( @@ -165,7 +175,7 @@ children = ( 488743011D61927700BF70F4 /* Configurations */, 488738DE1D61689000BF70F4 /* RxAutomaton */, - 488738EA1D61689100BF70F4 /* RxAutomatonTests */, + 1FB0B5241E226FA800052073 /* Tests */, 48AC076B1D61C962000293FD /* RxAutomatonDemo */, 48873F441D616A0800BF70F4 /* Frameworks */, 488738DD1D61689000BF70F4 /* Products */, @@ -209,8 +219,7 @@ 4822CC331D6194FD00783A77 /* TerminatingSpec.swift */, 488738ED1D61689100BF70F4 /* Info.plist */, ); - name = RxAutomatonTests; - path = Tests; + path = RxAutomatonTests; sourceTree = ""; }; 48873F441D616A0800BF70F4 /* Frameworks */ = { @@ -636,7 +645,7 @@ baseConfigurationReference = 4887411A1D61923300BF70F4 /* UniversalFramework_Test.xcconfig */; buildSettings = { CLANG_ENABLE_MODULES = YES; - INFOPLIST_FILE = Tests/Info.plist; + INFOPLIST_FILE = Tests/RxAutomatonTests/Info.plist; PRODUCT_BUNDLE_IDENTIFIER = com.inamiy.RxAutomatonTests; PRODUCT_NAME = "$(TARGET_NAME)"; }; @@ -647,7 +656,7 @@ baseConfigurationReference = 4887411A1D61923300BF70F4 /* UniversalFramework_Test.xcconfig */; buildSettings = { CLANG_ENABLE_MODULES = YES; - INFOPLIST_FILE = Tests/Info.plist; + INFOPLIST_FILE = Tests/RxAutomatonTests/Info.plist; PRODUCT_BUNDLE_IDENTIFIER = com.inamiy.RxAutomatonTests; PRODUCT_NAME = "$(TARGET_NAME)"; }; diff --git a/Tests/LinuxMain.swift b/Tests/LinuxMain.swift new file mode 100644 index 0000000..9a8352d --- /dev/null +++ b/Tests/LinuxMain.swift @@ -0,0 +1,13 @@ +import XCTest +import Quick + +@testable import RxAutomatonTests + +Quick.QCKMain([ + MappingSpec.self, + NextMappingSpec.self, + AnyMappingSpec.self, + StateFuncMappingSpec.self, + NextMappingLatestSpec.self, + TerminatingSpec.self +]) diff --git a/Tests/AnyMappingSpec.swift b/Tests/RxAutomatonTests/AnyMappingSpec.swift similarity index 100% rename from Tests/AnyMappingSpec.swift rename to Tests/RxAutomatonTests/AnyMappingSpec.swift diff --git a/Tests/Fixtures/Fixtures.swift b/Tests/RxAutomatonTests/Fixtures/Fixtures.swift similarity index 100% rename from Tests/Fixtures/Fixtures.swift rename to Tests/RxAutomatonTests/Fixtures/Fixtures.swift diff --git a/Tests/Fixtures/ToRACHelper.swift b/Tests/RxAutomatonTests/Fixtures/ToRACHelper.swift similarity index 100% rename from Tests/Fixtures/ToRACHelper.swift rename to Tests/RxAutomatonTests/Fixtures/ToRACHelper.swift diff --git a/Tests/Info.plist b/Tests/RxAutomatonTests/Info.plist similarity index 100% rename from Tests/Info.plist rename to Tests/RxAutomatonTests/Info.plist diff --git a/Tests/MappingSpec.swift b/Tests/RxAutomatonTests/MappingSpec.swift similarity index 100% rename from Tests/MappingSpec.swift rename to Tests/RxAutomatonTests/MappingSpec.swift diff --git a/Tests/NextMappingSpec.swift b/Tests/RxAutomatonTests/NextMappingSpec.swift similarity index 100% rename from Tests/NextMappingSpec.swift rename to Tests/RxAutomatonTests/NextMappingSpec.swift diff --git a/Tests/StateFuncMappingSpec.swift b/Tests/RxAutomatonTests/StateFuncMappingSpec.swift similarity index 100% rename from Tests/StateFuncMappingSpec.swift rename to Tests/RxAutomatonTests/StateFuncMappingSpec.swift diff --git a/Tests/StrategyLatestSpec.swift b/Tests/RxAutomatonTests/StrategyLatestSpec.swift similarity index 100% rename from Tests/StrategyLatestSpec.swift rename to Tests/RxAutomatonTests/StrategyLatestSpec.swift diff --git a/Tests/TerminatingSpec.swift b/Tests/RxAutomatonTests/TerminatingSpec.swift similarity index 100% rename from Tests/TerminatingSpec.swift rename to Tests/RxAutomatonTests/TerminatingSpec.swift