| # 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. |
| |
| visibility = [ "$cobalt_root/*" ] |
| |
| import("//build/go/go_binary.gni") |
| import("//build/go/go_library.gni") |
| import("//build/go/go_test.gni") |
| |
| go_library("validator") { |
| name = target_name |
| source_dir = target_name |
| sources = [ |
| "customers.go", |
| "escape_hatch.go", |
| "metrics.go", |
| "projects.go", |
| "registries.go", |
| "reports.go", |
| ] |
| |
| # Test files |
| sources += [ |
| "customers_test.go", |
| "escape_hatch_test.go", |
| "metrics_test.go", |
| "projects_test.go", |
| "reports_test.go", |
| ] |
| } |
| |
| go_test("validator_test") { |
| gopackages = [ "validator" ] |
| deps = [ |
| ":validator", |
| "$cobalt_root/src/registry:cobalt_registry_proto_go", |
| "//third_party/golibs:github.com/golang/glog", |
| "//third_party/golibs:google.golang.org/protobuf", |
| ] |
| } |
| |
| # This duplicates some source paths, but main needs to be relocated into a |
| # package path for our go_build rules. |
| go_library("main") { |
| name = target_name |
| |
| sources = [ "config_change_validator_main.go" ] |
| source_dir = "." |
| } |
| |
| go_binary("bin") { |
| gopackage = "main" |
| output_name = "config_change_validator" |
| |
| deps = [ |
| ":main", |
| ":validator", |
| "$cobalt_root/src/registry:cobalt_registry_proto_go", |
| "//third_party/golibs:github.com/golang/glog", |
| "//third_party/golibs:google.golang.org/protobuf", |
| ] |
| } |
| |
| group("tests") { |
| testonly = true |
| |
| deps = [ ":validator_test" ] |
| } |