cross-build

SBT: Cross build project for two Scala versions with different dependencies

こ雲淡風輕ζ 提交于 2020-05-15 02:39:26
问题 I have the following use case. I would like to build the same Scala project for scala 2.10 and 2.12. When doing so I would like to specify some of the dependencies for the 2.10 version as provided whereas I'd like to have those compiled in the jar for 2.12. I was looking at SBT's docs and found how I can split a build.sbt into separate declarations but those always get mentioned as sub-modules . In my case I'd like to cross-build the whole app - not specific parts of it. Any hints or

SBT Scala cross versions, with aggregation and dependencies

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-10 17:37:33
问题 I am struggling with how crossScalaVersions works with subprojects. I have a project that compiles with 2.10 (foo) and a project that compiles with 2.11 (bar). They share a cross compiled project (common). How can I compile projects foo and bar? build.sbt lazy val root = (project in file(".")).aggregate(foo, bar).settings( crossScalaVersions := Seq("2.10.4", "2.11.4") ) lazy val foo = (project in file("foo")).dependsOn(common).settings( crossScalaVersions := Seq("2.10.4"), scalaVersion := "2

How to have SBT subproject with multiple Scala versions?

て烟熏妆下的殇ゞ 提交于 2019-12-09 04:41:08
问题 I have a project using Scala 2.10 and one using Scala 2.11. They depend on a common project, which can compile with both. lazy val foo = (project in file("foo")).dependsOn(baz).settings( scalaVersion := "2.10.4" ) lazy val bar = (project in file("bar")).dependsOn(baz).settings( scalaVersion := "2.11.4" ) lazy val baz = (project in file("baz")).settings( crossScalaVersions := Seq("2.10.4", "2.11.4"), scalaVersion := "2.10.4" ) And then $ sbt bar/update [info] Updating {file:/home/paul/Private