Skip to content

Commit

Permalink
expand the maven coordinates template from variables
Browse files Browse the repository at this point in the history
  • Loading branch information
knarukulla committed Jan 4, 2023
1 parent 9367856 commit a33194a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 3 additions & 1 deletion private/rules/maven_bom_fragment.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,11 @@ MavenBomFragmentInfo = provider(
)

def _maven_bom_fragment_impl(ctx):
# Expand maven coordinates for any variables to be replaced.
coordinates = ctx.attr.maven_coordinates.format(**ctx.var)
return [
MavenBomFragmentInfo(
coordinates = ctx.attr.maven_coordinates,
coordinates = coordinates,
artifact = ctx.file.artifact,
srcs = ctx.file.src_artifact,
javadocs = ctx.file.javadoc_artifact,
Expand Down
3 changes: 2 additions & 1 deletion private/rules/pom_file.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@ def _pom_file_impl(ctx):

info = ctx.attr.target[MavenInfo]

coordinates = info.coordinates.format(**ctx.var)
out = generate_pom(
ctx,
coordinates = info.coordinates,
coordinates = coordinates,
versioned_dep_coordinates = sorted(info.maven_deps.to_list()),
pom_template = ctx.file.pom_template,
out_name = "%s.xml" % ctx.label.name,
Expand Down

0 comments on commit a33194a

Please sign in to comment.