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

Commit

Permalink
[fix] now server can obtain scala3 compiler (#455)
Browse files Browse the repository at this point in the history
* [fix] now server can obtain scala3 compiler

* regex fix

* ohh now the syntax is correct

* changelog
  • Loading branch information
abrams27 authored Aug 30, 2023
1 parent 2e17ea0 commit c4a6701
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
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")
}
}

0 comments on commit c4a6701

Please sign in to comment.