Skip to content

Commit 4f34713

Browse files
committed
Refactor build & publish
1 parent f19baef commit 4f34713

File tree

2 files changed

+40
-40
lines changed

2 files changed

+40
-40
lines changed

build.sbt

Lines changed: 28 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,12 @@
1-
ThisBuild / organization := "fr.janalyse"
2-
ThisBuild / name := "zwords"
3-
ThisBuild / description := "Guess a word everyday game"
4-
ThisBuild / homepage := Some(url("https://github.com/dacr/sotohp"))
5-
ThisBuild / licenses += "Apache 2" -> url(s"https://www.apache.org/licenses/LICENSE-2.0.txt")
6-
ThisBuild / scmInfo := Some(
7-
ScmInfo(
8-
url(s"https://github.com/dacr/zwords.git"),
9-
s"[email protected]:dacr/zwords.git"
10-
)
11-
)
1+
ThisBuild / name := "zwords"
2+
ThisBuild / organization := "fr.janalyse"
3+
ThisBuild / description := "Guess a word everyday game"
4+
5+
ThisBuild / licenses += "Apache 2" -> url(s"https://www.apache.org/licenses/LICENSE-2.0.txt")
126

137
ThisBuild / scalaVersion := "3.5.1"
148

15-
publishArtifact := false
9+
publishArtifact := false // no artifact for "root" project
1610

1711
val versions = new {
1812
val zio = "2.1.9"
@@ -28,7 +22,7 @@ val versions = new {
2822

2923
val sharedSettings = Seq(
3024
releasePublishArtifactsAction := PgpKeys.publishSigned.value, // MUST BE SET HERE TO TRIGGER THIS REQUIREMENT
31-
Test / fork := true,
25+
Test / fork := true,
3226
testFrameworks += new TestFramework("zio.test.sbt.ZTestFramework"),
3327
scalacOptions ++= Seq("-deprecation"), // "-Xfatal-warnings",
3428
// excludeDependencies += "org.scala-lang.modules" % "scala-collection-compat_2.13",
@@ -43,8 +37,8 @@ lazy val dictionary =
4337
project
4438
.in(file("dictionary"))
4539
.settings(
46-
name:="zwords-dictionary",
47-
description := "Dictionary management",
40+
name := "zwords-dictionary",
41+
description := "Dictionary management",
4842
sharedSettings,
4943
libraryDependencies ++= Seq(
5044
"dev.zio" %% "zio-config" % versions.zioconfig,
@@ -59,8 +53,8 @@ lazy val wordGenerator =
5953
.in(file("wordgen"))
6054
.dependsOn(dictionary)
6155
.settings(
62-
name:="zwords-word-generator",
63-
description := "generate word candidate from dictionary",
56+
name := "zwords-word-generator",
57+
description := "generate word candidate from dictionary",
6458
sharedSettings,
6559
libraryDependencies ++= Seq(
6660
"dev.zio" %% "zio-json" % versions.ziojson
@@ -72,8 +66,8 @@ lazy val gameLogic =
7266
.in(file("gamelogic"))
7367
.dependsOn(wordGenerator)
7468
.settings(
75-
name:="zwords-game-logic",
76-
description := "the sutom/motus game logic",
69+
name := "zwords-game-logic",
70+
description := "the sutom/motus game logic",
7771
sharedSettings
7872
)
7973

@@ -84,8 +78,8 @@ lazy val consoleUI =
8478
.dependsOn(wordGenerator)
8579
.dependsOn(dictionary)
8680
.settings(
87-
name:="zwords-console",
88-
description := "Play zwords from the console",
81+
name := "zwords-console",
82+
description := "Play zwords from the console",
8983
sharedSettings
9084
)
9185

@@ -97,8 +91,8 @@ lazy val webapi =
9791
.dependsOn(dictionary)
9892
.enablePlugins(JavaServerAppPackaging)
9993
.settings(
100-
name:="zwords-webapi",
101-
description := "zwords sutom/motus game REST API",
94+
name := "zwords-webapi",
95+
description := "zwords sutom/motus game REST API",
10296
Universal / javaOptions := Seq( // -- Required for LMDB with recent JVM
10397
"--add-opens",
10498
"java.base/java.nio=ALL-UNNAMED",
@@ -123,3 +117,14 @@ lazy val webapi =
123117
"ch.qos.logback" % "logback-classic" % versions.logback
124118
)
125119
)
120+
121+
ThisBuild / homepage := Some(url("https://github.com/dacr/sotohp"))
122+
ThisBuild / scmInfo := Some(ScmInfo(url(s"https://github.com/dacr/zwords.git"), s"[email protected]:dacr/zwords.git"))
123+
ThisBuild / developers := List(
124+
Developer(
125+
id = "dacr",
126+
name = "David Crosson",
127+
email = "[email protected]",
128+
url = url("https://github.com/dacr")
129+
)
130+
)

publish.sbt

Lines changed: 12 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,19 @@
1-
ThisBuild / pomIncludeRepository := { _ => false }
2-
ThisBuild / versionScheme := Some("early-semver")
3-
ThisBuild / releaseCrossBuild := true
4-
//ThisBuild / releasePublishArtifactsAction := PgpKeys.publishSigned.value
5-
ThisBuild / publishMavenStyle := true
1+
ThisBuild / pomIncludeRepository := { _ => false }
2+
ThisBuild / publishMavenStyle := true
63
ThisBuild / Test / publishArtifact := false
7-
ThisBuild / publishTo := Some(if (isSnapshot.value) Opts.resolver.sonatypeOssSnapshots.head else Opts.resolver.sonatypeStaging)
4+
ThisBuild / releaseCrossBuild := true
5+
ThisBuild / versionScheme := Some("semver-spec")
86

9-
//Global / PgpKeys.useGpg := true // workaround with pgp and sbt 1.2.x
10-
//ThisBuild / pgpSecretRing := pgpPublicRing.value // workaround with pgp and sbt 1.2.x
11-
12-
ThisBuild / pomExtra := {
13-
<developers>
14-
<developer>
15-
<id>dacr</id>
16-
<name>David Crosson</name>
17-
<url>https://github.com/dacr</url>
18-
</developer>
19-
</developers>
7+
ThisBuild / publishTo := {
8+
// For accounts created after Feb 2021:
9+
// val nexus = "https://s01.oss.sonatype.org/"
10+
val nexus = "https://oss.sonatype.org/"
11+
if (isSnapshot.value) Some("snapshots" at nexus + "content/repositories/snapshots")
12+
else Some("releases" at nexus + "service/local/staging/deploy/maven2")
2013
}
2114

15+
ThisBuild / releasePublishArtifactsAction := PgpKeys.publishSigned.value
16+
2217
ThisBuild / releaseTagComment := s"Releasing ${(ThisBuild / version).value}"
2318
ThisBuild / releaseCommitMessage := s"Setting version to ${(ThisBuild / version).value}"
2419
ThisBuild / releaseNextCommitMessage := s"[ci skip] Setting version to ${(ThisBuild / version).value}"

0 commit comments

Comments
 (0)