-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
31 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,7 +10,7 @@ lazy val scala33 = "3.3.1" | |
lazy val supportedScalaVersions = List(scala213, scala33) | ||
|
||
//## global project to no publish ## | ||
lazy val fly4s: Project = project | ||
lazy val root: Project = project | ||
.in(file(".")) | ||
.settings( | ||
inThisBuild( | ||
|
@@ -25,8 +25,7 @@ lazy val fly4s: Project = project | |
"[email protected]", | ||
url("https://github.com/geirolz") | ||
) | ||
), | ||
mimaPreviousArtifacts := Set(prjOrg %% prjName % "1.0.0") | ||
) | ||
) | ||
) | ||
) | ||
|
@@ -39,8 +38,9 @@ lazy val fly4s: Project = project | |
|
||
lazy val core: Project = | ||
module("core")( | ||
folder = "./core", | ||
publishAs = Some(prjName) | ||
folder = "./core", | ||
publishAs = Some(prjName), | ||
mimaCompatibleWith = Set("1.0.0") | ||
).settings( | ||
libraryDependencies ++= { | ||
CrossVersion.partialVersion(Keys.scalaVersion.value) match { | ||
|
@@ -51,7 +51,11 @@ lazy val core: Project = | |
) | ||
|
||
//=============================== MODULES UTILS =============================== | ||
def module(modName: String)(folder: String, publishAs: Option[String] = None): Project = { | ||
def module(modName: String)( | ||
folder: String, | ||
publishAs: Option[String] = None, | ||
mimaCompatibleWith: Set[String] = Set.empty | ||
): Project = { | ||
val keys = modName.split("-") | ||
val modDocName = keys.mkString(" ") | ||
val docNameStr = s"$prjName $modDocName" | ||
|
@@ -64,6 +68,13 @@ def module(modName: String)(folder: String, publishAs: Option[String] = None): P | |
) | ||
case None => noPublishSettings | ||
} | ||
|
||
val mimaSettings = Seq( | ||
mimaPreviousArtifacts := mimaCompatibleWith.map { version => | ||
organization.value % s"${moduleName.value}_${scalaBinaryVersion.value}" % version | ||
} | ||
) | ||
|
||
Project(modName, file(folder)) | ||
.settings( | ||
name := s"$prjName $modDocName", | ||
|
@@ -77,9 +88,11 @@ def module(modName: String)(folder: String, publishAs: Option[String] = None): P | |
"MODULE_NAME" -> moduleName.value, | ||
"VERSION" -> previousStableVersion.value.getOrElse("<version>") | ||
), | ||
mimaSettings, | ||
publishSettings, | ||
baseSettings | ||
).enablePlugins(ModuleMdocPlugin) | ||
) | ||
.enablePlugins(ModuleMdocPlugin) | ||
} | ||
|
||
def subProjectName(modPublishName: String): String = s"$prjName-$modPublishName" | ||
|
@@ -182,5 +195,12 @@ addCommandAlias( | |
"gen-doc", | ||
List( | ||
core | ||
).map(prj => s"project ${prj.id}-docs; mdoc").mkString(";") + s";project $prjName;" | ||
).map(prj => s"project ${prj.id}-docs; mdoc").mkString(";") + s";project root;" | ||
) | ||
addCommandAlias( | ||
"mimaCheck", | ||
List( | ||
core | ||
).map(prj => s"project ${prj.id}; mimaReportBinaryIssues") | ||
.mkString(";") + s";project root;" | ||
) |