Skip to content

Commit

Permalink
adjust directory structure for generated code
Browse files Browse the repository at this point in the history
(cherry picked from commit 899bd8e)
  • Loading branch information
xuwei-k committed Nov 25, 2017
1 parent 90ea7bb commit 8eed4cc
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions project/build.scala
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,8 @@ object build {

private val SetScala211 = releaseStepCommand("++" + Scala211)

private[this] val buildInfoPackageName = "scalaz"

lazy val standardSettings: Seq[Sett] = Seq[Sett](
unmanagedSourceDirectories in Compile += {
val base = ScalazCrossType.shared(baseDirectory.value, "main").getParentFile
Expand All @@ -125,7 +127,14 @@ object build {
},
organization := "org.scalaz",
mappings in (Compile, packageSrc) ++= (managedSources in Compile).value.map{ f =>
(f, f.relativeTo((sourceManaged in Compile).value).get.getPath)
// https://github.com/sbt/sbt-buildinfo/blob/v0.7.0/src/main/scala/sbtbuildinfo/BuildInfoPlugin.scala#L58
val buildInfoDir = "sbt-buildinfo"
val path = if(f.getAbsolutePath.contains(buildInfoDir)) {
(file(buildInfoPackageName) / f.relativeTo((sourceManaged in Compile).value / buildInfoDir).get.getPath).getPath
} else {
f.relativeTo((sourceManaged in Compile).value).get.getPath
}
(f, path)
},
scalaVersion := Scala212,
crossScalaVersions := Seq("2.10.6", Scala211, Scala212, "2.13.0-M2"),
Expand Down Expand Up @@ -308,7 +317,7 @@ object build {
dir => Seq(GenerateTupleW(dir), TupleNInstances(dir))
}.taskValue,
buildInfoKeys := Seq[BuildInfoKey](version, scalaVersion),
buildInfoPackage := "scalaz",
buildInfoPackage := buildInfoPackageName,
osgiExport("scalaz"),
OsgiKeys.importPackage := Seq("javax.swing;resolution:=optional", "*"))
.enablePlugins(sbtbuildinfo.BuildInfoPlugin)
Expand Down

0 comments on commit 8eed4cc

Please sign in to comment.