From 70447ebbaac0093e07c42eb537ea6a5f84c84bb1 Mon Sep 17 00:00:00 2001 From: kxbmap Date: Sun, 3 Apr 2016 05:56:58 +0900 Subject: [PATCH] Update sbt-checkstyle-plugin version to 3.0.0 --- config/build.sbt | 16 +++++----------- project/Build.scala | 5 ++++- project/plugins.sbt | 2 +- 3 files changed, 10 insertions(+), 13 deletions(-) diff --git a/config/build.sbt b/config/build.sbt index bbad3247..1b467428 100644 --- a/config/build.sbt +++ b/config/build.sbt @@ -4,7 +4,6 @@ import de.johoop.jacoco4sbt.JacocoPlugin.jacoco import com.typesafe.sbt.SbtScalariform import com.typesafe.sbt.SbtScalariform.ScalariformKeys import scalariform.formatter.preferences._ -import com.etsy.sbt.Checkstyle._ SbtScalariform.scalariformSettings @@ -26,14 +25,12 @@ libraryDependencies += "com.novocode" % "junit-interface" % "0.11" % "test" externalResolvers += "Scala Tools Snapshots" at "http://scala-tools.org/repo-snapshots/" -checkstyleSettings +checkstyleConfigLocation := CheckstyleConfigLocation.File((baseDirectory.value / "checkstyle-config.xml").toString) -CheckstyleTasks.checkstyleConfig := baseDirectory.value / "checkstyle-config.xml" - -CheckstyleTasks.checkstyle in Compile := { +checkstyle in Compile := { val log = streams.value.log - (CheckstyleTasks.checkstyle in Compile).value - val resultFile = (target in Compile).value / "checkstyle-report.xml" + (checkstyle in Compile).value + val resultFile = (checkstyleOutputFile in Compile).value val results = scala.xml.XML.loadFile(resultFile) val errorFiles = results \\ "checkstyle" \\ "file" @@ -61,10 +58,7 @@ CheckstyleTasks.checkstyle in Compile := { } // add checkstyle as a dependency of doc -doc in Compile := { - (CheckstyleTasks.checkstyle in Compile).value - (doc in Compile).value -} +doc in Compile <<= (doc in Compile).dependsOn(checkstyle in Compile) findbugsSettings findbugsReportType := Some(ReportType.Html) diff --git a/project/Build.scala b/project/Build.scala index 2047bbdd..00d33767 100644 --- a/project/Build.scala +++ b/project/Build.scala @@ -1,5 +1,6 @@ import sbt._ import Keys._ +import com.etsy.sbt.checkstyle.CheckstylePlugin.autoImport._ import com.typesafe.sbt.osgi.SbtOsgi import com.typesafe.sbt.osgi.SbtOsgi.autoImport._ import com.typesafe.sbt.JavaVersionCheckPlugin.autoImport._ @@ -35,7 +36,9 @@ object ConfigBuild extends Build { Seq(aggregate in doc := false, doc := (doc in (configLib, Compile)).value, aggregate in packageDoc := false, - packageDoc := (packageDoc in (configLib, Compile)).value) + packageDoc := (packageDoc in (configLib, Compile)).value, + aggregate in checkstyle := false, + checkstyle := (checkstyle in (configLib, Compile)).value) lazy val root = Project(id = "root", base = file("."), diff --git a/project/plugins.sbt b/project/plugins.sbt index 564c3130..de21c2d7 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -4,7 +4,7 @@ addSbtPlugin("com.jsuereth" % "sbt-pgp" % "1.0.0") addSbtPlugin("com.typesafe.sbt" % "sbt-osgi" % "0.8.0") addSbtPlugin("com.typesafe.sbt" % "sbt-scalariform" % "1.2.1") -addSbtPlugin("com.etsy" % "sbt-checkstyle-plugin" % "0.4.1") +addSbtPlugin("com.etsy" % "sbt-checkstyle-plugin" % "3.0.0") addSbtPlugin("com.typesafe.sbt" % "sbt-git" % "0.8.5") addSbtPlugin("com.typesafe.sbt" % "sbt-javaversioncheck" % "0.1.0")