Fix sbt warnings and add more aliases

This commit is contained in:
Eike Kettner 2021-04-10 17:16:01 +02:00
parent 5974031ac9
commit 9c427c3d38
3 changed files with 18 additions and 12 deletions

View File

@ -32,4 +32,4 @@ before_script:
- export TZ=Europe/Berlin - export TZ=Europe/Berlin
script: script:
- sbt -J-XX:+UseG1GC ++$TRAVIS_SCALA_VERSION ";project root ;scalafmtCheckAll ;make ;test" - sbt -J-XX:+UseG1GC ++$TRAVIS_SCALA_VERSION ci

View File

@ -39,9 +39,9 @@ val sharedSettings = Seq(
val dir = (LocalRootProject / baseDirectory).value / "tools" val dir = (LocalRootProject / baseDirectory).value / "tools"
packageTools(logger, dir, v) packageTools(logger, dir, v)
}, },
scalacOptions in (Compile, console) := Compile / console / scalacOptions :=
(scalacOptions.value.filter(o => !o.contains("-Xlint") && !o.contains("-W"))), (scalacOptions.value.filter(o => !o.contains("-Xlint") && !o.contains("-W"))),
scalacOptions in (Test, console) := Test / console / scalacOptions :=
(scalacOptions.value.filter(o => !o.contains("-Xlint") && !o.contains("-W"))) (scalacOptions.value.filter(o => !o.contains("-Xlint") && !o.contains("-W")))
) ++ scalafixSettings ) ++ scalafixSettings
@ -83,7 +83,7 @@ val stylesSettings = Seq(
def webjarSettings(queryJS: Project) = Seq( def webjarSettings(queryJS: Project) = Seq(
Compile / resourceGenerators += Def.task { Compile / resourceGenerators += Def.task {
copyWebjarResources( copyWebjarResources(
Seq((sourceDirectory in Compile).value / "webjar"), Seq((Compile / sourceDirectory).value / "webjar"),
(Compile / resourceManaged).value, (Compile / resourceManaged).value,
name.value, name.value,
version.value, version.value,
@ -112,7 +112,7 @@ def webjarSettings(queryJS: Project) = Seq(
def debianSettings(cfgFile: String) = def debianSettings(cfgFile: String) =
Seq( Seq(
maintainer := "Eike Kettner <eike.kettner@posteo.de>", maintainer := "Eike Kettner <eike.kettner@posteo.de>",
mappings in Universal += { Universal / mappings += {
val conf = (Compile / resourceDirectory).value / "reference.conf" val conf = (Compile / resourceDirectory).value / "reference.conf"
if (!conf.exists) if (!conf.exists)
sys.error(s"File $conf not found") sys.error(s"File $conf not found")
@ -570,11 +570,11 @@ val website = project
.settings( .settings(
name := "docspell-website", name := "docspell-website",
publishArtifact := false, publishArtifact := false,
skip in publish := true, publish / skip := true,
ghpagesNoJekyll := true, ghpagesNoJekyll := true,
// the ghpages plugins works together with the site plugin (its a dependency) // the ghpages plugins works together with the site plugin (its a dependency)
// to make it publish the zola generated site, override their mappings with the zola output // to make it publish the zola generated site, override their mappings with the zola output
mappings in SitePlugin.autoImport.makeSite := SitePlugin.autoImport.makeSite / mappings :=
Path.selectSubpaths(zolaOutputDir.value, _ => true).toSeq, Path.selectSubpaths(zolaOutputDir.value, _ => true).toSeq,
git.remoteRepo := "git@github.com:eikek/docspell", git.remoteRepo := "git@github.com:eikek/docspell",
Compile / resourceGenerators += Def.task { Compile / resourceGenerators += Def.task {
@ -584,10 +584,10 @@ val website = project
val logger = streams.value.log val logger = streams.value.log
val files = Seq( val files = Seq(
(resourceDirectory in (restserver, Compile)).value / "reference.conf" -> templateOut / "server.conf", (restserver / Compile / resourceDirectory).value / "reference.conf" -> templateOut / "server.conf",
(resourceDirectory in (joex, Compile)).value / "reference.conf" -> templateOut / "joex.conf", (joex / Compile / resourceDirectory).value / "reference.conf" -> templateOut / "joex.conf",
(LocalRootProject / baseDirectory).value / "tools" / "exim" / "exim.conf" -> templateOut / "sample-exim.conf", (LocalRootProject / baseDirectory).value / "tools" / "exim" / "exim.conf" -> templateOut / "sample-exim.conf",
(resourceDirectory in (restapi, Compile)).value / "docspell-openapi.yml" -> staticOut / "docspell-openapi.yml", (restapi / Compile / resourceDirectory).value / "docspell-openapi.yml" -> staticOut / "docspell-openapi.yml",
(restapi / Compile / openapiStaticDoc).value -> staticOut / "docspell-openapi.html" (restapi / Compile / openapiStaticDoc).value -> staticOut / "docspell-openapi.html"
) )
IO.copy(files) IO.copy(files)
@ -777,4 +777,10 @@ addCommandAlias("make-zip", ";restserver/universal:packageBin ;joex/universal:pa
addCommandAlias("make-deb", ";restserver/debian:packageBin ;joex/debian:packageBin") addCommandAlias("make-deb", ";restserver/debian:packageBin ;joex/debian:packageBin")
addCommandAlias("make-tools", ";root/toolsPackage") addCommandAlias("make-tools", ";root/toolsPackage")
addCommandAlias("make-pkg", ";clean ;make ;make-zip ;make-deb ;make-tools") addCommandAlias("make-pkg", ";clean ;make ;make-zip ;make-deb ;make-tools")
addCommandAlias("reformatAll", ";project root ;scalafix ;scalafmtAll")
addCommandAlias("ci", "make; lint; test")
addCommandAlias(
"lint",
"scalafmtSbtCheck; scalafmtCheckAll; Compile/scalafix --check; Test/scalafix --check"
)
addCommandAlias("fix", "Compile/scalafix; Test/scalafix; scalafmtSbt; scalafmtAll")

View File

@ -1 +1 @@
version in ThisBuild := "0.22.0-SNAPSHOT" ThisBuild / version := "0.22.0-SNAPSHOT"