| # Copyright 2019 The Fuchsia Authors. All rights reserved. |
| # Use of this source code is governed by a BSD-style license that can be |
| # found in the LICENSE file. |
| |
| from recipe_engine import recipe_api |
| |
| QEMU_CIPD_VERSION = 'git_revision:533bf2563d0213a7e002d9fcde75519d30ffa70f' |
| AEMU_CIPD_VERSION = 'git_revision:de95df869556006ad87f402110aa835d03835060' |
| |
| |
| class EmuApi(recipe_api.RecipeApi): |
| |
| def is_emulator_type(self, device_type): |
| """Determines if the given device is an emulator. |
| |
| Args: |
| device_type (str): The device to check. |
| """ |
| return device_type == 'QEMU' or device_type == 'AEMU' |
| |
| def add_aemu_to_ensure_file(self, ensure_file, subdir=None): |
| ensure_file.add_package( |
| 'fuchsia/third_party/aemu/${platform}', |
| AEMU_CIPD_VERSION, |
| subdir=subdir) |
| |
| def add_qemu_to_ensure_file(self, ensure_file, subdir=None): |
| ensure_file.add_package( |
| 'fuchsia/third_party/qemu/${platform}', |
| QEMU_CIPD_VERSION, |
| subdir=subdir) |