[proposal] ScalacOption class based on types
I started sketching out some ideas according to our conversations with @armanbilge and @DavidGregory084. See also #2.
Basically, it is very similar to how org.http4s.Header works:
case class Deprecation(value: Boolean)
object Deprecation {
implicit val deprecationScalacOption: ScalacOption.Aux[Deprecation, ScalacOption.Single] = new ScalacOption {
type Type = ScalacOption.Single
def baseName = "deprecation"
// and so on
}
}
Then in build.sbt:
val deprecation: Option[Deprecation] =
ScalacOptions.parse(scalacOptions.value) // `parse` is not implemented yet
.get[Deprecation]
Still requires a lot of work and refinements. And tests of course :)
Note: I put all the new classes into a proposal sub-package just to do not interfere with the existing code.
Ok.. But it won't work for options like -encoding utf-8 because of a parameter passed separately 😊
I need to think harder :)
@satorg so where did we leave this one? 😅 FTR no pressure or anything, just trying to figure if/how things are blocked. We do have to do sbt-tl 0.5.x sometime, but believe me I am in no rush 😬
Yeah, personally I would really love to continue on this... Just got distracted a little bit with some other less pleasant but more urgent stuff, unfortunately. Hopefully, I will sort it out soon and be able to return to more pleasant things like this one :)
I know the feeling :) thanks for the update and hope you have a nice holiday!
more pleasant things like this one :)
Ha, that's fantastic. I am not nearly so thrilled about scalac options 😂 so I'm glad we found the right person for the job 😉