Skip to content

Commit

Permalink
Merge pull request #672 from RustedBones/allow-custom-managed-src-dirs
Browse files Browse the repository at this point in the history
Allow packaging sources from all managed directories
  • Loading branch information
armanbilge committed Dec 13, 2023
2 parents 3d243b6 + a185397 commit 8ebcebc
Showing 1 changed file with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -338,19 +338,20 @@ object TypelevelSettingsPlugin extends AutoPlugin {
}
},
packageSrc / mappings ++= {
val base = sourceManaged.value
val bases = managedSourceDirectories.value
managedSources.value.map { file =>
file.relativeTo(base) match {
case Some(relative) => file -> relative.getPath
case None =>
bases
.map(b => file.relativeTo(b))
.collectFirst { case Some(relative) => file -> relative.getPath }
.getOrElse {
throw new RuntimeException(
s"""|Expected managed sources in:
|$base
|${bases.mkString("\n")}
|But found them here:
|$file
|""".stripMargin
)
}
}
}
}
)
Expand Down

0 comments on commit 8ebcebc

Please sign in to comment.