Skip to content

Commit 9d5a51f

Browse files
Rename binaries from e.g. dotc to scalac
Rename projects & binaries in project/scripts Fix scala3-doc name in scalad Rename scalar to scala
1 parent af63b04 commit 9d5a51f

File tree

13 files changed

+84
-83
lines changed

13 files changed

+84
-83
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ local.sbt
2424
# npm
2525
node_modules
2626

27-
# VS Code
27+
# VS Code
2828
.vscode/
2929
# Metals
3030
.bloop/
@@ -87,3 +87,4 @@ community-build/sbt-dotty-sbt
8787

8888
# Vulpix output files
8989
*.check.out
90+
!/dist/bin/

bin/dotc renamed to bin/scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22

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

5-
"$ROOT/bin/common" "$ROOT/dist/target/pack/bin/dotc" "$@"
5+
"$ROOT/bin/common" "$ROOT/dist/target/pack/bin/scala" "$@"

bin/dotd renamed to bin/scalac

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22

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

5-
"$ROOT/bin/common" "$ROOT/dist/target/pack/bin/dotd" "$@"
5+
"$ROOT/bin/common" "$ROOT/dist/target/pack/bin/scalac" "$@"

bin/dotr renamed to bin/scalad

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22

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

5-
"$ROOT/bin/common" "$ROOT/dist/target/pack/bin/dotr" "$@"
5+
"$ROOT/bin/common" "$ROOT/dist/target/pack/bin/scalad" "$@"

bin/test/TestScripts.scala

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -45,53 +45,53 @@ class TestScripts {
4545
@Before def buildUp = deletePackages
4646
@After def tearDown = deletePackages
4747

48-
/** bin/dotc script should be able to build hello world and successfully
49-
* execute it using dotr
48+
/** bin/scalac script should be able to build hello world and successfully
49+
* execute it using scala
5050
*/
5151
@Test def buildAndRunHelloWorld = doUnlessWindows {
52-
val (retDotc, dotcOutput) = executeScript("./bin/dotc ./tests/pos/HelloWorld.scala")
52+
val (retDotc, dotcOutput) = executeScript("./bin/scalac ./tests/pos/HelloWorld.scala")
5353

54-
// Check correct output of building and running dotc
54+
// Check correct output of building and running scalac
5555
assert(
5656
retDotc == 0,
57-
s"bin/dotc script did not run properly. Output:$lineSep$dotcOutput"
57+
s"bin/scalac script did not run properly. Output:$lineSep$dotcOutput"
5858
)
5959

60-
val (retDotr, dotrOutput) = executeScript("./bin/dotr HelloWorld")
60+
val (retDotr, dotrOutput) = executeScript("./bin/scala HelloWorld")
6161
assert(
6262
retDotr == 0 && dotrOutput == "hello world\n",
6363
s"Running hello world exited with status: $retDotr and output: $dotrOutput"
6464
)
6565
}
6666

67-
/** bin/dotc script should be able to detect changes in dotty sources and
67+
/** bin/scalac script should be able to detect changes in dotty sources and
6868
* rebuild dotty if needed
6969
*/
7070
@Test def rebuildIfNecessary = doUnlessWindows {
71-
val (retFirstBuild, out1) = executeScript("./bin/dotc ./tests/pos/HelloWorld.scala")
72-
assert(retFirstBuild == 0, s"building dotc failed: $out1")
71+
val (retFirstBuild, out1) = executeScript("./bin/scalac ./tests/pos/HelloWorld.scala")
72+
assert(retFirstBuild == 0, s"building scalac failed: $out1")
7373

7474
// Create a new file to force rebuild
7575
new JFile("./compiler/src/dotty/tools/dotc/Dummy.scala").createNewFile()
7676

77-
val (retSecondBuild, output) = executeScript("./bin/dotc ./tests/pos/HelloWorld.scala")
77+
val (retSecondBuild, output) = executeScript("./bin/scalac ./tests/pos/HelloWorld.scala")
7878
assert(
7979
retSecondBuild == 0 && output.contains("rebuilding"),
8080
s"Rebuilding the tool should result in jar files being rebuilt. Status: $retSecondBuild, output:$lineSep$output")
8181
}
8282

83-
/** if no changes to dotty, dotc script should be fast */
83+
/** if no changes to dotty, scalac script should be fast */
8484
@Test def beFastOnNoChanges = doUnlessWindows {
85-
val (retFirstBuild, _) = executeScript("./bin/dotc ./tests/pos/HelloWorld.scala")
86-
assert(retFirstBuild == 0, "building dotc failed")
85+
val (retFirstBuild, _) = executeScript("./bin/scalac ./tests/pos/HelloWorld.scala")
86+
assert(retFirstBuild == 0, "building scalac failed")
8787

88-
val (ret, output) = executeScript("./bin/dotc ./tests/pos/HelloWorld.scala")
88+
val (ret, output) = executeScript("./bin/scalac ./tests/pos/HelloWorld.scala")
8989
assert(
9090
ret == 0 && !output.contains("rebuilding"),
9191
s"Project recompiled when it didn't need to be. Status $ret, output:$lineSep$output")
9292
}
9393

94-
/** dotc script should work after corrupting .packages */
94+
/** scalac script should work after corrupting .packages */
9595
@Test def reCreatesPackagesIfNecessary = doUnlessWindows {
9696
import java.nio.file.{Paths, Files}
9797
import java.nio.charset.StandardCharsets
@@ -104,8 +104,8 @@ class TestScripts {
104104

105105
Files.write(Paths.get("./.packages"), contents.getBytes(StandardCharsets.UTF_8))
106106

107-
val (retFirstBuild, output) = executeScript("./bin/dotc ./tests/pos/HelloWorld.scala")
107+
val (retFirstBuild, output) = executeScript("./bin/scalac ./tests/pos/HelloWorld.scala")
108108
assert(output.contains(".packages file corrupted"))
109-
assert(retFirstBuild == 0, "building dotc failed")
109+
assert(retFirstBuild == 0, "building scalac failed")
110110
}
111111
}

dist/bin/common

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -104,11 +104,11 @@ find_lib () {
104104
fi
105105
}
106106

107-
DOTTY_COMP=$(find_lib "*dotty-compiler*")
108-
DOTTY_INTF=$(find_lib "*dotty-interfaces*")
109-
DOTTY_LIB=$(find_lib "*dotty-library*")
110-
DOTTY_STAGING=$(find_lib "*dotty-staging*")
111-
DOTTY_TASTY_INSPECTOR=$(find_lib "*dotty-tasty-inspector*")
107+
DOTTY_COMP=$(find_lib "*scala3-compiler*")
108+
DOTTY_INTF=$(find_lib "*scala3-interfaces*")
109+
DOTTY_LIB=$(find_lib "*scala3-library*")
110+
DOTTY_STAGING=$(find_lib "*scala3-staging*")
111+
DOTTY_TASTY_INSPECTOR=$(find_lib "*scala3-tasty-inspector*")
112112
TASTY_CORE=$(find_lib "*tasty-core*")
113113
SCALA_ASM=$(find_lib "*scala-asm*")
114114
SCALA_LIB=$(find_lib "*scala-library*")

dist/bin/dotr renamed to dist/bin/scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,8 @@ if [ $execute_repl == true ] || ([ $execute_run == false ] && [ $options_indicat
8989
if [ "$CLASS_PATH" ]; then
9090
cp_arg="-classpath \"$CLASS_PATH\""
9191
fi
92-
echo "Starting dotty REPL..."
93-
eval "\"$PROG_HOME/bin/dotc\" $cp_arg ${java_options[@]} -repl ${residual_args[@]}"
92+
echo "Starting scala3 REPL..."
93+
eval "\"$PROG_HOME/bin/scalac\" $cp_arg ${java_options[@]} -repl ${residual_args[@]}"
9494
elif [ $execute_repl == true ] || [ ${#residual_args[@]} -ne 0 ]; then
9595
cp_arg="$DOTTY_LIB$PSEP$SCALA_LIB"
9696
if [ -z "$CLASS_PATH" ]; then
@@ -99,7 +99,7 @@ elif [ $execute_repl == true ] || [ ${#residual_args[@]} -ne 0 ]; then
9999
cp_arg+="$PSEP$CLASS_PATH"
100100
fi
101101
if [ "$class_path_count" -gt 1 ]; then
102-
echo "warning: multiple classpaths are found, dotr only use the last one."
102+
echo "warning: multiple classpaths are found, scala only use the last one."
103103
fi
104104
if [ $with_compiler == true ]; then
105105
cp_arg+="$PSEP$DOTTY_COMP$PSEP$TASTY_CORE$PSEP$DOTTY_INTF$PSEP$SCALA_ASM$PSEP$DOTTY_STAGING$PSEP$DOTTY_TASTY_INSPECTOR"
File renamed without changes.

dist/bin/dotd renamed to dist/bin/scalad

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ fi
2929

3030
source "$PROG_HOME/bin/common"
3131

32-
# Set dotty-doc dep:
33-
DOTTY_DOC_LIB=$(find_lib "*dotty-doc*")
32+
# Set scala3-doc dep:
33+
DOTTY_DOC_LIB=$(find_lib "*scala3-doc*")
3434

3535
# Set flexmark deps:
3636
FLEXMARK_LIBS=""

project/Build.scala

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -114,11 +114,11 @@ object Build {
114114
// Spawns a repl with the correct classpath
115115
val repl = inputKey[Unit]("run the REPL with correct classpath")
116116

117-
// Used to compile files similar to ./bin/dotc script
118-
val dotc = inputKey[Unit]("run the compiler using the correct classpath, or the user supplied classpath")
117+
// Used to compile files similar to ./bin/scalac script
118+
val scalac = inputKey[Unit]("run the compiler using the correct classpath, or the user supplied classpath")
119119

120-
// Used to run binaries similar to ./bin/dotr script
121-
val dotr = inputKey[Unit]("run compiled binary using the correct classpath, or the user supplied classpath")
120+
// Used to run binaries similar to ./bin/scala script
121+
val scala = inputKey[Unit]("run compiled binary using the correct classpath, or the user supplied classpath")
122122

123123
// Compiles the documentation and static site
124124
val genDocs = inputKey[Unit]("run dottydoc to generate static documentation site")
@@ -557,7 +557,7 @@ object Build {
557557
}
558558
}.evaluated,
559559

560-
dotr := {
560+
scala := {
561561
val args: List[String] = spaceDelimited("<arg>").parsed.toList
562562
val externalDeps = externalCompilerClasspathTask.value
563563
val jars = packageAll.value
@@ -571,7 +571,7 @@ object Build {
571571
}
572572

573573
if (args.isEmpty) {
574-
println("Couldn't run `dotr` without args. Use `repl` to run the repl or add args to run the dotty application")
574+
println("Couldn't run `scala` without args. Use `repl` to run the repl or add args to run the dotty application")
575575
} else if (scalaLib == "") {
576576
println("Couldn't find scala-library on classpath, please run using script in bin dir instead")
577577
} else if (args.contains("-with-compiler")) {
@@ -586,8 +586,8 @@ object Build {
586586
} else run(args)
587587
},
588588

589-
run := dotc.evaluated,
590-
dotc := runCompilerMain().evaluated,
589+
run := scalac.evaluated,
590+
scalac := runCompilerMain().evaluated,
591591
repl := runCompilerMain(repl = true).evaluated,
592592

593593
/* Add the sources of scalajs-ir.
@@ -1021,7 +1021,7 @@ object Build {
10211021
(
10221022
(dir / "shared/src/test/scala" ** (("*.scala": FileFilter)
10231023
-- "ReflectiveCallTest.scala" // uses many forms of structural calls that are not allowed in Scala 3 anymore
1024-
-- "EnumerationTest.scala" // scala.Enumeration support for Scala.js is not implemented in dotc (yet)
1024+
-- "EnumerationTest.scala" // scala.Enumeration support for Scala.js is not implemented in scalac (yet)
10251025
)).get
10261026

10271027
++ (dir / "shared/src/test/require-sam" ** "*.scala").get

0 commit comments

Comments
 (0)