From b8f9bdb0fd025afc3a8e87bfcc60ec4d68009b40 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Micheloud?= Date: Fri, 13 Nov 2020 10:03:09 +0100 Subject: [PATCH 01/21] improved readability of help messages --- .../tools/dotc/config/CompilerCommand.scala | 61 ++++++++++++++----- 1 file changed, 47 insertions(+), 14 deletions(-) diff --git a/compiler/src/dotty/tools/dotc/config/CompilerCommand.scala b/compiler/src/dotty/tools/dotc/config/CompilerCommand.scala index 71b36709fb67..b128c3fbd91c 100644 --- a/compiler/src/dotty/tools/dotc/config/CompilerCommand.scala +++ b/compiler/src/dotty/tools/dotc/config/CompilerCommand.scala @@ -3,6 +3,8 @@ package config import java.nio.file.{Files, Paths} +import org.jline.terminal.TerminalBuilder + import Settings._ import core.Contexts._ import Properties._ @@ -67,11 +69,42 @@ object CompilerCommand { def checkUsage(summary: ArgsSummary, sourcesRequired: Boolean)(using Context): List[String] = { val settings = ctx.settings - /** Creates a help message for a subset of options based on cond */ - def availableOptionsMsg(cond: Setting[?] => Boolean): String = { - val ss = (ctx.settings.allSettings filter cond).toList sortBy (_.name) - val width = (ss map (_.name.length)).max - def format(s: String) = ("%-" + width + "s") format s + /** Creates a help message for a subset of options based on cond; + * terminalWidth = 0 means no terminal is available. + */ + def availableOptionsMsg(cond: Setting[?] => Boolean, terminalWidth: Int = 0): String = { + val ss = (settings.allSettings filter cond).toList sortBy (_.name) + val maxNameWidth = 30 + val nameWidths = ss.map(_.name.length).partition(_ < maxNameWidth)._1 + val width = if nameWidths.nonEmpty then nameWidths.max else maxNameWidth + val (nameWidth, descriptionWidth) = { + val w1 = + if width < maxNameWidth then width + else maxNameWidth + val w2 = + if terminalWidth < w1 + maxNameWidth then 0 + else terminalWidth - w1 - 1 + (w1, w2) + } + def formatName(name: String) = + if name.length <= nameWidth then ("%-" + nameWidth + "s") format name + else (name + "\n%-" + nameWidth + "s") format "" + def formatDescription(text: String): String = + if descriptionWidth == 0 then text + else if text.length < descriptionWidth then text + else { + val inx = text.substring(0, descriptionWidth).lastIndexOf(" ") + if inx < 0 then text + else + val str = text.substring(0, inx) + s"${str}\n${formatName("")} ${formatDescription(text.substring(inx + 1))}" + } + def formatSetting(name: String, value: String) = + if (value.nonEmpty) + // the format here is helping to make empty padding and put the additional information exactly under the description. + s"\n${formatName("")} $name: $value." + else + "" def helpStr(s: Setting[?]) = { def defaultValue = s.default match { case _: Int | _: String => s.default.toString @@ -80,13 +113,7 @@ object CompilerCommand { // For example 'false' for the version command. "" } - def formatSetting(name: String, value: String) = - if (value.nonEmpty) - // the format here is helping to make empty padding and put the additional information exactly under the description. - s"\n${format("")} $name: $value." - else - "" - s"${format(s.name)} ${s.description}${formatSetting("Default", defaultValue)}${formatSetting("Choices", s.legalChoices)}" + s"${formatName(s.name)} ${formatDescription(s.description)}${formatSetting("Default", defaultValue)}${formatSetting("Choices", s.legalChoices)}" } ss map helpStr mkString "\n" } @@ -97,8 +124,14 @@ object CompilerCommand { Some(explainAdvanced) filter (_ => shouldExplain), Some(label + " options include:") ).flatten mkString "\n" - - prefix + "\n" + availableOptionsMsg(cond) + try + // Use terminal width if terminal is available (see repl.JLineTerminal) + val terminal = TerminalBuilder.builder().dumb(false).build() + val usageMsg = prefix + "\n" + availableOptionsMsg(cond, terminal.getWidth) + terminal.close() + usageMsg + catch _ => + prefix + "\n" + availableOptionsMsg(cond) } def isStandard(s: Setting[?]): Boolean = !isAdvanced(s) && !isPrivate(s) From 161b012ae3dab6853f740838287d8c5256ca805f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Micheloud?= Date: Sat, 14 Nov 2020 00:39:07 +0100 Subject: [PATCH 02/21] removed dependency on jline terminal --- .../tools/dotc/config/CompilerCommand.scala | 30 +++++++++---------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/compiler/src/dotty/tools/dotc/config/CompilerCommand.scala b/compiler/src/dotty/tools/dotc/config/CompilerCommand.scala index b128c3fbd91c..db6a3011f362 100644 --- a/compiler/src/dotty/tools/dotc/config/CompilerCommand.scala +++ b/compiler/src/dotty/tools/dotc/config/CompilerCommand.scala @@ -3,8 +3,6 @@ package config import java.nio.file.{Files, Paths} -import org.jline.terminal.TerminalBuilder - import Settings._ import core.Contexts._ import Properties._ @@ -69,14 +67,22 @@ object CompilerCommand { def checkUsage(summary: ArgsSummary, sourcesRequired: Boolean)(using Context): List[String] = { val settings = ctx.settings - /** Creates a help message for a subset of options based on cond; - * terminalWidth = 0 means no terminal is available. - */ - def availableOptionsMsg(cond: Setting[?] => Boolean, terminalWidth: Int = 0): String = { + /** Creates a help message for a subset of options based on cond */ + def availableOptionsMsg(cond: Setting[?] => Boolean): String = { val ss = (settings.allSettings filter cond).toList sortBy (_.name) val maxNameWidth = 30 val nameWidths = ss.map(_.name.length).partition(_ < maxNameWidth)._1 - val width = if nameWidths.nonEmpty then nameWidths.max else maxNameWidth + val width = if nameWidths.nonEmpty then nameWidths.max else maxNameWidth + val terminalWidth = + val pageWidth = settings.pageWidth.value + val columnsVar = System.getenv("COLUMNS") + if columnsVar != null then columnsVar.toInt + else if Properties.isWin then + val ansiconVar = System.getenv("ANSICON") // eg. "142x32766 (142x26)" + if ansiconVar != null && ansiconVar.matches("[0-9]+x.*") then + ansiconVar.substring(0, ansiconVar.indexOf("x")).toInt + else pageWidth + else pageWidth val (nameWidth, descriptionWidth) = { val w1 = if width < maxNameWidth then width @@ -124,14 +130,8 @@ object CompilerCommand { Some(explainAdvanced) filter (_ => shouldExplain), Some(label + " options include:") ).flatten mkString "\n" - try - // Use terminal width if terminal is available (see repl.JLineTerminal) - val terminal = TerminalBuilder.builder().dumb(false).build() - val usageMsg = prefix + "\n" + availableOptionsMsg(cond, terminal.getWidth) - terminal.close() - usageMsg - catch _ => - prefix + "\n" + availableOptionsMsg(cond) + + prefix + "\n" + availableOptionsMsg(cond) } def isStandard(s: Setting[?]): Boolean = !isAdvanced(s) && !isPrivate(s) From 33d8b63988107d26cf3f95ee29446f8b70e90a26 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Micheloud?= Date: Sat, 14 Nov 2020 09:34:04 +0100 Subject: [PATCH 03/21] added defaultPageWidth into ScalaSettings --- .../dotty/tools/dotc/config/CompilerCommand.scala | 11 +---------- .../dotty/tools/dotc/config/ScalaSettings.scala | 14 +++++++++++++- 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/compiler/src/dotty/tools/dotc/config/CompilerCommand.scala b/compiler/src/dotty/tools/dotc/config/CompilerCommand.scala index db6a3011f362..638dc02a0037 100644 --- a/compiler/src/dotty/tools/dotc/config/CompilerCommand.scala +++ b/compiler/src/dotty/tools/dotc/config/CompilerCommand.scala @@ -73,16 +73,7 @@ object CompilerCommand { val maxNameWidth = 30 val nameWidths = ss.map(_.name.length).partition(_ < maxNameWidth)._1 val width = if nameWidths.nonEmpty then nameWidths.max else maxNameWidth - val terminalWidth = - val pageWidth = settings.pageWidth.value - val columnsVar = System.getenv("COLUMNS") - if columnsVar != null then columnsVar.toInt - else if Properties.isWin then - val ansiconVar = System.getenv("ANSICON") // eg. "142x32766 (142x26)" - if ansiconVar != null && ansiconVar.matches("[0-9]+x.*") then - ansiconVar.substring(0, ansiconVar.indexOf("x")).toInt - else pageWidth - else pageWidth + val terminalWidth = settings.pageWidth.value val (nameWidth, descriptionWidth) = { val w1 = if width < maxNameWidth then width diff --git a/compiler/src/dotty/tools/dotc/config/ScalaSettings.scala b/compiler/src/dotty/tools/dotc/config/ScalaSettings.scala index 9b8193648a62..a0d7f3b6dd1e 100644 --- a/compiler/src/dotty/tools/dotc/config/ScalaSettings.scala +++ b/compiler/src/dotty/tools/dotc/config/ScalaSettings.scala @@ -11,6 +11,18 @@ class ScalaSettings extends Settings.SettingGroup { protected def defaultClasspath: String = sys.env.getOrElse("CLASSPATH", ".") + protected def defaultPageWidth: Int = { + val defaultWidth = 80 + val columnsVar = System.getenv("COLUMNS") + if columnsVar != null then columnsVar.toInt + else if Properties.isWin then + val ansiconVar = System.getenv("ANSICON") // eg. "142x32766 (142x26)" + if ansiconVar != null && ansiconVar.matches("[0-9]+x.*") then + ansiconVar.substring(0, ansiconVar.indexOf("x")).toInt + else defaultWidth + else defaultWidth + } + /** Path related settings */ val bootclasspath: Setting[String] = PathSetting("-bootclasspath", "Override location of bootstrap class files.", Defaults.scalaBootClassPath) withAbbreviation "--boot-class-path" val extdirs: Setting[String] = PathSetting("-extdirs", "Override location of installed extensions.", Defaults.scalaExtDirs) withAbbreviation "--extension-directories" @@ -41,7 +53,7 @@ class ScalaSettings extends Settings.SettingGroup { val usejavacp: Setting[Boolean] = BooleanSetting("-usejavacp", "Utilize the java.class.path in classpath resolution.") withAbbreviation "--use-java-class-path" val verbose: Setting[Boolean] = BooleanSetting("-verbose", "Output messages about what the compiler is doing.") withAbbreviation "--verbose" val version: Setting[Boolean] = BooleanSetting("-version", "Print product version and exit.") withAbbreviation "--version" - val pageWidth: Setting[Int] = IntSetting("-pagewidth", "Set page width", 80) withAbbreviation "--page-width" + val pageWidth: Setting[Int] = IntSetting("-pagewidth", "Set page width", defaultPageWidth) withAbbreviation "--page-width" val language: Setting[List[String]] = MultiStringSetting("-language", "feature", "Enable one or more language features.") withAbbreviation "--language" val rewrite: Setting[Option[Rewrites]] = OptionSetting[Rewrites]("-rewrite", "When used in conjunction with a `...-migration` source version, rewrites sources to migrate to new version.") withAbbreviation "--rewrite" val silentWarnings: Setting[Boolean] = BooleanSetting("-nowarn", "Silence all warnings.") withAbbreviation "--no-warnings" From 29c552ddf5640eb5496705041249a54d02a922e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Micheloud?= Date: Fri, 13 Nov 2020 10:03:09 +0100 Subject: [PATCH 04/21] improved readability of help messages --- .../tools/dotc/config/CompilerCommand.scala | 61 ++++++++++++++----- 1 file changed, 47 insertions(+), 14 deletions(-) diff --git a/compiler/src/dotty/tools/dotc/config/CompilerCommand.scala b/compiler/src/dotty/tools/dotc/config/CompilerCommand.scala index 25f41c6b0955..1fbee52b93a7 100644 --- a/compiler/src/dotty/tools/dotc/config/CompilerCommand.scala +++ b/compiler/src/dotty/tools/dotc/config/CompilerCommand.scala @@ -3,6 +3,8 @@ package config import java.nio.file.{Files, Paths} +import org.jline.terminal.TerminalBuilder + import Settings._ import core.Contexts._ import Properties._ @@ -73,11 +75,42 @@ object CompilerCommand { def checkUsage(summary: ArgsSummary, sourcesRequired: Boolean)(using Context): List[String] = { val settings = ctx.settings - /** Creates a help message for a subset of options based on cond */ - def availableOptionsMsg(cond: Setting[?] => Boolean): String = { - val ss = (ctx.settings.allSettings filter cond).toList sortBy (_.name) - val width = (ss map (_.name.length)).max - def format(s: String) = ("%-" + width + "s") format s + /** Creates a help message for a subset of options based on cond; + * terminalWidth = 0 means no terminal is available. + */ + def availableOptionsMsg(cond: Setting[?] => Boolean, terminalWidth: Int = 0): String = { + val ss = (settings.allSettings filter cond).toList sortBy (_.name) + val maxNameWidth = 30 + val nameWidths = ss.map(_.name.length).partition(_ < maxNameWidth)._1 + val width = if nameWidths.nonEmpty then nameWidths.max else maxNameWidth + val (nameWidth, descriptionWidth) = { + val w1 = + if width < maxNameWidth then width + else maxNameWidth + val w2 = + if terminalWidth < w1 + maxNameWidth then 0 + else terminalWidth - w1 - 1 + (w1, w2) + } + def formatName(name: String) = + if name.length <= nameWidth then ("%-" + nameWidth + "s") format name + else (name + "\n%-" + nameWidth + "s") format "" + def formatDescription(text: String): String = + if descriptionWidth == 0 then text + else if text.length < descriptionWidth then text + else { + val inx = text.substring(0, descriptionWidth).lastIndexOf(" ") + if inx < 0 then text + else + val str = text.substring(0, inx) + s"${str}\n${formatName("")} ${formatDescription(text.substring(inx + 1))}" + } + def formatSetting(name: String, value: String) = + if (value.nonEmpty) + // the format here is helping to make empty padding and put the additional information exactly under the description. + s"\n${formatName("")} $name: $value." + else + "" def helpStr(s: Setting[?]) = { def defaultValue = s.default match { case _: Int | _: String => s.default.toString @@ -86,13 +119,7 @@ object CompilerCommand { // For example 'false' for the version command. "" } - def formatSetting(name: String, value: String) = - if (value.nonEmpty) - // the format here is helping to make empty padding and put the additional information exactly under the description. - s"\n${format("")} $name: $value." - else - "" - s"${format(s.name)} ${s.description}${formatSetting("Default", defaultValue)}${formatSetting("Choices", s.legalChoices)}" + s"${formatName(s.name)} ${formatDescription(s.description)}${formatSetting("Default", defaultValue)}${formatSetting("Choices", s.legalChoices)}" } ss map helpStr mkString "\n" } @@ -103,8 +130,14 @@ object CompilerCommand { Some(explainAdvanced) filter (_ => shouldExplain), Some(label + " options include:") ).flatten mkString "\n" - - prefix + "\n" + availableOptionsMsg(cond) + try + // Use terminal width if terminal is available (see repl.JLineTerminal) + val terminal = TerminalBuilder.builder().dumb(false).build() + val usageMsg = prefix + "\n" + availableOptionsMsg(cond, terminal.getWidth) + terminal.close() + usageMsg + catch _ => + prefix + "\n" + availableOptionsMsg(cond) } def isStandard(s: Setting[?]): Boolean = !isAdvanced(s) && !isPrivate(s) From 73e482a9c343365987b2128e186130b92ce68934 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Micheloud?= Date: Sat, 14 Nov 2020 00:39:07 +0100 Subject: [PATCH 05/21] removed dependency on jline terminal --- .../tools/dotc/config/CompilerCommand.scala | 30 +++++++++---------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/compiler/src/dotty/tools/dotc/config/CompilerCommand.scala b/compiler/src/dotty/tools/dotc/config/CompilerCommand.scala index 1fbee52b93a7..3b9769691692 100644 --- a/compiler/src/dotty/tools/dotc/config/CompilerCommand.scala +++ b/compiler/src/dotty/tools/dotc/config/CompilerCommand.scala @@ -3,8 +3,6 @@ package config import java.nio.file.{Files, Paths} -import org.jline.terminal.TerminalBuilder - import Settings._ import core.Contexts._ import Properties._ @@ -75,14 +73,22 @@ object CompilerCommand { def checkUsage(summary: ArgsSummary, sourcesRequired: Boolean)(using Context): List[String] = { val settings = ctx.settings - /** Creates a help message for a subset of options based on cond; - * terminalWidth = 0 means no terminal is available. - */ - def availableOptionsMsg(cond: Setting[?] => Boolean, terminalWidth: Int = 0): String = { + /** Creates a help message for a subset of options based on cond */ + def availableOptionsMsg(cond: Setting[?] => Boolean): String = { val ss = (settings.allSettings filter cond).toList sortBy (_.name) val maxNameWidth = 30 val nameWidths = ss.map(_.name.length).partition(_ < maxNameWidth)._1 - val width = if nameWidths.nonEmpty then nameWidths.max else maxNameWidth + val width = if nameWidths.nonEmpty then nameWidths.max else maxNameWidth + val terminalWidth = + val pageWidth = settings.pageWidth.value + val columnsVar = System.getenv("COLUMNS") + if columnsVar != null then columnsVar.toInt + else if Properties.isWin then + val ansiconVar = System.getenv("ANSICON") // eg. "142x32766 (142x26)" + if ansiconVar != null && ansiconVar.matches("[0-9]+x.*") then + ansiconVar.substring(0, ansiconVar.indexOf("x")).toInt + else pageWidth + else pageWidth val (nameWidth, descriptionWidth) = { val w1 = if width < maxNameWidth then width @@ -130,14 +136,8 @@ object CompilerCommand { Some(explainAdvanced) filter (_ => shouldExplain), Some(label + " options include:") ).flatten mkString "\n" - try - // Use terminal width if terminal is available (see repl.JLineTerminal) - val terminal = TerminalBuilder.builder().dumb(false).build() - val usageMsg = prefix + "\n" + availableOptionsMsg(cond, terminal.getWidth) - terminal.close() - usageMsg - catch _ => - prefix + "\n" + availableOptionsMsg(cond) + + prefix + "\n" + availableOptionsMsg(cond) } def isStandard(s: Setting[?]): Boolean = !isAdvanced(s) && !isPrivate(s) From c0e1d6c5089cc4579b4f1039f6a77768f4a47cc9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Micheloud?= Date: Mon, 22 Feb 2021 18:59:59 +0100 Subject: [PATCH 06/21] rebased with upstream --- community-build/community-projects/AsyncFile | 2 +- community-build/community-projects/Equal | 2 +- community-build/community-projects/FingerTree | 2 +- community-build/community-projects/Log | 2 +- community-build/community-projects/Lucre | 2 +- community-build/community-projects/Model | 2 +- community-build/community-projects/Numbers | 2 +- community-build/community-projects/PPrint | 2 +- community-build/community-projects/ScalaPB | 2 +- community-build/community-projects/Serial | 2 +- community-build/community-projects/Span | 2 +- community-build/community-projects/algebra | 2 +- community-build/community-projects/betterfiles | 2 +- community-build/community-projects/cats-mtl | 2 +- .../community-projects/discipline-munit | 2 +- .../community-projects/discipline-specs2 | 2 +- community-build/community-projects/dotty-cps-async | 2 +- community-build/community-projects/effpi | 2 +- community-build/community-projects/fansi | 2 +- community-build/community-projects/fastparse | 2 +- community-build/community-projects/geny | 2 +- community-build/community-projects/intent | 2 +- community-build/community-projects/izumi-reflect | 2 +- community-build/community-projects/minitest | 2 +- community-build/community-projects/munit | 2 +- community-build/community-projects/os-lib | 2 +- community-build/community-projects/perspective | 2 +- community-build/community-projects/requests-scala | 2 +- .../community-projects/scala-parallel-collections | 2 +- community-build/community-projects/scala-stm | 2 +- community-build/community-projects/scala-xml | 2 +- .../community-projects/scalatestplus-scalacheck | 2 +- community-build/community-projects/scodec | 2 +- community-build/community-projects/scodec-bits | 2 +- community-build/community-projects/sconfig | 2 +- community-build/community-projects/shapeless | 2 +- .../community-projects/simulacrum-scalafix | 2 +- community-build/community-projects/sourcecode | 2 +- community-build/community-projects/upickle | 2 +- community-build/community-projects/utest | 2 +- community-build/community-projects/verify | 2 +- .../community-projects/xml-interpolator | 2 +- .../dotty/tools/dotc/config/CompilerCommand.scala | 11 +---------- .../dotty/tools/dotc/config/ScalaSettings.scala | 14 +++++++++++++- 44 files changed, 56 insertions(+), 53 deletions(-) diff --git a/community-build/community-projects/AsyncFile b/community-build/community-projects/AsyncFile index 831f1db78cbd..fe33563b74e1 160000 --- a/community-build/community-projects/AsyncFile +++ b/community-build/community-projects/AsyncFile @@ -1 +1 @@ -Subproject commit 831f1db78cbda7b060a7dfe0426d0b59709fd728 +Subproject commit fe33563b74e1e1df333e86bb04b728feb199eecd diff --git a/community-build/community-projects/Equal b/community-build/community-projects/Equal index 43e829e01959..f42b05026591 160000 --- a/community-build/community-projects/Equal +++ b/community-build/community-projects/Equal @@ -1 +1 @@ -Subproject commit 43e829e0195961500824388a6552a66ec13521cd +Subproject commit f42b05026591e146d9b4cfdd6418383321a76cd4 diff --git a/community-build/community-projects/FingerTree b/community-build/community-projects/FingerTree index b5c89dff9efa..42b27e008e6f 160000 --- a/community-build/community-projects/FingerTree +++ b/community-build/community-projects/FingerTree @@ -1 +1 @@ -Subproject commit b5c89dff9efaab861b605199ac3d0ccfbb3f80d4 +Subproject commit 42b27e008e6f8095a928cbbef8efb4c644e46289 diff --git a/community-build/community-projects/Log b/community-build/community-projects/Log index bef85c8a61d8..02b59d0df788 160000 --- a/community-build/community-projects/Log +++ b/community-build/community-projects/Log @@ -1 +1 @@ -Subproject commit bef85c8a61d8f08be65a2de1822cb60485296d32 +Subproject commit 02b59d0df788fdbdf602ba7fdd40c63c7aca885f diff --git a/community-build/community-projects/Lucre b/community-build/community-projects/Lucre index 87d680baaa23..b569546707c5 160000 --- a/community-build/community-projects/Lucre +++ b/community-build/community-projects/Lucre @@ -1 +1 @@ -Subproject commit 87d680baaa2355de5b062adcbdfc5005e787521b +Subproject commit b569546707c55dded1072cd544afd0e01b56d25c diff --git a/community-build/community-projects/Model b/community-build/community-projects/Model index d4fa3fdc4049..0704fa394b39 160000 --- a/community-build/community-projects/Model +++ b/community-build/community-projects/Model @@ -1 +1 @@ -Subproject commit d4fa3fdc4049020e2cddd694d0e44f79b2bc0cfe +Subproject commit 0704fa394b39fc80c6292e67561c0884f50fabf7 diff --git a/community-build/community-projects/Numbers b/community-build/community-projects/Numbers index 3d9a4a028e61..971a6755c677 160000 --- a/community-build/community-projects/Numbers +++ b/community-build/community-projects/Numbers @@ -1 +1 @@ -Subproject commit 3d9a4a028e610ee28499284ed30a53789270c56e +Subproject commit 971a6755c677245678fd97652f9931910b797218 diff --git a/community-build/community-projects/PPrint b/community-build/community-projects/PPrint index 231bc187faad..94f9f4a8590c 160000 --- a/community-build/community-projects/PPrint +++ b/community-build/community-projects/PPrint @@ -1 +1 @@ -Subproject commit 231bc187faad172b55af4ddc50c30228a56b2ebd +Subproject commit 94f9f4a8590c06f98e6c515ffdbf3a17054284ec diff --git a/community-build/community-projects/ScalaPB b/community-build/community-projects/ScalaPB index 95515e8d052a..984eba1d17a9 160000 --- a/community-build/community-projects/ScalaPB +++ b/community-build/community-projects/ScalaPB @@ -1 +1 @@ -Subproject commit 95515e8d052a3b36f6fad168838e874420360de4 +Subproject commit 984eba1d17a9371e166fd76f89880590d8f5bfa5 diff --git a/community-build/community-projects/Serial b/community-build/community-projects/Serial index b4c3724b7fac..0a3a39772f6d 160000 --- a/community-build/community-projects/Serial +++ b/community-build/community-projects/Serial @@ -1 +1 @@ -Subproject commit b4c3724b7fac8b4d7fbae730118c5075c6f4392d +Subproject commit 0a3a39772f6df3fac495f203c8d582d29c72124b diff --git a/community-build/community-projects/Span b/community-build/community-projects/Span index 467882fc0320..8674590a836c 160000 --- a/community-build/community-projects/Span +++ b/community-build/community-projects/Span @@ -1 +1 @@ -Subproject commit 467882fc032081db5fe840db94251c9cc89cb30a +Subproject commit 8674590a836cb227284eef08a307dbbdb9140f15 diff --git a/community-build/community-projects/algebra b/community-build/community-projects/algebra index a010f13d7c4f..705fdced2505 160000 --- a/community-build/community-projects/algebra +++ b/community-build/community-projects/algebra @@ -1 +1 @@ -Subproject commit a010f13d7c4f5029ed0f6ce088f6e55a0c87ef3e +Subproject commit 705fdced25055f5e9df7b65a1ba2a0a379d63c90 diff --git a/community-build/community-projects/betterfiles b/community-build/community-projects/betterfiles index e138a70e4922..fae0d8432411 160000 --- a/community-build/community-projects/betterfiles +++ b/community-build/community-projects/betterfiles @@ -1 +1 @@ -Subproject commit e138a70e49225584171e5e879181796fe5594292 +Subproject commit fae0d8432411778cd7f1220a42f8cea768230592 diff --git a/community-build/community-projects/cats-mtl b/community-build/community-projects/cats-mtl index 1b0d1404f0eb..5b5dd285d42a 160000 --- a/community-build/community-projects/cats-mtl +++ b/community-build/community-projects/cats-mtl @@ -1 +1 @@ -Subproject commit 1b0d1404f0eb104e72d4fd80c4ba285c9390fbc0 +Subproject commit 5b5dd285d42a275ab4123fdac1003b10aa1b73f6 diff --git a/community-build/community-projects/discipline-munit b/community-build/community-projects/discipline-munit index e0a3aee65b85..fad723f51480 160000 --- a/community-build/community-projects/discipline-munit +++ b/community-build/community-projects/discipline-munit @@ -1 +1 @@ -Subproject commit e0a3aee65b85bf8d6bb53037e4bc33ebfdeaedff +Subproject commit fad723f514808466ce76ed9c8897df56216747a4 diff --git a/community-build/community-projects/discipline-specs2 b/community-build/community-projects/discipline-specs2 index b2fa931a44ee..ab61ef6ed278 160000 --- a/community-build/community-projects/discipline-specs2 +++ b/community-build/community-projects/discipline-specs2 @@ -1 +1 @@ -Subproject commit b2fa931a44eeb6a6afa1343e57f963e73aafff59 +Subproject commit ab61ef6ed2780d6800a959421cea9fe00aa9ff53 diff --git a/community-build/community-projects/dotty-cps-async b/community-build/community-projects/dotty-cps-async index 614dc4a30557..2ef1853669c8 160000 --- a/community-build/community-projects/dotty-cps-async +++ b/community-build/community-projects/dotty-cps-async @@ -1 +1 @@ -Subproject commit 614dc4a30557bf7d282387d0c7efcdb59d97d76b +Subproject commit 2ef1853669c80bddbf1a33c8d17dce7a7f09d494 diff --git a/community-build/community-projects/effpi b/community-build/community-projects/effpi index 52702912ce92..f6b0b3f18593 160000 --- a/community-build/community-projects/effpi +++ b/community-build/community-projects/effpi @@ -1 +1 @@ -Subproject commit 52702912ce92b801ab9fb033d30970cdf45b6961 +Subproject commit f6b0b3f185933f12faf3bd428c31cbac3cb7262e diff --git a/community-build/community-projects/fansi b/community-build/community-projects/fansi index 21d1db61a315..c30b5cd3cb6c 160000 --- a/community-build/community-projects/fansi +++ b/community-build/community-projects/fansi @@ -1 +1 @@ -Subproject commit 21d1db61a315b31636dfd6515f346454b21ac5f6 +Subproject commit c30b5cd3cb6ca94cc9f489b75b4920e8d0b71914 diff --git a/community-build/community-projects/fastparse b/community-build/community-projects/fastparse index 9b02d7050013..c49998f74aa0 160000 --- a/community-build/community-projects/fastparse +++ b/community-build/community-projects/fastparse @@ -1 +1 @@ -Subproject commit 9b02d7050013fd7158f37f60116f3907d4a578e2 +Subproject commit c49998f74aa05f27720eab974f25c3ee780f3549 diff --git a/community-build/community-projects/geny b/community-build/community-projects/geny index c511f4ad1ae2..f1804705fecf 160000 --- a/community-build/community-projects/geny +++ b/community-build/community-projects/geny @@ -1 +1 @@ -Subproject commit c511f4ad1ae2adf94bd55691bd8b4afed41213fc +Subproject commit f1804705fecfd41bf4f9a2cde24b7549fd3315a5 diff --git a/community-build/community-projects/intent b/community-build/community-projects/intent index 38c7314fb764..580f6cb5fce2 160000 --- a/community-build/community-projects/intent +++ b/community-build/community-projects/intent @@ -1 +1 @@ -Subproject commit 38c7314fb7643bc1786e4358b83a815194071d48 +Subproject commit 580f6cb5fce211e512478fc07c6ef07c8f1105b8 diff --git a/community-build/community-projects/izumi-reflect b/community-build/community-projects/izumi-reflect index 54051d0bca92..490df1c367dd 160000 --- a/community-build/community-projects/izumi-reflect +++ b/community-build/community-projects/izumi-reflect @@ -1 +1 @@ -Subproject commit 54051d0bca921706ef0a3f9f63264f6f57d50ef0 +Subproject commit 490df1c367ddef5bfedeb79c1d0f966a63c00e05 diff --git a/community-build/community-projects/minitest b/community-build/community-projects/minitest index 746b6aa16432..bda6c70aaeff 160000 --- a/community-build/community-projects/minitest +++ b/community-build/community-projects/minitest @@ -1 +1 @@ -Subproject commit 746b6aa1643254786549ebe2785c80693359acd1 +Subproject commit bda6c70aaeff686769dc4ac38ce31573bec93a08 diff --git a/community-build/community-projects/munit b/community-build/community-projects/munit index 3c9b71d7a087..5f384b548960 160000 --- a/community-build/community-projects/munit +++ b/community-build/community-projects/munit @@ -1 +1 @@ -Subproject commit 3c9b71d7a087015e95411534aaaf6d92cbbbfbc3 +Subproject commit 5f384b548960ee7731649f5f900eb1d854e7827a diff --git a/community-build/community-projects/os-lib b/community-build/community-projects/os-lib index 1a848dc584dd..7564b495b42c 160000 --- a/community-build/community-projects/os-lib +++ b/community-build/community-projects/os-lib @@ -1 +1 @@ -Subproject commit 1a848dc584ddfdcf48b7075a4292e09d0b8c00e0 +Subproject commit 7564b495b42c364832748acc7aae449cda45596c diff --git a/community-build/community-projects/perspective b/community-build/community-projects/perspective index f0525cdc94a5..f9d3067db6f6 160000 --- a/community-build/community-projects/perspective +++ b/community-build/community-projects/perspective @@ -1 +1 @@ -Subproject commit f0525cdc94a52e92587a464761741369f3351345 +Subproject commit f9d3067db6f6653b388762e60990f762a202a47a diff --git a/community-build/community-projects/requests-scala b/community-build/community-projects/requests-scala index 139dbe6418f1..70e8c48a3d74 160000 --- a/community-build/community-projects/requests-scala +++ b/community-build/community-projects/requests-scala @@ -1 +1 @@ -Subproject commit 139dbe6418f1ecee09b020086fc2fc9e844e57e3 +Subproject commit 70e8c48a3d74320758c0f2f876ff1e69b8061b81 diff --git a/community-build/community-projects/scala-parallel-collections b/community-build/community-projects/scala-parallel-collections index 152db284cc56..0d8cdab0b16c 160000 --- a/community-build/community-projects/scala-parallel-collections +++ b/community-build/community-projects/scala-parallel-collections @@ -1 +1 @@ -Subproject commit 152db284cc56c59c8fa9f74454e03d04c4355b60 +Subproject commit 0d8cdab0b16cc1c17dd2867cb2300b30f1e53cc6 diff --git a/community-build/community-projects/scala-stm b/community-build/community-projects/scala-stm index 96ef6e56af08..e25579f586a9 160000 --- a/community-build/community-projects/scala-stm +++ b/community-build/community-projects/scala-stm @@ -1 +1 @@ -Subproject commit 96ef6e56af08d0ec600ec80ebec68d227a8c048c +Subproject commit e25579f586a9d92242201d07faff5e586de1af69 diff --git a/community-build/community-projects/scala-xml b/community-build/community-projects/scala-xml index d809e1d855d7..0daee4a3a3d9 160000 --- a/community-build/community-projects/scala-xml +++ b/community-build/community-projects/scala-xml @@ -1 +1 @@ -Subproject commit d809e1d855d75352365ae4f218049a9910de7265 +Subproject commit 0daee4a3a3d9e32d3eca211824af8db54b646c25 diff --git a/community-build/community-projects/scalatestplus-scalacheck b/community-build/community-projects/scalatestplus-scalacheck index 010387f5854e..349d6d8c9367 160000 --- a/community-build/community-projects/scalatestplus-scalacheck +++ b/community-build/community-projects/scalatestplus-scalacheck @@ -1 +1 @@ -Subproject commit 010387f5854eb473ddc71ecd2d6a0183dfebfbcb +Subproject commit 349d6d8c936738a685fe3644d35a46d214b95034 diff --git a/community-build/community-projects/scodec b/community-build/community-projects/scodec index 8d7f83ae76e3..c337c06bef4a 160000 --- a/community-build/community-projects/scodec +++ b/community-build/community-projects/scodec @@ -1 +1 @@ -Subproject commit 8d7f83ae76e3278245631126d808c9c02e57ae23 +Subproject commit c337c06bef4af0a7fa7282066e264a707f846bf7 diff --git a/community-build/community-projects/scodec-bits b/community-build/community-projects/scodec-bits index 85de35c014b9..2710dac942b1 160000 --- a/community-build/community-projects/scodec-bits +++ b/community-build/community-projects/scodec-bits @@ -1 +1 @@ -Subproject commit 85de35c014b948f0dd3f94e975c42d17deab4055 +Subproject commit 2710dac942b1a2888dbbcd152b6ba3bf82fc2ebd diff --git a/community-build/community-projects/sconfig b/community-build/community-projects/sconfig index 43f7b12dce6e..38d620bdab66 160000 --- a/community-build/community-projects/sconfig +++ b/community-build/community-projects/sconfig @@ -1 +1 @@ -Subproject commit 43f7b12dce6ec53bc7fafee8a35141944f31763e +Subproject commit 38d620bdab6656850ab0358583d2bb3638f83150 diff --git a/community-build/community-projects/shapeless b/community-build/community-projects/shapeless index bfa5dba99d64..dfcd200f3ff6 160000 --- a/community-build/community-projects/shapeless +++ b/community-build/community-projects/shapeless @@ -1 +1 @@ -Subproject commit bfa5dba99d6402336a1fbaf687f5cb29b3e78fe2 +Subproject commit dfcd200f3ff68bfb76c93666b4f44c1d6f8f0277 diff --git a/community-build/community-projects/simulacrum-scalafix b/community-build/community-projects/simulacrum-scalafix index 75f7e10d30fb..b6a5d3d5eb9d 160000 --- a/community-build/community-projects/simulacrum-scalafix +++ b/community-build/community-projects/simulacrum-scalafix @@ -1 +1 @@ -Subproject commit 75f7e10d30fb1b848b7adaf2a026320ee548b56a +Subproject commit b6a5d3d5eb9d65852fdc14491085e5f465e2d3da diff --git a/community-build/community-projects/sourcecode b/community-build/community-projects/sourcecode index 1b8fcebec8c9..e911b9f27b23 160000 --- a/community-build/community-projects/sourcecode +++ b/community-build/community-projects/sourcecode @@ -1 +1 @@ -Subproject commit 1b8fcebec8c9322a06498fd5e1086bfc5abee277 +Subproject commit e911b9f27b23ca38d3cb657ea9c85856d6685aa9 diff --git a/community-build/community-projects/upickle b/community-build/community-projects/upickle index 52e388109f3a..0aa5b61300fe 160000 --- a/community-build/community-projects/upickle +++ b/community-build/community-projects/upickle @@ -1 +1 @@ -Subproject commit 52e388109f3a03f63795e0aa9b17cf6453eac69d +Subproject commit 0aa5b61300fe8032c2bc364a8a19d78ededc69be diff --git a/community-build/community-projects/utest b/community-build/community-projects/utest index f1ca7b12897f..37be849fe85e 160000 --- a/community-build/community-projects/utest +++ b/community-build/community-projects/utest @@ -1 +1 @@ -Subproject commit f1ca7b12897f0fedccc757c17552ebbade72c6a2 +Subproject commit 37be849fe85e6e9f92d31cac5a53c92789700d48 diff --git a/community-build/community-projects/verify b/community-build/community-projects/verify index 90bae9a5c83a..c6646b4d2261 160000 --- a/community-build/community-projects/verify +++ b/community-build/community-projects/verify @@ -1 +1 @@ -Subproject commit 90bae9a5c83a1c229922452b5ae3eb1b2b7de89b +Subproject commit c6646b4d2261ff33db119a84744740e4124dce1b diff --git a/community-build/community-projects/xml-interpolator b/community-build/community-projects/xml-interpolator index 0e032658e3d9..7232e3df7bf4 160000 --- a/community-build/community-projects/xml-interpolator +++ b/community-build/community-projects/xml-interpolator @@ -1 +1 @@ -Subproject commit 0e032658e3d915bac4a22360bcdeb880bd81a03d +Subproject commit 7232e3df7bf428c7c7cd202b47af94f623f21c19 diff --git a/compiler/src/dotty/tools/dotc/config/CompilerCommand.scala b/compiler/src/dotty/tools/dotc/config/CompilerCommand.scala index 3b9769691692..e4ea94bcd1b5 100644 --- a/compiler/src/dotty/tools/dotc/config/CompilerCommand.scala +++ b/compiler/src/dotty/tools/dotc/config/CompilerCommand.scala @@ -79,16 +79,7 @@ object CompilerCommand { val maxNameWidth = 30 val nameWidths = ss.map(_.name.length).partition(_ < maxNameWidth)._1 val width = if nameWidths.nonEmpty then nameWidths.max else maxNameWidth - val terminalWidth = - val pageWidth = settings.pageWidth.value - val columnsVar = System.getenv("COLUMNS") - if columnsVar != null then columnsVar.toInt - else if Properties.isWin then - val ansiconVar = System.getenv("ANSICON") // eg. "142x32766 (142x26)" - if ansiconVar != null && ansiconVar.matches("[0-9]+x.*") then - ansiconVar.substring(0, ansiconVar.indexOf("x")).toInt - else pageWidth - else pageWidth + val terminalWidth = settings.pageWidth.value val (nameWidth, descriptionWidth) = { val w1 = if width < maxNameWidth then width diff --git a/compiler/src/dotty/tools/dotc/config/ScalaSettings.scala b/compiler/src/dotty/tools/dotc/config/ScalaSettings.scala index 540eb80b1658..def17812571c 100644 --- a/compiler/src/dotty/tools/dotc/config/ScalaSettings.scala +++ b/compiler/src/dotty/tools/dotc/config/ScalaSettings.scala @@ -11,6 +11,18 @@ import Settings.Setting trait CommonScalaSettings { self: Settings.SettingGroup => protected def defaultClasspath: String = sys.env.getOrElse("CLASSPATH", ".") + protected def defaultPageWidth: Int = { + val defaultWidth = 80 + val columnsVar = System.getenv("COLUMNS") + if columnsVar != null then columnsVar.toInt + else if Properties.isWin then + val ansiconVar = System.getenv("ANSICON") // eg. "142x32766 (142x26)" + if ansiconVar != null && ansiconVar.matches("[0-9]+x.*") then + ansiconVar.substring(0, ansiconVar.indexOf("x")).toInt + else defaultWidth + else defaultWidth + } + /** Path related settings */ val bootclasspath: Setting[String] = PathSetting("-bootclasspath", "Override location of bootstrap class files.", Defaults.scalaBootClassPath, aliases = List("--boot-class-path")) val extdirs: Setting[String] = PathSetting("-extdirs", "Override location of installed extensions.", Defaults.scalaExtDirs, aliases = List("--extension-directories")) @@ -25,6 +37,7 @@ trait CommonScalaSettings { self: Settings.SettingGroup => val color: Setting[String] = ChoiceSetting("-color", "mode", "Colored output", List("always", "never"/*, "auto"*/), "always"/* "auto"*/, aliases = List("--color")) val verbose: Setting[Boolean] = BooleanSetting("-verbose", "Output messages about what the compiler is doing.", aliases = List("--verbose")) val version: Setting[Boolean] = BooleanSetting("-version", "Print product version and exit.", aliases = List("--version")) + val help: Setting[Boolean] = BooleanSetting("-help", "Print a synopsis of standard options.", aliases = List("--help")) val pageWidth: Setting[Int] = IntSetting("-pagewidth", "Set page width", 80, aliases = List("--page-width")) val silentWarnings: Setting[Boolean] = BooleanSetting("-nowarn", "Silence all warnings.", aliases = List("--no-warnings")) @@ -93,7 +106,6 @@ class ScalaSettings extends Settings.SettingGroup with CommonScalaSettings { val explainTypes: Setting[Boolean] = BooleanSetting("-explain-types", "Explain type errors in more detail.", aliases = List("--explain-types")) val explain: Setting[Boolean] = BooleanSetting("-explain", "Explain errors in more detail.", aliases = List("--explain")) val feature: Setting[Boolean] = BooleanSetting("-feature", "Emit warning and location for usages of features that should be imported explicitly.", aliases = List("--feature")) - val help: Setting[Boolean] = BooleanSetting("-help", "Print a synopsis of standard options.", aliases = List("--help")) val release: Setting[String] = ChoiceSetting("-release", "release", "Compile code with classes specific to the given version of the Java platform available on the classpath and emit bytecode for this version.", supportedReleaseVersions, "", aliases = List("--release")) val source: Setting[String] = ChoiceSetting("-source", "source version", "source version", List("3.0", "future", "3.0-migration", "future-migration"), "3.0", aliases = List("--source")) val scalajs: Setting[Boolean] = BooleanSetting("-scalajs", "Compile in Scala.js mode (requires scalajs-library.jar on the classpath).", aliases = List("--scalajs")) From 00bd2888479bcc47d92d8a808374ad90e2558654 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Micheloud?= Date: Tue, 2 Mar 2021 12:21:26 +0100 Subject: [PATCH 07/21] sync with upstream, added tput --- .../dotty/tools/dotc/config/CliCommand.scala | 48 ++++++++++++++----- .../tools/dotc/config/ScalaSettings.scala | 2 +- dist/bin/common | 5 ++ 3 files changed, 41 insertions(+), 14 deletions(-) diff --git a/compiler/src/dotty/tools/dotc/config/CliCommand.scala b/compiler/src/dotty/tools/dotc/config/CliCommand.scala index 1a48fbfdf131..e361519bb54d 100644 --- a/compiler/src/dotty/tools/dotc/config/CliCommand.scala +++ b/compiler/src/dotty/tools/dotc/config/CliCommand.scala @@ -66,9 +66,39 @@ trait CliCommand: /** Creates a help message for a subset of options based on cond */ protected def availableOptionsMsg(cond: Setting[?] => Boolean)(using settings: ConcreteSettings)(using SettingsState): String = - val ss = (settings.allSettings filter cond).toList sortBy (_.name) - val width = (ss map (_.name.length)).max - def format(s: String) = ("%-" + width + "s") format s + val ss = (settings.allSettings filter cond).toList sortBy (_.name) + val maxNameWidth = 30 + val nameWidths = ss.map(_.name.length).partition(_ < maxNameWidth)._1 + val width = if nameWidths.nonEmpty then nameWidths.max else maxNameWidth + val terminalWidth = settings.pageWidth.value + val (nameWidth, descriptionWidth) = { + val w1 = + if width < maxNameWidth then width + else maxNameWidth + val w2 = + if terminalWidth < w1 + maxNameWidth then 0 + else terminalWidth - w1 - 1 + (w1, w2) + } + def formatName(name: String) = + if name.length <= nameWidth then ("%-" + nameWidth + "s") format name + else (name + "\n%-" + nameWidth + "s") format "" + def formatDescription(text: String): String = + if descriptionWidth == 0 then text + else if text.length < descriptionWidth then text + else { + val inx = text.substring(0, descriptionWidth).lastIndexOf(" ") + if inx < 0 then text + else + val str = text.substring(0, inx) + s"${str}\n${formatName("")} ${formatDescription(text.substring(inx + 1))}" + } + def formatSetting(name: String, value: String) = + if (value.nonEmpty) + // the format here is helping to make empty padding and put the additional information exactly under the description. + s"\n${formatName("")} $name: $value." + else + "" def helpStr(s: Setting[?]) = def defaultValue = s.default match case _: Int | _: String => s.default.toString @@ -76,16 +106,8 @@ trait CliCommand: // For now, skip the default values that do not make sense for the end user. // For example 'false' for the version command. "" - - def formatSetting(name: String, value: String) = - if (value.nonEmpty) - // the format here is helping to make empty padding and put the additional information exactly under the description. - s"\n${format("")} $name: $value." - else - "" - s"${format(s.name)} ${s.description}${formatSetting("Default", defaultValue)}${formatSetting("Choices", s.legalChoices)}" - - ss.map(helpStr).mkString("", "\n", s"\n${format("@")} A text file containing compiler arguments (options and source files).\n") + s"${formatName(s.name)} ${formatDescription(s.description)}${formatSetting("Default", defaultValue)}${formatSetting("Choices", s.legalChoices)}" + ss.map(helpStr).mkString("", "\n", s"\n${formatName("@")} ${formatDescription("A text file containing compiler arguments (options and source files).")}\n") protected def shortUsage: String = s"Usage: $cmdName " diff --git a/compiler/src/dotty/tools/dotc/config/ScalaSettings.scala b/compiler/src/dotty/tools/dotc/config/ScalaSettings.scala index def17812571c..19e5a4cea229 100644 --- a/compiler/src/dotty/tools/dotc/config/ScalaSettings.scala +++ b/compiler/src/dotty/tools/dotc/config/ScalaSettings.scala @@ -38,7 +38,7 @@ trait CommonScalaSettings { self: Settings.SettingGroup => val verbose: Setting[Boolean] = BooleanSetting("-verbose", "Output messages about what the compiler is doing.", aliases = List("--verbose")) val version: Setting[Boolean] = BooleanSetting("-version", "Print product version and exit.", aliases = List("--version")) val help: Setting[Boolean] = BooleanSetting("-help", "Print a synopsis of standard options.", aliases = List("--help")) - val pageWidth: Setting[Int] = IntSetting("-pagewidth", "Set page width", 80, aliases = List("--page-width")) + val pageWidth: Setting[Int] = IntSetting("-pagewidth", "Set page width", defaultPageWidth, aliases = List("--page-width")) val silentWarnings: Setting[Boolean] = BooleanSetting("-nowarn", "Silence all warnings.", aliases = List("--no-warnings")) /** Other settings */ diff --git a/dist/bin/common b/dist/bin/common index d6da956207da..232462a43b7d 100755 --- a/dist/bin/common +++ b/dist/bin/common @@ -26,6 +26,11 @@ function onExit() { # to reenable echo if we are interrupted before completing. trap onExit INT TERM +# COLUMNS is used together with command line option '-pageWidth'. +if command -v tput >/dev/null 2>&1; then + export COLUMNS="$(tput -Tdumb cols)" +fi + cygwin=false mingw=false msys=false From 19d7024fe06f0bdc73a6d29358649da0e4e14d90 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Micheloud?= Date: Tue, 2 Mar 2021 12:25:59 +0100 Subject: [PATCH 08/21] added missing source file --- .../tools/dotc/config/CompilerCommand.scala | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 compiler/src/dotty/tools/dotc/config/CompilerCommand.scala diff --git a/compiler/src/dotty/tools/dotc/config/CompilerCommand.scala b/compiler/src/dotty/tools/dotc/config/CompilerCommand.scala new file mode 100644 index 000000000000..049972365642 --- /dev/null +++ b/compiler/src/dotty/tools/dotc/config/CompilerCommand.scala @@ -0,0 +1,24 @@ +package dotty.tools.dotc +package config + +import java.nio.file.{Files, Paths} + +import Settings._ +import core.Contexts._ +import Properties._ + +import scala.collection.JavaConverters._ + +abstract class CompilerCommand extends CliCommand: + type ConcreteSettings = ScalaSettings + + final def helpMsg(using settings: ScalaSettings)(using SettingsState, Context): String = + if (settings.help.value) usageMessage + else if (settings.Xhelp.value) xusageMessage + else if (settings.Yhelp.value) yusageMessage + else if (settings.showPlugins.value) ctx.base.pluginDescriptions + else if (settings.XshowPhases.value) phasesMessage + else "" + + final def isHelpFlag(using settings: ScalaSettings)(using SettingsState): Boolean = + Set(settings.help, settings.Xhelp, settings.Yhelp, settings.showPlugins, settings.XshowPhases) exists (_.value) From 6997b460600b8f9c173050c3ae520663ed21f04d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Micheloud?= Date: Fri, 13 Nov 2020 10:03:09 +0100 Subject: [PATCH 09/21] improved readability of help messages --- compiler/src/dotty/tools/dotc/config/CompilerCommand.scala | 2 ++ 1 file changed, 2 insertions(+) diff --git a/compiler/src/dotty/tools/dotc/config/CompilerCommand.scala b/compiler/src/dotty/tools/dotc/config/CompilerCommand.scala index 049972365642..0182af02d79d 100644 --- a/compiler/src/dotty/tools/dotc/config/CompilerCommand.scala +++ b/compiler/src/dotty/tools/dotc/config/CompilerCommand.scala @@ -3,6 +3,8 @@ package config import java.nio.file.{Files, Paths} +import org.jline.terminal.TerminalBuilder + import Settings._ import core.Contexts._ import Properties._ From d3302078de58ec745ecd2922ad5a2e069cf1cfac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Micheloud?= Date: Tue, 2 Mar 2021 16:56:43 +0100 Subject: [PATCH 10/21] 2nd attempt --- compiler/src/dotty/tools/dotc/config/CompilerCommand.scala | 2 -- 1 file changed, 2 deletions(-) diff --git a/compiler/src/dotty/tools/dotc/config/CompilerCommand.scala b/compiler/src/dotty/tools/dotc/config/CompilerCommand.scala index 0182af02d79d..049972365642 100644 --- a/compiler/src/dotty/tools/dotc/config/CompilerCommand.scala +++ b/compiler/src/dotty/tools/dotc/config/CompilerCommand.scala @@ -3,8 +3,6 @@ package config import java.nio.file.{Files, Paths} -import org.jline.terminal.TerminalBuilder - import Settings._ import core.Contexts._ import Properties._ From 9ae830ab8946ce4df2490e6b04d51bd8aa5fd214 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Micheloud?= Date: Fri, 13 Nov 2020 10:03:09 +0100 Subject: [PATCH 11/21] improved readability of help messages --- compiler/src/dotty/tools/dotc/config/CompilerCommand.scala | 2 ++ 1 file changed, 2 insertions(+) diff --git a/compiler/src/dotty/tools/dotc/config/CompilerCommand.scala b/compiler/src/dotty/tools/dotc/config/CompilerCommand.scala index 049972365642..0182af02d79d 100644 --- a/compiler/src/dotty/tools/dotc/config/CompilerCommand.scala +++ b/compiler/src/dotty/tools/dotc/config/CompilerCommand.scala @@ -3,6 +3,8 @@ package config import java.nio.file.{Files, Paths} +import org.jline.terminal.TerminalBuilder + import Settings._ import core.Contexts._ import Properties._ From f714e364a639888c7a4e629eba88ee731f679c47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Micheloud?= Date: Sat, 14 Nov 2020 00:39:07 +0100 Subject: [PATCH 12/21] removed dependency on jline terminal --- compiler/src/dotty/tools/dotc/config/CompilerCommand.scala | 2 -- 1 file changed, 2 deletions(-) diff --git a/compiler/src/dotty/tools/dotc/config/CompilerCommand.scala b/compiler/src/dotty/tools/dotc/config/CompilerCommand.scala index 0182af02d79d..049972365642 100644 --- a/compiler/src/dotty/tools/dotc/config/CompilerCommand.scala +++ b/compiler/src/dotty/tools/dotc/config/CompilerCommand.scala @@ -3,8 +3,6 @@ package config import java.nio.file.{Files, Paths} -import org.jline.terminal.TerminalBuilder - import Settings._ import core.Contexts._ import Properties._ From 40156d590a9d7fae0faa3d42dbca9f43993be336 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Micheloud?= Date: Thu, 4 Mar 2021 23:46:55 +0100 Subject: [PATCH 13/21] sync with upstream --- community-build/community-projects/AsyncFile | 2 +- community-build/community-projects/Equal | 2 +- community-build/community-projects/FingerTree | 2 +- community-build/community-projects/Log | 2 +- community-build/community-projects/Lucre | 2 +- community-build/community-projects/Model | 2 +- community-build/community-projects/Numbers | 2 +- community-build/community-projects/PPrint | 2 +- community-build/community-projects/ScalaPB | 2 +- community-build/community-projects/Serial | 2 +- community-build/community-projects/Span | 2 +- community-build/community-projects/algebra | 2 +- community-build/community-projects/betterfiles | 2 +- community-build/community-projects/cats-mtl | 2 +- community-build/community-projects/discipline-munit | 2 +- community-build/community-projects/discipline-specs2 | 2 +- community-build/community-projects/dotty-cps-async | 2 +- community-build/community-projects/effpi | 2 +- community-build/community-projects/fansi | 2 +- community-build/community-projects/fastparse | 2 +- community-build/community-projects/geny | 2 +- community-build/community-projects/intent | 2 +- community-build/community-projects/izumi-reflect | 2 +- community-build/community-projects/minitest | 2 +- community-build/community-projects/munit | 2 +- community-build/community-projects/os-lib | 2 +- community-build/community-projects/perspective | 2 +- community-build/community-projects/requests-scala | 2 +- .../community-projects/scala-parallel-collections | 2 +- community-build/community-projects/scala-stm | 2 +- community-build/community-projects/scala-xml | 2 +- .../community-projects/scalatestplus-scalacheck | 2 +- community-build/community-projects/scodec | 2 +- community-build/community-projects/scodec-bits | 2 +- community-build/community-projects/sconfig | 2 +- community-build/community-projects/shapeless | 2 +- .../community-projects/simulacrum-scalafix | 2 +- community-build/community-projects/sourcecode | 2 +- community-build/community-projects/upickle | 2 +- community-build/community-projects/utest | 2 +- community-build/community-projects/verify | 2 +- community-build/community-projects/xml-interpolator | 2 +- .../src/dotty/tools/dotc/config/ScalaSettings.scala | 12 ++++++++++++ 43 files changed, 54 insertions(+), 42 deletions(-) diff --git a/community-build/community-projects/AsyncFile b/community-build/community-projects/AsyncFile index 831f1db78cbd..fe33563b74e1 160000 --- a/community-build/community-projects/AsyncFile +++ b/community-build/community-projects/AsyncFile @@ -1 +1 @@ -Subproject commit 831f1db78cbda7b060a7dfe0426d0b59709fd728 +Subproject commit fe33563b74e1e1df333e86bb04b728feb199eecd diff --git a/community-build/community-projects/Equal b/community-build/community-projects/Equal index 43e829e01959..f42b05026591 160000 --- a/community-build/community-projects/Equal +++ b/community-build/community-projects/Equal @@ -1 +1 @@ -Subproject commit 43e829e0195961500824388a6552a66ec13521cd +Subproject commit f42b05026591e146d9b4cfdd6418383321a76cd4 diff --git a/community-build/community-projects/FingerTree b/community-build/community-projects/FingerTree index b5c89dff9efa..42b27e008e6f 160000 --- a/community-build/community-projects/FingerTree +++ b/community-build/community-projects/FingerTree @@ -1 +1 @@ -Subproject commit b5c89dff9efaab861b605199ac3d0ccfbb3f80d4 +Subproject commit 42b27e008e6f8095a928cbbef8efb4c644e46289 diff --git a/community-build/community-projects/Log b/community-build/community-projects/Log index bef85c8a61d8..02b59d0df788 160000 --- a/community-build/community-projects/Log +++ b/community-build/community-projects/Log @@ -1 +1 @@ -Subproject commit bef85c8a61d8f08be65a2de1822cb60485296d32 +Subproject commit 02b59d0df788fdbdf602ba7fdd40c63c7aca885f diff --git a/community-build/community-projects/Lucre b/community-build/community-projects/Lucre index 87d680baaa23..b569546707c5 160000 --- a/community-build/community-projects/Lucre +++ b/community-build/community-projects/Lucre @@ -1 +1 @@ -Subproject commit 87d680baaa2355de5b062adcbdfc5005e787521b +Subproject commit b569546707c55dded1072cd544afd0e01b56d25c diff --git a/community-build/community-projects/Model b/community-build/community-projects/Model index d4fa3fdc4049..0704fa394b39 160000 --- a/community-build/community-projects/Model +++ b/community-build/community-projects/Model @@ -1 +1 @@ -Subproject commit d4fa3fdc4049020e2cddd694d0e44f79b2bc0cfe +Subproject commit 0704fa394b39fc80c6292e67561c0884f50fabf7 diff --git a/community-build/community-projects/Numbers b/community-build/community-projects/Numbers index 3d9a4a028e61..971a6755c677 160000 --- a/community-build/community-projects/Numbers +++ b/community-build/community-projects/Numbers @@ -1 +1 @@ -Subproject commit 3d9a4a028e610ee28499284ed30a53789270c56e +Subproject commit 971a6755c677245678fd97652f9931910b797218 diff --git a/community-build/community-projects/PPrint b/community-build/community-projects/PPrint index 231bc187faad..94f9f4a8590c 160000 --- a/community-build/community-projects/PPrint +++ b/community-build/community-projects/PPrint @@ -1 +1 @@ -Subproject commit 231bc187faad172b55af4ddc50c30228a56b2ebd +Subproject commit 94f9f4a8590c06f98e6c515ffdbf3a17054284ec diff --git a/community-build/community-projects/ScalaPB b/community-build/community-projects/ScalaPB index 95515e8d052a..984eba1d17a9 160000 --- a/community-build/community-projects/ScalaPB +++ b/community-build/community-projects/ScalaPB @@ -1 +1 @@ -Subproject commit 95515e8d052a3b36f6fad168838e874420360de4 +Subproject commit 984eba1d17a9371e166fd76f89880590d8f5bfa5 diff --git a/community-build/community-projects/Serial b/community-build/community-projects/Serial index b4c3724b7fac..0a3a39772f6d 160000 --- a/community-build/community-projects/Serial +++ b/community-build/community-projects/Serial @@ -1 +1 @@ -Subproject commit b4c3724b7fac8b4d7fbae730118c5075c6f4392d +Subproject commit 0a3a39772f6df3fac495f203c8d582d29c72124b diff --git a/community-build/community-projects/Span b/community-build/community-projects/Span index 467882fc0320..8674590a836c 160000 --- a/community-build/community-projects/Span +++ b/community-build/community-projects/Span @@ -1 +1 @@ -Subproject commit 467882fc032081db5fe840db94251c9cc89cb30a +Subproject commit 8674590a836cb227284eef08a307dbbdb9140f15 diff --git a/community-build/community-projects/algebra b/community-build/community-projects/algebra index a010f13d7c4f..705fdced2505 160000 --- a/community-build/community-projects/algebra +++ b/community-build/community-projects/algebra @@ -1 +1 @@ -Subproject commit a010f13d7c4f5029ed0f6ce088f6e55a0c87ef3e +Subproject commit 705fdced25055f5e9df7b65a1ba2a0a379d63c90 diff --git a/community-build/community-projects/betterfiles b/community-build/community-projects/betterfiles index e138a70e4922..fae0d8432411 160000 --- a/community-build/community-projects/betterfiles +++ b/community-build/community-projects/betterfiles @@ -1 +1 @@ -Subproject commit e138a70e49225584171e5e879181796fe5594292 +Subproject commit fae0d8432411778cd7f1220a42f8cea768230592 diff --git a/community-build/community-projects/cats-mtl b/community-build/community-projects/cats-mtl index 1b0d1404f0eb..5b5dd285d42a 160000 --- a/community-build/community-projects/cats-mtl +++ b/community-build/community-projects/cats-mtl @@ -1 +1 @@ -Subproject commit 1b0d1404f0eb104e72d4fd80c4ba285c9390fbc0 +Subproject commit 5b5dd285d42a275ab4123fdac1003b10aa1b73f6 diff --git a/community-build/community-projects/discipline-munit b/community-build/community-projects/discipline-munit index e0a3aee65b85..fad723f51480 160000 --- a/community-build/community-projects/discipline-munit +++ b/community-build/community-projects/discipline-munit @@ -1 +1 @@ -Subproject commit e0a3aee65b85bf8d6bb53037e4bc33ebfdeaedff +Subproject commit fad723f514808466ce76ed9c8897df56216747a4 diff --git a/community-build/community-projects/discipline-specs2 b/community-build/community-projects/discipline-specs2 index b2fa931a44ee..ab61ef6ed278 160000 --- a/community-build/community-projects/discipline-specs2 +++ b/community-build/community-projects/discipline-specs2 @@ -1 +1 @@ -Subproject commit b2fa931a44eeb6a6afa1343e57f963e73aafff59 +Subproject commit ab61ef6ed2780d6800a959421cea9fe00aa9ff53 diff --git a/community-build/community-projects/dotty-cps-async b/community-build/community-projects/dotty-cps-async index 614dc4a30557..2ef1853669c8 160000 --- a/community-build/community-projects/dotty-cps-async +++ b/community-build/community-projects/dotty-cps-async @@ -1 +1 @@ -Subproject commit 614dc4a30557bf7d282387d0c7efcdb59d97d76b +Subproject commit 2ef1853669c80bddbf1a33c8d17dce7a7f09d494 diff --git a/community-build/community-projects/effpi b/community-build/community-projects/effpi index 52702912ce92..f6b0b3f18593 160000 --- a/community-build/community-projects/effpi +++ b/community-build/community-projects/effpi @@ -1 +1 @@ -Subproject commit 52702912ce92b801ab9fb033d30970cdf45b6961 +Subproject commit f6b0b3f185933f12faf3bd428c31cbac3cb7262e diff --git a/community-build/community-projects/fansi b/community-build/community-projects/fansi index 21d1db61a315..c30b5cd3cb6c 160000 --- a/community-build/community-projects/fansi +++ b/community-build/community-projects/fansi @@ -1 +1 @@ -Subproject commit 21d1db61a315b31636dfd6515f346454b21ac5f6 +Subproject commit c30b5cd3cb6ca94cc9f489b75b4920e8d0b71914 diff --git a/community-build/community-projects/fastparse b/community-build/community-projects/fastparse index 9b02d7050013..c49998f74aa0 160000 --- a/community-build/community-projects/fastparse +++ b/community-build/community-projects/fastparse @@ -1 +1 @@ -Subproject commit 9b02d7050013fd7158f37f60116f3907d4a578e2 +Subproject commit c49998f74aa05f27720eab974f25c3ee780f3549 diff --git a/community-build/community-projects/geny b/community-build/community-projects/geny index c511f4ad1ae2..f1804705fecf 160000 --- a/community-build/community-projects/geny +++ b/community-build/community-projects/geny @@ -1 +1 @@ -Subproject commit c511f4ad1ae2adf94bd55691bd8b4afed41213fc +Subproject commit f1804705fecfd41bf4f9a2cde24b7549fd3315a5 diff --git a/community-build/community-projects/intent b/community-build/community-projects/intent index 38c7314fb764..580f6cb5fce2 160000 --- a/community-build/community-projects/intent +++ b/community-build/community-projects/intent @@ -1 +1 @@ -Subproject commit 38c7314fb7643bc1786e4358b83a815194071d48 +Subproject commit 580f6cb5fce211e512478fc07c6ef07c8f1105b8 diff --git a/community-build/community-projects/izumi-reflect b/community-build/community-projects/izumi-reflect index 54051d0bca92..490df1c367dd 160000 --- a/community-build/community-projects/izumi-reflect +++ b/community-build/community-projects/izumi-reflect @@ -1 +1 @@ -Subproject commit 54051d0bca921706ef0a3f9f63264f6f57d50ef0 +Subproject commit 490df1c367ddef5bfedeb79c1d0f966a63c00e05 diff --git a/community-build/community-projects/minitest b/community-build/community-projects/minitest index 746b6aa16432..bda6c70aaeff 160000 --- a/community-build/community-projects/minitest +++ b/community-build/community-projects/minitest @@ -1 +1 @@ -Subproject commit 746b6aa1643254786549ebe2785c80693359acd1 +Subproject commit bda6c70aaeff686769dc4ac38ce31573bec93a08 diff --git a/community-build/community-projects/munit b/community-build/community-projects/munit index 3c9b71d7a087..5f384b548960 160000 --- a/community-build/community-projects/munit +++ b/community-build/community-projects/munit @@ -1 +1 @@ -Subproject commit 3c9b71d7a087015e95411534aaaf6d92cbbbfbc3 +Subproject commit 5f384b548960ee7731649f5f900eb1d854e7827a diff --git a/community-build/community-projects/os-lib b/community-build/community-projects/os-lib index 1a848dc584dd..7564b495b42c 160000 --- a/community-build/community-projects/os-lib +++ b/community-build/community-projects/os-lib @@ -1 +1 @@ -Subproject commit 1a848dc584ddfdcf48b7075a4292e09d0b8c00e0 +Subproject commit 7564b495b42c364832748acc7aae449cda45596c diff --git a/community-build/community-projects/perspective b/community-build/community-projects/perspective index f0525cdc94a5..f9d3067db6f6 160000 --- a/community-build/community-projects/perspective +++ b/community-build/community-projects/perspective @@ -1 +1 @@ -Subproject commit f0525cdc94a52e92587a464761741369f3351345 +Subproject commit f9d3067db6f6653b388762e60990f762a202a47a diff --git a/community-build/community-projects/requests-scala b/community-build/community-projects/requests-scala index 139dbe6418f1..70e8c48a3d74 160000 --- a/community-build/community-projects/requests-scala +++ b/community-build/community-projects/requests-scala @@ -1 +1 @@ -Subproject commit 139dbe6418f1ecee09b020086fc2fc9e844e57e3 +Subproject commit 70e8c48a3d74320758c0f2f876ff1e69b8061b81 diff --git a/community-build/community-projects/scala-parallel-collections b/community-build/community-projects/scala-parallel-collections index 152db284cc56..0d8cdab0b16c 160000 --- a/community-build/community-projects/scala-parallel-collections +++ b/community-build/community-projects/scala-parallel-collections @@ -1 +1 @@ -Subproject commit 152db284cc56c59c8fa9f74454e03d04c4355b60 +Subproject commit 0d8cdab0b16cc1c17dd2867cb2300b30f1e53cc6 diff --git a/community-build/community-projects/scala-stm b/community-build/community-projects/scala-stm index 7011331d3684..e25579f586a9 160000 --- a/community-build/community-projects/scala-stm +++ b/community-build/community-projects/scala-stm @@ -1 +1 @@ -Subproject commit 7011331d36848faf9af407e3e85ab75076dfdefa +Subproject commit e25579f586a9d92242201d07faff5e586de1af69 diff --git a/community-build/community-projects/scala-xml b/community-build/community-projects/scala-xml index d809e1d855d7..0daee4a3a3d9 160000 --- a/community-build/community-projects/scala-xml +++ b/community-build/community-projects/scala-xml @@ -1 +1 @@ -Subproject commit d809e1d855d75352365ae4f218049a9910de7265 +Subproject commit 0daee4a3a3d9e32d3eca211824af8db54b646c25 diff --git a/community-build/community-projects/scalatestplus-scalacheck b/community-build/community-projects/scalatestplus-scalacheck index 010387f5854e..349d6d8c9367 160000 --- a/community-build/community-projects/scalatestplus-scalacheck +++ b/community-build/community-projects/scalatestplus-scalacheck @@ -1 +1 @@ -Subproject commit 010387f5854eb473ddc71ecd2d6a0183dfebfbcb +Subproject commit 349d6d8c936738a685fe3644d35a46d214b95034 diff --git a/community-build/community-projects/scodec b/community-build/community-projects/scodec index 8d7f83ae76e3..c337c06bef4a 160000 --- a/community-build/community-projects/scodec +++ b/community-build/community-projects/scodec @@ -1 +1 @@ -Subproject commit 8d7f83ae76e3278245631126d808c9c02e57ae23 +Subproject commit c337c06bef4af0a7fa7282066e264a707f846bf7 diff --git a/community-build/community-projects/scodec-bits b/community-build/community-projects/scodec-bits index 85de35c014b9..2710dac942b1 160000 --- a/community-build/community-projects/scodec-bits +++ b/community-build/community-projects/scodec-bits @@ -1 +1 @@ -Subproject commit 85de35c014b948f0dd3f94e975c42d17deab4055 +Subproject commit 2710dac942b1a2888dbbcd152b6ba3bf82fc2ebd diff --git a/community-build/community-projects/sconfig b/community-build/community-projects/sconfig index 43f7b12dce6e..38d620bdab66 160000 --- a/community-build/community-projects/sconfig +++ b/community-build/community-projects/sconfig @@ -1 +1 @@ -Subproject commit 43f7b12dce6ec53bc7fafee8a35141944f31763e +Subproject commit 38d620bdab6656850ab0358583d2bb3638f83150 diff --git a/community-build/community-projects/shapeless b/community-build/community-projects/shapeless index bfa5dba99d64..dfcd200f3ff6 160000 --- a/community-build/community-projects/shapeless +++ b/community-build/community-projects/shapeless @@ -1 +1 @@ -Subproject commit bfa5dba99d6402336a1fbaf687f5cb29b3e78fe2 +Subproject commit dfcd200f3ff68bfb76c93666b4f44c1d6f8f0277 diff --git a/community-build/community-projects/simulacrum-scalafix b/community-build/community-projects/simulacrum-scalafix index 75f7e10d30fb..b6a5d3d5eb9d 160000 --- a/community-build/community-projects/simulacrum-scalafix +++ b/community-build/community-projects/simulacrum-scalafix @@ -1 +1 @@ -Subproject commit 75f7e10d30fb1b848b7adaf2a026320ee548b56a +Subproject commit b6a5d3d5eb9d65852fdc14491085e5f465e2d3da diff --git a/community-build/community-projects/sourcecode b/community-build/community-projects/sourcecode index 1b8fcebec8c9..e911b9f27b23 160000 --- a/community-build/community-projects/sourcecode +++ b/community-build/community-projects/sourcecode @@ -1 +1 @@ -Subproject commit 1b8fcebec8c9322a06498fd5e1086bfc5abee277 +Subproject commit e911b9f27b23ca38d3cb657ea9c85856d6685aa9 diff --git a/community-build/community-projects/upickle b/community-build/community-projects/upickle index 52e388109f3a..0aa5b61300fe 160000 --- a/community-build/community-projects/upickle +++ b/community-build/community-projects/upickle @@ -1 +1 @@ -Subproject commit 52e388109f3a03f63795e0aa9b17cf6453eac69d +Subproject commit 0aa5b61300fe8032c2bc364a8a19d78ededc69be diff --git a/community-build/community-projects/utest b/community-build/community-projects/utest index fcc38cf2d01c..37be849fe85e 160000 --- a/community-build/community-projects/utest +++ b/community-build/community-projects/utest @@ -1 +1 @@ -Subproject commit fcc38cf2d01cbff99618c81be651e957b2b42e52 +Subproject commit 37be849fe85e6e9f92d31cac5a53c92789700d48 diff --git a/community-build/community-projects/verify b/community-build/community-projects/verify index bd32493e1128..c6646b4d2261 160000 --- a/community-build/community-projects/verify +++ b/community-build/community-projects/verify @@ -1 +1 @@ -Subproject commit bd32493e1128590cba0c1b4d0d04b50bc0af6740 +Subproject commit c6646b4d2261ff33db119a84744740e4124dce1b diff --git a/community-build/community-projects/xml-interpolator b/community-build/community-projects/xml-interpolator index 0e032658e3d9..7232e3df7bf4 160000 --- a/community-build/community-projects/xml-interpolator +++ b/community-build/community-projects/xml-interpolator @@ -1 +1 @@ -Subproject commit 0e032658e3d915bac4a22360bcdeb880bd81a03d +Subproject commit 7232e3df7bf428c7c7cd202b47af94f623f21c19 diff --git a/compiler/src/dotty/tools/dotc/config/ScalaSettings.scala b/compiler/src/dotty/tools/dotc/config/ScalaSettings.scala index 7506976fa212..def17812571c 100644 --- a/compiler/src/dotty/tools/dotc/config/ScalaSettings.scala +++ b/compiler/src/dotty/tools/dotc/config/ScalaSettings.scala @@ -11,6 +11,18 @@ import Settings.Setting trait CommonScalaSettings { self: Settings.SettingGroup => protected def defaultClasspath: String = sys.env.getOrElse("CLASSPATH", ".") + protected def defaultPageWidth: Int = { + val defaultWidth = 80 + val columnsVar = System.getenv("COLUMNS") + if columnsVar != null then columnsVar.toInt + else if Properties.isWin then + val ansiconVar = System.getenv("ANSICON") // eg. "142x32766 (142x26)" + if ansiconVar != null && ansiconVar.matches("[0-9]+x.*") then + ansiconVar.substring(0, ansiconVar.indexOf("x")).toInt + else defaultWidth + else defaultWidth + } + /** Path related settings */ val bootclasspath: Setting[String] = PathSetting("-bootclasspath", "Override location of bootstrap class files.", Defaults.scalaBootClassPath, aliases = List("--boot-class-path")) val extdirs: Setting[String] = PathSetting("-extdirs", "Override location of installed extensions.", Defaults.scalaExtDirs, aliases = List("--extension-directories")) From 5b2970c44ee2318da5678e9c5261d9f2b599618e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Micheloud?= Date: Fri, 13 Nov 2020 10:03:09 +0100 Subject: [PATCH 14/21] improved readability of help messages --- compiler/src/dotty/tools/dotc/config/CompilerCommand.scala | 2 ++ 1 file changed, 2 insertions(+) diff --git a/compiler/src/dotty/tools/dotc/config/CompilerCommand.scala b/compiler/src/dotty/tools/dotc/config/CompilerCommand.scala index 049972365642..0182af02d79d 100644 --- a/compiler/src/dotty/tools/dotc/config/CompilerCommand.scala +++ b/compiler/src/dotty/tools/dotc/config/CompilerCommand.scala @@ -3,6 +3,8 @@ package config import java.nio.file.{Files, Paths} +import org.jline.terminal.TerminalBuilder + import Settings._ import core.Contexts._ import Properties._ From 4ef48a9edde7fe336a2eb473c4591528a46384c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Micheloud?= Date: Sat, 14 Nov 2020 00:39:07 +0100 Subject: [PATCH 15/21] removed dependency on jline terminal --- compiler/src/dotty/tools/dotc/config/CompilerCommand.scala | 2 -- 1 file changed, 2 deletions(-) diff --git a/compiler/src/dotty/tools/dotc/config/CompilerCommand.scala b/compiler/src/dotty/tools/dotc/config/CompilerCommand.scala index 0182af02d79d..049972365642 100644 --- a/compiler/src/dotty/tools/dotc/config/CompilerCommand.scala +++ b/compiler/src/dotty/tools/dotc/config/CompilerCommand.scala @@ -3,8 +3,6 @@ package config import java.nio.file.{Files, Paths} -import org.jline.terminal.TerminalBuilder - import Settings._ import core.Contexts._ import Properties._ From 5148a33cbd60b6e8d156249ce353f9b255cc7194 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Micheloud?= Date: Sat, 14 Nov 2020 09:34:04 +0100 Subject: [PATCH 16/21] added defaultPageWidth into ScalaSettings --- compiler/src/dotty/tools/dotc/config/ScalaSettings.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/src/dotty/tools/dotc/config/ScalaSettings.scala b/compiler/src/dotty/tools/dotc/config/ScalaSettings.scala index def17812571c..19e5a4cea229 100644 --- a/compiler/src/dotty/tools/dotc/config/ScalaSettings.scala +++ b/compiler/src/dotty/tools/dotc/config/ScalaSettings.scala @@ -38,7 +38,7 @@ trait CommonScalaSettings { self: Settings.SettingGroup => val verbose: Setting[Boolean] = BooleanSetting("-verbose", "Output messages about what the compiler is doing.", aliases = List("--verbose")) val version: Setting[Boolean] = BooleanSetting("-version", "Print product version and exit.", aliases = List("--version")) val help: Setting[Boolean] = BooleanSetting("-help", "Print a synopsis of standard options.", aliases = List("--help")) - val pageWidth: Setting[Int] = IntSetting("-pagewidth", "Set page width", 80, aliases = List("--page-width")) + val pageWidth: Setting[Int] = IntSetting("-pagewidth", "Set page width", defaultPageWidth, aliases = List("--page-width")) val silentWarnings: Setting[Boolean] = BooleanSetting("-nowarn", "Silence all warnings.", aliases = List("--no-warnings")) /** Other settings */ From 6c38e3945ba5c4cf8f35eaaea48103146039813c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Micheloud?= Date: Tue, 2 Mar 2021 12:21:26 +0100 Subject: [PATCH 17/21] sync with upstream, added tput --- .../dotty/tools/dotc/config/CliCommand.scala | 48 ++++++++++++++----- dist/bin/common | 6 +++ 2 files changed, 41 insertions(+), 13 deletions(-) diff --git a/compiler/src/dotty/tools/dotc/config/CliCommand.scala b/compiler/src/dotty/tools/dotc/config/CliCommand.scala index 1a48fbfdf131..e361519bb54d 100644 --- a/compiler/src/dotty/tools/dotc/config/CliCommand.scala +++ b/compiler/src/dotty/tools/dotc/config/CliCommand.scala @@ -66,9 +66,39 @@ trait CliCommand: /** Creates a help message for a subset of options based on cond */ protected def availableOptionsMsg(cond: Setting[?] => Boolean)(using settings: ConcreteSettings)(using SettingsState): String = - val ss = (settings.allSettings filter cond).toList sortBy (_.name) - val width = (ss map (_.name.length)).max - def format(s: String) = ("%-" + width + "s") format s + val ss = (settings.allSettings filter cond).toList sortBy (_.name) + val maxNameWidth = 30 + val nameWidths = ss.map(_.name.length).partition(_ < maxNameWidth)._1 + val width = if nameWidths.nonEmpty then nameWidths.max else maxNameWidth + val terminalWidth = settings.pageWidth.value + val (nameWidth, descriptionWidth) = { + val w1 = + if width < maxNameWidth then width + else maxNameWidth + val w2 = + if terminalWidth < w1 + maxNameWidth then 0 + else terminalWidth - w1 - 1 + (w1, w2) + } + def formatName(name: String) = + if name.length <= nameWidth then ("%-" + nameWidth + "s") format name + else (name + "\n%-" + nameWidth + "s") format "" + def formatDescription(text: String): String = + if descriptionWidth == 0 then text + else if text.length < descriptionWidth then text + else { + val inx = text.substring(0, descriptionWidth).lastIndexOf(" ") + if inx < 0 then text + else + val str = text.substring(0, inx) + s"${str}\n${formatName("")} ${formatDescription(text.substring(inx + 1))}" + } + def formatSetting(name: String, value: String) = + if (value.nonEmpty) + // the format here is helping to make empty padding and put the additional information exactly under the description. + s"\n${formatName("")} $name: $value." + else + "" def helpStr(s: Setting[?]) = def defaultValue = s.default match case _: Int | _: String => s.default.toString @@ -76,16 +106,8 @@ trait CliCommand: // For now, skip the default values that do not make sense for the end user. // For example 'false' for the version command. "" - - def formatSetting(name: String, value: String) = - if (value.nonEmpty) - // the format here is helping to make empty padding and put the additional information exactly under the description. - s"\n${format("")} $name: $value." - else - "" - s"${format(s.name)} ${s.description}${formatSetting("Default", defaultValue)}${formatSetting("Choices", s.legalChoices)}" - - ss.map(helpStr).mkString("", "\n", s"\n${format("@")} A text file containing compiler arguments (options and source files).\n") + s"${formatName(s.name)} ${formatDescription(s.description)}${formatSetting("Default", defaultValue)}${formatSetting("Choices", s.legalChoices)}" + ss.map(helpStr).mkString("", "\n", s"\n${formatName("@")} ${formatDescription("A text file containing compiler arguments (options and source files).")}\n") protected def shortUsage: String = s"Usage: $cmdName " diff --git a/dist/bin/common b/dist/bin/common index da5ae4aeff66..a3847b2b1dbd 100755 --- a/dist/bin/common +++ b/dist/bin/common @@ -27,6 +27,12 @@ function onExit() { trap onExit INT TERM EXIT unset cygwin mingw msys darwin conemu + +# COLUMNS is used together with command line option '-pageWidth'. +if command -v tput >/dev/null 2>&1; then + export COLUMNS="$(tput -Tdumb cols)" +fi + case "`uname`" in CYGWIN*) cygwin=true ;; From 49306d3b30d70532c453fdb85098438d90ee3279 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Micheloud?= Date: Fri, 13 Nov 2020 10:03:09 +0100 Subject: [PATCH 18/21] improved readability of help messages --- compiler/src/dotty/tools/dotc/config/CompilerCommand.scala | 2 ++ 1 file changed, 2 insertions(+) diff --git a/compiler/src/dotty/tools/dotc/config/CompilerCommand.scala b/compiler/src/dotty/tools/dotc/config/CompilerCommand.scala index 049972365642..0182af02d79d 100644 --- a/compiler/src/dotty/tools/dotc/config/CompilerCommand.scala +++ b/compiler/src/dotty/tools/dotc/config/CompilerCommand.scala @@ -3,6 +3,8 @@ package config import java.nio.file.{Files, Paths} +import org.jline.terminal.TerminalBuilder + import Settings._ import core.Contexts._ import Properties._ From c743126ded733f65c1f80d3bb364c96b028bfc66 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Micheloud?= Date: Tue, 2 Mar 2021 16:56:43 +0100 Subject: [PATCH 19/21] 2nd attempt --- compiler/src/dotty/tools/dotc/config/CompilerCommand.scala | 2 -- 1 file changed, 2 deletions(-) diff --git a/compiler/src/dotty/tools/dotc/config/CompilerCommand.scala b/compiler/src/dotty/tools/dotc/config/CompilerCommand.scala index 0182af02d79d..049972365642 100644 --- a/compiler/src/dotty/tools/dotc/config/CompilerCommand.scala +++ b/compiler/src/dotty/tools/dotc/config/CompilerCommand.scala @@ -3,8 +3,6 @@ package config import java.nio.file.{Files, Paths} -import org.jline.terminal.TerminalBuilder - import Settings._ import core.Contexts._ import Properties._ From 270fe2504a0444ad7991fe450a66304bc352d5c2 Mon Sep 17 00:00:00 2001 From: Tom Grigg Date: Thu, 4 Mar 2021 15:24:13 -0800 Subject: [PATCH 20/21] Bring community build submodules up to date --- community-build/community-projects/AsyncFile | 2 +- community-build/community-projects/Equal | 2 +- community-build/community-projects/FingerTree | 2 +- community-build/community-projects/Log | 2 +- community-build/community-projects/Lucre | 2 +- community-build/community-projects/Model | 2 +- community-build/community-projects/Numbers | 2 +- community-build/community-projects/PPrint | 2 +- community-build/community-projects/ScalaPB | 2 +- community-build/community-projects/Serial | 2 +- community-build/community-projects/Span | 2 +- community-build/community-projects/algebra | 2 +- community-build/community-projects/betterfiles | 2 +- community-build/community-projects/cats-mtl | 2 +- community-build/community-projects/discipline-munit | 2 +- community-build/community-projects/discipline-specs2 | 2 +- community-build/community-projects/dotty-cps-async | 2 +- community-build/community-projects/effpi | 2 +- community-build/community-projects/fansi | 2 +- community-build/community-projects/fastparse | 2 +- community-build/community-projects/geny | 2 +- community-build/community-projects/intent | 2 +- community-build/community-projects/izumi-reflect | 2 +- community-build/community-projects/minitest | 2 +- community-build/community-projects/munit | 2 +- community-build/community-projects/os-lib | 2 +- community-build/community-projects/perspective | 2 +- community-build/community-projects/requests-scala | 2 +- community-build/community-projects/scala-parallel-collections | 2 +- community-build/community-projects/scala-stm | 2 +- community-build/community-projects/scala-xml | 2 +- community-build/community-projects/scalatestplus-scalacheck | 2 +- community-build/community-projects/scodec | 2 +- community-build/community-projects/scodec-bits | 2 +- community-build/community-projects/sconfig | 2 +- community-build/community-projects/shapeless | 2 +- community-build/community-projects/simulacrum-scalafix | 2 +- community-build/community-projects/sourcecode | 2 +- community-build/community-projects/upickle | 2 +- community-build/community-projects/utest | 2 +- community-build/community-projects/verify | 2 +- community-build/community-projects/xml-interpolator | 2 +- 42 files changed, 42 insertions(+), 42 deletions(-) diff --git a/community-build/community-projects/AsyncFile b/community-build/community-projects/AsyncFile index fe33563b74e1..831f1db78cbd 160000 --- a/community-build/community-projects/AsyncFile +++ b/community-build/community-projects/AsyncFile @@ -1 +1 @@ -Subproject commit fe33563b74e1e1df333e86bb04b728feb199eecd +Subproject commit 831f1db78cbda7b060a7dfe0426d0b59709fd728 diff --git a/community-build/community-projects/Equal b/community-build/community-projects/Equal index f42b05026591..43e829e01959 160000 --- a/community-build/community-projects/Equal +++ b/community-build/community-projects/Equal @@ -1 +1 @@ -Subproject commit f42b05026591e146d9b4cfdd6418383321a76cd4 +Subproject commit 43e829e0195961500824388a6552a66ec13521cd diff --git a/community-build/community-projects/FingerTree b/community-build/community-projects/FingerTree index 42b27e008e6f..b5c89dff9efa 160000 --- a/community-build/community-projects/FingerTree +++ b/community-build/community-projects/FingerTree @@ -1 +1 @@ -Subproject commit 42b27e008e6f8095a928cbbef8efb4c644e46289 +Subproject commit b5c89dff9efaab861b605199ac3d0ccfbb3f80d4 diff --git a/community-build/community-projects/Log b/community-build/community-projects/Log index 02b59d0df788..bef85c8a61d8 160000 --- a/community-build/community-projects/Log +++ b/community-build/community-projects/Log @@ -1 +1 @@ -Subproject commit 02b59d0df788fdbdf602ba7fdd40c63c7aca885f +Subproject commit bef85c8a61d8f08be65a2de1822cb60485296d32 diff --git a/community-build/community-projects/Lucre b/community-build/community-projects/Lucre index b569546707c5..87d680baaa23 160000 --- a/community-build/community-projects/Lucre +++ b/community-build/community-projects/Lucre @@ -1 +1 @@ -Subproject commit b569546707c55dded1072cd544afd0e01b56d25c +Subproject commit 87d680baaa2355de5b062adcbdfc5005e787521b diff --git a/community-build/community-projects/Model b/community-build/community-projects/Model index 0704fa394b39..d4fa3fdc4049 160000 --- a/community-build/community-projects/Model +++ b/community-build/community-projects/Model @@ -1 +1 @@ -Subproject commit 0704fa394b39fc80c6292e67561c0884f50fabf7 +Subproject commit d4fa3fdc4049020e2cddd694d0e44f79b2bc0cfe diff --git a/community-build/community-projects/Numbers b/community-build/community-projects/Numbers index 971a6755c677..3d9a4a028e61 160000 --- a/community-build/community-projects/Numbers +++ b/community-build/community-projects/Numbers @@ -1 +1 @@ -Subproject commit 971a6755c677245678fd97652f9931910b797218 +Subproject commit 3d9a4a028e610ee28499284ed30a53789270c56e diff --git a/community-build/community-projects/PPrint b/community-build/community-projects/PPrint index 94f9f4a8590c..231bc187faad 160000 --- a/community-build/community-projects/PPrint +++ b/community-build/community-projects/PPrint @@ -1 +1 @@ -Subproject commit 94f9f4a8590c06f98e6c515ffdbf3a17054284ec +Subproject commit 231bc187faad172b55af4ddc50c30228a56b2ebd diff --git a/community-build/community-projects/ScalaPB b/community-build/community-projects/ScalaPB index 984eba1d17a9..95515e8d052a 160000 --- a/community-build/community-projects/ScalaPB +++ b/community-build/community-projects/ScalaPB @@ -1 +1 @@ -Subproject commit 984eba1d17a9371e166fd76f89880590d8f5bfa5 +Subproject commit 95515e8d052a3b36f6fad168838e874420360de4 diff --git a/community-build/community-projects/Serial b/community-build/community-projects/Serial index 0a3a39772f6d..b4c3724b7fac 160000 --- a/community-build/community-projects/Serial +++ b/community-build/community-projects/Serial @@ -1 +1 @@ -Subproject commit 0a3a39772f6df3fac495f203c8d582d29c72124b +Subproject commit b4c3724b7fac8b4d7fbae730118c5075c6f4392d diff --git a/community-build/community-projects/Span b/community-build/community-projects/Span index 8674590a836c..467882fc0320 160000 --- a/community-build/community-projects/Span +++ b/community-build/community-projects/Span @@ -1 +1 @@ -Subproject commit 8674590a836cb227284eef08a307dbbdb9140f15 +Subproject commit 467882fc032081db5fe840db94251c9cc89cb30a diff --git a/community-build/community-projects/algebra b/community-build/community-projects/algebra index 705fdced2505..a010f13d7c4f 160000 --- a/community-build/community-projects/algebra +++ b/community-build/community-projects/algebra @@ -1 +1 @@ -Subproject commit 705fdced25055f5e9df7b65a1ba2a0a379d63c90 +Subproject commit a010f13d7c4f5029ed0f6ce088f6e55a0c87ef3e diff --git a/community-build/community-projects/betterfiles b/community-build/community-projects/betterfiles index fae0d8432411..e138a70e4922 160000 --- a/community-build/community-projects/betterfiles +++ b/community-build/community-projects/betterfiles @@ -1 +1 @@ -Subproject commit fae0d8432411778cd7f1220a42f8cea768230592 +Subproject commit e138a70e49225584171e5e879181796fe5594292 diff --git a/community-build/community-projects/cats-mtl b/community-build/community-projects/cats-mtl index 5b5dd285d42a..1b0d1404f0eb 160000 --- a/community-build/community-projects/cats-mtl +++ b/community-build/community-projects/cats-mtl @@ -1 +1 @@ -Subproject commit 5b5dd285d42a275ab4123fdac1003b10aa1b73f6 +Subproject commit 1b0d1404f0eb104e72d4fd80c4ba285c9390fbc0 diff --git a/community-build/community-projects/discipline-munit b/community-build/community-projects/discipline-munit index fad723f51480..e0a3aee65b85 160000 --- a/community-build/community-projects/discipline-munit +++ b/community-build/community-projects/discipline-munit @@ -1 +1 @@ -Subproject commit fad723f514808466ce76ed9c8897df56216747a4 +Subproject commit e0a3aee65b85bf8d6bb53037e4bc33ebfdeaedff diff --git a/community-build/community-projects/discipline-specs2 b/community-build/community-projects/discipline-specs2 index ab61ef6ed278..b2fa931a44ee 160000 --- a/community-build/community-projects/discipline-specs2 +++ b/community-build/community-projects/discipline-specs2 @@ -1 +1 @@ -Subproject commit ab61ef6ed2780d6800a959421cea9fe00aa9ff53 +Subproject commit b2fa931a44eeb6a6afa1343e57f963e73aafff59 diff --git a/community-build/community-projects/dotty-cps-async b/community-build/community-projects/dotty-cps-async index 2ef1853669c8..614dc4a30557 160000 --- a/community-build/community-projects/dotty-cps-async +++ b/community-build/community-projects/dotty-cps-async @@ -1 +1 @@ -Subproject commit 2ef1853669c80bddbf1a33c8d17dce7a7f09d494 +Subproject commit 614dc4a30557bf7d282387d0c7efcdb59d97d76b diff --git a/community-build/community-projects/effpi b/community-build/community-projects/effpi index f6b0b3f18593..52702912ce92 160000 --- a/community-build/community-projects/effpi +++ b/community-build/community-projects/effpi @@ -1 +1 @@ -Subproject commit f6b0b3f185933f12faf3bd428c31cbac3cb7262e +Subproject commit 52702912ce92b801ab9fb033d30970cdf45b6961 diff --git a/community-build/community-projects/fansi b/community-build/community-projects/fansi index c30b5cd3cb6c..21d1db61a315 160000 --- a/community-build/community-projects/fansi +++ b/community-build/community-projects/fansi @@ -1 +1 @@ -Subproject commit c30b5cd3cb6ca94cc9f489b75b4920e8d0b71914 +Subproject commit 21d1db61a315b31636dfd6515f346454b21ac5f6 diff --git a/community-build/community-projects/fastparse b/community-build/community-projects/fastparse index c49998f74aa0..9b02d7050013 160000 --- a/community-build/community-projects/fastparse +++ b/community-build/community-projects/fastparse @@ -1 +1 @@ -Subproject commit c49998f74aa05f27720eab974f25c3ee780f3549 +Subproject commit 9b02d7050013fd7158f37f60116f3907d4a578e2 diff --git a/community-build/community-projects/geny b/community-build/community-projects/geny index f1804705fecf..c511f4ad1ae2 160000 --- a/community-build/community-projects/geny +++ b/community-build/community-projects/geny @@ -1 +1 @@ -Subproject commit f1804705fecfd41bf4f9a2cde24b7549fd3315a5 +Subproject commit c511f4ad1ae2adf94bd55691bd8b4afed41213fc diff --git a/community-build/community-projects/intent b/community-build/community-projects/intent index 580f6cb5fce2..38c7314fb764 160000 --- a/community-build/community-projects/intent +++ b/community-build/community-projects/intent @@ -1 +1 @@ -Subproject commit 580f6cb5fce211e512478fc07c6ef07c8f1105b8 +Subproject commit 38c7314fb7643bc1786e4358b83a815194071d48 diff --git a/community-build/community-projects/izumi-reflect b/community-build/community-projects/izumi-reflect index 490df1c367dd..54051d0bca92 160000 --- a/community-build/community-projects/izumi-reflect +++ b/community-build/community-projects/izumi-reflect @@ -1 +1 @@ -Subproject commit 490df1c367ddef5bfedeb79c1d0f966a63c00e05 +Subproject commit 54051d0bca921706ef0a3f9f63264f6f57d50ef0 diff --git a/community-build/community-projects/minitest b/community-build/community-projects/minitest index bda6c70aaeff..746b6aa16432 160000 --- a/community-build/community-projects/minitest +++ b/community-build/community-projects/minitest @@ -1 +1 @@ -Subproject commit bda6c70aaeff686769dc4ac38ce31573bec93a08 +Subproject commit 746b6aa1643254786549ebe2785c80693359acd1 diff --git a/community-build/community-projects/munit b/community-build/community-projects/munit index 5f384b548960..3c9b71d7a087 160000 --- a/community-build/community-projects/munit +++ b/community-build/community-projects/munit @@ -1 +1 @@ -Subproject commit 5f384b548960ee7731649f5f900eb1d854e7827a +Subproject commit 3c9b71d7a087015e95411534aaaf6d92cbbbfbc3 diff --git a/community-build/community-projects/os-lib b/community-build/community-projects/os-lib index 7564b495b42c..1a848dc584dd 160000 --- a/community-build/community-projects/os-lib +++ b/community-build/community-projects/os-lib @@ -1 +1 @@ -Subproject commit 7564b495b42c364832748acc7aae449cda45596c +Subproject commit 1a848dc584ddfdcf48b7075a4292e09d0b8c00e0 diff --git a/community-build/community-projects/perspective b/community-build/community-projects/perspective index f9d3067db6f6..f0525cdc94a5 160000 --- a/community-build/community-projects/perspective +++ b/community-build/community-projects/perspective @@ -1 +1 @@ -Subproject commit f9d3067db6f6653b388762e60990f762a202a47a +Subproject commit f0525cdc94a52e92587a464761741369f3351345 diff --git a/community-build/community-projects/requests-scala b/community-build/community-projects/requests-scala index 70e8c48a3d74..139dbe6418f1 160000 --- a/community-build/community-projects/requests-scala +++ b/community-build/community-projects/requests-scala @@ -1 +1 @@ -Subproject commit 70e8c48a3d74320758c0f2f876ff1e69b8061b81 +Subproject commit 139dbe6418f1ecee09b020086fc2fc9e844e57e3 diff --git a/community-build/community-projects/scala-parallel-collections b/community-build/community-projects/scala-parallel-collections index 0d8cdab0b16c..152db284cc56 160000 --- a/community-build/community-projects/scala-parallel-collections +++ b/community-build/community-projects/scala-parallel-collections @@ -1 +1 @@ -Subproject commit 0d8cdab0b16cc1c17dd2867cb2300b30f1e53cc6 +Subproject commit 152db284cc56c59c8fa9f74454e03d04c4355b60 diff --git a/community-build/community-projects/scala-stm b/community-build/community-projects/scala-stm index e25579f586a9..7011331d3684 160000 --- a/community-build/community-projects/scala-stm +++ b/community-build/community-projects/scala-stm @@ -1 +1 @@ -Subproject commit e25579f586a9d92242201d07faff5e586de1af69 +Subproject commit 7011331d36848faf9af407e3e85ab75076dfdefa diff --git a/community-build/community-projects/scala-xml b/community-build/community-projects/scala-xml index 0daee4a3a3d9..d809e1d855d7 160000 --- a/community-build/community-projects/scala-xml +++ b/community-build/community-projects/scala-xml @@ -1 +1 @@ -Subproject commit 0daee4a3a3d9e32d3eca211824af8db54b646c25 +Subproject commit d809e1d855d75352365ae4f218049a9910de7265 diff --git a/community-build/community-projects/scalatestplus-scalacheck b/community-build/community-projects/scalatestplus-scalacheck index 349d6d8c9367..010387f5854e 160000 --- a/community-build/community-projects/scalatestplus-scalacheck +++ b/community-build/community-projects/scalatestplus-scalacheck @@ -1 +1 @@ -Subproject commit 349d6d8c936738a685fe3644d35a46d214b95034 +Subproject commit 010387f5854eb473ddc71ecd2d6a0183dfebfbcb diff --git a/community-build/community-projects/scodec b/community-build/community-projects/scodec index c337c06bef4a..8d7f83ae76e3 160000 --- a/community-build/community-projects/scodec +++ b/community-build/community-projects/scodec @@ -1 +1 @@ -Subproject commit c337c06bef4af0a7fa7282066e264a707f846bf7 +Subproject commit 8d7f83ae76e3278245631126d808c9c02e57ae23 diff --git a/community-build/community-projects/scodec-bits b/community-build/community-projects/scodec-bits index 2710dac942b1..85de35c014b9 160000 --- a/community-build/community-projects/scodec-bits +++ b/community-build/community-projects/scodec-bits @@ -1 +1 @@ -Subproject commit 2710dac942b1a2888dbbcd152b6ba3bf82fc2ebd +Subproject commit 85de35c014b948f0dd3f94e975c42d17deab4055 diff --git a/community-build/community-projects/sconfig b/community-build/community-projects/sconfig index 38d620bdab66..43f7b12dce6e 160000 --- a/community-build/community-projects/sconfig +++ b/community-build/community-projects/sconfig @@ -1 +1 @@ -Subproject commit 38d620bdab6656850ab0358583d2bb3638f83150 +Subproject commit 43f7b12dce6ec53bc7fafee8a35141944f31763e diff --git a/community-build/community-projects/shapeless b/community-build/community-projects/shapeless index dfcd200f3ff6..bfa5dba99d64 160000 --- a/community-build/community-projects/shapeless +++ b/community-build/community-projects/shapeless @@ -1 +1 @@ -Subproject commit dfcd200f3ff68bfb76c93666b4f44c1d6f8f0277 +Subproject commit bfa5dba99d6402336a1fbaf687f5cb29b3e78fe2 diff --git a/community-build/community-projects/simulacrum-scalafix b/community-build/community-projects/simulacrum-scalafix index b6a5d3d5eb9d..75f7e10d30fb 160000 --- a/community-build/community-projects/simulacrum-scalafix +++ b/community-build/community-projects/simulacrum-scalafix @@ -1 +1 @@ -Subproject commit b6a5d3d5eb9d65852fdc14491085e5f465e2d3da +Subproject commit 75f7e10d30fb1b848b7adaf2a026320ee548b56a diff --git a/community-build/community-projects/sourcecode b/community-build/community-projects/sourcecode index e911b9f27b23..1b8fcebec8c9 160000 --- a/community-build/community-projects/sourcecode +++ b/community-build/community-projects/sourcecode @@ -1 +1 @@ -Subproject commit e911b9f27b23ca38d3cb657ea9c85856d6685aa9 +Subproject commit 1b8fcebec8c9322a06498fd5e1086bfc5abee277 diff --git a/community-build/community-projects/upickle b/community-build/community-projects/upickle index 0aa5b61300fe..52e388109f3a 160000 --- a/community-build/community-projects/upickle +++ b/community-build/community-projects/upickle @@ -1 +1 @@ -Subproject commit 0aa5b61300fe8032c2bc364a8a19d78ededc69be +Subproject commit 52e388109f3a03f63795e0aa9b17cf6453eac69d diff --git a/community-build/community-projects/utest b/community-build/community-projects/utest index 37be849fe85e..fcc38cf2d01c 160000 --- a/community-build/community-projects/utest +++ b/community-build/community-projects/utest @@ -1 +1 @@ -Subproject commit 37be849fe85e6e9f92d31cac5a53c92789700d48 +Subproject commit fcc38cf2d01cbff99618c81be651e957b2b42e52 diff --git a/community-build/community-projects/verify b/community-build/community-projects/verify index c6646b4d2261..bd32493e1128 160000 --- a/community-build/community-projects/verify +++ b/community-build/community-projects/verify @@ -1 +1 @@ -Subproject commit c6646b4d2261ff33db119a84744740e4124dce1b +Subproject commit bd32493e1128590cba0c1b4d0d04b50bc0af6740 diff --git a/community-build/community-projects/xml-interpolator b/community-build/community-projects/xml-interpolator index 7232e3df7bf4..0e032658e3d9 160000 --- a/community-build/community-projects/xml-interpolator +++ b/community-build/community-projects/xml-interpolator @@ -1 +1 @@ -Subproject commit 7232e3df7bf428c7c7cd202b47af94f623f21c19 +Subproject commit 0e032658e3d915bac4a22360bcdeb880bd81a03d From 1c039613cba17600afb912c2329f31a079ec6395 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Micheloud?= Date: Fri, 5 Mar 2021 08:49:22 +0100 Subject: [PATCH 21/21] dist/bin/*.bat belong to another branch --- dist/bin/common.bat | 57 ------------- dist/bin/scala.bat | 121 --------------------------- dist/bin/scalac.bat | 174 -------------------------------------- dist/bin/scaladoc.bat | 190 ------------------------------------------ 4 files changed, 542 deletions(-) delete mode 100644 dist/bin/common.bat delete mode 100644 dist/bin/scala.bat delete mode 100644 dist/bin/scalac.bat delete mode 100644 dist/bin/scaladoc.bat diff --git a/dist/bin/common.bat b/dist/bin/common.bat deleted file mode 100644 index 401e493d733e..000000000000 --- a/dist/bin/common.bat +++ /dev/null @@ -1,57 +0,0 @@ -@rem ######################################################################### -@rem ## Code common to scalac.bat, scaladoc.bat and scala.bat - -if defined JAVACMD ( - set "_JAVACMD=%JAVACMD%" -) else if defined JAVA_HOME ( - set "_JAVACMD=%JAVA_HOME%\bin\java.exe" -) else if defined JDK_HOME ( - set "_JAVACMD=%JDK_HOME%\bin\java.exe" -) else ( - where /q java.exe - if !ERRORLEVEL!==0 ( - set __JAVA_BIN_DIR= - for /f "delims=" %%i in ('where /f java.exe') do ( - set "__PATH=%%~dpi" - @rem we take first occurence and ignore Oracle path for java executable - if not defined __JAVA_BIN_DIR if "!__PATH!"=="!__PATH:javapath=!" set "__JAVA_BIN_DIR=!__PATH!" - ) - if defined __JAVA_BIN_DIR set "_JAVACMD=!__JAVA_BIN_DIR!\java.exe" - ) - if not defined _JAVACMD ( - set "__PATH=%ProgramFiles%\Java" - for /f %%f in ('dir /ad /b "!__PATH!\jre*" 2^>NUL') do set "_JAVA_HOME=!__PATH!\%%f" - if not defined _JAVA_HOME ( - set __PATH=C:\opt - for /f %%f in ('dir /ad /b "!__PATH!\jdk*" 2^>NUL') do set "_JAVA_HOME=!__PATH!\%%f\jre" - ) - if defined _JAVA_HOME set "_JAVACMD=!_JAVA_HOME!\bin\java.exe" - ) -) -if not exist "%_JAVACMD%" ( - echo Error: Java executable not found ^(!_JAVACMD!^) 1>&2 - set _EXITCODE=1 - goto :eof -) - -if not defined _PROG_HOME set "_PROG_HOME=%~dp0" -for /f %%f in ("%_PROG_HOME%\.") do set "_LIB_DIR=%%~dpflib" - -set _PSEP=; - -for /f %%f in ('dir /a-d /b "%_LIB_DIR%\*scala3-compiler*"') do set _SCALA3_COMP=%_LIB_DIR%\%%f -for /f %%f in ('dir /a-d /b "%_LIB_DIR%\*scala3-interfaces*"') do set _SCALA3_INTF=%_LIB_DIR%\%%f -for /f %%f in ('dir /a-d /b "%_LIB_DIR%\*scala3-library*"') do set _SCALA3_LIB=%_LIB_DIR%\%%f -for /f %%f in ('dir /a-d /b "%_LIB_DIR%\*scala3-staging*"') do set _SCALA3_STAGING=%_LIB_DIR%\%%f -for /f %%f in ('dir /a-d /b "%_LIB_DIR%\*scala3-tasty-inspector*"') do set _SCALA3_TASTY_INSPECTOR=%_LIB_DIR%\%%f -for /f %%f in ('dir /a-d /b "%_LIB_DIR%\*tasty-core*"') do set _TASTY_CORE=%_LIB_DIR%\%%f -for /f %%f in ('dir /a-d /b "%_LIB_DIR%\*scala-asm*"') do set _SCALA_ASM=%_LIB_DIR%\%%f -for /f %%f in ('dir /a-d /b "%_LIB_DIR%\*scala-library*"') do set _SCALA_LIB=%_LIB_DIR%\%%f -for /f %%f in ('dir /a-d /b "%_LIB_DIR%\*compiler-interface*"') do set _SBT_INTF=%_LIB_DIR%\%%f -for /f %%f in ('dir /a-d /b "%_LIB_DIR%\*jline-reader-3*"') do set _JLINE_READER=%_LIB_DIR%\%%f -for /f %%f in ('dir /a-d /b "%_LIB_DIR%\*jline-terminal-3*"') do set _JLINE_TERMINAL=%_LIB_DIR%\%%f -for /f %%f in ('dir /a-d /b "%_LIB_DIR%\*jline-terminal-jna-3*"') do set _JLINE_TERMINAL_JNA=%_LIB_DIR%\%%f -for /f %%f in ('dir /a-d /b "%_LIB_DIR%\*jna-5*"') do set _JNA=%_LIB_DIR%\%%f - -@rem debug -set _DEBUG_STR=-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=5005 diff --git a/dist/bin/scala.bat b/dist/bin/scala.bat deleted file mode 100644 index ef59b85c036c..000000000000 --- a/dist/bin/scala.bat +++ /dev/null @@ -1,121 +0,0 @@ -@echo off -setlocal enabledelayedexpansion - -@rem ######################################################################### -@rem ## Environment setup - -set _EXITCODE=0 - -set "_PROG_HOME=%~dp0" - -call "%_PROG_HOME%\common.bat" -if not %_EXITCODE%==0 goto end - -call :args %* - -@rem ######################################################################### -@rem ## Main - -set _CASE_REPL=0 -if %_EXECUTE_REPL%==1 set _CASE_REPL=1 -if %_EXECUTE_RUN%==0 if %_OPTIONS_INDICATOR%==0 set _CASE_REPL=1 - -set _CASE_EXEC=0 -if %_EXECUTE_REPL%==1 set _CASE_EXEC=1 -if defined _RESIDUAL_ARGS set _CASE_EXEC=1 - -if %_EXECUTE_SCRIPT%==1 ( - set _SCALAC_ARGS= - if defined _CLASS_PATH set _SCALAC_ARGS=-classpath "%_CLASS_PATH%" - set _SCALAC_ARGS=!_SCALAC_ARGS! %_JAVA_OPTS% -script %_RESIDUAL_ARGS% - call "%_PROG_HOME%\scalac.bat" !_SCALAC_ARGS! -@rem if [ $execute_repl == true ] || ([ $execute_run == false ] && [ $options_indicator == 0 ]); then -) else if %_CASE_REPL%==1 ( - set _SCALAC_ARGS= - if defined _CLASS_PATH set _SCALAC_ARGS=-classpath "%_CLASS_PATH%" - set _SCALAC_ARGS=!_SCALAC_ARGS! %_JAVA_OPTS% -repl %_RESIDUAL_ARGS% - call "%_PROG_HOME%\scalac.bat" !_SCALAC_ARGS! -@rem elif [ $execute_repl == true ] || [ ${#residual_args[@]} -ne 0 ]; then -) else if %_CASE_EXEC%==1 ( - set "_CP_ARG=%_SCALA3_LIB%%_PSEP%%_SCALA_LIB%" - if defined _CLASS_PATH ( set "_CP_ARG=!_CP_ARG!%_PSEP%%_CLASS_PATH%" - ) else ( set "_CP_ARG=!_CP_ARG!%_PSEP%." - ) - if %_CLASS_PATH_COUNT% gtr 1 ( - echo Warning: Multiple classpaths are found, scala only use the last one. 1>&2 - ) - if %_WITH_COMPILER%==1 ( - set "_CP_ARG=!_CP_ARG!%_PSEP%%_SCALA3_COMP%%_PSEP%%_TASTY_CORE%%_PSEP%%_SCALA3_INTF%%_PSEP%%_SCALA_ASM%%_PSEP%%_SCALA3_STAGING%%_PSEP%%_SCALA3_TASTY_INSPECTOR%" - ) - set _JAVA_ARGS=%_JAVA_DEBUG% -classpath "!_CP_ARG!" %_JVM_OPTS% %_RESIDUAL_ARGS% - call "%_JAVACMD%" !_JAVA_ARGS! - if not !ERRORLEVEL!==0 ( set _EXITCODE=1& goto end ) -) else ( - echo Warning: Command option is not correct. 1>&2 -) - -goto end - -@rem ######################################################################### -@rem ## Subroutines - -:args -set _RESIDUAL_ARGS= -set _SCRIPT_ARGS= -set _EXECUTE_REPL=0 -set _EXECUTE_RUN=0 -set _EXECUTE_SCRIPT=0 -set _TARGET_SCRIPT= -set _WITH_COMPILER=0 -set _JAVA_DEBUG= -set _CLASS_PATH_COUNT=0 -set _CLASS_PATH= -set _JVM_OPTS= -set _JAVA_OPTS= -set _OPTIONS_INDICATOR=0 - -:args_loop -if "%~1"=="" goto args_done -set "__ARG=%~1" -if "%__ARG%"=="-repl" ( - set _EXECUTE_REPL=1 -) else if "%__ARG%"=="-run" ( - set _EXECUTE_RUN=1 -) else if "%__ARG%"=="-classpath" ( - set "_CLASS_PATH=%~2" - set /a _CLASS_PATH_COUNT+=1 - shift -) else if "%__ARG%"=="-cp" ( - set "_CLASS_PATH=%~2" - set /a _CLASS_PATH_COUNT+=1 - shift -) else if "%__ARG%"=="-with-compiler" ( - set _WITH_COMPILER=1 -) else if "%__ARG%"=="-d" ( - set "_JAVA_DEBUG=%_DEBUG_STR%" -) else if "%__ARG:~0,2%"=="-J" ( - set _JVM_OPTS=!_JVM_OPTS! %__ARG:~2% - set _JAVA_OPTS=!_JAVA_OPTS! %__ARG% -) else ( - @rem _OPTIONS_INDICATOR != 0 if at least one parameter is not an option - if not "%__ARG:~0,1%"=="-" set /a _OPTIONS_INDICATOR+=1 - if %_EXECUTE_SCRIPT%==1 ( - set _SCRIPT_ARGS=%_SCRIPT_ARGS% %__ARG% - ) else if "%__ARG:~-6%"==".scala" ( - set _EXECUTE_SCRIPT=1 - set "_TARGET_SCRIPT=%__ARG%" - ) else ( - set _RESIDUAL_ARGS=%_RESIDUAL_ARGS% %__ARG% - ) -) -shift -goto args_loop -:args_done -goto :eof - -@rem ######################################################################### -@rem ## Cleanups - -:end -exit /b %_EXITCODE% -endlocal diff --git a/dist/bin/scalac.bat b/dist/bin/scalac.bat deleted file mode 100644 index f68772d315b9..000000000000 --- a/dist/bin/scalac.bat +++ /dev/null @@ -1,174 +0,0 @@ -@echo off -setlocal enabledelayedexpansion - -@rem ######################################################################### -@rem ## Environment setup - -set _EXITCODE=0 - -set "_PROG_HOME=%~dp0" - -call "%_PROG_HOME%\common.bat" -if not %_EXITCODE%==0 goto end - -set _DEFAULT_JAVA_OPTS=-Xmx768m -Xms768m -@rem set _WITH_COMPILER=true - -set _COMPILER_MAIN=dotty.tools.dotc.Main -set _DECOMPILER_MAIN=dotty.tools.dotc.decompiler.Main -set _REPL_MAIN=dotty.tools.repl.Main -set _SCRIPTING_MAIN=dotty.tools.scripting.Main - -call :args %* - -@rem ######################################################################### -@rem ## Main - -call :classpathArgs - -set _SCRIPTING_STRING= -if "%_PROG_NAME%"=="%_SCRIPTING_MAIN%" ( - if not defined _TARGET_SCRIPT ( - echo Error: Missing Scala script file 1>&2 - set _EXITCODE=1 - goto end - ) - set _SCRIPTING_STRING=-script %_TARGET_SCRIPT% %_SCRIPTING_ARGS% -) - -if defined JAVA_OPTS ( set _JAVA_OPTS=%JAVA_OPTS% -) else ( set _JAVA_OPTS=%_DEFAULT_JAVA_OPTS% -) -call "%_JAVACMD%" %_JAVA_OPTS% %_JAVA_DEBUG% %_JAVA_ARGS% %_JVM_CP_ARGS% ^ --Dscala.usejavacp=true ^ -%_PROG_NAME% %_SCALA_ARGS% %_RESIDUAL_ARGS% %_SCRIPTING_STRING% -if not %ERRORLEVEL%==0 ( - set _EXITCODE=1 - goto end -) -goto end - -@rem ######################################################################### -@rem ## Subroutines - -:args -set _JAVA_DEBUG= -set _HELP= -set _VERBOSE= -set _QUIET= -set _COLORS= -set _PROG_NAME=%_COMPILER_MAIN% -set _IN_SCRIPTING_ARGS= -set _SCALA_ARGS= -set _JAVA_ARGS= -set _RESIDUAL_ARGS= -set _SCRIPTING_ARGS= - -:args_loop -if "%~1"=="" goto args_done -set "__ARG=%~1" -if "%__ARG%"=="--" ( - @rem for arg; do addResidual "$arg"; done; set -- ;; -) else if "%__ARG%"=="-h" ( - set _HELP=true - call :addScala "-help" -) else if "%__ARG%"=="-help" ( - set _HELP=true - call :addScala "-help" -) else if "%__ARG%"=="-v" ( - set _VERBOSE=true - call :addScala "-verbose" -) else if "%__ARG%"=="-verbose" ( - set _VERBOSE=true - call :addScala "-verbose" -) else if "%__ARG%"=="-debug" ( set "_JAVA_DEBUG=%_DEBUG_STR%" -) else if "%__ARG%"=="-q" ( set _QUIET=true -) else if "%__ARG%"=="-quiet" ( set _QUIET=true -@rem Optimize for short-running applications, see https://github.com/lampepfl/dotty/issues/222 -) else if "%__ARG%"=="-Oshort" ( - call :addJava "-XX:+TieredCompilation -XX:TieredStopAtLevel=1" -) else if "%__ARG%"=="-repl" ( set _PROG_NAME=%_REPL_MAIN% -) else if "%__ARG%"=="-script" ( - set _PROG_NAME=%_SCRIPTING_MAIN% - if "%~2"=="" goto args_done - set "_TARGET_SCRIPT=%~2" - set _IN_SCRIPTING_ARGS=true& shift -) else if "%__ARG%"=="-compile" ( set _PROG_NAME=%_COMPILER_MAIN% -) else if "%__ARG%"=="-decompile" ( set _PROG_NAME=%_DECOMPILER_MAIN% -) else if "%__ARG%"=="-print-tasty" ( - set _PROG_NAME=%_DECOMPILER_MAIN% - call :addScala "-print-tasty" -) else if "%__ARG%"=="-run" ( set _PROG_NAME=%_REPL_MAIN% -) else if "%__ARG%"=="-colors" ( set _COLORS=true -) else if "%__ARG%"=="-no-colors" ( set _COLORS= -) else if "%__ARG%"=="-with-compiler" ( set _JVM_CP_ARGS=%_PSEP%%_SCALA3_COMP%%_PSEP%%_TASTY_CORE% -@rem break out -D and -J options and add them to JAVA_OPTS as well -@rem so they reach the JVM in time to do some good. The -D options -@rem will be available as system properties. -) else if "%__ARG:~0,2%"=="-D" ( call :addJava "%__ARG%" -) else if "%__ARG:~0,2%"=="-J" ( call :addJava "%__ARG:~2%" -) else ( - if defined _IN_SCRIPTING_ARGS ( call :addScripting "%__ARG%" - ) else ( call :addResidual "%__ARG%" - ) -) -shift -goto args_loop -:args_done -goto :eof - -@rem output parameter: _SCALA_ARGS -:addScala -set _SCALA_ARGS=%_SCALA_ARGS% %~1 -goto :eof - -@rem output parameter: _JAVA_ARGS -:addJava -set _JAVA_ARGS=%_JAVA_ARGS% %~1 -goto :eof - -@rem output parameter: _RESIDUAL_ARGS -:addResidual -set _RESIDUAL_ARGS=%_RESIDUAL_ARGS% %~1 -goto :eof - -@rem output parameter: _SCRIPTING_ARGS -:addScripting -set _SCRIPTING_ARGS=%_SCRIPTING_ARGS% %~1 -goto :eof - -@rem output parameter: _JVM_CP_ARGS -:classpathArgs -@rem echo scala3-compiler: %_SCALA3_COMP% -@rem echo scala3-interface: %_SCALA3_INTF% -@rem echo scala3-library: %_SCALA3_LIB% -@rem echo tasty-core: %_TASTY_CORE% -@rem echo scala-asm: %_SCALA_ASM% -@rem echo scala-lib: %_SCALA_LIB% -@rem echo sbt-intface: %_SBT_INTF% - -set __TOOLCHAIN=%_SCALA_LIB%%_PSEP% -set __TOOLCHAIN=%__TOOLCHAIN%%_SCALA3_LIB%%_PSEP% -set __TOOLCHAIN=%__TOOLCHAIN%%_SCALA_ASM%%_PSEP% -set __TOOLCHAIN=%__TOOLCHAIN%%_SBT_INTF%%_PSEP% -set __TOOLCHAIN=%__TOOLCHAIN%%_SCALA3_INTF%%_PSEP% -set __TOOLCHAIN=%__TOOLCHAIN%%_SCALA3_COMP%%_PSEP% -set __TOOLCHAIN=%__TOOLCHAIN%%_TASTY_CORE%%_PSEP% -set __TOOLCHAIN=%__TOOLCHAIN%%_SCALA3_STAGING%%_PSEP% -set __TOOLCHAIN=%__TOOLCHAIN%%_SCALA3_TASTY_INSPECTOR%%_PSEP% - -@rem # jline -set __TOOLCHAIN=%__TOOLCHAIN%%_JLINE_READER%%_PSEP% -set __TOOLCHAIN=%__TOOLCHAIN%%_JLINE_TERMINAL%%_PSEP% -set __TOOLCHAIN=%__TOOLCHAIN%%_JLINE_TERMINAL_JNA%%_PSEP% -set __TOOLCHAIN=%__TOOLCHAIN%%_JNA% - -set _JVM_CP_ARGS=-classpath "%__TOOLCHAIN%" -goto :eof - -@rem ######################################################################### -@rem ## Cleanups - -:end -exit /b %_EXITCODE% -endlocal diff --git a/dist/bin/scaladoc.bat b/dist/bin/scaladoc.bat deleted file mode 100644 index f90b5b8b03fd..000000000000 --- a/dist/bin/scaladoc.bat +++ /dev/null @@ -1,190 +0,0 @@ -@echo off -setlocal enabledelayedexpansion - -@rem ######################################################################### -@rem ## Environment setup - -set _EXITCODE=0 - -set "_PROG_HOME=%~dp0" - -call "%_PROG_HOME%\common.bat" -if not %_EXITCODE%==0 goto end - -set _DEFAULT_JAVA_OPTS=-Xmx768m -Xms768m - -@rem set _COMPILER_MAIN=dotty.tools.dotc.Main -@rem set _DECOMPILER_MAIN=dotty.tools.dotc.decompiler.Main -set _DOC_MAIN=dotty.tools.scaladoc.Main -@rem set _REPL_MAIN=dotty.tools.repl.Main -@rem set _SCRIPTING_MAIN=dotty.tools.scripting.Main - -set _PROG_NAME=%_DOC_MAIN% - -call :args %* - -@rem ######################################################################### -@rem ## Main - -call :classpathArgs - -if defined JAVA_OPTS ( set _JAVA_OPTS=%JAVA_OPTS% -) else ( set _JAVA_OPTS=%_DEFAULT_JAVA_OPTS% -) -call "%_JAVACMD%" %_JAVA_OPTS% %_JAVA_DEBUG% %_JAVA_ARGS% ^ --classpath "%_CLASS_PATH%" ^ --Dscala.usejavacp=true ^ -%_PROG_NAME% %_SCALA_ARGS% %_RESIDUAL_ARGS% -if not %ERRORLEVEL%==0 ( - @rem echo Error: Scaladoc execution failed 1>&2 - set _EXITCODE=1 - goto end -) -goto end - -@rem ######################################################################### -@rem ## Subroutines - -:args -set _JAVA_DEBUG= -set _HELP= -set _VERBOSE= -set _QUIET= -set _COLORS= -set _SCALA_ARGS= -set _JAVA_ARGS= -set _RESIDUAL_ARGS= - -:args_loop -if "%~1"=="" goto args_done -set "__ARG=%~1" -if "%__ARG%"=="--" ( - @rem for arg; do addResidual "$arg"; done; set -- ;; -) else if "%__ARG%"=="-h" ( - set _HELP=true - call :addScala "-help" -) else if "%__ARG%"=="-help" ( - set _HELP=true - call :addScala "-help" -) else if "%__ARG%"=="-v" ( - set _VERBOSE=true - call :addScala "-verbose" -) else if "%__ARG%"=="-verbose" ( - set _VERBOSE=true - call :addScala "-verbose" -) else if "%__ARG%"=="-debug" ( set "_JAVA_DEBUG=%_DEBUG_STR%" -) else if "%__ARG%"=="-q" ( set _QUIET=true -) else if "%__ARG%"=="-quiet" ( set _QUIET=true -) else if "%__ARG%"=="-colors" ( set _COLORS=true -) else if "%__ARG%"=="-no-colors" ( set _COLORS= -) else if "%__ARG:~0,2%"=="-D" ( call :addJava "%__ARG%" -) else if "%__ARG:~0,2%"=="-J" ( call :addJava "%__ARG:~2%" -) else ( - if defined _IN_SCRIPTING_ARGS ( call :addScripting "%__ARG%" - ) else ( call :addResidual "%__ARG%" - ) -) -shift -goto args_loop -:args_done -goto :eof - -@rem output parameter: _SCALA_ARGS -:addScala -set _SCALA_ARGS=%_SCALA_ARGS% %~1 -goto :eof - -@rem output parameter: _JAVA_ARGS -:addJava -set _JAVA_ARGS=%_JAVA_ARGS% %~1 -goto :eof - -@rem output parameter: _RESIDUAL_ARGS -:addResidual -set _RESIDUAL_ARGS=%_RESIDUAL_ARGS% %~1 -goto :eof - -@rem output parameter: _CLASS_PATH -:classpathArgs -for /f %%f in ("%_PROG_HOME%\.") do set "__LIB_DIR=%%~dpflib" - -@rem Set scaladoc dep: -for /f %%f in ('dir /a-d /b "%__LIB_DIR%\*scaladoc*"') do set _SCALA3_DOC=%__LIB_DIR%\%%f - -@rem Set flexmark deps: -for /f %%f in ('dir /a-d /b "%__LIB_DIR%\*flexmark-0*"') do set _FLEXMARK_LIBS=%__LIB_DIR%\%%f%_PSEP% -for /f %%f in ('dir /a-d /b "%__LIB_DIR%\*flexmark-ext-anchorlink*"') do set _FLEXMARK_LIBS=%_FLEXMARK_LIBS%%__LIB_DIR%\%%f%_PSEP% -for /f %%f in ('dir /a-d /b "%__LIB_DIR%\*flexmark-ext-autolink*"') do set _FLEXMARK_LIBS=%_FLEXMARK_LIBS%%__LIB_DIR%\%%f%_PSEP% -for /f %%f in ('dir /a-d /b "%__LIB_DIR%\*flexmark-ext-emoji*"') do set _FLEXMARK_LIBS=%_FLEXMARK_LIBS%%__LIB_DIR%\%%f%_PSEP% -for /f %%f in ('dir /a-d /b "%__LIB_DIR%\*flexmark-ext-gfm-strikethrough*"') do set _FLEXMARK_LIBS=%_FLEXMARK_LIBS%%__LIB_DIR%\%%f%_PSEP% -for /f %%f in ('dir /a-d /b "%__LIB_DIR%\*flexmark-ext-gfm-tables*"') do set _FLEXMARK_LIBS=%_FLEXMARK_LIBS%%__LIB_DIR%\%%f%_PSEP% -for /f %%f in ('dir /a-d /b "%__LIB_DIR%\*flexmark-ext-gfm-tasklist*"') do set _FLEXMARK_LIBS=%_FLEXMARK_LIBS%%__LIB_DIR%\%%f%_PSEP% -for /f %%f in ('dir /a-d /b "%__LIB_DIR%\*flexmark-ext-ins*"') do set _FLEXMARK_LIBS=%_FLEXMARK_LIBS%%__LIB_DIR%\%%f%_PSEP% -for /f %%f in ('dir /a-d /b "%__LIB_DIR%\*flexmark-ext-superscript*"') do set _FLEXMARK_LIBS=%_FLEXMARK_LIBS%%__LIB_DIR%\%%f%_PSEP% -for /f %%f in ('dir /a-d /b "%__LIB_DIR%\*flexmark-ext-tables*"') do set _FLEXMARK_LIBS=%_FLEXMARK_LIBS%%__LIB_DIR%\%%f%_PSEP% -for /f %%f in ('dir /a-d /b "%__LIB_DIR%\*flexmark-ext-wikilink*"') do set _FLEXMARK_LIBS=%_FLEXMARK_LIBS%%__LIB_DIR%\%%f%_PSEP% -for /f %%f in ('dir /a-d /b "%__LIB_DIR%\*flexmark-ext-yaml-front-matter*"') do set _FLEXMARK_LIBS=%_FLEXMARK_LIBS%%__LIB_DIR%\%%f%_PSEP% -for /f %%f in ('dir /a-d /b "%__LIB_DIR%\*flexmark-formatter*"') do set _FLEXMARK_LIBS=%_FLEXMARK_LIBS%%__LIB_DIR%\%%f%_PSEP% -for /f %%f in ('dir /a-d /b "%__LIB_DIR%\*flexmark-html-parser*"') do set _FLEXMARK_LIBS=%_FLEXMARK_LIBS%%__LIB_DIR%\%%f%_PSEP% -for /f %%f in ('dir /a-d /b "%__LIB_DIR%\*flexmark-jira-converter*"') do set _FLEXMARK_LIBS=%_FLEXMARK_LIBS%%__LIB_DIR%\%%f%_PSEP% -for /f %%f in ('dir /a-d /b "%__LIB_DIR%\*flexmark-util*"') do set _FLEXMARK_LIBS=%_FLEXMARK_LIBS%%__LIB_DIR%\%%f%_PSEP% - -@rem Set jackson deps: -for /f %%f in ('dir /a-d /b "%__LIB_DIR%\*jackson-annotations*"') do set _JACKSON_LIBS=%__LIB_DIR%\%%f%_PSEP% -for /f %%f in ('dir /a-d /b "%__LIB_DIR%\*jackson-core*"') do set _JACKSON_LIBS=%_JACKSON_LIBS%%__LIB_DIR%\%%f%_PSEP% -for /f %%f in ('dir /a-d /b "%__LIB_DIR%\*jackson-databind*"') do set _JACKSON_LIBS=%_JACKSON_LIBS%%__LIB_DIR%\%%f%_PSEP% -for /f %%f in ('dir /a-d /b "%__LIB_DIR%\*jackson-dataformat-yaml*"') do set _JACKSON_LIBS=%_JACKSON_LIBS%%__LIB_DIR%\%%f%_PSEP% - -@rem Set liqp dep: -for /f %%f in ('dir /a-d /b "%__LIB_DIR%\*liqp*"') do set _LIQP_LIB=%__LIB_DIR%\%%f%_PSEP% - -@rem Set ANTLR dep: -for /f %%f in ('dir /a-d /b "%__LIB_DIR%\*antlr-3*"') do set _ANTLR_LIB=%__LIB_DIR%\%%f%_PSEP% -for /f %%f in ('dir /a-d /b "%__LIB_DIR%\*antlr-runtime-3*"') do set _ANTLR_RUNTIME_LIB=%__LIB_DIR%\%%f%_PSEP% - -@rem Set autolink dep: -@rem conflict with flexmark-ext-autolink-0.11 -for /f %%f in ('dir /a-d /b "%__LIB_DIR%\*autolink-0.6*"') do set _AUTOLINK_LIB=%__LIB_DIR%\%%f%_PSEP% - -@rem Set Protobuf dep: -for /f %%f in ('dir /a-d /b "%__LIB_DIR%\*protobuf-java*"') do set _PROTOBUF_LIB=%__LIB_DIR%\%%f%_PSEP% - -@rem Set snakeyaml dep: -for /f %%f in ('dir /a-d /b "%__LIB_DIR%\*snakeyaml*"') do set _SNAKEYAML_LIB=%__LIB_DIR%\%%f%_PSEP% - -@rem Set ST4 dep: -for /f %%f in ('dir /a-d /b "%__LIB_DIR%\*ST4*"') do set _ST4_LIB=%__LIB_DIR%\%%f%_PSEP% - -@rem Set jsoup dep: -for /f %%f in ('dir /a-d /b "%__LIB_DIR%\*jsoup*"') do set _JSOUP_LIB=%__LIB_DIR%\%%f%_PSEP% - -set _CLASS_PATH=%_SCALA3_DOC% -set _CLASS_PATH=%_CLASS_PATH%%_PSEP%%_SCALA3_LIB% -set _CLASS_PATH=%_CLASS_PATH%%_PSEP%%_SCALA3_COMP% -set _CLASS_PATH=%_CLASS_PATH%%_PSEP%%_TASTY_CORE% -set _CLASS_PATH=%_CLASS_PATH%%_PSEP%%_SCALA3_INTF% -set _CLASS_PATH=%_CLASS_PATH%%_PSEP%%_SBT_INTF% -set _CLASS_PATH=%_CLASS_PATH%%_PSEP%%_SCALA3_STAGING% -set _CLASS_PATH=%_CLASS_PATH%%_PSEP%%_SCALA3_TASTY_INSPECTOR% -@rem set _CLASS_PATH=%_CLASS_PATH%%_PSEP%%_SCALA_ASM% -set _CLASS_PATH=%_CLASS_PATH%%_PSEP%%_SCALA_LIB% -set _CLASS_PATH=%_CLASS_PATH%%_PSEP%%_FLEXMARK_LIBS% -set _CLASS_PATH=%_CLASS_PATH%%_PSEP%%_JACKSON_LIBS% -@rem set _CLASS_PATH=%_CLASS_PATH%%_PSEP%%_JLINE_READER% -@rem set _CLASS_PATH=%_CLASS_PATH%%_PSEP%%_JLINE_TERMINAL% -@rem set _CLASS_PATH=%_CLASS_PATH%%_PSEP%%_JLINE_TERMINAL_JNA% -set _CLASS_PATH=%_CLASS_PATH%%_PSEP%%_LIQP_LIB% -set _CLASS_PATH=%_CLASS_PATH%%_PSEP%%_ANTLR_LIB%%_PSEP%%_ANTLR_RUNTIME_LIB% -set _CLASS_PATH=%_CLASS_PATH%%_PSEP%%_AUTOLINK_LIB% -set _CLASS_PATH=%_CLASS_PATH%%_PSEP%%_PROTOBUF_LIB% -set _CLASS_PATH=%_CLASS_PATH%%_PSEP%%_SNAKEYAML_LIB% -set _CLASS_PATH=%_CLASS_PATH%%_PSEP%%_ST4_LIB% -set _CLASS_PATH=%_CLASS_PATH%%_PSEP%%_JSOUP_LIB% -goto :eof - -@rem ######################################################################### -@rem ## Cleanups - -:end -exit /b %_EXITCODE% -endlocal