blob: d908621f2453325b9a25beeabeb84cd9771895ab [file] [log] [blame]
Thomas Vachuska2988e142018-07-23 16:20:01 -07001#!/bin/bash
2# -----------------------------------------------------------------------------
3# Generates a catalog for publishing ONOS artifacts to a Maven repository.
4# -----------------------------------------------------------------------------
5
6CATALOG=/tmp/onos.catalog
7
8rm -f $CATALOG
9
10SHLVL=1 # Required not to have Bazel rebuild everything!
11
12function writeCatalog {
13 bazel build $* --aspects tools/build/bazel/publish_catalog.bzl%publish_catalog 2>&1 \
14 | egrep "^DEBUG: " | cut -d\ -f3- >> $CATALOG
15}
16
17function jars {
18 egrep -v '(\# |grpc/api|build/conf)' tools/build/publish-target-list
19}
20
21function testJars {
22 egrep -v '(# |grpc/api|build/conf)' tools/build/publish-test-target-list
23}
24
25
26echo "Cataloging jar files..."
27writeCatalog $(jars)
28
29echo "Cataloging test jars..."
30writeCatalog $(testJars)
31
32echo "Cataloging source jars..."
33writeCatalog $(jars | sed 's/$/-sources/')
34echo "Cataloging javadoc jars..."
35writeCatalog $(jars | sed 's/$/-javadoc/')
36echo "Cataloging pom files..."
37writeCatalog $(jars | sed 's/$/-pom/')
38
39echo "Cataloging oar files..."
40writeCatalog $(bazel query 'kind("_onos_oar rule", //...)')