| # Copyright 2019 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. |
| |
| import("//build/config/fuchsia/zircon.gni") |
| |
| manifests = |
| read_file("$zircon_root_build_dir/legacy_unification-$target_cpu.json", |
| "json") |
| zircon_artifacts = [] |
| |
| foreach(manifest, manifests) { |
| if (manifest.cpu == target_cpu && manifest.os == target_os) { |
| _manifest_file = "$zircon_root_build_dir/${manifest.path}" |
| _lines = [] |
| _lines = read_file(_manifest_file, "list lines") |
| _manifest_deps = [] |
| _manifest_lines = [] |
| foreach(line, _lines) { |
| dep = string_replace(line, "@", "") |
| if (dep != line) { |
| # This is a line of the format "@foobar", which denotes a dependency on |
| # "foobar". |
| _manifest_deps += [ ":$dep" ] |
| } else { |
| _manifest_lines += [ line ] |
| } |
| } |
| zircon_artifacts += [ |
| { |
| name = manifest.name |
| deps = _manifest_deps |
| lines = _manifest_lines |
| }, |
| ] |
| } |
| } |