maven/internal/maven_repository.bzl
def _parse_gradle_dependencies(rtx, transitive_artifacts, configurations, out, disambiguate):
    """Parse the output of 'gradle dependencies'
    Args:
      rtx: !repository_ctx
      transitive_artifacts: !dict<string,!dict<string,string>>
      configurations: !list<string> - the list of acceptable configuration names.
      out: string (to be processed as a list of lines)

    Returns: !dict<string,!dict<string,string>> - a dict, keyed by
    config name, value is a set of artifacts for that configuration.
    """
    configs = {} # return value
    section = None # current section name

    lines = out.splitlines()
    for line in lines:
        #print("LINE: " + line)
        # Look for lines like 'testCompile - Dependencies for...'
        parts = line.partition(" - ")
        # If we match a known config name, start a new section.
        if parts[0] in configurations:
            section = parts[0]
            configs[section] = {}
        else:
            # Bail now if gradle not able to fetch the dependency.
            if line.endswith("FAILED"):
                fail("Unable to fetch dependency: " + line)
            # Look for lines like ' | +--- org.ow2.asm:asm:5.0.1'.
            # (the triple-dash-space appears constant).
            parts = line.partition("--- ")
            # artifact set must be defined, and the line must start with a artifact marker.
            # +--- org.eclipse.jetty.websocket:websocket-servlet:9.3.10.v20160621
            # |    \--- org.eclipse.jetty:jetty-util:9.3.10.v20160621
            if parts[0].endswith("+") or parts[0].endswith("\\"):
                artifact = parts[2]
                # This means the subtree is repeated, so no need to store it again.
                # +--- org.eclipse.jetty:jetty-jndi:9.3.10.v20160621 (*)
                if not artifact.endswith(" (*)"):
                    # If the artifact is not a root, it does not need
                    # to be listed in the deps attribute.

                    if len(parts[0]) > 1 and artifact in rtx.attr.deps:
                        fail("%r is a transitive dependency and does not need to be explicitly declared in deps" % (artifact), "deps")

                    artifact = _create_artifact_from_coordinate(artifact, disambiguate)
                    ws_name = artifact["ws_name"]
                    # Do we have a listing for this one in the transitive set?
                    transitive_artifact = transitive_artifacts.get(ws_name)
                    # If there is no current listing, store it.
                    if not transitive_artifact:
                        transitive_artifact = artifact
                        transitive_artifacts[ws_name] = artifact
                        # Mark this as new to trigger printing if the
                        # final maven_dependency rule
                        transitive_artifact["new"] = True
                    if not transitive_artifact.get("omit"):
                        if not transitive_artifact.get("sha1"):
                            transitive_artifact["sha1"] = _get_artifact_sha1(rtx,
                                                                             transitive_artifact)
                        config = configs[section]
                        config[ws_name] = transitive_artifact
                    # Mark this as seen to be able detect extraneous elements in the transitive_deps attribute.
                    transitive_artifact["seen"] = True

                #else: print("skipping line: " + line)
            #else: print("skipping line parts = %r" % (parts))

    #print("configs: %r" % configs)
    return configs
Parse the output of 'gradle dependencies'
    Args:
      rtx: !repository_ctx
      transitive_artifacts: !dict<string,!dict<string,string>>
      configurations: !list<string> - the list of acceptable configuration names.
      out: string (to be processed as a list of lines)

    Returns: !dict<string,!dict<string,string>> - a dict, keyed by
    config name, value is a set of artifacts for that configuration.
    
Parse the output of 'gradle dependencies'
Parse the output of ' gradle dependencies '
def _parse_gradle_dependencies(rtx, transitive_artifacts, configurations, out, disambiguate):
    configs = {} 
    section = None 
    lines = out.splitlines()
    for line in lines:
        parts = line.partition(" - ")
        if parts[0] in configurations:
            section = parts[0]
            configs[section] = {}
        else:
            if line.endswith("FAILED"):
                fail("Unable to fetch dependency: " + line)
            parts = line.partition("--- ")
            if parts[0].endswith("+") or parts[0].endswith("\\"):
                artifact = parts[2]
                if not artifact.endswith(" (*)"):
                    if len(parts[0]) > 1 and artifact in rtx.attr.deps:
                        fail("%r is a transitive dependency and does not need to be explicitly declared in deps" % (artifact), "deps")
                    artifact = _create_artifact_from_coordinate(artifact, disambiguate)
                    ws_name = artifact["ws_name"]
                    transitive_artifact = transitive_artifacts.get(ws_name)
                    if not transitive_artifact:
                        transitive_artifact = artifact
                        transitive_artifacts[ws_name] = artifact
                        transitive_artifact["new"] = True
                    if not transitive_artifact.get("omit"):
                        if not transitive_artifact.get("sha1"):
                            transitive_artifact["sha1"] = _get_artifact_sha1(rtx,
                                                                             transitive_artifact)
                        config = configs[section]
                        config[ws_name] = transitive_artifact
                    transitive_artifact["seen"] = True
    return configs
def _parse_gradle_dependencies ( rtx , transitive_artifacts , configurations , out , disambiguate ) : configs = { } section = None lines = out . splitlines ( ) for line in lines : parts = line . partition ( " - " ) if parts [ 0 ] in configurations : section = parts [ 0 ] configs [ section ] = { } else : if line . endswith ( "FAILED" ) : fail ( "Unable to fetch dependency: " + line ) parts = line . partition ( "--- " ) if parts [ 0 ] . endswith ( "+" ) or parts [ 0 ] . endswith ( "\\" ) : artifact = parts [ 2 ] if not artifact . endswith ( " (*)" ) : if len ( parts [ 0 ] ) > 1 and artifact in rtx . attr . deps : fail ( "%r is a transitive dependency and does not need to be explicitly declared in deps" % ( artifact ) , "deps" ) artifact = _create_artifact_from_coordinate ( artifact , disambiguate ) ws_name = artifact [ "ws_name" ] transitive_artifact = transitive_artifacts . get ( ws_name ) if not transitive_artifact : transitive_artifact = artifact transitive_artifacts [ ws_name ] = artifact transitive_artifact [ "new" ] = True if not transitive_artifact . get ( "omit" ) : if not transitive_artifact . get ( "sha1" ) : transitive_artifact [ "sha1" ] = _get_artifact_sha1 ( rtx , transitive_artifact ) config = configs [ section ] config [ ws_name ] = transitive_artifact transitive_artifact [ "seen" ] = True return configs
Parse the output of 'gradle dependencies'
Parse the output of ' gradle dependencies '
"""Parse the output of 'gradle dependencies'
    Args:
      rtx: !repository_ctx
      transitive_artifacts: !dict<string,!dict<string,string>>
      configurations: !list<string> - the list of acceptable configuration names.
      out: string (to be processed as a list of lines)

    Returns: !dict<string,!dict<string,string>> - a dict, keyed by
    config name, value is a set of artifacts for that configuration.
    """ # return value # current section name #print("LINE: " + line) # Look for lines like 'testCompile - Dependencies for...' # If we match a known config name, start a new section. # Bail now if gradle not able to fetch the dependency. # Look for lines like ' | +--- org.ow2.asm:asm:5.0.1'. # (the triple-dash-space appears constant). # artifact set must be defined, and the line must start with a artifact marker. # +--- org.eclipse.jetty.websocket:websocket-servlet:9.3.10.v20160621 # |    \--- org.eclipse.jetty:jetty-util:9.3.10.v20160621 # This means the subtree is repeated, so no need to store it again. # +--- org.eclipse.jetty:jetty-jndi:9.3.10.v20160621 (*) # If the artifact is not a root, it does not need # to be listed in the deps attribute. # Do we have a listing for this one in the transitive set? # If there is no current listing, store it. # Mark this as new to trigger printing if the # final maven_dependency rule # Mark this as seen to be able detect extraneous elements in the transitive_deps attribute. #else: print("skipping line: " + line) #else: print("skipping line parts = %r" % (parts)) #print("configs: %r" % configs)
rtx
None
transitive_artifacts
None
configurations
list - the list of acceptable configuration names.
list - the list of acceptable configuration names .
out
string (to be processed as a list of lines)
string ( to be processed as a list of lines )
disambiguate