~jan0sch/smederee

Showing details for patch 4db52a8da3d95a28ce8c2195433ad7ea1dc76cc8.
2022-11-23 (Wed), 4:46 PM - Jens Grassel - 4db52a8da3d95a28ce8c2195433ad7ea1dc76cc8

Solve scala-xml update issues and code cleanup and packaging.

- remove the docs module
- update sbt to 1.8.0
- remove sbt-site related plugins
- update sbt-native-package to 1.9.11
- update sbt-twirl to 1.6.0-M7
- set `noXml` to false in scalafix configuration
- suppress some scalafix warnings where no other solution is feasible
- make package building depend on running all tests
Summary of changes
8 files modified with 22 lines added and 32 lines removed
  • .scalafix.conf with 1 added and 1 removed lines
  • build.sbt with 7 added and 20 removed lines
  • modules/hub/src/main/scala/de/smederee/hub/MarkdownRenderer.scala with 3 added and 0 removed lines
  • modules/hub/src/main/scala/de/smederee/ssh/DarcsSshCommand.scala with 2 added and 0 removed lines
  • modules/hub/src/main/scala/de/smederee/ssh/NoLogin.scala with 1 added and 0 removed lines
  • modules/hub/src/main/scala/de/smederee/ssh/PublicSshKey.scala with 1 added and 0 removed lines
  • project/build.properties with 1 added and 1 removed lines
  • project/plugins.sbt with 6 added and 10 removed lines
1 files removed
  • docs/src/main/paradox/index.md
diff -rN -u old-smederee/build.sbt new-smederee/build.sbt
--- old-smederee/build.sbt	2025-02-01 12:38:47.358401760 +0000
+++ new-smederee/build.sbt	2025-02-01 12:38:47.358401760 +0000
@@ -82,26 +82,6 @@
       )
     )
 
-lazy val docs =
-  project
-    .in(file("docs"))
-    .enablePlugins(ParadoxSitePlugin, ParadoxMaterialThemePlugin, ScalaUnidocPlugin)
-    .settings(commonSettings)
-    .settings(
-      name := "docs",
-      version := "0.4.0-SNAPSHOT",
-      autoAPIMappings := true,
-      paradoxProperties ++= Map(
-        "extref.rfc.base_url"      -> "http://tools.ietf.org/html/rfc%s",
-        "image.base_url"           -> ".../images",
-        "project.description"      -> "TODO",
-        "scaladoc.base_url"        -> ".../api/",
-      ),
-      ScalaUnidoc / siteSubdirName := "api",
-      //ScalaUnidoc / unidoc / unidocProjectFilter := inAnyProject -- inProjects(shared.js),
-      addMappingsToSiteDir(ScalaUnidoc / packageDoc / mappings, ScalaUnidoc / siteSubdirName),
-    )
-
 lazy val email =
   project
     .in(file("modules/email"))
@@ -255,6 +235,13 @@
         Compile / doc / sources := Seq.empty,
         // Require tests to be run before building a debian package.
         Debian / packageBin := ((Debian / packageBin) dependsOn (Test / test) dependsOn (IntegrationTest / test)).value,
+        // Require tests to be run before building a RPM package.
+        Rpm / packageBin := ((Rpm / packageBin) dependsOn (Test / test) dependsOn (IntegrationTest / test)).value,
+        // Require tests to be run before building a universal package.
+        Universal / packageBin := ((Universal / packageBin) dependsOn (Test / test) dependsOn (IntegrationTest / test)).value,
+        Universal / packageOsxDmg := ((Universal / packageOsxDmg) dependsOn (Test / test) dependsOn (IntegrationTest / test)).value,
+        Universal / packageXzTarball := ((Universal / packageXzTarball) dependsOn (Test / test) dependsOn (IntegrationTest / test)).value,
+        Universal / packageZipTarball := ((Universal / packageZipTarball) dependsOn (Test / test) dependsOn (IntegrationTest / test)).value,
         // Prevent a customised local application.conf file to be packaged!
         Compile / packageBin / mappings ~= { files =>
           files.filterNot {
diff -rN -u old-smederee/docs/src/main/paradox/index.md new-smederee/docs/src/main/paradox/index.md
--- old-smederee/docs/src/main/paradox/index.md	2025-02-01 12:38:47.358401760 +0000
+++ new-smederee/docs/src/main/paradox/index.md	1970-01-01 00:00:00.000000000 +0000
@@ -1,21 +0,0 @@
-@@@ index
-
-
-@@@
-
-# Smederee
-
-TODO
-
-## Support
-
-If you are interested in paid business support, customised installations or
-any other service (e.g. search technology, data integration, etc.) please
-contact [Wegtam GmbH](https://www.wegtam.com/).
-
-## Language
-
-The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
-"SHOULD", "SHOULD NOT", "RECOMMENDED",  "MAY", and "OPTIONAL" in this
-document are to be interpreted as described in @extref[RFC 2119](rfc:2119).
-
diff -rN -u old-smederee/modules/hub/src/main/scala/de/smederee/hub/MarkdownRenderer.scala new-smederee/modules/hub/src/main/scala/de/smederee/hub/MarkdownRenderer.scala
--- old-smederee/modules/hub/src/main/scala/de/smederee/hub/MarkdownRenderer.scala	2025-02-01 12:38:47.358401760 +0000
+++ new-smederee/modules/hub/src/main/scala/de/smederee/hub/MarkdownRenderer.scala	2025-02-01 12:38:47.358401760 +0000
@@ -60,6 +60,9 @@
     * @param repo
     *   The repository which contains the markdown sources. If the option is empty then no URI path prefix will be set.
     */
+  @SuppressWarnings(
+    Array("scalafix:DisableSyntax.isInstanceOf")
+  ) // TODO Find a way to get rid of the isInstanceOf below.
   class LinkHrefCorrector(private val repo: Option[VcsRepository]) extends AttributeProvider {
     override def setAttributes(node: Node, tagName: String, attributes: java.util.Map[String, String]): Unit =
       if (node.isInstanceOf[Link]) {
diff -rN -u old-smederee/modules/hub/src/main/scala/de/smederee/ssh/DarcsSshCommand.scala new-smederee/modules/hub/src/main/scala/de/smederee/ssh/DarcsSshCommand.scala
--- old-smederee/modules/hub/src/main/scala/de/smederee/ssh/DarcsSshCommand.scala	2025-02-01 12:38:47.358401760 +0000
+++ new-smederee/modules/hub/src/main/scala/de/smederee/ssh/DarcsSshCommand.scala	2025-02-01 12:38:47.358401760 +0000
@@ -40,6 +40,7 @@
 
 /** A base class for the specific darcs commands that we implement.
   */
+@SuppressWarnings(Array("scalafix:DisableSyntax.null", "scalafix:DisableSyntax.var"))
 abstract class DarcsSshCommand extends Command with ServerSessionAware {
   private val log = LoggerFactory.getLogger(classOf[DarcsSshCommand])
 
@@ -224,6 +225,7 @@
       }
       .unsafeRunSync()
 
+  @SuppressWarnings(Array("scalafix:DisableSyntax.null"))
   override def createCommand(channel: ChannelSession, command: String): Command = {
     log.debug(s"Requested SSH command: $command")
     val sshKeyOwnerId = channel.getSession().getAttribute(SshServerConfiguration.SshKeyOwnerIdAttribute)
diff -rN -u old-smederee/modules/hub/src/main/scala/de/smederee/ssh/NoLogin.scala new-smederee/modules/hub/src/main/scala/de/smederee/ssh/NoLogin.scala
--- old-smederee/modules/hub/src/main/scala/de/smederee/ssh/NoLogin.scala	2025-02-01 12:38:47.358401760 +0000
+++ new-smederee/modules/hub/src/main/scala/de/smederee/ssh/NoLogin.scala	2025-02-01 12:38:47.362401768 +0000
@@ -64,6 +64,7 @@
        |${sshPort}darcs clone ${genericUser.toString}@${host.toString}:username/repository
      """.stripMargin.replaceAll("\n", "\r\n") + "\r\n"
 
+  @SuppressWarnings(Array("scalafix:DisableSyntax.null", "scalafix:DisableSyntax.var"))
   override def createShell(channel: ChannelSession): Command =
     new Command() {
       private var stdin: InputStream     = null
diff -rN -u old-smederee/modules/hub/src/main/scala/de/smederee/ssh/PublicSshKey.scala new-smederee/modules/hub/src/main/scala/de/smederee/ssh/PublicSshKey.scala
--- old-smederee/modules/hub/src/main/scala/de/smederee/ssh/PublicSshKey.scala	2025-02-01 12:38:47.358401760 +0000
+++ new-smederee/modules/hub/src/main/scala/de/smederee/ssh/PublicSshKey.scala	2025-02-01 12:38:47.362401768 +0000
@@ -59,6 +59,7 @@
     * @return
     *   The converted EncodedKeyBytes instance.
     */
+  @SuppressWarnings(Array("scalafix:DisableSyntax.throw"))
   @throws[IllegalArgumentException]("if the given string is not syntactically valid")
   def unsafeFrom(source: String): EncodedKeyBytes =
     from(source) match {
diff -rN -u old-smederee/project/build.properties new-smederee/project/build.properties
--- old-smederee/project/build.properties	2025-02-01 12:38:47.358401760 +0000
+++ new-smederee/project/build.properties	2025-02-01 12:38:47.362401768 +0000
@@ -1 +1 @@
-sbt.version = 1.7.2
+sbt.version = 1.8.0
diff -rN -u old-smederee/project/plugins.sbt new-smederee/project/plugins.sbt
--- old-smederee/project/plugins.sbt	2025-02-01 12:38:47.358401760 +0000
+++ new-smederee/project/plugins.sbt	2025-02-01 12:38:47.362401768 +0000
@@ -1,12 +1,8 @@
-addSbtPlugin("de.heikoseeberger"     % "sbt-header"                 % "5.7.0")
-addSbtPlugin("com.github.sbt"        % "sbt-native-packager"        % "1.9.9")
-addSbtPlugin("com.lightbend.paradox" % "sbt-paradox"                % "0.10.2")
-addSbtPlugin("io.github.jonas"       % "sbt-paradox-material-theme" % "0.6.0")
-addSbtPlugin("io.spray"              % "sbt-revolver"               % "0.9.1")
-addSbtPlugin("ch.epfl.scala"         % "sbt-scalafix"               % "0.10.4")
-addSbtPlugin("org.scalameta"         % "sbt-scalafmt"               % "2.5.0")
-addSbtPlugin("com.typesafe.sbt"      % "sbt-site"                   % "1.4.1")
-addSbtPlugin("com.typesafe.sbt"      % "sbt-twirl"                  % "1.5.1")
-addSbtPlugin("com.github.sbt"        % "sbt-unidoc"                 % "0.5.0")
+addSbtPlugin("de.heikoseeberger" % "sbt-header"          % "5.7.0")
+addSbtPlugin("com.github.sbt"    % "sbt-native-packager" % "1.9.11")
+addSbtPlugin("io.spray"          % "sbt-revolver"        % "0.9.1")
+addSbtPlugin("ch.epfl.scala"     % "sbt-scalafix"        % "0.10.4")
+addSbtPlugin("org.scalameta"     % "sbt-scalafmt"        % "2.5.0")
+addSbtPlugin("com.typesafe.play" % "sbt-twirl"           % "1.6.0-M7")
 // Needed to build debian packages via java (for sbt-native-packager).
 libraryDependencies += "org.vafer" % "jdeb" % "1.10" artifacts (Artifact("jdeb", "jar", "jar"))
diff -rN -u old-smederee/.scalafix.conf new-smederee/.scalafix.conf
--- old-smederee/.scalafix.conf	2025-02-01 12:38:47.358401760 +0000
+++ new-smederee/.scalafix.conf	2025-02-01 12:38:47.358401760 +0000
@@ -17,5 +17,5 @@
   noValPatterns = true
   noVars = true
   noWhileLoops = true
-  noXml = true
+  noXml = false
 }