File tree Expand file tree Collapse file tree 2 files changed +16
-8
lines changed Expand file tree Collapse file tree 2 files changed +16
-8
lines changed Original file line number Diff line number Diff line change @@ -6,21 +6,32 @@ RED='\033[1;31m'
6
6
GREEN=' \033[1;32m'
7
7
NC=' \033[0m' # No Color
8
8
9
+ checksum_file=" Carthage/cartSum.txt"
10
+
11
+ # Computes current Carthage checksum using 'Cartfile.resolved' file, Swift version and checksum version.
12
+ computeChecksum () {
13
+ local version=" 1"
14
+ { cat Cartfile.resolved; xcrun swift -version; echo " ${version} " } | md5
15
+ }
16
+
9
17
# Get previous checksum
10
18
mkdir -p " Carthage"
11
- touch " Carthage/cartSum.txt "
12
- if [ ! -f " Carthage/cartSum.txt " ]; then
19
+ touch " ${checksum_file} "
20
+ if [ ! -f " ${checksum_file} " ]; then
13
21
prevSum=" null" ;
14
22
else
15
- prevSum=` cat Carthage/cartSum.txt ` ;
23
+ prevSum=` computeChecksum ` ;
16
24
fi
17
25
18
26
# Get checksum
19
- cartSum=` { cat Cartfile.resolved ; xcrun swift -version ; } | md5 `
27
+ cartSum=` computeChecksum `
20
28
21
29
if [ " $prevSum " != " $cartSum " ] || [ ! -d " Carthage/Build/iOS" ]; then
22
30
printf " ${RED} Dependencies out of date with cache.${NC} Bootstrapping...\n"
23
31
scripts/bootstrap.sh
32
+
33
+ echo ` computeChecksum` > " ${checksum_file} "
34
+
24
35
else
25
36
printf " ${GREEN} Cache up-to-date.${NC} Skipping bootstrap...\n"
26
37
fi
Original file line number Diff line number Diff line change @@ -19,7 +19,4 @@ applyXcode12Workaround() {
19
19
}
20
20
21
21
applyXcode12Workaround
22
- carthage bootstrap --cache-builds
23
-
24
- cartSum=` { cat Cartfile.resolved; xcrun swift -version; } | md5`
25
- echo $cartSum > Carthage/cartSum.txt
22
+ carthage bootstrap
You can’t perform that action at this time.
0 commit comments