File tree 6 files changed +33
-0
lines changed
6 files changed +33
-0
lines changed Original file line number Diff line number Diff line change @@ -64,6 +64,8 @@ testlogs/
64
64
local /
65
65
compiler /test /debug /Gen.jar
66
66
67
+ /bin /.cp
68
+
67
69
before-pickling.txt
68
70
after-pickling.txt
69
71
bench /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
81
81
$ scala HelloWorld
82
82
```
83
83
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
+
84
90
## Starting a REPL
85
91
86
92
``` bash
Original file line number Diff line number Diff line change @@ -205,6 +205,8 @@ object Build {
205
205
206
206
val repl = taskKey[Unit ](" spawns a repl with the correct classpath" )
207
207
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
+
208
210
// Compiles the documentation and static site
209
211
val genDocs = inputKey[Unit ](" run scaladoc to generate static documentation site" )
210
212
@@ -2136,6 +2138,11 @@ object Build {
2136
2138
// default.
2137
2139
addCommandAlias(" publishLocal" , " scala3-bootstrapped/publishLocal" ),
2138
2140
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
+ },
2139
2146
(Compile / console) := (Compile / console).dependsOn(Def .task {
2140
2147
import _root_ .scala .io .AnsiColor ._
2141
2148
val msg = " `console` uses the reference Scala version. Use `repl` instead."
You can’t perform that action at this time.
0 commit comments