-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathbuild.sbt
More file actions
69 lines (56 loc) · 2.44 KB
/
build.sbt
File metadata and controls
69 lines (56 loc) · 2.44 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
import sbt._
import Keys._
import sbtghactions.JavaSpec.Distribution.Zulu
lazy val jacksonModuleScala3Enum = (project in file("."))
.settings(
name := "jackson-module-scala3-enum",
organization := "com.github.pjfanning",
ThisBuild / scalaVersion := "3.3.1",
sbtPlugin := false,
scalacOptions ++= Seq("-deprecation", "-Xcheckinit", "-encoding", "utf8", "-g:vars", "-unchecked", "-optimize"),
parallelExecution := true,
homepage := Some(new java.net.URL("https://github.com/pjfanning/jackson-module-scala3-enum/")),
description := "A library for serializing/deserializing scala3 enums using Jackson.",
licenses := Seq("APL2" -> url("https://www.apache.org/licenses/LICENSE-2.0.txt")),
scmInfo := Some(
ScmInfo(
url("https://github.com/pjfanning/jackson-module-scala3-enum"),
"scm:git@github.com:pjfanning/jackson-module-scala3-enum.git"
)
),
developers := List(
Developer(id="pjfanning", name="PJ Fanning", email="", url=url("https://github.com/pjfanning"))
),
libraryDependencies ++= Seq(
"com.fasterxml.jackson.core" % "jackson-databind" % "2.16.0",
"com.fasterxml.jackson.module" %% "jackson-module-scala" % "2.16.0" % Test,
"org.scalatest" %% "scalatest" % "3.2.17" % Test
),
// enable publishing the main API jar
packageDoc / publishArtifact := true,
// build.properties
Compile / resourceGenerators += Def.task {
val file = (Compile / resourceManaged).value / "com" / "github" / "pjfanning" / "enum" / "build.properties"
val contents = "version=%s\ngroupId=%s\nartifactId=%s\n".format(version.value, organization.value, name.value)
IO.write(file, contents)
Seq(file)
}.taskValue,
ThisBuild / githubWorkflowJavaVersions := Seq(JavaSpec(Zulu, "8")),
ThisBuild / githubWorkflowTargetTags ++= Seq("v*"),
ThisBuild / githubWorkflowPublishTargetBranches := Seq(
RefPredicate.Equals(Ref.Branch("main")),
RefPredicate.StartsWith(Ref.Tag("v"))
),
ThisBuild / githubWorkflowPublish := Seq(
WorkflowStep.Sbt(
List("ci-release"),
env = Map(
"PGP_PASSPHRASE" -> "${{ secrets.PGP_PASSPHRASE }}",
"PGP_SECRET" -> "${{ secrets.PGP_SECRET }}",
"SONATYPE_PASSWORD" -> "${{ secrets.SONATYPE_PASSWORD }}",
"SONATYPE_USERNAME" -> "${{ secrets.SONATYPE_USERNAME }}",
"CI_SNAPSHOT_RELEASE" -> "+publishSigned"
)
)
)
)