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

Update sbt version #9

Merged
merged 1 commit into from
Jan 26, 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
3 changes: 2 additions & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ lazy val `sbt-pull-request-validator` = (project in file("."))
.enablePlugins(AutomateHeaderPlugin)

sbtPlugin := true
enablePlugins(SbtPlugin)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is one of the few source breaking changes introduced in sbt over the years, specifically sbt 1.2.8.

I had to do a similar change when updating sbt version in multi-release-jar


organization := "com.hpe.sbt"

Expand Down Expand Up @@ -36,7 +37,7 @@ releaseProcess := Seq[ReleaseStep](
commitReleaseVersion,
tagRelease,
releaseStepCommandAndRemaining("publish"),
releaseStepTask(bintrayRelease in `sbt-pull-request-validator`),
releaseStepTask(`sbt-pull-request-validator` / bintrayRelease),
setNextVersion,
commitNextVersion,
pushChanges
Expand Down
2 changes: 1 addition & 1 deletion project/build.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sbt.version=1.1.5
sbt.version=1.9.7
16 changes: 8 additions & 8 deletions src/main/scala/com/hpe/sbt/ValidatePullRequest.scala
Original file line number Diff line number Diff line change
Expand Up @@ -134,10 +134,10 @@ object ValidatePullRequest extends AutoPlugin {
private def pullRequestId = jenkinsPullRequestId orElse travisPullRequestId

override lazy val buildSettings = Seq(
includeFilter in validatePullRequest := "*",
excludeFilter in validatePullRequest := "README.*",
includeFilter in validatePullRequestBuildAll := PathGlobFilter("project/**") || PathGlobFilter("*.sbt"),
excludeFilter in validatePullRequestBuildAll := NothingFilter,
validatePullRequest / includeFilter := "*",
validatePullRequest / excludeFilter := "README.*",
validatePullRequestBuildAll / includeFilter := PathGlobFilter("project/**") || PathGlobFilter("*.sbt"),
validatePullRequestBuildAll / excludeFilter := NothingFilter,
prValidatorSourceBranch := {
localSourceBranch orElse jenkinsSourceBranch getOrElse "HEAD"
},
Expand Down Expand Up @@ -198,7 +198,7 @@ object ValidatePullRequest extends AutoPlugin {

val state = Keys.state.value
val extracted = Project.extract(state)
val rootBaseDir = (baseDirectory in ThisBuild).value
val rootBaseDir = (ThisBuild / baseDirectory).value
// All projects in reverse order of path, this ensures when we search through them, we get the most specific
// first
val projects = extracted.structure.allProjects
Expand All @@ -217,9 +217,9 @@ object ValidatePullRequest extends AutoPlugin {
.sortBy(_._1)
.reverse

val filter = (includeFilter in validatePullRequest).value -- (excludeFilter in validatePullRequest).value
val filter = (validatePullRequest / includeFilter).value -- (validatePullRequest / excludeFilter).value
val allBuildFilter =
(includeFilter in validatePullRequestBuildAll).value -- (excludeFilter in validatePullRequestBuildAll).value
(validatePullRequestBuildAll / includeFilter).value -- (validatePullRequestBuildAll / excludeFilter).value

log.info(s"Diffing [$prId] to determine changed modules in PR...")
val diffOutput = s"git diff $target --name-only".!!.split("\n")
Expand Down Expand Up @@ -289,7 +289,7 @@ object ValidatePullRequest extends AutoPlugin {
Seq()
}
},
prValidatorTasks := Seq(test in Test),
prValidatorTasks := Seq(Test / test),
prValidatorBuildAllTasks := prValidatorTasks.value,
prValidatorEnforcedBuildAllTasks := prValidatorBuildAllTasks.value,
validatePullRequest := Def.taskDyn {
Expand Down
2 changes: 1 addition & 1 deletion version.sbt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
version in ThisBuild := "1.0.1-SNAPSHOT"
ThisBuild / version := "1.0.1-SNAPSHOT"
Loading