blob: b0fe064be5bc92d248ab979f5495949dc2476e2c [file] [log] [blame]
# Copyright 2017 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/go/go_binary.gni")
import("//build/go/go_library.gni")
import("//build/go/go_test.gni")
import("//build/host.gni")
import("//build/package.gni")
go_library("lib") {
name = "traceutil"
deps = [
":zedmon",
"//third_party/golibs:github.com/golang/glog",
"//third_party/golibs:github.com/google/subcommands",
"//third_party/golibs:github.com/pkg/sftp",
"//third_party/golibs:golang.org/x/crypto",
]
}
go_binary("bin") {
output_name = "traceutil"
gopackage = "traceutil"
deps = [ ":lib" ]
}
install_host_tools("traceutil") {
deps = [ ":bin" ]
outputs = [ "traceutil" ]
}
go_library("zedmon") {
name = "fuchsia.googlesource.com/fuchsia/garnet/bin/traceutil/zedmon"
source_dir = "zedmon"
}
_fake_zedmon_path = "$target_gen_dir/zedmon_test/runtime_deps/fake_zedmon"
go_test("zedmon_test") {
gopackages =
[ "fuchsia.googlesource.com/fuchsia/garnet/bin/traceutil/zedmon" ]
args = [
"-fake_zedmon_relpath",
rebase_path(_fake_zedmon_path, root_out_dir),
]
deps = [ ":lib" ]
non_go_deps = [ ":zedmon_test_runtime_deps" ]
}
copy("zedmon_test_runtime_deps") {
sources = [ "$root_out_dir/fake_zedmon" ]
outputs = [ _fake_zedmon_path ]
metadata = {
test_runtime_deps = [ _fake_zedmon_path ]
}
deps = [ "//tools/zedmon:fake_zedmon_bin" ]
}