aboutsummaryrefslogtreecommitdiff
path: root/src/main/scala/xyz.driver.sbt/SbtSettings.scala
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/scala/xyz.driver.sbt/SbtSettings.scala')
-rw-r--r--src/main/scala/xyz.driver.sbt/SbtSettings.scala34
1 files changed, 29 insertions, 5 deletions
diff --git a/src/main/scala/xyz.driver.sbt/SbtSettings.scala b/src/main/scala/xyz.driver.sbt/SbtSettings.scala
index b500d4a..c98bb4c 100644
--- a/src/main/scala/xyz.driver.sbt/SbtSettings.scala
+++ b/src/main/scala/xyz.driver.sbt/SbtSettings.scala
@@ -39,20 +39,44 @@ object SbtSettings extends AutoPlugin {
}
Seq(
+ scalafmtVersion := "1.3.0",
resourceGenerators in Compile += generateScalafmtConfTask.taskValue,
+ // it:scalafmt -> runs scalafmt in src/it
+ scalafmt in IntegrationTest := {
+ // Explicit dependency to generating .scalafmt.conf file, otherwise there is no guarantee on execution order
+ (scalafmt in IntegrationTest).dependsOn(generateScalafmtConfTask).value
+ },
+ // test:scalafmt -> runs scalafmt in src/test + src/it
+ scalafmt in Test := {
+ // By transitive dependency Test depends on generateScalafmtConfTask. No need to explicitly add it here.
+ (scalafmt in Test).dependsOn(scalafmt in IntegrationTest).value
+ },
+ // scalafmt -> runs scalafmt in src/main + src/test + src/it
scalafmt in Compile := {
- generateScalafmtConfTask.value
- (scalafmt in Compile).value
+ // By transitive dependency Compile depends on generateScalafmtConfTask. No need to explicitly add it here.
+ (scalafmt in Compile).dependsOn(scalafmt in Test).value
+ },
+ // it:scalafmt::test -> tests scalafmt format in src/it
+ test in scalafmt in IntegrationTest := {
+ // Explicit dependency to generating .scalafmt.conf file, otherwise there is no guarantee on execution order
+ (test in scalafmt in IntegrationTest).dependsOn(generateScalafmtConfTask).value
+ },
+ // test:scalafmt::test -> tests scalafmt format in src/test + src/it
+ test in scalafmt in Test := {
+ // By transitive dependency Test depends on generateScalafmtConfTask. No need to explicitly add it here.
+ (test in scalafmt in Test).dependsOn(test in scalafmt in IntegrationTest).value
},
+ // scalafmt::test -> tests scalafmt format in src/main + src/test (added behavior)
test in scalafmt in Compile := {
- generateScalafmtConfTask.value
- (test in scalafmt in Compile).value
+ // By transitive dependency Compile depends on generateScalafmtConfTask. No need to explicitly add it here.
+ (test in scalafmt in Compile).dependsOn(test in scalafmt in Test).value
+
},
test in Test := {
(test in scalafmt in Compile).value
(test in Test).value
}
- )
+ ) ++ inConfig(IntegrationTest)(scalafmtSettings)
}
lazy val testScalastyle = taskKey[Unit]("testScalastyle")