-
Notifications
You must be signed in to change notification settings - Fork 284
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Port DependencyAnalyzer plugin to Scala 3 (#1640)
* Adapt DependencyAnalyzer/OptionsParsers.tokenize tailrec to a bug when compiling under Scala 3.1.3 (fixed in 3.2) * Setup dt_patches for Scala 3 * Port dependency-analyzer compiler plugin, setup and unify tests. * Add .bazelbsp and .bsp to .gitignore * Add test_thridparty_version.sh as (actually working) subset of it's dangerous counterpart * Show errors of failing tests * Use Java17 for test_thirdparty_version - latest supported JDK version by Scala 3.1.3 is JDK 18 * Remove debug printlns * Simplify resolving version of Scala 3 compiler
- Loading branch information
1 parent
716210f
commit 9fccc25
Showing
34 changed files
with
1,137 additions
and
496 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,8 @@ hash2 | |
.DS_store | ||
.bazel_cache | ||
.ijwb | ||
.bazelbsp | ||
.bsp | ||
.metals | ||
.vscode | ||
unformatted-*.backup.scala | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
|
||
diff --git a/compiler/src/dotty/tools/dotc/core/SymbolLoaders.scala b/compiler/src/dotty/tools/dotc/core/SymbolLoaders.scala | ||
--- dotty/tools/dotc/core/SymbolLoaders.scala (revision 91ef92159c628eaeab8311dc82bed7ed4fe03c63) | ||
+++ dotty/tools/dotc/core/SymbolLoaders.scala (date 1730331517451) | ||
@@ -353,6 +353,14 @@ | ||
try { | ||
val start = System.currentTimeMillis | ||
trace.onDebug("loading") { | ||
+ root.symbol.associatedFile match { | ||
+ case assocFile: AbstractFile => assocFile.underlyingSource.foreach { | ||
+ case jar: dotty.tools.io.ZipArchive => | ||
+ report.echo(s"DT:${jar.path}") | ||
+ case _ => () | ||
+ } | ||
+ case null => () | ||
+ } | ||
doComplete(root) | ||
} | ||
report.informTime("loaded " + description, start) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -e | ||
|
||
test_scala_version() { | ||
SCALA_VERSION=$1 | ||
bazel test --test_output=errors //third_party/... --repo_env=SCALA_VERSION=${SCALA_VERSION} | ||
} | ||
|
||
dir=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) | ||
test_dir=$dir/test/shell | ||
# shellcheck source=./test_runner.sh | ||
. "${test_dir}"/test_runner.sh | ||
runner=$(get_test_runner "${1:-local}") | ||
|
||
|
||
# Latest version of each major version | ||
$runner test_scala_version "3.5.2" # Latest Next version | ||
$runner test_scala_version "3.3.4" # Latest LTS version | ||
$runner test_scala_version "3.1.3" # First supported major for Scala 3, max supported JDK=18 | ||
$runner test_scala_version "2.13.15" | ||
$runner test_scala_version "2.12.20" | ||
$runner test_scala_version "2.11.12" | ||
|
||
# Tests for other versions should be placed in dangerous_test_thirdparty_version.sh | ||
# However that script is outdated and uses only default Scala version for each minor |
Oops, something went wrong.