load("//cuttlefish/package:rules.bzl", "package_files")

package_files(
    name = "cvd",
    executable = "cuttlefish-common/bin/cvd",
    package_file_symlink_to_package_file = {
        "cuttlefish-common/bin/mcopy": "cuttlefish-common/bin/mtools",
        "cuttlefish-common/bin/mmd": "cuttlefish-common/bin/mtools",
        "cuttlefish-common/bin/resize.f2fs": "cuttlefish-common/bin/fsck.f2fs",
        "cuttlefish-common/bin/aarch64-linux-gnu/gfxstream_graphics_detector": "cuttlefish-common/bin/graphics_detector",
        "cuttlefish-common/bin/aarch64-linux-gnu/libmem_overrides.so": "cuttlefish-common/bin/libmem_overrides.so",
        "cuttlefish-common/bin/aarch64-linux-gnu/libvk_swiftshader.so": "cuttlefish-common/bin/libvk_swiftshader.so",
        "cuttlefish-common/bin/x86_64-linux-gnu/gfxstream_graphics_detector": "cuttlefish-common/bin/graphics_detector",
        "cuttlefish-common/lib64/vulkan.lvp.so": "cuttlefish-common/bin/libvk_lavapipe.so",
        "cuttlefish-common/lib64/vulkan.pastel.so": "cuttlefish-common/bin/libvk_swiftshader.so",
    },
    package_file_to_src = {
        "cuttlefish-common/bin/adb": "//adb:adb",
        "cuttlefish-common/bin/adb_connector": "//cuttlefish/host/frontend/adb_connector",
        "cuttlefish-common/bin/assemble_cvd": "//cuttlefish/host/commands/assemble_cvd",
        "cuttlefish-common/bin/avbtool.py": "@avb//:avbtool.py",
        "cuttlefish-common/bin/casimir_control_server": "//cuttlefish/host/commands/casimir_control_server",
        "cuttlefish-common/bin/casimir": "@casimir",
        "cuttlefish-common/bin/cf_vhost_user_input": "//cuttlefish/host/commands/vhost_user_input:cf_vhost_user_input",
        "cuttlefish-common/bin/console_forwarder": "//cuttlefish/host/commands/console_forwarder",
        "cuttlefish-common/bin/control_env_proxy_server": "//cuttlefish/host/commands/control_env_proxy_server",
        "cuttlefish-common/bin/cpio": "@libarchive//cpio:cpio",
        "cuttlefish-common/bin/cuttlefish_example_action_server": "//cuttlefish/host/example_custom_actions:cuttlefish_example_action_server",
        "cuttlefish-common/bin/cvd_import_locations": "//cuttlefish/host/commands/cvd_import_locations",
        "cuttlefish-common/bin/cvd_internal_display": "//cuttlefish/host/commands/display:cvd_internal_display",
        "cuttlefish-common/bin/cvd_internal_env": "//cuttlefish/host/commands/cvd_env:cvd_internal_env",
        "cuttlefish-common/bin/cvd_internal_host_bugreport": "//cuttlefish/host/commands/host_bugreport:cvd_internal_host_bugreport",
        "cuttlefish-common/bin/cvd_internal_start": "//cuttlefish/host/commands/start:cvd_internal_start",
        "cuttlefish-common/bin/cvd_internal_status": "//cuttlefish/host/commands/status:cvd_internal_status",
        "cuttlefish-common/bin/cvd_internal_stop": "//cuttlefish/host/commands/stop:cvd_internal_stop",
        "cuttlefish-common/bin/cvd_refresh_groups": "//cuttlefish/host/commands/refresh_groups:cvd_refresh_groups",
        "cuttlefish-common/bin/cvd_send_id_disclosure": "//cuttlefish/host/commands/cvd_send_id_disclosure",
        "cuttlefish-common/bin/cvd_send_sms": "//cuttlefish/host/commands/cvd_send_sms",
        "cuttlefish-common/bin/cvd_update_location": "//cuttlefish/host/commands/cvd_update_location",
        "cuttlefish-common/bin/cvd_update_security_algorithm": "//cuttlefish/host/commands/cvd_update_security_algorithm",
        "cuttlefish-common/bin/cvd": "//cuttlefish/host/commands/cvd",
        "cuttlefish-common/bin/cvdalloc": "//cuttlefish/host/commands/cvdalloc",
        "cuttlefish-common/bin/e2fsck": "@e2fsprogs//:e2fsck",
        "cuttlefish-common/bin/e2fsdroid": "@e2fsprogs//:e2fsdroid",
        "cuttlefish-common/bin/echo_server": "//cuttlefish/host/commands/echo_server",
        "cuttlefish-common/bin/extract-ikconfig": "//cuttlefish/host/commands/extract_ikconfig:extract-ikconfig.sh",
        "cuttlefish-common/bin/extract-vmlinux": "//cuttlefish/host/commands/extract_vmlinux:extract-vmlinux.sh",
        "cuttlefish-common/bin/fsck.f2fs": "@f2fs_tools//:fsck.f2fs",
        "cuttlefish-common/bin/fastboot": "//fastboot",
        "cuttlefish-common/bin/fec": "//fec",
        "cuttlefish-common/bin/generate_shader_embed": "//cuttlefish/host/graphics_detector/shaders:generate_shader_embed",
        "cuttlefish-common/bin/gnss_grpc_proxy": "//cuttlefish/host/commands/gnss_grpc_proxy",
        "cuttlefish-common/bin/graphics_detector": "//cuttlefish/host/graphics_detector",
        "cuttlefish-common/bin/health": "//cuttlefish/host/commands/health",
        "cuttlefish-common/bin/kernel_log_monitor": "//cuttlefish/host/commands/kernel_log_monitor",
        "cuttlefish-common/bin/libmem_overrides.so": "//cuttlefish/host/graphics/mem_overrides:libmem_overrides.so",
        "cuttlefish-common/bin/libgfxstream_backend.so": "@gfxstream//host:gfxstream_backend",
        "cuttlefish-common/bin/libvk_lavapipe.so": "@mesa//:vk_lavapipe",
        "cuttlefish-common/bin/libvk_swiftshader.so": "@swiftshader//:vk_swiftshader",
        "cuttlefish-common/bin/log_tee": "//cuttlefish/host/commands/log_tee",
        "cuttlefish-common/bin/logcat_receiver": "//cuttlefish/host/commands/logcat_receiver",
        "cuttlefish-common/bin/lpadd": "@android_system_extras//:lpadd",
        "cuttlefish-common/bin/lpmake": "@android_system_extras//:lpmake",
        "cuttlefish-common/bin/lz4": "@lz4//programs:lz4",
        "cuttlefish-common/bin/make_f2fs": "@f2fs_tools//:make_f2fs",
        "cuttlefish-common/bin/metrics_launcher": "//cuttlefish/host/commands/metrics_launcher",
        "cuttlefish-common/bin/metrics": "//cuttlefish/host/commands/metrics",
        "cuttlefish-common/bin/mkbootfs": "//mkbootfs",
        "cuttlefish-common/bin/mkbootimg.py": "@mkbootimg//:mkbootimg.py",
        "cuttlefish-common/bin/mke2fs": "@e2fsprogs//:mke2fs",
        "cuttlefish-common/bin/mke2fs.conf": "//libext4_utils:mke2fs.conf",
        "cuttlefish-common/bin/mkenvimage_slim": "//cuttlefish/host/commands/mkenvimage_slim",
        "cuttlefish-common/bin/mkfs.fat": "@dosfstools//:mkfs.fat",
        "cuttlefish-common/bin/mkuserimg_mke2fs.py": "//libext4_utils:mkuserimg_mke2fs.py",
        "cuttlefish-common/bin/modem_simulator": "//cuttlefish/host/commands/modem_simulator",
        "cuttlefish-common/bin/ms-tpm-20-ref": "@ms-tpm-20-ref//:simulator",
        "cuttlefish-common/bin/mtools": "@mtools//:mtools",
        "cuttlefish-common/bin/netsim": "@android_tools_netsim//:netsim",
        "cuttlefish-common/bin/netsimd": "@android_tools_netsim//:netsimd",
        "cuttlefish-common/bin/openwrt_control_server": "//cuttlefish/host/commands/openwrt_control_server",
        "cuttlefish-common/bin/operator_proxy": "//cuttlefish/host/frontend/operator_proxy",
        "cuttlefish-common/bin/pica": "@netsim_crates//:pica__pica",
        "cuttlefish-common/bin/powerbtn_cvd": "//cuttlefish/host/commands/powerbtn_cvd",
        "cuttlefish-common/bin/powerwash_cvd": "//cuttlefish/host/commands/powerwash_cvd",
        "cuttlefish-common/bin/process_restarter": "//cuttlefish/host/commands/process_restarter",
        "cuttlefish-common/bin/record_cvd": "//cuttlefish/host/commands/record_cvd",
        "cuttlefish-common/bin/resize2fs": "@e2fsprogs//:resize2fs",
        "cuttlefish-common/bin/restart_cvd": "//cuttlefish/host/commands/restart_cvd",
        "cuttlefish-common/bin/rootcanal": "@rootcanal",
        "cuttlefish-common/bin/run_cvd": "//cuttlefish/host/commands/run_cvd",
        "cuttlefish-common/bin/screen_recording_server": "//cuttlefish/host/commands/screen_recording_server",
        # "cuttlefish-common/bin/secure_env": "//cuttlefish/host/commands/secure_env", # TODO: schuffelen - make this more complete
        "cuttlefish-common/bin/sefcontext_compile": "@selinux//:sefcontext_compile",
        "cuttlefish-common/bin/sensors_simulator": "//cuttlefish/host/commands/sensors_simulator",
        "cuttlefish-common/bin/simg2img": "@android_system_core//:simg2img",
        "cuttlefish-common/bin/snapshot_util_cvd": "//cuttlefish/host/commands/snapshot_util_cvd",
        "cuttlefish-common/bin/socket_vsock_proxy": "//cuttlefish/common/frontend/socket_vsock_proxy",
        "cuttlefish-common/bin/tcp_connector": "//cuttlefish/host/commands/tcp_connector",
        "cuttlefish-common/bin/tombstone_receiver": "//cuttlefish/host/commands/tombstone_receiver",
        "cuttlefish-common/bin/unpack_bootimg.py": "@mkbootimg//:unpack_bootimg.py",
        "cuttlefish-common/bin/vhu_media_emulated_camera_splane": "//cuttlefish/host/commands/vhost_user_media/emulated_camera_splane",
        "cuttlefish-common/bin/vhu_media_emulated_camera_mplane": "//cuttlefish/host/commands/vhost_user_media/emulated_camera_mplane",
        "cuttlefish-common/bin/vk_lavapipe_icd.json": "//cuttlefish/host/graphics/vulkan:vk_lavapipe_icd",
        "cuttlefish-common/bin/vk_swiftshader_icd.json": "//cuttlefish/host/graphics/vulkan:vk_swiftshader_icd",
        "cuttlefish-common/bin/webRTC": "//cuttlefish/host/frontend/webrtc:webRTC",
        "cuttlefish-common/bin/wmediumd": "@wmediumd//:wmediumd",
        "cuttlefish-common/bin/wmediumd_gen_config": "@wmediumd//:wmediumd_gen_config",
        "cuttlefish-common/etc/default_input_devices/keyboard.json": "//cuttlefish/host/commands/vhost_user_input:device_specs/keyboard.json",
        "cuttlefish-common/etc/default_input_devices/mouse.json": "//cuttlefish/host/commands/vhost_user_input:device_specs/mouse.json",
        "cuttlefish-common/etc/default_input_devices/gamepad.json": "//cuttlefish/host/commands/vhost_user_input:device_specs/gamepad.json",
        "cuttlefish-common/etc/default_input_devices/multi_touchpad_template.json": "//cuttlefish/host/commands/vhost_user_input:device_specs/multi_touchpad_template.json",
        "cuttlefish-common/etc/default_input_devices/multi_touchscreen_template.json": "//cuttlefish/host/commands/vhost_user_input:device_specs/multi_touchscreen_template.json",
        "cuttlefish-common/etc/default_input_devices/rotary_wheel.json": "//cuttlefish/host/commands/vhost_user_input:device_specs/rotary_wheel.json",
        "cuttlefish-common/etc/default_input_devices/single_touchpad_template.json": "//cuttlefish/host/commands/vhost_user_input:device_specs/single_touchpad_template.json",
        "cuttlefish-common/etc/default_input_devices/single_touchscreen_template.json": "//cuttlefish/host/commands/vhost_user_input:device_specs/single_touchscreen_template.json",
        "cuttlefish-common/etc/default_input_devices/switches.json": "//cuttlefish/host/commands/vhost_user_input:device_specs/switches.json",
        "cuttlefish-common/etc/cvd_custom_action_config/cuttlefish_example_action_config.json": "//cuttlefish/host/example_custom_actions:custom_action_config.json",
        "cuttlefish-common/etc/modem_simulator/files/iccprofile_for_sim0_for_CtsCarrierApiTestCases.xml": "//cuttlefish/host/commands/modem_simulator:etc/files/iccprofile_for_sim0_for_CtsCarrierApiTestCases.xml",
        "cuttlefish-common/etc/modem_simulator/files/iccprofile_for_sim0.xml": "//cuttlefish/host/commands/modem_simulator:etc/files/iccprofile_for_sim0.xml",
        "cuttlefish-common/etc/modem_simulator/files/iccprofile_for_sim1_for_CtsCarrierApiTestCases.xml": "//cuttlefish/host/commands/modem_simulator:etc/files/iccprofile_for_sim1_for_CtsCarrierApiTestCases.xml",
        "cuttlefish-common/etc/modem_simulator/files/iccprofile_for_sim1.xml": "//cuttlefish/host/commands/modem_simulator:etc/files/iccprofile_for_sim1.xml",
        "cuttlefish-common/etc/modem_simulator/files/numeric_operator.xml": "//cuttlefish/host/commands/modem_simulator:etc/files/numeric_operator.xml",
        # "cuttlefish-common/bin/crosvm": "@crosvm_bin//:crosvm__crosvm", # TODO: b/402274999 - currently requires --enable_sandbox=false
        "cuttlefish-common/usr/share/webrtc/assets/client.html": "//cuttlefish/host/frontend/webrtc/html_client:client.html",
        "cuttlefish-common/usr/share/webrtc/assets/controls.css": "//cuttlefish/host/frontend/webrtc/html_client:controls.css",
        "cuttlefish-common/usr/share/webrtc/assets/custom.css": "//cuttlefish/host/frontend/webrtc/html_client:custom.css",
        "cuttlefish-common/usr/share/webrtc/assets/style.css": "//cuttlefish/host/frontend/webrtc/html_client:style.css",
        "cuttlefish-common/usr/share/webrtc/assets/js/adb.js": "//cuttlefish/host/frontend/webrtc/html_client:js/adb.js",
        "cuttlefish-common/usr/share/webrtc/assets/js/app.js": "//cuttlefish/host/frontend/webrtc/html_client:js/app.js",
        "cuttlefish-common/usr/share/webrtc/assets/js/cf_webrtc.js": "//cuttlefish/host/frontend/webrtc/html_client:js/cf_webrtc.js",
        "cuttlefish-common/usr/share/webrtc/assets/js/controls.js": "//cuttlefish/host/frontend/webrtc/html_client:js/controls.js",
        "cuttlefish-common/usr/share/webrtc/assets/js/keyboard.js": "//cuttlefish/host/frontend/webrtc/html_client:js/keyboard.js",
        "cuttlefish-common/usr/share/webrtc/assets/js/location.js": "//cuttlefish/host/frontend/webrtc/html_client:js/location.js",
        "cuttlefish-common/usr/share/webrtc/assets/js/mouse.js": "//cuttlefish/host/frontend/webrtc/html_client:js/mouse.js",
        "cuttlefish-common/usr/share/webrtc/assets/js/gamepad.js": "//cuttlefish/host/frontend/webrtc/html_client:js/gamepad.js",
        "cuttlefish-common/usr/share/webrtc/assets/js/rootcanal.js": "//cuttlefish/host/frontend/webrtc/html_client:js/rootcanal.js",
        "cuttlefish-common/usr/share/webrtc/assets/js/touch.js": "//cuttlefish/host/frontend/webrtc/html_client:js/touch.js",
    },
    visibility = ["//:android_cuttlefish"],
)

package_files(
    name = "defaults",
    executable = "cuttlefish-integration/bin/cf_defaults",
    package_file_to_src = {
        "cuttlefish-integration/bin/cf_defaults": "//cuttlefish/host/commands/defaults:cf_defaults",
    },
    visibility = ["//:android_cuttlefish"],
)

package_files(
    name = "metrics",
    executable = "cuttlefish-metrics/bin/metrics_transmitter",
    package_file_to_src = {
        "cuttlefish-metrics/bin/metrics_transmitter": "//cuttlefish/host/commands/metrics:metrics_transmitter",
    },
    visibility = ["//:android_cuttlefish"],
)
