| # 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. | 
 |  | 
 | import("//build/go/go_binary.gni") | 
 | import("//build/go/go_library.gni") | 
 | import("//build/go/go_test.gni") | 
 | import("//build/host.gni") | 
 |  | 
 | go_library("lib") { | 
 |   deps = [ | 
 |     "//third_party/golibs:github.com/golang/glog", | 
 |     "//third_party/golibs:github.com/google/go-cmp", | 
 |     "//third_party/golibs:github.com/pkg/sftp", | 
 |     "//third_party/golibs:golang.org/x/crypto", | 
 |     "//tools/qemu", | 
 |   ] | 
 |   sources = [ | 
 |     "api.go", | 
 |     "api_test.go", | 
 |     "build.go", | 
 |     "build_mock.go", | 
 |     "build_test.go", | 
 |     "command.go", | 
 |     "command_mock.go", | 
 |     "connector.go", | 
 |     "connector_mock.go", | 
 |     "connector_test.go", | 
 |     "e2e_test.go", | 
 |     "fuzzer.go", | 
 |     "fuzzer_test.go", | 
 |     "handle.go", | 
 |     "handle_test.go", | 
 |     "instance.go", | 
 |     "instance_test.go", | 
 |     "launcher.go", | 
 |     "launcher_mock.go", | 
 |     "launcher_test.go", | 
 |     "process.go", | 
 |     "process_test.go", | 
 |     "ssh_fake.go", | 
 |     "test_utils.go", | 
 |   ] | 
 | } | 
 |  | 
 | # This tool can only be built on the host | 
 | if (is_host) { | 
 |   go_library("main") { | 
 |     name = "main" | 
 |     source_dir = "cmd" | 
 |     deps = [ ":lib" ] | 
 |     sources = [ "fuzz.go" ] | 
 |   } | 
 |  | 
 |   go_binary("undercoat") { | 
 |     gopackage = "main" | 
 |     deps = [ ":main" ] | 
 |   } | 
 |  | 
 |   go_test("undercoat_tests") { | 
 |     gopackages = [ "go.fuchsia.dev/fuchsia/tools/fuzz" ] | 
 |     deps = [ ":lib" ] | 
 |   } | 
 |  | 
 |   group("tests") { | 
 |     testonly = true | 
 |  | 
 |     deps = [ ":undercoat_tests" ] | 
 |   } | 
 | } | 
 |  | 
 | install_host_tools("fuzz") { | 
 |   deps = [ ":undercoat" ] | 
 |   outputs = [ "undercoat" ] | 
 | } |