Skip to content

Commit

Permalink
Sync Maven rules with latest bazel-distribution (#96)
Browse files Browse the repository at this point in the history
  • Loading branch information
vmax authored Sep 23, 2019
1 parent 64517da commit f50e7a6
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
2 changes: 1 addition & 1 deletion dependencies/graknlabs/dependencies.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@ def graknlabs_bazel_distribution():
git_repository(
name = "graknlabs_bazel_distribution",
remote = "https://github.com/graknlabs/bazel-distribution",
commit = "d4a7864b90733ee8ab51c32d0657b2d4868d2f70" # sync-marker: do not remove this comment, this is used for sync-dependencies by @graknlabs_bazel_distribution
commit = "0065b1260189551ac3b27528732e8589965b2a26" # sync-marker: do not remove this comment, this is used for sync-dependencies by @graknlabs_bazel_distribution
)
16 changes: 13 additions & 3 deletions distribution/maven/rules.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -238,11 +238,22 @@ def _generate_pom_xml(ctx, maven_coordinates):
else:
version_file = ctx.file.version_file

inputs = [preprocessed_template, version_file]

args = ctx.actions.args()
args.add('--template_file', preprocessed_template.path)
args.add('--version_file', version_file.path)
args.add('--pom_file', pom_file.path)

if ctx.attr.workspace_refs:
inputs.append(ctx.file.workspace_refs)
args.add('--workspace_refs', ctx.file.workspace_refs.path)

# Step 2: fill in {pom_version} from version_file
ctx.actions.run(
inputs = [preprocessed_template, ctx.file.workspace_refs, version_file],
inputs = inputs,
executable = ctx.file._pom_replace_version,
arguments = [preprocessed_template.path, ctx.file.workspace_refs.path, version_file.path, pom_file.path],
arguments = [args],
outputs = [pom_file],
)

Expand Down Expand Up @@ -301,7 +312,6 @@ assemble_maven = rule(
"""
),
"workspace_refs": attr.label(
mandatory = True,
allow_single_file = True,
doc = 'JSON file describing dependencies to other Bazel workspaces'
),
Expand Down

0 comments on commit f50e7a6

Please sign in to comment.