mardi 26 mai 2020

How to load a class from the source code using reflection inside SBT task?

I'm using SBT to build my project. I want to analyze some classes from my source code using either Scala or Java reflection during the build process.

How do I define an SBT task that loads a single known class or all classes from my source code?

import sbt._

val loadedClasses = taskKey[Seq[Class[_]]]("All classes from the source")

val classToLoad = settingKey[String]("Scala class name to load")
val loadedClass = taskKey[Seq[Class[_]]]("Loaded classToLoad")




Aucun commentaire:

Enregistrer un commentaire