In the build.sbt definition of a Scala project, is it possible to define the minimum version of sbt that is required to build the project?
sbt uses that same version of Scala to compile the build definitions that you write for your project because they use sbt APIs. This version of Scala is fixed for a specific sbt release and cannot be changed. For sbt 1.7. 1, this version is Scala 2.12.
sbt is an open-source build tool for Scala and Java projects, similar to Apache's Maven and Ant.
sbt is a popular tool for compiling, running, and testing Scala projects of any size. Using a build tool such as sbt (or Maven/Gradle) becomes essential once you create projects with dependencies or more than one code file.
project/build.properties
allows you to force sbt to use particular version. If current version of installed sbt is different - sbt itself will download (if needed) the version you've specified there:
sbt.version=0.12.0
See, Hello for instance. So actually you may have installed several versions of sbt in your system - it's just jars, that placed in .sbt/boot/scala-{scala.version required by this sbt}/org.scala-sbt/sbt/{sbt.version}
folder. Sbt executable actually looks for version specified in project/build.properties
or (if it's not specified) highest version installed in the system.
P.S. From sbt-launcher
perspective, sbt is only one dependency with small non-intersecting others like ansi.jar
, so specifying the range of versions like [0.13.1, 0.13.8]
have no much sense as it would be efective only for conflicting transitive deps. Otherwise it's enough to specify higher possible version (which would compile) - you may even choose some version that you already have (and update project's sbt that way).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With