~jan0sch/smederee

Showing details for patch 405413ba875d67d35482baead7df864817da1184.
2024-04-23 (Tue), 11:29 AM - Jens Grassel - 405413ba875d67d35482baead7df864817da1184

build: Remove obsolete settings and logic regarding copyright years.

- refactor license url constructur to fix deprecation warning
Summary of changes
1 files modified with 3 lines added and 25 lines removed
  • build.sbt with 3 added and 25 removed lines
diff -rN -u old-smederee/build.sbt new-smederee/build.sbt
--- old-smederee/build.sbt	2024-05-05 13:29:33.061244557 +0000
+++ new-smederee/build.sbt	2024-05-05 13:29:33.061244557 +0000
@@ -2,15 +2,8 @@
 // Build settings
 // *****************************************************************************
 
-import java.time.*
-
-// The current year is used to update the license copyright headers in the  sources.
-val currentYear: Int = OffsetDateTime.now().getYear
-// The initial starting year of the project.
-val projectStartYear: Int = 2022
-
 addCommandAlias("check", "Compile/scalafix --check; Test/scalafix --check; headerCheckAll; scalafmtCheckAll")
-addCommandAlias("fix", "Compile/scalafix; Test/scalafix; headerCreateAll; scalafmtSbt; scalafmtAll")
+addCommandAlias("fix", "headerCreate; Compile/scalafix; Test/scalafix; scalafmtSbt; scalafmtAll")
 
 // Enable the semanticdb compiler plugin needed by the metals language server.
 Global / semanticdbEnabled := true
@@ -357,29 +350,14 @@
 // Settings
 // *****************************************************************************
 
-/** Calculate the copyright year string e.g. xxxx or xxxx - yyyy depending on the given start year and the current year.
-  *
-  * @param start
-  *   The start year of the project.
-  * @param current
-  *   The current year which must be equal or larger than the start year.
-  * @return
-  *   A string containing either only the start year or "start year - current year"
-  */
-def calculateCopyrightYears(start: Int, current: Int): String =
-    if (start < current)
-        s"$start - $current"
-    else
-        start.toString
-
 lazy val commonSettings =
     codeSettings ++
         scalafmtSettings
 
 lazy val codeSettings =
     Seq(
-        startYear := Option(projectStartYear),
-        licenses += ("AGPL-3.0-or-later", new URL("https://www.gnu.org/licenses/agpl-3.0.txt"))
+        startYear := Option(2022),
+        licenses += ("AGPL-3.0-or-later", new URI("https://www.gnu.org/licenses/agpl-3.0.txt").toURL())
     )
 
 lazy val scalafmtSettings =