Skip to content

Commit

Permalink
simple scripts to run non-bootstrapped compiler after 'sbt buildQuick'
Browse files Browse the repository at this point in the history
  • Loading branch information
lrytz committed Mar 6, 2024
1 parent c36c390 commit 7ee14d6
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ testlogs/
local/
compiler/test/debug/Gen.jar

/bin/.cp

before-pickling.txt
after-pickling.txt
bench/compile.txt
Expand Down
6 changes: 6 additions & 0 deletions bin/commonQ
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
cp=$(cat $ROOT/bin/.cp) 2> /dev/null

if [[ "$cp" == "" ]]; then
echo "run 'sbt buildQuick' first"
exit 1
fi
6 changes: 6 additions & 0 deletions bin/scalaQ
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/usr/bin/env bash

ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")" >& /dev/null && pwd)/.."
. $ROOT/bin/commonQ

java -cp $cp dotty.tools.MainGenericRunner -usejavacp "$@"
6 changes: 6 additions & 0 deletions bin/scalacQ
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/usr/bin/env bash

ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")" >& /dev/null && pwd)/.."
. $ROOT/bin/commonQ

java -cp $cp dotty.tools.dotc.Main -usejavacp "$@"
6 changes: 6 additions & 0 deletions bin/scaladocQ
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/usr/bin/env bash

ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")" >& /dev/null && pwd)/.."
. $ROOT/bin/commonQ

java -cp $cp dotty.tools.scaladoc.Main -usejavacp "$@"
6 changes: 6 additions & 0 deletions project/Build.scala
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,8 @@ object Build {

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

val buildQuick = taskKey[Unit]("builds the compiler and enables bin/scalaQ, bin/scalacQ, bin/scaladocQ")

// Compiles the documentation and static site
val genDocs = inputKey[Unit]("run scaladoc to generate static documentation site")

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

0 comments on commit 7ee14d6

Please sign in to comment.