blob: be9e8577e1dca9de2dc6f5f6d33fe5988a02ce91 [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' \
Thomas Vachuska0a1e5492014-12-08 08:52:50 -08008 -not -path '.git/*' -and -not -path '*/archetypes/*' -and -not -path '*/foo/*' \
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}