Skip to content

Commit

Permalink
Move to SBT 0.11.2
Browse files Browse the repository at this point in the history
  • Loading branch information
indrajitr committed Feb 22, 2012
1 parent cfe201f commit 6fc81a0
Show file tree
Hide file tree
Showing 12 changed files with 311 additions and 137 deletions.
19 changes: 19 additions & 0 deletions build.sbt
@@ -0,0 +1,19 @@
import Dependencies._

version in ThisBuild := "2.5-SNAPSHOT"

crossScalaVersions in ThisBuild := Seq("2.9.1", "2.9.0-1", "2.9.0", /*"2.8.2", */"2.8.1", "2.8.0")

libraryDependencies in ThisBuild <++= scalaVersion { sv => Seq(/*specs2, */specs(sv), scalacheck(sv)) }

pomExtra in ThisBuild ~= { _ ++ (
<scm>
<url>http://github.com/lift/framework</url>
<connection>scm:git:git@github.com:lift/framework.git</connection>
</scm>
<developers>
<developer>
<id>indrajitr</id>
<name>Indrajit Raychaudhuri</name>
</developer>
</developers>)}
2 changes: 1 addition & 1 deletion liftsh
Expand Up @@ -14,4 +14,4 @@ DEFAULT_OPTS="-Dsbt.intransitive=true -Djava.util.logging.config.file=logging.pr
cd `dirname $0`

# Call with INTERNAL_OPTS followed by LIFTSH_OPTS (or DEFAULT_OPTS). java aways takes the last option when duplicate.
exec java ${INTERNAL_OPTS} ${LIFTSH_OPTS:-${DEFAULT_OPTS}} -jar project/sbt-launch-0.7.7.jar "$@"
exec java ${INTERNAL_OPTS} ${LIFTSH_OPTS:-${DEFAULT_OPTS}} -jar project/sbt-launch-0.11.2.jar "$@"
2 changes: 1 addition & 1 deletion liftsh.cmd
Expand Up @@ -11,4 +11,4 @@ if "%LIFTSH_OPTS%"=="" (
)

@REM Call with INTERNAL_OPTS followed by LIFTSH_OPTS (or DEFAULT_OPTS). java aways takes the last option when duplicate.
java %INTERNAL_OPTS% %LIFTSH_OPTS% -jar "%~dp0\project\sbt-launch-0.7.7.jar" %*
java %INTERNAL_OPTS% %LIFTSH_OPTS% -jar "%~dp0\project\sbt-launch-0.11.2.jar" %*
Expand Up @@ -26,7 +26,7 @@ import org.bson.types.ObjectId
import org.specs.Specification

import common._
import json.{Num => _, _}
import json._
import BsonDSL._
import util.Helpers.randomString
import http.{LiftSession, S}
Expand Down
197 changes: 197 additions & 0 deletions project/Build.scala
@@ -0,0 +1,197 @@
/*
* Copyright 2012 WorldWide Conferencing, LLC
*
* 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.
*/

import java.util.{Calendar => Cal}
import sbt._
import Keys._
import net.liftweb.sbt._
import Dependencies._


object BuildDef extends Build {

lazy val liftProjects = core ++ web ++ persistence

lazy val framework =
liftProject("lift-framework", file("."))
.aggregate(liftProjects: _*)
.settings(publishArtifact := false)

// Core Projects
// -------------
lazy val core: Seq[ProjectReference] =
Seq(common, actor, json, json_scalaz, json_ext, util)

lazy val common =
coreProject("common")
.settings(
description := "Common Libraties and Utilities",
libraryDependencies ++= Seq(slf4j_api, logback, slf4j_log4j12, commons_codec))

lazy val actor =
coreProject("actor")
.dependsOn(common)
.settings(
description := "Simple Actor")

lazy val json =
coreProject("json")
.settings(
description := "JSON Library",
libraryDependencies <++= scalaVersion { sv => Seq(scalap(sv), paranamer) })

lazy val json_scalaz =
coreProject("json-scalaz")
.dependsOn(json)
.settings(
description := "JSON Library based on Scalaz",
libraryDependencies <+= scalaVersion(scalaz))

lazy val json_ext =
coreProject("json-ext")
.dependsOn(common, json)
.settings(
description := "Extentions to JSON Library",
libraryDependencies ++= Seq(commons_codec, joda_time))

lazy val util =
coreProject("util")
.dependsOn(actor, json)
.settings(
description := "Utilities Library",
parallelExecution in Test := false,
libraryDependencies ++= Seq(joda_time, commons_codec, javamail, log4j, htmlparser))


// Web Projects
// ------------
lazy val web: Seq[ProjectReference] =
Seq(testkit, webkit, wizard)

lazy val testkit =
webProject("testkit")
.dependsOn(util)
.settings(
description := "Testkit for Webkit Library",
libraryDependencies ++= Seq(commons_httpclient, servlet_api))

lazy val webkit =
webProject("webkit")
.dependsOn(util, testkit % "provided")
.settings(
description := "Webkit Library",
packageOptions in packageBin += Package.ManifestAttributes("Build-Time" -> Cal.getInstance.getTimeInMillis.toString),
parallelExecution in Test := false,
libraryDependencies <++= scalaVersion { sv =>
Seq(commons_fileupload, servlet_api, specs(sv).copy(configurations = Some("provided")), jetty6, jwebunit)
},
initialize in Test <<= (sourceDirectory in Test) { src =>
System.setProperty("net.liftweb.webapptest.src.test.webapp", (src / "webapp").absString)
})

lazy val wizard =
webProject("wizard")
.dependsOn(webkit, db)
.settings(
description := "Wizard Library")


// Persistence Projects
// --------------------
lazy val persistence: Seq[ProjectReference] =
Seq(db, proto, jpa, mapper, record, couchdb, squeryl_record, mongodb, mongodb_record, ldap)

lazy val db =
persistenceProject("db")
.dependsOn(util)

lazy val proto =
persistenceProject("proto")
.dependsOn(webkit)

lazy val jpa =
persistenceProject("jpa")
.dependsOn(webkit)
.settings(libraryDependencies ++= Seq(scalajpa, persistence_api))

lazy val mapper =
persistenceProject("mapper")
.dependsOn(db, proto)
.settings(
description := "Mapper Library",
parallelExecution in Test := false,
libraryDependencies ++= Seq(h2, derby),
initialize in Test <<= (crossTarget in Test) { ct =>
System.setProperty("derby.stream.error.file", (ct / "derby.log").absolutePath)
})

lazy val record =
persistenceProject("record")
.dependsOn(proto, db)

lazy val couchdb =
persistenceProject("couchdb")
.dependsOn(record)
.settings(
libraryDependencies += dispatch_http)

lazy val squeryl_record =
persistenceProject("squeryl-record")
.dependsOn(record, db)
.settings(libraryDependencies ++= Seq(h2, squeryl))

lazy val mongodb =
persistenceProject("mongodb")
.dependsOn(json_ext)
.settings(
parallelExecution in Test := false,
libraryDependencies += mongo_driver)

lazy val mongodb_record =
persistenceProject("mongodb-record")
.dependsOn(record, mongodb)
.settings(parallelExecution in Test := false)

lazy val ldap =
persistenceProject("ldap")
.dependsOn(mapper)
.settings(
libraryDependencies += apacheds,
initialize in Test <<= (crossTarget in Test) { ct =>
System.setProperty("apacheds.working.dir", (ct / "apacheds").absolutePath)
})

def coreProject = liftProject("core") _
def webProject = liftProject("web") _
def persistenceProject = liftProject("persistence") _

/** Project definition helper that simplifies creation of `ProjectReference`.
*
* It is a convenience method to create a Lift `ProjectReference` module by having the boilerplate for most common
* activities tucked in.
*
* @param base the base path location of project module.
* @param prefix the prefix of project module.
* @param module the name of the project module. Typically, a project id is of the form lift-`module`.
*/
def liftProject(base: String, prefix: String = "lift-")(module: String): Project =
liftProject(
id = if(module.startsWith(prefix)) module else prefix + module,
base = file(base) / module.stripPrefix(prefix))

def liftProject(id: String, base: File): Project =
Project(id, base).settings(LiftBuildPlugin.liftBuildSettings: _*)
}
84 changes: 84 additions & 0 deletions project/Dependencies.scala
@@ -0,0 +1,84 @@
/*
* Copyright 2011 WorldWide Conferencing, LLC
*
* 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.
*/

import sbt._
import Keys._
import net.liftweb.sbt.LiftBuildPlugin.selectDynamic


object Dependencies {

lazy val slf4jVersion = "1.6.4"

lazy val scalacheckVersion = selectDynamic("1.9", "2.8.0" -> "1.7", "2.8.1" -> "1.8", "2.8.2" -> "1.8") _
lazy val specsVersion = selectDynamic("1.6.8", "2.8.0" -> "1.6.5", "2.9.1" -> "1.6.9") _

lazy val scalazGroup = selectDynamic("org.scalaz", "2.8.0" -> "com.googlecode.scalaz") _
lazy val scalazVersion = selectDynamic("6.0.2", "2.8.0" -> "5.0", "2.9.0" -> "6.0.RC2") _

type DynModuleID = String => ModuleID

// Compile scope:
// Scope available in all classpath, transitive by default.
lazy val commons_codec = "commons-codec" % "commons-codec" % "1.4"
lazy val commons_fileupload = "commons-fileupload" % "commons-fileupload" % "1.2.2"
lazy val commons_httpclient = "commons-httpclient" % "commons-httpclient" % "3.1"
lazy val dispatch_http = "net.databinder" %% "dispatch-http" % "0.7.8"
lazy val javamail = "javax.mail" % "mail" % "1.4.4" // TODO: "[1.4.1,)"
lazy val joda_time = "joda-time" % "joda-time" % "1.6.2"
lazy val htmlparser = "nu.validator.htmlparser" % "htmlparser" % "1.2.1"
lazy val mongo_java_driver = "org.mongodb" % "mongo-java-driver" % "2.6.5"
lazy val paranamer = "com.thoughtworks.paranamer" % "paranamer" % "2.4.1"
lazy val scalajpa = "org.scala-libs" %% "scalajpa" % "1.4"
lazy val scalap: DynModuleID = "org.scala-lang" % "scalap" % _
lazy val scalaz_core: DynModuleID = sv => scalazGroup(sv) %% "scalaz-core" % scalazVersion(sv)
lazy val slf4j_api = "org.slf4j" % "slf4j-api" % slf4jVersion
lazy val squeryl = "org.squeryl" %% "squeryl" % "0.9.4"

// Aliases
lazy val mongo_driver = mongo_java_driver
lazy val scalaz = scalaz_core


// Provided scope:
// Scope provided by container, available only in compile and test classpath, non-transitive by default.
lazy val logback = "ch.qos.logback" % "logback-classic" % "1.0.0" % "provided"
lazy val log4j = "log4j" % "log4j" % "1.2.16" % "provided"
lazy val slf4j_log4j12 = "org.slf4j" % "slf4j-log4j12" % slf4jVersion % "provided"
lazy val persistence_api = "javax.persistence" % "persistence-api" % "1.0" % "provided"
lazy val servlet_api = "javax.servlet" % "servlet-api" % "2.5" % "provided"


// Runtime scope:
// Scope provided in runtime, available only in runtime and test classpath, not compile classpath, non-transitive by default.
lazy val derby = "org.apache.derby" % "derby" % "10.7.1.1" % "runtime" //% "optional"
lazy val h2database = "com.h2database" % "h2" % "1.2.147" % "runtime" //% "optional"

// Aliases
lazy val h2 = h2database


// Test scope:
// Scope available only in test classpath, non-transitive by default.
// TODO: See if something alternative with lesser footprint can be used instead of mega heavy apacheds
lazy val apacheds = "org.apache.directory.server" % "apacheds-server-integ" % "1.5.5" % "test"
lazy val jetty6 = "org.mortbay.jetty" % "jetty" % "6.1.26" % "test"
lazy val jwebunit = "net.sourceforge.jwebunit" % "jwebunit-htmlunit-plugin" % "2.5" % "test"
lazy val scalacheck: DynModuleID = "org.scala-tools.testing" %% "scalacheck" % scalacheckVersion(_) % "test"
lazy val specs: DynModuleID = "org.scala-tools.testing" %% "specs" % specsVersion(_) % "test"
lazy val specs2 = "org.specs2" %% "specs2" % "1.5" % "test"

}
10 changes: 1 addition & 9 deletions project/build.properties
@@ -1,9 +1 @@
#
#Fri Jan 27 12:14:38 PST 2012
project.name=lift-framework
project.organization=net.liftweb
project.version=2.5-SNAPSHOT
sbt.version=0.7.7
def.scala.version=2.7.7
build.scala.versions=2.9.1 2.8.1 2.8.0 2.9.0-1 2.9.0
project.initialize=false
sbt.version=0.11.2

0 comments on commit 6fc81a0

Please sign in to comment.