#!/bin/sh
# Copyright 2018 Google Inc.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
set -e
BRANCH="${1:-origin/skqp/dev}"
COUNT="${2:-40}"
cd "$(dirname "$0")/../.."
EXTANT="$(mktemp "${TMPDIR:-/tmp}/extant.XXXXXXXXXX")"
BUCKET='skia-skqp'
gsutil ls "gs://$BUCKET" > $EXTANT
cat << EOF
SkQP Pre-built APKs
SkQP Pre-built APKs
APK |
Date |
Commit |
EOF
for commit in $(git log "$BRANCH" -${COUNT} -\-format=%H) ; do
short="$(git log -1 -\-format=%h $commit)"
name="${BUCKET}/skqp-universal-${short}.apk"
if ! grep -q "gs://$name" "$EXTANT"; then
continue
fi
url="https://storage.googleapis.com/$name"
date=$(TZ='' git log -\-date='format-local:%Y-%m-%d %H:%M:%S %Z' -1 $commit -\-format=%cd)
subj=$(git log -1 $commit -\-format='%<(50,trunc)%s' | sed 's/ *$//')
commit_url="https://skia.googlesource.com/skia/+/${commit}"
printf '\nskqp-universal-%s.apk | \n' "$url" "$short"
printf '%s | \n%s | \n
\n' "$date" "$commit_url" "$subj"
done
printf '\n\n'