Add Reflections

This commit is contained in:
Norbi Peti 2021-04-05 03:47:56 +02:00
parent 860dd66431
commit 5146fdf368
No known key found for this signature in database
GPG key ID: DBA4C4549A927E56
4 changed files with 21 additions and 11 deletions

View file

@ -42,21 +42,14 @@ assemblyMergeStrategy in assembly := {
case x => (assemblyMergeStrategy in assembly).value(x)
}
lazy val commenter = project.settings(Seq(
name := "Chroma-Commenter",
version := "1.0",
organization := "com.github.TBMCPlugins"
))
val teszt = TaskKey[Unit]("teszt")
teszt := {
//val tv = target.value
val sv = (Compile / sources).value
for (file <- sv) {
Using(Source.fromFile(file)) { src =>
for (line <- src.getLines) {
if (line.contains("class"))
println(line)
println(line + "")
}
}.recover[Unit]({ case t => t.printStackTrace() })
}

View file

@ -1,3 +0,0 @@
class Commenter {
}

10
project/build.sbt Normal file
View file

@ -0,0 +1,10 @@
lazy val commenter = project.settings(Seq(
name := "Chroma-Commenter",
version := "1.0",
organization := "com.github.TBMCPlugins",
resolvers += Resolver.mavenLocal,
libraryDependencies += "org.reflections" % "reflections" % "0.9.12",
libraryDependencies += "com.github.TBMCPlugins.ChromaCore" % "ButtonProcessor" % "master-SNAPSHOT"
))

View file

@ -0,0 +1,10 @@
object Commenter extends App {
val ref = new Reflections("buttondevteam.discordplugin")
val types: Set[Class[_]] = ref.getTypesAnnotatedWith(HasConfig, true).asScala
for (ty <- types) {
ty
.
}
}