11import ScalaModulePlugin ._
22
33scalaVersionsByJvm in ThisBuild := Map (
4- 8 -> List (" 2.12.0 " , " 2.11.8 " , " 2.13.0-M1" ).map(_ -> true )
4+ 8 -> List (" 2.12.2 " , " 2.11.11 " , " 2.13.0-M1" ).map(_ -> true )
55)
66
77val disableDocs = sys.props(" nodocs" ) == " true"
@@ -23,7 +23,8 @@ def osgiExport(scalaVersion: String, version: String) = {
2323
2424lazy val commonSettings = Seq (
2525 organization := " org.scala-lang.modules" ,
26- version := " 0.9.0-SNAPSHOT"
26+ version := " 0.9.0-SNAPSHOT" ,
27+ scalacOptions ++= Seq (" -feature" , " -deprecation" , " -unchecked" )
2728)
2829
2930lazy val fnGen = (project in file(" fnGen" )).
@@ -68,9 +69,10 @@ lazy val root = (project in file(".")).
6869 (out ** " *.scala" ).get
6970 }.taskValue,
7071
71- sourceGenerators in Compile <+= (sourceManaged in Compile , scalaVersion) map { (dir, v) =>
72+ sourceGenerators in Compile += Def .task {
73+ val dir = (sourceManaged in Compile ).value
7274 val write = jwrite(dir) _
73- if (v .startsWith(" 2.11." )) {
75+ if (scalaVersion.value .startsWith(" 2.11." )) {
7476 Seq (write(" JFunction" , CodeGen .factory)) ++
7577 (0 to 22 ).map(n => write(" JFunction" + n, CodeGen .fN(n))) ++
7678 (0 to 22 ).map(n => write(" JProcedure" + n, CodeGen .pN(n))) ++
@@ -79,11 +81,11 @@ lazy val root = (project in file(".")).
7981 CodeGen .specializedF2.map(write.tupled) ++
8082 CodeGen .packageDummy.map((jwrite(dir, " java/runtime/java8" ) _).tupled)
8183 } else CodeGen .create212.map(write.tupled)
82- },
84+ }.taskValue ,
8385
84- sourceGenerators in Test < += sourceManaged in Test map { dir =>
85- Seq (jwrite(dir )(" TestApi" , CodeGen .testApi))
86- },
86+ sourceGenerators in Test += Def .task {
87+ Seq (jwrite((sourceManaged in Test ).value )(" TestApi" , CodeGen .testApi))
88+ }.taskValue ,
8789
8890 initialize := {
8991 // Run previously configured inialization...
@@ -103,14 +105,16 @@ lazy val root = (project in file(".")).
103105 ).
104106 settings(
105107 (inConfig(JavaDoc )(Defaults .configSettings) ++ (if (disableDocs) Nil else Seq (
106- packageDoc in Compile <<= packageDoc in JavaDoc ,
107- sources in JavaDoc <<= (target, compile in Compile , sources in Compile ) map {(t, c, s) =>
108- val allJavaSources = (t / " java" ** " *.java" ).get ++ s.filter(_.getName.endsWith(" .java" ))
108+ packageDoc in Compile := (packageDoc in JavaDoc ).value,
109+ sources in JavaDoc := {
110+ val allJavaSources =
111+ (target.value / " java" ** " *.java" ).get ++
112+ (sources in Compile ).value.filter(_.getName.endsWith(" .java" ))
109113 allJavaSources.filterNot(_.getName.contains(" FuturesConvertersImpl.java" )) // this file triggers bugs in genjavadoc
110114 },
111115 javacOptions in JavaDoc := Seq (),
112116 artifactName in packageDoc in JavaDoc := ((sv, mod, art) => " " + mod.name + " _" + sv.binary + " -" + mod.revision + " -javadoc.jar" ),
113- libraryDependencies += compilerPlugin(" com.typesafe.genjavadoc" % " genjavadoc-plugin" % " 0.10" cross CrossVersion .fullMapped { case " 2.12.0 " => " 2.12.0-RC1 " case x => x} ),
117+ libraryDependencies += compilerPlugin(" com.typesafe.genjavadoc" % " genjavadoc-plugin" % " 0.10" cross CrossVersion .full ),
114118 scalacOptions in Compile += " -P:genjavadoc:out=" + (target.value / " java" )
115119 ))): _*
116120 ).
0 commit comments