Skip to content
This repository has been archived by the owner on Aug 5, 2024. It is now read-only.

[fix] now server can obtain scala3 compiler #455

Merged
merged 4 commits into from
Aug 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@

### Fixes 🛠️

- aspects dont fail if target contains another target as `srcs` attribute
- aspects don't fail if target contains another target as `srcs` attribute
- now server can obtain scala 3 compiler

## [3.0.0] - 09.08.2023

Expand Down
6 changes: 3 additions & 3 deletions aspects/rules/scala/scala_info.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ def find_scalac_classpath(runfiles):
found_scala_compiler_jar = False
for file in runfiles:
name = file.basename
if file.extension == "jar" and "scala-compiler" in name:
if file.extension == "jar" and ("scala3-compiler" in name or "scala-compiler" in name):
found_scala_compiler_jar = True
result.append(file)
elif file.extension == "jar" and ("scala-library" in name or "scala-reflect" in name):
elif file.extension == "jar" and ("scala3-library" in name or "scala3-reflect" in name or "scala-library" in name or "scala-reflect" in name):
result.append(file)
return result if found_scala_compiler_jar and len(result) >= 3 else []
return result if found_scala_compiler_jar and len(result) >= 2 else []

def extract_scala_toolchain_info(target, ctx, output_groups, **kwargs):
runfiles = target.default_runfiles.files.to_list()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,6 @@ class ScalaSdkResolver(private val bazelPathsResolver: BazelPathsResolver) {
0
}
private val VERSION_PATTERN =
Pattern.compile("(?:processed_)?scala-(?:library|compiler|reflect)-([.\\d]+)\\.jar")
Pattern.compile("(?:processed_)?scala3?-(?:library|compiler|reflect)(?:_3)?-([.\\d]+)\\.jar")
}
}