Successfully made an unnecessary subproject work

This commit is contained in:
Norbi Peti 2021-04-05 18:57:40 +02:00
parent 5146fdf368
commit 470212411d
No known key found for this signature in database
GPG key ID: DBA4C4549A927E56
55 changed files with 42 additions and 40 deletions

8
commenter/.idea/.gitignore vendored Normal file
View file

@ -0,0 +1,8 @@
# Default ignored files
/shelf/
/workspace.xml
# Datasource local storage ignored files
/dataSources/
/dataSources.local.xml
# Editor-based HTTP Client requests
/httpRequests/

10
commenter/build.sbt Normal file
View file

@ -0,0 +1,10 @@
name := "Chroma-Commenter"
version := "1.0"
organization := "com.github.TBMCPlugins"
scalaVersion := "2.13.4"
resolvers += Resolver.mavenLocal
libraryDependencies += "org.reflections" % "reflections" % "0.9.12"
libraryDependencies += "com.github.TBMCPlugins.ChromaCore" % "ButtonProcessor" % "master-SNAPSHOT"
libraryDependencies += "com.github.TBMCPlugins.ChromaCore" % "Chroma-Core" % "v1.0.0"

View file

@ -0,0 +1,18 @@
import buttondevteam.buttonproc.HasConfig
import buttondevteam.lib.architecture.ConfigData
import org.reflections.Reflections
import scala.jdk.javaapi.CollectionConverters.asScala
object Commenter extends App {
val ref = new Reflections("buttondevteam.discordplugin")
val types = asScala(ref.getTypesAnnotatedWith(classOf[HasConfig], true))
for (ty <- types) {
val path = if (ty.getAnnotation(classOf[HasConfig]).global()) "global"
else s"components.${ty.getSimpleName}"
val cdcl = classOf[ConfigData[_]]
ty.getDeclaredMethods.filter(m => cdcl.isAssignableFrom(m.getReturnType))
.concat(ty.getDeclaredFields.filter(f => cdcl.isAssignableFrom(f.getType)))
.map(path + "." + _.getName)
}
}

View file

@ -1,10 +1,2 @@
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"
))
lazy val commenter = RootProject(file("../commenter"))
lazy val root = (project in file(".")).dependsOn(commenter)

View file

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

View file

@ -1,18 +1 @@
addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.15.0")
/*lazy val commenter = project.settings(Seq(
name := "Chroma-Commenter",
version := "1.0",
organization := "com.github.TBMCPlugins"
))
lazy val root = (project in file(".")).dependsOn(commenter)*/
//addSbtPlugin("com.github.TBMCPlugins" % "Chroma-Commenter" % "1.0")
/*val Teszt = config("teszt").extend(Compile)
val teszt = TaskKey[Unit]("teszt")
teszt := target map { target => //teszt := { x.value }
println("Teszt: " + target)
}*/

View file

@ -3,10 +3,10 @@ package buttondevteam.discordplugin
import buttondevteam.discordplugin.mcchat.MinecraftChatModule
import buttondevteam.discordplugin.util.DPState
import org.apache.logging.log4j.Level
import org.apache.logging.log4j.core.{Filter, LogEvent}
import org.apache.logging.log4j.core.appender.AbstractAppender
import org.apache.logging.log4j.core.filter.LevelRangeFilter
import org.apache.logging.log4j.core.layout.PatternLayout
import org.apache.logging.log4j.core.{Filter, LogEvent}
class BukkitLogWatcher private[discordplugin]() extends AbstractAppender("ChromaDiscord",
LevelRangeFilter.createFilter(Level.INFO, Level.INFO, Filter.Result.ACCEPT, Filter.Result.DENY),

View file

@ -70,7 +70,8 @@ import java.util.Optional
if (id.asInstanceOf[Long] == 0L) Option.empty
else SMono.fromPublisher(DiscordPlugin.dc.getGuildById(Snowflake.of(id.asInstanceOf[Long])))
.onErrorResume((t: Throwable) => {
getLogger.warning("Failed to get guild: " + t.getMessage); SMono.empty
getLogger.warning("Failed to get guild: " + t.getMessage);
SMono.empty
}).blockOption()
}

View file

@ -1,7 +1,7 @@
package buttondevteam.discordplugin.playerfaker
import buttondevteam.discordplugin.{DiscordSenderBase, IMCPlayer}
import buttondevteam.discordplugin.mcchat.MinecraftChatModule
import buttondevteam.discordplugin.{DiscordSenderBase, IMCPlayer}
import buttondevteam.lib.TBMCCoreAPI
import org.bukkit.Bukkit
import org.bukkit.entity.Player