#!/bin/bash -e

# See comment in bootstrap_fun

source scripts/common

# scripts/common provides sbtRepositoryConfig
sbtArgs="-ivy $IVY2_DIR -Dsbt.override.build.repos=true -Dsbt.repository.config=$sbtRepositoryConfig"

source scripts/bootstrap_fun

generateRepositoriesConfig $integrationRepoUrl

determineScalaVersion
deriveModuleVersions

removeExistingBuilds $integrationRepoUrl
clearIvyCache

if [ ! -z "$STARR_REF" ]; then
  buildStarr
fi

buildLocker

# locker is now published in artifactory -- make sure we resolve from there
rm -rf build/

buildModules

buildQuick clean testAll publish

testStability

if [ "$publishToSonatype" == "yes" ]; then
  publishSonatype
fi
