Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't normalize names #510

Merged
merged 1 commit into from
May 28, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -143,3 +143,16 @@ To make `mimaReportBinaryIssues` not fail you may want to do one of the followin
* avoid calling `mimaPreviousArtifacts` when binary compatibility checking isn't needed
* set `mimaFailOnNoPrevious := false` on specific projects that want to opt-out (alternatively `disablePlugins(MimaPlugin)`)
* set `mimaFailOnNoPrevious in ThisBuild := false`, which disables it build-wide, effectively reverting back to the previous behaviour

## Setting mimaPreviousArtifacts when name contains a "."

To refer to the project name in `mimaPreviousArtifacts`, use `moduleName` rather
than `name`, like
```scala
mimaPreviousArtifacts := Set(organization.value %% moduleName.value % "0.1.0")
```

Unlike `name`, `moduleName` escapes characters like `.`, and is the name
actually used by `publish` and `publishLocal` to publish your project. It's
also the value your users should use when adding a dependency towards your
project.
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ object MimaPlugin extends AutoPlugin {
case previousArtifacts =>
previousArtifacts.iterator.map { m =>
val moduleId = CrossVersion(m, scalaModuleInfo.value) match {
case Some(f) => m.withName(f(Project.normalizeModuleID(m.name)))
case None => m // no module id normalization if it's fully declaring it (using "%")
case Some(f) => m.withName(f(m.name))
case None => m
}
moduleId -> SbtMima.getPreviousArtifact(moduleId, ivy, taskStreams)
}.toMap
Expand Down