| load("//tools/build/bazel:generate_workspace.bzl", "maven_coordinates") |
| # bazel build $(bazel query 'kind("_bnd rule", //...)') \ |
| # --aspects tools/build/bazel/publish_catalog.bzl%publish_catalog 2>&1 | \ |
| # egrep "DEBUG: .*mvn_jar.bzl" | cut -d\ -f3- |
| def _remote(group_id, artifact_id, version, packaging, classifier): |
| p = group_id.replace(".", "/") + "/" + artifact_id + "/" + version + "/" + artifact_id + "-" + version |
| coords = maven_coordinates(target.label) |
| version = mvn[len(mvn) - 1] |
| packaging = "oar" if target.label.name.endswith("-oar") else "jar" |
| c = artifact_id.split("-") |
| if len(c) > 1 and c[len(c) - 1] in ("javadoc", "sources", "tests", "pom"): |
| classifier = c[len(c) - 1] |
| artifact_id = "-".join(c[:len(c) - 1]) |
| for f in target.files.to_list(): |
| print("%s\t%s" % (f.path, _remote(group_id, artifact_id, version, packaging, classifier))) |
| publish_catalog = aspect( |