Skip to content

Commit

Permalink
Change artifact name from fly4s-core to fly4s
Browse files Browse the repository at this point in the history
  • Loading branch information
geirolz committed Jan 8, 2024
1 parent 196e7fe commit 8bd12d3
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 16 deletions.
38 changes: 22 additions & 16 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ lazy val fly4s: Project = project
"[email protected]",
url("https://github.com/geirolz")
)
)
),
mimaPreviousArtifacts := Set(prjOrg %% prjName % "1.0.0")
)
)
)
Expand All @@ -36,12 +37,10 @@ lazy val fly4s: Project = project
)
.aggregate(core)


lazy val core: Project =
buildModule(
prjModuleName = "core",
toPublish = true,
folder = "."
module("core")(
folder = "./core",
publishAs = Some(prjName)
).settings(
libraryDependencies ++= {
CrossVersion.partialVersion(Keys.scalaVersion.value) match {
Expand All @@ -52,18 +51,22 @@ lazy val core: Project =
)

//=============================== MODULES UTILS ===============================
def buildModule(prjModuleName: String, toPublish: Boolean, folder: String): Project = {
val keys = prjModuleName.split("-")
val docName = keys.mkString(" ")
val prjFile = file(s"$folder/$prjModuleName")
val docNameStr = s"$prjName $docName"
def module(modName: String)(folder: String, publishAs: Option[String] = None): Project = {
val keys = modName.split("-")
val modDocName = keys.mkString(" ")
val docNameStr = s"$prjName $modDocName"

Project(prjModuleName, prjFile)
val publishSettings = publishAs match {
case Some(pubName) =>
Seq(
moduleName := pubName,
publish / skip := false
)
case None => noPublishSettings
}
Project(modName, file(folder))
.settings(
description := moduleName.value,
moduleName := s"$prjName-$prjModuleName",
name := s"$prjName $docName",
publish / skip := !toPublish,
name := s"$prjName $modDocName",
mdocIn := file(s"$folder/docs"),
mdocOut := file(folder),
mdocScalacOptions := Seq("-Xsource:3"),
Expand All @@ -74,10 +77,13 @@ def buildModule(prjModuleName: String, toPublish: Boolean, folder: String): Proj
"MODULE_NAME" -> moduleName.value,
"VERSION" -> previousStableVersion.value.getOrElse("<version>")
),
publishSettings,
baseSettings
).enablePlugins(ModuleMdocPlugin)
}

def subProjectName(modPublishName: String): String = s"$prjName-$modPublishName"

//=============================== SETTINGS ===============================
lazy val noPublishSettings: Seq[Def.Setting[_]] = Seq(
publish := {},
Expand Down
1 change: 1 addition & 0 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.5.2")
addSbtPlugin("org.scoverage" % "sbt-scoverage" % "2.0.9")
addSbtPlugin("com.github.sbt" % "sbt-ci-release" % "1.5.12")
addSbtPlugin("org.scalameta" % "sbt-mdoc" % "2.5.1")
addSbtPlugin("com.typesafe" % "sbt-mima-plugin" % "1.1.3")

0 comments on commit 8bd12d3

Please sign in to comment.