Skip to content

Commit

Permalink
Document how to cross build using sbt 1.x
Browse files Browse the repository at this point in the history
  • Loading branch information
eed3si9n committed Oct 5, 2024
1 parent 6e0f3e7 commit 3606ed3
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 2 deletions.
2 changes: 1 addition & 1 deletion book.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ cname = "www.scala-sbt.org"
[preprocessor.variables]

[preprocessor.variables.variables]
sbt_version = "2.0.0-alpha7"
sbt_version = "2.0.0-M2"
sbt_runner_version = "1.10.0"
scala3_example_version = "3.3.3"
scala2_13_example_version = "2.13.15"
Expand Down
24 changes: 23 additions & 1 deletion src/reference/changes/migrating-from-sbt-1.x.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,29 @@ lazy val plugin = (projectMatrix in file("plugin"))
```

If you use `projectMatrix`, make sure to move the plugin to a subdirectory like `plugin/`. Otherwise, the synthetic root project will also pick up the `src/`.
Use sbt 1.10.2 or later to cross build from sbt 1.x side.

### Cross building sbt plugin with sbt 1.x

Use sbt 1.10.2 or later, if you want to cross build using sbt 1.x.

```scala
// using sbt 1.x
lazy val scala212 = "2.12.20"
lazy val scala3 = "3.3.4"
ThisBuild / crossScalaVersions := Seq(scala212, scala3)

lazy val plugin = (project in file("plugin"))
.enablePlugins(SbtPlugin)
.settings(
name := "sbt-vimquit",
(pluginCrossBuild / sbtVersion) := {
scalaBinaryVersion.value match {
case "2.12" => "1.5.8"
case _ => "{{sbt_version}}"
}
},
)
```

Migrating to slash syntax
-------------------------
Expand Down

0 comments on commit 3606ed3

Please sign in to comment.