@@ -24,8 +24,8 @@ ThisBuild / versionPolicyIntention := Compatibility.BinaryAndSourceCompatible
24
24
lazy val commonSettings = Seq (
25
25
scalacOptions ++= Seq (" -feature" , " -deprecation" , " -unchecked" ),
26
26
27
- unmanagedSourceDirectories in Compile ++= {
28
- (unmanagedSourceDirectories in Compile ).value.flatMap { dir =>
27
+ Compile / unmanagedSourceDirectories ++= {
28
+ (Compile / unmanagedSourceDirectories ).value.flatMap { dir =>
29
29
CrossVersion .partialVersion(scalaVersion.value) match {
30
30
case Some ((2 , 13 )) => Seq (file(dir.getPath ++ " -2.13+" ))
31
31
case Some ((2 , 11 )) => Seq (file(dir.getPath ++ " -2.13-" ), file(dir.getPath ++ " -2.11" ))
@@ -34,8 +34,8 @@ lazy val commonSettings = Seq(
34
34
}
35
35
},
36
36
37
- unmanagedSourceDirectories in Test ++= {
38
- (unmanagedSourceDirectories in Test ).value.flatMap { dir =>
37
+ Test / unmanagedSourceDirectories ++= {
38
+ (Test / unmanagedSourceDirectories ).value.flatMap { dir =>
39
39
CrossVersion .partialVersion(scalaVersion.value) match {
40
40
case Some ((2 , 13 )) => Seq (file(dir.getPath ++ " -2.13+" ))
41
41
case Some ((2 , 11 )) => Seq (file(dir.getPath ++ " -2.13-" ), file(dir.getPath ++ " -2.11" ))
@@ -48,7 +48,7 @@ lazy val commonSettings = Seq(
48
48
lazy val fnGen = (project in file(" fnGen" ))
49
49
.settings(commonSettings)
50
50
.settings(
51
- fork in run := true , // Needed if you run this project directly
51
+ run / fork := true , // Needed if you run this project directly
52
52
libraryDependencies += " org.scala-lang" % " scala-reflect" % scalaVersion.value,
53
53
libraryDependencies += " org.scala-lang" % " scala-compiler" % scalaVersion.value
54
54
)
@@ -93,19 +93,19 @@ lazy val scalaJava8Compat = (project in file("."))
93
93
94
94
testOptions += Tests .Argument (TestFrameworks .JUnit , " -v" , " -a" ),
95
95
96
- (sourceGenerators in Compile ) += Def .task {
97
- val out = (sourceManaged in Compile ).value
96
+ (Compile / sourceGenerators ) += Def .task {
97
+ val out = (Compile / sourceManaged ).value
98
98
if (! out.exists) IO .createDirectory(out)
99
99
val canon = out.getCanonicalPath
100
100
val args = (new File (canon, " FunctionConverters.scala" )).toString :: Nil
101
- val runTarget = (mainClass in Compile in fnGen ).value getOrElse " No main class defined for function conversion generator"
102
- val classPath = (fullClasspath in Compile in fnGen ).value
101
+ val runTarget = (fnGen / Compile / mainClass ).value getOrElse " No main class defined for function conversion generator"
102
+ val classPath = (fnGen / Compile / fullClasspath ).value
103
103
runner.value.run(runTarget, classPath.files, args, streams.value.log)
104
104
(out ** " *.scala" ).get
105
105
}.taskValue,
106
106
107
- sourceGenerators in Compile += Def .task {
108
- val dir = (sourceManaged in Compile ).value
107
+ Compile / sourceGenerators += Def .task {
108
+ val dir = (Compile / sourceManaged ).value
109
109
val write = jwrite(dir) _
110
110
if (scalaVersion.value.startsWith(" 2.11." )) {
111
111
Seq (write(" JFunction" , CodeGen .factory)) ++
@@ -118,8 +118,8 @@ lazy val scalaJava8Compat = (project in file("."))
118
118
} else CodeGen .create212.map(write.tupled)
119
119
}.taskValue,
120
120
121
- sourceGenerators in Test += Def .task {
122
- Seq (jwrite((sourceManaged in Test ).value)(" TestApi" , CodeGen .testApi))
121
+ Test / sourceGenerators += Def .task {
122
+ Seq (jwrite((Test / sourceManaged ).value)(" TestApi" , CodeGen .testApi))
123
123
}.taskValue,
124
124
125
125
initialize := {
@@ -131,23 +131,23 @@ lazy val scalaJava8Compat = (project in file("."))
131
131
sys.error(" Java 8 or higher is required for this project." )
132
132
},
133
133
134
- publishArtifact in packageDoc := ! disableDocs
134
+ packageDoc / publishArtifact := ! disableDocs
135
135
)
136
136
.settings(
137
137
inConfig(JavaDoc )(Defaults .configSettings) ++ {
138
138
if (disableDocs) Nil
139
139
else Seq (
140
- packageDoc in Compile := (packageDoc in JavaDoc ).value,
141
- sources in JavaDoc := {
140
+ Compile / packageDoc := (JavaDoc / packageDoc ).value,
141
+ JavaDoc / sources := {
142
142
val allJavaSources =
143
143
(target.value / " java" ** " *.java" ).get ++
144
- (sources in Compile ).value.filter(_.getName.endsWith(" .java" ))
144
+ (Compile / sources ).value.filter(_.getName.endsWith(" .java" ))
145
145
allJavaSources.filterNot(_.getName.contains(" FuturesConvertersImpl.java" )) // this file triggers bugs in genjavadoc
146
146
},
147
- javacOptions in JavaDoc := Seq (" -Xdoclint:none" ),
148
- artifactName in packageDoc in JavaDoc := ((sv, mod, art) => " " + mod.name + " _" + sv.binary + " -" + mod.revision + " -javadoc.jar" ),
147
+ JavaDoc / javacOptions := Seq (" -Xdoclint:none" ),
148
+ JavaDoc / packageDoc / artifactName := ((sv, mod, art) => " " + mod.name + " _" + sv.binary + " -" + mod.revision + " -javadoc.jar" ),
149
149
libraryDependencies += compilerPlugin(" com.typesafe.genjavadoc" % " genjavadoc-plugin" % " 0.16" cross CrossVersion .full),
150
- scalacOptions in Compile += " -P:genjavadoc:out=" + (target.value / " java" )
150
+ Compile / scalacOptions += " -P:genjavadoc:out=" + (target.value / " java" )
151
151
)
152
152
}
153
153
)
0 commit comments