Fixes#2232
Within `build.sbt` this makes sure that definitions are ordered from top to bottom.
This matters when multiple subprojects refer to the same setting (probably not a good practice).
Fixes https://github.com/sbt/sbt/issues/3112
This unpacks Extracted as State's extension methods.
In addition this provides a way of responding via LSP.
csrResolvers.all evaluates all possible scopes in arbitrary order. This change
makes sure at least the project resolvers are placed before any resolvers from
dependency projects.
When a class on the project classpath is loaded via reflection by one of
the parents of the project classloader, sbt run can fail with a
mysterious ClassNotFoundException. This is expected behavior but it
wasn't previously explained to the user.
Ref https://github.com/sbt/sbt/issues/5410.
The initial implementation of reboot full did not work correctly. After
this change, the project/extra scripted test, which exercises reboot
full works.
When sbt was entered through xMain.run and the classloaders do not have
the expected format, sbt recreates the classloaders for itself.
Unfortunately the extra classpath was not added to the classloader. This
caused project/extra to fail if it was entered from RunFromSourceMain
rather than with the launcher.
The repo overrides scripted test relies on using the launcher to modify
the default resolvers. To support this, I extended the scripted launcher
to use the bundled sbt launcher if it is passed in via the
`-Dsbt.launch.jar` system property.
This commit makes it so that the scalaVersion, sbtVersion and classpath
are always passed in as parameters to any method that creates an sbt
server -- either for scripted or for the sbt server tests. By making
that change, I was able to change the implementation of scripted in the
sbt project to use publishLocalBin instead of publishLocal. This makes
the scripted tests start much faster (doc alone can easily take 30
second) with messing with the build to exclude slow tasks from
publishLocal.
As part of this change, I removed the test dependency on scriptedSbtRedux for
sbtProj and instead had scriptedSbtRedux depend on sbtProj. This allowed
me to remove some messy LocalProject logic in the resourceGenerators for
scriptedSbtReduxProj. I also had to remove a number of imports in the
scriptedSbtReduxProj because the definitions available in the sbt
package object became available.
I also removed the dependency on sbt-buildinfo and instead pass the
values from the build into test classes using scalatest properties. I
ran into a number of minor issues with the build info plugin, namely
that I couldn't get fullClasspathAsJars to reliably run as a BuildInfo
key. It also is somewhat more clear to me to just rely on the built in
scalatest functionality. The big drawback is that the scalatest
properties can only be strings, but that restriction isn't really a
problem here (strangely the TestData structure has a field configMap
which is effectively Map[String, Any] but Any is actually always String
given how the TestData is created as part of framework initialization.
Since scripted no longer publishes, scriptedUnpublished is now
effectively an alias for scripted.
To get publishLocalBin working, I had to copy private code from
IvyXml.scala into PublishBinPlugin. Once we publish a new version of
sbt, we can remove the copied code and invoke IvyXml.makeIvyXmlBefore
directly.
After the changes to `RunFromSourceMain` and the addition of
`Compile / exportJars` to the build, all of the tests pass with
RunFromSourceMain so I decided to remove the launcher based ones. The
RunFromSourceMain based tests are faster because they don't recompile
the various compiler bridges every time.