Skip to content

Commit

Permalink
Add ScalafixProject#in
Browse files Browse the repository at this point in the history
  • Loading branch information
armanbilge committed Nov 24, 2023
1 parent 128e077 commit 6f61ef7
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions scalafix/src/main/scala/org/typelevel/sbt/ScalafixProject.scala
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,16 @@ final class ScalafixProject private (

lazy val componentProjects = Seq(all, rules, input, output, tests)

lazy val all = Project(name, file(s"target/$name-aggregate"))
def in(dir: File): ScalafixProject =
new ScalafixProject(
name,
rules.in(dir / "rules"),
input.in(dir / "input"),
output.in(dir / "output"),
tests.in(dir / "tests")
)

lazy val all = Project(name, file(s"$name-aggregate"))
.aggregate(rules, input, output, tests)
.enablePlugins(NoPublishPlugin)

Expand Down Expand Up @@ -89,7 +98,7 @@ final class ScalafixProject private (
object ScalafixProject {
def apply(name: String): ScalafixProject = {

lazy val rules = Project(s"$name-rules", file(s"modules/$name/rules")).settings(
lazy val rules = Project(s"$name-rules", file(s"$name/rules")).settings(
libraryDependencies += "ch.epfl.scala" %% "scalafix-core" % _root_
.scalafix
.sbt
Expand All @@ -98,12 +107,12 @@ object ScalafixProject {
)

lazy val input =
Project(s"$name-input", file(s"modules/$name/input")).enablePlugins(NoPublishPlugin)
Project(s"$name-input", file(s"$name/input")).enablePlugins(NoPublishPlugin)

lazy val output =
Project(s"$name-output", file(s"modules/$name/output")).enablePlugins(NoPublishPlugin)
Project(s"$name-output", file(s"$name/output")).enablePlugins(NoPublishPlugin)

lazy val tests = Project(s"$name-tests", file(s"modules/$name/tests"))
lazy val tests = Project(s"$name-tests", file(s"$name/tests"))
.settings(
scalafixTestkitOutputSourceDirectories := (output / Compile / unmanagedSourceDirectories).value,
scalafixTestkitInputSourceDirectories := (input / Compile / unmanagedSourceDirectories).value,
Expand Down

0 comments on commit 6f61ef7

Please sign in to comment.