From 00cec896bcc88796dd94f1d1b12b0040f3032bcd Mon Sep 17 00:00:00 2001 From: almacken Date: Wed, 30 May 2018 13:43:35 -0600 Subject: [PATCH 01/18] Added Retrieve Command Also refactored commands to use currying to prevent code duplication, as most Get requests should be relatively similar. --- .../de/upb/cs/swt/delphi/cli/Command.scala | 14 ------- .../de/upb/cs/swt/delphi/cli/Config.scala | 3 +- .../de/upb/cs/swt/delphi/cli/DelphiCLI.scala | 11 +++++- .../upb/cs/swt/delphi/cli/TestCommand.scala | 33 ---------------- .../cs/swt/delphi/cli/commands/Command.scala | 38 +++++++++++++++++++ .../delphi/cli/commands/RetrieveCommand.scala | 14 +++++++ .../swt/delphi/cli/commands/TestCommand.scala | 17 +++++++++ 7 files changed, 81 insertions(+), 49 deletions(-) delete mode 100644 src/main/scala/de/upb/cs/swt/delphi/cli/Command.scala delete mode 100644 src/main/scala/de/upb/cs/swt/delphi/cli/TestCommand.scala create mode 100644 src/main/scala/de/upb/cs/swt/delphi/cli/commands/Command.scala create mode 100644 src/main/scala/de/upb/cs/swt/delphi/cli/commands/RetrieveCommand.scala create mode 100644 src/main/scala/de/upb/cs/swt/delphi/cli/commands/TestCommand.scala diff --git a/src/main/scala/de/upb/cs/swt/delphi/cli/Command.scala b/src/main/scala/de/upb/cs/swt/delphi/cli/Command.scala deleted file mode 100644 index 1aad406..0000000 --- a/src/main/scala/de/upb/cs/swt/delphi/cli/Command.scala +++ /dev/null @@ -1,14 +0,0 @@ -package de.upb.cs.swt.delphi.cli - -/** - * Represents the implementation of a command of the CLI - */ -trait Command { - - /** - * Executes the command implementation - * @param config The current configuration for the command - */ - def execute(config: Config) : Unit - -} diff --git a/src/main/scala/de/upb/cs/swt/delphi/cli/Config.scala b/src/main/scala/de/upb/cs/swt/delphi/cli/Config.scala index cee645b..87e98ec 100644 --- a/src/main/scala/de/upb/cs/swt/delphi/cli/Config.scala +++ b/src/main/scala/de/upb/cs/swt/delphi/cli/Config.scala @@ -6,6 +6,7 @@ package de.upb.cs.swt.delphi.cli * @param verbose Marker if logging should be verbose * @param mode The command to be run */ -case class Config (server : String = sys.env.getOrElse("DELPHI_SERVER", "https://delphi.cs.uni-paderborn.de/api/"), verbose: Boolean = false, mode : String = "") { +case class Config (server : String = sys.env.getOrElse("DELPHI_SERVER", "https://delphi.cs.uni-paderborn.de/api/"), + verbose: Boolean = false, mode : String = "", args : List[String] = List(), opts : List[String] = List()) { } diff --git a/src/main/scala/de/upb/cs/swt/delphi/cli/DelphiCLI.scala b/src/main/scala/de/upb/cs/swt/delphi/cli/DelphiCLI.scala index c56e835..06f4fe9 100644 --- a/src/main/scala/de/upb/cs/swt/delphi/cli/DelphiCLI.scala +++ b/src/main/scala/de/upb/cs/swt/delphi/cli/DelphiCLI.scala @@ -1,5 +1,7 @@ package de.upb.cs.swt.delphi.cli +import de.upb.cs.swt.delphi.cli.commands.{RetrieveCommand, TestCommand} + /** * The application class for the Delphi command line interface @@ -20,8 +22,14 @@ object DelphiCLI extends App { checkConfig(c => if (c.server.isEmpty()) failure("Option server is required.") else success) cmd("test").action((_,c) => c.copy(mode = "test")) + + cmd("retrieve").action((s,c) => c.copy(mode = "retrieve")) + .text("Retrieve a project's description, specified by ID.") + .children( + arg[String]("ID").action((x, c) => c.copy(args = List(x))).text("The ID of the project to retrieve") + ) + //cmd("search") - //cmd("retrieve") } } @@ -31,6 +39,7 @@ object DelphiCLI extends App { cliParser.showHeader() config.mode match { case "test" => TestCommand.execute(config) + case "retrieve" => RetrieveCommand.execute(config) case _ => println("Unknown command") } diff --git a/src/main/scala/de/upb/cs/swt/delphi/cli/TestCommand.scala b/src/main/scala/de/upb/cs/swt/delphi/cli/TestCommand.scala deleted file mode 100644 index fb33739..0000000 --- a/src/main/scala/de/upb/cs/swt/delphi/cli/TestCommand.scala +++ /dev/null @@ -1,33 +0,0 @@ -package de.upb.cs.swt.delphi.cli - -import akka.actor.ActorSystem -import akka.http.scaladsl.Http -import akka.http.scaladsl.model.{HttpRequest, Uri} -import akka.stream.{ActorMaterializer, ActorMaterializerSettings} -import akka.util.ByteString - -import scala.util.{Failure, Success} - -/** - * The implementation of the test command. - * Tries to connect to the Delphi server and reports on the results of the version call. - */ -object TestCommand extends Command { - override def execute(config: Config): Unit = { - - val uri = Uri(config.server) - println(s"Contacting server ${uri}...") - val resp = BlockingHttpClient.doGet(uri.withPath(uri.path + "/version")) - - resp match { - case Success(res) => { - println("Successfully contacted Delphi server. ") - println("Server version: " + res) - } - case Failure(_) => { - println(s"Could not reach server ${config.server}.") - } - } - - } -} diff --git a/src/main/scala/de/upb/cs/swt/delphi/cli/commands/Command.scala b/src/main/scala/de/upb/cs/swt/delphi/cli/commands/Command.scala new file mode 100644 index 0000000..5d4b9a0 --- /dev/null +++ b/src/main/scala/de/upb/cs/swt/delphi/cli/commands/Command.scala @@ -0,0 +1,38 @@ +package de.upb.cs.swt.delphi.cli.commands + +import akka.http.scaladsl.model.Uri +import de.upb.cs.swt.delphi.cli.{BlockingHttpClient, Config} + +import scala.util.{Failure, Success} + +/** + * Represents the implementation of a command of the CLI + */ +trait Command { + + /** + * Executes the command implementation + * @param config The current configuration for the command + */ + def execute(config: Config): Unit + + /** + * Implements a common request type using currying to avoid code duplication + * @param target The endpoint to perform a Get request on + * @param onSuccess The function to perform on the response (eg. printing it) + * @param config The current configuration for the command + */ + protected def executeGet(target: String, onSuccess: String => Unit)(config: Config) : Unit = { + + val uri = Uri(config.server) + println(s"Contacting server ${uri}...") + val resp = BlockingHttpClient.doGet(uri.withPath(uri.path + target)) + + resp match { + case Success(res) => onSuccess(res) + case Failure(_) => println(s"Could not reach server ${config.server}.") + } + + } + +} diff --git a/src/main/scala/de/upb/cs/swt/delphi/cli/commands/RetrieveCommand.scala b/src/main/scala/de/upb/cs/swt/delphi/cli/commands/RetrieveCommand.scala new file mode 100644 index 0000000..8a4a8f8 --- /dev/null +++ b/src/main/scala/de/upb/cs/swt/delphi/cli/commands/RetrieveCommand.scala @@ -0,0 +1,14 @@ +package de.upb.cs.swt.delphi.cli.commands + +import de.upb.cs.swt.delphi.cli.Config + +/** + * The implementation of the retrieve command. + * Retrieves the contents of the file at the endpoint specified by the config file, and prints them to stdout + */ +object RetrieveCommand extends Command { + override def execute(config: Config): Unit = executeGet( + "/retrieve/" + config.args.head, + s => println(s) + )(config) +} diff --git a/src/main/scala/de/upb/cs/swt/delphi/cli/commands/TestCommand.scala b/src/main/scala/de/upb/cs/swt/delphi/cli/commands/TestCommand.scala new file mode 100644 index 0000000..705bf9d --- /dev/null +++ b/src/main/scala/de/upb/cs/swt/delphi/cli/commands/TestCommand.scala @@ -0,0 +1,17 @@ +package de.upb.cs.swt.delphi.cli.commands + +import de.upb.cs.swt.delphi.cli.Config + +/** + * The implementation of the test command. + * Tries to connect to the Delphi server and reports on the results of the version call. + */ +object TestCommand extends Command { + override def execute(config: Config): Unit = executeGet( + "/version", + s => { + println("Successfully contacted Delphi server. ") + println("Server version: " + s) + } + )(config) +} From 8696070a9b945041bd8fbe155962abf477314183 Mon Sep 17 00:00:00 2001 From: almacken Date: Wed, 30 May 2018 14:40:33 -0600 Subject: [PATCH 02/18] Retrieve command can now take a filename to load an ID from. --- .../de/upb/cs/swt/delphi/cli/DelphiCLI.scala | 4 +++- .../delphi/cli/commands/RetrieveCommand.scala | 21 +++++++++++++++---- 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/src/main/scala/de/upb/cs/swt/delphi/cli/DelphiCLI.scala b/src/main/scala/de/upb/cs/swt/delphi/cli/DelphiCLI.scala index 06f4fe9..7810c09 100644 --- a/src/main/scala/de/upb/cs/swt/delphi/cli/DelphiCLI.scala +++ b/src/main/scala/de/upb/cs/swt/delphi/cli/DelphiCLI.scala @@ -26,7 +26,9 @@ object DelphiCLI extends App { cmd("retrieve").action((s,c) => c.copy(mode = "retrieve")) .text("Retrieve a project's description, specified by ID.") .children( - arg[String]("ID").action((x, c) => c.copy(args = List(x))).text("The ID of the project to retrieve") + arg[String]("ID").action((x, c) => c.copy(args = List(x))).text("The ID of the project to retrieve"), + opt[Unit]('f', "file").action((_, c) => c.copy(opts = List("file"))).text("Use to load the ID from file, " + + "with the filepath given in place of the ID") ) //cmd("search") diff --git a/src/main/scala/de/upb/cs/swt/delphi/cli/commands/RetrieveCommand.scala b/src/main/scala/de/upb/cs/swt/delphi/cli/commands/RetrieveCommand.scala index 8a4a8f8..10af80a 100644 --- a/src/main/scala/de/upb/cs/swt/delphi/cli/commands/RetrieveCommand.scala +++ b/src/main/scala/de/upb/cs/swt/delphi/cli/commands/RetrieveCommand.scala @@ -1,14 +1,27 @@ package de.upb.cs.swt.delphi.cli.commands import de.upb.cs.swt.delphi.cli.Config +import io.Source /** * The implementation of the retrieve command. * Retrieves the contents of the file at the endpoint specified by the config file, and prints them to stdout */ object RetrieveCommand extends Command { - override def execute(config: Config): Unit = executeGet( - "/retrieve/" + config.args.head, - s => println(s) - )(config) + override def execute(config: Config): Unit = { + //Checks whether the ID should be loaded from a file or not, and either returns the first line + // of the given file if it is, or the specified ID otherwise + def checkTarget: String = { + if (config.opts.contains("file")) { + val source = Source.fromFile(config.args.head) + val target = source.getLines.next() + source.close() + target + } else config.args.head + } + executeGet( + "/retrieve/" + checkTarget, + s => println(s) + )(config) + } } From d093198a351bf9a6bc89845ef2e9040cb5108c16 Mon Sep 17 00:00:00 2001 From: Unknown Date: Sun, 3 Jun 2018 17:58:51 +0200 Subject: [PATCH 03/18] windows installable package created Have done changes in build.sbt added package related attributes like changed version and added windows plugin. --- build.sbt | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/build.sbt b/build.sbt index 0ff96eb..846dfbb 100644 --- a/build.sbt +++ b/build.sbt @@ -1,6 +1,16 @@ name := "delphi-cli" -version := "1.0.0-SNAPSHOT" +version := "1.0" + +maintainer := "Ben Hermann " + +packageSummary := "Windows Package for Delphi-cli" + +packageDescription := """Windows Package for Delphi-cli""" + +wixProductId := "ce07be71-510d-414a-92d4-dff47631848a" + +wixProductUpgradeId := "4552fb0e-e257-4dbd-9ecb-dba9dbacf424" scalaVersion := "2.12.4" @@ -9,10 +19,15 @@ libraryDependencies ++= Seq( "com.typesafe.akka" %% "akka-http-core" % "10.0.11" ) +debianPackageDependencies := Seq("java8-runtime-headless") + lazy val cli = (project in file(".")). enablePlugins(JavaAppPackaging). enablePlugins(DockerPlugin). enablePlugins(BuildInfoPlugin). + enablePlugins(DebianPlugin). + enablePlugins(WindowsPlugin). + settings( buildInfoKeys := Seq[BuildInfoKey](name, version, scalaVersion, sbtVersion), buildInfoPackage := "de.upb.cs.swt.delphi.cli" From b82e93361b568418e948bd7549aaa44466937c00 Mon Sep 17 00:00:00 2001 From: Ben Hermann Date: Sun, 3 Jun 2018 18:15:05 +0200 Subject: [PATCH 04/18] Restored version number The version number cannot be used without a SNAPSHOT at the end in the develop branch. --- build.sbt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.sbt b/build.sbt index 846dfbb..8e2c50d 100644 --- a/build.sbt +++ b/build.sbt @@ -1,6 +1,6 @@ name := "delphi-cli" -version := "1.0" +version := "1.0.0-SNAPSHOT" maintainer := "Ben Hermann " From a70085b90b2148198ed791cbd336fdf6f155586c Mon Sep 17 00:00:00 2001 From: Hariharan Ramanathan Date: Tue, 3 Jul 2018 12:26:29 +0200 Subject: [PATCH 05/18] Adding scalastyle to delphi cli --- build.sbt | 8 +++ project/plugins.sbt | 1 + scalastyle-config.xml | 117 ++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 126 insertions(+) create mode 100644 scalastyle-config.xml diff --git a/build.sbt b/build.sbt index 0ff96eb..0bb6693 100644 --- a/build.sbt +++ b/build.sbt @@ -12,8 +12,16 @@ libraryDependencies ++= Seq( lazy val cli = (project in file(".")). enablePlugins(JavaAppPackaging). enablePlugins(DockerPlugin). + enablePlugins(ScalastylePlugin). enablePlugins(BuildInfoPlugin). settings( buildInfoKeys := Seq[BuildInfoKey](name, version, scalaVersion, sbtVersion), buildInfoPackage := "de.upb.cs.swt.delphi.cli" ) + +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 d376a4a..14bea27 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -1,2 +1,3 @@ addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.7.0") 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 691f4e2df31d0a922733235a5af32f61fd04c9d3 Mon Sep 17 00:00:00 2001 From: Ben Hermann Date: Thu, 26 Jul 2018 09:11:20 +0200 Subject: [PATCH 06/18] Added coverage collection to the repo --- .travis.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index ab14e26..0a2dc6c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,3 +1,8 @@ language: scala scala: - - 2.12.4 \ No newline at end of file + - 2.12.4 +script: + - 'if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then sbt ++$TRAVIS_SCALA_VERSION test; fi' + - 'if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then sbt ++$TRAVIS_SCALA_VERSION coverage test coverageReport coverageAggregate codacyCoverage; fi' +after_success: + - 'if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then bash <(curl -s https://codecov.io/bash); fi' From 30b58fd67ea1a5d91b17b7eb0eb09773bb6e85fa Mon Sep 17 00:00:00 2001 From: Ben Hermann Date: Thu, 26 Jul 2018 09:12:20 +0200 Subject: [PATCH 07/18] Changed Windows package descriptions --- build.sbt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build.sbt b/build.sbt index 8e2c50d..61da98d 100644 --- a/build.sbt +++ b/build.sbt @@ -4,9 +4,9 @@ version := "1.0.0-SNAPSHOT" maintainer := "Ben Hermann " -packageSummary := "Windows Package for Delphi-cli" +packageSummary := "Windows Package for the Delphi CLI" -packageDescription := """Windows Package for Delphi-cli""" +packageDescription := """Windows Package for the Delphi CLI""" wixProductId := "ce07be71-510d-414a-92d4-dff47631848a" From 9f9fb742c1b24867c8a831f85067b2a8e155d981 Mon Sep 17 00:00:00 2001 From: Ben Hermann Date: Thu, 26 Jul 2018 09:17:29 +0200 Subject: [PATCH 08/18] Added plugins --- project/build.properties | 2 +- project/plugins.sbt | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/project/build.properties b/project/build.properties index cd7364c..210243d 100644 --- a/project/build.properties +++ b/project/build.properties @@ -1 +1 @@ -sbt.version = 0.13.17 \ No newline at end of file +sbt.version = 1.1.1 diff --git a/project/plugins.sbt b/project/plugins.sbt index d376a4a..2969ab1 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -1,2 +1,7 @@ +// build management and packaging addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.7.0") addSbtPlugin("com.typesafe.sbt" % "sbt-native-packager" % "1.3.2") + +// coverage +addSbtPlugin("org.scoverage" % "sbt-scoverage" % "1.5.1") +addSbtPlugin("com.codacy" % "sbt-codacy-coverage" % "1.3.12") From a9b198c0d6171916c2665f8e9625263b1e868be6 Mon Sep 17 00:00:00 2001 From: Ben Hermann Date: Thu, 26 Jul 2018 09:31:25 +0200 Subject: [PATCH 09/18] Finished license application --- LICENSE | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/LICENSE b/LICENSE index 261eeb9..d7e3293 100644 --- a/LICENSE +++ b/LICENSE @@ -175,18 +175,7 @@ END OF TERMS AND CONDITIONS - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] + Copyright 2018 The Delphi Team (represented by Ben Hermann) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. From 1ff5b482b2311f0aab6b522f8ab4e29d74681faa Mon Sep 17 00:00:00 2001 From: Ben Hermann Date: Thu, 26 Jul 2018 09:41:41 +0200 Subject: [PATCH 10/18] Added plugin for snyk --- project/plugins.sbt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/project/plugins.sbt b/project/plugins.sbt index 2969ab1..c3f46c6 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -5,3 +5,6 @@ addSbtPlugin("com.typesafe.sbt" % "sbt-native-packager" % "1.3.2") // coverage addSbtPlugin("org.scoverage" % "sbt-scoverage" % "1.5.1") addSbtPlugin("com.codacy" % "sbt-codacy-coverage" % "1.3.12") + +// preparation for dependency checking +addSbtPlugin("net.virtual-void" % "sbt-dependency-graph" % "0.9.1") From 747a0d0e4cf7543d6647b2270fff6f31352d4204 Mon Sep 17 00:00:00 2001 From: Ben Hermann Date: Thu, 26 Jul 2018 10:34:11 +0200 Subject: [PATCH 11/18] Reorganized build file and added licence information --- build.sbt | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/build.sbt b/build.sbt index 61da98d..eb5a9fe 100644 --- a/build.sbt +++ b/build.sbt @@ -1,18 +1,16 @@ -name := "delphi-cli" +scalaVersion := "2.12.4" +name := "delphi-cli" version := "1.0.0-SNAPSHOT" - maintainer := "Ben Hermann " -packageSummary := "Windows Package for the Delphi CLI" +licenses := Seq("Apache-2.0" -> url("http://www.apache.org/licenses/LICENSE-2.0.html")) +packageSummary := "Windows Package for the Delphi CLI" packageDescription := """Windows Package for the Delphi CLI""" - wixProductId := "ce07be71-510d-414a-92d4-dff47631848a" - wixProductUpgradeId := "4552fb0e-e257-4dbd-9ecb-dba9dbacf424" -scalaVersion := "2.12.4" libraryDependencies += "com.github.scopt" %% "scopt" % "3.7.0" libraryDependencies ++= Seq( From 3132b59dac8d9283226df3273949b89f54a6d81f Mon Sep 17 00:00:00 2001 From: Ben Hermann Date: Thu, 26 Jul 2018 15:10:44 +0200 Subject: [PATCH 12/18] Removed redundant brackets --- src/main/scala/de/upb/cs/swt/delphi/cli/Config.scala | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/main/scala/de/upb/cs/swt/delphi/cli/Config.scala b/src/main/scala/de/upb/cs/swt/delphi/cli/Config.scala index 87e98ec..40d6fd7 100644 --- a/src/main/scala/de/upb/cs/swt/delphi/cli/Config.scala +++ b/src/main/scala/de/upb/cs/swt/delphi/cli/Config.scala @@ -7,6 +7,4 @@ package de.upb.cs.swt.delphi.cli * @param mode The command to be run */ case class Config (server : String = sys.env.getOrElse("DELPHI_SERVER", "https://delphi.cs.uni-paderborn.de/api/"), - verbose: Boolean = false, mode : String = "", args : List[String] = List(), opts : List[String] = List()) { - -} + verbose: Boolean = false, mode : String = "", args : List[String] = List(), opts : List[String] = List()) From f14be263eae48d0a9fb5b096fe0967c711ee7b46 Mon Sep 17 00:00:00 2001 From: Ben Hermann Date: Thu, 26 Jul 2018 15:48:27 +0200 Subject: [PATCH 13/18] Activated scalastyle plugin --- build.sbt | 1 + project/plugins.sbt | 3 +++ 2 files changed, 4 insertions(+) diff --git a/build.sbt b/build.sbt index eb5a9fe..48d5bf4 100644 --- a/build.sbt +++ b/build.sbt @@ -11,6 +11,7 @@ packageDescription := """Windows Package for the Delphi CLI""" wixProductId := "ce07be71-510d-414a-92d4-dff47631848a" wixProductUpgradeId := "4552fb0e-e257-4dbd-9ecb-dba9dbacf424" +scalastyleConfig := baseDirectory.value / "project" / "scalastyle_config.xml" libraryDependencies += "com.github.scopt" %% "scopt" % "3.7.0" libraryDependencies ++= Seq( diff --git a/project/plugins.sbt b/project/plugins.sbt index c3f46c6..705f861 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -8,3 +8,6 @@ addSbtPlugin("com.codacy" % "sbt-codacy-coverage" % "1.3.12") // preparation for dependency checking addSbtPlugin("net.virtual-void" % "sbt-dependency-graph" % "0.9.1") + +// scalastyle +addSbtPlugin("org.scalastyle" %% "scalastyle-sbt-plugin" % "1.0.0") From f575618f611f9e14d1bb6e8248648efaa7cc148b Mon Sep 17 00:00:00 2001 From: Hariharan Ramanathan Date: Tue, 31 Jul 2018 13:48:08 +0200 Subject: [PATCH 14/18] 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 0a08a46..e442d3a 100644 --- a/build.sbt +++ b/build.sbt @@ -39,4 +39,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 c798971f66cecae6eb4be7000f51cee657b925fa Mon Sep 17 00:00:00 2001 From: Ben Hermann Date: Fri, 3 Aug 2018 15:24:42 +0200 Subject: [PATCH 15/18] Made import more explicit --- .../de/upb/cs/swt/delphi/cli/commands/RetrieveCommand.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/scala/de/upb/cs/swt/delphi/cli/commands/RetrieveCommand.scala b/src/main/scala/de/upb/cs/swt/delphi/cli/commands/RetrieveCommand.scala index 10af80a..fbf795c 100644 --- a/src/main/scala/de/upb/cs/swt/delphi/cli/commands/RetrieveCommand.scala +++ b/src/main/scala/de/upb/cs/swt/delphi/cli/commands/RetrieveCommand.scala @@ -1,7 +1,7 @@ package de.upb.cs.swt.delphi.cli.commands import de.upb.cs.swt.delphi.cli.Config -import io.Source +import scala.io.Source /** * The implementation of the retrieve command. From 1b3004f27cd758140d1a9a059e3a74f179a89727 Mon Sep 17 00:00:00 2001 From: Hariharan Ramanathan Date: Thu, 9 Aug 2018 14:36:47 +0200 Subject: [PATCH 16/18] Removing scalastyle from test target --- build.sbt | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/build.sbt b/build.sbt index e442d3a..972eff0 100644 --- a/build.sbt +++ b/build.sbt @@ -33,12 +33,5 @@ lazy val cli = (project in file(".")). buildInfoKeys := Seq[BuildInfoKey](name, version, scalaVersion, sbtVersion), buildInfoPackage := "de.upb.cs.swt.delphi.cli" ) +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 From 95fba8a6165f0477929273dbb59eb342bf5eb9aa Mon Sep 17 00:00:00 2001 From: Ben Hermann Date: Sat, 11 Aug 2018 15:41:35 +0200 Subject: [PATCH 17/18] Rename scalastyle-config.xml to scalastyle_config.xml --- project/{scalastyle-config.xml => scalastyle_config.xml} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename project/{scalastyle-config.xml => scalastyle_config.xml} (99%) diff --git a/project/scalastyle-config.xml b/project/scalastyle_config.xml similarity index 99% rename from project/scalastyle-config.xml rename to project/scalastyle_config.xml index 7e3596f..c220edc 100644 --- a/project/scalastyle-config.xml +++ b/project/scalastyle_config.xml @@ -114,4 +114,4 @@ - \ No newline at end of file + From 56ff64fde4bac0798a1239ae06cefa96880898ba Mon Sep 17 00:00:00 2001 From: Ben Hermann Date: Sat, 11 Aug 2018 15:50:45 +0200 Subject: [PATCH 18/18] Rename scalastyle_config.xml to scalastyle-config.xml --- project/{scalastyle_config.xml => scalastyle-config.xml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename project/{scalastyle_config.xml => scalastyle-config.xml} (100%) diff --git a/project/scalastyle_config.xml b/project/scalastyle-config.xml similarity index 100% rename from project/scalastyle_config.xml rename to project/scalastyle-config.xml