mirror of
https://github.com/google/sandboxed-api.git
synced 2024-03-22 13:11:30 +08:00
IWYU in sapi code generator
PiperOrigin-RevId: 350134692 Change-Id: I5389df8a02f6679a3881b20b599ff5d9fc81650e
This commit is contained in:
parent
142c35898c
commit
fe79c95a50
|
@ -31,6 +31,7 @@ def get_embed_dir():
|
|||
return native.package_name()
|
||||
|
||||
def sort_deps(deps):
|
||||
deps = depset(deps).to_list()
|
||||
colon_deps = [x for x in deps if x.startswith(":")]
|
||||
other_deps = [x for x in deps if not x.startswith(":")]
|
||||
return sorted(colon_deps) + sorted(other_deps)
|
||||
|
@ -192,7 +193,10 @@ def sapi_library(
|
|||
data = [":" + name + ".bin"],
|
||||
deps = sort_deps(
|
||||
[
|
||||
"@com_google_absl//absl/status",
|
||||
"@com_google_absl//absl/status:statusor",
|
||||
rprefix + "//sandboxed_api:sapi",
|
||||
rprefix + "//sandboxed_api/util:status",
|
||||
rprefix + "//sandboxed_api:vars",
|
||||
] + deps +
|
||||
([":" + name + "_embed"] if embed else []) +
|
||||
|
|
|
@ -12,11 +12,11 @@
|
|||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
licenses(["notice"])
|
||||
|
||||
load("//sandboxed_api/bazel:build_defs.bzl", "sapi_platform_copts")
|
||||
load("//sandboxed_api/bazel:sapi.bzl", "sapi_library")
|
||||
|
||||
licenses(["notice"])
|
||||
|
||||
py_library(
|
||||
name = "code",
|
||||
srcs = ["code.py"],
|
||||
|
@ -81,6 +81,9 @@ cc_binary(
|
|||
"//sandboxed_api:sapi",
|
||||
"//sandboxed_api:vars",
|
||||
"//sandboxed_api/sandbox2",
|
||||
"//sandboxed_api/util:status",
|
||||
"@com_google_absl//absl/status",
|
||||
"@com_google_absl//absl/status:statusor",
|
||||
],
|
||||
)
|
||||
|
||||
|
|
|
@ -906,7 +906,10 @@ class Generator(object):
|
|||
result.append(Generator.GUARD_START.format(header_guard))
|
||||
|
||||
# Copybara transform results in the paths below.
|
||||
result.append('#include "absl/status/status.h"')
|
||||
result.append('#include "absl/status/statusor.h"')
|
||||
result.append('#include "sandboxed_api/sandbox.h"')
|
||||
result.append('#include "sandboxed_api/util/status_macros.h"')
|
||||
result.append('#include "sandboxed_api/vars.h"')
|
||||
|
||||
if embed_name:
|
||||
|
|
|
@ -18,7 +18,10 @@
|
|||
CODE_GOLD = """// AUTO-GENERATED by the Sandboxed API generator.
|
||||
// Edits will be discarded when regenerating this file.
|
||||
|
||||
#include "absl/status/status.h"
|
||||
#include "absl/status/statusor.h"
|
||||
#include "sandboxed_api/sandbox.h"
|
||||
#include "sandboxed_api/util/status_macros.h"
|
||||
#include "sandboxed_api/vars.h"
|
||||
|
||||
namespace sapi {
|
||||
|
@ -119,7 +122,10 @@ class TestApi {
|
|||
CODE_GOLD_MAPPED = """// AUTO-GENERATED by the Sandboxed API generator.
|
||||
// Edits will be discarded when regenerating this file.
|
||||
|
||||
#include "absl/status/status.h"
|
||||
#include "absl/status/statusor.h"
|
||||
#include "sandboxed_api/sandbox.h"
|
||||
#include "sandboxed_api/util/status_macros.h"
|
||||
#include "sandboxed_api/vars.h"
|
||||
|
||||
namespace sapi {
|
||||
|
@ -154,7 +160,10 @@ class TestApi {
|
|||
CODE_ENUM_GOLD = """// AUTO-GENERATED by the Sandboxed API generator.
|
||||
// Edits will be discarded when regenerating this file.
|
||||
|
||||
#include "absl/status/status.h"
|
||||
#include "absl/status/statusor.h"
|
||||
#include "sandboxed_api/sandbox.h"
|
||||
#include "sandboxed_api/util/status_macros.h"
|
||||
#include "sandboxed_api/vars.h"
|
||||
|
||||
namespace sapi {
|
||||
|
|
Loading…
Reference in New Issue
Block a user