blob: fbd0868c1043e35e59fae1b8169e70f275d595ff [file] [log] [blame]
# Copyright 2022 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.
load(
"@fuchsia_infra//infra:infra.bzl",
"fuchsia_builder_group",
)
load(
"@rules_fuchsia//fuchsia:defs.bzl",
"fuchsia_emulator",
"fuchsia_local_package_repository",
"fuchsia_remote_product_bundle",
)
load("@rules_fuchsia//fuchsia:workflows.bzl", "fuchsia_development_configuration")
load("@bazel_skylib//rules:common_settings.bzl", "bool_flag")
# This is the top level target that gets built by infra
fuchsia_builder_group(
name = "buildbot",
build_only = [
"//src/fortune_teller:pkg",
],
cipd_uploads = [
"//src:artifact_cipd_release",
"//src:debug_symbol_cipd_release",
],
test_groups = [
"//src:tests",
],
)
# Development Flags
bool_flag(
name = "no_kvm",
build_setting_default = False
)
config_setting(
name = "disable_kvm",
flag_values = {
":no_kvm": "true"
}
)
# Environment Configuration
# The workstation product bundle.
fuchsia_remote_product_bundle(
name = "pb_ws",
product_name = "workstation_eng.qemu-x64",
repository = "workstation-packages",
)
# The workstation product bundle for running on the chromebook
fuchsia_remote_product_bundle(
name = "pb_chromebook",
product_name = "workstation_eng.chromebook-x64",
repository = "workstation-packages",
)
# A fuchsia emulator which runs the workstation product.
# To launch this emulator without kvm run `bazel run --//:no_kvm //:emu_ws.start
fuchsia_emulator(
name = "emu_ws",
emulator_name = "workstation-emulator",
launch_options = [
"--headless",
] + select({
":disable_kvm": [
"--engine",
"qemu",
"--startup-timeout",
"720",
"--accel",
"none",
"--device",
"qemu-x64-emu-min",
],
"//conditions:default": []
}
),
product_bundle = ":pb_ws",
)
fuchsia_local_package_repository(
name = "dev_repo",
repo_name = "devhost",
repo_path = ".package_repos/devhost",
)
# Run this target to set up the environment for working with the workstation
# product on an emulator
fuchsia_development_configuration(
name = "ws_emu_development",
emulator = ":emu_ws",
package_repository = ":dev_repo",
product_bundle = ":pb_ws",
)
# Run this target to set up the environment for working with a physical
# chromebook running the workstation product. This target should run after
# the device has been plugged in to the host.
fuchsia_development_configuration(
name = "ws_development",
autodetect_target = True,
package_repository = ":dev_repo",
stop_emulators = True,
product_bundle = ":pb_chromebook",
)