sbt-tpolecat
sbt-tpolecat copied to clipboard
Provide a test to replicate issue #102
This is a test to replicate #102 thanks to @keynmol's great example on the ticket
Hmm FWIW @keynmol I actually get the same result here even if sbt-tpolecat
is removed from plugins.sbt
- -scalajs
is not present in the scalacOptions
. Am I missing something?
sbt:scalajs> show Compile/scalacOptions
[info] * -Xplugin:/Users/davidgregory/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-js/scalajs-compiler_2.13.8/1.10.1/scalajs-compiler_2.13.8-1.10.1.jar
[success] Total time: 0 s, completed 28 Jul 2022, 14:36:56
sbt:scalajs> show Test/scalacOptions
[info] * -Xplugin:/Users/davidgregory/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-js/scalajs-compiler_2.13.8/1.10.1/scalajs-compiler_2.13.8-1.10.1.jar
[success] Total time: 0 s, completed 28 Jul 2022, 14:37:14
sbt:scalajs> show Runtime/scalacOptions
[info] * -Xplugin:/Users/davidgregory/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-js/scalajs-compiler_2.13.8/1.10.1/scalajs-compiler_2.13.8-1.10.1.jar
[success] Total time: 0 s, completed 28 Jul 2022, 14:37:19
sbt:scalajs> show scalacOptions
[info] *
[success] Total time: 0 s, completed 28 Jul 2022, 14:37:32
sbt:scalajs>
I've realised now that this -scalajs
option is for Scala 3.x only
The latest commit attempts to resolve the problem by dropping derived settings and switching to configuration filters.
The immediate problem with this was that manipulating unscoped settings no longer worked, e.g. the following manipulation no longer contributed to Compile/tpolecatReleaseModeOptions
:
tpolecatReleaseModeOptions ++= {
ScalacOptions.optimizerOptions("**") +
ScalacOptions.release("8") +
ScalacOptions.privateBackendParallelism(8)
}
This prompted me to try appending to tpolecatReleaseModeOptions
in the sbtTpolecatSettings
, which unfortunately breaks the ordering of options that we got from using ListSet
within the plugin:
tpolecatDevModeOptions ++= ScalacOptions.default,
tpolecatCiModeOptions ++= tpolecatDevModeOptions.value + ScalacOptions.fatalWarnings,
tpolecatReleaseModeOptions ++= tpolecatCiModeOptions.value + ScalacOptions.optimizerMethodLocal,
I'm afraid it did not resolve the problem in any case as we still see settings duplication in the modePerConfiguration
test in Test/scalacOptions
regardless of whether ++=
is used in the tpolecat*Options
.
No longer needed due to #126