maven/internal/maven_repository.bzl
def _format_maven_repository(rtx, configs, all_artifacts):
    """Format a maven_repository rule, for copy-paste back into the WORKSPACE.
    Args:
      rtx: !repository_ctx
      configs: !dict<string,!dict<string,!Artifact>>
      all_artifacts: !dict<string,!Artifact>
    Returns: !list<string>
    """
    ws_names = sorted(all_artifacts.keys())

    lines = []
    lines.append("maven_repository(")

    lines.append("    name = '%s'," % rtx.name)

    if rtx.attr.exclude:
        lines.append("    exclude = {")
        for k, v in rtx.attr.exclude.items():
            lines.append("        '%s': [" % k)
            for item in v:
                lines.append("            '%s'," % item)
            lines.append("        ],")
        lines.append("    },")

    if rtx.attr.force:
        lines.append("    force = [")
        for item in rtx.attr.force:
            lines.append("        '%s'," % item)
        lines.append("    ],")

    if rtx.attr.omit:
        lines.append("    omit = [")
        for item in rtx.attr.omit:
            lines.append("        '%s'," % item)
        lines.append("    ],")

    lines.append("    transitive_deps = [")
    for ws_name in ws_names:
        artifact = all_artifacts[ws_name]
        if should_omit(rtx.attr.omit, artifact):
            lines.append("        'omit:%s'," % (artifact["coordinate"]))
        else:
            lines.append("        '%s:%s'," % (artifact["sha1"], artifact["coordinate"]))
    lines.append("    ],")

    lines.append("    deps = [")
    for coord in rtx.attr.deps:
        lines.append("        '%s'," % coord)
    lines.append("    ],")

    if rtx.attr.experimental_disambiguate_maven_jar_workspace_names:
        lines.append("    experimental_disambiguate_maven_jar_workspace_names = True,")

    lines.append(")")
    return lines
Format a maven_repository rule, for copy-paste back into the WORKSPACE.
    Args:
      rtx: !repository_ctx
      configs: !dict<string,!dict<string,!Artifact>>
      all_artifacts: !dict<string,!Artifact>
    Returns: !list<string>
    
Format a maven_repository rule, for copy-paste back into the WORKSPACE.
Format a maven_repository rule for copy - paste back into the WORKSPACE .
def _format_maven_repository(rtx, configs, all_artifacts):
    ws_names = sorted(all_artifacts.keys())
    lines = []
    lines.append("maven_repository(")
    lines.append("    name = '%s'," % rtx.name)
    if rtx.attr.exclude:
        lines.append("    exclude = {")
        for k, v in rtx.attr.exclude.items():
            lines.append("        '%s': [" % k)
            for item in v:
                lines.append("            '%s'," % item)
            lines.append("        ],")
        lines.append("    },")
    if rtx.attr.force:
        lines.append("    force = [")
        for item in rtx.attr.force:
            lines.append("        '%s'," % item)
        lines.append("    ],")
    if rtx.attr.omit:
        lines.append("    omit = [")
        for item in rtx.attr.omit:
            lines.append("        '%s'," % item)
        lines.append("    ],")
    lines.append("    transitive_deps = [")
    for ws_name in ws_names:
        artifact = all_artifacts[ws_name]
        if should_omit(rtx.attr.omit, artifact):
            lines.append("        'omit:%s'," % (artifact["coordinate"]))
        else:
            lines.append("        '%s:%s'," % (artifact["sha1"], artifact["coordinate"]))
    lines.append("    ],")
    lines.append("    deps = [")
    for coord in rtx.attr.deps:
        lines.append("        '%s'," % coord)
    lines.append("    ],")
    if rtx.attr.experimental_disambiguate_maven_jar_workspace_names:
        lines.append("    experimental_disambiguate_maven_jar_workspace_names = True,")
    lines.append(")")
    return lines
def _format_maven_repository ( rtx , configs , all_artifacts ) : ws_names = sorted ( all_artifacts . keys ( ) ) lines = [ ] lines . append ( "maven_repository(" ) lines . append ( "    name = '%s'," % rtx . name ) if rtx . attr . exclude : lines . append ( "    exclude = {" ) for k , v in rtx . attr . exclude . items ( ) : lines . append ( "        '%s': [" % k ) for item in v : lines . append ( "            '%s'," % item ) lines . append ( "        ]," ) lines . append ( "    }," ) if rtx . attr . force : lines . append ( "    force = [" ) for item in rtx . attr . force : lines . append ( "        '%s'," % item ) lines . append ( "    ]," ) if rtx . attr . omit : lines . append ( "    omit = [" ) for item in rtx . attr . omit : lines . append ( "        '%s'," % item ) lines . append ( "    ]," ) lines . append ( "    transitive_deps = [" ) for ws_name in ws_names : artifact = all_artifacts [ ws_name ] if should_omit ( rtx . attr . omit , artifact ) : lines . append ( "        'omit:%s'," % ( artifact [ "coordinate" ] ) ) else : lines . append ( "        '%s:%s'," % ( artifact [ "sha1" ] , artifact [ "coordinate" ] ) ) lines . append ( "    ]," ) lines . append ( "    deps = [" ) for coord in rtx . attr . deps : lines . append ( "        '%s'," % coord ) lines . append ( "    ]," ) if rtx . attr . experimental_disambiguate_maven_jar_workspace_names : lines . append ( "    experimental_disambiguate_maven_jar_workspace_names = True," ) lines . append ( ")" ) return lines
Format a maven_repository rule, for copy-paste back into the WORKSPACE.
Format a maven_repository rule for copy - paste back into the WORKSPACE .
"""Format a maven_repository rule, for copy-paste back into the WORKSPACE.
    Args:
      rtx: !repository_ctx
      configs: !dict<string,!dict<string,!Artifact>>
      all_artifacts: !dict<string,!Artifact>
    Returns: !list<string>
    """
rtx
None
configs
None
all_artifacts
None