Skip to content
This repository has been archived by the owner on Oct 30, 2018. It is now read-only.

Commit

Permalink
Merge pull request #14 from snowplow/feature/sbt
Browse files Browse the repository at this point in the history
WORK IN PROGRESS Initial version of SBT config
  • Loading branch information
Lemmsjid committed Dec 5, 2013
2 parents 53ecb1a + b09263d commit 4165d7c
Show file tree
Hide file tree
Showing 4 changed files with 137 additions and 0 deletions.
38 changes: 38 additions & 0 deletions project/BuildSettings.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
/** Licensed to Gravity.com under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. Gravity.com 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 Keys._

object BuildSettings {

// Basic settings for our app
lazy val basicSettings = Seq[Setting[_]](
organization := "Gravity",
version := "0.1.24",
description := "HBase DSL for Scala with MapReduce support",
scalaVersion := "2.10.3",
crossScalaVersions := Seq("2.9.2", "2.9.3", "2.10.0", "2.10.3"),
scalacOptions := Seq("-deprecation", "-encoding", "utf8"),
scalacOptions in Test := Seq("-Yrangepos")
)

// TODO: add Maven Central publishing as per
// http://www.scala-sbt.org/release/docs/Community/Using-Sonatype.html

lazy val buildSettings = basicSettings // ++ more as required
}
53 changes: 53 additions & 0 deletions project/Dependencies.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
/** Licensed to Gravity.com under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. Gravity.com 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._

object Dependencies {

object V {
// Java
val jodaTime = "1.6.1"
val hadoopCore = "0.20.2"
val hbase = "0.90.4"
val asyncHbase = "1.4.0"
val trove4j = "3.0.3"
// Java (test only)
val junit = "4.8.1"
val hadoopTest = "0.20.2"
}

object Libraries {
// Java
val jodaTime = "joda-time" % "joda-time" % V.jodaTime
val hadoopCore = "org.apache.hadoop" % "hadoop-core" % V.hadoopCore
val hbase = "org.apache.hbase" % "hbase" % V.hbase
val asyncHbase = "org.hbase" % "asynchbase" % V.asyncHbase
val trove4j = "net.sf.trove4j" % "trove4j" % V.trove4j
// Java (test only)
val junit = "junit" % "junit" % V.junit % "test"
val hadoopTest = "org.apache.hadoop" % "hadoop-test" % V.hadoopTest % "test"
val hbaseTests = "org.apache.hbase" % "hbase" % V.hbase classifier "tests"
// To exclude. TODO: not yet implemented
val exclusions = List(
"org.apache.thrift" , "thrift" ,
"org.jruby" , "jruby-complete" ,
"org.slf4j" , "log4j-over-slf4j" ,
"org.slf4j" , "jcl-over-slf4j" )

}
}
45 changes: 45 additions & 0 deletions project/HPasteBuild.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
/** Licensed to Gravity.com under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. Gravity.com 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 Keys._

object HPasteBuild extends Build {

import Dependencies._
import BuildSettings._

// Configure prompt to show current project
override lazy val settings = super.settings :+ {
shellPrompt := { s => Project.extract(s).currentProject.id + " > " }
}

// Define our project, with basic project information and library dependencies
lazy val project = Project("HPaste", file("."))
.settings(buildSettings: _*)
.settings(
libraryDependencies ++= Seq(
Libraries.jodaTime,
Libraries.hadoopCore,
Libraries.hbase,
Libraries.asyncHbase,
Libraries.trove4j,
Libraries.junit,
Libraries.hbaseTests
).map(_.exclude("org.apache.thrift", "thrift")) // TODO: use full list
)
}
1 change: 1 addition & 0 deletions project/build.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
sbt.version=0.13.0

0 comments on commit 4165d7c

Please sign in to comment.