File tree Expand file tree Collapse file tree 2 files changed +30
-11
lines changed
integration/src/test/scala/scala/cli/integration
options/src/main/scala/scala/build/options Expand file tree Collapse file tree 2 files changed +30
-11
lines changed Original file line number Diff line number Diff line change @@ -608,7 +608,8 @@ class SipScalaTests extends ScalaCliSuite with SbtTestHelper with MillTestHelper
608
608
val localRepoPath = root / " local-repo"
609
609
val sv = " 3.4.1-RC1"
610
610
val artifactNames =
611
- Seq (" scala3-compiler_3" ) ++ (if (withBloop) Seq (" scala3-sbt-bridge" ) else Nil )
611
+ Seq (" scala3-compiler_3" , " scala3-staging_3" , " scala3-tasty-inspector_3" ) ++
612
+ (if (withBloop) Seq (" scala3-sbt-bridge" ) else Nil )
612
613
for { artifactName <- artifactNames } {
613
614
val csRes = os.proc(
614
615
TestUtil .cs,
@@ -692,6 +693,21 @@ class SipScalaTests extends ScalaCliSuite with SbtTestHelper with MillTestHelper
692
693
}
693
694
}
694
695
696
+ test(" --with-compiler option includes scala3-staging & scala3-tasty-inspector artifacts" ) {
697
+ TestInputs (os.rel / " example.sc" ->
698
+ """ import scala.quoted.staging.Compiler
699
+ |import scala.tasty.inspector.TastyInspector
700
+ |""" .stripMargin).fromRoot { root =>
701
+ val res = os.proc(
702
+ TestUtil .cli,
703
+ " compile" ,
704
+ " example.sc" ,
705
+ " --with-compiler"
706
+ ).call(cwd = root)
707
+ expect(res.exitCode == 0 )
708
+ }
709
+ }
710
+
695
711
test(s " default Scala version override launcher option is respected by the json export " ) {
696
712
val input = " printVersion.sc"
697
713
val code = """ println(s"Default version: ${scala.util.Properties.versionNumberString}")"""
Original file line number Diff line number Diff line change @@ -100,16 +100,19 @@ final case class BuildOptions(
100
100
}
101
101
102
102
private def scalaCompilerDependencies : Either [BuildException , Seq [AnyDependency ]] = either {
103
- value(scalaParams).toSeq.flatMap { sp =>
104
- if (scalaOptions.addScalaCompiler.getOrElse(false ))
105
- Seq (
106
- if (sp.scalaVersion.startsWith(" 3." ))
107
- dep " org.scala-lang::scala3-compiler:: ${sp.scalaVersion}"
108
- else
109
- dep " org.scala-lang:scala-compiler: ${sp.scalaVersion}"
110
- )
111
- else Nil
112
- }
103
+ value(scalaParams)
104
+ .map(_ -> scalaOptions.addScalaCompiler.getOrElse(false ))
105
+ .toSeq
106
+ .flatMap {
107
+ case (sp, true ) if sp.scalaVersion.startsWith(" 3" ) =>
108
+ Seq (
109
+ dep " org.scala-lang::scala3-compiler:: ${sp.scalaVersion}" ,
110
+ dep " org.scala-lang::scala3-staging:: ${sp.scalaVersion}" ,
111
+ dep " org.scala-lang::scala3-tasty-inspector:: ${sp.scalaVersion}"
112
+ )
113
+ case (sp, true ) => Seq (dep " org.scala-lang:scala-compiler: ${sp.scalaVersion}" )
114
+ case _ => Nil
115
+ }
113
116
}
114
117
115
118
private def maybeJsDependencies : Either [BuildException , Seq [AnyDependency ]] = either {
You can’t perform that action at this time.
0 commit comments