Skip to content

Commit

Permalink
Expose read_coordinates via defs.bzl (#519)
Browse files Browse the repository at this point in the history
  • Loading branch information
shs96c committed Nov 23, 2021
1 parent ac5aed3 commit eec0af5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion defs.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,11 @@
load(":coursier.bzl", "coursier_fetch", "pinned_coursier_fetch", "DEFAULT_AAR_IMPORT_LABEL")
load(":specs.bzl", "json", "parse")
load("//:private/dependency_tree_parser.bzl", "JETIFY_INCLUDE_LIST_JETIFY_ALL")
load("//private/rules:has_maven_deps.bzl", _read_coordinates = "read_coordinates")
load("//private/rules:java_export.bzl", _java_export = "java_export")
load("//private/rules:javadoc.bzl", _javadoc = "javadoc")
load("//private/rules:pom_file.bzl", _pom_file = "pom_file")
load("//private/rules:maven_publish.bzl", _MavenPublishInfo = "MavenPublishInfo")
load("//private/rules:pom_file.bzl", _pom_file = "pom_file")

DEFAULT_REPOSITORY_NAME = "maven"

Expand Down Expand Up @@ -182,4 +183,5 @@ def _parse_artifact_str(artifact_str):
java_export = _java_export
javadoc = _javadoc
pom_file = _pom_file
read_coordinates = _read_coordinates
MavenPublishInfo = _MavenPublishInfo
4 changes: 2 additions & 2 deletions private/rules/has_maven_deps.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ _EMPTY_INFO = MavenInfo(
_MAVEN_PREFIX = "maven_coordinates="
_STOP_TAGS = ["maven:compile-only", "no-maven"]

def _read_coordinates(tags):
def read_coordinates(tags):
coordinates = []
for stop_tag in _STOP_TAGS:
if stop_tag in tags:
Expand Down Expand Up @@ -120,7 +120,7 @@ def _has_maven_deps_impl(target, ctx):
if tag in _STOP_TAGS:
return _EMPTY_INFO

coordinates = _read_coordinates(ctx.rule.attr.tags)
coordinates = read_coordinates(ctx.rule.attr.tags)
label_to_javainfo = {target.label: target[JavaInfo]}

gathered = _gathered(
Expand Down

0 comments on commit eec0af5

Please sign in to comment.