blob: 0a04bb8a017865f2baa860ca8a67163aaaba4592 [file] [log] [blame]
# 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.
if (is_host) {
# Copies templates to the specified output directory and generates a file
# containing all copied paths.
copy("templates") {
# All template files available to fx create.
sources = [
"component-v1/{{snake_case PROJECT_NAME}}.cc.tmpl-cpp",
"component-v1/{{snake_case PROJECT_NAME}}.h.tmpl-cpp",
"component-v1/{{snake_case PROJECT_NAME}}",
"component-v2/{{snake_case PROJECT_NAME}}.cc.tmpl-cpp",
"component-v2/{{snake_case PROJECT_NAME}}.h.tmpl-cpp",
"component-v2/{{snake_case PROJECT_NAME}}",
"driver/{{snake_case PROJECT_NAME}}.bind.tmpl-cpp",
"driver/{{snake_case PROJECT_NAME}}.cc.tmpl-cpp",
"driver/{{snake_case PROJECT_NAME}}.h.tmpl-cpp",
outputs =
[ "${host_tools_dir}/create_templates/{{source_target_relative}}" ]
# Write out all the template paths to a single file as JSON.
# fx create will use the paths in this file as the available set of
# template files.
metadata = {
# Include the template files as test dependencies.
# Tests that depend on the `create` binary need to pull in the template files
# transitively.
test_runtime_deps =
rebase_path(sources, "", "${host_tools_dir}/create_templates") +
[ "${host_tools_dir}/create_templates/templates.json" ]