Skip to content

Commit 128fd80

Browse files
committed
adjust build to pass cmd test
1 parent f504b6f commit 128fd80

File tree

5 files changed

+27
-14
lines changed

5 files changed

+27
-14
lines changed

dist/bin/common

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ DOTTY_COMP=$(find_lib "*dotty-compiler*")
108108
DOTTY_INTF=$(find_lib "*dotty-interfaces*")
109109
DOTTY_LIB=$(find_lib "*dotty-library*")
110110
DOTTY_STAGING=$(find_lib "*dotty-staging*")
111+
TASTY_CORE=$(find_lib "*tasty-core*")
111112
SCALA_ASM=$(find_lib "*scala-asm*")
112113
SCALA_LIB=$(find_lib "*scala-library*")
113114
SBT_INTF=$(find_lib "*compiler-interface*")

dist/bin/dotc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ classpathArgs () {
5050
# echo "dotty-compiler: $DOTTY_COMP"
5151
# echo "dotty-interface: $DOTTY_INTF"
5252
# echo "dotty-library: $DOTTY_LIB"
53+
# echo "tasty-core: $TASTY_CORE"
5354
# echo "scala-asm: $SCALA_ASM"
5455
# echo "scala-lib: $SCALA_LIB"
5556
# echo "sbt-intface: $SBT_INTF"
@@ -61,6 +62,7 @@ classpathArgs () {
6162
toolchain+="$SBT_INTF$PSEP"
6263
toolchain+="$DOTTY_INTF$PSEP"
6364
toolchain+="$DOTTY_COMP$PSEP"
65+
toolchain+="$TASTY_CORE$PSEP"
6466
toolchain+="$DOTTY_STAGING$PSEP"
6567

6668
# jine
@@ -88,7 +90,7 @@ case "$1" in
8890
-run) PROG_NAME="$ReplMain" && shift ;;
8991
-colors) colors=true && shift ;;
9092
-no-colors) unset colors && shift ;;
91-
-with-compiler) jvm_cp_args="$PSEP$DOTTY_COMP" && shift ;;
93+
-with-compiler) jvm_cp_args="$PSEP$DOTTY_COMP$PSEP$TASTY_CORE" && shift ;;
9294

9395
# break out -D and -J options and add them to java_args so
9496
# they reach the JVM in time to do some good. The -D options

dist/bin/dotd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ ST4_LIB=$(find_lib "*ST4*")
7676
# Set jsoup dep:
7777
JSOUP_LIB=$(find_lib "*jsoup*")
7878

79-
CLASS_PATH="$DOTTY_LIB$PSEP$DOTTY_COMP$PSEP$DOTTY_DOC_LIB$PSEP$DOTTY_INTF$PSEP$SBT_INTF$PSEP$DOTTY_STAGING"
79+
CLASS_PATH="$DOTTY_LIB$PSEP$DOTTY_COMP$PSEP$TASTY_CORE$PSEP$DOTTY_DOC_LIB$PSEP$DOTTY_INTF$PSEP$SBT_INTF$PSEP$DOTTY_STAGING"
8080
CLASS_PATH="$CLASS_PATH$PSEP$SCALA_LIB"
8181
CLASS_PATH="$CLASS_PATH$PSEP$FLEXMARK_LIBS"
8282
CLASS_PATH="$CLASS_PATH$PSEP$JACKSON_LIBS"

dist/bin/dotr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ elif [ $execute_repl == true ] || [ ${#residual_args[@]} -ne 0 ]; then
102102
echo "warning: multiple classpaths are found, dotr only use the last one."
103103
fi
104104
if [ $with_compiler == true ]; then
105-
cp_arg+="$PSEP$DOTTY_COMP$PSEP$DOTTY_INTF$PSEP$SCALA_ASM$PSEP$DOTTY_STAGING"
105+
cp_arg+="$PSEP$DOTTY_COMP$PSEP$TASTY_CORE$PSEP$DOTTY_INTF$PSEP$SCALA_ASM$PSEP$DOTTY_STAGING"
106106
fi
107107
eval exec "\"$JAVACMD\"" "$DEBUG" "-classpath \"$cp_arg\"" "${jvm_options[@]}" "${residual_args[@]}"
108108
else

project/Build.scala

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,6 @@ object Build {
362362
private lazy val dottydocClasspath = Def.task {
363363
val jars = (packageAll in `dotty-compiler`).value
364364
val dottyLib = jars("dotty-library")
365-
val dottyInterfaces = jars("dotty-interfaces")
366365
val otherDeps = (dependencyClasspath in Compile).value.map(_.data).mkString(File.pathSeparator)
367366
val externalDeps = externalCompilerClasspathTask.value
368367
dottyLib + File.pathSeparator + findArtifactPath(externalDeps, "scala-library")
@@ -575,7 +574,8 @@ object Build {
575574
val dottyCompiler = jars("dotty-compiler")
576575
val dottyStaging = jars("dotty-staging")
577576
val dottyInterfaces = jars("dotty-interfaces")
578-
run(insertClasspathInArgs(args1, List(dottyCompiler, dottyInterfaces, asm, dottyStaging).mkString(File.pathSeparator)))
577+
val tastyCore = jars("tasty-core")
578+
run(insertClasspathInArgs(args1, List(dottyCompiler, dottyInterfaces, asm, dottyStaging, tastyCore).mkString(File.pathSeparator)))
579579
} else run(args)
580580
},
581581

@@ -649,8 +649,9 @@ object Build {
649649
}
650650
val dottyInterfaces = jars("dotty-interfaces")
651651
val dottyStaging = jars("dotty-staging")
652+
val tastyCore = jars("tasty-core")
652653
val asm = findArtifactPath(externalDeps, "scala-asm")
653-
extraClasspath ++= Seq(dottyCompiler, dottyInterfaces, asm, dottyStaging)
654+
extraClasspath ++= Seq(dottyCompiler, dottyInterfaces, asm, dottyStaging, tastyCore)
654655
}
655656

656657
val fullArgs = main :: insertClasspathInArgs(args, extraClasspath.mkString(File.pathSeparator))
@@ -671,13 +672,13 @@ object Build {
671672
Map(
672673
"dotty-interfaces" -> packageBin.in(`dotty-interfaces`, Compile).value,
673674
"dotty-compiler" -> packageBin.in(Compile).value,
675+
"tasty-core" -> packageBin.in(`tasty-core`, Compile).value,
674676

675677
// NOTE: Using dotty-library-bootstrapped here is intentional: when
676678
// running the compiler, we should always have the bootstrapped
677679
// library on the compiler classpath since the non-bootstrapped one
678680
// may not be binary-compatible.
679-
"dotty-library" -> packageBin.in(`dotty-library-bootstrapped`, Compile).value,
680-
"tasty-core" -> packageBin.in(`tasty-core-bootstrapped`, Compile).value,
681+
"dotty-library" -> packageBin.in(`dotty-library-bootstrapped`, Compile).value
681682
).mapValues(_.getAbsolutePath)
682683
}
683684
}.value,
@@ -700,6 +701,7 @@ object Build {
700701
packageAll.in(`dotty-compiler`).value ++ Seq(
701702
"dotty-compiler" -> packageBin.in(Compile).value.getAbsolutePath,
702703
"dotty-staging" -> packageBin.in(LocalProject("dotty-staging"), Compile).value.getAbsolutePath,
704+
"tasty-core" -> packageBin.in(LocalProject("tasty-core-bootstrapped"), Compile).value.getAbsolutePath,
703705
)
704706
}
705707
)
@@ -729,11 +731,6 @@ object Build {
729731
case Bootstrapped => `dotty-library-bootstrapped`
730732
}
731733

732-
def tastyCore(implicit mode: Mode): Project = mode match {
733-
case NonBootstrapped => `tasty-core`
734-
case Bootstrapped => `tasty-core-bootstrapped`
735-
}
736-
737734
/** The dotty standard library compiled with the Scala.js back-end, to produce
738735
* the corresponding .sjsir files.
739736
*
@@ -751,9 +748,21 @@ object Build {
751748
(unmanagedSourceDirectories in (`dotty-library-bootstrapped`, Compile)).value,
752749
)
753750

751+
lazy val tastyCoreSettings = Seq(
752+
scalacOptions := {
753+
val (language, other) = scalacOptions.value.partition(_.startsWith("-language:"))
754+
other :+ (language.headOption.map(_ + ",Scala2Compat").getOrElse("-language:Scala2Compat"))
755+
}
756+
)
757+
754758
lazy val `tasty-core` = project.in(file("tasty")).asTastyCore(NonBootstrapped)
755759
lazy val `tasty-core-bootstrapped`: Project = project.in(file("tasty")).asTastyCore(Bootstrapped)
756760

761+
def tastyCore(implicit mode: Mode): Project = mode match {
762+
case NonBootstrapped => `tasty-core`
763+
case Bootstrapped => `tasty-core-bootstrapped`
764+
}
765+
757766
lazy val `dotty-staging` = project.in(file("staging")).
758767
withCommonSettings(Bootstrapped).
759768
// We want the compiler to be present in the compiler classpath when compiling this project but not
@@ -1298,7 +1307,8 @@ object Build {
12981307
settings(dottyLibrarySettings)
12991308

13001309
def asTastyCore(implicit mode: Mode): Project = project.withCommonSettings.
1301-
dependsOn(dottyLibrary)
1310+
dependsOn(dottyLibrary).
1311+
settings(tastyCoreSettings)
13021312

13031313
def asDottyDoc(implicit mode: Mode): Project = project.withCommonSettings.
13041314
dependsOn(dottyCompiler, dottyCompiler % "test->test").

0 commit comments

Comments
 (0)