This repository was archived by the owner on Aug 4, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +23
-2
lines changed Expand file tree Collapse file tree 2 files changed +23
-2
lines changed Original file line number Diff line number Diff line change @@ -47,6 +47,6 @@ git fetch
47
47
git checkout v3.0.0
48
48
popd
49
49
50
- ./.kokoro-ios-runner/bazel.sh build //:CatalogByConvention
51
- ./.kokoro-ios-runner/bazel.sh test //:CatalogByConventionTests
50
+ ./.kokoro-ios-runner/bazel.sh build //:CatalogByConvention 8.0.0
51
+ ./.kokoro-ios-runner/bazel.sh test //:CatalogByConventionTests 8.0.0
52
52
```
Original file line number Diff line number Diff line change 22
22
# Arguments:
23
23
# 1. bazel action (build or test, usually)
24
24
# 2. BUILD target.
25
+ # 3. Minimum Xcode version. E.g. "8" or "8.2.1"
25
26
#
26
27
# Example usage:
27
28
# bazel.sh build //:CatalogByConvention
@@ -36,8 +37,18 @@ set -x
36
37
script_version=" v3.0.0"
37
38
echo " bazel_build_and_test version $script_version "
38
39
40
+ version_as_number () {
41
+ padded_version=" ${1% .} " # Strip any trailing dots
42
+ # Pad with .0 until we get a M.m.p version string.
43
+ while [ $( grep -o " \." <<< " $padded_version" | wc -l) -lt " 2" ]; do
44
+ padded_version=${padded_version} .0
45
+ done
46
+ echo " ${padded_version// .} "
47
+ }
48
+
39
49
action=" $1 "
40
50
target=" $2 "
51
+ min_xcode_version=" $( version_as_number $3 ) "
41
52
42
53
# Dependencies
43
54
@@ -55,6 +66,16 @@ ls /Applications/ | grep "Xcode" | while read -r xcode_path; do
55
66
| grep string \
56
67
| cut -d' >' -f2 \
57
68
| cut -d' <' -f1)
69
+ if [ -z " $min_xcode_version " ]; then
70
+ :
71
+ else
72
+ xcode_version_as_number=" $( version_as_number $xcode_version ) "
73
+
74
+ # TODO: This doesn't work yet.
75
+ if [ " $xcode_version_as_number " -lt " $min_xcode_version " ]; then
76
+ continue
77
+ fi
78
+ fi
58
79
59
80
set +x
60
81
if [ " $action " == " build" ]; then
You can’t perform that action at this time.
0 commit comments