Skip to content

Commit

Permalink
Update test and project files.
Browse files Browse the repository at this point in the history
  • Loading branch information
BB9z committed Apr 24, 2018
1 parent 803b8c3 commit 235a5d0
Show file tree
Hide file tree
Showing 20 changed files with 324 additions and 343 deletions.
36 changes: 18 additions & 18 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,32 +1,32 @@

# Xcode Project
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
!default.perspectivev3
xcuserdata
*.xccheckout
*.moved-aside
*.hmap
*.xcuserstate
*.xcscmblueprint
**/*.xcodeproj/xcuserdata/
**/*.xcworkspace/xcuserdata/
**/*.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
**/*.xcworkspace/xcshareddata/*.xccheckout
**/*.xcworkspace/xcshareddata/*.xcscmblueprint
.idea/

# Xcode Injection
IOSInjectionProject/
OSXInjectionProject/

# Build
Scripts/build/
## Build generated
build/
DerivedData
DerivedData/
*.hmap

# CocoaPods
# CocoaPods & Carthage
Pods/
Carthage/Build
# Ignore the lock file because we are developing a library.
Podfile.lock

# fastlane
fastlane/report.xml
fastlane/Preview.html
fastlane/screenshots
fastlane/test_output

# CSV
*.orig
Expand Down
64 changes: 64 additions & 0 deletions .travis.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
#! /usr/bin/env sh

set -eo pipefail
# set -euxo pipefail

echo $TRAVIS_COMMIT_MESSAGE
echo "RFCI_TASK = $RFCI_TASK"
readonly RFWorkspace="RFSegue.xcworkspace"
readonly RFSTAGE="$1"
echo "RFSTAGE = $RFSTAGE"

# Run test
# $1 scheme
# $2 destination
XC_Test() {
xcodebuild test -enableCodeCoverage YES -workspace "$RFWorkspace" -scheme "$1" -destination "$2" ONLY_ACTIVE_ARCH=NO GCC_INSTRUMENT_PROGRAM_FLOW_ARCS=YES GCC_GENERATE_TEST_COVERAGE_FILES=YES | xcpretty
}

# Run macOS test
XC_TestMac() {
xcodebuild test -enableCodeCoverage YES -workspace "$RFWorkspace" -scheme "Test-macOS" GCC_INSTRUMENT_PROGRAM_FLOW_ARCS=YES GCC_GENERATE_TEST_COVERAGE_FILES=YES | xcpretty
}

# Run watchOS test
XC_TestWatch() {
xcodebuild build -workspace "$RFWorkspace" -scheme Target-watchOS ONLY_ACTIVE_ARCH=NO | xcpretty
}

STAGE_MAIN() {
if [ "$RFCI_TASK" = "POD_LINT" ]; then
if [[ "$TRAVIS_COMMIT_MESSAGE" = *"[skip lint]"* ]]; then
echo "Skip pod lint"
else
echo "TRAVIS_BRANCH = $TRAVIS_BRANCH"
gem install cocoapods --no-rdoc --no-ri --no-document --quiet
if [ "$TRAVIS_BRANCH" = "develop" ]; then
pod lib lint --allow-warnings
else
pod lib lint
fi
fi

elif [ "$RFCI_TASK" = "Xcode9" ]; then
pod install
XC_Test "Test-iOS" "platform=iOS Simulator,name=iPhone X,OS=11.3"
XC_Test "Test-tvOS" "platform=tvOS Simulator,name=Apple TV 4K,OS=11.3"
else
echo "Unexpected CI task: $RFCI_TASK"
fi
}

STAGE_SUCCESS() {
if [ "$RFCI_TASK" = "Xcode9" ]; then
curl -s https://codecov.io/bash | bash -s
fi
}

STAGE_FAILURE() {
if [[ "$RFCI_TASK" == Xcode* ]]; then
cat -n ~/Library/Logs/DiagnosticReports/xctest*.crash
fi
}

"STAGE_$RFSTAGE"
22 changes: 10 additions & 12 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,19 @@
language: objective-c
osx_image: xcode9.2
sudo: false
cache: cocoapods
env:
global:
- LC_CTYPE=en_US.UTF-8
- LANG=en_US.UTF-8
- LANGUAGE=en_US.UTF-8
- XB_DEST="platform=iOS Simulator,name=iPhone 6,OS=11.2"
# podfile: Example/Podfile
matrix:
include:
- osx_image: xcode9.3
env: RFCI_TASK="POD_LINT"
- osx_image: xcode9.3
env: RFCI_TASK="Xcode9"
before_install:
- gem install cocoapods --no-rdoc --no-ri --no-document --quiet
- pod repo update master
- pod install
script:
- set -o pipefail
- xcodebuild test -enableCodeCoverage YES -workspace RFSegue.xcworkspace -scheme Test-iOS -destination "$XB_DEST" ONLY_ACTIVE_ARCH=NO | xcpretty
- pod lib lint --allow-warnings
after_failure:
- cat -n ~/Library/Logs/DiagnosticReports/xctest*.crash
- pod repo update master --silent
script: ./.travis.sh MAIN
after_success: ./.travis.sh SUCCESS
after_failure: ./.travis.sh FAILURE
30 changes: 0 additions & 30 deletions Example/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,35 +12,5 @@ import UIKit
class AppDelegate: UIResponder, UIApplicationDelegate {

var window: UIWindow?


func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after application launch.
return true
}

func applicationWillResignActive(_ application: UIApplication) {
// Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
// Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game.
}

func applicationDidEnterBackground(_ application: UIApplication) {
// Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
// If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
}

func applicationWillEnterForeground(_ application: UIApplication) {
// Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background.
}

func applicationDidBecomeActive(_ application: UIApplication) {
// Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
}

func applicationWillTerminate(_ application: UIApplication) {
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
}


}

14 changes: 8 additions & 6 deletions Podfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@

platform :ios, '7.0'
target 'Example-iOS' do
platform :ios, '7.0'

target 'RFSegueExample' do
pod 'RFSegue', :path => '.'
end

target 'Test-iOS' do
pod 'RFSegue', :path => '.'

target 'Test-iOS' do
inherit! :search_paths
end
end

target 'Test-tvOS' do
platform :tvos, '9.0'

pod 'RFSegue', :path => '.'
end
41 changes: 0 additions & 41 deletions Podfile.lock

This file was deleted.

7 changes: 5 additions & 2 deletions RFSegue.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@ DESC
s.homepage = 'https://github.com/RFUI/RFSegue'
s.license = { :type => 'MIT', :file => 'LICENSE' }
s.author = { 'BB9z' => 'bb9z@me.com' }
s.source = { :git => 'https://github.com/RFUI/RFSegue.git', :tag => s.version.to_s }
s.source = {
:git => 'https://github.com/RFUI/RFSegue.git',
:branch => 'develop'
}

s.ios.deployment_target = '6.0'
s.tvos.deployment_target = '9.0'
Expand All @@ -21,7 +24,7 @@ DESC
s.public_header_files = ['*.h', 'Async/*.h', 'Return/*.h']
s.frameworks = 'UIKit'

s.dependency 'RFKit/Runtime'
s.dependency 'RFKit/Runtime', '>=1.7'
s.dependency 'RFKit/Category/UIDevice'
s.dependency 'RFKit/Category/UINavigationController'
s.dependency 'RFKit/Category/UIResponder'
Expand Down
Loading

0 comments on commit 235a5d0

Please sign in to comment.