Skip to content

Commit

Permalink
bazel: apply buildifier
Browse files Browse the repository at this point in the history
  • Loading branch information
manuelnaranjo committed Mar 12, 2024
1 parent 66508ea commit 649c403
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
1 change: 0 additions & 1 deletion MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ bazel_dep(name = "aspect_bazel_lib", version = "1.32.1", dev_dependency = True)
bazel_dep(name = "buildifier_prebuilt", version = "6.1.2", dev_dependency = True)

bazel_dep(name = "contrib_rules_jvm", version = "0.24.0")

bazel_dep(name = "rules_java", version = "7.4.0")
bazel_dep(name = "rules_jvm_external", version = "6.0")

Expand Down
16 changes: 7 additions & 9 deletions pitest/private/rules.bzl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
load("@rules_java//java:defs.bzl", "java_test", "java_common")
load("@rules_java//java:defs.bzl", "java_common", "java_test")

# Common package prefixes, in the order we want to check for them
_PREFIXES = (".com.", ".org.", ".net.", ".io.", ".ai.", ".co.", ".me.")
Expand Down Expand Up @@ -39,7 +39,7 @@ def _extract_jar_impl(ctx):
)

for x in ctx.files.target:
cmd = "{cmd}$CWD/{jar_path} -xf $CWD/{file};\n".format(cmd = cmd, jar_path = jar_path, file=x.path)
cmd = "{cmd}$CWD/{jar_path} -xf $CWD/{file};\n".format(cmd = cmd, jar_path = jar_path, file = x.path)

cmd = "%srm -rf META-INF;\n" % cmd

Expand All @@ -51,12 +51,12 @@ def _extract_jar_impl(ctx):
use_default_shell_env = True,
)

return DefaultInfo(files=depset([out]))
return DefaultInfo(files = depset([out]))

_extract_jar = rule(
implementation = _extract_jar_impl,
attrs = {
"target": attr.label_list(allow_files=True),
"target": attr.label_list(allow_files = True),
"_jdk": attr.label(
default = "@rules_java//toolchains:current_host_java_runtime",
providers = [java_common.JavaRuntimeInfo],
Expand Down Expand Up @@ -98,13 +98,11 @@ def java_pitest_test(
else:
clazz = _get_package_name(package_prefixes) + name



src_dirs = [native.package_name()] + src_dirs

_extract_jar(
name = "%s-classes" % name,
target = [ library_target ]
target = [library_target],
)

_extract_jar(
Expand All @@ -113,7 +111,6 @@ def java_pitest_test(
testonly = True,
)


args = list(args)
args += [
"--reportDir",
Expand Down Expand Up @@ -141,7 +138,8 @@ def java_pitest_test(
],
args = args,
jvm_flags = [
"-cp", "$$CLASSPATH:$(location :%s-classes):$(location :%s-test-classes)" % (name, name)
"-cp",
"$$CLASSPATH:$(location :%s-classes):$(location :%s-test-classes)" % (name, name),
],
**kwargs
)

0 comments on commit 649c403

Please sign in to comment.