Skip to content

Commit

Permalink
mill: Try fix issues found in CI
Browse files Browse the repository at this point in the history
  • Loading branch information
WojciechMazur committed Feb 2, 2024
1 parent cb8c38e commit 1a4c1a2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
2 changes: 1 addition & 1 deletion project-builder/mill/prepare-project.sh
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ fi

# Rename build.sc to build.scala - Scalafix does ignore .sc files
# Use scala 3 dialect to allow for top level defs
adaptedFiles=(build.sc )
adaptedFiles=($PWD/build.sc )
if [[ -d ./project ]]; then
adaptedFiles+=(`find ./project -type f -name "*.sc"`)
fi
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -221,14 +221,13 @@ class Scala3CommunityBuildMillAdapter(
|
|implicit class MillCommunityBuildScalacOptionsOps(asSeq: Seq[String]){
| def mapScalacOptions(scalaVersion: mill.define.Target[String])(implicit ctx: mill.api.Ctx): Seq[String] = {
| scalaVersion.evaluate(ctx).asSuccess.map(_.value)
| .map{ scalaVersion =>
| MillCommunityBuild.mapScalacOptions(scalaVersion, asSeq)
| }.getOrElse{
| println("Failed to resolve scalaVersion, assume it's Scala 3 project")
| MillCommunityBuild.mapScalacOptions(sys.props.getOrElse("communitybuild.scala", "3.3.1"), asSeq)
| }
| }
| try scalaVersion.evaluate(ctx).asSuccess.map(_.value)
| catch {ex: Throwable => None }
| }.map(MillCommunityBuild.mapScalacOptions(_, asSeq))
| .getOrElse {
| println("Failed to resolve scalaVersion, assume it's Scala 3 project")
| MillCommunityBuild.mapScalacOptions(sys.props.getOrElse("communitybuild.scala", "3.3.1"), asSeq)
| }
| def mapScalacOptions(scalaVersion: String) = MillCommunityBuild.mapScalacOptions(scalaVersion, asSeq)
|}
|
Expand Down

0 comments on commit 1a4c1a2

Please sign in to comment.