sbt, the interactive build tool
Go to file
Martin Duhem 65adc869d4 Implement static launcher for sbt
This is a combination of 13 commits. I squashed these 13 commits to make
forward porting those changes easier, since some commit undo the changes
of other commits.

The PRs that include these changes can be found at
https://github.com/sbt/sbt/pull/2564 and
https://github.com/sbt/sbt/pull/2576.

Static launcher, get bridge sources from resources

This commit introduces a new "static" launcher that does not use Ivy to
gather all the artifacts that it requires, but rather expect them to be
immediately available.

To be able to use sbt without Internet access, we add a new
`ComponentCompiler` that is able to retrieve the bridge sources from the
resources on classpath and compile it.

Fix classpath issues in static launcher

The launcher defines a top classloader that willbe used by all
`ScalaInstance`s. Previously, this top classloader had a parent that
contained the scala library 2.10, which prevented the correct
compilation of the compiler bridge for scala 2.11.

Also, we no longer need the scala-reflect JAR.

Tests for FakeResolver

Add `scala-reflect.jar` to JARs of `StaticScalaProvider`

It turns out we need to have `scala-reflect.jar` on classpath to compile
the compiler bridge for the static scala instance of the launcher.

Comply to Ivy's specification in `FakeResolver`

Remove `CompilerBridgeProvider` and `ResourceBridgeProvider`

It turns out that we can leverage the`FakeResolver` that has been
implemented to use with the static launcher, and resolve a "fake
compiler bridge" using it, rather than copying it from the resources.

This also has the advantage of not requiring to change the build
definition.

Fix NPE in FakeResolver

Add compiler bridge sources to fake resolver

This allows sbt to resolve the compiler bridge sources when using the
static launcher

Don't hardcode sbt version in static launcher

Add scala compiler and library to fake resolver

This allows us to still resolve them if we have no other resolver
configured.

Add `RepositoriesParser`

This parser is used by the static launcher to parse the definition of
resolvers that override the build resolvers.

Support repositories override in static launcher

The static launcher will now parse user-defined repositories like the
usual launcher does.

Specifically, the static launcher now uses the following configuration:

 - `sbt.boot.directory`: specifies the boot directory that sbt will use.
   Defaults to `~/.sbt/boot`.
 - `sbt.override.build.repos`: indicate whether we want to override the
   build resolvers. Defaults to false.
 - `sbt.repository.config`: specifies the path to the files that
   contains repositories definition. Defaults to
   `${sbt.boot.directory}/repositories`.

Notes for sbt/sbt#2564 & sbt/sbt#2576
2016-04-27 10:14:47 +02:00
librarymanagement Implement static launcher for sbt 2016-04-27 10:14:47 +02:00
project Implement static launcher for sbt 2016-04-27 10:14:47 +02:00
sbt/src/sbt-test/dependency-management/chainresolver Reproduce "configuration not public" on local test->test. #1827 2016-01-17 16:43:44 +00:00
.travis.yml Target Oracle JDK 7 & 8 in Travis 2016-01-17 22:17:54 +00:00
README.md Add build.sbt 2015-08-19 03:56:08 -04:00
build.sbt Implement static launcher for sbt 2016-04-27 10:14:47 +02:00

README.md

librarymanagement module for sbt

git clone --no-hardlinks --branch 0.13 sbt sbt-modules/librarymanagement
cd sbt-modules/librarymanagement
git filter-branch --index-filter 'git rm --cached -qr -- . && git reset -q $GIT_COMMIT -- ivy util/cross' --prune-empty
git reset --hard
git gc --aggressive
git prune
git cb 1.0