Add more properties to upload meta data

This commit is contained in:
Eike Kettner
2020-11-11 01:08:07 +01:00
parent a21a97f7d5
commit 55a6f7aaf6
10 changed files with 70 additions and 21 deletions

View File

@ -124,9 +124,8 @@ val buildInfoSettings = Seq(
val openapiScalaSettings = Seq(
openapiScalaConfig := ScalaConfig()
.withJson(ScalaJson.circeSemiauto)
.addMapping(CustomMapping.forType({
case TypeDef("LocalDateTime", _) =>
TypeDef("Timestamp", Imports("docspell.common.Timestamp"))
.addMapping(CustomMapping.forType({ case TypeDef("LocalDateTime", _) =>
TypeDef("Timestamp", Imports("docspell.common.Timestamp"))
}))
.addMapping(CustomMapping.forFormatType({
case "ident" =>
@ -182,6 +181,8 @@ val openapiScalaSettings = Seq(
)
)
)
case "glob" =>
field => field.copy(typeDef = TypeDef("Glob", Imports("docspell.common.Glob")))
}))
)
@ -595,11 +596,10 @@ def copyWebjarResources(
src.flatMap { dir =>
if (dir.isDirectory) {
val files = (dir ** "*").filter(_.isFile).get.pair(Path.relativeTo(dir))
files.flatMap {
case (f, name) =>
val target = targetDir / name
IO.createDirectories(Seq(target.getParentFile))
copyWithGZ(f, target)
files.flatMap { case (f, name) =>
val target = targetDir / name
IO.createDirectories(Seq(target.getParentFile))
copyWithGZ(f, target)
}
} else {
val target = targetDir / dir.name
@ -633,11 +633,13 @@ def compileElm(
}
def createWebjarSource(wj: Seq[ModuleID], out: File): Seq[File] = {
val target = out / "Webjars.scala"
val target = out / "Webjars.scala"
val badChars = "-.".toSet
val fields = wj
.map(m =>
s"""val ${m.name.toLowerCase.filter(c => !badChars.contains(c))} = "/${m.name}/${m.revision}" """
s"""val ${m.name.toLowerCase.filter(c =>
!badChars.contains(c)
)} = "/${m.name}/${m.revision}" """
)
.mkString("\n\n")
val content = s"""package docspell.restserver.webapp