2021-06-23 18:34:31 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
# Copyright 2021 The Chromium OS Authors. All rights reserved.
|
|
|
|
# Use of this source code is governed by a BSD-style license that can be
|
2021-06-21 11:59:04 +00:00
|
|
|
# found in the LICENSE file.
|
2021-06-23 18:34:31 +00:00
|
|
|
#
|
|
|
|
# To build crosvm using cargo against libraries and crates provided by ChromeOS
|
|
|
|
# use this script to update path references in Cargo.toml.
|
|
|
|
#
|
|
|
|
# TODO(b/194323235): Add documentation for ChromeOS developer workflows.
|
|
|
|
|
2021-08-13 17:43:07 +00:00
|
|
|
declare -A replacements=(
|
|
|
|
["libcras_stub"]="../../third_party/adhd/cras/client/libcras"
|
2021-06-21 11:59:04 +00:00
|
|
|
["system_api_stub"]="../../platform2/system_api"
|
2021-08-13 17:43:07 +00:00
|
|
|
["third_party/minijail"]="../../aosp/external/minijail"
|
|
|
|
["third_party/vmm_vhost"]="../../third_party/rust-vmm/vhost"
|
|
|
|
)
|
|
|
|
|
|
|
|
for crate in "${!replacements[@]}"; do
|
|
|
|
echo "Replacing '${crate}' with '${replacements[$crate]}'"
|
|
|
|
sed -i "s|path = \"${crate}|path = \"${replacements[$crate]}|g" \
|
|
|
|
Cargo.toml
|
|
|
|
done
|
2021-06-23 18:34:31 +00:00
|
|
|
|
|
|
|
echo "Modified Cargo.toml with new paths. Please do not commit those."
|