Open yamin-oanda opened 5 months ago
On https://twitter.github.io/scrooge/CommandLine.html#scrooge-generator
It is instructed:
--language-flag Pass arguments to supported language generators. To generate Scala 2.13 compatible scala.Seq alias as scala.collection.immutable.Seq, please use "immutable-sequences".
scala.Seq
scala.collection.immutable.Seq
However it is not clear how exactly to pass in this command-line argument. According to https://twitter.github.io/scrooge/SBTPlugin.html#scrooge-sbt-configuration-options
scroogeBuildOptions: Seq[String] list of command-line arguments to pass to scrooge (default: Seq(“WithFinagle”))
scroogeBuildOptions: Seq[String]
list of command-line arguments to pass to scrooge (default: Seq(“WithFinagle”))
However this documentation seems incorrect and it seems to have been a Seq[ServiceOption] for a long time now: https://github.com/twitter/scrooge/commit/5979724d4ac92f6b895847e0ebc7a5a67475fa85?diff=unified&w=0#diff-83e8daaecab09dbc766048e5ea463929ef92658795f3d8669bacea67d85c2417L20
Seq[ServiceOption]
And ServiceOption is locked down so we can't pass in arbitrary strings like --language-flag immutable-sequences: https://github.com/twitter/scrooge/blob/c99132bcf2d1de1e5613cd25e00644f0d3086a28/scrooge-generator/src/main/scala/com/twitter/scrooge/backend/Generator.scala#L37
ServiceOption
--language-flag immutable-sequences
abstract sealed class ServiceOption case object WithFinagle extends ServiceOption case object WithJavaPassThrough extends ServiceOption case object WithAsClosable extends ServiceOption { val AsClosableMethodName: String = "asClosable" }
Is there any configuration exposed through sbt that would allow us to pass in the flag?
This is really annoying. Any accepted work arounds?
I haven't found any automated workaround. Just been adding .toSeq wherever the compiler complains about a type mismatch.
.toSeq
On https://twitter.github.io/scrooge/CommandLine.html#scrooge-generator
It is instructed:
However it is not clear how exactly to pass in this command-line argument. According to https://twitter.github.io/scrooge/SBTPlugin.html#scrooge-sbt-configuration-options
However this documentation seems incorrect and it seems to have been a
Seq[ServiceOption]
for a long time now: https://github.com/twitter/scrooge/commit/5979724d4ac92f6b895847e0ebc7a5a67475fa85?diff=unified&w=0#diff-83e8daaecab09dbc766048e5ea463929ef92658795f3d8669bacea67d85c2417L20And
ServiceOption
is locked down so we can't pass in arbitrary strings like--language-flag immutable-sequences
: https://github.com/twitter/scrooge/blob/c99132bcf2d1de1e5613cd25e00644f0d3086a28/scrooge-generator/src/main/scala/com/twitter/scrooge/backend/Generator.scala#L37Is there any configuration exposed through sbt that would allow us to pass in the flag?