blob: a546308c87ae6caf7890d73da080c56ab9b60957 [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.
import("//build/go/go_binary.gni")
import("//build/go/go_library.gni")
import("//build/go/go_test.gni")
import("//build/testing/host_test_data.gni")
go_binary("check-licenses") {
gopackage = "go.fuchsia.dev/fuchsia/tools/check-licenses/cmd"
deps = [ ":main" ]
}
go_library("main") {
source_dir = "cmd"
deps = [
":lib",
"golden",
"//third_party/golibs:cloud.google.com/go/storage",
"//third_party/golibs:github.com/google/subcommands",
"//tools/lib/logger",
]
sources = [
"gn.go",
"main.go",
]
}
go_library("lib") {
sources = [
"config.go",
"driver.go",
]
deps = [
"file",
"filetree",
"license",
"project",
"result",
"//tools/lib/logger",
]
}
install_host_tools("host") {
deps = [ ":check-licenses" ]
outputs = [ "check-licenses" ]
}
group("tests") {
testonly = true
deps = [
":check-licenses_golden_tests($host_toolchain)",
"file:tests",
"filetree:tests",
"project:tests",
]
}
if (is_host) {
go_test("check-licenses_golden_tests") {
gopackages = [ "go.fuchsia.dev/fuchsia/tools/check-licenses/golden" ]
args = [
"--test_data_dir",
rebase_path("$target_gen_dir/golden", root_build_dir),
]
deps = [ "golden" ]
non_go_deps = [ "golden:licenses" ]
}
}