2009-08-16 20:29:08 +02:00
import sbt._
2009-11-03 05:02:00 +01:00
import java.io.File
2010-03-20 00:29:57 +01:00
class XSbt ( info : ProjectInfo ) extends ParentProject ( info ) with NoCrossPaths
2009-08-16 20:29:08 +02:00
{
2009-08-26 14:38:20 +02:00
/* Subproject declarations */
2009-09-09 05:13:30 +02:00
val launchInterfaceSub = project ( launchPath / "interface" , "Launcher Interface" , new LaunchInterfaceProject ( _ ) )
2009-08-21 14:12:43 +02:00
val launchSub = project ( launchPath , "Launcher" , new LaunchProject ( _ ) , launchInterfaceSub )
2009-08-17 16:51:43 +02:00
val interfaceSub = project ( "interface" , "Interface" , new InterfaceProject ( _ ) )
2010-01-01 00:56:37 +01:00
val apiSub = baseProject ( compilePath / "api" , "API" , interfaceSub )
2009-08-16 20:29:08 +02:00
2010-07-05 18:53:37 +02:00
// util
2009-11-09 15:34:52 +01:00
val controlSub = baseProject ( utilPath / "control" , "Control" )
2010-07-02 12:57:03 +02:00
val collectionSub = testedBase ( utilPath / "collection" , "Collections" )
2010-08-22 04:49:11 +02:00
val processSub = project ( utilPath / "process" , "Process" , new Base ( _ ) with TestWithIO )
2010-07-02 12:57:03 +02:00
val ioSub = testedBase ( utilPath / "io" , "IO" , controlSub )
2010-07-05 18:53:37 +02:00
val classpathSub = baseProject ( utilPath / "classpath" , "Classpath" , launchInterfaceSub , ioSub )
2010-07-28 05:01:45 +02:00
val completeSub = project ( utilPath / "complete" , "Completion" , new InputProject ( _ ) , controlSub , ioSub )
2010-08-23 01:07:46 +02:00
val logSub = project ( utilPath / "log" , "Logging" , new LogProject ( _ ) , interfaceSub , processSub )
2010-07-15 01:24:50 +02:00
val classfileSub = testedBase ( utilPath / "classfile" , "Classfile" , ioSub , interfaceSub , logSub )
2010-07-05 18:53:37 +02:00
val datatypeSub = baseProject ( utilPath / "datatype" , "Datatype Generator" , ioSub )
2010-07-15 01:24:50 +02:00
val envSub = baseProject ( utilPath / "env" , "Properties" , ioSub , logSub , classpathSub )
2009-11-09 15:34:52 +01:00
2010-07-05 18:53:37 +02:00
// intermediate-level modules
2010-09-04 14:42:37 +02:00
val ivySub = project ( "ivy" , "Ivy" , new IvyProject ( _ ) , interfaceSub , launchInterfaceSub , logSub , ioSub )
2010-07-05 18:53:37 +02:00
val testingSub = project ( "testing" , "Testing" , new TestingProject ( _ ) , ioSub , classpathSub , logSub )
val taskSub = testedBase ( tasksPath , "Tasks" , controlSub , collectionSub )
val cacheSub = project ( cachePath , "Cache" , new CacheProject ( _ ) , ioSub , collectionSub )
2010-09-04 14:08:17 +02:00
val trackingSub = baseProject ( cachePath / "tracking" , "Tracking" , cacheSub , ioSub )
2010-07-15 01:24:50 +02:00
val webappSub = project ( "web" , "Web App" , new WebAppProject ( _ ) , ioSub , logSub , classpathSub , controlSub )
val runSub = baseProject ( "run" , "Run" , ioSub , logSub , classpathSub , processSub )
2010-07-05 18:53:37 +02:00
// compilation/discovery related modules
2009-09-09 05:13:30 +02:00
val compileInterfaceSub = project ( compilePath / "interface" , "Compiler Interface" , new CompilerInterfaceProject ( _ ) , interfaceSub )
2010-07-02 12:57:03 +02:00
val compileIncrementalSub = testedBase ( compilePath / "inc" , "Incremental Compiler" , collectionSub , apiSub , ioSub )
val discoverySub = testedBase ( compilePath / "discover" , "Discovery" , compileIncrementalSub , apiSub )
val compilePersistSub = project ( compilePath / "persist" , "Persist" , new PersistProject ( _ ) , compileIncrementalSub , apiSub )
2010-06-27 15:18:35 +02:00
val compilerSub = project ( compilePath , "Compile" , new CompileProject ( _ ) ,
2010-07-15 01:24:50 +02:00
launchInterfaceSub , interfaceSub , ivySub , ioSub , classpathSub , compileInterfaceSub , logSub )
2010-06-27 15:18:35 +02:00
2010-07-17 18:07:41 +02:00
val buildSub = baseProject ( "main" / "build" , "Project Builder" ,
classfileSub , classpathSub , compilePersistSub , compilerSub , compileIncrementalSub , interfaceSub , ivySub , launchInterfaceSub , logSub , discoverySub , processSub )
2010-09-28 00:39:14 +02:00
val scriptedBaseSub = project ( "scripted" / "base" , "Scripted Framework" , new TestProject ( _ ) , ioSub , processSub )
val scriptedSbtSub = baseProject ( "scripted" / "sbt" , "Scripted sbt" , ioSub , logSub , processSub , scriptedBaseSub , launchInterfaceSub /* should really be a 'provided' dependency */ )
val scriptedPluginSub = project ( "scripted" / "plugin" , "Scripted Plugin" , new Scripted ( _ ) )
// Standard task system. This provides map, flatMap, join, and more on top of the basic task model.
2010-08-14 15:55:49 +02:00
val stdTaskSub = testedBase ( tasksPath / "standard" , "Task System" , taskSub , collectionSub , logSub , ioSub , processSub )
2010-09-22 04:10:21 +02:00
val mainSub = baseProject ( "main" , "Main" ,
2010-09-04 14:30:02 +02:00
buildSub , compileIncrementalSub , compilerSub , completeSub , discoverySub , ioSub , logSub , processSub , taskSub , stdTaskSub , runSub , trackingSub )
2010-09-28 00:39:14 +02:00
// Strictly for bringing implicits and aliases from subsystems into the top-level sbt namespace through a single package object
val sbtSub = project ( sbtPath , "Simple Build Tool" , new Sbt ( _ ) , mainSub ) // technically, we need a dependency on all of mainSub's dependencies, but we don't do that since this is strictly an integration project
2010-07-02 12:57:03 +02:00
2010-07-15 01:24:50 +02:00
/* * following modules are not updated for 2.8 or 0.9 */
2010-09-28 00:39:14 +02:00
/*
2010-07-15 01:24:50 +02:00
val sbtSub = project ( sbtPath , "Simple Build Tool" , new SbtProject ( _ ) { } ,
compilerSub , launchInterfaceSub , testingSub , cacheSub , taskSub )
2010-04-24 00:50:27 +02:00
val installerSub = project ( sbtPath / "install" , "Installer" , new InstallerProject ( _ ) { } , sbtSub )
2010-03-24 01:36:16 +01:00
2010-07-17 18:07:41 +02:00
lazy val dist = task { None } dependsOn ( launchSub . proguard , sbtSub . publishLocal , installerSub . publishLocal ) */
2010-06-07 16:50:51 +02:00
2009-11-11 14:30:39 +01:00
def baseProject ( path : Path , name : String , deps : Project * ) = project ( path , name , new Base ( _ ) , deps : _ * )
2010-07-02 12:57:03 +02:00
def testedBase ( path : Path , name : String , deps : Project * ) = project ( path , name , new TestedBase ( _ ) , deps : _ * )
2009-11-09 15:34:52 +01:00
2009-09-09 05:13:30 +02:00
/* Multi-subproject paths */
2010-04-24 00:50:27 +02:00
def sbtPath = path ( "sbt" )
2009-08-31 16:45:32 +02:00
def cachePath = path ( "cache" )
2009-08-29 16:19:00 +02:00
def tasksPath = path ( "tasks" )
2009-08-21 14:12:43 +02:00
def launchPath = path ( "launch" )
2009-08-18 06:51:08 +02:00
def utilPath = path ( "util" )
def compilePath = path ( "compile" )
2009-08-19 05:25:34 +02:00
2009-09-09 05:13:30 +02:00
def compilerInterfaceClasspath = compileInterfaceSub . projectClasspath ( Configurations . Test )
2009-08-26 14:38:20 +02:00
//run in parallel
2010-02-08 05:45:19 +01:00
override def parallelExecution = true
2010-04-02 02:20:05 +02:00
def jlineDep = "jline" % "jline" % "0.9.94" intransitive ( )
2009-08-26 14:38:20 +02:00
2010-03-20 00:29:57 +01:00
// publish locally when on repository server
2009-10-24 04:04:15 +02:00
override def managedStyle = ManagedStyle . Ivy
2009-11-03 05:02:00 +01:00
val publishTo = Resolver . file ( "test-repo" , new File ( "/var/dbwww/repo/" ) )
2009-10-24 04:04:15 +02:00
2009-08-26 14:38:20 +02:00
/* Subproject configurations */
2010-03-20 00:29:57 +01:00
class LaunchProject ( info : ProjectInfo ) extends Base ( info ) with TestWithIO with TestDependencies with ProguardLaunch with NoCrossPaths
2009-08-21 14:12:43 +02:00
{
2010-01-23 02:17:49 +01:00
val jline = jlineDep
2010-09-22 04:05:57 +02:00
val ivy = "org.apache.ivy" % "ivy" % "2.2.0-rc1"
2009-08-24 04:21:15 +02:00
override def deliverProjectDependencies = Nil
2010-03-20 00:29:57 +01:00
// defines the package that proguard operates on
def rawJarPath = jarPath
def rawPackage = `package`
override def packagePaths = super . packagePaths +++ launchInterfaceSub . packagePaths
// configure testing
2009-12-18 23:46:57 +01:00
override def testClasspath = super . testClasspath +++ interfaceSub . compileClasspath +++ interfaceSub . mainResourcesPath
2010-03-20 00:29:57 +01:00
override def testCompileAction = super . testCompileAction dependsOn ( interfaceSub . publishLocal , testSamples . publishLocal )
// used to test the retrieving and loading of an application: sample app is packaged and published to the local repository
lazy val testSamples = project ( "test-sample" , "Launch Test" , new TestSamples ( _ ) , interfaceSub , launchInterfaceSub )
2010-04-24 00:50:27 +02:00
class TestSamples ( info : ProjectInfo ) extends Base ( info ) with NoCrossPaths with NoRemotePublish {
2010-03-20 00:29:57 +01:00
override def deliverProjectDependencies = Nil
}
2009-08-21 14:12:43 +02:00
}
2010-07-28 05:01:45 +02:00
class InputProject ( info : ProjectInfo ) extends TestedBase ( info )
{
val jline = jlineDep
}
2010-07-15 01:24:50 +02:00
class WebAppProject ( info : ProjectInfo ) extends Base ( info )
{
val jetty = "org.mortbay.jetty" % "jetty" % "6.1.14" % "optional"
2010-08-05 02:33:50 +02:00
val jettyplus = "org.mortbay.jetty" % "jetty-plus" % "6.1.14" % "optional"
2010-07-15 01:24:50 +02:00
val jetty7server = "org.eclipse.jetty" % "jetty-server" % "7.0.1.v20091125" % "optional"
val jetty7webapp = "org.eclipse.jetty" % "jetty-webapp" % "7.0.1.v20091125" % "optional"
2010-08-05 02:33:50 +02:00
val jetty7plus = "org.eclipse.jetty" % "jetty-plus" % "7.0.1.v20091125" % "optional"
2010-07-15 01:24:50 +02:00
val optional = Configurations . Optional
/* For generating JettyRun for Jetty 6 and 7. The only difference is the imports, but the file has to be compiled against each set of imports. */
override def compileAction = super . compileAction dependsOn ( generateJettyRun6 , generateJettyRun7 )
def jettySrcDir = info . projectPath
def jettyTemplate = jettySrcDir / "LazyJettyRun.scala.templ"
lazy val generateJettyRun6 = generateJettyRunN ( "6" )
lazy val generateJettyRun7 = generateJettyRunN ( "7" )
def generateJettyRunN ( n : String ) =
generateJettyRun ( jettyTemplate , jettySrcDir / ( "LazyJettyRun" + n + ".scala" ) , n , jettySrcDir / ( "jetty" + n + ".imports" ) )
def generateJettyRun ( in : Path , out : Path , version : String , importsPath : Path ) =
task
{
( for ( template <- FileUtilities . readString ( in asFile , log ) . right ; imports <- FileUtilities . readString ( importsPath asFile , log ) . right ) yield
FileUtilities . write ( out asFile , processJettyTemplate ( template , version , imports ) , log ) . toLeft ( ( ) ) ) . left . toOption
}
def processJettyTemplate ( template : String , version : String , imports : String ) : String =
template . replaceAll ( """\Q${jetty.version}\E""" , version ) . replaceAll ( """\Q${jetty.imports}\E""" , imports )
}
2009-08-24 04:21:15 +02:00
trait TestDependencies extends Project
2009-08-16 20:29:08 +02:00
{
2010-09-22 04:05:57 +02:00
val sc = "org.scala-tools.testing" % "scalacheck_2.8.0" % "1.7" % "test"
val sp = "org.scala-tools.testing" % "specs_2.8.0" % "1.6.5" % "test"
2009-08-16 20:29:08 +02:00
}
2010-06-14 04:59:29 +02:00
class LogProject ( info : ProjectInfo ) extends Base ( info ) with TestDependencies
2010-06-11 03:26:27 +02:00
{
2010-07-19 18:33:41 +02:00
val opt = Configurations . Optional
val jline = jlineDep % "optional"
2010-06-11 03:26:27 +02:00
}
2010-06-27 15:18:35 +02:00
class CacheProject ( info : ProjectInfo ) extends Base ( info ) with SBinaryDep
2010-07-02 12:57:03 +02:00
class PersistProject ( info : ProjectInfo ) extends Base ( info ) with SBinaryDep
2010-06-27 15:18:35 +02:00
trait SBinaryDep extends BasicManagedProject
2009-08-16 20:29:08 +02:00
{
2009-08-26 14:38:20 +02:00
// these compilation options are useful for debugging caches and task composition
2009-08-16 20:29:08 +02:00
//override def compileOptions = super.compileOptions ++ List(Unchecked,ExplainTypes, CompileOption("-Xlog-implicits"))
2010-09-22 04:05:57 +02:00
val sbinary = "org.scala-tools.sbinary" % "sbinary_2.8.0" % "0.3.1"
2009-08-16 20:29:08 +02:00
}
2010-02-08 05:45:19 +01:00
class Base ( info : ProjectInfo ) extends DefaultProject ( info ) with ManagedBase with Component with Licensed
2009-08-16 20:29:08 +02:00
{
override def scratch = true
2009-09-04 05:40:47 +02:00
override def consoleClasspath = testClasspath
2010-06-16 02:38:18 +02:00
override def compileOptions = super . compileOptions ++ compileOptions ( "-Xelide-below" , "0" )
2009-08-16 20:29:08 +02:00
}
2010-07-02 12:57:03 +02:00
class TestedBase ( info : ProjectInfo ) extends Base ( info ) with TestDependencies
2010-02-08 05:45:19 +01:00
trait Licensed extends BasicScalaProject
{
def notice = path ( "NOTICE" )
abstract override def mainResources = super . mainResources +++ notice +++ Path . lazyPathFinder ( extractLicenses )
lazy val seeRegex = """\(see (.*?)\)""" . r
def licensePath ( str : String ) : Path = { val path = Path . fromString ( XSbt . this . info . projectPath , str ) ; if ( path . exists ) path else error ( "Referenced license '" + str + "' not found at " + path ) }
def seePaths ( noticeString : String ) : List [ Path ] = seeRegex . findAllIn ( noticeString ) . matchData . map ( d => licensePath ( d . group ( 1 ) ) ) . toList
def extractLicenses = if ( ! notice . exists ) Nil else FileUtilities . readString ( notice asFile , log ) . fold ( _ => { log . warn ( "Could not read NOTICE" ) ; Nil } , seePaths _ )
}
2010-07-05 18:53:37 +02:00
class TestingProject ( info : ProjectInfo ) extends Base ( info )
{
val testInterface = "org.scala-tools.testing" % "test-interface" % "0.5"
}
2009-09-27 20:39:26 +02:00
class CompileProject ( info : ProjectInfo ) extends Base ( info ) with TestWithLog with TestWithLaunch
2009-08-24 04:21:15 +02:00
{
2009-09-27 20:39:26 +02:00
override def testCompileAction = super . testCompileAction dependsOn ( compileInterfaceSub . `package` , interfaceSub . `package` )
2010-04-02 02:20:05 +02:00
override def testClasspath = super . testClasspath +++ compileInterfaceSub . packageSrcJar +++ interfaceSub . jarPath --- compilerInterfaceClasspath --- interfaceSub . mainCompilePath
2009-08-24 04:21:15 +02:00
}
2009-09-27 20:39:26 +02:00
class IvyProject ( info : ProjectInfo ) extends Base ( info ) with TestWithIO with TestWithLog with TestWithLaunch
2009-08-16 20:29:08 +02:00
{
2010-09-22 04:05:57 +02:00
val ivy = "org.apache.ivy" % "ivy" % "2.2.0-rc1"
2009-08-16 20:29:08 +02:00
}
2009-11-10 04:02:53 +01:00
abstract class BaseInterfaceProject ( info : ProjectInfo ) extends DefaultProject ( info ) with ManagedBase with TestWithLog with Component with JavaProject
class InterfaceProject ( info : ProjectInfo ) extends BaseInterfaceProject ( info )
2009-08-17 16:51:43 +02:00
{
2009-09-09 05:13:30 +02:00
override def componentID : Option [ String ] = Some ( "xsbti" )
2009-11-10 04:02:53 +01:00
override def packageAction = super . packageAction dependsOn generateVersions
def versionPropertiesPath = mainResourcesPath / "xsbt.version.properties"
lazy val generateVersions = task {
import java.util. { Date , TimeZone }
val formatter = new java . text . SimpleDateFormat ( "yyyyMMdd'T'HHmmss" )
formatter . setTimeZone ( TimeZone . getTimeZone ( "GMT" ) )
val timestamp = formatter . format ( new Date )
2009-12-18 23:46:57 +01:00
val content = "version=" + version + "\ntimestamp=" + timestamp
log . info ( "Writing version information to " + versionPropertiesPath + " :\n" + content )
FileUtilities . write ( versionPropertiesPath . asFile , content , log )
2009-11-10 04:02:53 +01:00
}
2009-11-16 14:46:47 +01:00
override def watchPaths = super . watchPaths +++ apiDefinitionPaths --- sources ( generatedBasePath )
override def mainSourceRoots = super . mainSourceRoots +++ ( generatedBasePath # # )
def srcManagedPath = path ( "src_managed" )
def generatedBasePath = srcManagedPath / "main" / "java"
/* * Files that define the datatypes. */
def apiDefinitionPaths : PathFinder = "definition"
/* * Delete up the generated sources */
lazy val cleanManagedSrc = cleanTask ( srcManagedPath )
override def cleanAction = super . cleanAction dependsOn ( cleanManagedSrc )
/* * Runs the generator compiled by 'compile', putting the classes in src_managed and processing the definitions 'apiDefinitions'. */
lazy val generateSource = generateSourceAction dependsOn ( cleanManagedSrc , datatypeSub . compile )
2010-01-23 02:17:49 +01:00
def generateSourceTask ( immutable : Boolean , pkg : String , apiDefinitions : PathFinder ) : Task =
{
val m = if ( immutable ) "immutable" else "mutable"
generateSourceTask ( m : : pkg :: generatedBasePath . absolutePath :: apiDefinitions . get . toList . map ( _ . absolutePath ) )
}
def generateSourceTask ( args : List [ String ] ) : Task =
runTask ( datatypeSub . getMainClass ( true ) , datatypeSub . runClasspath , args )
def generateSourceAction =
//generateSourceTask(false, "xsbti.api", "definition" +++ "type") &&
generateSourceTask ( true , "xsbti.api" , "other" +++ "definition" +++ "type" )
2009-11-16 14:46:47 +01:00
/* * compiles the generated sources */
override def compileAction = super . compileAction dependsOn ( generateSource )
2009-09-09 05:13:30 +02:00
}
2010-03-24 01:36:16 +01:00
class LaunchInterfaceProject ( info : ProjectInfo ) extends BaseInterfaceProject ( info )
2009-09-09 05:13:30 +02:00
{
override def componentID = None
2009-08-17 16:51:43 +02:00
}
2010-09-28 00:39:14 +02:00
class Scripted ( info : ProjectInfo ) extends PluginProject ( info ) with Licensed
{
override def managedStyle = ManagedStyle . Ivy
override def scratch = true
}
2009-11-09 15:34:52 +01:00
class TestProject ( info : ProjectInfo ) extends Base ( info )
{
val process = "org.scala-tools.sbt" % "process" % "0.1"
}
2010-04-02 02:20:05 +02:00
class CompilerInterfaceProject ( info : ProjectInfo ) extends Base ( info ) with PrecompiledInterface with NoCrossPaths with TestWithIO with TestWithLog
{ cip =>
//val jline = jlineDep artifacts(Artifact("jline", Map("e:component" -> srcID)))
2010-01-23 02:17:49 +01:00
// necessary because jline is not distributed with 2.8 and we will get a compile error
2010-04-02 02:20:05 +02:00
// sbt should work with the above inline declaration, but it doesn't, so the inline Ivy version is used for now.
2010-01-14 04:19:48 +01:00
override def ivyXML =
2010-04-02 02:20:05 +02:00
( < publications />
2010-01-14 04:19:48 +01:00
< dependencies >
2010-04-02 02:20:05 +02:00
< dependency org = "jline" name = "jline" rev = "0.9.94" transitive = "false" >
< artifact name = "jline" type = "jar" e : component = { srcID } />
2010-01-14 04:19:48 +01:00
</ dependency >
2010-04-02 02:20:05 +02:00
</ dependencies > )
def xTestClasspath = projectClasspath ( Configurations . Test )
def srcID = "compiler-interface-src"
lazy val srcArtifact = Artifact ( srcID ) extra ( "e:component" -> srcID )
override def packageSrcJar = mkJarPath ( srcID )
lazy val pkgSrc = packageSrc // call it something else because we don't need dependencies to run package-src
override def packageAction = super . packageAction dependsOn ( pkgSrc )
// sub projects for each version of Scala to precompile against other than the one sbt is built against
// each sub project here will add ~100k to the download
2010-07-17 18:07:41 +02:00
//lazy val precompiled28 = precompiledSub("2.8.0")
lazy val precompiled27 = precompiledSub ( "2.7.7" )
2010-04-02 02:20:05 +02:00
def precompiledSub ( v : String ) =
project ( info . projectPath , "Precompiled " + v , new Precompiled ( v ) ( _ ) , cip . info . dependencies . toSeq : _ * /* doesn ' t include subprojects of cip */ )
/* * A project that compiles the compiler interface against the Scala version 'sv'.
* This is done for selected Scala versions ( generally , popular ones ) so that it doesn 't need to be done at runtime . */
class Precompiled ( sv : String ) ( info : ProjectInfo ) extends Base ( info ) with PrecompiledInterface with NoUpdate {
/* * force the Scala version in order to precompile the compiler interface for different Scala versions */
override def buildScalaVersion = sv
/* * Get compilation classpath from parent. Scala dependencies are added on top of this and this
* subproject does not depend on any Scala subprojects , so mixing versions is not a problem . */
override def compileClasspath = cip . compileClasspath --- cip . mainUnmanagedClasspath +++ mainUnmanagedClasspath
2010-07-17 18:07:41 +02:00
override def compileOptions = Nil
2010-04-02 02:20:05 +02:00
// these ensure that the classes compiled against other versions of Scala are not exported (for compilation/testing/...)
override def projectClasspath ( config : Configuration ) = Path . emptyPathFinder
}
2009-09-05 18:19:34 +02:00
}
2009-09-27 20:39:26 +02:00
trait TestWithIO extends TestWith {
override def testWithTestClasspath = super . testWithTestClasspath ++ Seq ( ioSub )
}
trait TestWithLaunch extends TestWith {
override def testWithTestClasspath = super . testWithTestClasspath ++ Seq ( launchSub )
}
trait TestWithLog extends TestWith {
override def testWithCompileClasspath = super . testWithCompileClasspath ++ Seq ( logSub )
}
trait TestWith extends BasicScalaProject
2009-08-21 14:55:11 +02:00
{
2009-09-27 20:39:26 +02:00
def testWithCompileClasspath : Seq [ BasicScalaProject ] = Nil
def testWithTestClasspath : Seq [ BasicScalaProject ] = Nil
override def testCompileAction = super . testCompileAction dependsOn ( ( testWithTestClasspath . map ( _ . testCompile ) ++ testWithCompileClasspath . map ( _ . compile ) ) : _ * )
override def testClasspath = ( super . testClasspath /: ( testWithTestClasspath . map ( _ . testClasspath ) ++ testWithCompileClasspath . map ( _ . compileClasspath ) ) ) ( _ +++ _ )
2009-08-21 14:55:11 +02:00
}
2010-09-28 00:39:14 +02:00
class Sbt ( info : ProjectInfo ) extends Base ( info ) with TestWith
{
override def normalizedName = "sbt"
override def testWithCompileClasspath = super . testWithCompileClasspath ++ Seq ( scriptedSbtSub )
override def testAction = super . testAction dependsOn ( publishLocal )
def scriptedScalaVersions = "2.8.1.RC1"
lazy val scripted = task { args => task {
val launcher = launchSub . outputJar . asFile
val loader = ClasspathUtilities . toLoader ( scriptedSbtSub . testClasspath , buildScalaInstance . loader )
val m = ModuleUtilities . getObject ( "sbt.test.ScriptedTests" , loader )
val r = m . getClass . getMethod ( "run" , classOf [ File ] , classOf [ Boolean ] , classOf [ String ] , classOf [ String ] , classOf [ String ] , classOf [ Array [ String ] ] , classOf [ File ] )
try { r . invoke ( m , sourcePath / "sbt-test" asFile , true : java . lang . Boolean , version . toString , buildScalaVersion , scriptedScalaVersions , args , launcher ) }
catch { case e : java . lang . reflect . InvocationTargetException => throw e . getCause }
None
} dependsOn ( publishLocal , scriptedSbtSub . compile ) }
}
2010-06-16 02:38:18 +02:00
}