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

Move mimaSettings back to scalaModuleSettings #28

Merged
merged 1 commit into from
Jul 11, 2017
Merged

Conversation

lrytz
Copy link
Member

@lrytz lrytz commented Jul 7, 2017

Running MiMa makes sense also for scala-js artifacts.


lazy val scalaModuleSettingsJVM: Seq[Setting[_]] = Seq(
mimaPreviousVersion := None
) ++ mimaSettings ++ scalaModuleOsgiSettings
) ++ scalaModuleOsgiSettings
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't mimaPreviousVersion also be moved to scalaModuleSettings?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

right, thanks! so hot in this office...

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎾

@lrytz
Copy link
Member Author

lrytz commented Jul 7, 2017

Thanks - still got to fix some stuff to make MiMa actually work on the js artifacts. Testing that locally.

@lrytz lrytz force-pushed the master branch 2 times, most recently from 7479ef6 to 4bd0619 Compare July 11, 2017 12:10
@lrytz
Copy link
Member Author

lrytz commented Jul 11, 2017

@sjrd @dwijnand I have MiMa working now for both jvm and js projects.

Here's a log of using this plugin with scala-parser-combinators, it works correctly. MiMa would have caught scala/scala-parser-combinators#119 before the release of 1.0.6.

> show mimaPreviousClassfiles
[info] scala-parser-combinatorsJS/*:mimaPreviousClassfiles
[info] 	Map(org.scala-lang.modules:scala-parser-combinators_sjs0.6_2.12:1.0.5 -> /Users/luc/.ivy2/cache/org.scala-lang.modules/scala-parser-combinators_sjs0.6_2.12/jars/scala-parser-combinators_sjs0.6_2.12-1.0.5.jar)

[info] scala-parser-combinatorsJVM/*:mimaPreviousClassfiles
[info] 	Map(org.scala-lang.modules:scala-parser-combinators_2.12:1.0.5 -> /Users/luc/.ivy2/cache/org.scala-lang.modules/scala-parser-combinators_2.12/bundles/scala-parser-combinators_2.12-1.0.5.jar)

> scala-parser-combinatorsJS/mimaReportBinaryIssues
[info] scala-parser-combinators: found 0 potential binary incompatibilities while checking against org.scala-lang.modules:scala-parser-combinators_sjs0.6_2.12:1

> scala-parser-combinatorsJVM/mimaReportBinaryIssues
[info] scala-parser-combinators: found 0 potential binary incompatibilities while checking against org.scala-lang.modules:scala-parser-combinators_2.12:1.0.5

> set every mimaCheckDirection := "forward"

> scala-parser-combinatorsJS/mimaReportBinaryIssues
[info] scala-parser-combinators: found 2 potential binary incompatibilities while checking against org.scala-lang.modules:scala-parser-combinators_sjs0.6_2.12:1.0.5
[error]  * class scala.util.parsing.json.package does not have a correspondent in other version
[error]    filter with: ProblemFilters.exclude[MissingClassProblem]("scala.util.parsing.json.package")
[error]  * object scala.util.parsing.json.package does not have a correspondent in other version
[error]    filter with: ProblemFilters.exclude[MissingClassProblem]("scala.util.parsing.json.package$")

> scala-parser-combinatorsJVM/mimaReportBinaryIssues
[info] scala-parser-combinators: found 2 potential binary incompatibilities while checking against org.scala-lang.modules:scala-parser-combinators_2.12:1.0.5
[error]  * class scala.util.parsing.json.package does not have a correspondent in other version
[error]    filter with: ProblemFilters.exclude[MissingClassProblem]("scala.util.parsing.json.package")
[error]  * object scala.util.parsing.json.package does not have a correspondent in other version
[error]    filter with: ProblemFilters.exclude[MissingClassProblem]("scala.util.parsing.json.package$")


// correct: package object `json` was added between 1.0.5 and 1.0.6
// https://github.com/scala/scala-parser-combinators/commit/7815fd9abbe7b26c3bdd7772249c3e070175976e


> set every ScalaModulePlugin.mimaPreviousVersion := Some("1.0.6")

// ok, the current master is forward-compatible with 1.0.6
> scala-parser-combinatorsJVM/mimaReportBinaryIssues
[info] scala-parser-combinators: found 0 potential binary incompatibilities while checking against org.scala-lang.modules:scala-parser-combinators_2.12:1.0.6


// ok, all the stuff that's missing the sjs-1.0.6 jar shows as errors
> scala-parser-combinatorsJS/mimaReportBinaryIssues
[info] scala-parser-combinators: found 77 potential binary incompatibilities while checking against org.scala-lang.modules:scala-parser-combinators_sjs0.6_2.12:1.0.6
[error]  * object scala.util.parsing.input.StreamReader does not have a correspondent in other version
[error]    filter with: ProblemFilters.exclude[MissingClassProblem]("scala.util.parsing.input.StreamReader$")
[error]  * object scala.util.parsing.input.CharArrayReader does not have a correspondent in other version
[error]    filter with: ProblemFilters.exclude[MissingClassProblem]("scala.util.parsing.input.CharArrayReader$")
...
[error] (scala-parser-combinatorsJS/*:mimaReportBinaryIssues) scala-parser-combinators: Binary compatibility check failed!


{
import org.scalajs.sbtplugin.ScalaJSPlugin.autoImport._
mimaPreviousArtifacts := Set(organization.value %%% s"${moduleName.value}" % mimaPreviousVersion.value.getOrElse("dummy"))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you should be able to use the following, which won't require the dependency on sbt-scalajs:

mimaPreviousArtifacts := Set(organization.value % moduleName.value % mimaPreviousVersion.value.getOrElse("dummy") cross crossVersion.value)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, I'll try that!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works! I pushed that change.

Moves the `mimaSettings` back into `scalaModuleSettings`, which are added
to both JVM and JS projects of modules that cross-build with Scala.js.
Copy link
Member

@sjrd sjrd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice :)

@lrytz lrytz merged commit f2ac283 into scala:master Jul 11, 2017
@lrytz
Copy link
Member Author

lrytz commented Jul 11, 2017

Will release 1.0.11 now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants