blob: 07682da9eddbd290651593bda65bed3a72f64056 [file] [log] [blame]
bohuc383a212017-02-02 12:25:31 -08001#!/bin/bash
Roman Kiryanov683d70c2018-08-30 16:06:47 -07002# Find builds here:
3# https://android-build.googleplex.com/builds/branches/aosp-emu-master-dev/grid?
bohuc383a212017-02-02 12:25:31 -08004set -e
5
Roman Kiryanov683d70c2018-08-30 16:06:47 -07006function update_binaries {
7 local src="$1"
8 local dst="$2"
9
10 rm -rf "$dst"
11 rm -rf "emulator"
12 unzip "$src"
13 rm -f "./emulator/emulator64-crash-service"
14 rm -f "./emulator/emulator64-mips"
15 rm -f "./emulator/qemu/linux-x86_64/qemu-system-mipsel"
16 rm -f "./emulator/qemu/linux-x86_64/qemu-system-mips64el"
17 mv "emulator" "$dst"
18 git add "$dst"
19}
20
bohuc383a212017-02-02 12:25:31 -080021if [ $# == 1 ]
22then
23build=$1
24else
25 echo Usage: $0 build
26 exit 1
27fi
28
Roman Kiryanov683d70c2018-08-30 16:06:47 -070029linux_zip="sdk-repo-linux-emulator-$build.zip"
30mac_zip="sdk-repo-darwin-emulator-$build.zip"
bohuc383a212017-02-02 12:25:31 -080031
32echo Fetching Linux $build
33/google/data/ro/projects/android/fetch_artifact --bid $build --target sdk_tools_linux "$linux_zip"
Roman Kiryanov683d70c2018-08-30 16:06:47 -070034update_binaries "$linux_zip" "linux-x86_64"
bohuc383a212017-02-02 12:25:31 -080035
36echo Fetching Mac $build
37/google/data/ro/projects/android/fetch_artifact --bid $build --target sdk_tools_mac "$mac_zip"
Roman Kiryanov683d70c2018-08-30 16:06:47 -070038update_binaries "$mac_zip" "darwin-x86_64"
bohuc383a212017-02-02 12:25:31 -080039
40printf "Upgrade emulator to emu-master-dev build $build\n\n" > emulator.commitmsg
41
Roman Kiryanov683d70c2018-08-30 16:06:47 -070042git commit -s -t emulator.commitmsg
bohuc383a212017-02-02 12:25:31 -080043
Roman Kiryanov683d70c2018-08-30 16:06:47 -070044rm -f "emulator.commitmsg"
45rm -f "$linux_zip"
46rm -f "$mac_zip"