xref: /aosp_15_r20/external/bazelbuild-rules_android/src/common/golang/BUILD (revision 9e965d6fece27a77de5377433c2f7e6999b8cc0b)
1load("@io_bazel_rules_go//proto:def.bzl", "go_proto_library")
2load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library", "go_test")
3
4# Description:
5#   Common libraries and utilities.
6package(
7    default_applicable_licenses = ["//:license"],
8    default_visibility = ["//visibility:public"],
9)
10
11licenses(["notice"])
12
13go_library(
14    name = "xml2",
15    srcs = ["marshal.go"],
16    importpath = "src/common/golang/xml2",
17)
18
19go_test(
20    name = "xml2_test",
21    size = "small",
22    srcs = [
23        "marshal_test.go",
24    ],
25    embed = [":xml2"],
26)
27
28go_library(
29    name = "shard",
30    srcs = ["shard.go"],
31    importpath = "src/common/golang/shard",
32)
33
34go_test(
35    name = "shard_test",
36    size = "small",
37    srcs = [
38        "shard_test.go",
39        "zipshard_test.go",
40    ],
41    embed = [":shard"],
42)
43
44go_library(
45    name = "walk",
46    srcs = ["walk.go"],
47    importpath = "src/common/golang/walk",
48)
49
50go_library(
51    name = "ziputils",
52    srcs = ["ziputils.go"],
53    importpath = "src/common/golang/ziputils",
54    deps = ["@org_golang_x_sync//errgroup"],
55)
56
57go_library(
58    name = "fileutils",
59    srcs = ["fileutils.go"],
60    importpath = "src/common/golang/fileutils",
61)
62
63go_library(
64    name = "flags",
65    srcs = ["flags.go"],
66    importpath = "src/common/golang/flags",
67)
68
69go_test(
70    name = "flagfile_test",
71    size = "small",
72    srcs = ["flagfile_test.go"],
73    embed = [":flagfile"],
74)
75
76go_library(
77    name = "ini",
78    srcs = ["ini.go"],
79    importpath = "src/common/golang/ini",
80)
81
82go_test(
83    name = "ini_test",
84    size = "small",
85    srcs = ["ini_test.go"],
86    embed = [":ini"],
87)
88
89go_library(
90    name = "pprint",
91    srcs = ["pprint.go"],
92    importpath = "src/common/golang/pprint",
93)
94
95go_library(
96    name = "flagfile",
97    srcs = ["flagfile.go"],
98    importpath = "src/common/golang/flagfile",
99)
100
101genrule(
102    name = "a_txt",
103    outs = ["a.txt"],
104    cmd = "echo hello world > $@",
105)
106
107go_library(
108    name = "runfilelocation",
109    srcs = ["runfilelocation.go"],
110    importpath = "src/common/golang/runfilelocation",
111    deps = ["@io_bazel_rules_go//go/runfiles"],
112)
113
114go_test(
115    name = "runfilelocation_test",
116    srcs = ["runfilelocation_test.go"],
117    data = [":a_txt"],
118    embed = [":runfilelocation"],
119)
120