buildifier

main
Motiejus Jakštys 2021-05-24 00:11:58 +03:00
parent c71b70a32a
commit 424b115841
2 changed files with 7 additions and 10 deletions

11
BUILD
View File

@ -1,10 +1,7 @@
load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library") load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")
load("@bazel_tools//tools/build_defs/pkg:pkg.bzl", "pkg_tar") load("@bazel_tools//tools/build_defs/pkg:pkg.bzl", "pkg_tar")
load("//src/undocker:rules.bzl", "rootfs", "temp") load("//src/undocker:rules.bzl", "rootfs", "temp")
load( load("@io_bazel_rules_docker//container:container.bzl", "container_bundle")
"@io_bazel_rules_docker//container:container.bzl",
"container_bundle",
)
go_library( go_library(
name = "go_default_library", name = "go_default_library",
@ -26,7 +23,7 @@ go_binary(
genrule( genrule(
name = "alpine-rootfs", name = "alpine-rootfs",
srcs = ["@alpine//image:image"], srcs = ["@alpine//image"],
outs = ["alpine-rootfs.tar"], outs = ["alpine-rootfs.tar"],
cmd = "$(location :undocker) rootfs $< $@", cmd = "$(location :undocker) rootfs $< $@",
tools = [":undocker"], tools = [":undocker"],
@ -35,7 +32,7 @@ genrule(
# later debugging # later debugging
pkg_tar( pkg_tar(
name = "alpine-container-plus", name = "alpine-container-plus",
deps = ["@alpine//image:image"], deps = ["@alpine//image"],
) )
rootfs( rootfs(
@ -52,6 +49,6 @@ filegroup(
temp( temp(
name = "temp", name = "temp",
data = ":maingo",
out = "maingo.txt", out = "maingo.txt",
data = ":maingo",
) )

View File

@ -11,8 +11,8 @@ def _rootfs_impl(ctx):
], ],
) )
return [DefaultInfo( return [DefaultInfo(
files = depset([out]), files = depset([out]),
runfiles = ctx.runfiles(files = ctx.files.src), runfiles = ctx.runfiles(files = ctx.files.src),
)] )]
rootfs = rule( rootfs = rule(
@ -46,6 +46,6 @@ temp = rule(
implementation = _temp_impl, implementation = _temp_impl,
attrs = { attrs = {
"data": attr.label(mandatory = True, allow_single_file = True), "data": attr.label(mandatory = True, allow_single_file = True),
"out": attr.output(mandatory = True) "out": attr.output(mandatory = True),
}, },
) )