Commit Graph

3115 Commits

Author SHA1 Message Date
William Narmontas febccde3e7 Building on #6353 to help identify the issue of #6101 for Windows users. 2021-07-24 19:59:00 +01:00
eugene yokota d4162cce04
Merge pull request #6566 from adpi2/fix-6010
[BSP] Send diagnostics and meaningful error message when reloading fails
2021-07-12 16:01:48 -04:00
Adrien Piquerez 5490385303 Remove topLoader hack for dotty 2021-07-08 10:03:47 +02:00
Adrien Piquerez 69795cbed7 Move jansiExclusionLoader to scalaInstanceTopLoader 2021-07-08 10:03:47 +02:00
Adrien Piquerez 63dcb1957b Move scalaInstanceTopLoader to compileBase settings 2021-07-08 09:27:20 +02:00
Adrien Piquerez a76e209dde [BSP] send diagnostics when evaluating build.sbt
Since build.sbt is compiled/evaluated in `sbt.compiler.Eval`,
this commit introduces a `BuildServerEvalReporter` to redirect
the compiler errors to the BSP clients.

A new `finalReport` method is added in the new `EvalReporter` base class
to reset the old diagnostics.
2021-07-08 09:25:01 +02:00
Adrien Piquerez 4804cc2fa4 Simplify bspReload cmd by calling doLoadProject
Fixes #6010: Send real error message when realod failed
2021-07-08 08:39:46 +02:00
Adrien Piquerez a825c115c2 [BSP] Ignore sbt target in resources request 2021-06-30 10:31:43 +02:00
Jason Zaugg 3d92827af3 Fix compilation error in test 2021-06-30 12:12:24 +10:00
Jason Zaugg fe046476b1 Refine and test SBT BSP target
- Pass source dirs and current list of files
  - Align display name and URI
2021-06-30 11:19:24 +10:00
Jason Zaugg 0bd736be2a Record build sources in PluginData for BSP 2021-06-28 23:27:33 +10:00
Jason Zaugg 111cc5f473 Add scalacOptions to the SBT targets 2021-06-28 11:02:12 +10:00
Jason Zaugg af14864986 Address review feedback
- Restore old type of `bspWorkspace` key for backwards compat.
    Instead, introduce `bspFullWorkspace` that includes the
    SBT targets
  - Log a warning if the client requests, e.g. `scalaMainClasses`
    for a SBT target
  - Refactor the code that creates the SBT build targets so it
    doesn't depend on `sbtFullWorkspace`.
  - Add a setting `bspSbtEnabled` to let the user opt-opt of
    SBT target export (e.g. to compensate for a client that does
    not yet support them)
2021-06-28 11:02:12 +10:00
Jason Zaugg 45e8e2f90d Support the SBT extension in BSP import
This enables code assist in the .sbt and project/*.scala files
in IntelliJ and any other IDEs that implement this extension.
2021-06-28 11:02:09 +10:00
Adrien Piquerez 852498e992 [BSP] Remove useless log after request failure 2021-06-25 10:41:10 +02:00
Adrien Piquerez f58c8c349a [BSP] add handle for cancelled compilation 2021-06-25 10:41:08 +02:00
Adrien Piquerez f0efbf0f5d Make BSP compile fail after random exception 2021-06-25 10:40:32 +02:00
Adrien Piquerez 74ff1b0a4a Fill error message when BSP task fails 2021-06-24 17:00:22 +02:00
Samuel CLARENC c9562cb1c3
Merge branch 'develop' into bspBuildTargetResources 2021-06-21 16:52:58 +02:00
Samuel CLARENC f3ec202a06 Add resourcesProvider flag to BuildServerCapabilities in BSP contra 2021-06-21 16:51:34 +02:00
Samuel CLARENC a0e3d89855 Implement BSP buildTarget/resources command 2021-06-21 16:51:34 +02:00
Amina Adewusi 24bb4de35e
Merge branch 'develop' into remote-cache 2021-06-18 20:13:55 +01:00
Amina Adewusi f82c0c4c5f fixes remote caching not managing resource files
What is the problem?
When using remote caching, the resource files are not tracked so if they
have changed, pullRemoteCache will deliver both the old resource file
as well as the changed one.

This is a problem, because it's not the behaviour that our users will
expect and it's not in keeping with the contract of this feature.

Why is this happening?
Zinc, sbt's incremental compiler, keeps track of changes that have
been made. It keeps this in what is called the Analysis file.
However, resource files are not tracked in the Analysis file, so
remote caching is not invalidating the unchanged resource file in
place of the latest version.

What is the solution?
PullRemoteCache deletes all of the resources files. After this,
copyResources is called by PackageBin, which puts the latest
version of the resources back.
2021-06-18 20:10:07 +01:00
eugene yokota a9402a61ae
Merge pull request #6538 from adpi2/fix-mkScalaInstance
Fix compiler class loader jars
2021-06-12 01:00:22 -04:00
Adrien Piquerez 75a55a10df fix compiler class loader jars 2021-06-11 10:41:40 +02:00
Adrien Piquerez cbc1c87974 Disconnect BSP server when build/exit 2021-06-09 18:01:09 +02:00
eugene yokota f2f884436b
Merge pull request #6499 from pikinier20/scaladoc-scalac-options
Add missing scalac options to scaladoc task configuration
2021-05-30 22:06:32 -04:00
Ethan Atkins 7dbf7978e9 Disable multiple main class warning w/ qualified key
If the user runs foo/runMain in a project with multiple main classes,
sbt will still warn the user about their being multiple main classes
even though this is a pointless warning since the user either is running
runMain which requires a main class. The run task is also excluded since
by default it prompts the user with a main class selector. The previous
logic for doing this filtering was bad because it only looked at the
first command in a sequence and couldn't handle the foo/runMain case
since it was looking for an exact match with `run` or `runMain`. This
commit relaxes those restrictions to look at all of the strings in the
command as well as splitting the string to check if the last part of the
key ends in run or runMain. This logic could theoretically be incorrect
if the user wrote an input task that was expecting run or runMain as
user input but even in that case the only consequence would be that they
wouldn't see the multiple main class warning which generally isn't all
the helpful unless you are packaging a jar that expects there to be only
one main class. It seems unlikely that that the user would be running a
custom input task that is both packaging a jar and expecting run or
runMain as input strings.
2021-05-30 14:48:05 -07:00
Matthias Kurz ee460e0043
Upgrade semanticdb to newest version which supports Scala 2.12.14 2021-05-28 21:44:10 +02:00
Matthias Kurz fbfc272171
Scala 2.12.14 / 2.13.6 2021-05-28 18:13:28 +02:00
Filip Zybała 236f419f88 Add condition preventing errors on 3.0.0. Add scripted test for running doc on Scala.js project 2021-05-27 14:56:47 +02:00
eugene yokota 1ae2d9d59c
Merge pull request #6517 from Nirvikalpa108/fix-nowarn
Fix @nowarn annotation in old sbt plugin style
2021-05-21 13:58:16 -04:00
Amina Adewusi 2e6fb3f2a5 Fix nowarn in both old & new sbt plugin styles
Fixes #6430.

What is the problem?
As detailed in #6430, the @nowarn annotation was not suppressing
warnings, even after the first attempt to fix this in PR#6431.

This first PR fixed the problem for projects using
enablePlugins(SbtPlugin), but not for those using sbtPlugin := true.

Why is this a valuable problem to solve?
The annotation was not working as users would expect.

What is this solution?
I have moved the scalacOptions change from SbtPlugin.projectSettings
to the scalacOptions in the JvmPlugin settings.

Has this been tested?
Yes, a test has been added. Also, this branch was tested successfully
on the twinagle repo (https://github.com/soundcloud/twinagle/pull/224).
2021-05-21 18:11:24 +01:00
Brice Jaglin 622eabfa95 dedup unmanagedSourceDirectories for Scala 3
For Scala 3, scalaBinaryVersion == epochVersion
2021-05-15 22:14:51 +02:00
Adrien Piquerez ce59ea754a expose makeScalaInstance 2021-05-10 11:32:33 +02:00
Eugene Yokota 25148899a1 Skip zip file manipulation if the package is empty
Fixes https://github.com/sbt/sbt/issues/6497
2021-05-09 18:55:04 -04:00
eugene yokota e1766d9a3d
Merge pull request #6500 from Nirvikalpa108/correct-client-arg
make -client the same as --client
2021-05-07 14:48:37 -04:00
Amina Adewusi f12b0baef0 make -client the same as --client
The problem was that -client was different from --client, which
makes for a confusing user experience. So, this change makes
them the same and re-names -client to --java-client. The value
of this is that hopefully -client and --client being the same
feels more logical to users.
2021-05-07 16:07:42 +01:00
Filip Zybała fcab06bd3d Add missing scalac options to scaladoc task configuration 2021-05-07 11:58:18 +02:00
Adrien Piquerez a07bd46cdb Add util-interface to SbtInterfaceLoader 2021-05-03 11:18:12 +02:00
eugene yokota 9b6d4b5390
Merge pull request #6488 from eed3si9n/wip/new
Fix new command leaving behind target, take 2
2021-05-02 21:52:44 -04:00
Eugene Yokota 1c8b55107d Fix new command leaving behind target, take 2
Fixes #2835

Somehow the fix in #4033 due to various initialization.
Here's a bit more aggressive rebasing of the base directory
that should fix the `project` and `target` directory created during sbt
new.
2021-05-02 20:48:10 -04:00
Adrien Piquerez ded074ac75 Expose Defaults.makeScalaInstance 2021-05-01 20:29:42 +02:00
Jason Pickens 223ab2b310
Remove configuration scope from runner settings 2021-04-20 15:35:06 +12:00
Guillaume Galy 8849bfbcd5 Retain classifiers for transitive dependencies when publishing to Ivy 2021-04-19 15:24:45 +02:00
kenji yoshida 61f4ed1017
fix typo 2021-04-16 15:48:53 +09:00
Philippus Baalman 4bf7f3a877
Fix typo 2021-04-12 21:02:14 +02:00
eugene yokota 627f72ef87
Merge pull request #6425 from ashleymercer/issues/2853-junit-config
Allow output directory for JUnitXmlTestsListener to be configured
2021-04-12 10:15:56 -04:00
Ashley Mercer b37fc6d5be Allow JUnitXmlTestsListener output directory to be configured
Add `testReportsDirectory` setting to allow output directory for
JUnitXmlTestsListener to be configured.

Add `testReportSettings` which provides defaults values:

- by default this uses the build configuration name as a prefix so
  `target/test-reports` for `Test` config, but `target/it-reports`
  for `IntegrationTest` (previously this was hardcoded to always
  use `target/test-reports`). To override this set e.g.

  `Test / testReportsDirectory := target.value / "my-custom-dir"`

- the `JunitXmlTestsListener` is now only attached to the `Test`
  and `IntegrationTest` configs by default (previously it was added
  to the global configuration object). Any configs which inherit
  from one of these will continue to have the listener attached;
  but completely custom configurations will need to re-add with:

  `project.settings(testReportSettings)`

Fixes #2853
2021-04-12 12:17:50 +01:00
Adrien Piquerez 7ac35d11d9 Fix MetaBuildLoader 2021-04-07 17:11:38 +02:00