Commit Graph

3221 Commits

Author SHA1 Message Date
Eugene Yokota 4c96c087c0 Fix typo 2023-05-03 21:20:16 -04:00
eugene yokota d8725e245e
Merge pull request #7228 from eed3si9n/wip/new
sbt new, a text-based adventure
2023-05-01 00:27:47 -04:00
Eugene Yokota a033c37d6e sbt new, a text-based adventure
**Problem**
You want to get started with sbt, and you don't know
which template to get started with.

**Solution**
This implements an interactive menu on `sbt new` command
when invoked without an argument to list template candidates.

The first option is `scala/toolkit.local`, which locally creates
an sbt build without calling out to Giter8 (GitHub).
2023-04-30 23:36:06 -04:00
Eugene Yokota f98c4fff3b Update modules 2023-04-30 00:56:11 -04:00
eugene yokota df738abbbd
Merge pull request #7215 from dragos/expose/external-hooks-public
Expose RunProfiler to the build
2023-04-25 11:49:28 -04:00
Iulian Dragos 6dfebc689b
Add a key for Zinc listeners.
Expose what the incremental compiler is doing behind the scenes. The RunProfiler interface has been part of Zinc for a while, but this allows the build itself, or an Sbt plugin, to hook their own implementation.

We expose a list of such listeners to avoid plugins stepping on each other and replacing an existing listener.
2023-04-25 12:00:02 +02:00
Iulian Dragos 9301bc2589
Make externalHooks public
This key has been added in 4061dabf4d but it is only available to Sbt itself. Since ExternalHooks is a Java interface, defined in Zinc for a while and fairly stable, I think this should be safe to do.

My main  motivation is to allow installing an InvalidationProfiler from an Sbt plugin, thus gaining access to zinc recompilation decisions. See related PR https://github.com/sbt/zinc/pull/1181
2023-04-18 15:13:09 +03:00
adpi2 e1b0b25418
Merge pull request #7201 from adpi2/sbt-plugin-toggle
[1.9.x] Add `sbtPluginPublishLegacyMavenStyle` to publish to Artifactory
2023-04-12 09:55:13 +02:00
Adrien Piquerez 9e0a728c58 Add sbtPluginPublishLegacyMavenStyle to publish to Artifactory
Artifactory rejects the legacy artifacts of sbt plugin.
It is now possible to publish to Artifactory
by turning `sbtPluginPublishLegacyMavenStyle` off.
2023-04-11 16:56:24 +02:00
Adrien Piquerez 5436ed5ef8 Fix cross-publish sbt plugin to Maven 2023-04-11 11:43:44 +02:00
eugene yokota 4a470dcd17
Merge pull request #7148 from armanbilge/feature/release-notes-url
Add `releaseNotesURL` setting
2023-03-07 10:37:46 -05:00
Matthew de Detrich 714e4175b3
Improve grammar on skip key description 2023-03-04 09:19:17 +01:00
Matthew de Detrich 2a332a56a9
Make skip work on publishLocal 2023-03-03 16:09:44 +01:00
Arman Bilge ed29e35f41 Bump lm, use release notes key 2023-02-28 06:08:13 +00:00
Adrien Piquerez 8020ec4d7c Smooth transition to valid Maven pattern of sbt plugin
For an sbt plugin, we publish two POM files, the legacy one, and the
new Maven compatible one. The name of the new POM file contains the sbt
cross-version _2.12_1.0. The format of the new POM file is also slightly
different, because we append the sbt cross-version to all artifactIds of
sbt plugins. Hence Maven can resolve the new sbt plugin POM and its
dependencies.

When resolving an sbt plugin, we first try to resolve the new Maven POM
and if it fails we fallback on the legacy one. When parsing the new POM
format, we remove the sbt cross-version from all artifact IDs so that
there is no mismatch between old and new format of dependencies.
2023-02-22 10:09:26 +01:00
Arman Bilge 11ea11e382
Fix
Co-authored-by: Marco Zühlke <mzuehlke@gmail.com>
2023-02-12 22:54:19 -08:00
Arman Bilge 3cde7f8e07 Missing comma 2023-02-12 23:27:14 +00:00
Arman Bilge 3ce8008ae7 WIP support for `releaseNotesURL` 2023-02-10 06:19:39 +00:00
Adrien Piquerez 9b4d5a5a5a Fix reporting Java diagnostics through BSP
Java diagnostics don't have a pointer but we should report them.
Copied implementation from Bloop to translate the position of an
xsbti.Problem to a BSP range.
2023-01-27 10:21:44 +01:00
Eugene Yokota b0b7705739 Fixes Debian 11 compat
Fixes https://github.com/sbt/sbt/issues/7118

Problem
-------
sbtn 1.8.1 was built using ubuntu-latest, which meant picking up newer
glibc.

Solution
--------
This downgraded the ubuntu machine to build sbtn.
2023-01-04 17:19:29 -05:00
Matthias Kurz ac638a764d
Use latest sbtn 2023-01-03 16:02:18 +01:00
Matthias Kurz 5fa46859d2
Make use of sbtn aarch64 binary where possible 2023-01-03 12:41:49 +01:00
Eugene Yokota 39dc13668f lm-coursier-shaded 2.0.12
https://github.com/coursier/sbt-coursier/releases/tag/v2.0.12
2022-10-30 18:25:04 -04:00
Nabil Abdel-Hafeez e7a847615a
Add zio-test TestFramework to default test frameworks 2022-10-16 22:42:53 +02:00
frosforever d366b77b23 Protect against missing edges in graph by using map get vs apply 2022-10-02 14:04:50 -04:00
Eugene Yokota 2a61fb35f9 Fix /tmp/.sbt/ collision for domain socket
Problem
-------
Fixes https://github.com/sbt/sbt/issues/7013
In a shared environment, multiple users will try to create
`/tmp/.sbt/` directory, and fail.

Solution
--------
Append a deterministic hash like `/tmp/.sbt1234ABCD` based
on the user home, so the same directory is used for the given
user, but each user would have a unique runtime directory.
2022-10-02 12:45:30 -04:00
eugene yokota f0cb420fe2
Merge pull request #7031 from gontard/backport_6903_to_1.8.x
Backport #6903 to 1.8.x
2022-09-30 11:43:20 -04:00
gontard cc44169fe0 Fix testQuick on changed function in object
Fix https://github.com/sbt/sbt/issues/5504
2022-09-30 11:25:31 +02:00
gontard 89acd3eed1 Improve log for not found remote cache artifact
Before
remote cache not found for 0.0.0-7c40144bd1c774e6

After
remote cache artifact not found for org.gontard:sbt-test:0.0.0-7c40144bd1c774e6 Some(cached-compile)
2022-09-30 11:07:20 +02:00
Eugene Yokota b00792a3a7 Scala 2.12.17
This bumps up scala-xml to 2.x.
2022-09-17 04:09:52 -04:00
Eugene Yokota 573cd2de81 Giter8 0.15.0 by default 2022-09-11 13:03:43 -04:00
Devin Fisher 9f9b08edbd refactor printing error to an in-function function 2022-08-10 10:08:49 -04:00
Devin Fisher 5874ad920e add output when book server socket fails to create 2022-08-10 10:08:42 -04:00
eugene yokota ab59e4c6ba
Merge pull request #6998 from ckipp01/captureCodeBsp
feat: start forwarding diagnosticCode via BSP
2022-08-10 10:03:40 -04:00
Chris Kipp 15a45cb3c0 feat: start forwarding diagnosticCode via BSP
This change is a continuation of the work that was done in
https://github.com/sbt/sbt/pull/6874 to allow the Scala 3 compiler to
forward the `diagnosticCode` of an error as well as the other normal
things. This change in dotty was merged in
https://github.com/lampepfl/dotty/pull/15565 and also backported so it
will be in the 3.2.x series release. This change captures the
`diagnosticCode` and forwards it on via BSP so that tools like Metals
can can use this code.

You can see this in the BSP trace now for a diagnostic:

For example with some code that contains the following:

```scala
val x: Int = "hi"
```

You'll see the code in the BSP diagnostic:
```  "diagnostics": [
    {
      "range": {
        "start": {
          "line": 9,
          "character": 15
        },
        "end": {
          "line": 9,
          "character": 19
        }
      },
      "severity": 1,
      "code": "7",
      "source": "sbt",
      "message": "Found:    (\u001b[32m\"hi\"\u001b[0m : String)\nRequired: Int\n\nThe following import might make progress towards fixing the problem:\n\n  import sourcecode.Text.generate\n\n"
    }
  ]
```

Co-authored-by: Adrien Piquerez <adrien.piquerez@gmail.com>
Refs: https://github.com/lampepfl/dotty/issues/14904
2022-08-09 19:02:52 +02:00
Adrien Piquerez 634e8799e7 Catch ClosedChannelException in background job logger
We want the background job to stay alive even if its terminal
has been closed and we cannot write to it anymore
2022-08-05 14:45:38 +02:00
Adrien Piquerez 592086b889 Don't use ProxyTerminal in background job
If we use the ProxyTerminal in the background jobs, the logs
would be spread across different terminals, switching from active
client to active client. We want the logs to stick
to the client that started the job.
2022-08-04 16:48:13 +02:00
Adrien Piquerez 6bcda6684a Use BackgroundJobService context instead of MainLoop context
A new context is created and closed for each state of the MainLoop.
But the context of the backgroundJob must stay alive.
So we use a context that is owned by the BackgroundJobService.
It creates a new logger for each background job and cleans it when
the job stops.
2022-08-04 16:48:13 +02:00
Krzysztof Pado 2bffb2731e Add support for BSP's buildTarget/outputPaths method 2022-08-03 10:13:48 +02:00
eugene yokota aad0464138
Merge pull request #6947 from eed3si9n/wip/banner
Banner
2022-07-02 19:20:11 -04:00
Eugene Yokota 31a6c60df3 Banner 2022-07-02 19:07:34 -04:00
Eugene Yokota 05d3d8689b Remove compatibility check from ++
Problem
-------
Since sbt-doge merger `++ <sv> <command1>` has used binary compatibility
as a test to select subproject, but it causes surprising situations like
sbt/sbt#6915, and it blurs the responsibility of YAML file and build
file as the version specified in the version can override the Scala
version test on local laptop.

Solution
--------
This removes the compatibiliy check (backward-only or otherwise),
and require that `<sv>` match one of `crossScalaVersions` using the new
Semantic Version selector pattern.
2022-07-02 18:38:04 -04:00
eugene yokota 6d0ef2093d
Merge pull request #6943 from raboof/more-appropriate-error-when-no-versions-match
Show a more appropriate message when no Scala versions matches
2022-06-28 09:26:06 -04:00
Arnout Engelen 697e3bce51
Show a more appropriate message when no Scala versions matches
When switching scala versions with a wildcard, and no subproject
has a matching version to switch to, show a more appropriate error
message
2022-06-28 14:43:06 +02:00
Arnout Engelen 6a79bdb461
Show a more useful log message when doing a flexible version switch
Suggested by @SethTisue in https://github.com/sbt/sbt/pull/6894#issuecomment-1168042209

Will show multiple lines when different versions are selected for different subprojects.

When no subprojects have a matching Scala version you will get a
'Switch failed' exception anyway, so in that case there is no
change in behavior.
2022-06-28 07:59:13 +02:00
Rui Gonçalves 705d3d58ce Filter incompatible Scala 3 projects in cross switch commands 2022-06-26 22:46:37 -04:00
Arnout Engelen 8973fce1fa
More flexible Scala version switch
By using SemanticSelector instead of custom globbing.

Follow-up on https://github.com/sbt/sbt/pull/6894,
fixes https://github.com/sbt/sbt/issues/6934
2022-06-26 12:43:41 +02:00
eugene yokota 1db7dd328a
Merge pull request #6935 from eed3si9n/wip/temp-directories
[1.7.x] Fix sbt trying to delete /tmp on ARM Macs
2022-06-25 20:23:39 -04:00
Eugene Yokota 87dc5da93a Fix sbt trying to delete /tmp on ARM Macs
Problem
-------
There's a bug in ipcsocket cleanup logic that effectively
tries to wipe out /tmp.

Workaround
----------
We should fix the underlying bug, but we can start by
explicitly configuring the temp directories ipcsocket uses.

Ref https://github.com/sbt/sbt/issues/6931
2022-06-25 18:58:19 -04:00
Kamil Podsiadlo 7921cab7e3 fix: publishing bsp diagnostics
* do not publish bsp diagnostics if there were and there are no problems
* publish diagnostics if problems needs to be updated
2022-06-25 11:14:51 +02:00