Commit Graph

3528 Commits

Author SHA1 Message Date
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
Matthew de Detrich eea840be2c Replace tuple with proper record type for licenses 2024-12-05 00:56:39 -05:00
Eugene Yokota 02c7cf309d Avoid the use of URL
**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.
2024-12-04 22:12:54 -05:00
Eugene Yokota ac4ba55e9e fix: Fix root project detection
**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.
2024-12-02 03:15:35 -05:00
Eugene Yokota 56e83977e9 fix: Remove -Wconf:cat=unused-nowarn:s
**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.
2024-12-01 18:09:38 -05:00
Eugene Yokota eb7d43c363 Refactor RefThenConfig to be an opaque type 2024-11-26 04:55:08 -05:00
Eugene Yokota 70d7ddb258 Refactor slash syntax to mostly use methods
**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.
2024-11-25 04:54:40 -05:00
Eugene Yokota 4e3fbcced9 Refactor ScopeAxis to use enum 2024-11-24 23:10:18 -05:00
Eugene Yokota 56377274b7 fix: Fix Scala 3.x - 2.12 sandwich for matrix
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."
2024-11-23 04:05:28 -05:00
xuwei-k d8705bbac0 use given instead of implicit object 2024-11-18 17:09:03 +09: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
xuwei-k c5b7038f3a use `given` instead of `implicit val` 2024-11-17 17:35:23 +09:00
friendseeker 1ec08180f7
Remove enableConsistentCompileAnalysis & enableBinaryCompileAnalysis 2024-11-16 21:27:29 -08:00
Eugene Yokota 29c77f6f5f Merge branch 'develop' into wip/scalainstance 2024-11-14 22:02:10 -05:00
adpi2 4c66e5a907
Merge branch 'develop' into 2.x-fuse-info 2024-11-13 17:08:37 +01:00
Adrien Piquerez 0ccf3325c8 Optimize indexing of aggregate keys
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.
2024-11-13 12:25:31 +01:00
Adrien Piquerez f4f185a1c1 Settings as a Map[ScopedKey[x], x]
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%.
2024-11-13 12:25:31 +01:00
Adrien Piquerez 327d05e28f Remove unused Structure.taskToKey 2024-11-13 11:22:53 +01:00
Adrien Piquerez d54647a46c Use referential equality on Task 2024-11-13 10:55:29 +01:00
Eugene Yokota cfbc5c078a Merge branch 'develop' into wip/scalainstance 2024-11-13 00:31:53 -05:00
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
Adrien Piquerez 8b5eaa2cd5 Cache delegates during Load 2024-11-04 10:43:42 +01: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 6922915949 use extension instead of implicit class 2024-10-26 09:05:27 +09: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
xuwei-k 00d01ce215 Update scalafmt 2024-10-22 19:58:21 +09: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
xuwei-k 6bf5b8b30f Update contraband sources 2024-10-18 20:34:44 +09:00