File tree Expand file tree Collapse file tree 6 files changed +33
-0
lines changed Expand file tree Collapse file tree 6 files changed +33
-0
lines changed Original file line number Diff line number Diff line change @@ -64,6 +64,8 @@ testlogs/
6464local /
6565compiler /test /debug /Gen.jar
6666
67+ /bin /.cp
68+
6769before-pickling.txt
6870after-pickling.txt
6971bench /compile.txt
Original file line number Diff line number Diff line change 1+ cp=$(cat $ROOT/bin/.cp) 2> /dev/null
2+
3+ if [[ "$cp" == "" ]]; then
4+ echo "run 'sbt buildQuick' first"
5+ exit 1
6+ fi
Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+
3+ ROOT=" $( cd " $( dirname " ${BASH_SOURCE[0]} " ) " >& /dev/null && pwd) /.."
4+ . $ROOT /bin/commonQ
5+
6+ java -cp $cp dotty.tools.MainGenericRunner -usejavacp " $@ "
Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+
3+ ROOT=" $( cd " $( dirname " ${BASH_SOURCE[0]} " ) " >& /dev/null && pwd) /.."
4+ . $ROOT /bin/commonQ
5+
6+ java -cp $cp dotty.tools.MainGenericCompiler -usejavacp " $@ "
Original file line number Diff line number Diff line change @@ -81,6 +81,12 @@ $ scalac tests/pos/HelloWorld.scala
8181$ scala HelloWorld
8282```
8383
84+ Note that the ` scalac ` and ` scala ` scripts have slow roundtrip times when working on the compiler codebase: whenever
85+ any source file changes they invoke ` sbt dist/pack ` first.
86+
87+ As an alternative, run the ` buildQuick ` task in sbt. It builds the compiler and writes its classpath to the ` bin/.cp `
88+ file, which enables the ` scalacQ ` and ` scalaQ ` scripts in the ` bin/ ` folder.
89+
8490## Starting a REPL
8591
8692``` bash
Original file line number Diff line number Diff line change @@ -205,6 +205,8 @@ object Build {
205205
206206 val repl = taskKey[Unit ](" spawns a repl with the correct classpath" )
207207
208+ val buildQuick = taskKey[Unit ](" builds the compiler and writes the classpath to bin/.cp to enable the bin/scalacQ and bin/scalaQ scripts" )
209+
208210 // Compiles the documentation and static site
209211 val genDocs = inputKey[Unit ](" run scaladoc to generate static documentation site" )
210212
@@ -2136,6 +2138,11 @@ object Build {
21362138 // default.
21372139 addCommandAlias(" publishLocal" , " scala3-bootstrapped/publishLocal" ),
21382140 repl := (`scala3-compiler-bootstrapped` / repl).value,
2141+ buildQuick := {
2142+ val _ = (`scala3-compiler` / Compile / compile).value
2143+ val cp = (`scala3-compiler` / Compile / fullClasspath).value.map(_.data.getAbsolutePath).mkString(File .pathSeparator)
2144+ IO .write(baseDirectory.value / " bin" / " .cp" , cp)
2145+ },
21392146 (Compile / console) := (Compile / console).dependsOn(Def .task {
21402147 import _root_ .scala .io .AnsiColor ._
21412148 val msg = " `console` uses the reference Scala version. Use `repl` instead."
You can’t perform that action at this time.
0 commit comments