blob: 732a31df347d154c742423d45445a60dd6793664 [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
Thomas Vachuska0a1e5492014-12-08 08:52:50 -08006# TODO: figure out a more elegant way of ignoring disconnected projects
tom1cd74ae2014-10-01 14:58:32 -07007projects=$(find $ONOS_ROOT -name '*.java' \
Jonathan Hartc39773c2015-03-23 10:11:00 -07008 -not -path '.git/*' -and -not -path '*/archetypes/*' -and -not -path '*/grouphandler/*' -and -not -path '*/maven-plugin/*' \
tom1cd74ae2014-10-01 14:58:32 -07009 -exec $ONOS_ROOT/tools/dev/bin/onos-build-selective-hook {} \; | \
10 sort -u | sed "s:$ONOS_ROOT::g" | tr '\n' ',' | \
11 sed 's:/,:,:g;s:,/:,:g;s:^/::g;s:,$::g')
12
Pavlin Radoslavov91413792014-10-15 11:00:32 -070013[ -n "$projects" ] && cd $ONOS_ROOT && mvn --projects $projects ${@:-clean install}