blob: 3616a2fe766bbdbcc04a657f29e58c2e36bd6ec2 [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 Hartfccd3122015-02-17 11:44:56 -08008 -not -path '.git/*' -and -not -path '*/archetypes/*' -and -not -path '*/foo/*' -and -not -path '*/grouphandler/*' \
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}