Skip to content
This repository was archived by the owner on Aug 4, 2022. It is now read-only.

Commit 68b9e0d

Browse files
author
Jeff Verkoeyen
committed
Merge branch 'release-candidate' into stable
2 parents b9fa826 + 5989947 commit 68b9e0d

File tree

4 files changed

+96
-28
lines changed

4 files changed

+96
-28
lines changed

CHANGELOG.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,34 @@
1+
# 4.0.0
2+
3+
This major release introduces support for configuring bazel output verbosity.
4+
5+
## Breaking changes
6+
7+
The minimum Xcode version must now be provided as a flag.
8+
9+
```
10+
// Old invocations:
11+
bazel.sh build //:CatalogByConvention 8.2
12+
13+
// New invocations:
14+
bazel.sh build //:CatalogByConvention --xcode-version 8.2
15+
```
16+
17+
## New features
18+
19+
Local bazel builds no longer build with verbose output. To enable verbose output, pass the `-v` flag
20+
to the bazel.sh script.
21+
22+
## Source changes
23+
24+
* [Add arguments for configuring verbosity to the bazel runner (#15)](https://github.com/material-foundation/kokoro-ios-runner/commit/e686ab44e1d31e1fbf981af306daff7cafca211b) (featherless)
25+
* [Remove outdated comment (#12)](https://github.com/material-foundation/kokoro-ios-runner/commit/f4a5f341ced7c2016e9faa3d67eb9028f67df908) (featherless)
26+
27+
## API changes
28+
29+
bazel.sh now supports a `-v` argument for enabling verbosity on local builds. Verbose output is
30+
always enabled on kokoro builds.
31+
132
# 3.2.0
233

334
This minor release increases the amount of logging generated during bazel runs.

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ fi
1818

1919
pushd .kokoro-ios-runner
2020
git fetch
21-
git checkout v3.2.0
21+
git checkout v4.0.0
2222
popd
2323

2424
./.kokoro-ios-runner/xcodebuild.sh "MotionInterchange/MotionInterchange.xcodeproj" MotionInterchange "iPhone SE"
@@ -44,8 +44,8 @@ fi
4444

4545
pushd .kokoro-ios-runner
4646
git fetch
47-
git checkout v3.2.0
47+
git checkout v4.0.0
4848
popd
4949

50-
./.kokoro-ios-runner/bazel.sh test //:CatalogByConventionTests 8.0.0
50+
./.kokoro-ios-runner/bazel.sh test //:CatalogByConventionTests --xcode-version 8.0.0
5151
```

bazel.sh

Lines changed: 61 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -19,23 +19,26 @@
1919
# This script will clean, build, and run tests against each installation of Xcode available on the
2020
# machine using bazel.
2121
#
22-
# Arguments:
23-
# 1. bazel action (build or test, usually)
24-
# 2. BUILD target.
25-
# 3. Minimum Xcode version. E.g. "8" or "8.2.1"
22+
# Ordered arguments:
23+
# 1. action: bazel ACTION. E.g. "build" or "test".
24+
# 2. target: Bazel build target. E.g. "//path/to/target:Target"
25+
#
26+
# Named arguments:
27+
# -m|--min-xcode-version <version>: Every Xcode version equal to or greater than this value will
28+
# build and run tests. E.g. "8.2.1" will run 8.2.1, 8.3.3, 9,
29+
# etc...
30+
# -v|--verbose: Generates verbose output on local runs.
31+
# Does not affect kokoro runs.
2632
#
2733
# Example usage:
28-
# bazel.sh build //:CatalogByConvention
29-
# bazel.sh test //:CatalogByConventionTests
34+
# bazel.sh build //:CatalogByConvention --xcode-version 8.2
35+
# bazel.sh test //:CatalogByConventionTests -v
3036

3137
# Fail on any error.
3238
set -e
3339

34-
# Display commands to stderr.
35-
set -x
36-
37-
script_version="v3.2.0"
38-
echo "bazel_build_and_test version $script_version"
40+
script_version="v4.0.0"
41+
echo "$(basename $0) version $script_version"
3942

4043
version_as_number() {
4144
padded_version="${1%.}" # Strip any trailing dots
@@ -46,38 +49,72 @@ version_as_number() {
4649
echo "${padded_version//.}"
4750
}
4851

49-
action="$1"
50-
target="$2"
51-
min_xcode_version="$(version_as_number $3)"
52+
POSITIONAL=()
53+
while [[ $# -gt 0 ]]; do
54+
key="$1"
5255

53-
# Dependencies
56+
case $key in
57+
-m|--min-xcode-version)
58+
MIN_XCODE_VERSION="$(version_as_number $2)"
59+
shift
60+
shift
61+
;;
62+
-v|--verbose)
63+
VERBOSE_OUTPUT="1"
64+
shift
65+
;;
66+
*)
67+
POSITIONAL+=("$1")
68+
shift
69+
;;
70+
esac
71+
done
72+
set -- "${POSITIONAL[@]}" # restore positional parameters
5473

5574
if [ -n "$KOKORO_BUILD_NUMBER" ]; then
5675
# Move into our cloned repo
5776
cd github/repo
77+
78+
# Always enable verbose output on kokoro runs.
79+
VERBOSE_OUTPUT=1
80+
fi
81+
82+
if [ -n "$VERBOSE_OUTPUT" ]; then
83+
verbosity_flags="-s"
84+
85+
# Display commands to stderr.
86+
set -x
5887
fi
5988

60-
# Runs our tests on every available Xcode 8 or 9 installation.
89+
ACTION="$1"
90+
TARGET="$2"
91+
92+
# Runs our tests on every available Xcode installation.
6193
ls /Applications/ | grep "Xcode" | while read -r xcode_path; do
6294
xcode_version=$(cat /Applications/$xcode_path/Contents/version.plist \
6395
| grep "CFBundleShortVersionString" -A1 \
6496
| grep string \
6597
| cut -d'>' -f2 \
6698
| cut -d'<' -f1)
67-
if [ -n "$min_xcode_version" ]; then
99+
if [ -n "$MIN_XCODE_VERSION" ]; then
68100
xcode_version_as_number="$(version_as_number $xcode_version)"
69101

70-
if [ "$xcode_version_as_number" -lt "$min_xcode_version" ]; then
102+
if [ "$xcode_version_as_number" -lt "$MIN_XCODE_VERSION" ]; then
71103
continue
72104
fi
73105
fi
74106

75107
extra_args=""
76-
if [ "$action" == "build" ]; then
77-
echo "🏗️ $target with Xcode $xcode_version..."
78-
elif [ "$action" == "test" ]; then
79-
echo "🛠️ $target with Xcode $xcode_version..."
80-
extra_args="--test_output=all"
108+
if [ "$ACTION" == "build" ]; then
109+
echo "🏗️ $TARGET with Xcode $xcode_version..."
110+
elif [ "$ACTION" == "test" ]; then
111+
echo "🛠️ $TARGET with Xcode $xcode_version..."
112+
113+
if [ -n "$VERBOSE_OUTPUT" ]; then
114+
extra_args="--test_output=all"
115+
else
116+
extra_args="--test_output=errors"
117+
fi
81118

82119
if [ -n "$KOKORO_BUILD_NUMBER" ]; then
83120
sudo xcode-select --switch /Applications/$xcode_path/Contents/Developer
@@ -90,5 +127,5 @@ ls /Applications/ | grep "Xcode" | while read -r xcode_path; do
90127
fi
91128

92129
bazel clean
93-
bazel $action $target --xcode_version $xcode_version $extra_args -s
130+
bazel $ACTION $TARGET --xcode_version $xcode_version $extra_args $verbosity_flags
94131
done

xcodebuild.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ run() {
9898
fi
9999
}
100100

101-
script_version="v3.2.0"
101+
script_version="v4.0.0"
102102
echo "build_and_test version $script_version"
103103

104104
project="$1"

0 commit comments

Comments
 (0)