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'
66GREEN=' \033[1;32m'
77NC=' \033[0m' # No Color
88
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+
917# Get previous checksum
1018mkdir -p " Carthage"
11- touch " Carthage/cartSum.txt "
12- if [ ! -f " Carthage/cartSum.txt " ]; then
19+ touch " ${checksum_file} "
20+ if [ ! -f " ${checksum_file} " ]; then
1321 prevSum=" null" ;
1422else
15- prevSum=` cat Carthage/cartSum.txt ` ;
23+ prevSum=` computeChecksum ` ;
1624fi
1725
1826# Get checksum
19- cartSum=` { cat Cartfile.resolved ; xcrun swift -version ; } | md5 `
27+ cartSum=` computeChecksum `
2028
2129if [ " $prevSum " != " $cartSum " ] || [ ! -d " Carthage/Build/iOS" ]; then
2230 printf " ${RED} Dependencies out of date with cache.${NC} Bootstrapping...\n"
2331 scripts/bootstrap.sh
32+
33+ echo ` computeChecksum` > " ${checksum_file} "
34+
2435else
2536 printf " ${GREEN} Cache up-to-date.${NC} Skipping bootstrap...\n"
2637fi
Original file line number Diff line number Diff line change @@ -19,7 +19,4 @@ applyXcode12Workaround() {
1919}
2020
2121applyXcode12Workaround
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