-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild.sbt
124 lines (106 loc) · 5.14 KB
/
build.sbt
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
import sbtrelease.ReleaseStateTransformations.*
import xerial.sbt.Sonatype.*
import scala.language.postfixOps
import scala.sys.process.*
lazy val javaVersion = "17"
ThisBuild / scalaVersion := "3.3.4"
ThisBuild / javacOptions ++= Seq("-source", javaVersion, "-target", javaVersion)
ThisBuild / scalacOptions += s"-java-output-version:$javaVersion"
lazy val packageExecutable =
taskKey[String]("Package an executable with Coursier")
lazy val versionResource =
settingKey[File]("Location of generated version resource file.")
lazy val root = (project in file("."))
.settings(
publishTo := sonatypePublishToBundle.value,
pomIncludeRepository := { _ => false },
sonatypeCredentialHost := "s01.oss.sonatype.org",
publishMavenStyle := true,
licenses += ("MIT", url("https://opensource.org/licenses/MIT")),
organization := "com.sageserpent",
organizationName := "sageserpent",
description := "Merge branches in the presence of code motion within and between files.",
sonatypeProjectHosting := Some(
GitHubHosting(
user = "sageserpent-open",
repository = "kineticMerge",
email = "gjmurphy1@icloud.com"
)
),
releaseCrossBuild := false, // No cross-building here - just Scala 3.
releaseProcess := Seq[ReleaseStep](
checkSnapshotDependencies,
inquireVersions,
runClean,
runTest,
setReleaseVersion,
commitReleaseVersion,
tagRelease,
releaseStepCommand("packageExecutable"),
releaseStepCommand(
"publishSigned"
), // ... finally the publishing step using SBT's own mechanism.
releaseStepCommand("sonatypeBundleRelease"),
setNextVersion,
commitNextVersion,
pushChanges
),
scalacOptions ++= List("-source:future"),
name := "kinetic-merge",
versionResource := {
val additionalResourcesDirectory = (Compile / resourceManaged).value
additionalResourcesDirectory.toPath.resolve("version.txt").toFile
},
Compile / resourceGenerators += Def.task {
val location = versionResource.value
val packagingVersion = (ThisBuild / version).value
println(
s"Generating version resource: $location for version: $packagingVersion"
)
IO.write(location, packagingVersion)
Seq(location)
}.taskValue,
packageExecutable := {
val packagingVersion = (ThisBuild / version).value
println(s"Packaging executable with version: $packagingVersion")
val localArtifactCoordinates =
s"${organization.value}:${name.value}_${scalaBinaryVersion.value}:$packagingVersion"
val executablePath = s"${target.value}${Path.sep}${name.value}"
s"cs bootstrap --verbose --bat=true --scala-version ${scalaBinaryVersion.value} -f $localArtifactCoordinates -o $executablePath" !
name.value
},
packageExecutable := (packageExecutable dependsOn publishLocal).value,
libraryDependencies += "com.typesafe.scala-logging" %% "scala-logging" % "3.9.5",
libraryDependencies += "ch.qos.logback" % "logback-core" % "1.5.16",
libraryDependencies += "ch.qos.logback" % "logback-classic" % "1.5.16",
libraryDependencies += "org.typelevel" %% "cats-core" % "2.9.0",
libraryDependencies += "com.github.scopt" %% "scopt" % "4.1.0",
libraryDependencies += "org.typelevel" %% "cats-collections-core" % "0.9.9",
libraryDependencies += "org.typelevel" %% "cats-core" % "2.12.0",
libraryDependencies += "org.typelevel" %% "alleycats-core" % "2.12.0",
libraryDependencies += "org.typelevel" %% "cats-effect" % "3.5.7",
libraryDependencies += "org.scala-lang.modules" %% "scala-collection-contrib" % "0.4.0",
libraryDependencies ++= Seq(
"dev.optics" %% "monocle-core" % "3.3.0",
"dev.optics" %% "monocle-macro" % "3.3.0"
),
libraryDependencies += "org.scala-lang.modules" %% "scala-parser-combinators" % "2.4.0",
libraryDependencies += "com.lihaoyi" %% "os-lib" % "0.11.3",
libraryDependencies += "com.lihaoyi" %% "fansi" % "0.5.0",
libraryDependencies += "com.lihaoyi" %% "pprint" % "0.9.0",
libraryDependencies += "com.softwaremill.common" %% "tagging" % "2.3.5",
libraryDependencies += "com.google.guava" % "guava" % "33.4.0-jre",
libraryDependencies += "de.sciss" %% "fingertree" % "1.5.5",
libraryDependencies += "com.github.ben-manes.caffeine" % "caffeine" % "3.2.0",
libraryDependencies += "org.apache.commons" % "commons-text" % "1.13.0",
libraryDependencies += "me.tongfei" % "progressbar" % "0.10.1",
libraryDependencies +=
"org.scala-lang.modules" %% "scala-parallel-collections" % "1.2.0",
libraryDependencies += "eu.timepit" %% "refined" % "0.11.3",
libraryDependencies += "com.sageserpent" %% "americium" % "1.19.9" % Test,
libraryDependencies += "com.eed3si9n.expecty" %% "expecty" % "0.17.0" % Test,
libraryDependencies += "com.github.sbt.junit" % "jupiter-interface" % JupiterKeys.jupiterVersion.value % Test,
Test / test / logLevel := Level.Error,
Test / fork := true,
Test / testForkedParallel := true
)