#!/usr/bin/env bash

##############################################################################
##
## Rebuild using the locally built bnd gradle plugin
##
## Since this will use the gradle plugin in dist/bundles, your gradle tasks
## must not include :gradle-plugins:publish which will attempt to
## overwrite the plugin being used for the build.
##
##############################################################################
REPO=$(dirname ${BASH_SOURCE[0]})
ARGS="$@"
if [ -z "$ARGS" ]; then
  ARGS=":build"
fi
set -ev

$REPO/gradlew --no-daemon -Pbnd_snapshots=$REPO/dist/bundles $ARGS
