Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,6 @@ kind-up:
kind-down:
kind delete cluster --name pipecd


.PHONY: prepare-release
prepare-release:
./hack/prepare-release.sh $(version)
Expand Down
20 changes: 6 additions & 14 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@ protobuf_deps()
### BuildTools
http_archive(
name = "com_github_bazelbuild_buildtools",
strip_prefix = "buildtools-3.5.0",
url = "https://github.com/bazelbuild/buildtools/archive/3.5.0.zip",
strip_prefix = "buildtools-4.2.3",
url = "https://github.com/bazelbuild/buildtools/archive/4.2.3.zip",
)

load(
Expand All @@ -105,9 +105,9 @@ buildifier_dependencies()
### Docker
http_archive(
name = "io_bazel_rules_docker",
sha256 = "4521794f0fba2e20f3bf15846ab5e01d5332e587e9ce81629c7f96c793bb7036",
strip_prefix = "rules_docker-0.14.4",
urls = ["https://github.com/bazelbuild/rules_docker/releases/download/v0.14.4/rules_docker-v0.14.4.tar.gz"],
sha256 = "4349f2b0b45c860dd2ffe18802e9f79183806af93ce5921fb12cbd6c07ab69a8",
strip_prefix = "rules_docker-0.21.0",
urls = ["https://github.com/bazelbuild/rules_docker/releases/download/v0.21.0/rules_docker-v0.21.0.tar.gz"],
)

load(
Expand All @@ -131,13 +131,6 @@ load(

container_deps()

load(
"@io_bazel_rules_docker//repositories:pip_repositories.bzl",
"pip_deps",
)

pip_deps()

load(
"@io_bazel_rules_docker//container:container.bzl",
"container_pull",
Expand Down Expand Up @@ -206,14 +199,13 @@ node_repositories(

yarn_install(
name = "npm",
frozen_lockfile = False,
package_json = "//pkg/app/web:package.json",
yarn_lock = "//pkg/app/web:yarn.lock",
frozen_lockfile = False,
)

load("@npm//@bazel/labs:package.bzl", "npm_bazel_labs_dependencies")

npm_bazel_labs_dependencies()

# gazelle:repository_macro repositories.bzl%go_repositories

19 changes: 11 additions & 8 deletions bazel/gomock.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,15 @@ def _gomock_source_impl(ctx):
gopath = "$(pwd)/" + ctx.bin_dir.path + "/" + ctx.attr.gopath_dep[GoPath].gopath

# passed in source needs to be in gopath to not trigger module mode
args = ["-source", gopath + "/src/" + ctx.attr.library[GoLibrary].importmap + "/"+ ctx.file.source.basename]
args = ["-source", gopath + "/src/" + ctx.attr.library[GoLibrary].importmap + "/" + ctx.file.source.basename]

args, needed_files = _handle_shared_args(ctx, args)

if len(ctx.attr.aux_files) > 0:
aux_files = []
for pkg, files in ctx.attr.aux_files.items():
for f in files:
mapped_f = gopath + "/src/" + ctx.attr.library[GoLibrary].importmap + "/"+ f
mapped_f = gopath + "/src/" + ctx.attr.library[GoLibrary].importmap + "/" + f
aux_files.append("{0}={1}".format(pkg, mapped_f))
args += ["-aux_files", ",".join(aux_files)]

Expand Down Expand Up @@ -112,7 +112,7 @@ _gomock_source = rule(
doc = "Ignored. If `source` is not set, this would be the list of Go interfaces to generate mocks for.",
mandatory = True,
),
"aux_files": attr.string_list_dict(
"aux_files": attr.string_list_dict(
default = {},
doc = "A map from packages to auxilliary Go source files to load for those packages.",
),
Expand Down Expand Up @@ -170,14 +170,16 @@ def gomock(name, library, out, **kwargs):
library = library,
gopath_dep = gopath_name,
out = out,
**kwargs)
**kwargs
)
else:
_gomock_reflect(
name = name,
library = library,
out = out,
mockgen_tool = mockgen_tool,
**kwargs)
**kwargs
)

def _gomock_reflect(name, library, out, mockgen_tool, **kwargs):
interfaces = kwargs.pop("interfaces", None)
Expand Down Expand Up @@ -208,7 +210,8 @@ def _gomock_reflect(name, library, out, mockgen_tool, **kwargs):
out = out,
prog_bin = prog_bin,
mockgen_tool = mockgen_tool,
**kwargs)
**kwargs
)

def _gomock_prog_gen_impl(ctx):
args = ["-prog_only"]
Expand All @@ -227,7 +230,7 @@ def _gomock_prog_gen_impl(ctx):
args = " ".join(args),
out = out.path,
),
mnemonic = "GoMockReflectProgOnlyGen"
mnemonic = "GoMockReflectProgOnlyGen",
)

_gomock_prog_gen = rule(
Expand Down Expand Up @@ -336,7 +339,7 @@ _gomock_prog_exec = rule(
executable = True,
cfg = "exec",
mandatory = False,
),
),
"_go_context_data": attr.label(
default = "@io_bazel_rules_go//:go_context_data",
),
Expand Down