From 0b96865ed8183cb7e6f8ac6d184e941a26308df5 Mon Sep 17 00:00:00 2001 From: vlad Date: Tue, 19 Jul 2016 00:44:35 -0400 Subject: Scalastyle in compile --- project/Build.scala | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'project') diff --git a/project/Build.scala b/project/Build.scala index ebb24b4..c3ede93 100644 --- a/project/Build.scala +++ b/project/Build.scala @@ -1,6 +1,7 @@ import sbt._ import Keys._ import org.scalafmt.sbt.ScalaFmtPlugin.autoImport._ +import org.scalastyle.sbt.ScalastylePlugin._ import wartremover._ import wartremover.WartRemover.autoImport.wartremoverErrors @@ -13,6 +14,8 @@ object BuildSettings { Wart.Overloading, Wart.DefaultArguments, Wart.ToString, Wart.Any, Wart.Throw) ) + val compileScalastyle = taskKey[Unit]("compileScalastyle") + val buildSettings = Defaults.coreDefaultSettings ++ Seq ( organization := "com.drivergrp", name := "core", @@ -22,7 +25,9 @@ object BuildSettings { "-language:higherKinds", "-language:implicitConversions", "-language:postfixOps", "-Ywarn-infer-any", "-Ywarn-unused", "-Ywarn-unused-import"), scalafmtConfig := Some(file(".scalafmt")), - fork in run := true + fork in run := true, + compileScalastyle := (scalastyle in Compile).toTask("").value, + (compile in Compile) <<= ((compile in Compile) dependsOn compileScalastyle) ) ++ wartRemoverSettings ++ reformatOnCompileSettings } -- cgit v1.2.3