From d111938fd011955e57230295347024f14757de7b Mon Sep 17 00:00:00 2001 From: Manuel Fuchs Date: Tue, 31 Oct 2023 12:07:29 +0100 Subject: [PATCH 1/2] Fix deprecation warning, drop sbt 1.0 support --- CHANGELOG.md | 4 +++- bin/compile | 2 +- lib/common.sh | 2 +- opt/HerokuBuildpackPlugin_sbt1.scala | 10 ++++++---- test/common_test.sh | 4 ++-- test/compile_test.sh | 2 +- test/release_test.sh | 1 + 7 files changed, 15 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f4eb6a13..f2d0a268 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/bin/compile b/bin/compile index 9fc78261..1495bfee 100755 --- a/bin/compile +++ b/bin/compile @@ -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 diff --git a/lib/common.sh b/lib/common.sh index dcbd3151..fdceecd8 100644 --- a/lib/common.sh +++ b/lib/common.sh @@ -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_1_VERSION_PATTERN='sbt\.version=\(1\.[1-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() { diff --git a/opt/HerokuBuildpackPlugin_sbt1.scala b/opt/HerokuBuildpackPlugin_sbt1.scala index 9a2671bd..f8f4d2f9 100644 --- a/opt/HerokuBuildpackPlugin_sbt1.scala +++ b/opt/HerokuBuildpackPlugin_sbt1.scala @@ -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 ) } diff --git a/test/common_test.sh b/test/common_test.sh index c6fbd446..d2955bbf 100644 --- a/test/common_test.sh +++ b/test/common_test.sh @@ -174,13 +174,13 @@ testGetSupportedSbt1Version() { mkdir -p ${BUILD_DIR}/project cat > ${BUILD_DIR}/project/build.properties <= 0.11, for sbt 1.x you must use a version >= 1.1" } testComplile_BuildPropertiesFileWithRCVersion() diff --git a/test/release_test.sh b/test/release_test.sh index 1a16211f..772f9f46 100755 --- a/test/release_test.sh +++ b/test/release_test.sh @@ -4,6 +4,7 @@ testRelease() { + mkdir -p "${BUILD_DIR}/.heroku" touch "${BUILD_DIR}/.heroku/sbt-dependency-classpath.log" expected_release_output=`cat < Date: Wed, 7 Feb 2024 10:21:53 +0100 Subject: [PATCH 2/2] Update sbt version patterns --- lib/common.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/common.sh b/lib/common.sh index fdceecd8..90987664 100644 --- a/lib/common.sh +++ b/lib/common.sh @@ -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\.[1-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() {