Skip to content

Commit

Permalink
Fix deprecation warning, drop sbt 1.0 support
Browse files Browse the repository at this point in the history
  • Loading branch information
Malax committed Oct 31, 2023
1 parent 2f334eb commit e8ac0d4
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 11 deletions.
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
## Main

* 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

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
2 changes: 1 addition & 1 deletion hatchet.lock
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@
- - test/spec/fixtures/repos/sbt/sbt-minimal-scala-sample
- 92b704164a806e7a70a2237f07c5519664c7def3
- - test/spec/fixtures/repos/sbt/sbt-one-example
- 32291b4dc3219e72af320f0387706f223de864db
- 88746f1d917c233b11219abb4461804356e967ce
- - test/spec/fixtures/repos/sbt/sbt-start-script-sample
- 0e5668e7b096c62af1d54ddadc2aecaf30592840
2 changes: 1 addition & 1 deletion 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_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() {
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
)
}
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
4 changes: 2 additions & 2 deletions test/spec/sbt_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@
end
end

it "should work with sbt 1.0" do
it "should work with sbt 1.1" do
new_default_hatchet_runner("sbt-one-example").tap do |app|
app.deploy do
expect(app.output).to include("Running: sbt compile stage")
expect(app.output).to include("https://repo1.maven.org/maven2/org/scala-sbt/sbt-launch/1.0.0")
expect(app.output).to include("https://repo1.maven.org/maven2/org/scala-sbt/sbt-launch/1.1.6")
expect(app.output).not_to include("Main Scala API documentation to")
expect(app.output).to include("[info] Done packaging.")
end
Expand Down

0 comments on commit e8ac0d4

Please sign in to comment.