-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathupdate3rd.sh
executable file
·110 lines (83 loc) · 2.9 KB
/
update3rd.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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
#!/bin/bash
# first get last
rm -Rf ~/Library/Caches/org.carthage.CarthageKit/dependencies/QMobile*
# rm -f Cartfile.resolved
file=Cartfile.resolved
url=https://gitlab-4d.private.4d.fr/4d/qmobile/ios/
echo "- before:"
cat $file
sed -i '' '/QMobile/d' $file
for f in ../QMobile*; do
if [[ -d $f ]]; then
hash=`git -C $f rev-parse HEAD`
f="$(basename $f)"
if [ -z "$hash" ];then
if [[ -d $HOME/QMobile/$f ]]; then
hash=`git -C $HOME/QMobile/$f rev-parse HEAD`
fi
fi
if grep -q $f "Cartfile"; then
line="git \"$url$f.git\" \"$hash\""
echo "$line" >> "$file"
fi
fi
done
echo "- after:"
cat $file
# checkout
carthage checkout
# Remove Reactivate extension from Moya
## Sources
rm -Rf Carthage/Checkouts/Reactive*
rm -Rf Carthage/Checkouts/Rx*
## Build artifact
rm -Rf Carthage/Build/Reactive*
rm -Rf Carthage/Build/Rx*
## Build scheme
rm -Rf Carthage/Checkouts/Moya/Moya.xcodeproj/xcshareddata/xcschemes/Reactive*
rm -Rf Carthage/Checkouts/Moya/Moya.xcodeproj/xcshareddata/xcschemes/Rx*
## In Cartfile (mandatory or carthage will try to compile or resolve dependencies)
sed -i '' '/Reactive/d' Cartfile.resolved
sed -i '' '/Rx/d' Cartfile.resolved
sed -i '' '/Reactive/d' Carthage/Checkouts/Moya/Cartfile.resolved
sed -i '' '/Rx/d' Carthage/Checkouts/Moya/Cartfile.resolved
sed -i '' '/Reactive/d' Carthage/Checkouts/Moya/Cartfile
sed -i '' '/Rx/d' Carthage/Checkouts/Moya/Cartfile
# Remove Reactivate extension from Moya
echo "Remove Reactivate extension from Moya"
## Sources
rm -Rf Carthage/Checkouts/Reactive*
rm -Rf Carthage/Checkouts/Rx*
## Build artifact
rm -Rf Carthage/Build/Reactive*
rm -Rf Carthage/Build/Rx*
## Build scheme
rm -Rf Carthage/Checkouts/Moya/Moya.xcodeproj/xcshareddata/xcschemes/Reactive*
rm -Rf Carthage/Checkouts/Moya/Moya.xcodeproj/xcshareddata/xcschemes/Rx*
## In Cartfile (mandatory or carthage will try to compile or resolve dependencies)
sed -i '' '/Reactive/d' Cartfile.resolved
sed -i '' '/Rx/d' Cartfile.resolved
sed -i '' '/Reactive/d' Carthage/Checkouts/Moya/Cartfile.resolved
sed -i '' '/Rx/d' Carthage/Checkouts/Moya/Cartfile.resolved
sed -i '' '/Reactive/d' Carthage/Checkouts/Moya/Cartfile
sed -i '' '/Rx/d' Carthage/Checkouts/Moya/Cartfile
# use last version of alamofire if 4.7.3
sed -i.bak 's/4.7.3/4.8.0/' Carthage/Checkouts/Moya/Cartfile.resolved
# remove workspace if project exist (avoid compile dependencies and have some umbrella issues)
cd Carthage/Checkouts
for f in *; do
if [[ -d $f ]]; then
if [[ $f == QMobile* ]]; then
echo "$f: "
if [[ -d $f/$f.xcworkspace ]]; then
echo "- remove xcworkspace"
rm -Rf $f/$f.xcworkspace
fi
fi
fi
done
# build
mkdir -p "build"
carthage build --no-use-binaries --platform iOS --cache-builds --log-path "build/log"
# https://github.com/Carthage/Carthage/issues/1986?
cat "build/log" | xcpretty