FPORT: Off the grid installation + repositories override#34
Merged
FPORT: Off the grid installation + repositories override#34
Conversation
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 sbt/sbt#2564 and sbt/sbt#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
We get a warning about the exhaustivity check, but the warning disappears if we increase the maximum recursion depth.
8660908 to
ed0f2af
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Forward port of sbt/sbt#2564 and sbt/sbt#2576