Commit Graph

571 Commits

Author SHA1 Message Date
Eugene Yokota e854909592 Use JAVA_HOME when available 2024-12-15 14:59:02 -05:00
Eugene Yokota 0906b2d7ac fix: Use JDK path, not JRE path
**Problem**
There are a few places where javaHome or java path is set,
using java.home system property. The problem is that it points to JRE,
not JDK, so it would break on Java compilation etc.

**Solution**
If the path ends with jre, go up one directory.
2024-12-15 02:47:35 -05:00
Eugene Yokota c4aebf5744 feat: Support glob expressions in scripted
**Problem**
It's currently not easy to write a scripted test that works on
both sbt 1.x and 2.x when you want to write exists test under target.

**Solution**
Since we can only use the file system (and not evaluate Scala version etc)
1. this implements glob expression support in `exists`, `absent`, and `delete`.
2. this also introduces `||` operator that would mean a or b.
2024-12-08 23:40:27 -05:00
xuwei-k f11d9d76f0 remove more implicit. use given and using 2024-11-18 14:39:00 +09:00
xuwei-k d193c990d1 remove implicit params. change to using 2024-11-18 06:49:22 +09:00
eugene yokota 312f1a0782
Merge pull request #7888 from xuwei-k/Alternative-CommandBuilder
[2.x] use `extension` instead of `implicit`
2024-11-16 21:03:28 -05:00
xuwei-k 4da8d942ce use extension instead of implicit 2024-11-17 07:38:40 +09:00
friendseeker c47d01738f
Remove jansi from WindowsInputStream 2024-11-07 22:08:00 -08:00
adpi2 aa5e252d22
Merge pull request #7866 from adpi2/2.x-reduce-heap
[2.x] Reduce number of long-living instances to speed up loading
2024-11-06 08:44:03 +01:00
Adrien Piquerez 8b5eaa2cd5 Cache delegates during Load 2024-11-04 10:43:42 +01:00
xuwei-k 07ae450e14 delete deprecated methods 2024-11-04 17:26:55 +09:00
Eugene Yokota 56941dac04 refactor: Update Scala 3 syntax 2024-10-27 23:55:30 -04:00
Eugene Yokota 14f7d29afc Contraband 0.7.0 2024-10-27 16:21:18 -04:00
xuwei-k 22f5c798f5 use to{Int, Long, Double}Option methods 2024-10-23 12:22:40 +09:00
xuwei-k ec70bae39a use extension instead of implicit class 2024-10-23 07:05:38 +09:00
Friendseeker cdab4c10be Scalafmt 2024-10-21 21:38:59 -07:00
Friendseeker b1c4c09a7f Fix bunch more compiler errors 2024-10-21 21:38:59 -07:00
Friendseeker f87ffc8042 Fix CI compile errors 2024-10-21 21:38:59 -07:00
friendseeker e0d9493a93
Bump CI to JDK 21 2024-10-19 21:08:20 -07:00
xuwei-k 6bf5b8b30f Update contraband sources 2024-10-18 20:34:44 +09:00
Friendseeker e35d14aa46 Drop scala212, scala213 for utils 2024-10-11 17:45:59 -07:00
xuwei-k cfb9ffea95 remove deprecated `[this]` qualifier
https://docs.scala-lang.org/scala3/reference/dropped-features/this-qualifier.html
2024-10-03 21:16:48 +09:00
xuwei-k 7279f659e0 Update .scalafmt.conf. re-format 2024-09-07 16:37:49 +09:00
Eugene Yokota c81d269ed2 Merge branch '1.10.x' into wip/merge-1.10.x 2024-05-07 04:39:25 -04:00
Stefan Zeiger da79479ff7 Fix logging of raw strings
sbt passes raw string messages in `ConsoleAppenderFromLog4J` to `StringFormatterMessageFactory`. This is wrong because these strings are pre-formatted and should not be processed again for formatting. There is no way to pass parameters to them anyway. This causes problems when the raw strings contain characters that `StringFormatterMessageFactory` wants to interpret.

For example, when using `-Ystatistics`:

```
ERROR StatusConsoleListener Unable to format msg:   nscprofiling                : 1 spans, ()7.543ms (0.3%)
java.util.UnknownFormatConversionException: Conversion = ')'
at java.base/java.util.Formatter.checkText(Formatter.java:2732)
at java.base/java.util.Formatter.parse(Formatter.java:2718)
at java.base/java.util.Formatter.format(Formatter.java:2655)
at java.base/java.util.Formatter.format(Formatter.java:2609)
at java.base/java.lang.String.format(String.java:2938)
at org.apache.logging.log4j.message.StringFormattedMessage.formatMessage(StringFormattedMessage.java:121)
at org.apache.logging.log4j.message.StringFormattedMessage.getFormattedMessage(StringFormattedMessage.java:89)
at sbt.internal.util.Appender.$anonfun$appendMessage$1(ConsoleAppender.scala:522)
...
```
2024-05-02 18:31:23 +02:00
Adrien Piquerez 12e9267e1e Remove more unused 2024-03-05 15:25:25 +01:00
Adrien Piquerez 369e647008 Fix scala 2 compat with -Xsource:3 and scala-collection-compat 2024-03-05 13:32:15 +01:00
Adrien Piquerez 0458e8063d Adapt -Wunused 2024-03-05 11:23:00 +01:00
Adrien Piquerez c15a4031a9 Fix or mute warnings 2024-03-05 10:39:00 +01:00
Adrien Piquerez 5425e066a0 Fix SbtRefactorings 2024-02-13 14:01:26 +01:00
Adrien Piquerez e18ddb1666 Fix resolution of * on String 2024-02-07 11:47:22 +01:00
Matthias Kurz 2d7f087753
Add missing logger methods that take Java Supplier 2023-12-05 10:15:51 +01:00
Adrien Piquerez ba6daf1521 Fix deadlock in Terminal init 2023-11-22 15:51:28 +01:00
Adrien Piquerez 99385881f0 ignore discarded Unit 2023-11-22 11:51:15 +01:00
Adrien Piquerez 1f33b27b03 Deactivate cross-compilation except for utils
Lower util projects are used by LM and Zinc
2023-11-22 11:51:15 +01:00
Adrien Piquerez 73e3b43683 Introduce util-core to cross-compile util-logging 2023-11-14 11:43:12 +01:00
Heikki Vesalainen c07ee8411e JLine 3.24.1 and JAnsi 2.4.0. 2023-11-01 21:25:24 +02:00
Martin Duhem f03320047e
Keep logger names in hash set
Previously, the list of logger names that have been created in a given
context with Log4J was being kept in a `Vector`. As a result, subsequent
calls to `logger` on a `Log4JLoggerContext` with the same logger name
would introduce duplicates in the list. Note that Log4J's logger
configuration would not allow duplicates, and only one configuration
object for a given logger name will exist. The duplicates in the list of
logger names are therefore unnecessary.

With this patch, the logger names will be kept in a `HashSet`.

Since the logger names are only used to remove the logger configurations
after the logger context is closed, and the logger configurations
contain no duplicates, removing duplicate logger names should not cause
any issue.
2023-09-25 17:40:12 +02:00
xuwei-k 6c032b8283 some trivial refactoring
- remove unused type params
- use `withFilter` if possible
- use `collectFirst` instead of `collect` and `headOption`
- use `length` instead of `size` if `Array` or `String`
- use `foreach` instead of `map`
2023-06-25 08:57:41 +09:00
xuwei-k 2edb4dcbb6 fix typo 2023-06-24 20:05:52 +09:00
Julien Richard-Foy 72bfb3f45a Transfer copyright to Scala Center 2023-06-20 16:39:07 +02:00
​Andrzej Ressel 4cf2b7269d Cache echoEnabled 2023-06-03 22:44:19 +02:00
Eugene Yokota 9d87f3f596 Add concrete impl for Action 2023-05-14 14:06:46 -04:00
Chris Kipp fa8dfd225d fix: get rid of the `FileChanges` abstraction
I don't believe this is actually needed. We can simplify the
`WorkspaceEdit` further and put together the mapping for `changes`
according to the LSP spec later on down the line. This will allow us to
remove the need for the `URI`, which is problematic.

closes #7252
2023-05-14 09:52:16 +02:00
eugene yokota cf6fac7692
Merge pull request #7242 from ckipp01/action
feat: add in `actions()` to `Problem`
2023-05-12 00:03:49 -04:00
Chris Kipp aeb168aa93 feat: add in `actions()` to `Problem`
This adds a new field into `xsbti.Problem` allowing for the compiler to
forward "actions" that can address diagnostics. The idea largely mimics
a very minimal `CodeAction` that can be found in the [LSP
Spec](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#codeAction)
in order to ensure it will work with a variety of difference clients
that use LSP, and those that don't. In the future the `WorkspaceEdit`
that was created here could also be expanded to handle more advanced
changes, aka resource operations, like creating/moving/deleting files.
For now we only focus on a small subset of these features.
2023-05-10 14:14:13 +02:00
Chris Kipp 300b770ea4 fix: deprecate misspelled diagnosticRelatedInforamation and add in a new one
Relates to https://github.com/sbt/sbt/discussions/7063
2023-05-08 13:38:15 +02:00
Eugene Yokota 51591bde5b Make new more interactive
If the terminal supports ANSI control sequence,
this displays the template list in an interactive way.
The focused template is rendered reversed,
and arrow key can be used to move the focus up/down.
2023-05-06 20:07:47 -04:00
Adrien Piquerez da4ce68142 Fix dead lock between LoggerContext and Terminal 2023-03-28 14:08:15 +02:00
Eugene Yokota e5dd518deb Adjust to changes in develop branch 2023-01-16 00:23:05 -05:00