blob: 410e022a3eadf7a1f9323fcf6a35ba2afd470abb [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
Ray Milkey7f46b1f2018-07-24 19:01:58 -07006set -e -o pipefail
7
Thomas Vachuska22a662b2018-07-24 11:25:19 -07008CATALOG=${1:-/tmp/onos.catalog}
Thomas Vachuska2988e142018-07-23 16:20:01 -07009
10rm -f $CATALOG
11
12SHLVL=1 # Required not to have Bazel rebuild everything!
13
14function writeCatalog {
15 bazel build $* --aspects tools/build/bazel/publish_catalog.bzl%publish_catalog 2>&1 \
16 | egrep "^DEBUG: " | cut -d\ -f3- >> $CATALOG
17}
18
19function jars {
20 egrep -v '(\# |grpc/api|build/conf)' tools/build/publish-target-list
21}
22
23function testJars {
24 egrep -v '(# |grpc/api|build/conf)' tools/build/publish-test-target-list
25}
26
27
28echo "Cataloging jar files..."
29writeCatalog $(jars)
30
31echo "Cataloging test jars..."
32writeCatalog $(testJars)
33
34echo "Cataloging source jars..."
35writeCatalog $(jars | sed 's/$/-sources/')
36echo "Cataloging javadoc jars..."
37writeCatalog $(jars | sed 's/$/-javadoc/')
38echo "Cataloging pom files..."
39writeCatalog $(jars | sed 's/$/-pom/')
40
41echo "Cataloging oar files..."
42writeCatalog $(bazel query 'kind("_onos_oar rule", //...)')