Commit Graph

3732 Commits

Author SHA1 Message Date
Adrien Piquerez e5cedbe56b Fuse Info in Task to reduce instances 2024-11-12 17:05:20 +01:00
Adrien Piquerez 6c226a2afd Reduce settings created by Defaults 2024-11-12 11:51:42 +01:00
Adrien Piquerez 8406fc86a8 Reduce settings created by ProjectMatrix 2024-11-12 11:51:42 +01:00
Adrien Piquerez 07ac8625e5 Reduce settings created by dependency-tree plugins 2024-11-12 11:51:31 +01:00
Eugene Yokota 258a831b03 Use ScalaInstance from update
**Problem**
doc task currently doesn't work.

**Solution**
For now turn off the optimized ScalaInstance
2024-11-12 03:44:52 -05:00
eugene yokota 583939fc3c
Merge pull request #7874 from xuwei-k/ClassLoaderWarmup-scala-2-universe
[2.x] update ClassLoaderWarmup.scala
2024-11-06 03:47:09 -05:00
xuwei-k 6e4c2ea275 update ClassLoaderWarmup.scala 2024-11-06 14:17:13 +09:00
Adrien Piquerez 2f726cddf0 Add comments 2024-11-05 11:36:18 +01:00
Friendseeker 8ce6c1b47e Pass `useConsistent` to `staticCachedStore` 2024-11-04 13:21:08 -08:00
Adrien Piquerez 8b5eaa2cd5 Cache delegates during Load 2024-11-04 10:43:42 +01:00
Eugene Yokota f8280f14c8 Fix ++ with a command argument
**Problem**
sbt 1.10.0 added support for ++ command with external reference,
but broke ++ takes an aggregate command with slash.

**Solution**
This fixes the parser
2024-11-03 14:42:10 -05:00
friendseeker fae2bcc01b
Add documentation & deduplicate implementation 2024-10-29 21:40:51 -07:00
Friendseeker 92d4cfa690 Replace nnbsp with regular space 2024-10-29 17:43:33 -07:00
Friendseeker 828dc04808 Migrate all usages of `System.console == null` 2024-10-28 18:25:16 -07:00
eugene yokota 64f0acf05f
Merge pull request #7838 from Friendseeker/sbt-7017
[1.x] Pass reload action for `watchOnTermination` callback
2024-10-28 02:23:38 -04:00
friendseeker 6d4d2161b2
Set correct action for onTermination callback 2024-10-27 22:43:44 -07:00
eugene yokota 4e15180596
Merge pull request #7830 from Friendseeker/remove-early-output-version
[1.x] Use generic early output file name
2024-10-28 01:12:58 -04: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
friendseeker 7d674f6c93
Throw when template not found 2024-10-26 22:10:48 -07:00
Friendseeker 4beb78b260
Adopt PR feedbacks 2024-10-26 16:24:45 -07:00
xuwei-k 6922915949 use extension instead of implicit class 2024-10-26 09:05:27 +09:00
friendseeker 5e7fe0b158
Use more generic early output file name 2024-10-24 22:00:51 -07:00
eugene yokota 36fb500f8c
Merge pull request #7811 from Friendseeker/use-jline-jni
[1.x] Use `jline-terminal-jni` to replace deprecated Jansi & JNA Provider
2024-10-23 10:14:39 -04:00
philippus 1ba63a1c07
Deprecate useJCenter key 2024-10-23 07:56:00 +02:00
xuwei-k 7ecae27b3d use extension in OptionSyntax 2024-10-23 13:29:30 +09:00
xuwei-k 34832a1c3e delete sbt.internal.CompatParColls 2024-10-23 08:47:38 +09:00
xuwei-k ec70bae39a use extension instead of implicit class 2024-10-23 07:05:38 +09:00
Friendseeker 0e85726858 Use JNI to replace deprecated Jansi & JNA 2024-10-22 13:05:20 -07:00
xuwei-k 00d01ce215 Update scalafmt 2024-10-22 19:58:21 +09:00
friendseeker 9d5cddd171
Let Consistent Analysis to be opt-in by default 2024-10-21 22:00:25 -07:00
Friendseeker a959acd230 Fix more compile errors 2024-10-21 21:38:59 -07:00
Friendseeker b1c4c09a7f Fix bunch more compiler errors 2024-10-21 21:38:59 -07:00
Friendseeker 375e4f1d2e Fix bunch of unused imports 2024-10-21 21:38:59 -07:00
eugene yokota b8bef9d0b9
Merge pull request #7803 from Friendseeker/template-port-2
[2.x] update to latest versions in TemplateCommandUtil
2024-10-21 21:42:29 -04:00
eugene yokota 32464d382c
Merge pull request #7797 from Friendseeker/bump-scala-2
[2.x] Bump Scala 2.12 to 2.12.20
2024-10-21 21:41:28 -04:00
eugene yokota c39d74d062
Merge pull request #7801 from xuwei-k/delete-useJCenter
[2.x] delete `useJCenter` settingKey
2024-10-21 21:36:15 -04:00
kenji yoshida fe523c50bc update to latest versions in TemplateCommandUtil 2024-10-21 17:10:33 -07:00
xuwei-k 026f78d056 delete useJCenter settingKey 2024-10-22 09:00:05 +09:00
xuwei-k a99398eb84 update sbtResolvers default value 2024-10-22 07:25:22 +09:00
Friendseeker dd16c9b0db Bump Scala 2 to 2.19.20 2024-10-21 15:11:52 -07:00
SlowBrainDude b1b5caa1ca Fix stale BSP diagnostics
The BSP server didn't reset old diagnostic messages sent to BSP clients under
certain circumstances. This commit mitigates this edge case and ensures that
diagnostics for files that previously had compilation problems are properly
reset when fresh diagnostics messages are sent.

The culprit was a mismatch of map keys: Files with problems were sometimes recorded
under an absolute path, but later attempted to be retrieved by virtual path.
2024-10-21 12:18:41 -07:00
James Roper 4b75c97f69 Include ALL sources, and resources in source jar
This follows on from #7470, to include all sources, not just managed and
unmanaged, in the source jar, along with all resources (previously only
unmanaged resources were included).

This means that if, for whatever crazy reason, someone does modify the
`sources` task to include additional sources or filter out sources, rather than
using the managed or unmanaged source mechanisms, their changes will still be
reflected in the source jar.
2024-10-19 23:09:51 -07:00
Eugene Yokota b7a687356f deps: Zinc 1.10.3 2024-10-19 12:15:16 -04:00
xuwei-k 6bf5b8b30f Update contraband sources 2024-10-18 20:34:44 +09:00
xuwei-k 6372c2056a fix old `in` syntax 2024-10-15 14:54:52 +09:00
Adrien Piquerez c82f13c2db Fix csrCacheDirectory and add test 2024-10-14 15:35:14 +02:00
adpi2 6d6cbce465
Merge pull request #7739 from adpi2/2.x-lm-coursier
[2.x] Merge librarymanagement and sbt-coursier
2024-10-11 16:14:17 +02:00
Seth Tisue f06b7622be Scala 2.12.20 (was .19) 2024-10-10 12:53:31 -07:00
Eugene Yokota 65bc3d9722 fix: Resurrect or for tasks
**Problem**
1. `or` is missing
2. `?` should have English method name

**Solution**
1. This resurrects `or`
2. Name `??` as `option`, since `get` is taken
2024-10-10 02:39:52 -04:00
Adrien Piquerez 11002de212 Fix compilation in lm-core, lm-ivy 2024-10-09 13:34:32 +02:00
eugene yokota 713471bcc1
Merge pull request #7734 from Friendseeker/remove-deprecated-thread-id-2
[2.x] Remove deprecated `Thread.getId`
2024-10-06 23:41:27 -04:00
friendseeker 23b769efe6
Remove compile error in GCUtil
runFinalization is going to be removed
2024-10-06 19:09:39 -07:00
friendseeker cfb0c1953b
Remove deprecated Thread.getId call 2024-10-06 19:05:16 -07:00
eugene yokota c5b11a41a9
Merge pull request #7733 from Friendseeker/remove-deprecated-thread-id
[1.x] Remove deprecated `Thread.getId`
2024-10-06 21:48:16 -04:00
friendseeker 0b34b6b406
Remove deprecated Thread.getId call 2024-10-06 18:18:46 -07:00
friendseeker 48ac49d4ca Remove compile error in GCUtil
runFinalization is going to be removed
2024-10-06 18:14:09 -07:00
kenji yoshida b36cf81584
update to latest versions in TemplateCommandUtil 2024-10-06 19:36:12 +09:00
eugene yokota bb32c385fb
[2.x] fix: Append -root to synthetic root (#7716)
**Problem**
I notice that the synthetic root project ends up conflicting with
the projectMatrix on Scala 3, when the name of the matrix
matches the directory name, which is fairly common.

**Solution**
Append `-root` to the root project when there are multiple subprojects found.
2024-10-03 20:19:58 +02: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
eugene yokota eb5c3cfccf
[2.x] refactor: Remove useCoursier setting (drop Ivy) (#7712)
**Problem**
It's been a while since Coursier has been the default library management engine,
and we don't need to support two.

**Solution**
This removes `useCoursier` setting.
2024-10-02 14:33:54 -04:00
eugene yokota 59099cb3af Merge branch 'develop' into wip/query 2024-10-02 01:44:19 -04:00
eugene yokota 3c645bbeeb
Merge pull request #7688 from eed3si9n/wip/non-blocking-run
[2.x] feat: Non-blocking run
2024-10-01 16:47:26 -04:00
Eugene Yokota 8aa740574b Move suspendChannel to EvaluateTask 2024-10-01 03:15:28 -04:00
eugene yokota 683b09afa8
Update main/src/main/scala/sbt/internal/DefaultBackgroundJobService.scala
Co-authored-by: adpi2 <adrien.piquerez@gmail.com>
2024-10-01 00:46:52 -04:00
adpi2 a4ef38c5da
Merge pull request #7708 from adpi2/2.x-fix-7706
[2.x] Fix loading of `ScalaJSPlugin` in `ProjectMatrix`
2024-09-30 15:06:34 +02:00
adpi2 254ff06b6b
Merge branch 'develop' into 2.x-fix-7706 2024-09-30 14:06:23 +02:00
Adrien Piquerez be04ad552d Use projectMatrix caller to resolve plugins 2024-09-30 14:01:46 +02:00
Eugene Yokota 5684a842c3 refactor: Remove sbt 0.13 `in` methods
**Problem**
See https://www.scala-sbt.org/1.x/docs/Migrating-from-sbt-013x.html#Migrating+to+slash+syntax

We should remove `scalacOptions in (Compile, console)` notation. This was deprecated in https://eed3si9n.com/sbt-1.5.0.

**Solution**
This renames `in` to `rescope` for internal usage, and ports the usages to slash.
2024-09-28 19:19:58 -04:00
Eugene Yokota 4e72eaecdf Remove scopedKeyAggregatedSep 2024-09-28 19:11:27 -04:00
Eugene Yokota 89517c642c Merge branch 'develop' into wip/query 2024-09-28 18:55:15 -04:00
Eugene Yokota a6b4cfef12 refactor: Remove old sbt 0.13 shell syntax 2024-09-28 13:51:14 -04:00
adpi2 aa280837c0
Merge branch 'develop' into wip/cross-building 2024-09-26 14:15:05 +02:00
adpi2 1a4cdf4862
Merge pull request #7697 from adpi2/2.x-source-compat
[2.x] Improve backward source compat
2024-09-26 09:28:26 +02:00
Eugene Yokota e61ae80088 feat: queriable slash syntax (sbt query)
**Problem**
We want a more flexible way of aggregating subprojects.

**Solution**
This implements a subproject filtering as a replacement of
the subproject axis in the act command.
2024-09-26 01:20:44 -04:00
Adrien Piquerez eda3a87e76 Resolve conflict between BuildSyntax.dependsOn and Scoped.dependsOn 2024-09-25 16:43:45 +02:00
Adrien Piquerez edd11a283e Make Classpaths.analyzed public 2024-09-25 15:32:04 +02:00
Eugene Yokota 01d5f9c050 feat: plugin cross building as Scala cross building
**Problem**
Since Scala cross building works better than the plugin cross building `^^`,
it was common for plugin authors to encode plugin cross building as Scala cross building
given that we usually have zero or one sbt release in one Scala version.

**Solution**
This brings in the setting into SbtPlugin so plugin authors can cross build
using sbt 2.x.
2024-09-22 17:25:08 -04:00
Eugene Yokota 354dd25988 fix: Fix common settings loading when root is synthetic
**Problem**
The new common settings feature doesn't work when the root isn't created by the user.

**Solution**
This fixes common settings by calling `expandCommonSettingsPerBase(...)` on
the synthetic root's base first.
2024-09-22 16:51:10 -04:00
eugene yokota 864da879c6
Merge pull request #7691 from eed3si9n/wip/root_skip_publish
[2.x] fix: skip publish on synthetic aggregate root
2024-09-22 15:48:39 -04:00
eugene yokota 39e5a1f7eb
Merge branch 'develop' into wip/root_skip_publish 2024-09-22 01:00:03 -04:00
eugene yokota 4ff0477e1e
Merge branch 'develop' into wip/matrix_followup 2024-09-22 00:59:36 -04:00
Eugene Yokota 6491e50449 fix: skip publish on synthetic aggregate root
**Problem**
There's been previous attempt like 1878 to skip publishing of the root,
but it seems like the behavior has regressed at some point in time.

**Solution**
This skips publishing on synthetic aggregate root project.
2024-09-22 00:53:10 -04:00
Eugene Yokota fb4b433db3 Make Scala 3 the default axis, instead of 2.13 2024-09-21 22:40:19 -04:00
Eugene Yokota 1f71332edc runBlock 2024-09-21 01:26:57 -04:00
Eugene Yokota c37b7a1555 feat: Non-blocking run
**Problem**
`run` currently blocks all other commands, such as BSP commands.

**Solution**
`run` no longer blocks the command execution loop.
Instead it pauses the prompt on the current command channel.
2024-09-20 04:00:03 -04:00
Eugene Yokota 2a3ea0837b feat: Rename testQuick to test
**Problem**
We have incremental testing, but it's not used by default.

**Solution**
This renames testQuick to test, and test to testFull.
2024-09-18 22:57:47 -04:00
Adrien Piquerez f08f272d23 [2.x] Fix scripted cache tests 2024-09-18 10:28:11 +02:00
eugene yokota 733b526ac5
Merge pull request #7681 from adpi2/sbt-projectmatrix
[2.x] Merge sbt-projectmatrix
2024-09-17 18:28:35 -04:00
eugene yokota 97823b18b0
[2.x] fix: Invalidate testQuick on test argument changes (#7680)
**Problem**
testQuick currently does not invalidate on argument changes.

**Solution**
This includes test argument digests.

---------

Co-authored-by: adpi2 <adrien.piquerez@gmail.com>
2024-09-17 17:48:53 -04:00
adpi2 6a2c4e56ea
Merge branch 'develop' into sbt-projectmatrix 2024-09-17 17:03:20 +02:00
Adrien Piquerez b59856bcba Merge sbt-projectmatrix 2024-09-17 17:02:30 +02:00
Adrien Piquerez 7c01636efa Move sources from sbt-projectmatrix 2024-09-17 17:00:04 +02:00
eugene yokota cb9a455915
Merge pull request #7676 from eed3si9n/wip/invalidate-on-resource
[2.x] fix: Invalidate testQuick on resource file changes
2024-09-17 10:26:15 -04:00
Eugene Yokota 803e575b8a feat: Use _sbt2_3 suffix
**Problem**
The extra attribute is a vestige from the days when sbt plugins were published on Ivy repos.

**Solution**
This uses normal suffix system.
2024-09-16 00:51:00 -04:00
Eugene Yokota c13c25fdff fix: Invalidate testQuick on resource file changes
**Problem**
testQuick currently does not invalidate on resource file changes.

**Solution**
This includes resource digests into the input.
2024-09-15 18:13:56 -04:00
Eugene Yokota ddeb5dba2c feat: Use _sbt2_3 suffix
**Problem**
The extra attribute is a vestige from the days when sbt plugins were published on Ivy repos.

**Solution**
This uses normal suffix system.
2024-09-15 15:16:10 -04:00
Eugene Yokota 31dd85b7ba fix: Allow scripted to go through
**Problem**
Currently scripted does version checking to block sbt 2.x plugins
to be cross published from sbt 1.x.

**Solution**
Remove the sbt version matching.
2024-09-15 12:28:40 -04:00
Eugene Yokota 4af0024238 refactor: Move scripted-sbt-redux back to scripted-sbt
**Problem**
During sbt 1.x we created scripted-sbt-redux for package name change.

**Solution**
We can move the module back to scripted-sbt, which simplifies things.
2024-09-15 01:58:23 -04:00
Eugene Yokota c8de828830 refactor: Remove unused tasks
**Problem/Solution**
Unused setting ends up showing warnings on startup.
This removes the unused settings from sbt 1.x remote cache.
2024-09-14 23:33:13 -04:00
Eugene Yokota a58950e65e Comment out cleanEvalClasses
**Problem**
reload currently causes NoClassDefFoundError.

**Solution**
Comment out cleanEvalClasses.
2024-09-13 02:03:42 -04:00
eugene yokota a0597e9935
Merge branch 'develop' into wip/testquick 2024-09-12 08:15:04 -04:00
Eugene Yokota e9c04108bd Add extraTestDigests key 2024-09-12 02:23:25 -04:00
Adrien Piquerez 5c200d6258 Optimize ScopeFilter 2024-09-10 11:39:40 +02:00
Eugene Yokota 947ae1e8eb Implement remote test caching 2024-09-08 15:50:26 -04:00
Eugene Yokota f12cbcb450 Include classesDirectory into the digest 2024-09-08 12:56:49 -04:00
Eugene Yokota 0021c3a0bd Refactor to definedTestDigests task 2024-09-08 12:54:36 -04:00
Eugene Yokota 721f202ae5 Hermetic incremental test
**Problem**
Current implementation of testQuick depends on the concept of timestamp,
which probably won't work well with the new consistent analysis store or
the idea of remote caching.

**Solution**
This is a step towards cached testing by making the incrementality hermetic
(no longer depends on the timestamp). Instead this calculates the aggregated
SHA-256 of the class files involved in the test.
2024-09-08 12:50:45 -04:00
SlowBrainDude f6663a0d6c Fix stale BSP diagnostics
The BSP server didn't reset old diagnostic messages sent to BSP clients under
certain circumstances. This commit mitigates this edge case and ensures that
diagnostics for files that previously had compilation problems are properly
reset when fresh diagnostics messages are sent.

The culprit was a mismatch of map keys: Files with problems were sometimes recorded
under an absolute path, but later attempted to be retrieved by virtual path.
2024-09-02 15:27:26 +02:00
Adrien Piquerez b1564d4888 Add cachePath to CompileInputs2 to fix dependency-management/test-artifact
We cannot recover compilation after the path of the Zinc cache changed
2024-08-27 16:02:27 +02:00
Adrien Piquerez 47c60bab2e Fix cleaning packed dir
`clean` should delete the packed dir. If it does not,
the next `compileIncremental`, which is a cache hit, will see that
the packed dir is already there and will not unpack it.
2024-08-26 16:29:21 +02:00
James Roper a7481e49d0 Include ALL sources, and resources in source jar
This follows on from #7470, to include all sources, not just managed and
unmanaged, in the source jar, along with all resources (previously only
unmanaged resources were included).

This means that if, for whatever crazy reason, someone does modify the
`sources` task to include additional sources or filter out sources, rather than
using the managed or unmanaged source mechanisms, their changes will still be
reflected in the source jar.
2024-08-26 13:07:17 +10:00
Eugene Yokota b7e037adbb Use VirtualFileRef of the classes directory 2024-08-22 01:49:49 -04:00
Eugene Yokota d9e3bb52b3 Remove unnecessary settings 2024-08-18 12:57:29 -04:00
Eugene Yokota e0f0550276 Migrate cachedCompileIncrementalTask to dir caching 2024-08-18 12:57:29 -04:00
Eugene Yokota 3ef3a605c2 Merge branch '1.10.x' into wip/merge-1.10.x 2024-08-18 12:37:24 -04:00
Eugene Yokota 4752e180fd Update lm 2024-06-09 17:56:17 -04:00
Adrien Piquerez 3ec8bd2269 Fix fetching Scala 2.13.12 bridges 2024-06-06 17:41:20 +02:00
Adrien Piquerez 64a8d5ff31 Fix Defaults 2024-06-06 10:36:29 +02:00
Adrien Piquerez 492cd2c091 Fix compilation 2024-06-06 10:36:29 +02:00
adpi2 586e0a752c
Merge pull request #7568 from adpi2/fix-bsp-internal-dep-configs
[1.10.x] Fix declaring `Optional` inter-project dependency in BSP
2024-05-23 08:50:43 +02:00
Adrien Piquerez 9a3c4a6f53 Fix dependency-management/force-update-period 2024-05-21 16:54:14 +02:00
Adrien Piquerez f990bd2d8d [BSP] Fix importing Optional project dependency 2024-05-21 15:56:37 +02:00
Eugene Yokota c81d269ed2 Merge branch '1.10.x' into wip/merge-1.10.x 2024-05-07 04:39:25 -04:00
Eugene Yokota bc4d5830e9 Banner for sbt 1.10.0 2024-05-05 22:38:05 -04:00
Eugene Yokota ae1f829f9f Include universal macOS sbtn 2024-05-05 22:34:58 -04:00
Eugene Yokota aac79df4a3 Fix old Dotty plugin compat
**Problem**
https://github.com/scala/scala3/pull/20157 identified that
`sbt-dotty/dotty-knowledge.i17` scripted test fails on sbt 1.10.0-RC2.
The regression happened in https://github.com/sbt/sbt/pull/7480/files#diff-6d9589bfb3f1247d2eace99bab7e928590337680d1aebd087d9da286586fba77L739-L740
where global setting was removed, and moved to project level.

**Solution**
This restores the global setting that is apparently referenced by
now defunct Dotty plugin.
2024-05-05 01:55:32 -04:00
Adrien Piquerez 2e439cab1e [2.x] report cache errors
Report a cache error if the output file of a task is not cacheable
2024-04-24 10:41:56 +02:00
Adrien Piquerez 7c51ba2f64 Revert "Use fileConverter in cacheStore" 2024-04-17 09:30:44 +02:00
Adrien Piquerez 1472ac287f [2.x] Fix dependency-management/force-update-period 2024-04-16 15:23:40 +02:00
eugene yokota 422d9e735f
Fix typo 2024-04-15 10:44:17 -04:00
Eugene Yokota b1a43f9adc Consistent Analysis
See also https://github.com/sbt/zinc/pull/1326

This adds a new setting `enableConsistentCompileAnalysis`,
which enables the new "Consistent" Analysis format,
which is faster and more repeatable than the status quo.
This is initialized to `true` by default.
It can be opted out either by the setting or using
`-Dsbt.analysis2024=false`.
2024-04-14 23:17:04 -04:00
Eugene Yokota b19a54a1ef Improve the SIP-51 error message 2024-04-14 21:18:15 -04:00
eugene yokota 0e67131beb
Update main/src/main/scala/sbt/Defaults.scala
Co-authored-by: adpi2 <adrien.piquerez@gmail.com>
2024-04-11 10:45:51 -04:00
Eugene Yokota 33d50e2f47 Success log change fix 2024-04-11 13:55:29 +02:00
Eugene Yokota 86cf7c3a0c Remote caching support
This implements Bazel-compat remote caching support via a plugin.
2024-04-11 13:55:29 +02:00
Philippus Baalman f89505bb03
Remove superfluous space 2024-04-11 07:21:26 +02:00
Adrien Piquerez 8865565004 Fix classloader-cache/resources 2024-04-10 15:32:50 +02:00
Adrien Piquerez eda67a05fc Use fileConverter in cacheStore
Otherwise the store cannot sync files that are not in the out folder.
2024-04-09 16:09:44 +02:00
Adrien Piquerez 9e6612a3f8 Fix hashing of incrementalCompile 2024-04-09 15:33:22 +02:00
Adrien Piquerez ab1aa6d001 Fix todos in actions/compile-clean 2024-04-09 15:33:22 +02:00
Adrien Piquerez e1cf43c6bd Add jar file to compileOutputs 2024-04-09 15:33:22 +02:00
Adrien Piquerez 85fcb014f0 Fix data race to remote cache on classpath analyses
The attributed classpath should point to the existing analysis file in the target folder to avoid data racing to the remote cache.
2024-04-08 16:34:18 +02:00
Adrien Piquerez 1c03463e19 Fix test-quick 2024-04-08 10:05:52 +02:00
Adrien Piquerez b0f3cb0a8e Fix actions/completions
When loading a scripted test, sbt creates a jar file and loads it.
The path of the jar file is the same for all the batched tests.
We must prevent the JDK from caching this jar file to force a reload after each test.
Otherwise sbt tries to load the auto-plugins of a previous test and fails.
2024-04-08 10:05:52 +02:00
eugene yokota ec02bf3dc2
Merge pull request #7480 from lrytz/lib-unfreeze-m
Add support for SIP-51 (unfreezing the Scala library)
2024-04-08 01:10:05 -04:00
Adrien Piquerez 129b38f55b Fix tests/serial 2024-04-02 17:49:12 +02:00
Adrien Piquerez d9b024cf91 fix project1/ignore-hidden-build-files 2024-04-02 17:49:12 +02:00
Adrien Piquerez 4a946a68cd Fix project1/extra 2024-04-02 17:49:12 +02:00
Adrien Piquerez 222410009b fix no-scala-tool 2024-04-02 17:49:12 +02:00
Adrien Piquerez e2c7a294f8 minor change 2024-03-27 14:41:24 +01:00
Adrien Piquerez 453ccc6805 Uncomment pending tests 2024-03-26 10:12:29 +01:00
Adrien Piquerez 627bd6bea1 Fix checkTargets 2024-03-25 10:52:15 +01:00
Adrien Piquerez b5afcf8a0c Fix server completion tests 2024-03-19 17:06:09 +01:00
Adrien Piquerez 03ca5365f5 Fix BuildServerTest 2024-03-19 17:06:09 +01:00
Adrien Piquerez 924150851c Port server tests to scalatest and fix 2024-03-19 17:06:09 +01:00
Adrien Piquerez e62984846b Re-implement BuildServerEvalReporter 2024-03-19 17:06:09 +01:00
Seth Tisue 735214afd0 Scala 2.12.19 (was 2.12.18), scala-xml 2.2.0 (was 2.1.0) 2024-03-16 11:39:55 +01:00
Adrien Piquerez 7ca6ad5fec Fix resolution of bridge using Coursier 2024-03-06 16:40:41 +01:00
Adrien Piquerez 12e9267e1e Remove more unused 2024-03-05 15:25:25 +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
Lukas Rytz f0afeff4d9 Set locale for f interpolator decimal character
dependency-graph/toFileSubTask failed for me locally
2024-02-27 10:56:30 +01:00
Lukas Rytz b9375f5e6b Update scala-library in scala-tool configuration for Scala 3
When a macro was compiled against a new scala-library (say 2.13.15),
the runtime classpath of the Scala compiler should not contain an older
scala-library. Otherwise the macro can cause a NoSuchMethodException
during expansion.

This commit updates scala-library in the scalaInstance to the version
on the projects dependency classpath.
2024-02-27 10:56:30 +01:00
Lukas Rytz 951d1c4ae4 Add new `csrSameVersions` setting, use it for Scala artifacts
The `csrSameVersions` setting can be used to keep dependencies at the
same version.

By default it's used for Scala artifacts. They need to be kept at the
same version because the compiler / reflect are built with
cross-artifact inlining enabled.

`csrSameVersions := Seq(Set(scala-library, scala-reflect, scala-compiler, scalap))`

Users can make use of the new setting in the following way:
  - `csrSameVersions += Set[InclExclRule]("com.corp" % "lib", "com.corp" % "lub")`
  - `csrSameVersions += Set[InclExclRule]("com.corp" % "lib-family-*")`
2024-02-27 10:56:30 +01:00
Lukas Rytz 4c74358707 Fail the build if 2.13 scalaVersion < scala artifact on classpath
When expanding a macro compiled against a new Scala library, the
runtime classpath of the compiler should not contain an older library.
Otherwise a NoSuchMethodException can occur.

A similar issue is present when running the Scala repl through sbt.
An input line compiled against a new library could fail to run if
the repl's runtime classpath is on an old version.
2024-02-26 13:49:04 +01:00
Lukas Rytz 35bc07bd9e Use scala library from classpath in sbt run class loader 2024-02-26 13:49:04 +01:00
Lukas Rytz 893997d1b6 Update scala libraries according to dependency graph
There are a couple of settings / configs that affect this, summary
below. The change in this PR seems to be the most narrow.

`scalaModuleInfo.value.overrideScalaVersion` in sbt
  - affects how sbt to sets coursier's `forceScalaVersion` (see below)
  - used by librarymanagement.ivy. If true, add a OverrideScalaMediator
    See sbt/sbt#2634. Probably not relevant when using coursier.

`autoScalaLibrary` setting in sbt
  - automatically add `scala-library` (or `scala3-library`) as a project
    dependency
  - also used for `forceScalaVersion` (see below)

`CoursierConfiguration.autoScalaLibrary`
  - if `true` then Coursier `ResolutionParams.forceScalaVersion` is set
    to to `true`
  - initialized by sbt to
    `autoScalaLibrary.value &&
     !ScalaArtifacts.isScala3(sv) &&
     !Classpaths.isScala213(sv) &&        // added in this commit
     scalaModuleInfo.forall(_.overrideScalaVersion)`

coursier `ResolutionParams.forceScalaVersion`
  - if true, `scala-library` / `scala-reflect` / `scala-compiler` /
    `scalap` are forced to the scala version, not actually resolved
  - for Scala 3, the `scala3-library` and `scala3-compiler` versions
    are forced
2024-02-26 13:49:04 +01:00
Lukas Rytz d8d2b02e7e Use the ordinary compiler classpath for scala-library
No longer pass `-bootclasspath /path/to/scala-library.jar` to the Scala
compiler, put the library on the ordinary classpath.
2024-02-26 13:49:04 +01:00
Adrien Piquerez eadf1117f6 Store bootServerSocket in state 2024-02-15 16:18:54 +01:00
Adrien Piquerez 02df82840a add noOp field in BSP compile report 2024-02-15 15:50:02 +01:00
Adrien Piquerez 5425e066a0 Fix SbtRefactorings 2024-02-13 14:01:26 +01:00
Adrien Piquerez 739dedb017 Remove usage of Manifest in Structure.scala 2024-02-12 15:22:09 +01:00
adpi2 64be877549
Merge pull request #7491 from adpi2/misc-cleanup
[2.x] Miscellaneous cleanup
2024-02-08 17:42:35 +01:00
Eugene Yokota 63ba90d198 Migrate postfix ops
**Problem**
There are a few places in the code that's using postfix ops.

**Solution**
This rewrites the expressions to use normal dot notaiton.
2024-02-07 11:40:45 -05:00
eugene yokota ecca26175e
[sbt 2.x] remote cache (#7464)
For the details about this PR, please see the blog post https://eed3si9n.com/sbt-remote-cache/.

* Add cache basics
* Refactor Attributed to use StringAttributeMap, which is Map[StringAttributeKey, String]
* Implement disk cache
* Rename Package to Pkg
* Virtualize packageBin
* Use HashedVirtualFileRef for packageBin
* Virtualize compile task
2024-02-07 10:34:06 -05:00
Adrien Piquerez e18ddb1666 Fix resolution of * on String 2024-02-07 11:47:22 +01:00
Adrien Piquerez 7ac3cd321d Remove the unused ~> 2024-02-07 11:12:43 +01:00
Martin Duhem 6679067bcb
Resolve `scripted-sbt-redux` to run scripted
Previously, in sbt 2, the Scripted plugin was not resolving any module
that would provide it with the `ScriptedTests` object, and could
therefore not run scripted tests.

With this patch, `scripted-sbt-redux` will be resolved and added to the
classloader that's used to load `sbt.scriptedtest.ScriptedTests`.
2024-02-02 14:28:56 +01:00
Tammo Steffens 053c7cc8bd Use the publisher interface for publishing as default 2024-01-17 21:39:39 +01:00
friendseeker e4ab56e444 Include managedSources in packageSrc 2024-01-01 20:58:39 -08:00
friendseeker eadb5b3786
fix compile error in VirtualFileValueCache 2024-01-01 19:47:08 -08:00
Adrien Piquerez 7ea0506736 Introduce TaskId to reduce abstraction around Execute 2023-11-28 14:26:52 +01:00
Eugene Yokota 08966370b1 Update to lm 2.0.0-alpha13 for sjson-new 2023-11-25 21:01:04 -05:00
Eugene Yokota bde26f6c51 Communicate narrowing by adding case 2023-11-25 20:50:34 -05:00
Eugene Yokota e87e1d6e0d Update to Scalafmt 3.7.14 2023-11-25 01:08:17 -05:00
Aleksandra Zdrojowa f9f47620d0 pass classifiersModule configurations to ModuleDescriptorConfiguration 2023-11-21 15:57:59 +01:00
Adrien Piquerez b189d49968 Refactoring 2023-10-25 14:19:03 +02:00
unknown 3d1319efea Use sourcePositionMappers in BuildServerReporter 2023-10-25 11:40:18 +02:00
Eugene Yokota 2956f168db Make loading order alphabetical for plugins
**Problem**
Plugins are topologically sorted, but plugins with equal weigh could
modify the same key via `~=` etc, resulting in different builds
depending on the artifact.

**Solution**
This attempts to fix that by first sorting the selected plugins
by the class name before sorting it topologically.
2023-10-15 22:09:23 -04:00
adpi2 da41144f37
Merge pull request #7350 from dragos/commands-progress
Add a new CommandProgress API.
2023-10-12 09:24:14 +02:00
Martin Duhem 77e22e9a01 Small documentation fixes 2023-10-11 22:30:18 +02:00
MINKYU LEE 9f1d2fd4ed
Fix bug of unmanagedResourceDirectories (#7178)
Sort resourceDirectories for copyResourcesTask
2023-10-08 22:56:48 -04:00
kenji yoshida 32558c9537
catch NoSuchMethodError when call runFinalization 2023-10-08 18:04:06 +09:00
eugene yokota 5d6d30ed1c
Merge pull request #7396 from mkurz/uri_log_dependencyBrowseTree 2023-10-07 13:03:25 -04:00
Matthias Kurz 5fddf3d741
Include uri in log of dependencyBrowseTree 2023-10-07 12:20:01 +02:00
adpi2 d53ccda9c4
Merge branch '1.10.x' into commands-progress 2023-10-04 09:49:05 +02:00
Michel Davit c5fd4f2e6d Support cross-build for external project ref 2023-10-03 16:12:54 +02:00
eugene yokota 397c7a634a
Merge pull request #7352 from adpi2/bsp-javacoptions
[BSP] Implement `buildTarget/javacOptions`
2023-09-21 13:54:31 -04:00
Matthew de Detrich 8ce5f2e336 Document scriptedSbt 2023-09-15 20:49:39 +02:00
Eugene Yokota b1e9308ebe Use binary compiler bridge
Problem
-------
Starting Scala 2.13.12, Scala 2 has in-sourced the compiler bridge
implementtion, which hopefully will be kept up to date more than the
ones in Zinc.

Solution
--------
This switches to using the pre-compiled compiler bridge for >=2.13.12.
2023-09-11 23:15:15 -04:00
Seth Tisue 876a85461d add a Scala 3 seed to the sbt new menu 2023-08-13 07:18:09 -07:00
Iulian Dragos 18353f1ca8
Reviewer's suggestions. 2023-08-11 16:08:11 +02:00
Adrien Piquerez 5515619ecc Implement buildTarget/javacOptions 2023-08-10 16:11:28 +02:00
Iulian Dragos 51a774b081
Fix failing test case 2023-08-08 11:29:32 +02:00
Iulian Dragos 193dba708f
Add missing header. 2023-08-08 10:14:48 +02:00
Iulian Dragos 0f53349ce9
Add method overload to keep binary compatibility 2023-08-08 09:54:09 +02:00
Iulian Dragos 82ae293e3f
Add a new CommandProgress API.
In addition to ExecuteProgress, this new interface allows builds and plugins to receive events when commands start and finish, including the State before and after each command. It also makes cancellation visible to clients by making the Cancelled type top-level.
2023-08-07 17:09:30 +02:00
Adrien Piquerez 897e2552e4 Maintain order of internal deps 2023-08-02 10:26:59 +02:00
Eugene Yokota de20328029 Let ++ fall back to a bincompat Scala version
Fixes https://github.com/sbt/sbt/issues/7327

**Problem**
In builds with mixed Scala patch versions (like scalameta),
it's possible for a core subproject to be set to the lastest 2.12.x,
but the compiler plugin component is cross published to 2.12.0 etc.
`++ 2.12.0` in this case does not work since sbt 1.7.x onwards requires
the queried Scala version to be listed in `crossScalaVersions`.

**Solution**
This implements sbt 1.6.x-like fallback mechanism,
but instead of using the queried version (e.g. 2.12.0) it will set
the Scala version to one of listed versions that is binary compatible.
2023-07-09 18:31:55 -04:00
eugene yokota 98cafd366c
Merge pull request #7318 from eed3si9n/wip/template_bump
Bump toolkit versions
2023-06-25 20:07:14 -04:00
eugene yokota 4b810a63e7
Merge pull request #7304 from eed3si9n/wip/templates
Make sbt new extensible
2023-06-25 20:07:02 -04:00
Eugene Yokota 952db253a2 Bump toolkit versions 2023-06-25 19:18:43 -04:00
eugene yokota 5fc0a4c8d4
Merge pull request #7317 from xuwei-k/trivial-refactoring 2023-06-25 11:28:41 -04:00
eugene yokota fb011ecaa3
Merge pull request #7315 from xuwei-k/URL-constructor 2023-06-24 22:14:00 -04: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 c7ec22cff8 avoid deprecated `java.net.URL` constructor
- https://bugs.openjdk.org/browse/JDK-8295949
- 4338f527aa
2023-06-25 08:23:09 +09:00
xuwei-k 3de0c92754 fix scaladoc warnings 2023-06-25 08:04:17 +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
Eugene Yokota 5398f6e1aa Make sbt new extensible
Problem
-------
`sbt new` (`sbt init`) hardcodes the templates, which I think is ok,
but without changing much, we can make it extensible.

Solution
--------
This adds two new keys `templateDescriptions` and `templateRunLocal`,
which can customize the behavior for in-house usage etc.
2023-06-18 15:48:18 -04:00
Ondra Pelech 9ec7c4f027 Dependency graph with colors (based on the organization) (#7052) 2023-06-17 02:29:48 +02:00
Krzysztof Atłasik 118138a0c8
Add new template to text-based menu (#7300) 2023-06-15 05:14:40 -04:00
eugene yokota c6bc422ea3
Merge pull request #7298 from adpi2/fix-7297 2023-06-14 08:56:06 -04:00
Adrien Piquerez a209cf2700 Fix #7297: Convert OffsetPosition to BSP range 2023-06-14 10:35:54 +02:00
adpi2 f692583034
Merge pull request #7295 from adpi2/fix-7288
Fix #7288: `publish` should not fail if `publish / skip := true`
2023-06-13 09:54:45 +02:00
eugene yokota e0d88607a5
Merge pull request #7294 from ckipp01/semanticDbUpdate
deps: bump the default semanticdb version used
2023-06-12 13:03:53 -04:00
Adrien Piquerez 783a8e57db Fix #7288 and implement publisM2 / skip 2023-06-12 18:06:06 +02:00
eugene yokota cfa88f766f
Merge pull request #7290 from mkurz/sbtn-1.9.0
sbtn 1.9.0
2023-06-12 10:49:49 -04:00
Chris Kipp 05ac9c88d1 deps: bump the default semanticdb version used
This updates semanticdb from 4.5.13 to 4.7.8.
2023-06-12 16:44:20 +02:00
Alex Klibisz b9cc499ec3
Fix typo in exportPipelining Key description 2023-06-07 13:21:00 -04:00
Matthias Kurz 7256fb2725
sbtn 1.9.0 2023-06-06 17:12:41 +02:00
Adrien Piquerez dd00e143f2 Fix #7285: use legacy Maven style on publishLocal 2023-06-05 21:24:20 +02:00
Eugene Yokota 7c7576843a Fix sbt init menu
Problem
-------
sbt init menu doesn't pick the right template in the latter half.

Solution
--------
This fixes the mapping between the position and the letter.
2023-06-01 22:45:51 -04:00
Eugene Yokota 1f1ee778e3 Update Scala to 2.12.18
Fixes https://github.com/sbt/sbt/issues/7235
2023-06-01 12:13:40 -04:00
eugene yokota babbdaeaa0
Merge pull request #7264 from eed3si9n/wip/diagnostic
Forward ScalaDiagnostic
2023-05-26 09:49:59 -04:00
Arman Bilge dc79c592cf Update typelevel toolkit, config test artifact 2023-05-22 21:53:09 +00:00
Eugene Yokota 93bd66b673 Forward ScalaDiagnostic
**Problem**
Zinc added actions in Problem, but it's not yet forwarded to BSP
clients.

**Solution**
As discussed in
https://contributors.scala-lang.org/t/roadmap-for-actionable-diagnostics/6172,
the plan seems to be to use the `data` field with `actions` inside it,
so this implements that.
2023-05-22 00:33:46 -04:00
Jakub Kozłowski f8a29b748b
Add weaver-cats as a default test framework (#7263)
Add weaver-cats as a default test framework
2023-05-21 23:28:04 -04:00
Matthew de Detrich e3c7bc7d8f
Deprecate itSettings 2023-05-22 00:14:29 +02:00
eugene yokota 26e9af13ec
Merge pull request #7240 from eed3si9n/wip/bannar
sbt 1.9.0 bannar
2023-05-07 14:41:01 -04:00
Eugene Yokota b122e292e5 Bump Typelevel toolkit 2023-05-07 14:18:18 -04:00
Eugene Yokota 731af0173c Add init as an alias to new 2023-05-07 14:17:26 -04:00
Eugene Yokota 2664884f37 sbt 1.9.0 bannar 2023-05-07 14:05:05 -04:00
Eugene Yokota 86ecec8ac3 sbt-giter8-resolver 0.16.2 2023-05-07 01:28:46 -04: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
eugene yokota 3d1349a37d
Merge pull request #7234 from adpi2/fix-7233
[1.9.x] Fix #7233: copy artifact files of sbt plugin
2023-05-04 12:47:28 -04:00
Adrien Piquerez bb0bb5ce58 Fix #7233
The sbt-reproducible-build fails if  two artifacts point to the same file.

When packaging the artifacts of an sbt plugin,
we copy each files to avoid this issue.
2023-05-04 10:46:21 +02:00
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