Commit 0bc86cd 1 parent b715f06 commit 0bc86cd Copy full SHA for 0bc86cd
File tree 5 files changed +62
-23
lines changed
5 files changed +62
-23
lines changed Original file line number Diff line number Diff line change @@ -9,6 +9,10 @@ build_using_carthage ()
9
9
then
10
10
carthage_cmd=" $carthage_cmd --use-ssh"
11
11
fi
12
+ if [ ! -z " $VERBOSE " ]
13
+ then
14
+ echo $carthage_cmd
15
+ fi
12
16
eval $carthage_cmd
13
17
}
14
18
@@ -21,7 +25,7 @@ build_using_xcodebuild ()
21
25
else
22
26
build_command=" $build_command -workspace $XCODE_WORKSPACE "
23
27
fi
24
- build_command=" $build_command build"
28
+ build_command=" $build_command -sdk iphonesimulator build -configuration Debug "
25
29
26
30
if type bundle > /dev/null && bundle show xcpretty > /dev/null
27
31
then
@@ -31,20 +35,21 @@ build_using_xcodebuild ()
31
35
echo " "
32
36
echo " → Building scheme '$1 '"
33
37
echo " "
38
+ if [ ! -z " $VERBOSE " ]
39
+ then
40
+ echo $build_command
41
+ fi
34
42
eval $build_command
35
43
}
36
44
37
- schemes ()
38
- {
39
- xcodebuild -list | awk ' {if(found) print} /Schemes/{found=1}' | awk ' {$1=$1};1'
40
- }
41
-
42
45
if [ ! -f $XCODE_WORKSPACE ] && [ -f Cartfile ] && type carthage > /dev/null
43
46
then
44
47
build_using_carthage
45
48
else
46
49
source script/.env
50
+ source script/script_hooks/schemes
47
51
52
+ current_schemes=$( schemes)
48
53
if [ -z " $current_schemes " ]
49
54
then
50
55
echo " "
Original file line number Diff line number Diff line change @@ -35,11 +35,11 @@ main ()
35
35
echo " "
36
36
echo " ####### Build & Test Phase #######"
37
37
echo " "
38
- script/test | tee /tmp/build.test-output.txt
38
+ set -o pipefail && script/test 2>&1 | tee /tmp/build.test-output.txt
39
39
status=$?
40
40
if [ ! $status -eq 0 ]
41
41
then
42
- log_file_path=` cat /tmp/build.test-output.txt | perl -l -ne ' /(\/var\/folders.*\/com\.apple\.dt\.XCTest-status.*)\)/ && print $1' `
42
+ log_file_path=` cat /tmp/build.test-output.txt | tail -n 100 | perl -l -ne ' /(\/var\/folders.*\/com\.apple\.dt\.XCTest-status.*)\)/ && print $1' `
43
43
if [ ! -z " $log_file_path " ]
44
44
then
45
45
echo " "
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ if [ -z " $DEFAULT_OSX_DESTINATION " ]; then
4
+ DEFAULT_OSX_DESTINATION=" 'platform=OS X'"
5
+ fi
6
+
7
+ if [ -z " $IOS_OS_VERSION " ]; then
8
+ IOS_OS_VERSION=" latest"
9
+ fi
10
+
11
+ if [ -z " $IOS_SIMULATOR_NAME " ]; then
12
+ IOS_SIMULATOR_NAME=" iPhone 6"
13
+ fi
14
+
15
+ if [ -z " $DEFAULT_IOS_DESTINATION " ]; then
16
+ DEFAULT_IOS_DESTINATION=" 'platform=iOS Simulator,name=$IOS_SIMULATOR_NAME ,OS=$IOS_OS_VERSION '"
17
+ fi
18
+
19
+ scheme_destination ()
20
+ {
21
+ shopt -s nocasematch
22
+
23
+ case " $1 " in
24
+ * iOS)
25
+ destination=$DEFAULT_IOS_DESTINATION
26
+ ;;
27
+ * OSX)
28
+ destination=$DEFAULT_OSX_DESTINATION
29
+ ;;
30
+ * )
31
+ destination=$DEFAULT_IOS_DESTINATION
32
+ ;;
33
+ esac
34
+
35
+ echo $destination
36
+ }
Original file line number Diff line number Diff line change
1
+ schemes ()
2
+ {
3
+ xcodebuild -list | awk '{if(found) print} /Schemes/{found=1}' | awk '{$1=$1};1'
4
+ }
Original file line number Diff line number Diff line change 3
3
set -e
4
4
5
5
source script/.env
6
-
7
- schemes ()
8
- {
9
- xcodebuild -list | awk ' {if(found) print} /Schemes/{found=1}' | awk ' {$1=$1};1'
10
- }
6
+ source script/script_hooks/schemes
7
+ source script/script_hooks/destinations
11
8
12
9
run_tests ()
13
10
{
14
11
test_command=" set -o pipefail && xcodebuild -scheme $1 "
12
+
15
13
if [ -z " $XCODE_WORKSPACE " ]
16
14
then
17
15
test_command=" $test_command -project $XCODE_PROJECT "
18
16
else
19
17
test_command=" $test_command -workspace $XCODE_WORKSPACE "
20
18
fi
21
- test_command=" $test_command test"
22
19
23
- shopt -s nocasematch
20
+ destination=$( scheme_destination $1 )
21
+ test_command=" $test_command -destination $destination clean build test -configuration Debug"
24
22
25
- case " $1 " in
26
-
27
- * iOS) test_command=" $test_command -destination 'platform=iOS Simulator,name=iPhone 6'"
28
- ;;
29
- * OSX) test_command=" $test_command -destination 'platform=OS X'"
30
- ;;
31
-
32
- esac
33
23
if [ ! -z " $CIRCLE_ARTIFACTS " ]
34
24
then
35
25
test_command=" $test_command | tee $CIRCLE_ARTIFACTS /xcode_raw.log"
46
36
echo " "
47
37
echo " → Running tests for scheme '$1 '"
48
38
echo " "
39
+ if [ ! -z " $VERBOSE " ]
40
+ then
41
+ echo $test_command
42
+ fi
49
43
eval $test_command
50
44
}
51
45
You can’t perform that action at this time.
0 commit comments