mirror of https://github.com/sbt/sbt.git
Merge pull request #172 from alexarchambault/topic/plugin-force-scala-artifact-version
Force versions of the usual org.scala-lang modules, from the SBT plugin
This commit is contained in:
commit
a8c8c83645
16
README.md
16
README.md
|
|
@ -52,8 +52,9 @@ Lastly, it can be used programmatically via its [API](#api) and has a Scala JS [
|
||||||
4. [Limitations](#limitations)
|
4. [Limitations](#limitations)
|
||||||
5. [FAQ](#faq)
|
5. [FAQ](#faq)
|
||||||
6. [Roadmap](#roadmap)
|
6. [Roadmap](#roadmap)
|
||||||
7. [Contributors](#contributors)
|
7. [Development tips](#development-tips)
|
||||||
8. [Projects using coursier](#projects-using-coursier)
|
8. [Contributors](#contributors)
|
||||||
|
9. [Projects using coursier](#projects-using-coursier)
|
||||||
|
|
||||||
## Quick start
|
## Quick start
|
||||||
|
|
||||||
|
|
@ -605,6 +606,17 @@ Set the `COURSIER_NO_TERM` environment variable to `1`. This disables the
|
||||||
progress bar message, and prints simple `Downloading URL` / `Downloaded URL`
|
progress bar message, and prints simple `Downloading URL` / `Downloaded URL`
|
||||||
instead.
|
instead.
|
||||||
|
|
||||||
|
## Development tips
|
||||||
|
|
||||||
|
#### Working on the plugin module in an IDE
|
||||||
|
|
||||||
|
Set `scalaVersion` to `2.10.6` in `build.sbt`. Then re-open / reload the coursier project.
|
||||||
|
|
||||||
|
#### Running the Scala JS tests
|
||||||
|
|
||||||
|
They require `npm install` to have been run once from the `coursier` directory or a subdirectory of
|
||||||
|
it. They can then be run with `sbt testsJS/test`.
|
||||||
|
|
||||||
## Roadmap
|
## Roadmap
|
||||||
|
|
||||||
The first releases were milestones like `0.1.0-M?`. As a launcher, basic Ivy
|
The first releases were milestones like `0.1.0-M?`. As a launcher, basic Ivy
|
||||||
|
|
|
||||||
|
|
@ -52,8 +52,9 @@ Lastly, it can be used programmatically via its [API](#api) and has a Scala JS [
|
||||||
4. [Limitations](#limitations)
|
4. [Limitations](#limitations)
|
||||||
5. [FAQ](#faq)
|
5. [FAQ](#faq)
|
||||||
6. [Roadmap](#roadmap)
|
6. [Roadmap](#roadmap)
|
||||||
7. [Contributors](#contributors)
|
7. [Development tips](#development-tips)
|
||||||
8. [Projects using coursier](#projects-using-coursier)
|
8. [Contributors](#contributors)
|
||||||
|
9. [Projects using coursier](#projects-using-coursier)
|
||||||
|
|
||||||
## Quick start
|
## Quick start
|
||||||
|
|
||||||
|
|
@ -629,6 +630,17 @@ Set the `COURSIER_NO_TERM` environment variable to `1`. This disables the
|
||||||
progress bar message, and prints simple `Downloading URL` / `Downloaded URL`
|
progress bar message, and prints simple `Downloading URL` / `Downloaded URL`
|
||||||
instead.
|
instead.
|
||||||
|
|
||||||
|
## Development tips
|
||||||
|
|
||||||
|
#### Working on the plugin module in an IDE
|
||||||
|
|
||||||
|
Set `scalaVersion` to `2.10.6` in `build.sbt`. Then re-open / reload the coursier project.
|
||||||
|
|
||||||
|
#### Running the Scala JS tests
|
||||||
|
|
||||||
|
They require `npm install` to have been run once from the `coursier` directory or a subdirectory of
|
||||||
|
it. They can then be run with `sbt testsJS/test`.
|
||||||
|
|
||||||
## Roadmap
|
## Roadmap
|
||||||
|
|
||||||
The first releases were milestones like `0.1.0-M?`. As a launcher, basic Ivy
|
The first releases were milestones like `0.1.0-M?`. As a launcher, basic Ivy
|
||||||
|
|
|
||||||
|
|
@ -154,6 +154,14 @@ object Tasks {
|
||||||
|
|
||||||
private val resolutionsCache = new mutable.HashMap[CacheKey, UpdateReport]
|
private val resolutionsCache = new mutable.HashMap[CacheKey, UpdateReport]
|
||||||
|
|
||||||
|
private def forcedScalaModules(scalaVersion: String): Map[Module, String] =
|
||||||
|
Map(
|
||||||
|
Module("org.scala-lang", "scala-library") -> scalaVersion,
|
||||||
|
Module("org.scala-lang", "scala-compiler") -> scalaVersion,
|
||||||
|
Module("org.scala-lang", "scala-reflect") -> scalaVersion,
|
||||||
|
Module("org.scala-lang", "scalap") -> scalaVersion
|
||||||
|
)
|
||||||
|
|
||||||
def updateTask(withClassifiers: Boolean, sbtClassifiers: Boolean = false) = Def.task {
|
def updateTask(withClassifiers: Boolean, sbtClassifiers: Boolean = false) = Def.task {
|
||||||
|
|
||||||
// SBT logging should be better than that most of the time...
|
// SBT logging should be better than that most of the time...
|
||||||
|
|
@ -209,6 +217,8 @@ object Tasks {
|
||||||
val cachePolicy = coursierCachePolicy.value
|
val cachePolicy = coursierCachePolicy.value
|
||||||
val cacheDir = coursierCache.value
|
val cacheDir = coursierCache.value
|
||||||
|
|
||||||
|
val sv = scalaVersion.value // is this always defined? (e.g. for Java only projects?)
|
||||||
|
|
||||||
val resolvers =
|
val resolvers =
|
||||||
if (sbtClassifiers)
|
if (sbtClassifiers)
|
||||||
coursierSbtResolvers.value
|
coursierSbtResolvers.value
|
||||||
|
|
@ -221,7 +231,7 @@ object Tasks {
|
||||||
val startRes = Resolution(
|
val startRes = Resolution(
|
||||||
currentProject.dependencies.map { case (_, dep) => dep }.toSet,
|
currentProject.dependencies.map { case (_, dep) => dep }.toSet,
|
||||||
filter = Some(dep => !dep.optional),
|
filter = Some(dep => !dep.optional),
|
||||||
forceVersions = projects.map(_.moduleVersion).toMap
|
forceVersions = forcedScalaModules(sv) ++ projects.map(_.moduleVersion)
|
||||||
)
|
)
|
||||||
|
|
||||||
// required for publish to be fine, later on
|
// required for publish to be fine, later on
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@ package object compatibility {
|
||||||
|
|
||||||
fs.readFile("tests/shared/src/test/resources/" + path, "utf-8", {
|
fs.readFile("tests/shared/src/test/resources/" + path, "utf-8", {
|
||||||
(err: js.Dynamic, data: js.Dynamic) =>
|
(err: js.Dynamic, data: js.Dynamic) =>
|
||||||
if (err == null) p.success(data.asInstanceOf[String])
|
if (js.isUndefined(err) || err == null) p.success(data.asInstanceOf[String])
|
||||||
else p.failure(new Exception(err.toString))
|
else p.failure(new Exception(err.toString))
|
||||||
()
|
()
|
||||||
}: js.Function2[js.Dynamic, js.Dynamic, Unit])
|
}: js.Function2[js.Dynamic, js.Dynamic, Unit])
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue