Skip to content

Commit 6eb5081

Browse files
authored
Add support for some missing Scala compiler options & aliases without the need for -O (#3665)
1 parent 5fcc579 commit 6eb5081

File tree

1 file changed

+31
-3
lines changed

1 file changed

+31
-3
lines changed

modules/cli/src/main/scala/scala/cli/commands/shared/ScalacOptions.scala

Lines changed: 31 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,31 +52,58 @@ object ScalacOptions {
5252
private val replAliasedOptions = Set(replInitScript)
5353
private val scalacAliasedOptions = // these options don't require being passed after -O and accept an arg
5454
Set(
55+
"bootclasspath",
56+
"boot-class-path",
5557
"coverage-exclude-classlikes",
5658
"coverage-exclude-files",
5759
"encoding",
60+
"extdirs",
61+
"extension-directories",
62+
"javabootclasspath",
63+
"java-boot-class-path",
64+
"javaextdirs",
65+
"java-extension-directories",
66+
"java-output-version",
5867
"release",
5968
"color",
6069
"g",
6170
"language",
6271
"opt",
72+
"pagewidth",
73+
"page-width",
6374
"target",
75+
"scalajs-mapSourceURI",
76+
"scalajs-genStaticForwardersForNonTopLevelObjects",
6477
"source",
78+
"sourcepath",
79+
"source-path",
80+
"sourceroot",
6581
YScriptRunnerOption
6682
) ++ replAliasedOptions
6783
private val scalacNoArgAliasedOptions = // these options don't require being passed after -O and don't accept an arg
6884
Set(
6985
"experimental",
7086
"explain",
87+
"explaintypes",
88+
"explain-types",
89+
"explain-cyclic",
90+
"from-tasty",
7191
"unchecked",
7292
"nowarn",
93+
"no-warnings",
7394
"feature",
7495
"deprecation",
7596
"rewrite",
97+
"scalajs",
7698
"old-syntax",
99+
"print-tasty",
100+
"print-lines",
77101
"new-syntax",
78102
"indent",
79-
"no-indent"
103+
"no-indent",
104+
"preview",
105+
"uniqid",
106+
"unique-id"
80107
)
81108

82109
/** This includes all the scalac options which disregard inputs and print a help and/or context
@@ -97,8 +124,9 @@ object ScalacOptions {
97124
/** This includes all the scalac options which are redirected to native Scala CLI options. */
98125
val ScalaCliRedirectedOptions: Set[String] = Set(
99126
"classpath",
100-
"cp", // redirected to --extra-jars
101-
"d" // redirected to --compilation-output
127+
"cp", // redirected to --extra-jars
128+
"class-path", // redirected to --extra-jars
129+
"d" // redirected to --compilation-output
102130
)
103131
val ScalacDeprecatedOptions: Set[String] = Set(
104132
YScriptRunnerOption // old 'scala' runner specific, no longer supported

0 commit comments

Comments
 (0)