Skip to content

Commit

Permalink
handle full coord dict case in artifact() macro
Browse files Browse the repository at this point in the history
  • Loading branch information
dmivankov committed Jan 24, 2022
1 parent 43a482b commit f3eb06a
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions private/rules/artifact.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,14 @@ def maven_artifact(a):
def _escape(string):
return string.replace(".", "_").replace("-", "_").replace(":", "_")

# inverse of parse_maven_coordinate
def _make_artifact_str(artifact_obj):
# TODO: add support for optional type, classifier and version parts in artifact_obj case
return artifact_obj["group"] + ":" + artifact_obj["artifact"]
# produce either simplified g:a or standard g:a:[p:[c:]]v Maven coordinate string
coord = [artifact_obj["group"], artifact_obj["artifact"]]
if "version" in artifact_obj:
if "packaging" in artifact_obj:
coord.extend([artifact_obj["packaging"]])
if "classifier" in artifact_obj:
coord.extend([artifact_obj["classifier"]])
coord.extend([artifact_obj["version"]])
return ":".join(coord)

0 comments on commit f3eb06a

Please sign in to comment.