Skip to content

Commit

Permalink
Update: build.sbt - add SonatypeSnapshots resolver
Browse files Browse the repository at this point in the history
  • Loading branch information
kevin-lee committed Feb 11, 2024
1 parent 3b818da commit 6d77ae0
Showing 1 changed file with 21 additions and 16 deletions.
37 changes: 21 additions & 16 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ ThisBuild / scmInfo :=
url(s"https://github.com/${props.GitHubUsername}/${props.RepoName}"),
s"git@github.com:${props.GitHubUsername}/${props.RepoName}.git"
).some
ThisBuild / licenses := List("MIT" -> url("http://opensource.org/licenses/MIT"))
ThisBuild / licenses := props.licenses

ThisBuild / resolvers += props.SonatypeSnapshots

ThisBuild / resolvers += "sonatype-snapshots" at s"https://${props.SonatypeCredentialHost}/content/repositories/snapshots"

Expand Down Expand Up @@ -86,7 +88,7 @@ lazy val core = (project in file("core"))
List("com.lihaoyi" % "ammonite" % "2.3.8-58-aa8b2ab1" % Test cross CrossVersion.full)
case "2.13" =>
List("com.lihaoyi" % "ammonite" % "2.5.9" % Test cross CrossVersion.full)
case _ =>
case _ =>
Seq.empty[ModuleID]
}),
libraryDependencies ++= libs.hedgehogLibs,
Expand All @@ -100,7 +102,7 @@ lazy val core = (project in file("core"))
),
Test / sourceGenerators +=
(scalaBinaryVersion.value match {
case "2.10" =>
case "2.10" =>
task(Seq.empty[File])
case "2.11" | "2.12" =>
task {
Expand All @@ -114,7 +116,7 @@ lazy val core = (project in file("core"))
IO.write(file, """object amm extends App { ammonite.AmmoniteMain.main(args) }""")
List(file)
}
case _ =>
case _ =>
task(Seq.empty[File])
}),
/* } Ammonite-REPL */
Expand All @@ -137,7 +139,7 @@ lazy val core = (project in file("core"))
coverageHighlighting := (CrossVersion.partialVersion(scalaVersion.value) match {
case Some((2, 10)) =>
false
case _ =>
case _ =>
true
})
/* } Coveralls */
Expand All @@ -148,14 +150,15 @@ lazy val docs = (project in file("generated-docs"))
.settings(
name := prefixedProjectName("docs"),
mdocVariables := Map(
"VERSION" -> {
"VERSION" -> {
import sys.process._
"git fetch --tags".!
val tag = "git rev-list --tags --max-count=1".!!.trim
s"git describe --tags $tag".!!.trim.stripPrefix("v")
},
"SUPPORTED_SCALA_VERSIONS" -> {
val versions = props.CrossScalaVersions
val versions = props
.CrossScalaVersions
.map(CrossVersion.binaryScalaVersion)
.map(binVer => s"`$binVer`")
if (versions.length > 1)
Expand Down Expand Up @@ -201,6 +204,13 @@ lazy val props =
val DottyVersions = List("3.0.0")
val ProjectScalaVersion = "2.13.10"

val SonatypeCredentialHost = "s01.oss.sonatype.org"
val SonatypeRepository = s"https://$SonatypeCredentialHost/service/local"

val SonatypeSnapshots = "sonatype-snapshots" at s"https://$SonatypeCredentialHost/content/repositories/snapshots"

val licenses = List(License.MIT)

val removeDottyIncompatible: ModuleID => Boolean =
m =>
m.name == "wartremover" ||
Expand All @@ -219,10 +229,7 @@ lazy val props =
val RepoName = "just-fp"
val ProjectName = RepoName

val SonatypeCredentialHost = "s01.oss.sonatype.org"
val SonatypeRepository = s"https://$SonatypeCredentialHost/service/local"

val hedgehogVersion = "0.8.0"
val hedgehogVersion = "0.8.0"
}

lazy val libs =
Expand All @@ -237,13 +244,11 @@ lazy val libs =
lazy val mavenCentralPublishSettings: SettingsDefinition = List(
/* Publish to Maven Central { */
sonatypeCredentialHost := props.SonatypeCredentialHost,
sonatypeRepository := props.SonatypeRepository,
sonatypeRepository := props.SonatypeRepository,
/* } Publish to Maven Central */
)

def prefixedProjectName(name: String) = s"${props.ProjectName}${if (name.isEmpty)
""
else
s"-$name"}"
def prefixedProjectName(name: String) =
s"${props.ProjectName}${if (name.isEmpty) "" else s"-$name"}"

def isScala3(scalaVersion: String): Boolean = scalaVersion.startsWith("3.")

0 comments on commit 6d77ae0

Please sign in to comment.