blob: 0becd32d11f1217f00f48291fdf163713c63221e [file] [log] [blame]
tom1cd74ae2014-10-01 14:58:32 -07001#!/bin/bash
Pavlin Radoslavov91413792014-10-15 11:00:32 -07002# ----------------------------------------------------------------------------
tom1cd74ae2014-10-01 14:58:32 -07003# Selectively builds only those projects that contained modified Java files.
Pavlin Radoslavov91413792014-10-15 11:00:32 -07004# ----------------------------------------------------------------------------
tom1cd74ae2014-10-01 14:58:32 -07005
6projects=$(find $ONOS_ROOT -name '*.java' \
Thomas Vachuskafc7f22d2014-12-04 11:07:01 -08007 -not -path '*/openflowj/*' -and -not -path '.git/*' -and -not -path '*/archetypes/*' \
tom1cd74ae2014-10-01 14:58:32 -07008 -exec $ONOS_ROOT/tools/dev/bin/onos-build-selective-hook {} \; | \
9 sort -u | sed "s:$ONOS_ROOT::g" | tr '\n' ',' | \
10 sed 's:/,:,:g;s:,/:,:g;s:^/::g;s:,$::g')
11
Pavlin Radoslavov91413792014-10-15 11:00:32 -070012[ -n "$projects" ] && cd $ONOS_ROOT && mvn --projects $projects ${@:-clean install}