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

Fix #247 ensure binary compatibility from now #248

Merged
merged 4 commits into from
Oct 28, 2021
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
39 changes: 8 additions & 31 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -46,16 +46,6 @@ lazy val commonSettings = Seq(
},
)

lazy val fnGen = (project in file("fnGen"))
.settings(commonSettings)
.settings(
crossScalaVersions := Seq("2.12.15"),
scalaVersion := crossScalaVersions.value.head,
run / fork := true, // Needed if you run this project directly
libraryDependencies += "org.scala-lang" % "scala-reflect" % scalaVersion.value,
libraryDependencies += "org.scala-lang" % "scala-compiler" % scalaVersion.value
)

lazy val scalaJava8Compat = (project in file("."))
.settings(ScalaModulePlugin.scalaModuleSettings)
.settings(ScalaModulePlugin.scalaModuleOsgiSettings)
Expand All @@ -65,8 +55,6 @@ lazy val scalaJava8Compat = (project in file("."))
scalaModuleAutomaticModuleName := Some("scala.compat.java8"),
)
.settings(
fork := true, // This must be set so that runner task is forked when it runs fnGen and the compiler gets a proper classpath

OsgiKeys.exportPackage := osgiExport(scalaVersion.value, version.value),

OsgiKeys.privatePackage := List("scala.concurrent.java8.*"),
Expand All @@ -77,30 +65,19 @@ lazy val scalaJava8Compat = (project in file("."))

libraryDependencies += "com.novocode" % "junit-interface" % "0.11" % "test",

mimaBinaryIssueFilters ++= {
import com.typesafe.tools.mima.core._, ProblemFilters._
Seq(
// bah
exclude[IncompatibleSignatureProblem]("*"),
// mysterious -- see scala/scala-java8-compat#211
exclude[DirectMissingMethodProblem ]("scala.compat.java8.Priority1FunctionConverters.enrichAsJavaIntFunction"),
exclude[ReversedMissingMethodProblem]("scala.compat.java8.Priority1FunctionConverters.enrichAsJavaIntFunction"),
exclude[DirectMissingMethodProblem ]("scala.compat.java8.FunctionConverters.package.enrichAsJavaIntFunction" ),
exclude[ReversedMissingMethodProblem]("scala.compat.java8.FunctionConverters.package.enrichAsJavaIntFunction" ),
)
// see https://github.com/scala/scala-java8-compat/issues/247
versionPolicyPreviousVersions := versionPolicyPreviousVersions.value.flatMap {
case VersionNumber(Seq(0, _*), _, _) => Nil
case VersionNumber(Seq(1, 0, n, _*), _, _) if n <= 1 => Nil
case v => Seq(v)
},

testOptions += Tests.Argument(TestFrameworks.JUnit, "-v", "-a"),

(Compile / sourceGenerators) += Def.task {
val out = (Compile / sourceManaged).value
if (!out.exists) IO.createDirectory(out)
val canon = out.getCanonicalPath
val args = (new File(canon, "FunctionConverters.scala")).toString :: Nil
val runTarget = (fnGen / Compile / mainClass).value getOrElse "No main class defined for function conversion generator"
val classPath = (fnGen / Compile / fullClasspath).value
runner.value.run(runTarget, classPath.files, args, streams.value.log)
(out ** "*.scala").get
val f = (Compile / sourceManaged).value / "FunctionConverters.scala"
IO.write(f, WrapFnGen.code)
Seq(f)
}.taskValue,

Compile / sourceGenerators += Def.task {
Expand Down
314 changes: 0 additions & 314 deletions fnGen/WrapFnGen.scala

This file was deleted.

Loading