Code generation with Scala

前端 未结 3 1285
时光取名叫无心
时光取名叫无心 2021-02-13 16:44

When using the SBT toolchain in Scala, is it possible to write a task that will read a special part of the project\'s source to generate scala-code at compile time.

Any

3条回答
  •  攒了一身酷
    2021-02-13 16:54

    I did a bit of research recently. Pretty much there are 3 options available:

    1. String templates.
    2. treehugger
    3. Scala Macros

    More details here: http://yefremov.net/blog/scala-code-generation/

提交回复
热议问题