BUILD 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. package(default_visibility = ["//visibility:public"])
  2. load(
  3. "@io_bazel_rules_go//go:def.bzl",
  4. "go_test",
  5. "go_library",
  6. )
  7. go_test(
  8. name = "go_default_test",
  9. srcs = [
  10. "cgroup_test.go",
  11. "stat_test.go",
  12. ],
  13. embed = [":go_default_library"],
  14. rundir = ".",
  15. tags = ["automanaged"],
  16. deps = ["//vendor/github.com/stretchr/testify/assert:go_default_library"],
  17. )
  18. go_library(
  19. name = "go_default_library",
  20. srcs = [
  21. "cgroup.go",
  22. "cpu.go",
  23. "sysconfig_notcgo.go",
  24. "util.go",
  25. ] + select({
  26. "@io_bazel_rules_go//go/platform:linux": [
  27. "cpu_linux.go",
  28. ],
  29. "@io_bazel_rules_go//go/platform:darwin": [
  30. "cpu_darwin.go",
  31. ],
  32. "//conditions:default": [
  33. "cpu_other.go",
  34. ],
  35. }),
  36. importpath = "go-common/library/stat/sys/cpu",
  37. tags = ["manual"],
  38. visibility = ["//visibility:public"],
  39. deps = [
  40. "//library/log:go_default_library",
  41. "//vendor/github.com/pkg/errors:go_default_library",
  42. ],
  43. )
  44. filegroup(
  45. name = "package-srcs",
  46. srcs = glob(["**"]),
  47. tags = ["automanaged"],
  48. visibility = ["//visibility:private"],
  49. )
  50. filegroup(
  51. name = "all-srcs",
  52. srcs = [":package-srcs"],
  53. tags = ["automanaged"],
  54. visibility = ["//visibility:public"],
  55. )