blob: 530d9e3de222fa140e081c0f1cf21bf97eade230 [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/components.gni")
import("//build/go/go_library.gni")
import("//build/go/go_test.gni")
import("//build/go/toolchain.gni")
import("//src/go/grand_unified_binary/gub.gni")
go_library("pmd") {
name = "go.fuchsia.dev/fuchsia/src/sys/pkg/bin/pkgfs/..."
deps = [
"//sdk/fidl/fuchsia.sys($go_toolchain)",
"//src/lib/component",
"//src/lib/thinfs:thinfs_lib",
"//src/sys/pkg/bin/pm:pm_lib",
"//src/sys/pkg/lib/far/go:far",
"//src/sys/pkg/lib/merkle",
]
sources = [
"allowlist/allowlist.go",
"allowlist/allowlist_test.go",
"blobfs/blobfs.go",
"index/dynamic_index.go",
"index/dynamic_index_test.go",
"index/static_index.go",
"index/static_index_test.go",
"iou/iou.go",
"pkgfs/ctl_directory.go",
"pkgfs/dents.go",
"pkgfs/metafar.go",
"pkgfs/needs_directory.go",
"pkgfs/package_directory.go",
"pkgfs/package_install_directory.go",
"pkgfs/package_list_directories.go",
"pkgfs/pkgfs.go",
"pkgfs/pkgfs_test.go",
"pkgfs/root_directory.go",
"pkgfs/unsupported_vnodes.go",
"pkgfs/validation_directory.go",
"pkgfs/validation_directory_test.go",
"pkgfs/versions_directory.go",
"pkgsvr/pkgsvr.go",
"ramdisk/ramdisk.go",
]
}
grand_unified_binary("pkgsvr_bin") {
output_name = "pkgsvr"
}
fuchsia_component("pkgsvr") {
deps = [ ":pkgsvr_bin" ]
manifest = "meta/pkgsvr.cmx"
}
fuchsia_package("pkgfs") {
deps = [ "//src/sys/pkg/bin/pkgfs:pkgsvr" ]
}
go_test_packages = [
"allowlist",
"index",
"pkgfs",
]
go_test_components = []
foreach(testpkg, go_test_packages) {
test_target = "pmd_${testpkg}_test"
go_test(test_target) {
gopackages = [ "go.fuchsia.dev/fuchsia/src/sys/pkg/bin/pkgfs/${testpkg}" ]
deps = [ ":pmd" ]
non_go_deps = [
"//sdk/lib/fdio",
"//src/lib/storage/ramdevice_client/cpp",
]
include_dirs =
[ rebase_path("//src/lib/storage/ramdevice_client/cpp/include") ]
}
test_component_target = "${test_target}_component"
fuchsia_component(test_component_target) {
testonly = true
component_name = test_target
manifest = "meta/$test_target.cmx"
deps = [ ":$test_target" ]
}
go_test_components += [ ":$test_component_target" ]
}
fuchsia_test_package("pmd_tests") {
deps = [ "//src/storage/bin/blobfs" ]
test_components = go_test_components
}
group("tests") {
testonly = true
public_deps = [ ":pmd_tests" ]
}