iota-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tonyfaust...@apache.org
Subject [1/7] incubator-iota git commit: Refactor build of performer to manage depenpencies more properly
Date Tue, 05 Jul 2016 20:29:58 GMT
Repository: incubator-iota
Updated Branches:
  refs/heads/master b65c38229 -> 881b59ee5


Refactor build of performer to manage depenpencies more properly


Project: http://git-wip-us.apache.org/repos/asf/incubator-iota/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-iota/commit/890742a0
Tree: http://git-wip-us.apache.org/repos/asf/incubator-iota/tree/890742a0
Diff: http://git-wip-us.apache.org/repos/asf/incubator-iota/diff/890742a0

Branch: refs/heads/master
Commit: 890742a042523a4f221101be137bca62cf366f71
Parents: 48aa93d
Author: sandy <phalodi@gmail.com>
Authored: Mon Jul 4 22:52:17 2016 +0530
Committer: sandy <phalodi@gmail.com>
Committed: Mon Jul 4 22:52:17 2016 +0530

----------------------------------------------------------------------
 Performers/project/Build.scala         | 123 ++++------------------------
 Performers/project/BuildSettings.scala |  65 +++++++++++++++
 Performers/project/Dependencies.scala  |  29 +++++++
 Performers/project/plugins.sbt         |   3 +-
 Performers/scalastyle-config.xml       | 117 ++++++++++++++++++++++++++
 5 files changed, 228 insertions(+), 109 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-iota/blob/890742a0/Performers/project/Build.scala
----------------------------------------------------------------------
diff --git a/Performers/project/Build.scala b/Performers/project/Build.scala
index ab33c20..8f14fb0 100644
--- a/Performers/project/Build.scala
+++ b/Performers/project/Build.scala
@@ -18,86 +18,17 @@
 import sbt._
 import sbt.Keys._
 
-object BuildSettings {
+object ModuleDependencies {
 
-  val ParentProject = "jars_parent"
-  val Fey = "fey"
-  val Stream = "fey_stream"
-  val ZMQ = "fey_zmq"
+  import Dependencies._
 
-
-  val Version = "1.0"
-  val ScalaVersion = "2.11.8"
-
-  lazy val rootbuildSettings = Defaults.coreDefaultSettings ++ Seq(
-    name := ParentProject,
-    version := Version,
-    scalaVersion := ScalaVersion,
-    organization := "com.libit",
-    description := "Fey External Jars Project",
-    scalacOptions := Seq("-deprecation", "-unchecked", "-encoding", "utf8", "-Xlint")
-  )
-
-  lazy val FeybuildSettings = Defaults.coreDefaultSettings ++ Seq(
-    name := Fey,
-    version := Version,
-    scalaVersion := ScalaVersion,
-    organization := "com.litbit",
-    description := "Fey Development Instance",
-    scalacOptions := Seq("-deprecation", "-unchecked", "-encoding", "utf8", "-Xlint")
-  )
-
-  lazy val StreambuildSettings = Defaults.coreDefaultSettings ++ Seq(
-    name := Stream,
-    version := Version,
-    scalaVersion := ScalaVersion,
-    organization := "org.apache.iota.fey.performer",
-    description := "Simple Stream Application",
-    scalacOptions := Seq("-deprecation", "-unchecked", "-encoding", "utf8", "-Xlint")
-  )
-
-   lazy val ZMQbuildSettings = Defaults.coreDefaultSettings ++ Seq(
-    name := ZMQ,
-    version := Version,
-    scalaVersion := ScalaVersion,
-    organization := "org.apache.iota.fey.performer",
-    description := "ZMQ Application",
-    scalacOptions := Seq("-deprecation", "-unchecked", "-encoding", "utf8", "-Xlint")
-  )
-
-}
-
-object Resolvers {
-
-  val typesafe = "Typesafe Repository" at "http://repo.typesafe.com/typesafe/releases/"
-  val sonatype = "Sonatype Release" at "https://oss.sonatype.org/content/repositories/releases"
-  val mvnrepository = "MVN Repo" at "http://mvnrepository.com/artifact"
-  val litbitBitbucket = "Litbit Repo" at "https://s3-us-west-2.amazonaws.com/maven.litbit.com/snapshots"
-  val emuller = "emueller-bintray" at "http://dl.bintray.com/emueller/maven"
-
-  val allResolvers = Seq(typesafe, sonatype, mvnrepository, emuller, litbitBitbucket)
-
-}
-
-object Dependency {
-  //Use when building Artifacts (jar files)
-  val akka_actor = "com.typesafe.akka" %% "akka-actor" % "2.4.2" % "provided"
-  val fey = "org.apache.iota" %% "fey-core" % "1.0-SNAPSHOT" % "provided"
-  val zmq = "org.zeromq" % "jeromq" % "0.3.5"
-}
-
-object Dependencies {
-
-  import Dependency._
-
-  val FeyDependencies = Seq(akka_actor, fey)
-  val StreamDependencies = Seq(akka_actor, fey)
-  val ZMQDependecies = Seq(akka_actor, zmq, fey)
+  val FeyDependencies = provided(akka_actor, fey)
+  val StreamDependencies = provided(akka_actor, fey)
+  val ZMQDependecies = provided(akka_actor, zmq, fey)
 }
 
-object JarsBuild extends Build {
+object PerformersBuild extends Build {
 
-  import Resolvers._
   import BuildSettings._
 
   lazy val parent = Project(
@@ -112,50 +43,26 @@ object JarsBuild extends Build {
   lazy val fey = Project(
     id = "fey",
     base = file("./fey"),
-    settings = FeybuildSettings ++ Seq(
-      maxErrors := 5,
-      ivyScala := ivyScala.value map {
-        _.copy(overrideScalaVersion = true)
-      },
-      triggeredMessage := Watched.clearWhenTriggered,
-      resolvers := allResolvers,
-      libraryDependencies ++= Dependencies.FeyDependencies,
-      mainClass := Some("org.apache.iota.fey.Application"),
-      fork := true,
-      connectInput in run := true
+    settings = BasicSettings ++ FeybuildSettings ++ Seq(
+      libraryDependencies ++= ModuleDependencies.FeyDependencies,
+      mainClass := Some("org.apache.iota.fey.Application")
     ))
 
   lazy val stream = Project(
     id = "fey_stream",
     base = file("./stream"),
-    settings = StreambuildSettings ++ Seq(
-      maxErrors := 5,
+    settings = BasicSettings ++ StreambuildSettings ++ Seq(
+      libraryDependencies ++= ModuleDependencies.StreamDependencies,
+      mainClass := Some("org.apache.iota.fey.performer.stream.Application")
 
-      ivyScala := ivyScala.value map {
-        _.copy(overrideScalaVersion = true)
-      },
-      triggeredMessage := Watched.clearWhenTriggered,
-      resolvers := allResolvers,
-      libraryDependencies ++= Dependencies.StreamDependencies,
-      mainClass := Some("org.apache.iota.fey.performer.stream.Application"),
-      fork := true,
-      connectInput in run := true
     ))
 
    lazy val zmq = Project(
     id = "fey_zmq",
     base = file("./zmq"),
-    settings = ZMQbuildSettings ++ Seq(
-      maxErrors := 5,
-      ivyScala := ivyScala.value map {
-        _.copy(overrideScalaVersion = true)
-      },
-      triggeredMessage := Watched.clearWhenTriggered,
-      resolvers := allResolvers,
-      libraryDependencies ++= Dependencies.ZMQDependecies,
-      mainClass := Some("org.apache.iota.fey.performer.zmq.Application"),
-      fork := true,
-      connectInput in run := true
+    settings = BasicSettings ++ ZMQbuildSettings ++ Seq(
+      libraryDependencies ++= ModuleDependencies.ZMQDependecies,
+      mainClass := Some("org.apache.iota.fey.performer.zmq.Application")
     ))
 
 }

http://git-wip-us.apache.org/repos/asf/incubator-iota/blob/890742a0/Performers/project/BuildSettings.scala
----------------------------------------------------------------------
diff --git a/Performers/project/BuildSettings.scala b/Performers/project/BuildSettings.scala
new file mode 100644
index 0000000..8b5fa19
--- /dev/null
+++ b/Performers/project/BuildSettings.scala
@@ -0,0 +1,65 @@
+import sbt.{Defaults, Watched}
+import sbt.Keys._
+
+object BuildSettings {
+
+  import Dependencies.Resolvers._
+
+  val ParentProject = "jars_parent"
+  val Fey = "fey"
+  val Stream = "fey_stream"
+  val ZMQ = "fey_zmq"
+
+
+  val Version = "1.0"
+  val ScalaVersion = "2.11.8"
+
+  lazy val rootbuildSettings = Defaults.coreDefaultSettings ++ Seq(
+    name := ParentProject,
+    version := Version,
+    scalaVersion := ScalaVersion,
+    organization := "com.libit",
+    description := "Fey External Jars Project",
+    scalacOptions := Seq("-deprecation", "-unchecked", "-encoding", "utf8", "-Xlint")
+  )
+
+  lazy val BasicSettings = Seq(
+    maxErrors := 5,
+    ivyScala := ivyScala.value map {
+      _.copy(overrideScalaVersion = true)
+    },
+    triggeredMessage := Watched.clearWhenTriggered,
+    resolvers := allResolvers,
+    mainClass := Some("org.apache.iota.fey.Application"),
+    fork := true,
+    connectInput in run := true
+  )
+
+  lazy val FeybuildSettings = Defaults.coreDefaultSettings ++ Seq(
+    name := Fey,
+    version := Version,
+    scalaVersion := ScalaVersion,
+    organization := "com.litbit",
+    description := "Fey Development Instance",
+    scalacOptions := Seq("-deprecation", "-unchecked", "-encoding", "utf8", "-Xlint")
+  )
+
+  lazy val StreambuildSettings = Defaults.coreDefaultSettings ++ Seq(
+    name := Stream,
+    version := Version,
+    scalaVersion := ScalaVersion,
+    organization := "org.apache.iota.fey.performer",
+    description := "Simple Stream Application",
+    scalacOptions := Seq("-deprecation", "-unchecked", "-encoding", "utf8", "-Xlint")
+  )
+
+  lazy val ZMQbuildSettings = Defaults.coreDefaultSettings ++ Seq(
+    name := ZMQ,
+    version := Version,
+    scalaVersion := ScalaVersion,
+    organization := "org.apache.iota.fey.performer",
+    description := "ZMQ Application",
+    scalacOptions := Seq("-deprecation", "-unchecked", "-encoding", "utf8", "-Xlint")
+  )
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-iota/blob/890742a0/Performers/project/Dependencies.scala
----------------------------------------------------------------------
diff --git a/Performers/project/Dependencies.scala b/Performers/project/Dependencies.scala
new file mode 100644
index 0000000..7149662
--- /dev/null
+++ b/Performers/project/Dependencies.scala
@@ -0,0 +1,29 @@
+import sbt._
+
+object Dependencies {
+
+  object Resolvers {
+    val typesafe = "Typesafe Repository" at "http://repo.typesafe.com/typesafe/releases/"
+    val sonatype = "Sonatype Release" at "https://oss.sonatype.org/content/repositories/releases"
+    val mvnrepository = "MVN Repo" at "http://mvnrepository.com/artifact"
+    val litbitBitbucket = "Litbit Repo" at "https://s3-us-west-2.amazonaws.com/maven.litbit.com/snapshots"
+    val emuller = "emueller-bintray" at "http://dl.bintray.com/emueller/maven"
+
+    val allResolvers = Seq(typesafe, sonatype, mvnrepository, emuller, litbitBitbucket)
+
+  }
+
+  def compile(deps: ModuleID*): Seq[ModuleID] = deps map (_ % "compile")
+
+  def provided(deps: ModuleID*): Seq[ModuleID] = deps map (_ % "provided")
+
+  def test(deps: ModuleID*): Seq[ModuleID] = deps map (_ % "test")
+
+  def runtime(deps: ModuleID*): Seq[ModuleID] = deps map (_ % "runtime")
+
+  def container(deps: ModuleID*): Seq[ModuleID] = deps map (_ % "container")
+
+  val akka_actor = "com.typesafe.akka" %% "akka-actor" % "2.4.2"
+  val fey = "org.apache.iota" %% "fey-core" % "1.0-SNAPSHOT"
+  val zmq = "org.zeromq" % "jeromq" % "0.3.5"
+}

http://git-wip-us.apache.org/repos/asf/incubator-iota/blob/890742a0/Performers/project/plugins.sbt
----------------------------------------------------------------------
diff --git a/Performers/project/plugins.sbt b/Performers/project/plugins.sbt
index 8d0b78a..4f3261f 100644
--- a/Performers/project/plugins.sbt
+++ b/Performers/project/plugins.sbt
@@ -1,4 +1,5 @@
 logLevel := Level.Warn
 
 addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.13.0")
-addSbtPlugin("io.spray" % "sbt-revolver" % "0.7.2")
\ No newline at end of file
+addSbtPlugin("io.spray" % "sbt-revolver" % "0.7.2")
+addSbtPlugin("org.scalastyle" %% "scalastyle-sbt-plugin" % "0.8.0")
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-iota/blob/890742a0/Performers/scalastyle-config.xml
----------------------------------------------------------------------
diff --git a/Performers/scalastyle-config.xml b/Performers/scalastyle-config.xml
new file mode 100644
index 0000000..7e3596f
--- /dev/null
+++ b/Performers/scalastyle-config.xml
@@ -0,0 +1,117 @@
+<scalastyle>
+ <name>Scalastyle standard configuration</name>
+ <check level="warning" class="org.scalastyle.file.FileTabChecker" enabled="true"></check>
+ <check level="warning" class="org.scalastyle.file.FileLengthChecker" enabled="true">
+  <parameters>
+   <parameter name="maxFileLength"><![CDATA[800]]></parameter>
+  </parameters>
+ </check>
+ <check level="warning" class="org.scalastyle.file.HeaderMatchesChecker" enabled="true">
+  <parameters>
+   <parameter name="header"><![CDATA[// Copyright (C) 2011-2012 the original author
or authors.
+// See the LICENCE.txt file distributed with this work for additional
+// information regarding copyright ownership.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.]]></parameter>
+  </parameters>
+ </check>
+ <check level="warning" class="org.scalastyle.scalariform.SpacesAfterPlusChecker" enabled="true"></check>
+ <check level="warning" class="org.scalastyle.file.WhitespaceEndOfLineChecker" enabled="true"></check>
+ <check level="warning" class="org.scalastyle.scalariform.SpacesBeforePlusChecker" enabled="true"></check>
+ <check level="warning" class="org.scalastyle.file.FileLineLengthChecker" enabled="true">
+  <parameters>
+   <parameter name="maxLineLength"><![CDATA[160]]></parameter>
+   <parameter name="tabSize"><![CDATA[4]]></parameter>
+  </parameters>
+ </check>
+ <check level="warning" class="org.scalastyle.scalariform.ClassNamesChecker" enabled="true">
+  <parameters>
+   <parameter name="regex"><![CDATA[[A-Z][A-Za-z]*]]></parameter>
+  </parameters>
+ </check>
+ <check level="warning" class="org.scalastyle.scalariform.ObjectNamesChecker" enabled="true">
+  <parameters>
+   <parameter name="regex"><![CDATA[[A-Z][A-Za-z]*]]></parameter>
+  </parameters>
+ </check>
+ <check level="warning" class="org.scalastyle.scalariform.PackageObjectNamesChecker" enabled="true">
+  <parameters>
+   <parameter name="regex"><![CDATA[^[a-z][A-Za-z]*$]]></parameter>
+  </parameters>
+ </check>
+ <check level="warning" class="org.scalastyle.scalariform.EqualsHashCodeChecker" enabled="true"></check>
+ <check level="warning" class="org.scalastyle.scalariform.IllegalImportsChecker" enabled="true">
+  <parameters>
+   <parameter name="illegalImports"><![CDATA[sun._,java.awt._]]></parameter>
+  </parameters>
+ </check>
+ <check level="warning" class="org.scalastyle.scalariform.ParameterNumberChecker" enabled="true">
+  <parameters>
+   <parameter name="maxParameters"><![CDATA[8]]></parameter>
+  </parameters>
+ </check>
+ <check level="warning" class="org.scalastyle.scalariform.MagicNumberChecker" enabled="true">
+  <parameters>
+   <parameter name="ignore"><![CDATA[-1,0,1,2,3]]></parameter>
+  </parameters>
+ </check>
+ <check level="warning" class="org.scalastyle.scalariform.NoWhitespaceBeforeLeftBracketChecker"
enabled="true"></check>
+ <check level="warning" class="org.scalastyle.scalariform.NoWhitespaceAfterLeftBracketChecker"
enabled="true"></check>
+ <check level="warning" class="org.scalastyle.scalariform.ReturnChecker" enabled="true"></check>
+ <check level="warning" class="org.scalastyle.scalariform.NullChecker" enabled="true"></check>
+ <check level="warning" class="org.scalastyle.scalariform.NoCloneChecker" enabled="true"></check>
+ <check level="warning" class="org.scalastyle.scalariform.NoFinalizeChecker" enabled="true"></check>
+ <check level="warning" class="org.scalastyle.scalariform.CovariantEqualsChecker" enabled="true"></check>
+ <check level="warning" class="org.scalastyle.scalariform.StructuralTypeChecker" enabled="true"></check>
+ <check level="warning" class="org.scalastyle.file.RegexChecker" enabled="true">
+  <parameters>
+   <parameter name="regex"><![CDATA[println]]></parameter>
+  </parameters>
+ </check>
+ <check level="warning" class="org.scalastyle.scalariform.NumberOfTypesChecker" enabled="true">
+  <parameters>
+   <parameter name="maxTypes"><![CDATA[30]]></parameter>
+  </parameters>
+ </check>
+ <check level="warning" class="org.scalastyle.scalariform.CyclomaticComplexityChecker"
enabled="true">
+  <parameters>
+   <parameter name="maximum"><![CDATA[10]]></parameter>
+  </parameters>
+ </check>
+ <check level="warning" class="org.scalastyle.scalariform.UppercaseLChecker" enabled="true"></check>
+ <check level="warning" class="org.scalastyle.scalariform.SimplifyBooleanExpressionChecker"
enabled="true"></check>
+ <check level="warning" class="org.scalastyle.scalariform.IfBraceChecker" enabled="true">
+  <parameters>
+   <parameter name="singleLineAllowed"><![CDATA[true]]></parameter>
+   <parameter name="doubleLineAllowed"><![CDATA[false]]></parameter>
+  </parameters>
+ </check>
+ <check level="warning" class="org.scalastyle.scalariform.MethodLengthChecker" enabled="true">
+  <parameters>
+   <parameter name="maxLength"><![CDATA[50]]></parameter>
+  </parameters>
+ </check>
+ <check level="warning" class="org.scalastyle.scalariform.MethodNamesChecker" enabled="true">
+  <parameters>
+   <parameter name="regex"><![CDATA[^[a-z][A-Za-z0-9]*$]]></parameter>
+  </parameters>
+ </check>
+ <check level="warning" class="org.scalastyle.scalariform.NumberOfMethodsInTypeChecker"
enabled="true">
+  <parameters>
+   <parameter name="maxMethods"><![CDATA[30]]></parameter>
+  </parameters>
+ </check>
+ <check level="warning" class="org.scalastyle.scalariform.PublicMethodsHaveTypeChecker"
enabled="true"></check>
+ <check level="warning" class="org.scalastyle.file.NewLineAtEofChecker" enabled="true"></check>
+ <check level="warning" class="org.scalastyle.file.NoNewLineAtEofChecker" enabled="false"></check>
+</scalastyle>
\ No newline at end of file


Mime
View raw message