Skip to content

Commit 3375e8e

Browse files
committed
sbt build cleanup: use slash syntax
1 parent 05ca073 commit 3375e8e

File tree

1 file changed

+20
-20
lines changed

1 file changed

+20
-20
lines changed

build.sbt

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ ThisBuild / versionPolicyIntention := Compatibility.BinaryAndSourceCompatible
2424
lazy val commonSettings = Seq(
2525
scalacOptions ++= Seq("-feature", "-deprecation", "-unchecked"),
2626

27-
unmanagedSourceDirectories in Compile ++= {
28-
(unmanagedSourceDirectories in Compile).value.flatMap { dir =>
27+
Compile / unmanagedSourceDirectories ++= {
28+
(Compile / unmanagedSourceDirectories).value.flatMap { dir =>
2929
CrossVersion.partialVersion(scalaVersion.value) match {
3030
case Some((2, 13)) => Seq(file(dir.getPath ++ "-2.13+"))
3131
case Some((2, 11)) => Seq(file(dir.getPath ++ "-2.13-"), file(dir.getPath ++ "-2.11"))
@@ -34,8 +34,8 @@ lazy val commonSettings = Seq(
3434
}
3535
},
3636

37-
unmanagedSourceDirectories in Test ++= {
38-
(unmanagedSourceDirectories in Test).value.flatMap { dir =>
37+
Test / unmanagedSourceDirectories ++= {
38+
(Test / unmanagedSourceDirectories).value.flatMap { dir =>
3939
CrossVersion.partialVersion(scalaVersion.value) match {
4040
case Some((2, 13)) => Seq(file(dir.getPath ++ "-2.13+"))
4141
case Some((2, 11)) => Seq(file(dir.getPath ++ "-2.13-"), file(dir.getPath ++ "-2.11"))
@@ -48,7 +48,7 @@ lazy val commonSettings = Seq(
4848
lazy val fnGen = (project in file("fnGen"))
4949
.settings(commonSettings)
5050
.settings(
51-
fork in run := true, // Needed if you run this project directly
51+
run / fork := true, // Needed if you run this project directly
5252
libraryDependencies += "org.scala-lang" % "scala-reflect" % scalaVersion.value,
5353
libraryDependencies += "org.scala-lang" % "scala-compiler" % scalaVersion.value
5454
)
@@ -93,19 +93,19 @@ lazy val scalaJava8Compat = (project in file("."))
9393

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

96-
(sourceGenerators in Compile) += Def.task {
97-
val out = (sourceManaged in Compile).value
96+
(Compile / sourceGenerators) += Def.task {
97+
val out = (Compile / sourceManaged).value
9898
if (!out.exists) IO.createDirectory(out)
9999
val canon = out.getCanonicalPath
100100
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
103103
runner.value.run(runTarget, classPath.files, args, streams.value.log)
104104
(out ** "*.scala").get
105105
}.taskValue,
106106

107-
sourceGenerators in Compile += Def.task {
108-
val dir = (sourceManaged in Compile).value
107+
Compile / sourceGenerators += Def.task {
108+
val dir = (Compile / sourceManaged).value
109109
val write = jwrite(dir) _
110110
if(scalaVersion.value.startsWith("2.11.")) {
111111
Seq(write("JFunction", CodeGen.factory)) ++
@@ -118,8 +118,8 @@ lazy val scalaJava8Compat = (project in file("."))
118118
} else CodeGen.create212.map(write.tupled)
119119
}.taskValue,
120120

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))
123123
}.taskValue,
124124

125125
initialize := {
@@ -131,23 +131,23 @@ lazy val scalaJava8Compat = (project in file("."))
131131
sys.error("Java 8 or higher is required for this project.")
132132
},
133133

134-
publishArtifact in packageDoc := !disableDocs
134+
packageDoc / publishArtifact := !disableDocs
135135
)
136136
.settings(
137137
inConfig(JavaDoc)(Defaults.configSettings) ++ {
138138
if (disableDocs) Nil
139139
else Seq(
140-
packageDoc in Compile := (packageDoc in JavaDoc).value,
141-
sources in JavaDoc := {
140+
Compile / packageDoc := (JavaDoc / packageDoc).value,
141+
JavaDoc / sources := {
142142
val allJavaSources =
143143
(target.value / "java" ** "*.java").get ++
144-
(sources in Compile).value.filter(_.getName.endsWith(".java"))
144+
(Compile / sources).value.filter(_.getName.endsWith(".java"))
145145
allJavaSources.filterNot(_.getName.contains("FuturesConvertersImpl.java")) // this file triggers bugs in genjavadoc
146146
},
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"),
149149
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")
151151
)
152152
}
153153
)

0 commit comments

Comments
 (0)