blob: 711a9644cc12b5e614ee1431fc870fbe1c67119f [file] [log] [blame]
#!/usr/bin/env bash
# Copyright 2020 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.
# This script compiles the .proto files and copies the compiled versions
# from the build dir back to the source tree. It should be run whenever
# the .proto files are modified.
set -o errexit
set -o pipefail
# cd to fuchsia checkout root.
cd "$( dirname "${BASH_SOURCE[0]}" )/../../.."
# scripts/fx set core.x64 --with //tools/virtual_device:proto
# TODO(garymm): We should probably build the :proto target instead, but currently
# that builds a static library which is unnecesarily slow. We should fix the
# proto_library() GN template so it doesn't unnecessarily declare a static_library.
scripts/fx ninja -C out/default tools/virtual_device:proto_lib_gen
cp out/default/gen/go-proto-gen/src/tools/virtual_device/proto/*.pb.go \
tools/virtual_device/proto/