Skip to content

Commit

Permalink
Merge pull request #490 from gemini-hlsw/pr/workaround-sbt-i7173
Browse files Browse the repository at this point in the history
Try to workaround sbt/sbt#7173
  • Loading branch information
armanbilge committed Mar 27, 2023
2 parents 394bcb5 + 71545af commit bcfd836
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions sbt-plugin/src/main/scala/clue/sbt/CluePlugin.scala
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,20 @@ import ScalafixPlugin.autoImport._
object CluePlugin extends AutoPlugin {

object autoImport {
lazy val clueSourceDirectory = settingKey[File]("Clue input schemas and sources")
lazy val clueSourceDirectory = settingKey[File]("Clue input schemas and sources")
lazy val clueSourceGenerators = settingKey[Seq[Task[Seq[File]]]]("Clue source generators")
}
import autoImport._

override def buildSettings: Seq[Setting[_]] = Seq(
scalafixScalaBinaryVersion := "2.13",
scalafixDependencies += BuildInfo.organization %% BuildInfo.rulesModule % BuildInfo.version
scalafixDependencies += BuildInfo.organization %% BuildInfo.rulesModule % BuildInfo.version,
Compile / clueSourceGenerators := Seq.empty
)

override def projectSettings: Seq[Setting[_]] = Seq(
Compile / clueSourceDirectory := sourceDirectory.value / "clue",
Compile / clueSourceDirectory := sourceDirectory.value / "clue",
Compile / sourceGenerators ++= (Compile / clueSourceGenerators).value, // workaround for sbt/sbt#7173
libraryDependencies += BuildInfo.organization %%% BuildInfo.coreModule % BuildInfo.version
)

Expand All @@ -42,7 +45,7 @@ object CluePlugin extends AutoPlugin {
(LocalProject(proj.id) / Compile / dependencyClasspath).value,

// register generator
LocalProject(proj.id) / Compile / sourceGenerators += Def.taskDyn {
LocalProject(proj.id) / Compile / clueSourceGenerators += Def.taskDyn {
val root = (LocalRootProject / baseDirectory).value.toPath
val from = (Compile / clueSourceDirectory).value
val to = (LocalProject(proj.id) / Compile / sourceManaged).value
Expand Down

0 comments on commit bcfd836

Please sign in to comment.