Lingfeng Yang | 45bb29b | 2020-02-15 11:31:26 -0800 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | # Find builds here: |
| 3 | # https://android-build.googleplex.com/builds/branches/aosp-emu-master-dev/grid? |
| 4 | set -e |
| 5 | |
| 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 | |
| 21 | if [ $# == 1 ] |
| 22 | then |
| 23 | build=$1 |
| 24 | else |
| 25 | echo Usage: $0 build |
| 26 | exit 1 |
| 27 | fi |
| 28 | |
| 29 | linux_zip="sdk-repo-linux-emulator-$build.zip" |
| 30 | |
| 31 | echo Fetching Linux $build |
| 32 | /google/data/ro/projects/android/fetch_artifact --bid $build --target sdk_tools_linux "$linux_zip" |
| 33 | update_binaries "$linux_zip" "linux-x86_64" |
| 34 | |
| 35 | printf "Upgrade emulator to emu-master-dev build $build\n\n" > emulator.commitmsg |
| 36 | |
| 37 | git commit -s -t emulator.commitmsg |
| 38 | |
| 39 | rm -f "emulator.commitmsg" |
| 40 | rm -f "$linux_zip" |