blob: 84a5fd23677eba75975daf2e5c56e2d26a371713 [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/go/go_library.gni")
import("//build/go/go_test.gni")
import("//build/go/toolchain.gni")
import("//build/package.gni")
import("//garnet/go/src/grand_unified_binary/gub.gni")
import("//src/sys/build/components.gni")
go_library("pmd") {
name = "go.fuchsia.dev/fuchsia/src/sys/pkg/bin/pkgfs/..."
deps = [
"//garnet/go/src/merkle",
"//garnet/go/src/thinfs:thinfs_lib",
"//sdk/fidl/fuchsia.sys($go_toolchain)",
"//src/lib/component",
"//src/sys/pkg/bin/pm:pm_lib",
"//src/sys/pkg/lib/far/go:far",
]
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" ]
}
package("disable-executability-restrictions") {
__deprecated_system_image = true
resources = [
{
dest = "pkgfs_disable_executability_restrictions"
path = "disable_executability_restrictions"
},
]
}
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",
"//zircon/system/ulib/ramdevice-client",
]
}
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" ]
}