1- import ScalaModulePlugin ._
2-
3- crossScalaVersions in ThisBuild := List (" 2.13.0" , " 2.12.8" , " 2.11.12" )
4-
51val disableDocs =
62 sys.props(" nodocs" ) == " true" ||
7- // can't build doc on JDK 11 until sbt/sbt#4350 is fixed
3+ // on jdk 11 https://github.com/scala/scala-java8-compat/issues/160, seems to fail the build (not on 8)
84 ! sys.props(" java.version" ).startsWith(" 1." )
95
106lazy val JavaDoc = config(" genjavadoc" ) extend Compile
@@ -23,9 +19,6 @@ def osgiExport(scalaVersion: String, version: String) = {
2319}
2420
2521lazy val commonSettings = Seq (
26- organization := " org.scala-lang.modules" ,
27- version := " 0.9.1-SNAPSHOT" ,
28-
2922 scalacOptions ++= Seq (" -feature" , " -deprecation" , " -unchecked" ),
3023
3124 unmanagedSourceDirectories in Compile ++= {
@@ -49,21 +42,22 @@ lazy val commonSettings = Seq(
4942 },
5043)
5144
52- lazy val fnGen = (project in file(" fnGen" )).
53- settings(commonSettings : _* ).
54- settings(
45+ lazy val fnGen = (project in file(" fnGen" ))
46+ . settings(commonSettings)
47+ . settings(
5548 fork in run := true , // Needed if you run this project directly
5649 libraryDependencies += " org.scala-lang" % " scala-reflect" % scalaVersion.value,
5750 libraryDependencies += " org.scala-lang" % " scala-compiler" % scalaVersion.value
5851 )
5952
60- lazy val root = (project in file(" ." )).
61- settings(scalaModuleSettings : _* ).
62- settings(commonSettings : _* ).
63- settings(
53+ lazy val scalaJava8Compat = (project in file(" ." ))
54+ .settings(ScalaModulePlugin .scalaModuleSettings)
55+ .settings(ScalaModulePlugin .scalaModuleSettingsJVM)
56+ .settings(commonSettings)
57+ .settings(
6458 name := " scala-java8-compat"
65- ).
66- settings(
59+ )
60+ . settings(
6761 fork := true , // This must be set so that runner task is forked when it runs fnGen and the compiler gets a proper classpath
6862
6963 OsgiKeys .exportPackage := osgiExport(scalaVersion.value, version.value),
@@ -76,7 +70,7 @@ lazy val root = (project in file(".")).
7670
7771 libraryDependencies += " com.novocode" % " junit-interface" % " 0.11" % " test" ,
7872
79- mimaPreviousVersion := None ,
73+ scalaModuleMimaPreviousVersion := None ,
8074
8175 testOptions += Tests .Argument (TestFrameworks .JUnit , " -v" , " -a" ),
8276
@@ -119,23 +113,26 @@ lazy val root = (project in file(".")).
119113 },
120114
121115 publishArtifact in packageDoc := ! disableDocs
122- ).
123- settings(
124- (inConfig(JavaDoc )(Defaults .configSettings) ++ (if (disableDocs) Nil else Seq (
125- packageDoc in Compile := (packageDoc in JavaDoc ).value,
126- sources in JavaDoc := {
127- val allJavaSources =
128- (target.value / " java" ** " *.java" ).get ++
129- (sources in Compile ).value.filter(_.getName.endsWith(" .java" ))
130- allJavaSources.filterNot(_.getName.contains(" FuturesConvertersImpl.java" )) // this file triggers bugs in genjavadoc
131- },
132- javacOptions in JavaDoc := Seq (),
133- artifactName in packageDoc in JavaDoc := ((sv, mod, art) => " " + mod.name + " _" + sv.binary + " -" + mod.revision + " -javadoc.jar" ),
134- libraryDependencies += compilerPlugin(" com.typesafe.genjavadoc" % " genjavadoc-plugin" % " 0.14" cross CrossVersion .full),
135- scalacOptions in Compile += " -P:genjavadoc:out=" + (target.value / " java" )
136- ))): _*
137- ).
138- settings(
116+ )
117+ .settings(
118+ inConfig(JavaDoc )(Defaults .configSettings) ++ {
119+ if (disableDocs) Nil
120+ else Seq (
121+ packageDoc in Compile := (packageDoc in JavaDoc ).value,
122+ sources in JavaDoc := {
123+ val allJavaSources =
124+ (target.value / " java" ** " *.java" ).get ++
125+ (sources in Compile ).value.filter(_.getName.endsWith(" .java" ))
126+ allJavaSources.filterNot(_.getName.contains(" FuturesConvertersImpl.java" )) // this file triggers bugs in genjavadoc
127+ },
128+ javacOptions in JavaDoc := Seq (),
129+ artifactName in packageDoc in JavaDoc := ((sv, mod, art) => " " + mod.name + " _" + sv.binary + " -" + mod.revision + " -javadoc.jar" ),
130+ libraryDependencies += compilerPlugin(" com.typesafe.genjavadoc" % " genjavadoc-plugin" % " 0.14" cross CrossVersion .full),
131+ scalacOptions in Compile += " -P:genjavadoc:out=" + (target.value / " java" )
132+ )
133+ }
134+ )
135+ .settings(
139136 initialCommands :=
140137 """ |import scala.concurrent._
141138 |import ExecutionContext.Implicits.global
0 commit comments