**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.
**Problem**
`java.net.URL` calls out to the network to perform `equals`,
so we should remove that from anywhere that can be involved in caching etc.
**Solution**
This changes java.net.URL to java.net.URI in Keys.
**Problem**
Whether a subproject is root or not is currently detected by
comparing getCanonicalFile against the build base directory.
Problem is that often the root project uses "." as the directory,
and getting the canonical file works ok for the current build,
but it breaks when loading `ProjectRef`.
There might be other bugs related to the root project detection.
**Solution**
This factors out `isRootPath` function that's aware of the build base.
This PR adds the repro test prepared by xuwei-k.
**Problem**
Currently the following warning shows up while compiling metabuild:
[warn] Failed to parse `-Wconf` configuration: cat=unused-nowarn:s
[warn] unknown category: unused-nowarn
-Wconf:cat=unused-nowarn in general was added as a Scala 2.12 of
falsely warning about pure expression not doing anything in the macro.
**Solution**
We should be able to remove the -Wconf flag in sbt 2.x.
**Problem**
Slash syntax is currently implemented via a series of implicit
converters (Conversion), which is not nice, partly because
the behavior is difficult to follow.
**Solution**
This removes all the implicit converters and moves the slashes
into:
1. / methods under Reference for subproject scoping.
2. / methods under ScopeAxis with Reference type constraint
for the initial Zero scoping.
3. Return RefThenConfig structure for intermediate config scoping.
4. / method under `Scoped`, which is base trait for the keys
to implement task scoping e.g. `compile / scalacOptions`.
5. Extension methods for ConfigKey.
6. Extension methods for AttributeKey.
Problem
Currently Scala 3.x - 2.13 sandwich doesn't seem to work for projectMatrix.
This is due to isScala2Scala3Sandwich checking for "3." while projectMatrix
uses scalaBinaryVersion, which is 3.
Solution
This consolidates the implementation of isScala2Scala3Sandwich with the one
in Defaults module, and check for both "3" and "3."
To build the index of all aggregate keys, we were computing the reverse
aggregation of each key, before indexing them.
And so each aggregate key was indexed many times, once for each
aggregated project. It was parallelized to reduce the latency.
In this PR, we compute the reverse aggregation of all the keys at once,
removing all duplication. We cannot parallelize this process anymore
but we don't need to, because it is a lot faster. It reduces the total
CPU time by 12%. The impact for the user depends on its number of cores.
Settings0 used to be a Map[Scope, AttributeMap], and is now a
Map[ScopedKey[x], x].
This is better because we don't need to decompose all ScopedKey[x]
into a Scope and an AttributeKey[x], for recomposing it back later,
which duplicates all ScopedKey[x]. It reduces the number of long-living
ScopedKey[x] by 8%, and the total number of instances by 1.4%.
Also it improves the performance of Settings0, which was responsible of
2.95% of the total CPU time, and is now responsible of 0.41%.
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.
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.