Skip to content

Commit

Permalink
added support for release candidate versions of sbt
Browse files Browse the repository at this point in the history
  • Loading branch information
jkutner committed Jul 29, 2014
1 parent 2ece3bd commit 9bd0166
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
2 changes: 1 addition & 1 deletion bin/common
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ get_supported_sbt_version() {
local ctxDir=$1
if _has_buildPropertiesFile $ctxDir; then
sbtVersionLine="$(grep -P '[ \t]*sbt\.version[ \t]*=' "${ctxDir}"/project/build.properties | sed -E -e 's/[ \t\r\n]//g')"
sbtVersion=$(expr "$sbtVersionLine" : 'sbt\.version=\(0\.1[1-3]\.[0-9]\)$')
sbtVersion=$(expr "$sbtVersionLine" : 'sbt\.version=\(0\.1[1-3]\.[0-9]\(-RC[1-9]\)*\)$')
if [ "$sbtVersion" != 0 ] ; then
echo "$sbtVersion"
else
Expand Down
15 changes: 14 additions & 1 deletion test/common_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -139,11 +139,24 @@ EOF
assertCapturedEquals "${EXPECTED_VERSION}"
}

testGetSbtVersionWithReleaseCandidate()
{
mkdir -p ${BUILD_DIR}/project
cat > ${BUILD_DIR}/project/build.properties <<EOF
sbt.version = ${EXPECTED_VERSION}-RC3
EOF

capture get_supported_sbt_version ${BUILD_DIR}

assertCapturedSuccess
assertCapturedEquals "${EXPECTED_VERSION}-RC3"
}

testGetSbtVersionWithTrailingLetters()
{
mkdir -p ${BUILD_DIR}/project
cat > ${BUILD_DIR}/project/build.properties <<EOF
sbt.version = ${EXPECTED_VERSION}RC
sbt.version = ${EXPECTED_VERSION}-MSERVER-1
EOF

capture get_supported_sbt_version ${BUILD_DIR}
Expand Down

0 comments on commit 9bd0166

Please sign in to comment.