sbt/project/build/SbtProject.scala

62 lines
2.8 KiB
Scala
Raw Normal View History

/* sbt -- Simple Build Tool
* Copyright 2008, 2009 Mark Harrah
*/
import sbt._
import java.io.File
2009-12-05 17:02:41 +01:00
import java.net.URL
2010-05-17 03:33:27 +02:00
abstract class SbtProject(info: ProjectInfo) extends DefaultProject(info) with test.SbtScripted with posterous.Publish with Sxr
{
2009-10-19 17:14:27 +02:00
/* Additional resources to include in the produced jar.*/
def extraResources = descendents(info.projectPath / "licenses", "*") +++ "LICENSE" +++ "NOTICE"
override def mainResources = super.mainResources +++ extraResources
2009-10-19 17:14:27 +02:00
override def normalizedName = "sbt"
2009-10-24 04:03:53 +02:00
override def managedStyle = ManagedStyle.Ivy
2009-12-05 17:02:41 +01:00
//val publishTo = Resolver.file("technically", new File("/var/dbwww/repo/"))
val technically = Resolver.url("technically.us", new URL("http://databinder.net/repo/"))(Resolver.ivyStylePatterns)
2009-10-24 04:03:53 +02:00
override def compileOptions = CompileOption("-Xno-varargs-conversion") :: Nil
2009-12-12 14:38:35 +01:00
/** configuration of scripted testing **/
// Set to false to show logging as it happens without buffering, true to buffer until it completes and only show if the task fails.
2010-02-15 04:59:35 +01:00
// The output of scripted tasks executed in parallel will be inteleaved if false.
2010-02-15 05:43:51 +01:00
override def scriptedBufferLog = true
// Configure which versions of Scala to test against for those tests that do cross building
2010-06-22 03:25:48 +02:00
override def scriptedBuildVersions = "2.7.7 2.7.5 2.7.2 2.8.0.RC6 2.8.0.RC3"
override def useDefaultConfigurations = false
val default = Configurations.Default
val optional = Configurations.Optional
val provided = Configurations.Provided
2010-01-11 01:06:16 +01:00
val testConf = Configurations.Test
2010-05-14 00:36:05 +02:00
val docConf = Configurations.Javadoc
val srcConf = Configurations.Sources
//testing
2010-06-22 03:25:48 +02:00
val scalacheck = "org.scala-tools.testing" %% "scalacheck" % "1.7" % "test"
val ivy = "org.apache.ivy" % "ivy" % "2.1.0" intransitive()
val jsch = "com.jcraft" % "jsch" % "0.1.31" intransitive()
val testInterface = "org.scala-tools.testing" % "test-interface" % "0.5"
2009-10-23 01:10:54 +02:00
2010-05-14 00:36:05 +02:00
def concatPaths[T](s: Seq[T])(f: PartialFunction[T, PathFinder]): PathFinder =
{
def finder: T => PathFinder = (f orElse { case _ => Path.emptyPathFinder })
(Path.emptyPathFinder /: s) { _ +++ finder(_) }
}
def deepSources = concatPaths(topologicalSort){ case p: ScalaPaths => p.mainSources }
lazy val sbtGenDoc = scaladocTask("sbt", deepSources, docPath, docClasspath, documentOptions) dependsOn(compile)
lazy val sbtDoc = packageTask(mainDocPath ##, packageDocsJar, Recursive) dependsOn(sbtGenDoc)
lazy val sbtSrc = packageTask(deepSources, packageSrcJar, packageOptions) dependsOn(compile)
2010-05-17 03:33:27 +02:00
override def packageToPublishActions = super.packageToPublishActions //++ Seq(sbtSrc, sbtDoc, sxr)
2010-05-14 00:36:05 +02:00
override def packageDocsJar = defaultJarPath("-javadoc.jar")
override def packageSrcJar= defaultJarPath("-sources.jar")
2010-05-17 02:54:22 +02:00
/*val sourceArtifact = Artifact(artifactID, "src", "jar", "sources")
val docsArtifact = Artifact(artifactID, "doc", "jar", "javadoc")*/
}