blob: be9e8577e1dca9de2dc6f5f6d33fe5988a02ce91 [file] [log] [blame]
#!/bin/bash
# ----------------------------------------------------------------------------
# Selectively builds only those projects that contained modified Java files.
# ----------------------------------------------------------------------------
# TODO: figure out a more elegant way of ignoring disconnected projects
projects=$(find $ONOS_ROOT -name '*.java' \
-not -path '.git/*' -and -not -path '*/archetypes/*' -and -not -path '*/foo/*' \
-exec $ONOS_ROOT/tools/dev/bin/onos-build-selective-hook {} \; | \
sort -u | sed "s:$ONOS_ROOT::g" | tr '\n' ',' | \
sed 's:/,:,:g;s:,/:,:g;s:^/::g;s:,$::g')
[ -n "$projects" ] && cd $ONOS_ROOT && mvn --projects $projects ${@:-clean install}