From 30a425cee83ed65f0ea740617698e22591b0ed51 Mon Sep 17 00:00:00 2001 From: Barbara Gomes Date: Fri, 1 Jul 2016 13:39:17 -0700 Subject: [PATCH 2/2] [IOTA-1] Implementing SBT project structure for Fey --- fey-core/project/Build.scala | 109 ++++++++++++++++++++++++++++++++++++++ fey-core/project/build.properties | 17 ++++++ fey-core/project/plugins.sbt | 22 ++++++++ 3 files changed, 148 insertions(+) create mode 100644 fey-core/project/Build.scala create mode 100644 fey-core/project/build.properties create mode 100644 fey-core/project/plugins.sbt diff --git a/fey-core/project/Build.scala b/fey-core/project/Build.scala new file mode 100644 index 0000000..75503b0 --- /dev/null +++ b/fey-core/project/Build.scala @@ -0,0 +1,109 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You 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. + */ + +import sbt._ +import sbt.Keys._ +import sbtassembly.AssemblyPlugin.autoImport._ + +object Settings { + + lazy val iota_connectors = Defaults.coreDefaultSettings ++ Seq( + name := "FEY-CORE", + version := "1.0-SNAPSHOT", + scalaVersion := "2.11.8", + organization := "org.apache.iota", + description := "Framework of the event processing / actions engine for IOTA", + 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 emuller = "emueller-bintray" at "http://dl.bintray.com/emueller/maven" + + val allResolvers = Seq(typesafe, sonatype, mvnrepository, emuller) + +} + +object Dependency { + + val akka_actor = "com.typesafe.akka" %% "akka-actor" % "2.4.2" + val typesafe_config = "com.typesafe" % "config" % "1.3.0" + + val playJson = "com.typesafe.play" %% "play-json" % "2.5.3" + val jsonValidator = "com.eclipsesource" %% "play-json-schema-validator" % "0.7.0" + + //Logger + val slf4j = "com.typesafe.akka" %% "akka-slf4j" % "2.4.2" + val log4jbind = "ch.qos.logback" % "logback-classic" % "1.1.7" + val javaFilter = "janino" % "janino" % "2.5.10" + + //restapi + val sprayCan = "io.spray" %% "spray-can" % "1.3.3" + val sprayRouting = "io.spray" %% "spray-routing" % "1.3.3" + +} + +object Dependencies { + import Dependency._ + + val iota_dep_conn = Seq(akka_actor,typesafe_config,playJson,slf4j,log4jbind,sprayCan,sprayRouting,jsonValidator,javaFilter) +} + +object IotaBuild extends Build{ + import Resolvers._ + import Dependencies._ + import Settings._ + + lazy val iota = Project( + id = "iota-fey-core", + base = file("."), + settings = iota_connectors ++ Seq( + maxErrors := 5, + ivyScala := ivyScala.value map { _.copy(overrideScalaVersion = true) }, + triggeredMessage := Watched.clearWhenTriggered, + resolvers := allResolvers, + libraryDependencies ++= iota_dep_conn, + mainClass := Some("org.apache.iota.fey.Application"), + fork := true, + connectInput in run := true, + assemblyJarName in assembly := "iota-fey-core.jar", + publishTo := { + val nexus = "s3://maven.litbit.com/" + if (isSnapshot.value) + Some("snapshots" at nexus + "snapshots") + else + Some("releases" at nexus + "releases") + }, + publishMavenStyle := true, + conflictManager := ConflictManager.all, + assemblyMergeStrategy in assembly := { + case PathList("org", "slf4j", xs @ _*) => MergeStrategy.last + case x => + val oldStrategy = (assemblyMergeStrategy in assembly).value + oldStrategy(x) + } + ) + ) +} + + + diff --git a/fey-core/project/build.properties b/fey-core/project/build.properties new file mode 100644 index 0000000..a3c5bf0 --- /dev/null +++ b/fey-core/project/build.properties @@ -0,0 +1,17 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You 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. +# + +sbt.version = 0.13.11 \ No newline at end of file diff --git a/fey-core/project/plugins.sbt b/fey-core/project/plugins.sbt new file mode 100644 index 0000000..82fae02 --- /dev/null +++ b/fey-core/project/plugins.sbt @@ -0,0 +1,22 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You 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. + */ + +logLevel := Level.Warn + +addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.13.0") +addSbtPlugin("io.spray" % "sbt-revolver" % "0.7.2") +addSbtPlugin("com.frugalmechanic" % "fm-sbt-s3-resolver" % "0.9.0") \ No newline at end of file -- 2.7.4 (Apple Git-66)