forked from appsquickly/typhoon
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sh
executable file
·66 lines (46 loc) · 2.31 KB
/
build.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#!/bin/bash
echo '----------------------------------------------------------------------------------------------------'
echo "This build script requires the following dependencies to be installed:"
echo '----------------------------------------------------------------------------------------------------'
echo "gem install xcpretty"
echo "sudo port install lcov"
echo "sudo port install groovy"
echo "sudo port install doxygen"
echo "sudo port install graphviz"
echo '----------------------------------------------------------------------------------------------------'
#Configuration
reportsDir=build/reports
sourceDir=Source
resourceDir=Resources
requiredCoverage=87
#Fail immediately if a task fails
set -e
set -o pipefail
#Clean
rm -fr ~/Library/Developer/Xcode/DerivedData/*
rm -fr ./build
#Init submodules
git submodule init
git submodule update
#Stamp build Initially failing
ditto ${resourceDir}/build-failed.png ${reportsDir}/build-status/build-status.png
#xcodebuild -project Typhoon.xcodeproj/ -scheme 'Typhoon' clean build | xcpretty -c
#Run tests and produce coverage report for iOS Simulator
platform=iOS_Simulator
mkdir -p ${reportsDir}/${platform}
xcodebuild clean test -project Typhoon.xcodeproj -scheme 'Typhoon-iOSTests' -configuration Debug \
-destination "platform=iOS Simulator,name=iPhone 5s,OS=latest" | xcpretty -c --report junit
mv ${reportsDir}/junit.xml ${reportsDir}/${platform}/junit.xml
groovy http://frankencover.it/with --source-dir Source --output-dir ${reportsDir}/${platform} -r${requiredCoverage}
echo '----------------------------------------------------------------------------------------------------'
#Compile, run tests and produce coverage report for OSX
platform=OSX
mkdir -p ${reportsDir}/${platform}
xcodebuild -project Typhoon.xcodeproj/ -scheme 'Typhoon-OSXTests' clean test | xcpretty -c --report junit
mv ${reportsDir}/junit.xml ${reportsDir}/${platform}/junit.xml
groovy http://frankencover.it/with --source-dir Source --output-dir ${reportsDir}/OSX -r${requiredCoverage}
echo '--------------------------------------------------------------------------------'
echo ' 💉 Typhoon is ready to inject.'
echo '--------------------------------------------------------------------------------'
#Stamp build passing
ditto ${resourceDir}/build-passed.png ${reportsDir}/build-status/build-status.png