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