Commit Graph

9013 Commits

Author SHA1 Message Date
Eugene Yokota a9e592996e Try to reproduce Scala.js + macro bug
Ref https://github.com/sbt/sbt/issues/5427
2020-02-12 15:24:41 -05:00
eugene yokota f5bd0fd096
Merge pull request #5423 from dwijnand/1.4/fix-coursier-classpath-order
Fix Coursier classpath order
2020-02-08 01:33:53 -05:00
Dale Wijnand 9eb51211d6 Fix Coursier classpath order 2020-02-07 07:04:38 +00:00
eugene yokota 06e8bc4476
Merge pull request #5419 from anilkumarmyla/update/coursier-2.0.0-RC5-6
Update coursier to 2.0.0-RC5-6
2020-02-04 15:45:45 -05:00
Anil Kumar Myla 6e25f1419b
Update coursier to 2.0.0-RC6 2020-02-04 11:47:08 -08:00
Anil Kumar Myla bbc25c5ec4
Update coursier to 2.0.0-RC5-6 2020-02-04 11:40:17 -08:00
eugene yokota dc34dd4955
Merge pull request #5416 from eed3si9n/wip/template
Update issue template
2020-02-04 12:24:14 -05:00
Eugene Yokota 3a10592bac Update issue template
I've been getting issue report that only fills out sbt version in the steps section.
Here's an attempt to fix that.
2020-02-03 14:28:20 -05:00
eugene yokota 7360e6342e
Merge pull request #5403 from eed3si9n/wip/artifacts
Fix the default artifact of packageSrc for custom configuration
2020-02-03 13:46:01 -05:00
eugene yokota ef68d16148
Merge pull request #5413 from raboof/coursierResolverOrder
Use project resolvers before dependency resolvers in coursier
2020-02-03 13:45:26 -05:00
Arnout Engelen 88623828d4 Use project resolvers before dependency resolvers in coursier
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.
2020-02-03 13:22:34 +01:00
eugene yokota f669fc734a
Merge pull request #5411 from eatkins/layering-error-message
Improve ClassLoader layering error message
2020-02-02 15:14:38 -05:00
Ethan Atkins 2c473fc31d Improve ClassLoader layering error message
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.
2020-02-01 14:42:21 -08:00
Eugene Yokota c38181d39f Fix the default artifact of packageSrc for custom configuration
Fixes https://github.com/sbt/sbt/issues/5391
2020-01-26 22:55:26 -05:00
eugene yokota 996ee5f0d6
Merge pull request #5367 from eatkins/scripted-run-source-from-main
Run all scripted tests using RunFromSourceMain
2020-01-20 10:34:10 -05:00
Ethan Atkins eb66651886 Fix reboot full in RunFromSourceMain
The initial implementation of reboot full did not work correctly. After
this change, the project/extra scripted test, which exercises reboot
full works.
2020-01-19 09:04:27 -08:00
Ethan Atkins c47db91bdc Set jna.nosys=true in RunSourceFromMain
Without this, I saw errors on windows.
2020-01-19 09:04:27 -08:00
Ethan Atkins 15d3ed1298 Add extra classpath to the metabuild
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.
2020-01-19 09:04:27 -08:00
Ethan Atkins 86eaf9d572 Allow RunSourceFromMain to use 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.
2020-01-19 09:04:27 -08:00
Ethan Atkins ae4d3aecb8 Explicitly set scripted and server test classpath
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.
2020-01-19 09:04:26 -08:00
Ethan Atkins 1ff5ff45bd Remove launcher based scriped runner
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.
2020-01-19 09:04:26 -08:00
Ethan Atkins 7a36a6f9ea Add test sources to scriptedUnpublished/watchTriggers 2020-01-19 09:04:26 -08:00
Ethan Atkins 2f99797bac Fix RunFromSourceMain sbt.Package$ bug
The main reason for having both the RunFromSourceMain and LauncherBased
scripted tests was that RunFromSourceMain would fail for any test that
ended up accessing the sbt.Package$ object. This commit fixes this bug
by reworking the classloader generated by RunFromSourceMain to invoke
sbt, switching from the classpath to jar classpath (by setting exportJars =
true) and entering sbt by calling `new xMain().run` rather than
`xMain.run`.

The reason for switching to the jar classpath is that the jvm seems to
have issues when there are two classes provided in different directories
that have the same case insensitive name, e.g. `sbt.package$` and
`sbt.Package$`. If those classes are instead provided in different
jars, the jvm seems to be able to handle it.

Exporting the jars is not enough though, I had to rework the
ClassLoader created in the launch method to have a layout that was
recognized by xMainConfiguration. I reimplemented the AppConfiguration
in java so that it could bootstrap itself in a single jar classloader
(the only needed jar is the Scripted.

If we export the jars in the build, then the NoClassDefErrors for
`sbt.Package$` go away during scripted tests using RunSourceFromMain.
This might make running tests in subprojects slightly slower but I think
its a worthy tradeoff.
2020-01-19 09:04:26 -08:00
eugene yokota 04ade0cb2f
Merge pull request #5364 from eatkins/publish-local-bin
Make publishLocalBin work without prior publishLocal
2020-01-18 20:33:53 -05:00
Ethan Atkins 17deb8b5d6 Make publishLocalBin work without prior publishLocal
In order for the sbt launcher to be able to resolve a local version of
sbt, we must publish the main jar, the sources jar, the doc jar, the pom
and an ivy.xml file. The publish and publishLocal tasks are wired in
IvyXml.scala to create an ivy.xml file before running publish. This
wasn't done with publishLocalBin which made it not work when no ivy.xml
file was already present (which was the case after running clean).
2020-01-18 16:11:37 -08:00
Ethan Atkins c18284948d Bump sbt version 2020-01-18 16:11:37 -08:00
eugene yokota 9920da77a0
Merge pull request #5385 from eatkins/accidental-debug-logging
Revert accidental debug logging commit
2020-01-17 22:10:07 -05:00
Ethan Atkins 3c54559236 Revert accidental debug logging commit
This was accidentally included in a formatting commit
cf745255e8.
2020-01-17 17:09:52 -08:00
eugene yokota cfa410cbd7
Merge pull request #5358 from dwijnand/cleanup/Deps
build: Cleanup Dependencies
2020-01-17 14:20:35 -05:00
eugene yokota e762e81714
Merge pull request #5383 from eatkins/disable-ivy-settings
Disable legacy ivy tests
2020-01-16 22:28:35 -05:00
Ethan Atkins f5730e1a16 Disable legacy ivy tests
These started failing recently. I think it is because they may be using
insecure resolvers. Since these tests are unlikely to be testing widely
used functionality, we can disable them for now. If we start seeing
related issues, we can consider actually fixing them.
2020-01-16 11:03:32 -08:00
eugene yokota 3043ca4ae0
Merge pull request #5375 from eed3si9n/wip/whitesource
WhiteSource integration
2020-01-15 17:56:09 -05:00
Eugene Yokota 58040d13be WhiteSource integration 2020-01-15 17:45:27 -05:00
Ethan Atkins 19fcd3011d
Merge pull request #5371 from eatkins/javafmt
Apply google java formatting to sbt java source files
2020-01-14 15:11:00 -08:00
Ethan Atkins cf745255e8 Apply javafmt in sbt project 2020-01-14 14:38:08 -08:00
Ethan Atkins 813864ec0f Add swoval java formatting plugin
The swoval javafmt plugin uses the google java formatter (which I
believe is the only widely used java formatter) to format source files.
It does not provide an automatic javafmtOnCompile method like the
scalafmt plugin so I had to manually implement that functionality. In
general the java formatter is much faster than scalafmt so the impact of
having javafmtOnCompile set to true is very low.
2020-01-14 14:20:23 -08:00
eugene yokota f1370a25fe
Merge pull request #5363 from eatkins/doc-linter
Use implicit val rather than import
2020-01-13 18:46:29 -05:00
eugene yokota e180c43dd3
Merge pull request #5362 from eatkins/doc-last-modified
Don't use last modified time of directories in doc
2020-01-13 18:45:56 -05:00
Ethan Atkins c5f0ee0e59 Don't use last modified time of directories in doc
I noticed that sbt does a _lot_ of no-op docs in the sbt project.
Through some debugging, I determined that this was because the target
directory last modified time of some of the dependent projects would
change between runs. I'm not really sure why that was happening but
instead of computing the last modified time of the directory, we should
be checking the last modified time of the directory contents.

After this change a no-op `doc` in the sbt project returns in less than
one second on my mac. Before, it was more like 25-60 seconds (the upper
bound is one runs `doc` because `sbtRoot/doc` takes about a minute).
2020-01-13 13:11:09 -08:00
Ethan Atkins 11174fb382 Use implicit val rather than import
This import was causing an unused import warning during doc.
2020-01-13 10:25:34 -08:00
eugene yokota 27531c5d29
Merge pull request #5365 from eatkins/scalafmt-bump
Upgrade scalafmt
2020-01-13 12:16:11 -05:00
Ethan Atkins adfdb945f8 Upgrade scalafmt
Intellij has problems with older versions of scalafmt (see
https://github.com/scalameta/scalafmt/issues/1630). Not sure if this a
scalafmt issue or an intellij issue. I pinned the edition to October
2019 to avoid reformatting tons of files. Once development stabilizes,
we may wish to drop the edition but, for now, it's disruptive to change
the formatting.
2020-01-12 13:52:10 -08:00
eugene yokota 57543fc59a
Merge pull request #5361 from eatkins/no-escape
Cleanup scripted quotation mark parsing
2020-01-11 20:36:09 -05:00
Ethan Atkins b9231a49cc Don't add extra quotation marks in scripted commands
Scripted automatically adding quotation marks when an argument contains
spaces breaks arguments that already were wrapped in quotations. The
scripted test should be responsible for its own escaping. Since this is
part of scripted-sbt-redux, we don't have to worry about downstream
builds relying on the old escaping behavior.
2020-01-11 16:51:46 -08:00
Ethan Atkins 639b812a01 Don't strip quotes in _sbt_ scripted command arguments
Stripping quotation marks makes it impossible to cleanly test certain
sbt features without resorting to weird hacks. For example:
> set Compile / scalacOptions += "-Xfatal-warnings"
did not work while
> set Compile / scalacOptions += '"-Xfatal-warnings"'
did.

I leave the single quote parser unchanged since single quotes are not
really used in sbt and so there is utility in leaving them as a way to
group arguments that should not be split apart.

This change should only affect the scripted tests in the sbt repo. We
can consider making stripQuotes = false the default for the plugin as
well.
2020-01-11 16:50:22 -08:00
Dale Wijnand 6b7b572e1a build: Cleanup Dependencies 2020-01-10 15:25:49 +00:00
eugene yokota 3d510e27ad
Merge pull request #5354 from eed3si9n/wip/bumpcoursier
lm-coursier-shaded 2.0.0-RC5-3
2020-01-09 16:16:02 -05:00
eugene yokota f96652bc4c
Merge pull request #5355 from eed3si9n/wip/repo-override
Update repo override test
2020-01-09 15:28:01 -05:00
Eugene Yokota f94aa19643 Update repo override test
Fixes https://github.com/sbt/sbt/issues/5335
2020-01-09 14:47:55 -05:00
eugene yokota 9b931c4bf8
Merge pull request #5350 from mrArkwright/fix-4451
introduce SysProp sbt.testing.legacyreport
2020-01-09 13:30:24 -05:00