Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion compiler/src/dotty/tools/dotc/config/PathResolver.scala
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ class PathResolver(using c: Context) {
*/
object Calculated {
def scalaHome: String = Defaults.scalaHome
def useJavaClassPath: Boolean = settings.usejavacp.value || Defaults.useJavaClassPath
def useJavaClassPath: Boolean = settings.Yusejavacp.value || Defaults.useJavaClassPath
def javaBootClassPath: String = cmdLineOrElse("javabootclasspath", Defaults.javaBootClassPath)
def javaExtDirs: String = cmdLineOrElse("javaextdirs", Defaults.javaExtDirs)
def javaUserClassPath: String = if (useJavaClassPath) Defaults.javaUserClassPath else ""
Expand Down
5 changes: 2 additions & 3 deletions compiler/src/dotty/tools/dotc/config/ScalaSettings.scala
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,6 @@ trait CommonScalaSettings:

/* Other settings */
val encoding: Setting[String] = StringSetting(RootSetting, "encoding", "encoding", "Specify character encoding used by source files.", Properties.sourceEncoding, aliases = List("--encoding"))
val usejavacp: Setting[Boolean] = BooleanSetting(RootSetting, "usejavacp", "Utilize the java.class.path in classpath resolution.", aliases = List("--use-java-class-path"))
val scalajs: Setting[Boolean] = BooleanSetting(RootSetting, "scalajs", "Compile in Scala.js mode (requires scalajs-library.jar on the classpath).", aliases = List("--scalajs"))
val replInitScript: Setting[String] = StringSetting(RootSetting, "repl-init-script", "code", "The code will be run on REPL startup.", "", aliases = List("--repl-init-script"))
val replQuitAfterInit: Setting[Boolean] = BooleanSetting(RootSetting, "repl-quit-after-init", "Quit REPL after evaluating the init script.", aliases = List("--repl-quit-after-init"))
Expand Down Expand Up @@ -403,12 +402,12 @@ private sealed trait YSettings:
val YlogClasspath: Setting[Boolean] = BooleanSetting(ForkSetting, "Ylog-classpath", "Output information about what classpath is being applied.")
val YdisableFlatCpCaching: Setting[Boolean] = BooleanSetting(ForkSetting, "YdisableFlatCpCaching", "Do not cache flat classpath representation of classpath elements from jars across compiler instances.")
val YnoStdlibPatches: Setting[Boolean] = BooleanSetting(ForkSetting, "Yno-stdlib-patches", "Do not patch stdlib files (temporary and only to be used for the stdlib migration)", false)

val Yreporter: Setting[String] = StringSetting(ForkSetting, name = "Yreporter", helpArg = "<class>", descr = "Specify a dotty.tools.dotc.reporting.Reporter", default = "dotty.tools.dotc.reporting.ConsoleReporter")

val Yscala2Unpickler: Setting[String] = StringSetting(ForkSetting, "Yscala2-unpickler", "", "Control where we may get Scala 2 symbols from. This is either \"always\", \"never\", or a classpath.", "always")

val YnoImports: Setting[Boolean] = BooleanSetting(ForkSetting, "Yno-imports", "Compile without importing scala.*, java.lang.*, or Predef.")

val Yimports: Setting[List[String]] = MultiStringSetting(ForkSetting, "Yimports", helpArg="", "Custom root imports. If set, none of scala.*, java.lang.*, or Predef.* will be imported unless explicitly included.")
val YnoPredef: Setting[Boolean] = BooleanSetting(ForkSetting, "Yno-predef", "Compile without importing Predef.")
val Yskip: Setting[List[String]] = PhasesSetting(ForkSetting, "Yskip", "Skip")
Expand Down Expand Up @@ -447,8 +446,8 @@ private sealed trait YSettings:
val YprofileExternalTool: Setting[List[String]] = PhasesSetting(ForkSetting, "Yprofile-external-tool", "Enable profiling for a phase using an external tool hook. Generally only useful for a single phase.", "typer", depends = List(YprofileEnabled -> true))
val YprofileRunGcBetweenPhases: Setting[List[String]] = PhasesSetting(ForkSetting, "Yprofile-run-gc", "Run a GC between phases - this allows heap size to be accurate at the expense of more time. Specify a list of phases, or *", "_", depends = List(YprofileEnabled -> true))
val YprofileTrace: Setting[String] = StringSetting(ForkSetting, "Yprofile-trace", "file", s"Capture trace of compilation in JSON Chrome Trace format to the specified file. This option requires ${YprofileEnabled.name}. The output file can be visualized using https://ui.perfetto.dev/.", "", depends = List(YprofileEnabled -> true))

val YbestEffort: Setting[Boolean] = BooleanSetting(ForkSetting, "Ybest-effort", "Enable best-effort compilation attempting to produce betasty to the META-INF/best-effort directory, regardless of errors, as part of the pickler phase.")
val Yusejavacp: Setting[Boolean] = BooleanSetting(ForkSetting, "Yusejavacp", "Utilize the java.class.path in classpath resolution.", aliases = List("--use-java-class-path", "-usejavacp", "--usejavacp"))
val YwithBestEffortTasty: Setting[Boolean] = BooleanSetting(ForkSetting, "Ywith-best-effort-tasty", "Allow to compile using best-effort tasty files. If such file is used, the compiler will stop after the pickler phase.")

val YmagicOffsetHeader: Setting[String] = StringSetting(ForkSetting, "Ymagic-offset-header", "header", "Specify the magic header comment that marks the start of the actual code in generated wrapper scripts. Example: -Ymagic-offset-header:SOURCE_CODE_START. Then, in the source, the magic comment `///SOURCE_CODE_START:<ORIGINAL_FILE_PATH>` marks the start of user code. The comment should be suffixed by `:<ORIGINAL_FILE_PATH>` to indicate the original file.", "")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class MultiReleaseJarTest extends dotty.tools.backend.jvm.DottyBytecodeTest {

def apiMethods(jarPath: Path, release: String): Set[String] = {
given ctx: Context = initCtx.fresh
ctx.settings.usejavacp.update(true)
ctx.settings.Yusejavacp.update(true)
ctx.settings.classpath.update(jarPath.toAbsolutePath.toString)
ctx.settings.javaOutputVersion.update(release)
ctx.initialize()
Expand Down Expand Up @@ -76,7 +76,7 @@ class MultiReleaseJarTest extends dotty.tools.backend.jvm.DottyBytecodeTest {

def classExists(className: String, release: String): Boolean = {
given ctx: Context = initCtx.fresh
ctx.settings.usejavacp.update(true)
ctx.settings.Yusejavacp.update(true)
ctx.settings.javaOutputVersion.update(release)
ctx.initialize()
val classFile = ctx.platform.classPath.findClassFile(className)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import dotty.tools.io.{AbstractFile, VirtualDirectory}

class SnippetCompilerTest {
val compiler = SnippetCompiler(
Seq(SnippetCompilerSetting(testContext.settings.usejavacp, true))
Seq(SnippetCompilerSetting(testContext.settings.Yusejavacp, true))
)
def wrapFn: String => WrappedSnippet = (str: String) => WrappedSnippet(
str,
Expand Down
2 changes: 1 addition & 1 deletion scaladoc/test/dotty/tools/scaladoc/testUtils.scala
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def testArgs(files: Seq[File] = Nil, dest: File = new File("notUsed")) = Scalado

def testContext =
val ctx = (new ContextBase).initialCtx.fresh.setReporter(new TestReporter)
ctx.setSetting(ctx.settings.usejavacp, true)
ctx.setSetting(ctx.settings.Yusejavacp, true)
ctx

def testDocContext(files: Seq[File] = Nil) = DocContext(testArgs(files), testContext)
Expand Down
Loading