|
| 1 | +#!/bin/bash |
| 2 | + |
| 3 | +# Copyright (C) 2022 The Android Open Source Project |
| 4 | +# |
| 5 | +# Licensed under the Apache License, Version 2.0 (the "License"); |
| 6 | +# you may not use this file except in compliance with the License. |
| 7 | +# You may obtain a copy of the License at |
| 8 | +# |
| 9 | +# https://www.apache.org/licenses/LICENSE-2.0 |
| 10 | +# |
| 11 | +# Unless required by applicable law or agreed to in writing, software |
| 12 | +# distributed under the License is distributed on an "AS IS" BASIS, |
| 13 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 | +# See the License for the specific language governing permissions and |
| 15 | +# limitations under the License. |
| 16 | + |
| 17 | +######################################################################## |
| 18 | +# |
| 19 | +# Allows testing a snapshot version across all samples |
| 20 | +# |
| 21 | +# Example: To run build over all projects run: |
| 22 | +# ./scripts/test_snapshot.sh |
| 23 | +# |
| 24 | +######################################################################## |
| 25 | + |
| 26 | +if [ -z "$1" ]; then |
| 27 | + read -p "Enter compose version e.g. 1.3.0: " compose_ver |
| 28 | +else |
| 29 | + echo "Using compose version: $1" |
| 30 | + compose_ver=$1 |
| 31 | +fi |
| 32 | +if [ -z "$2" ]; then |
| 33 | + read -p "Enter snapshot ID: " snapshot |
| 34 | +else |
| 35 | + echo "Using compose snapshot: $2" |
| 36 | + snapshot=$2 |
| 37 | +fi |
| 38 | +export COMPOSE_SNAPSHOT_ID=$snapshot |
| 39 | + |
| 40 | +# Switch version to SNAPSHOT |
| 41 | +cp ./scripts/libs.versions.toml ./scripts/libs.versions.toml.tmp |
| 42 | +sed -i '' -e 's/^compose = ".*"/compose = "'$compose_ver'-SNAPSHOT"/g' ./scripts/libs.versions.toml |
| 43 | + |
| 44 | +# Copy to all samples and verify |
| 45 | +./scripts/duplicate_version_config.sh |
| 46 | +./scripts/verify_samples.sh |
| 47 | + |
| 48 | +# Undo all changes |
| 49 | +mv ./scripts/libs.versions.toml.tmp ./scripts/libs.versions.toml |
| 50 | +./scripts/duplicate_version_config.sh |
0 commit comments