From 302abe674ff28e169d1bea6ff94880a5525bda0c Mon Sep 17 00:00:00 2001 From: Robin Hillyard Date: Wed, 24 Sep 2025 11:23:26 -0400 Subject: [PATCH] Upgrade to 1.2.3 build.sbt: (and module build.sbt files) various fixed including version; core/build.sbt: changed flog version from 1.0.10 to 1.0.8 (it's Scala 2); build.properties: upgrade to SBT 1.11.6; plugins.sbt: upgrade to sonatype 3.11.3; publish.sbt: major changes for new Sonatype protocol; --- build.sbt | 10 +++----- cats/build.sbt | 2 ++ core/build.sbt | 4 ++- project/build.properties | 2 +- project/plugins.sbt | 3 ++- publish.sbt | 53 ++++++++++++++++++++++++++-------------- spark/build.sbt | 2 ++ zio/build.sbt | 2 ++ 8 files changed, 50 insertions(+), 28 deletions(-) diff --git a/build.sbt b/build.sbt index bd140244..55aa9fb3 100755 --- a/build.sbt +++ b/build.sbt @@ -2,9 +2,11 @@ ThisBuild / organization := "com.phasmidsoftware" name := "TableParser" -ThisBuild / version := "1.2.2" +ThisBuild / version := "1.2.3" -ThisBuild / scalaVersion := "2.13.16" +scalaVersion := "2.13.16" + +scalacOptions ++= Seq("-encoding", "UTF-8", "-unchecked", "-deprecation", "-Ywarn-dead-code", "-Ywarn-value-discard", "-Ywarn-unused") lazy val core = project @@ -18,10 +20,6 @@ lazy val root = (project in file(".")).aggregate(core, cats, zio, spark) Test / parallelExecution := false -//javaOptions ++= Seq("-Xms512M", "-Xmx2048M", "-XX:+CMSClassUnloadingEnabled") - -scalacOptions += "-deprecation" - // NOTE: if you reinstate these directories, you will need to manage the large crimes file (see code). //Test / unmanagedSourceDirectories += baseDirectory.value / "src/it/scala" //Test / unmanagedResourceDirectories += baseDirectory.value / "src/it/resources" diff --git a/cats/build.sbt b/cats/build.sbt index 03861bb3..1baeeade 100644 --- a/cats/build.sbt +++ b/cats/build.sbt @@ -1,5 +1,7 @@ name := "tableparser-cats" +scalaVersion := "2.13.16" + //Compile / doc / scalacOptions ++= Seq("-implicits", "-deprecation", "-Ywarn-dead-code", "-Ywarn-value-discard", "-Ywarn-unused") lazy val scalaModules = "org.scala-lang.modules" diff --git a/core/build.sbt b/core/build.sbt index 5cfc19a8..7c06f447 100644 --- a/core/build.sbt +++ b/core/build.sbt @@ -1,5 +1,7 @@ name := "tableparser-core" +scalaVersion := "2.13.16" + //Compile / doc / scalacOptions ++= Seq("-Vimplicits", "-deprecation", "-Ywarn-dead-code", "-Ywarn-value-discard", "-Ywarn-unused") lazy val scalaModules = "org.scala-lang.modules" @@ -11,7 +13,7 @@ lazy val nScalaTimeVersion = "2.32.0" lazy val tsecVersion = "0.4.0" libraryDependencies ++= Seq( - "com.phasmidsoftware" %% "flog" % "1.0.10", + "com.phasmidsoftware" %% "flog" % "1.0.8", "io.spray" %% "spray-json" % "1.3.6", "org.scala-lang.modules" %% "scala-parallel-collections" % "1.2.0", //noinspection SbtDependencyVersionInspection diff --git a/project/build.properties b/project/build.properties index d054a794..25b1adc1 100644 --- a/project/build.properties +++ b/project/build.properties @@ -1,4 +1,4 @@ # # Copyright (c) 2019. Phasmid Software # -sbt.version=1.9.9 \ No newline at end of file +sbt.version=1.11.6 \ No newline at end of file diff --git a/project/plugins.sbt b/project/plugins.sbt index 8a1107f0..072e38e1 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -1,3 +1,4 @@ addSbtPlugin("com.github.sbt" % "sbt-pgp" % "2.1.2") -addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "3.9.5") +// CONSIDER removing this plugin, as its functionality is now built into sbt +addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "3.11.3") diff --git a/publish.sbt b/publish.sbt index 50b88562..053bb42b 100644 --- a/publish.sbt +++ b/publish.sbt @@ -1,31 +1,46 @@ -ThisBuild / organization := "com.phasmidsoftware" +// Optional but useful +ThisBuild / description := "Scala library to process tabular data, for example, CSV files" +ThisBuild / homepage := Some(url("https://github.com/rchillyard/TableParser")) ThisBuild / organizationName := "Phasmid Software" ThisBuild / organizationHomepage := Some(url("https://phasmidsoftware.com/")) +// Publishing configuration +ThisBuild / publishTo := { + val centralSnapshots = "https://central.sonatype.com/repository/maven-snapshots/" + if (isSnapshot.value) Some("central-snapshots" at centralSnapshots) + else localStaging.value +} +ThisBuild / publishMavenStyle := true + +// Credentials +ThisBuild / credentials += Credentials(Path.userHome / ".sbt" / "sonatype_credentials") + +// Required POM metadata for Maven Central +ThisBuild / licenses := List("Apache-2.0" -> new URL("https://www.apache.org/licenses/LICENSE-2.0.txt")) ThisBuild / scmInfo := Some( ScmInfo( url("https://github.com/rchillyard/TableParser"), "scm:git@github.com:rchillyard/TableParser.git" ) - ) - ThisBuild / developers := List( +) +ThisBuild / developers := List( Developer( - id = "rchillyard", - name = "Robin Hillyard", - email = "rchillyard@phasmidsoftware.com", - url = url("https://phasmidsoftware.com") - ) + id = "rchillyard", + name = "Robin Hillyard", + email = "rchillyard@phasmidsoftware.com", + url = url("https://phasmidsoftware.com") ) +) + +// Optional + +// Publishing settings +ThisBuild / versionScheme := Some("early-semver") +ThisBuild / publishConfiguration := publishConfiguration.value.withOverwrite(true) +ThisBuild / publishLocalConfiguration := publishLocalConfiguration.value.withOverwrite(true) - ThisBuild / description := "This project is a Scala library for facilitate comparisons in a functional style." - ThisBuild / licenses := List("Apache-2.0" -> new URL("https://www.apache.org/licenses/LICENSE-2.0.txt")) - ThisBuild / homepage := Some(url("https://github.com/rchillyard/TableParser")) +// Optional: Skip publishing of docs and sources for snapshot versions +ThisBuild / publishArtifact := true - // Remove all additional repository other than Maven Central from POM - ThisBuild / pomIncludeRepository := { _ => false } - ThisBuild / publishTo := { - val nexus = "https://oss.sonatype.org/" - if (isSnapshot.value) Some("snapshots" at nexus + "content/repositories/snapshots") - else Some("releases" at nexus + "service/local/staging/deploy/maven2") - } - ThisBuild / publishMavenStyle := true \ No newline at end of file +// Remove all additional repository other than Maven Central from POM +ThisBuild / pomIncludeRepository := { _ => false } diff --git a/spark/build.sbt b/spark/build.sbt index d707b1ba..31d3e660 100644 --- a/spark/build.sbt +++ b/spark/build.sbt @@ -1,5 +1,7 @@ name := "tableparser-spark" +scalaVersion := "2.13.16" + //Compile / doc / scalacOptions ++= Seq("-Vimplicits", "-deprecation", "-Ywarn-dead-code", "-Ywarn-value-discard", "-Ywarn-unused") lazy val scalaModules = "org.scala-lang.modules" diff --git a/zio/build.sbt b/zio/build.sbt index 67e8df83..df3b5af3 100644 --- a/zio/build.sbt +++ b/zio/build.sbt @@ -1,5 +1,7 @@ name := "tableparser-zio" +scalaVersion := "2.13.16" + //Compile / doc / scalacOptions ++= Seq("-implicits", "-deprecation", "-Ywarn-dead-code", "-Ywarn-value-discard", "-Ywarn-unused") lazy val scalaModules = "org.scala-lang.modules"