blob: 18b3b3023293bc6aa053ae0b661dcc3d4d06a6ee [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/testing/host_test_data.gni")
go_library("lib") {
name = "traceutil"
sources = [
"actions.go",
"check_build.go",
"cmd_convert.go",
"cmd_record.go",
"main.go",
"target_connection.go",
"util.go",
]
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") {
source_dir = "zedmon"
sources = [
"zedmon.go",
"zedmon_test.go",
]
}
if (is_host) {
_fake_zedmon_path = "$target_gen_dir/zedmon_test/runtime_deps/fake_zedmon"
go_test("zedmon_test") {
gopackages = [ "go.fuchsia.dev/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" ]
}
host_test_data("zedmon_test_runtime_deps") {
sources = [ "$root_out_dir/fake_zedmon" ]
outputs = [ _fake_zedmon_path ]
deps = [ "//tools/zedmon:fake_zedmon_bin" ]
}
}