Skip to content

Commit

Permalink
Generate boilerplate in shared sources
Browse files Browse the repository at this point in the history
to a place that works for Intellij
  • Loading branch information
joroKr21 committed Sep 17, 2022
1 parent 2e0d307 commit c7ff1de
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
.metals
project/boot
target
**/src/*/managed
.ensime
.ensime_lucene
.ensime_cache
Expand Down
6 changes: 6 additions & 0 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,9 @@ lazy val testingDependencies = Seq(
)
)

lazy val sharedSourceManaged =
Compile / sourceManaged := baseDirectory.value.getParentFile / "src" / "main" / "managed"

lazy val root = tlCrossRootProject
.aggregate(
kernel,
Expand All @@ -109,6 +112,7 @@ lazy val kernel = crossProject(JSPlatform, JVMPlatform, NativePlatform)
.in(file("kernel"))
.settings(moduleName := "cats-kernel", name := "Cats kernel")
.settings(testingDependencies)
.settings(sharedSourceManaged)
.settings(Compile / sourceGenerators += (Compile / sourceManaged).map(KernelBoiler.gen).taskValue)
.jsSettings(commonJsSettings)
.jvmSettings(commonJvmSettings, cats1BincompatSettings)
Expand Down Expand Up @@ -139,6 +143,7 @@ lazy val algebra = crossProject(JSPlatform, JVMPlatform, NativePlatform)
.in(file("algebra-core"))
.dependsOn(kernel)
.settings(moduleName := "algebra", name := "Cats algebra")
.settings(sharedSourceManaged)
.settings(Compile / sourceGenerators += (Compile / sourceManaged).map(AlgebraBoilerplate.gen).taskValue)
.jsSettings(commonJsSettings)
.jvmSettings(commonJvmSettings)
Expand Down Expand Up @@ -167,6 +172,7 @@ lazy val core = crossProject(JSPlatform, JVMPlatform, NativePlatform)
.dependsOn(kernel)
.settings(moduleName := "cats-core", name := "Cats core")
.settings(macroSettings)
.settings(sharedSourceManaged)
.settings(Compile / sourceGenerators += (Compile / sourceManaged).map(Boilerplate.gen).taskValue)
.settings(
libraryDependencies += "org.scalacheck" %%% "scalacheck" % scalaCheckVersion % Test,
Expand Down

0 comments on commit c7ff1de

Please sign in to comment.