blob: 17c0790d85dc53f727dddb3b2d1eea193e0ae4a3 [file] [log] [blame]
# Copyright 2021 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/components.gni")
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")
copy("copy-files") {
sources = [
"//sdk/version_history.json",
"version_history.go",
"version_history_test.go",
]
outputs = [ "$target_gen_dir/{{source_file_part}}" ]
}
go_library("version-history") {
name = "go.fuchsia.dev/fuchsia/src/sys/pkg/lib/version-history/go"
source_dir = target_gen_dir
sources = [
"version_history.go",
"version_history.json",
"version_history_test.go",
]
non_go_deps = [ ":copy-files" ]
}
if (is_host) {
host_test_data("version-history-test-data") {
sources = [ "//sdk/version_history.json" ]
outputs =
[ "$root_out_dir/test_data/version-history/go/{{source_file_part}}" ]
}
go_test("version-history-test") {
gopackages = [ "go.fuchsia.dev/fuchsia/src/sys/pkg/lib/version-history/go" ]
deps = [ ":version-history" ]
non_go_deps = [ ":version-history-test-data" ]
}
}
group("tests") {
testonly = true
public_deps = [ ":version-history-test($host_toolchain)" ]
}