@@ -46,16 +46,6 @@ lazy val commonSettings = Seq(
4646 },
4747)
4848
49- lazy val fnGen = (project in file(" fnGen" ))
50- .settings(commonSettings)
51- .settings(
52- crossScalaVersions := Seq (" 2.12.15" ),
53- scalaVersion := crossScalaVersions.value.head,
54- run / fork := true , // Needed if you run this project directly
55- libraryDependencies += " org.scala-lang" % " scala-reflect" % scalaVersion.value,
56- libraryDependencies += " org.scala-lang" % " scala-compiler" % scalaVersion.value
57- )
58-
5949lazy val scalaJava8Compat = (project in file(" ." ))
6050 .settings(ScalaModulePlugin .scalaModuleSettings)
6151 .settings(ScalaModulePlugin .scalaModuleOsgiSettings)
@@ -65,8 +55,6 @@ lazy val scalaJava8Compat = (project in file("."))
6555 scalaModuleAutomaticModuleName := Some (" scala.compat.java8" ),
6656 )
6757 .settings(
68- fork := true , // This must be set so that runner task is forked when it runs fnGen and the compiler gets a proper classpath
69-
7058 OsgiKeys .exportPackage := osgiExport(scalaVersion.value, version.value),
7159
7260 OsgiKeys .privatePackage := List (" scala.concurrent.java8.*" ),
@@ -77,30 +65,19 @@ lazy val scalaJava8Compat = (project in file("."))
7765
7866 libraryDependencies += " com.github.sbt" % " junit-interface" % " 0.13.2" % " test" ,
7967
80- mimaBinaryIssueFilters ++= {
81- import com .typesafe .tools .mima .core ._ , ProblemFilters ._
82- Seq (
83- // bah
84- exclude[IncompatibleSignatureProblem ](" *" ),
85- // mysterious -- see scala/scala-java8-compat#211
86- exclude[DirectMissingMethodProblem ](" scala.compat.java8.Priority1FunctionConverters.enrichAsJavaIntFunction" ),
87- exclude[ReversedMissingMethodProblem ](" scala.compat.java8.Priority1FunctionConverters.enrichAsJavaIntFunction" ),
88- exclude[DirectMissingMethodProblem ](" scala.compat.java8.FunctionConverters.package.enrichAsJavaIntFunction" ),
89- exclude[ReversedMissingMethodProblem ](" scala.compat.java8.FunctionConverters.package.enrichAsJavaIntFunction" ),
90- )
68+ // see https://github.com/scala/scala-java8-compat/issues/247
69+ versionPolicyPreviousVersions := versionPolicyPreviousVersions.value.flatMap {
70+ case VersionNumber (Seq (0 , _* ), _, _) => Nil
71+ case VersionNumber (Seq (1 , 0 , n, _* ), _, _) if n <= 1 => Nil
72+ case v => Seq (v)
9173 },
9274
9375 testOptions += Tests .Argument (TestFrameworks .JUnit , " -v" , " -a" ),
9476
9577 (Compile / sourceGenerators) += Def .task {
96- val out = (Compile / sourceManaged).value
97- if (! out.exists) IO .createDirectory(out)
98- val canon = out.getCanonicalPath
99- val args = (new File (canon, " FunctionConverters.scala" )).toString :: Nil
100- val runTarget = (fnGen / Compile / mainClass).value getOrElse " No main class defined for function conversion generator"
101- val classPath = (fnGen / Compile / fullClasspath).value
102- runner.value.run(runTarget, classPath.files, args, streams.value.log)
103- (out ** " *.scala" ).get
78+ val f = (Compile / sourceManaged).value / " FunctionConverters.scala"
79+ IO .write(f, WrapFnGen .code)
80+ Seq (f)
10481 }.taskValue,
10582
10683 Compile / sourceGenerators += Def .task {
0 commit comments