From 4053613c6896bbc35dd344ae373a07d47e0b086f Mon Sep 17 00:00:00 2001 From: Hariharan Ramanathan Date: Tue, 3 Jul 2018 12:41:30 +0200 Subject: [PATCH 1/3] Adding scalastyle to delphi webapi --- build.sbt | 8 +++ project/plugins.sbt | 2 +- scalastyle-config.xml | 117 ++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 126 insertions(+), 1 deletion(-) create mode 100644 scalastyle-config.xml diff --git a/build.sbt b/build.sbt index 9293e5f..ded010a 100644 --- a/build.sbt +++ b/build.sbt @@ -29,6 +29,7 @@ libraryDependencies ++= Seq( lazy val webapi = (project in file(".")). enablePlugins(JavaAppPackaging). enablePlugins(DockerPlugin). + enablePlugins(ScalastylePlugin). settings ( dockerBaseImage := "openjdk:jre-alpine" ). @@ -38,3 +39,10 @@ lazy val webapi = (project in file(".")). buildInfoKeys := Seq[BuildInfoKey](name, version, scalaVersion, sbtVersion), buildInfoPackage := "de.upb.cs.swt.delphi.webapi" ) + +lazy val scalastyleTask = taskKey[Unit]("scalastyleTask") +scalastyleTask :={ + scalastyle.in(Compile).toTask("").value + scalastyle.in(Test).toTask("").value +} +(test in Test) := ((test in Test) dependsOn scalastyleTask).value diff --git a/project/plugins.sbt b/project/plugins.sbt index 2dcfb83..8d08441 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -1,2 +1,2 @@ addSbtPlugin("com.typesafe.sbt" % "sbt-native-packager" % "1.3.2") - +addSbtPlugin("org.scalastyle" %% "scalastyle-sbt-plugin" % "1.0.0") diff --git a/scalastyle-config.xml b/scalastyle-config.xml new file mode 100644 index 0000000..7e3596f --- /dev/null +++ b/scalastyle-config.xml @@ -0,0 +1,117 @@ + + Scalastyle standard configuration + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file From a6c40301abcdf688b930893fc9d0eea7592e6ce1 Mon Sep 17 00:00:00 2001 From: Hariharan Ramanathan Date: Tue, 31 Jul 2018 13:49:01 +0200 Subject: [PATCH 2/3] Moved scala style config to project folder --- build.sbt | 2 ++ scalastyle-config.xml => project/scalastyle-config.xml | 0 2 files changed, 2 insertions(+) rename scalastyle-config.xml => project/scalastyle-config.xml (100%) diff --git a/build.sbt b/build.sbt index ded010a..cea1247 100644 --- a/build.sbt +++ b/build.sbt @@ -45,4 +45,6 @@ scalastyleTask :={ scalastyle.in(Compile).toTask("").value scalastyle.in(Test).toTask("").value } +(scalastyleConfig in Compile):=file("project/scalastyle-config.xml") +(scalastyleConfig in Test):=file("project/scalastyle-config.xml") (test in Test) := ((test in Test) dependsOn scalastyleTask).value diff --git a/scalastyle-config.xml b/project/scalastyle-config.xml similarity index 100% rename from scalastyle-config.xml rename to project/scalastyle-config.xml From 993e4a55f59aff6141050d6fe5f3c5fe5f4f90f2 Mon Sep 17 00:00:00 2001 From: Hariharan Ramanathan Date: Thu, 9 Aug 2018 14:40:40 +0200 Subject: [PATCH 3/3] Removing scalastyle from test target --- build.sbt | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/build.sbt b/build.sbt index cea1247..20beb15 100644 --- a/build.sbt +++ b/build.sbt @@ -39,12 +39,6 @@ lazy val webapi = (project in file(".")). buildInfoKeys := Seq[BuildInfoKey](name, version, scalaVersion, sbtVersion), buildInfoPackage := "de.upb.cs.swt.delphi.webapi" ) +scalastyleConfig := baseDirectory.value / "project" / "scalastyle-config.xml" + -lazy val scalastyleTask = taskKey[Unit]("scalastyleTask") -scalastyleTask :={ - scalastyle.in(Compile).toTask("").value - scalastyle.in(Test).toTask("").value -} -(scalastyleConfig in Compile):=file("project/scalastyle-config.xml") -(scalastyleConfig in Test):=file("project/scalastyle-config.xml") -(test in Test) := ((test in Test) dependsOn scalastyleTask).value