Skip to content

Instantly share code, notes, and snippets.

@samidalouche
Created March 1, 2011 03:23
Show Gist options
  • Save samidalouche/848555 to your computer and use it in GitHub Desktop.
Save samidalouche/848555 to your computer and use it in GitHub Desktop.
import java.io.File
import sbt._
class Project(info: ProjectInfo) extends ParentProject(info) with IdeaProject {
lazy val mavenLocal = "Local Maven Repository" at "file://"+Path.userHome+"/.m2/repository"
lazy val geotoolsRepository = "Open Source Geospatial Foundation Repository" at "http://download.osgeo.org/webdav/geotools/"
lazy val javanetRepository = "Java.net Repository" at "http://download.java.net/maven/2"
lazy val iglootoolsRepository = "Iglootools Releases Repository" at "http://developers.sirika.com/maven2/releases/"
lazy val jbossRepository = "JBoss Releases Repository" at "https://repository.jboss.org/nexus/content/groups/public-jboss"
lazy val hibernateSpatial = "Hibernate Spatial Repository" at "http://www.hibernatespatial.org/repository"
override def parallelExecution = true
// Publishing
override def managedStyle = ManagedStyle.Maven
//lazy val keyFile: File = (Path.userHome / ".ssh" / "id_rsa").asFile
//lazy val publishTo = Resolver.sftp("Iglootools maven2", "iglootools.org", "/srv/http/iglootools.org/maven2/internal") as ("samokk", keyFile)
// Bounded Context: Commons
lazy val commons = project("commons", "igloofinder-commons", new Commons(_))
// Bounded Context: Write Domain
lazy val domain = project("domain", "igloofinder-domain", new Domain(_), commons)
lazy val infrastructure = project("infrastructure", "igloofinder-infrastructure", new Infrastructure(_), domain)
lazy val infrastructureIntegrationTests = project("infrastructure-integration-tests", "igloofinder-infrastructure-integration-tests", new InfrastructureIntegrationTests(_), domain, infrastructure)
// Bounded Context: Web
lazy val webDomain = project("web-domain", "igloofinder-web-domain", new WebDomain(_), commons)
lazy val webInfrastructure = project("web-infrastructure", "igloofinder-web-infrastructure", new WebInfrastructure(_), commons, webDomain)
lazy val webInfrastructureIntegrationTests = project("web-infrastructure-integration-tests", "igloofinder-web-infrastructure-integration-tests", new WebInfrastructureIntegrationTests(_), webDomain, webInfrastructure)
lazy val webui = project("web-ui", "igloofinder-web-ui", new WebUi(_), webDomain)
object Dependencies {
val HibernateVersion = "3.6.1.Final"
val SpringFrameworkVersion = "3.0.5.RELEASE"
val HamcrestVersion = "1.1"
val JunitVersion = "4.8.2"
//val PostgisJdbcVersion = "1.3.3"
val Jsr275Version = "1.0-beta-2"
// test dependencies
lazy val junit = "junit" % "junit" % JunitVersion % "test" withSources()
lazy val junitInterface = "com.novocode" % "junit-interface" % "0.5" % "test->default"
lazy val hamcrest = "org.hamcrest" % "hamcrest-all" % HamcrestVersion % "test" withSources()
lazy val scalaTest = "org.scalatest" % "scalatest" % "1.2" % "test" withSources()
lazy val mockito = "org.mockito" % "mockito-all" % "1.8.5" % "test" withSources()
lazy val logbackTest = "ch.qos.logback" % "logback-classic" % "0.9.27" % "test" // withSources()
def ivyXML =
<dependencies>
<exclude org="ehcache"/>
<exclude module="hibernate" /> <!-- older versions of hibernate -->
</dependencies>
}
class Commons(info: ProjectInfo) extends DefaultProject(info) with IdeaProject {
override def ivyXML =
<dependencies>
${Dependencies.ivyXML \ "exclude" } ++
<override module="spring-aop" rev="3.0.5.RELEASE" />
<override module="spring-asm" rev="3.0.5.RELEASE" />
<override module="spring-beans" rev="3.0.5.RELEASE" />
<override module="spring-context" rev="3.0.5.RELEASE" />
<override module="spring-core" rev="3.0.5.RELEASE" />
<override module="spring-expression" rev="3.0.5.RELEASE" />
</dependencies>
// commons
lazy val slf4jApi = "org.slf4j" % "slf4j-api" % "1.6.1" withSources()
lazy val grizzled = "org.clapper" %% "grizzled-slf4j" % "0.4" // withSources()
lazy val guava = "com.google.guava" % "guava" % "r08" withSources()
lazy val jodaTime = "joda-time" % "joda-time" % "1.6.2" withSources()
// optional dependencies
lazy val hibernateCore = "org.hibernate" % "hibernate-core" % Dependencies.HibernateVersion % "provided" withSources()
lazy val hibernateEntityManager = "org.hibernate" % "hibernate-entitymanager" % Dependencies.HibernateVersion % "provided" withSources()
lazy val springSecurity = "org.springframework.security" % "spring-security-core" % Dependencies.SpringFrameworkVersion % "provided" withSources()
lazy val jsr275 = "net.java.dev.jsr-275" % "jsr-275" % Dependencies.Jsr275Version % "provided" withSources()
lazy val servletApi = "javax.servlet" % "servlet-api" % "2.5" % "provided" withSources()
lazy val providedHamcrest = "org.hamcrest" % "hamcrest-all" % Dependencies.HamcrestVersion % "provided" withSources()
lazy val providedJunit = "junit" % "junit" % Dependencies.JunitVersion % "provided" withSources()
//lazy val postgisJdbc = "org.postgis" % "postgis-jdbc" % Dependencies.PostgisJdbcVersion % "provided" withSources()
// FIXME
//lazy val providedHamcrest = "org.hamcrest" % "hamcrest-all" % Dependencies.HamcrestVersion withSources()
//lazy val providedJunit = "junit" % "junit" % Dependencies.JunitVersion withSources()
// test dependencies
lazy val junit = Dependencies.junit
lazy val junitInterface = Dependencies.junitInterface
lazy val hamcrest = Dependencies.hamcrest
lazy val mockito = Dependencies.mockito
lazy val logback = Dependencies.logbackTest
lazy val springTest = "org.springframework" % "spring-test" % Dependencies.SpringFrameworkVersion % "test" withSources()
override def testOptions = super.testOptions ++ Seq(TestArgument(TestFrameworks.JUnit, "-q", "-v"))
}
class InfrastructureIntegrationTests(info: ProjectInfo) extends DefaultProject(info) with IdeaProject {
override def ivyXML = Dependencies.ivyXML
override def testOptions = TestFilter(s => true) :: super.testOptions.toList
// test dependencies
lazy val junit = Dependencies.junit
lazy val scalaTest = Dependencies.scalaTest
lazy val logback = Dependencies.logbackTest
}
class WebInfrastructureIntegrationTests(info: ProjectInfo) extends DefaultProject(info) with IdeaProject {
override def ivyXML = Dependencies.ivyXML
override def testOptions = TestFilter(s => true) :: super.testOptions.toList
// test dependencies
lazy val junit = Dependencies.junit
lazy val scalaTest = Dependencies.scalaTest
lazy val logback = Dependencies.logbackTest
}
class Domain(info: ProjectInfo) extends DefaultProject(info) with IdeaProject {
override def ivyXML = Dependencies.ivyXML
// test dependencies
lazy val junit = Dependencies.junit
lazy val scalaTest = Dependencies.scalaTest
lazy val mockito = Dependencies.mockito
lazy val logback = Dependencies.logbackTest
}
class WebDomain(info: ProjectInfo) extends DefaultProject(info) with IdeaProject {
override def ivyXML = Dependencies.ivyXML
lazy val jsr275 = "net.java.dev.jsr-275" % "jsr-275" % Dependencies.Jsr275Version withSources()
//lazy val jpaApi = "org.hibernate.javax.persistence" % "hibernate-jpa-2.0-api" % "1.0.0.Final" withSources()
lazy val hibernateCore = "org.hibernate" % "hibernate-core" % Dependencies.HibernateVersion withSources()
lazy val hibernateEntityManager = "org.hibernate" % "hibernate-entitymanager" % Dependencies.HibernateVersion withSources()
lazy val jodaTimeHibernate = "joda-time" % "joda-time-hibernate" % "1.2" withSources()
lazy val springBeans = "org.springframework" % "spring-beans" % Dependencies.SpringFrameworkVersion withSources()
lazy val openplacesearch = "org.iglootools.openplacesearch" %% "openplacesearch-scala-api" % "0.1" withSources()
// test dependencies
lazy val junit = Dependencies.junit
lazy val junitInterface = Dependencies.junitInterface
lazy val hamcrest = Dependencies.hamcrest
lazy val scalaTest = Dependencies.scalaTest
lazy val mockito = Dependencies.mockito
lazy val logbackTest = Dependencies.logbackTest
lazy val springTest = "org.springframework" % "spring-test" % Dependencies.SpringFrameworkVersion % "test" withSources()
lazy val springContext = "org.springframework" % "spring-context" % Dependencies.SpringFrameworkVersion % "test" withSources()
override def testOptions = super.testOptions ++ Seq(TestFilter(s => ! s.contains("TestCase")), TestArgument(TestFrameworks.JUnit, "-q", "-v"))
}
class WebInfrastructure(info: ProjectInfo) extends DefaultProject(info) with IdeaProject {
override def ivyXML = Dependencies.ivyXML
// commons
lazy val slf4jApi = "org.slf4j" % "slf4j-api" % "1.6.1" withSources()
// persistence
lazy val c3p0 = "c3p0" % "c3p0" % "0.9.1.2" withSources()
lazy val hibernateCore = "org.hibernate" % "hibernate-core" % Dependencies.HibernateVersion withSources()
lazy val hibernateEntityManager = "org.hibernate" % "hibernate-entitymanager" % Dependencies.HibernateVersion withSources()
lazy val postgresJdbc = "postgresql" % "postgresql" % "9.0-801.jdbc4" withSources()
//lazy val postgisJdbc = "org.postgis" % "postgis-jdbc" % Dependencies.PostgisJdbcVersion withSources()
lazy val hibernateSpatial = "org.hibernatespatial" % "hibernate-spatial-postgis" % "1.0" withSources()
lazy val ehcacheCore = "net.sf.ehcache" % "ehcache-core" % "2.4.0" withSources()
// spring
lazy val springSecurity = "org.springframework.security" % "spring-security-core" % Dependencies.SpringFrameworkVersion withSources()
lazy val springOrm = "org.springframework" % "spring-orm" % Dependencies.SpringFrameworkVersion withSources()
lazy val springContextSupport = "org.springframework" % "spring-context-support" % Dependencies.SpringFrameworkVersion withSources()
// test dependencies
lazy val junit = Dependencies.junit
lazy val hamcrest = Dependencies.hamcrest
lazy val scalaTest = Dependencies.scalaTest
lazy val mockito = Dependencies.mockito
lazy val logbackTest = Dependencies.logbackTest
lazy val springTest = "org.springframework" % "spring-test" % Dependencies.SpringFrameworkVersion % "test" withSources()
}
class Infrastructure(info: ProjectInfo) extends DefaultProject(info) with IdeaProject {
override def ivyXML = Dependencies.ivyXML
// lazy val hibernateCore = "org.hibernate" % "hibernate-core" % Dependencies.HibernateVersion withSources()
// lazy val hibernateEntityManager = "org.hibernate" % "hibernate-entitymanager" % Dependencies.HibernateVersion withSources()
// lazy val postgisJdbc = "org.postgis" % "postgis-jdbc" % Dependencies.PostgisJdbcVersion withSources()
// test dependencies
lazy val junit = Dependencies.junit
lazy val hamcrest = Dependencies.hamcrest
lazy val scalaTest = Dependencies.scalaTest
lazy val mockito = Dependencies.mockito
lazy val logbackTest = Dependencies.logbackTest
}
class WebUi(info: ProjectInfo) extends DefaultWebProject(info) with IdeaProject {
override def ivyXML = Dependencies.ivyXML
// test dependencies
lazy val jetty7 = "org.eclipse.jetty" % "jetty-webapp" % "7.0.2.RC0" % "test"
lazy val junit = Dependencies.junit
lazy val scalaTest = Dependencies.scalaTest
lazy val mockito = Dependencies.mockito
lazy val logback = Dependencies.logbackTest
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment