Skip to content

Commit f1f7c48

Browse files
author
Guido Marucci Blas
committed
Revert "Updates build scripts."
This reverts commit 466b41b.
1 parent 466b41b commit f1f7c48

File tree

7 files changed

+94
-105
lines changed

7 files changed

+94
-105
lines changed

script/.env

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
REQUIRED_CARTHAGE_VERSION=0.9.2
1+
22
PROJECT_NAME=ReactiveArray
33
XCODE_SCHEME=ReactiveArray
44
XCODE_WORKSPACE=

script/bootstrap

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,6 @@ bundle_install ()
8787
"or try to install the gems globally by running the following command:"
8888
print_gem_install_cmd
8989
printf "\033[0m"
90-
exit 1
9190
fi
9291
}
9392

@@ -166,21 +165,6 @@ install_dependencies ()
166165
fi
167166
}
168167

169-
install_carthage ()
170-
{
171-
source script/common/carthage
172-
173-
if type carthage > /dev/null
174-
then
175-
echo ""
176-
echo " → Checking installed version of carthage"
177-
echo ""
178-
check_carthage_version
179-
else
180-
force_install_carthage
181-
fi
182-
}
183-
184168
main ()
185169
{
186170
source script/.env
@@ -194,7 +178,7 @@ main ()
194178

195179
if [ -f Cartfile ]
196180
then
197-
install_carthage
181+
brew_install "carthage"
198182
bootstrap_carthage
199183
fi
200184

script/build

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,8 @@
22

33
set -e
44

5-
source script/common/carthage
6-
75
build_using_carthage ()
86
{
9-
check_carthage_version
107
carthage_cmd="carthage build --no-skip-current --platform ios"
118
if [ "$USE_SSH" == "true" ]
129
then

script/cibuild

Lines changed: 92 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,99 @@
11
#!/bin/bash
22

3-
echo ""
4-
echo "####### Bootstrap Phase #######"
5-
echo ""
6-
NO_CARTHAGE_UPDATE=true script/bootstrap
7-
status=$?
8-
9-
if [ $status -eq 0 ]
10-
then
11-
echo ""
12-
echo ""
13-
echo "####### Build & Test Phase #######"
14-
echo ""
15-
set -o pipefail && script/test 2>&1 | tee /tmp/build.test-output.txt
16-
status=$?
17-
if [ ! $status -eq 0 ]
18-
then
19-
log_file_path=`cat /tmp/build.test-output.txt | tail -n 100 | perl -l -ne '/(\/var\/folders.*\/com\.apple\.dt\.XCTest-status.*)\)/ && print $1'`
20-
if [ ! -z "$log_file_path" ]
3+
export SCRIPT_DIR=$(dirname "$0")
4+
5+
##
6+
## Configuration Variables
7+
##
8+
9+
# The name of the keychain to create for iOS code signing.
10+
KEYCHAIN=ios-build.keychain
11+
12+
##
13+
## Build Process
14+
##
15+
16+
main ()
17+
{
18+
if [ -f Cartfile ]
19+
then
20+
echo ""
21+
echo "####### Importing Developer Certificates #######"
22+
echo ""
23+
import_certs
24+
fi
25+
26+
echo ""
27+
echo "####### Bootstrap Phase #######"
28+
echo ""
29+
script/bootstrap
30+
local status=$?
31+
32+
if [ $status -eq 0 ]
2133
then
2234
echo ""
23-
echo " → The tests have failed. Printing output of log file '$log_file_path'."
24-
cat $log_file_path
2535
echo ""
36+
echo "####### Build & Test Phase #######"
37+
echo ""
38+
set -o pipefail && script/test 2>&1 | tee /tmp/build.test-output.txt
39+
status=$?
40+
if [ ! $status -eq 0 ]
41+
then
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+
if [ ! -z "$log_file_path" ]
44+
then
45+
echo ""
46+
echo " → The tests have failed. Printing output of log file '$log_file_path'."
47+
cat $log_file_path
48+
echo ""
49+
fi
50+
fi
51+
fi
52+
53+
delete_keychain
54+
exit $status
55+
}
56+
57+
import_certs ()
58+
{
59+
# If this environment variable is missing, we must not be running on Travis.
60+
if [ -z "$KEY_PASSWORD" ]
61+
then
62+
return 0
63+
fi
64+
65+
echo " → Setting up code signing..."
66+
local password=cibuild
67+
68+
# Create a temporary keychain for code signing.
69+
security create-keychain -p "$password" "$KEYCHAIN"
70+
security default-keychain -s "$KEYCHAIN"
71+
security unlock-keychain -p "$password" "$KEYCHAIN"
72+
security set-keychain-settings -t 3600 -l "$KEYCHAIN"
73+
74+
# Download the certificate for the Apple Worldwide Developer Relations
75+
# Certificate Authority.
76+
local certpath="$SCRIPT_DIR/apple_wwdr.cer"
77+
curl -s 'https://developer.apple.com/certificationauthority/AppleWWDRCA.cer' > "$certpath"
78+
security import "$certpath" -k "$KEYCHAIN" -T /usr/bin/codesign
79+
80+
# Import our development certificate.
81+
security import "$SCRIPT_DIR/certificates/cibot.p12" -k "$KEYCHAIN" -P "$KEY_PASSWORD" -T /usr/bin/codesign
82+
}
83+
84+
delete_keychain ()
85+
{
86+
if [ -z "$KEY_PASSWORD" ]
87+
then
88+
return 0
2689
fi
27-
fi
28-
fi
2990

30-
exit $status
91+
echo " → Removing temporary keychain"
92+
security delete-keychain "$KEYCHAIN"
93+
echo " ✔ Temporary keychain successfully removed."
94+
}
95+
96+
export -f import_certs
97+
export -f delete_keychain
98+
99+
main

script/common/carthage

Lines changed: 0 additions & 53 deletions
This file was deleted.

script/test

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ set -e
44

55
source script/.env
66
source script/script_hooks/schemes
7-
source script/common/carthage
87

98
run_tests ()
109
{
@@ -39,11 +38,6 @@ run_tests ()
3938
eval $test_command
4039
}
4140

42-
if [ -f Cartfile ]
43-
then
44-
check_carthage_version
45-
fi
46-
4741
current_schemes=$(schemes)
4842
if [ -z "$current_schemes" ]
4943
then

script/update

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,9 @@
33
set -e
44

55
source script/.env
6-
source script/common/carthage
76

87
if [ -f Cartfile ] && type carthage > /dev/null
98
then
10-
check_carthage_version
119
carthage_cmd="carthage update --platform ios"
1210
if [ "$USE_SSH" == "true" ]
1311
then

0 commit comments

Comments
 (0)