Commit Graph

3089 Commits

Author SHA1 Message Date
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
Adrien Piquerez 56746d5792 Fix unused nowarn in sbt plugins 2021-04-06 15:45:52 +02:00
Adrien Piquerez b0ee80e34e Use full Scala 3 version in crossTarget 2021-04-01 10:23:38 +02:00
Guillaume Martres 24dba24b2a Fix Scala 2.13-3.0 sandwich on Scala >= 3.0.0
The binary version of Scala >= 3.0.0 will be 3, but the logic was
hardcoded for 3.0.
2021-03-31 13:54:40 +02:00
Eugene Yokota 2a3a0f5594 Fixes clean not cleaning files added to cleanFiles
Fixes #6395

The current code assumes cleanFiles are only directories. This fixes that.
2021-03-29 00:23:50 -04:00
eugene yokota 1cb23c843b
Merge pull request #6417 from mkurz/fix_warn
Add missing versionScheme to warning
2021-03-28 16:43:07 -04:00
Josef Vlach 0c7bc71403
Instantiate only test runners needed by current TestDefinitions 2021-03-28 20:58:18 +01:00
Matthias Kurz dc2865d407
Add missing versionScheme to warning 2021-03-28 21:31:48 +02:00
Adrien Piquerez 54c27d575b Fix internal dependency configurations 2021-03-23 15:58:23 +01:00
Eugene Yokota 01e3d9e9d8 Use LOCALAPPDATA or $HOME/AppData/Local on Windows
Fixes https://github.com/sbt/sbt/issues/5206

Problem
--------
Coursier uses directories-jvm to determine its default cache directory.
Currently directories-jvm shells out to Powershell to call the [Known Folders API](https://docs.microsoft.com/en-us/windows/win32/shell/knownfolderid), which doesn't work in various environments, and instead of an error, it apparently returns `null/Coursier/cache` as the directory name.

Solution
--------
With due respect to the heroic effort directories-jvm is making to comply to the directory standards on all operating systems, including that of Microsoft, I don't think the majority of the sbt users care exactly where that directory is as long as it is well-documented, and calculated in a fast and predictable way.

Instead of shelling out to Powershell, or using JNI, to hit the Known Folders API, I propose we first look at `LOCALAPPDATA` environment variable. When it is not found, it will fall back to `$HOME/AppData/Local`. Per discussion in https://github.com/dirs-dev/directories-jvm/issues/43, `LOCALAPPDATA` environment variable may NOT represent the one-true Known Folders API value of the AppData directory in case the user happened to have set the `LOCALAPPDATA` environmental variable. For the purpose of picking a directory for Coursier cache, I don't find that to be a problem because it will be faster, more reliable, and predictable.
2021-03-21 20:50:03 -04:00
eugene yokota b8691cba88
Merge pull request #6397 from arixmkii/bsp-env-var
Environment variables support in BSP debug session
2021-03-19 11:45:01 -04:00
Arthur Sengileyev 75a5135417 Adding env vars at ScalaMainClass creation time 2021-03-18 23:13:03 +02:00
Adrien Piquerez 332b53735e Silence unused-nowarn in meta-build 2021-03-18 18:27:26 +01:00
Arthur Sengileyev 970ce22aca Environment variables support in BSP debug session 2021-03-15 13:41:50 +02:00
eugene yokota 3d784b9217
Merge pull request #6378 from adpi2/bsp-logging
Improve BSP processing logs
2021-03-09 09:46:31 -05:00
Adrien Piquerez 93afa7e892 Improve BSP processing logs
The processing log is sent when a command issued by a request is being
processed, if the request has not yet been responded. In particular,
the processing log of sbtReportResult is filtered out if the client has
already received a response.

The processing log severity is the lowest so that it can be ignored by
the BSP client.
2021-03-09 10:18:12 +01:00
Ethan Atkins 7dc5590190 Don't use deprecated `in` inside of macros
The inputFileChanges, inputFiles and outputFiles macros all used the now
deprecated `in` syntax, which causes warnings for builds that use these
apis. SlashSyntax doesn't naively work in these macros so it was easier
to just reimplement the logic in this file.

Fixes #6330
2021-03-08 10:54:01 -08:00
Matthias Kurz 6fbed26d22 Make sure to also pass absolute sourceFile to sourceMappers 2021-03-07 14:44:42 -05:00
eugene yokota ff6cbf2e1f
Merge pull request #6351 from steinybot/scripted-publish-deps
Publish all plugin dependencies
2021-03-04 23:35:59 -05:00
Ondra Pelech 81457e60ec
Give an explanation in case of ServerAlreadyBootingException (#6353)
Give and explanation in case of ServerAlreadyBootingException
2021-03-04 23:21:42 -05:00
eugene yokota 5f24664c0d
Merge pull request #6355 from marcospereira/updates/semanticdb-4.4.10
Update semanticdb to version 4.4.10
2021-03-04 20:17:06 -05:00
Marcos Pereira c9941aeabc
Update semanticdb to version 4.4.10 2021-03-04 16:38:00 -05:00
Matthias Kurz de313bbdde
Never set a default for sourcePositionMappers 2021-03-04 22:30:35 +01:00
Jason Pickens 6e0da94d91
Publish all plugin dependencies 2021-03-04 12:09:12 +13:00
eugene yokota 0972b7fa17
Merge pull request #6336 from adpi2/fix-tasty-test
Fix TastyFiles added twice in Test
2021-02-24 13:28:51 -05:00
eugene yokota c5eda8c7ce
Merge pull request #6332 from adpi2/fix-scala3-doc
Fix scaladoc resolution without JCenter
2021-02-24 11:25:20 -05:00
Adrien Piquerez c1e7b9c3f8 Fix TastyFiles added twice in Test 2021-02-24 15:58:31 +01:00