Skip to content

Commit 7ee14d6

Browse files
committed
simple scripts to run non-bootstrapped compiler after 'sbt buildQuick'
1 parent c36c390 commit 7ee14d6

File tree

6 files changed

+32
-0
lines changed

6 files changed

+32
-0
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,8 @@ testlogs/
6464
local/
6565
compiler/test/debug/Gen.jar
6666

67+
/bin/.cp
68+
6769
before-pickling.txt
6870
after-pickling.txt
6971
bench/compile.txt

bin/commonQ

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
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

bin/scalaQ

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
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 "$@"

bin/scalacQ

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
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.dotc.Main -usejavacp "$@"

bin/scaladocQ

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
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.scaladoc.Main -usejavacp "$@"

project/Build.scala

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,8 @@ object Build {
202202

203203
val repl = taskKey[Unit]("spawns a repl with the correct classpath")
204204

205+
val buildQuick = taskKey[Unit]("builds the compiler and enables bin/scalaQ, bin/scalacQ, bin/scaladocQ")
206+
205207
// Compiles the documentation and static site
206208
val genDocs = inputKey[Unit]("run scaladoc to generate static documentation site")
207209

@@ -2140,6 +2142,10 @@ object Build {
21402142
// default.
21412143
addCommandAlias("publishLocal", "scala3-bootstrapped/publishLocal"),
21422144
repl := (`scala3-compiler-bootstrapped` / repl).value,
2145+
buildQuick := {
2146+
val cp = (LocalProject("scaladoc") / Compile / fullClasspath).value.map(_.data.getAbsolutePath).mkString(":")
2147+
IO.write(baseDirectory.value / "bin" / ".cp", cp)
2148+
},
21432149
(Compile / console) := (Compile / console).dependsOn(Def.task {
21442150
import _root_.scala.io.AnsiColor._
21452151
val msg = "`console` uses the reference Scala version. Use `repl` instead."

0 commit comments

Comments
 (0)