Skip to content

Commit

Permalink
Automate publishLocal step for slow/test
Browse files Browse the repository at this point in the history
sbt can be fun sometimes
  • Loading branch information
olafurpg committed Mar 7, 2019
1 parent feaa27d commit 3ab0608
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 2 deletions.
5 changes: 4 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@ jobs:
- sbt scalafixCheck docs/docusaurusCreateSite
- env: TEST="sbt slow/test"
script:
- sbt sbt-metals/publishLocal slow/test
- sbt slow/test
- env: TEST="sbt +cross/test"
script:
- sbt +cross/test
- stage: release
script: sbt ci-release docs/docusaurusPublishGhpages

Expand Down
28 changes: 27 additions & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -323,10 +323,36 @@ lazy val unit = project
)
.dependsOn(mtest, metals, pc)
.enablePlugins(BuildInfoPlugin)

val cross211publishLocal = Def.task[Unit] {
// Runs `publishLocal` for mtags/pc with 2.11 scalaVersion.
val newState = Project
.extract(state.value)
.appendWithSession(
List(
scalaVersion.in(mtags) := V.scala211,
scalaVersion.in(pc) := V.scala211
),
state.value
)
Project
.extract(newState)
.runTask(publishLocal.in(mtags), newState)
Project
.extract(newState)
.runTask(publishLocal.in(pc), newState)
}
lazy val slow = project
.in(file("tests/slow"))
.settings(
testSettings
testSettings,
test.in(Test) := test
.in(Test)
.dependsOn(
publishLocal.in(`sbt-metals`),
cross211publishLocal
)
.value
)
.dependsOn(unit)

Expand Down

0 comments on commit 3ab0608

Please sign in to comment.