Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix deprecation warning, drop sbt 1.0.x support #232

Merged
merged 2 commits into from
Feb 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

## [Unreleased]

* Remove heroku-18 support ([#226](https://github.com/heroku/heroku-buildpack-scala/pull/226))
* Remove heroku-18 support. ([#226](https://github.com/heroku/heroku-buildpack-scala/pull/226))
* Fix deprecation warnings when using sbt `>= 1.5`. ([#232](https://github.com/heroku/heroku-buildpack-scala/pull/232))
* Support for sbt `1.0.x` has been removed. ([#232](https://github.com/heroku/heroku-buildpack-scala/pull/232))

## [v96] - 2022-09-30

Expand Down
2 changes: 1 addition & 1 deletion bin/compile
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ fi

if ! (has_supported_sbt_version ${BUILD_DIR} || has_supported_sbt_1_version ${BUILD_DIR}); then
error "You have defined an unsupported sbt.version in project/build.properties
You must use a version of sbt between 0.11.0 and 1.x"
For sbt 0.x you must use a version >= 0.11, for sbt 1.x you must use a version >= 1.1"
fi

if has_old_preset_sbt_opts; then
Expand Down
4 changes: 2 additions & 2 deletions lib/common.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env bash

SBT_0_VERSION_PATTERN='sbt\.version=\(0\.1[1-3]\.[0-9]*\(-[a-zA-Z0-9_]*\)*\)$'
SBT_1_VERSION_PATTERN='sbt\.version=\(1\.[0-9]*\.[0-9]*\(-[a-zA-Z0-9_]*\)*\)$'
SBT_0_VERSION_PATTERN='sbt\.version=\(0\.1[1-3]\.[0-9]\+\(-[a-zA-Z0-9_]\+\)*\)$'
SBT_1_VERSION_PATTERN='sbt\.version=\(1\.[1-9][0-9]*\.[0-9]\+\(-[a-zA-Z0-9_]\+\)*\)$'

## SBT 0.10 allows either *.sbt in the root dir, or project/*.scala or .sbt/*.scala
detect_sbt() {
Expand Down
10 changes: 6 additions & 4 deletions opt/HerokuBuildpackPlugin_sbt1.scala
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
import sbt._
import Keys._
import sbt.Keys._

object HerokuBuildpackPlugin extends AutoPlugin {
override def trigger = allRequirements

override lazy val projectSettings = Seq(
sources in doc in Compile := List(),
publishArtifact in packageDoc := false,
publishArtifact in packageSrc := false
Compile / doc / sources := List(),
packageDoc / publishArtifact := false,
packageSrc / publishArtifact := false
)
}
4 changes: 2 additions & 2 deletions test/common_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -174,13 +174,13 @@ testGetSupportedSbt1Version()
{
mkdir -p ${BUILD_DIR}/project
cat > ${BUILD_DIR}/project/build.properties <<EOF
sbt.version=1.0.0-RC3
sbt.version=1.1.0-RC3
EOF

capture get_supported_sbt_version ${BUILD_DIR} ${SBT_1_VERSION_PATTERN}

assertCapturedSuccess
assertCapturedEquals "1.0.0-RC3"
assertCapturedEquals "1.1.0-RC3"
}

testGetUnsupportedSbtVersion()
Expand Down
2 changes: 1 addition & 1 deletion test/compile_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ testComplile_BuildPropertiesFileWithUnsupportedOldVersion()
compile

assertCapturedError "You have defined an unsupported sbt.version in project/build.properties"
assertCapturedError "You must use a version of sbt between 0.11.0 and 1.x"
assertCapturedError "For sbt 0.x you must use a version >= 0.11, for sbt 1.x you must use a version >= 1.1"
}

testComplile_BuildPropertiesFileWithRCVersion()
Expand Down
1 change: 1 addition & 0 deletions test/release_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

testRelease()
{
mkdir -p "${BUILD_DIR}/.heroku"
touch "${BUILD_DIR}/.heroku/sbt-dependency-classpath.log"

expected_release_output=`cat <<EOF
Expand Down