Commit Graph

3304 Commits

Author SHA1 Message Date
Adrien Piquerez 9a3c4a6f53 Fix dependency-management/force-update-period 2024-05-21 16:54:14 +02: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
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
Philippus Baalman f89505bb03
Remove superfluous space 2024-04-11 07:21:26 +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
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
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 02df82840a add noOp field in BSP compile report 2024-02-15 15:50:02 +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
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