Skip to content
This repository was archived by the owner on Jun 23, 2020. It is now read-only.

Commit 9874e06

Browse files
committed
Adjust build.sbt to be dbuild-friendly
1 parent 7995a5b commit 9874e06

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

build.sbt

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,19 @@ lazy val commonSettings = scalaModuleSettings ++ Seq(
2222
scalacOptions ++= Seq(
2323
"-deprecation",
2424
"-feature")
25-
)
25+
) ++ crossVersionSharedSources
26+
27+
lazy val crossVersionSharedSources: Seq[Setting[_]] =
28+
Seq(Compile, Test).map { sc =>
29+
(unmanagedSourceDirectories in sc) ++= {
30+
(unmanagedSourceDirectories in sc ).value.map { dir: File =>
31+
CrossVersion.partialVersion(scalaVersion.value) match {
32+
case Some((2, y)) if y == 11 => new File(dir.getPath + "-2.11")
33+
case Some((2, y)) if y == 12 => new File(dir.getPath + "-2.12")
34+
}
35+
}
36+
}
37+
}
2638

2739
lazy val root = project.in( file(".") ).settings( publishArtifact := false ).aggregate(plugin, library).settings(commonSettings : _*)
2840

0 commit comments

Comments
 (0)