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