ScalafmtAll to sbt files

This commit is contained in:
Eike Kettner 2020-06-23 00:28:04 +02:00
parent 3018fbc0b6
commit 9db3c70e3f
2 changed files with 103 additions and 88 deletions

View File

@ -38,7 +38,6 @@ object Dependencies {
val JQueryVersion = "3.5.1"
val ViewerJSVersion = "0.5.8"
val calevCore = Seq(
"com.github.eikek" %% "calev-core" % CalevVersion
)
@ -59,10 +58,12 @@ object Dependencies {
val poi = Seq(
"org.apache.poi" % "poi" % PoiVersion,
"org.apache.poi" % "poi-ooxml" % PoiVersion,
"org.apache.poi" % "poi-scratchpad" % PoiVersion,
).map(_.excludeAll(
"org.apache.poi" % "poi-scratchpad" % PoiVersion
).map(
_.excludeAll(
ExclusionRule("commons-logging")
)) ++ jclOverSlf4j
)
) ++ jclOverSlf4j
// https://github.com/vsch/flexmark-java
// BSD 2-Clause
@ -70,10 +71,12 @@ object Dependencies {
"com.vladsch.flexmark" % "flexmark" % FlexmarkVersion,
"com.vladsch.flexmark" % "flexmark-ext-tables" % FlexmarkVersion,
"com.vladsch.flexmark" % "flexmark-ext-gfm-strikethrough" % FlexmarkVersion
).map(_.excludeAll(
).map(
_.excludeAll(
ExclusionRule("junit"),
ExclusionRule("hamcrest-core")
))
)
)
val twelvemonkeys = Seq(
"com.twelvemonkeys.imageio" % "imageio-jpeg" % TwelveMonkeysVersion,
@ -81,30 +84,30 @@ object Dependencies {
)
val pdfbox = Seq(
"org.apache.pdfbox" % "pdfbox" % PdfboxVersion excludeAll (
("org.apache.pdfbox" % "pdfbox" % PdfboxVersion).excludeAll(
ExclusionRule("org.bouncycastle"),
ExclusionRule("commons-logging")
)
) ++ jclOverSlf4j
val emilCommon = Seq(
"com.github.eikek" %% "emil-common" % EmilVersion,
"com.github.eikek" %% "emil-common" % EmilVersion
)
val emil = Seq(
"com.github.eikek" %% "emil-common" % EmilVersion,
"com.github.eikek" %% "emil-javamail" % EmilVersion
)
val emilDoobie = Seq(
"com.github.eikek" %% "emil-doobie" % EmilVersion,
"com.github.eikek" %% "emil-doobie" % EmilVersion
)
val emilTnef = Seq(
"com.github.eikek" %% "emil-tnef" % EmilVersion,
"com.github.eikek" %% "emil-tnef" % EmilVersion
)
val emilMarkdown = Seq(
"com.github.eikek" %% "emil-markdown" % EmilVersion,
"com.github.eikek" %% "emil-markdown" % EmilVersion
)
val emilJsoup = Seq(
"com.github.eikek" %% "emil-jsoup" % EmilVersion,
"com.github.eikek" %% "emil-jsoup" % EmilVersion
)
val jsoup = Seq(
@ -112,7 +115,7 @@ object Dependencies {
)
val stanfordNlpCore = Seq(
"edu.stanford.nlp" % "stanford-corenlp" % StanfordNlpVersion excludeAll(
("edu.stanford.nlp" % "stanford-corenlp" % StanfordNlpVersion).excludeAll(
ExclusionRule("com.io7m.xom", "xom"),
ExclusionRule("javax.servlet", "javax.servlet-api"),
ExclusionRule("org.apache.lucene", "lucene-queryparser"),
@ -130,8 +133,11 @@ object Dependencies {
)
val stanfordNlpModels = Seq(
"edu.stanford.nlp" % "stanford-corenlp" % StanfordNlpVersion classifier "models-german",
"edu.stanford.nlp" % "stanford-corenlp" % StanfordNlpVersion classifier "models-english"
("edu.stanford.nlp" % "stanford-corenlp" % StanfordNlpVersion)
.classifier("models-german"),
("edu.stanford.nlp" % "stanford-corenlp" % StanfordNlpVersion).classifier(
"models-english"
)
)
val tika = Seq(
@ -156,7 +162,7 @@ object Dependencies {
val http4s = Seq(
"org.http4s" %% "http4s-blaze-server" % Http4sVersion,
"org.http4s" %% "http4s-circe" % Http4sVersion,
"org.http4s" %% "http4s-dsl" % Http4sVersion,
"org.http4s" %% "http4s-dsl" % Http4sVersion
)
val http4sClient = Seq(

View File

@ -27,21 +27,25 @@ object NerModelsPlugin extends AutoPlugin {
import autoImport._
def nerModelSettings: Seq[Setting[_]] = Seq(
def nerModelSettings: Seq[Setting[_]] =
Seq(
nerModelsFilter := (_ => false),
nerModelsRunFilter := {
filterArtifacts(streams.value.log
, Classpaths.managedJars(NerModels, Set("jar", "zip"), update.value)
, nerModelsFilter.value
, (Compile/resourceManaged).value)
filterArtifacts(
streams.value.log,
Classpaths.managedJars(NerModels, Set("jar", "zip"), update.value),
nerModelsFilter.value,
(Compile / resourceManaged).value
)
},
Compile / resourceGenerators += nerModelsRunFilter.taskValue
)
def nerClassifierSettings: Seq[Setting[_]] = Seq(
def nerClassifierSettings: Seq[Setting[_]] =
Seq(
libraryDependencies ++= Dependencies.stanfordNlpModels.map(_ % NerModels),
nerModelsFilter := {
name => nerModels.exists(name.endsWith)
nerModelsFilter := { name =>
nerModels.exists(name.endsWith)
}
)
@ -51,11 +55,16 @@ object NerModelsPlugin extends AutoPlugin {
override def projectSettings: Seq[Setting[_]] =
nerModelSettings
def filterArtifacts(logger: Logger, cp: Classpath, nameFilter: NameFilter, out: File): Seq[File] = {
def filterArtifacts(
logger: Logger,
cp: Classpath,
nameFilter: NameFilter,
out: File
): Seq[File] = {
logger.info(s"NerModels: Filtering artifacts...")
cp.files.flatMap(f => {
cp.files.flatMap { f =>
IO.unzip(f, out, nameFilter)
})
}
}
private val nerModels = List(