bohu | c383a21 | 2017-02-02 12:25:31 -0800 | [diff] [blame] | 1 | #!/bin/bash |
Roman Kiryanov | 683d70c | 2018-08-30 16:06:47 -0700 | [diff] [blame] | 2 | # Find builds here: |
| 3 | # https://android-build.googleplex.com/builds/branches/aosp-emu-master-dev/grid? |
bohu | c383a21 | 2017-02-02 12:25:31 -0800 | [diff] [blame] | 4 | set -e |
| 5 | |
Roman Kiryanov | 683d70c | 2018-08-30 16:06:47 -0700 | [diff] [blame] | 6 | function 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 | |
bohu | c383a21 | 2017-02-02 12:25:31 -0800 | [diff] [blame] | 21 | if [ $# == 1 ] |
| 22 | then |
| 23 | build=$1 |
| 24 | else |
| 25 | echo Usage: $0 build |
| 26 | exit 1 |
| 27 | fi |
| 28 | |
Roman Kiryanov | 683d70c | 2018-08-30 16:06:47 -0700 | [diff] [blame] | 29 | linux_zip="sdk-repo-linux-emulator-$build.zip" |
| 30 | mac_zip="sdk-repo-darwin-emulator-$build.zip" |
bohu | c383a21 | 2017-02-02 12:25:31 -0800 | [diff] [blame] | 31 | |
| 32 | echo Fetching Linux $build |
| 33 | /google/data/ro/projects/android/fetch_artifact --bid $build --target sdk_tools_linux "$linux_zip" |
Roman Kiryanov | 683d70c | 2018-08-30 16:06:47 -0700 | [diff] [blame] | 34 | update_binaries "$linux_zip" "linux-x86_64" |
bohu | c383a21 | 2017-02-02 12:25:31 -0800 | [diff] [blame] | 35 | |
| 36 | echo Fetching Mac $build |
| 37 | /google/data/ro/projects/android/fetch_artifact --bid $build --target sdk_tools_mac "$mac_zip" |
Roman Kiryanov | 683d70c | 2018-08-30 16:06:47 -0700 | [diff] [blame] | 38 | update_binaries "$mac_zip" "darwin-x86_64" |
bohu | c383a21 | 2017-02-02 12:25:31 -0800 | [diff] [blame] | 39 | |
| 40 | printf "Upgrade emulator to emu-master-dev build $build\n\n" > emulator.commitmsg |
| 41 | |
Roman Kiryanov | 683d70c | 2018-08-30 16:06:47 -0700 | [diff] [blame] | 42 | git commit -s -t emulator.commitmsg |
bohu | c383a21 | 2017-02-02 12:25:31 -0800 | [diff] [blame] | 43 | |
Roman Kiryanov | 683d70c | 2018-08-30 16:06:47 -0700 | [diff] [blame] | 44 | rm -f "emulator.commitmsg" |
| 45 | rm -f "$linux_zip" |
| 46 | rm -f "$mac_zip" |