Thomas Vachuska | 8c9ee81 | 2015-11-24 17:29:37 -0800 | [diff] [blame^] | 1 | #!/bin/bash |
| 2 | # ----------------------------------------------------------------------------- |
| 3 | # Assembles together all bundles required to run ONOS off-line. |
| 4 | # ----------------------------------------------------------------------------- |
| 5 | |
| 6 | mkdir -p target |
| 7 | |
| 8 | features=target/features-list.xml |
| 9 | repos=target/staged-repos.xml |
| 10 | |
| 11 | echo "<features>" > $repos |
| 12 | echo " <repository>mvn:org.onosproject/onos-features/1.4.0-SNAPSHOT/xml/features</repository>" >> $repos |
| 13 | |
| 14 | # Find all app feature files |
| 15 | find $ONOS_ROOT -name '*-features.xml' | grep -v features-repo > $features |
| 16 | |
| 17 | # Produce repository entry for each file |
| 18 | cat $features | while read feature; do |
| 19 | echo " <repository>file:$feature</repository>" >> $repos |
| 20 | done |
| 21 | |
| 22 | # Create a synthetic feature that depends on all other ONOS features |
| 23 | echo " <feature name=\"foo\">" >> $repos |
| 24 | grep "feature name=" $ONOS_ROOT/features/features.xml | cut -d\" -f2 | while read f; do |
| 25 | echo " <feature>$f</feature>" >> $repos |
| 26 | done |
| 27 | |
| 28 | cat $features | while read feature; do |
| 29 | grep "feature name=" $feature | cut -d\" -f2 | while read f; do |
| 30 | echo " <feature>$f</feature>" >> $repos |
| 31 | done |
| 32 | done |
| 33 | echo " </feature>" >> $repos |
| 34 | |
| 35 | echo "</features>" >> $repos |