2011-01-19 00:24:11 +01:00
/* sbt -- Simple Build Tool
* Copyright 2011 Mark Harrah
*/
package sbt
/* * An abstraction on top of Settings for build configuration and task definition. */
import java.io.File
import java.net.URI
2012-07-31 17:52:10 +02:00
import ConcurrentRestrictions.Tag
import Def. { Initialize , KeyedInitialize , ScopedKey , Setting , setting }
2011-04-14 13:32:42 +02:00
import Path._
2012-07-31 17:52:10 +02:00
import std.TaskExtra. { task => mktask , _ }
import Task._
import Types._
2011-01-19 00:24:11 +01:00
2012-07-31 17:52:10 +02:00
import language.experimental.macros
2011-10-16 23:27:36 +02:00
sealed trait Scoped { def scope : Scope ; val key : AttributeKey [ _ ] }
2011-10-17 02:20:45 +02:00
/* * A common type for SettingKey and TaskKey so that both can be used as inputs to tasks. */
2012-07-31 17:52:10 +02:00
sealed trait ScopedTaskable [ T ] extends Scoped {
def toTask : Initialize [ Task [ T ] ]
}
2011-10-17 02:20:45 +02:00
/* * Identifies a setting. It consists of three parts: the scope, the name, and the type of a value associated with this key.
* The scope is represented by a value of type Scope .
* The name and the type are represented by a value of type AttributeKey [ T ] .
* Instances are constructed using the companion object . */
2012-12-02 09:17:19 +01:00
sealed abstract class SettingKey [ T ] extends ScopedTaskable [ T ] with KeyedInitialize [ T ] with Scoped . ScopingSetting [ SettingKey [ T ] ] with Scoped . DefinableSetting [ T ]
2011-08-14 16:53:37 +02:00
{
2011-10-16 23:27:36 +02:00
val key : AttributeKey [ T ]
2012-11-02 19:20:17 +01:00
final def toTask : Initialize [ Task [ T ] ] = this apply inlineTask
final def scopedKey : ScopedKey [ T ] = ScopedKey ( scope , key )
final def in ( scope : Scope ) : SettingKey [ T ] = Scoped . scopedSetting ( Scope . replaceThis ( this . scope ) ( scope ) , this . key )
2011-08-14 16:53:37 +02:00
2012-11-02 19:20:17 +01:00
final def : = ( v : T ) : Setting [ T ] = macro std . TaskMacro . settingAssignMacroImpl [ T ]
final def += [ U ] ( v : U ) ( implicit a : Append.Value [ T , U ] ) : Setting [ T ] = macro std . TaskMacro . settingAppend1Impl [ T ,U ]
final def ++= [ U ] ( vs : U ) ( implicit a : Append.Values [ T , U ] ) : Setting [ T ] = macro std . TaskMacro . settingAppendNImpl [ T ,U ]
2012-12-02 09:17:20 +01:00
final def <+= [ V ] ( value : Initialize [ V ] ) ( implicit a : Append.Value [ T , V ] ) : Setting [ T ] = make ( value , NoPosition ) ( a . appendValue )
final def <++= [ V ] ( values : Initialize [ V ] ) ( implicit a : Append.Values [ T , V ] ) : Setting [ T ] = make ( values , NoPosition ) ( a . appendValues )
2012-07-31 17:52:10 +02:00
2012-12-02 09:17:20 +01:00
final def append1 [ V ] ( value : Initialize [ V ] , source : SourcePosition ) ( implicit a : Append.Value [ T , V ] ) : Setting [ T ] = make ( value , source ) ( a . appendValue )
final def appendN [ V ] ( values : Initialize [ V ] , source : SourcePosition ) ( implicit a : Append.Values [ T , V ] ) : Setting [ T ] = make ( values , source ) ( a . appendValues )
protected [ this ] def make [ S ] ( other : Initialize [ S ] , source : SourcePosition ) ( f : ( T , S ) => T ) : Setting [ T ] = this . set ( ( this , other ) ( f ) , source )
2011-08-14 16:53:37 +02:00
}
2011-10-17 02:20:45 +02:00
/* * Identifies a task. It consists of three parts: the scope, the name, and the type of the value computed by a task associated with this key.
* The scope is represented by a value of type Scope .
* The name and the type are represented by a value of type AttributeKey [ Task [ T ] ] .
* Instances are constructed using the companion object . */
2012-12-02 09:17:19 +01:00
sealed abstract class TaskKey [ T ] extends ScopedTaskable [ T ] with KeyedInitialize [ Task [ T ] ] with Scoped . ScopingSetting [ TaskKey [ T ] ] with Scoped . DefinableTask [ T ]
2011-08-14 16:53:37 +02:00
{
2011-10-16 23:27:36 +02:00
val key : AttributeKey [ Task [ T ] ]
2012-07-31 17:52:10 +02:00
def toTask : Initialize [ Task [ T ] ] = this
2011-08-14 16:53:37 +02:00
def scopedKey : ScopedKey [ Task [ T ] ] = ScopedKey ( scope , key )
2011-10-16 23:27:36 +02:00
def in ( scope : Scope ) : TaskKey [ T ] = Scoped . scopedTask ( Scope . replaceThis ( this . scope ) ( scope ) , this . key )
2011-01-19 00:24:11 +01:00
2012-07-31 17:52:10 +02:00
def += [ U ] ( v : U ) ( implicit a : Append.Value [ T , U ] ) : Setting [ Task [ T ] ] = macro std . TaskMacro . taskAppend1Impl [ T ,U ]
def ++= [ U ] ( vs : U ) ( implicit a : Append.Values [ T , U ] ) : Setting [ Task [ T ] ] = macro std . TaskMacro . taskAppendNImpl [ T ,U ]
2012-12-02 09:17:20 +01:00
def <+= [ V ] ( v : Initialize [ Task [ V ] ] ) ( implicit a : Append.Value [ T , V ] ) : Setting [ Task [ T ] ] = make ( v , NoPosition ) ( a . appendValue )
def <++= [ V ] ( vs : Initialize [ Task [ V ] ] ) ( implicit a : Append.Values [ T , V ] ) : Setting [ Task [ T ] ] = make ( vs , NoPosition ) ( a . appendValues )
def append1 [ V ] ( v : Initialize [ Task [ V ] ] , source : SourcePosition ) ( implicit a : Append.Value [ T , V ] ) : Setting [ Task [ T ] ] = make ( v , source ) ( a . appendValue )
def appendN [ V ] ( vs : Initialize [ Task [ V ] ] , source : SourcePosition ) ( implicit a : Append.Values [ T , V ] ) : Setting [ Task [ T ] ] = make ( vs , source ) ( a . appendValues )
2012-07-31 17:52:10 +02:00
2012-12-02 09:17:20 +01:00
private [ this ] def make [ S ] ( other : Initialize [ Task [ S ] ] , source : SourcePosition ) ( f : ( T , S ) => T ) : Setting [ Task [ T ] ] =
set ( ( this , other ) { ( a , b ) => ( a , b ) map f . tupled } , source )
2011-08-14 16:53:37 +02:00
}
2011-10-17 02:20:45 +02:00
/* * Identifies an input task. An input task parses input and produces a task to run.
* It consists of three parts : the scope , the name , and the type of the value produced by an input task associated with this key .
* The scope is represented by a value of type Scope .
2011-10-17 03:29:39 +02:00
* The name and the type are represented by a value of type AttributeKey [ InputTask [ T ] ] .
2011-10-17 02:20:45 +02:00
* Instances are constructed using the companion object . */
2011-10-16 23:27:36 +02:00
sealed trait InputKey [ T ] extends Scoped with KeyedInitialize [ InputTask [ T ] ] with Scoped . ScopingSetting [ InputKey [ T ] ] with Scoped . DefinableSetting [ InputTask [ T ] ]
2011-08-14 16:53:37 +02:00
{
2011-10-16 23:27:36 +02:00
val key : AttributeKey [ InputTask [ T ] ]
2011-08-14 16:53:37 +02:00
def scopedKey : ScopedKey [ InputTask [ T ] ] = ScopedKey ( scope , key )
2011-10-16 23:27:36 +02:00
def in ( scope : Scope ) : InputKey [ T ] = Scoped . scopedInput ( Scope . replaceThis ( this . scope ) ( scope ) , this . key )
2012-11-02 19:20:17 +01:00
def : = ( v : T ) : Setting [ InputTask [ T ] ] = macro std . TaskMacro . inputTaskAssignMacroImpl [ T ]
2011-08-14 16:53:37 +02:00
}
2011-10-17 02:20:45 +02:00
/* * Methods and types related to constructing settings, including keys, scopes, and initializations. */
2011-01-19 00:24:11 +01:00
object Scoped
{
2011-10-16 23:27:36 +02:00
implicit def taskScopedToKey [ T ] ( s : TaskKey [ T ] ) : ScopedKey [ Task [ T ] ] = ScopedKey ( s . scope , s . key )
implicit def inputScopedToKey [ T ] ( s : InputKey [ T ] ) : ScopedKey [ InputTask [ T ] ] = ScopedKey ( s . scope , s . key )
2011-03-01 14:48:14 +01:00
2011-08-14 16:53:37 +02:00
sealed trait ScopingSetting [ Result ]
2011-01-19 00:24:11 +01:00
{
2011-08-14 16:53:37 +02:00
def in ( s : Scope ) : Result
2011-02-05 04:02:39 +01:00
2011-03-03 12:44:19 +01:00
def in ( p : Reference ) : Result = in ( Select ( p ) , This , This )
2011-02-10 14:16:07 +01:00
def in ( t : Scoped ) : Result = in ( This , This , Select ( t . key ) )
2011-02-05 04:02:39 +01:00
def in ( c : ConfigKey ) : Result = in ( This , Select ( c ) , This )
2011-02-10 14:16:07 +01:00
def in ( c : ConfigKey , t : Scoped ) : Result = in ( This , Select ( c ) , Select ( t . key ) )
2011-03-03 12:44:19 +01:00
def in ( p : Reference , c : ConfigKey ) : Result = in ( Select ( p ) , Select ( c ) , This )
def in ( p : Reference , t : Scoped ) : Result = in ( Select ( p ) , This , Select ( t . key ) )
def in ( p : Reference , c : ConfigKey , t : Scoped ) : Result = in ( Select ( p ) , Select ( c ) , Select ( t . key ) )
def in ( p : ScopeAxis [ Reference ] , c : ScopeAxis [ ConfigKey ] , t : ScopeAxis [ AttributeKey [ _ ] ] ) : Result = in ( Scope ( p , c , t , This ) )
2011-01-19 00:24:11 +01:00
}
2011-01-29 03:15:39 +01:00
2011-10-16 23:27:36 +02:00
def scopedSetting [ T ] ( s : Scope , k : AttributeKey [ T ] ) : SettingKey [ T ] = new SettingKey [ T ] { val scope = s ; val key = k }
def scopedInput [ T ] ( s : Scope , k : AttributeKey [ InputTask [ T ] ] ) : InputKey [ T ] = new InputKey [ T ] { val scope = s ; val key = k }
def scopedTask [ T ] ( s : Scope , k : AttributeKey [ Task [ T ] ] ) : TaskKey [ T ] = new TaskKey [ T ] { val scope = s ; val key = k }
2011-01-19 00:24:11 +01:00
2011-08-14 16:53:37 +02:00
sealed trait DefinableSetting [ S ]
2011-01-19 00:24:11 +01:00
{
2011-08-14 16:53:37 +02:00
def scopedKey : ScopedKey [ S ]
2012-07-31 17:52:10 +02:00
private [ sbt ] final def : = = ( value : S ) : Setting [ S ] = setting ( scopedKey , Def . valueStrict ( value ) )
2012-07-31 17:52:10 +02:00
final def ~= ( f : S => S ) : Setting [ S ] = Def . update ( scopedKey ) ( f )
2012-12-02 09:17:20 +01:00
final def <<= ( app : Initialize [ S ] ) : Setting [ S ] = set ( app , NoPosition )
final def set ( app : Initialize [ S ] , source : SourcePosition ) : Setting [ S ] = setting ( scopedKey , app , source )
2011-08-14 16:53:37 +02:00
final def get ( settings : Settings [ Scope ] ) : Option [ S ] = settings . get ( scopedKey . scope , scopedKey . key )
2012-07-31 17:52:10 +02:00
final def ? : Initialize [ Option [ S ] ] = Def . optional ( scopedKey ) ( idFun )
2011-08-14 16:53:37 +02:00
final def or [ T >: S ] ( i : Initialize [ T ] ) : Initialize [ T ] = ( this . ? , i ) ( _ getOrElse _ )
2012-07-31 17:52:10 +02:00
final def ?? [ T >: S ] ( or : => T ) : Initialize [ T ] = Def . optional ( scopedKey ) ( _ getOrElse or )
2011-08-14 16:53:37 +02:00
}
final class RichInitialize [ S ] ( init : Initialize [ S ] )
2011-01-19 00:24:11 +01:00
{
2011-08-14 16:53:37 +02:00
def map [ T ] ( f : S => T ) : Initialize [ Task [ T ] ] = init ( s => mktask ( f ( s ) ) )
def flatMap [ T ] ( f : S => Task [ T ] ) : Initialize [ Task [ T ] ] = init ( f )
}
sealed trait DefinableTask [ S ]
2011-10-16 23:27:36 +02:00
{ self : TaskKey [ S ] =>
2011-08-14 16:53:37 +02:00
2012-07-31 17:52:10 +02:00
private [ sbt ] def : = = ( v : S ) : Setting [ Task [ S ] ] = : := ( constant ( v ) )
private [ sbt ] def : := ( value : Task [ S ] ) : Setting [ Task [ S ] ] = Def . setting ( scopedKey , Def . valueStrict ( value ) )
def : = ( v : S ) : Setting [ Task [ S ] ] = macro std . TaskMacro . taskAssignMacroImpl [ S ] //::=(mktask(value))
2011-10-16 23:27:36 +02:00
private [ sbt ] def : = = ( v : SettingKey [ S ] ) : Setting [ Task [ S ] ] = <<= ( v ( constant ) )
2012-07-31 17:52:10 +02:00
def ~= ( f : S => S ) : Setting [ Task [ S ] ] = Def . update ( scopedKey ) ( _ map f )
2011-01-19 00:24:11 +01:00
2012-12-02 09:17:20 +01:00
def <<= ( app : Initialize [ Task [ S ] ] ) : Setting [ Task [ S ] ] = set ( app , NoPosition )
def set ( app : Initialize [ Task [ S ] ] , source : SourcePosition ) : Setting [ Task [ S ] ] = Def . setting ( scopedKey , app , source )
2011-01-19 00:24:11 +01:00
2011-10-16 23:27:36 +02:00
def task : SettingKey [ Task [ S ] ] = scopedSetting ( scope , key )
2011-01-19 00:24:11 +01:00
def get ( settings : Settings [ Scope ] ) : Option [ Task [ S ] ] = settings . get ( scope , key )
2012-07-31 17:52:10 +02:00
def ? : Initialize [ Task [ Option [ S ] ] ] = Def . optional ( scopedKey ) { case None => mktask { None } ; case Some ( t ) => t map some . fn }
def ?? [ T >: S ] ( or : => T ) : Initialize [ Task [ T ] ] = Def . optional ( scopedKey ) ( _ getOrElse mktask ( or ) )
2012-07-31 17:52:10 +02:00
def or [ T >: S ] ( i : Initialize [ Task [ T ] ] ) : Initialize [ Task [ T ] ] = ( this . ? zipWith i ) ( ( x , y ) => ( x , y ) map { case ( a , b ) => a getOrElse b } )
2011-03-01 14:48:14 +01:00
}
2011-12-13 23:29:08 +01:00
final class RichInitializeTask [ S ] ( i : Initialize [ Task [ S ] ] ) extends RichInitTaskBase [ S , Task ]
2011-03-01 14:48:14 +01:00
{
2011-12-13 23:29:08 +01:00
protected def onTask [ T ] ( f : Task [ S ] => Task [ T ] ) : Initialize [ Task [ T ] ] = i apply f
2011-08-14 16:53:37 +02:00
2012-08-24 19:27:34 +02:00
def dependsOn ( tasks : AnyInitTask * ) : Initialize [ Task [ S ] ] = ( i , Initialize . joinAny [ Task ] ( tasks ) ) { ( thisTask , deps ) => thisTask . dependsOn ( deps : _ * ) }
2011-08-14 16:53:37 +02:00
2012-12-02 09:17:19 +01:00
def failure : Initialize [ Task [ Incomplete ] ] = i ( _ . failure )
def result : Initialize [ Task [ Result [ S ] ] ] = i ( _ . result )
2012-07-31 17:52:10 +02:00
def triggeredBy ( tasks : AnyInitTask * ) : Initialize [ Task [ S ] ] = nonLocal ( tasks , Def . triggeredBy )
def runBefore ( tasks : AnyInitTask * ) : Initialize [ Task [ S ] ] = nonLocal ( tasks , Def . runBefore )
2011-08-14 16:53:37 +02:00
private [ this ] def nonLocal ( tasks : Seq [ AnyInitTask ] , key : AttributeKey [ Seq [ Task [ _ ] ] ] ) : Initialize [ Task [ S ] ] =
2012-08-24 19:27:34 +02:00
( Initialize . joinAny [ Task ] ( tasks ) , i ) { ( ts , i ) => i . copy ( info = i . info . set ( key , ts ) ) }
2011-03-01 14:48:14 +01:00
}
2011-12-13 23:29:08 +01:00
final class RichInitializeInputTask [ S ] ( i : Initialize [ InputTask [ S ] ] ) extends RichInitTaskBase [ S ,InputTask ]
{
protected def onTask [ T ] ( f : Task [ S ] => Task [ T ] ) : Initialize [ InputTask [ T ] ] = i ( _ mapTask f )
2012-08-24 19:27:34 +02:00
def dependsOn ( tasks : AnyInitTask * ) : Initialize [ InputTask [ S ] ] = ( i , Initialize . joinAny [ Task ] ( tasks ) ) { ( thisTask , deps ) => thisTask . mapTask ( _ . dependsOn ( deps : _ * ) ) }
2011-12-13 23:29:08 +01:00
}
sealed abstract class RichInitTaskBase [ S , R [ _ ] ]
{
protected def onTask [ T ] ( f : Task [ S ] => Task [ T ] ) : Initialize [ R [ T ] ]
def flatMap [ T ] ( f : S => Task [ T ] ) : Initialize [ R [ T ] ] = flatMapR ( f compose successM )
def map [ T ] ( f : S => T ) : Initialize [ R [ T ] ] = mapR ( f compose successM )
def andFinally ( fin : => Unit ) : Initialize [ R [ S ] ] = onTask ( _ andFinally fin )
def doFinally ( t : Task [ Unit ] ) : Initialize [ R [ S ] ] = onTask ( _ doFinally t )
def || [ T >: S ] ( alt : Task [ T ] ) : Initialize [ R [ T ] ] = onTask ( _ || alt )
def && [ T ] ( alt : Task [ T ] ) : Initialize [ R [ T ] ] = onTask ( _ && alt )
2012-07-31 17:52:10 +02:00
def tag ( tags : Tag * ) : Initialize [ R [ S ] ] = onTask ( _ . tag ( tags : _ * ) )
def tagw ( tags : ( Tag , Int ) * ) : Initialize [ R [ S ] ] = onTask ( _ . tagw ( tags : _ * ) )
2012-12-02 09:17:19 +01:00
@deprecated ( "Use the `result` method to create a task that returns the full Result of this task. Then, call `flatMap` on the new task." , "0.13.0" )
def flatMapR [ T ] ( f : Result [ S ] => Task [ T ] ) : Initialize [ R [ T ] ] = onTask ( _ flatMapR f )
@deprecated ( "Use the `result` method to create a task that returns the full Result of this task. Then, call `map` on the new task." , "0.13.0" )
def mapR [ T ] ( f : Result [ S ] => T ) : Initialize [ R [ T ] ] = onTask ( _ mapR f )
@deprecated ( "Use the `failure` method to create a task that returns Incomplete when this task fails and then call `flatMap` on the new task." , "0.13.0" )
def flatFailure [ T ] ( f : Incomplete => Task [ T ] ) : Initialize [ R [ T ] ] = flatMapR ( f compose failM )
@deprecated ( "Use the `failure` method to create a task that returns Incomplete when this task fails and then call `map` on the new task." , "0.13.0" )
def mapFailure [ T ] ( f : Incomplete => T ) : Initialize [ R [ T ] ] = mapR ( f compose failM )
2011-12-13 23:29:08 +01:00
}
2011-08-14 16:53:37 +02:00
type AnyInitTask = Initialize [ Task [ T ] ] forSome { type T }
implicit def richTaskSeq [ T ] ( in : Seq [ Initialize [ Task [ T ] ] ] ) : RichTaskSeq [ T ] = new RichTaskSeq ( in )
final class RichTaskSeq [ T ] ( keys : Seq [ Initialize [ Task [ T ] ] ] )
2011-02-10 14:16:07 +01:00
{
2011-08-14 16:53:37 +02:00
def join : Initialize [ Task [ Seq [ T ] ] ] = tasks ( _ . join )
def tasks : Initialize [ Seq [ Task [ T ] ] ] = Initialize . join ( keys )
2011-02-10 14:16:07 +01:00
}
2011-08-14 16:53:37 +02:00
implicit def richAnyTaskSeq ( in : Seq [ AnyInitTask ] ) : RichAnyTaskSeq = new RichAnyTaskSeq ( in )
final class RichAnyTaskSeq ( keys : Seq [ AnyInitTask ] )
2011-04-23 17:49:58 +02:00
{
2012-08-24 19:27:34 +02:00
def dependOn : Initialize [ Task [ Unit ] ] = Initialize . joinAny [ Task ] ( keys ) . apply ( deps => nop . dependsOn ( deps : _ * ) )
2011-04-23 17:49:58 +02:00
}
2011-10-16 23:27:36 +02:00
implicit def richFileSetting ( s : SettingKey [ File ] ) : RichFileSetting = new RichFileSetting ( s )
implicit def richFilesSetting ( s : SettingKey [ Seq [ File ] ] ) : RichFilesSetting = new RichFilesSetting ( s )
2011-04-14 13:32:42 +02:00
2011-10-16 23:27:36 +02:00
final class RichFileSetting ( s : SettingKey [ File ] ) extends RichFileBase
2011-04-14 13:32:42 +02:00
{
2012-07-31 17:52:10 +02:00
@deprecated ( "Use a standard setting definition." , "0.13.0" )
2011-04-14 13:32:42 +02:00
def / ( c : String ) : Initialize [ File ] = s { _ / c }
protected [ this ] def map0 ( f : PathFinder => PathFinder ) = s ( file => finder ( f ) ( file : : Nil ) )
}
2011-10-16 23:27:36 +02:00
final class RichFilesSetting ( s : SettingKey [ Seq [ File ] ] ) extends RichFileBase
2011-04-14 13:32:42 +02:00
{
2012-07-31 17:52:10 +02:00
@deprecated ( "Use a standard setting definition." , "0.13.0" )
2011-04-14 13:32:42 +02:00
def / ( s : String ) : Initialize [ Seq [ File ] ] = map0 { _ / s }
protected [ this ] def map0 ( f : PathFinder => PathFinder ) = s ( finder ( f ) )
}
sealed abstract class RichFileBase
{
2012-07-31 17:52:10 +02:00
@deprecated ( "Use a standard setting definition." , "0.13.0" )
2011-04-14 13:32:42 +02:00
def * ( filter : FileFilter ) : Initialize [ Seq [ File ] ] = map0 { _ * filter }
2012-07-31 17:52:10 +02:00
@deprecated ( "Use a standard setting definition." , "0.13.0" )
2011-04-14 13:32:42 +02:00
def ** ( filter : FileFilter ) : Initialize [ Seq [ File ] ] = map0 { _ ** filter }
protected [ this ] def map0 ( f : PathFinder => PathFinder ) : Initialize [ Seq [ File ] ]
protected [ this ] def finder ( f : PathFinder => PathFinder ) : Seq [ File ] => Seq [ File ] =
2011-05-15 00:21:41 +02:00
in => f ( in ) . get
2011-04-14 13:32:42 +02:00
}
2011-01-31 05:19:28 +01:00
// this is the least painful arrangement I came up with
implicit def t2ToTable2 [ A ,B ] ( t2 : ( ScopedTaskable [ A ] , ScopedTaskable [ B ] ) ) : RichTaskable2 [ A ,B ] = new RichTaskable2 ( t2 )
implicit def t3ToTable3 [ A ,B ,C ] ( t3 : ( ScopedTaskable [ A ] , ScopedTaskable [ B ] , ScopedTaskable [ C ] ) ) : RichTaskable3 [ A ,B ,C ] = new RichTaskable3 ( t3 )
implicit def t4ToTable4 [ A ,B ,C ,D ] ( t4 : ( ScopedTaskable [ A ] , ScopedTaskable [ B ] , ScopedTaskable [ C ] , ScopedTaskable [ D ] ) ) : RichTaskable4 [ A ,B ,C ,D ] = new RichTaskable4 ( t4 )
implicit def t5ToTable5 [ A ,B ,C ,D ,E ] ( t5 : ( ScopedTaskable [ A ] , ScopedTaskable [ B ] , ScopedTaskable [ C ] , ScopedTaskable [ D ] , ScopedTaskable [ E ] ) ) : RichTaskable5 [ A ,B ,C ,D ,E ] = new RichTaskable5 ( t5 )
implicit def t6ToTable6 [ A ,B ,C ,D ,E ,F ] ( t6 : ( ScopedTaskable [ A ] , ScopedTaskable [ B ] , ScopedTaskable [ C ] , ScopedTaskable [ D ] , ScopedTaskable [ E ] , ScopedTaskable [ F ] ) ) : RichTaskable6 [ A ,B ,C ,D ,E ,F ] = new RichTaskable6 ( t6 )
implicit def t7ToTable7 [ A ,B ,C ,D ,E ,F ,G ] ( t7 : ( ScopedTaskable [ A ] , ScopedTaskable [ B ] , ScopedTaskable [ C ] , ScopedTaskable [ D ] , ScopedTaskable [ E ] , ScopedTaskable [ F ] , ScopedTaskable [ G ] ) ) : RichTaskable7 [ A ,B ,C ,D ,E ,F ,G ] = new RichTaskable7 ( t7 )
implicit def t8ToTable8 [ A ,B ,C ,D ,E ,F ,G ,H ] ( t8 : ( ScopedTaskable [ A ] , ScopedTaskable [ B ] , ScopedTaskable [ C ] , ScopedTaskable [ D ] , ScopedTaskable [ E ] , ScopedTaskable [ F ] , ScopedTaskable [ G ] , ScopedTaskable [ H ] ) ) : RichTaskable8 [ A ,B ,C ,D ,E ,F ,G ,H ] = new RichTaskable8 ( t8 )
implicit def t9ToTable9 [ A ,B ,C ,D ,E ,F ,G ,H ,I ] ( t9 : ( ScopedTaskable [ A ] , ScopedTaskable [ B ] , ScopedTaskable [ C ] , ScopedTaskable [ D ] , ScopedTaskable [ E ] , ScopedTaskable [ F ] , ScopedTaskable [ G ] , ScopedTaskable [ H ] , ScopedTaskable [ I ] ) ) : RichTaskable9 [ A ,B ,C ,D ,E ,F ,G ,H ,I ] = new RichTaskable9 ( t9 )
2011-12-13 21:30:06 +01:00
implicit def t10ToTable10 [ A ,B ,C ,D ,E ,F ,G ,H ,I ,J ] ( t10 : ( ScopedTaskable [ A ] , ScopedTaskable [ B ] , ScopedTaskable [ C ] , ScopedTaskable [ D ] , ScopedTaskable [ E ] , ScopedTaskable [ F ] , ScopedTaskable [ G ] , ScopedTaskable [ H ] , ScopedTaskable [ I ] , ScopedTaskable [ J ] ) ) : RichTaskable10 [ A ,B ,C ,D ,E ,F ,G ,H ,I ,J ] = new RichTaskable10 ( t10 )
implicit def t11ToTable11 [ A ,B ,C ,D ,E ,F ,G ,H ,I ,J ,K ] ( t11 : ( ScopedTaskable [ A ] , ScopedTaskable [ B ] , ScopedTaskable [ C ] , ScopedTaskable [ D ] , ScopedTaskable [ E ] , ScopedTaskable [ F ] , ScopedTaskable [ G ] , ScopedTaskable [ H ] , ScopedTaskable [ I ] , ScopedTaskable [ J ] , ScopedTaskable [ K ] ) ) : RichTaskable11 [ A ,B ,C ,D ,E ,F ,G ,H ,I ,J ,K ] = new RichTaskable11 ( t11 )
2012-07-31 17:52:10 +02:00
/* implicit def t12ToTable12[A,B,C,D,E,F,G,H,I,J,K,L](t12: (ScopedTaskable[A], ScopedTaskable[B], ScopedTaskable[C], ScopedTaskable[D], ScopedTaskable[E], ScopedTaskable[F], ScopedTaskable[G], ScopedTaskable[H], ScopedTaskable[I], ScopedTaskable[J], ScopedTaskable[K], ScopedTaskable[L]) ): RichTaskable12[A,B,C,D,E,F,G,H,I,J,K,L] = new RichTaskable12(t12)
2011-12-13 21:30:06 +01:00
implicit def t13ToTable13 [ A ,B ,C ,D ,E ,F ,G ,H ,I ,J ,K ,L ,N ] ( t13 : ( ScopedTaskable [ A ] , ScopedTaskable [ B ] , ScopedTaskable [ C ] , ScopedTaskable [ D ] , ScopedTaskable [ E ] , ScopedTaskable [ F ] , ScopedTaskable [ G ] , ScopedTaskable [ H ] , ScopedTaskable [ I ] , ScopedTaskable [ J ] , ScopedTaskable [ K ] , ScopedTaskable [ L ] , ScopedTaskable [ N ] ) ) : RichTaskable13 [ A ,B ,C ,D ,E ,F ,G ,H ,I ,J ,K ,L ,N ] = new RichTaskable13 ( t13 )
implicit def t14ToTable14 [ A ,B ,C ,D ,E ,F ,G ,H ,I ,J ,K ,L ,N ,O ] ( t14 : ( ScopedTaskable [ A ] , ScopedTaskable [ B ] , ScopedTaskable [ C ] , ScopedTaskable [ D ] , ScopedTaskable [ E ] , ScopedTaskable [ F ] , ScopedTaskable [ G ] , ScopedTaskable [ H ] , ScopedTaskable [ I ] , ScopedTaskable [ J ] , ScopedTaskable [ K ] , ScopedTaskable [ L ] , ScopedTaskable [ N ] , ScopedTaskable [ O ] ) ) : RichTaskable14 [ A ,B ,C ,D ,E ,F ,G ,H ,I ,J ,K ,L ,N ,O ] = new RichTaskable14 ( t14 )
2012-07-31 17:52:10 +02:00
implicit def t15ToTable15 [ A ,B ,C ,D ,E ,F ,G ,H ,I ,J ,K ,L ,N ,O ,P ] ( t15 : ( ScopedTaskable [ A ] , ScopedTaskable [ B ] , ScopedTaskable [ C ] , ScopedTaskable [ D ] , ScopedTaskable [ E ] , ScopedTaskable [ F ] , ScopedTaskable [ G ] , ScopedTaskable [ H ] , ScopedTaskable [ I ] , ScopedTaskable [ J ] , ScopedTaskable [ K ] , ScopedTaskable [ L ] , ScopedTaskable [ N ] , ScopedTaskable [ O ] , ScopedTaskable [ P ] ) ) : RichTaskable15 [ A ,B ,C ,D ,E ,F ,G ,H ,I ,J ,K ,L ,N ,O ,P ] = new RichTaskable15 ( t15 ) */
2011-01-31 05:19:28 +01:00
2012-07-31 17:52:10 +02:00
sealed abstract class RichTaskables [ K [ L [ x ] ] ] ( final val keys : K [ ScopedTaskable ] ) ( implicit a : AList [ K ] )
2011-01-31 05:19:28 +01:00
{
2011-02-12 02:22:17 +01:00
type App [ T ] = Initialize [ Task [ T ] ]
2011-01-31 05:19:28 +01:00
type Fun [ M [ _ ] ,Ret ]
2012-07-31 17:52:10 +02:00
protected def convert [ M [ _ ] ,Ret ] ( f : Fun [ M ,Ret ] ) : K [ M ] => Ret
private [ this ] val inputs : K [ App ] = a . transform ( keys , new ( ScopedTaskable ~> App ) { def apply [ T ] ( in : ScopedTaskable [ T ] ) : App [ T ] = in . toTask } )
private [ this ] def onTasks [ T ] ( f : K [ Task ] => Task [ T ] ) : App [ T ] = Def . app [ ( { type l [ L [ x ] ] = K [ ( L ∙ Task ) # l ] } ) # l ,Task [ T ] ] ( inputs ) ( f ) ( AList . asplit [ K ,Task ] ( a ) )
def flatMap [ T ] ( f : Fun [ Id ,Task [ T ] ] ) : App [ T ] = onTasks ( _ . flatMap ( convert ( f ) ) )
def flatMapR [ T ] ( f : Fun [ Result ,Task [ T ] ] ) : App [ T ] = onTasks ( _ . flatMapR ( convert ( f ) ) )
def map [ T ] ( f : Fun [ Id , T ] ) : App [ T ] = onTasks ( _ . mapR ( convert ( f ) compose allM ) )
def mapR [ T ] ( f : Fun [ Result ,T ] ) : App [ T ] = onTasks ( _ . mapR ( convert ( f ) ) )
def flatFailure [ T ] ( f : Seq [ Incomplete ] => Task [ T ] ) : App [ T ] = onTasks ( _ flatFailure f )
def mapFailure [ T ] ( f : Seq [ Incomplete ] => T ) : App [ T ] = onTasks ( _ mapFailure f )
}
type ST [ X ] = ScopedTaskable [ X ]
final class RichTaskable2 [ A ,B ] ( t2 : ( ST [ A ] , ST [ B ] ) ) extends RichTaskables [ AList . T2K [ A ,B ] # l ] ( t2 ) ( AList . tuple2 [ A ,B ] )
2011-01-31 05:19:28 +01:00
{
type Fun [ M [ _ ] ,Ret ] = ( M [ A ] , M [ B ] ) => Ret
2011-04-16 18:05:42 +02:00
def identityMap = map ( mkTuple2 )
2012-07-31 17:52:10 +02:00
protected def convert [ M [ _ ] ,R ] ( f : ( M [ A ] , M [ B ] ) => R ) = f . tupled
2011-01-31 05:19:28 +01:00
}
2012-07-31 17:52:10 +02:00
final class RichTaskable3 [ A ,B ,C ] ( t3 : ( ST [ A ] , ST [ B ] , ST [ C ] ) ) extends RichTaskables [ AList . T3K [ A ,B ,C ] # l ] ( t3 ) ( AList . tuple3 [ A ,B ,C ] )
2011-01-31 05:19:28 +01:00
{
type Fun [ M [ _ ] ,Ret ] = ( M [ A ] , M [ B ] , M [ C ] ) => Ret
2011-04-16 18:05:42 +02:00
def identityMap = map ( mkTuple3 )
2012-07-31 17:52:10 +02:00
protected def convert [ M [ _ ] ,R ] ( f : Fun [ M ,R ] ) = f . tupled
2011-01-31 05:19:28 +01:00
}
2012-07-31 17:52:10 +02:00
final class RichTaskable4 [ A ,B ,C ,D ] ( t4 : ( ST [ A ] , ST [ B ] , ST [ C ] , ST [ D ] ) ) extends RichTaskables [ AList . T4K [ A ,B ,C ,D ] # l ] ( t4 ) ( AList . tuple4 [ A ,B ,C ,D ] )
2011-01-31 05:19:28 +01:00
{
type Fun [ M [ _ ] ,Ret ] = ( M [ A ] , M [ B ] , M [ C ] , M [ D ] ) => Ret
2011-04-16 18:05:42 +02:00
def identityMap = map ( mkTuple4 )
2012-07-31 17:52:10 +02:00
protected def convert [ M [ _ ] ,R ] ( f : Fun [ M ,R ] ) = f . tupled
2011-01-31 05:19:28 +01:00
}
2012-07-31 17:52:10 +02:00
final class RichTaskable5 [ A ,B ,C ,D ,E ] ( t5 : ( ST [ A ] , ST [ B ] , ST [ C ] , ST [ D ] , ST [ E ] ) ) extends RichTaskables [ AList . T5K [ A ,B ,C ,D ,E ] # l ] ( t5 ) ( AList . tuple5 [ A ,B ,C ,D ,E ] )
2011-01-31 05:19:28 +01:00
{
type Fun [ M [ _ ] ,Ret ] = ( M [ A ] , M [ B ] , M [ C ] , M [ D ] , M [ E ] ) => Ret
2011-04-16 18:05:42 +02:00
def identityMap = map ( mkTuple5 )
2012-07-31 17:52:10 +02:00
protected def convert [ M [ _ ] ,R ] ( f : Fun [ M ,R ] ) = f . tupled
2011-01-31 05:19:28 +01:00
}
2012-07-31 17:52:10 +02:00
final class RichTaskable6 [ A ,B ,C ,D ,E ,F ] ( t6 : ( ST [ A ] , ST [ B ] , ST [ C ] , ST [ D ] , ST [ E ] , ST [ F ] ) ) extends RichTaskables [ AList . T6K [ A ,B ,C ,D ,E ,F ] # l ] ( t6 ) ( AList . tuple6 [ A ,B ,C ,D ,E ,F ] )
2011-01-31 05:19:28 +01:00
{
type Fun [ M [ _ ] ,Ret ] = ( M [ A ] , M [ B ] , M [ C ] , M [ D ] , M [ E ] , M [ F ] ) => Ret
2011-04-16 18:05:42 +02:00
def identityMap = map ( mkTuple6 )
2012-07-31 17:52:10 +02:00
protected def convert [ M [ _ ] ,R ] ( z : Fun [ M ,R ] ) = z . tupled
2011-01-31 05:19:28 +01:00
}
2012-07-31 17:52:10 +02:00
final class RichTaskable7 [ A ,B ,C ,D ,E ,F ,G ] ( t7 : ( ST [ A ] , ST [ B ] , ST [ C ] , ST [ D ] , ST [ E ] , ST [ F ] , ST [ G ] ) ) extends RichTaskables [ AList . T7K [ A ,B ,C ,D ,E ,F ,G ] # l ] ( t7 ) ( AList . tuple7 [ A ,B ,C ,D ,E ,F ,G ] )
2011-01-31 05:19:28 +01:00
{
type Fun [ M [ _ ] ,Ret ] = ( M [ A ] , M [ B ] , M [ C ] , M [ D ] , M [ E ] , M [ F ] , M [ G ] ) => Ret
2011-04-16 18:05:42 +02:00
def identityMap = map ( mkTuple7 )
2012-07-31 17:52:10 +02:00
protected def convert [ M [ _ ] ,R ] ( z : Fun [ M ,R ] ) = z . tupled
2011-01-31 05:19:28 +01:00
}
2012-07-31 17:52:10 +02:00
final class RichTaskable8 [ A ,B ,C ,D ,E ,F ,G ,H ] ( t8 : ( ST [ A ] , ST [ B ] , ST [ C ] , ST [ D ] , ST [ E ] , ST [ F ] , ST [ G ] , ST [ H ] ) ) extends RichTaskables [ AList . T8K [ A ,B ,C ,D ,E ,F ,G ,H ] # l ] ( t8 ) ( AList . tuple8 [ A ,B ,C ,D ,E ,F ,G ,H ] )
2011-01-31 05:19:28 +01:00
{
type Fun [ M [ _ ] ,Ret ] = ( M [ A ] , M [ B ] , M [ C ] , M [ D ] , M [ E ] , M [ F ] , M [ G ] , M [ H ] ) => Ret
2011-04-16 18:05:42 +02:00
def identityMap = map ( mkTuple8 )
2012-07-31 17:52:10 +02:00
protected def convert [ M [ _ ] ,R ] ( z : Fun [ M ,R ] ) = z . tupled
2011-01-31 05:19:28 +01:00
}
2012-07-31 17:52:10 +02:00
final class RichTaskable9 [ A ,B ,C ,D ,E ,F ,G ,H ,I ] ( t9 : ( ST [ A ] , ST [ B ] , ST [ C ] , ST [ D ] , ST [ E ] , ST [ F ] , ST [ G ] , ST [ H ] , ST [ I ] ) ) extends RichTaskables [ AList . T9K [ A ,B ,C ,D ,E ,F ,G ,H ,I ] # l ] ( t9 ) ( AList . tuple9 [ A ,B ,C ,D ,E ,F ,G ,H ,I ] )
2011-01-31 05:19:28 +01:00
{
type Fun [ M [ _ ] ,Ret ] = ( M [ A ] , M [ B ] , M [ C ] , M [ D ] , M [ E ] , M [ F ] , M [ G ] , M [ H ] , M [ I ] ) => Ret
2011-04-16 18:05:42 +02:00
def identityMap = map ( mkTuple9 )
2012-07-31 17:52:10 +02:00
protected def convert [ M [ _ ] ,R ] ( z : Fun [ M ,R ] ) = z . tupled
2011-01-31 05:19:28 +01:00
}
2012-07-31 17:52:10 +02:00
final class RichTaskable10 [ A ,B ,C ,D ,E ,F ,G ,H ,I ,J ] ( t10 : ( ( ST [ A ] , ST [ B ] , ST [ C ] , ST [ D ] , ST [ E ] , ST [ F ] , ST [ G ] , ST [ H ] , ST [ I ] , ST [ J ] ) ) ) extends RichTaskables [ AList . T10K [ A ,B ,C ,D ,E ,F ,G ,H ,I ,J ] # l ] ( t10 ) ( AList . tuple10 [ A ,B ,C ,D ,E ,F ,G ,H ,I ,J ] )
2011-12-13 21:30:06 +01:00
{
type Fun [ M [ _ ] ,Ret ] = ( M [ A ] , M [ B ] , M [ C ] , M [ D ] , M [ E ] , M [ F ] , M [ G ] , M [ H ] , M [ I ] , M [ J ] ) => Ret
def identityMap = map ( mkTuple10 )
2012-07-31 17:52:10 +02:00
protected def convert [ M [ _ ] ,R ] ( z : Fun [ M ,R ] ) = z . tupled
2011-12-13 21:30:06 +01:00
}
2012-07-31 17:52:10 +02:00
final class RichTaskable11 [ A ,B ,C ,D ,E ,F ,G ,H ,I ,J ,K ] ( t11 : ( ( ST [ A ] , ST [ B ] , ST [ C ] , ST [ D ] , ST [ E ] , ST [ F ] , ST [ G ] , ST [ H ] , ST [ I ] , ST [ J ] , ST [ K ] ) ) ) extends RichTaskables [ AList . T11K [ A ,B ,C ,D ,E ,F ,G ,H ,I ,J ,K ] # l ] ( t11 ) ( AList . tuple11 [ A ,B ,C ,D ,E ,F ,G ,H ,I ,J ,K ] )
2011-12-13 21:30:06 +01:00
{
type Fun [ M [ _ ] ,Ret ] = ( M [ A ] , M [ B ] , M [ C ] , M [ D ] , M [ E ] , M [ F ] , M [ G ] , M [ H ] , M [ I ] , M [ J ] , M [ K ] ) => Ret
def identityMap = map ( mkTuple11 )
2012-07-31 17:52:10 +02:00
protected def convert [ M [ _ ] ,R ] ( z : Fun [ M ,R ] ) = z . tupled
2011-12-13 21:30:06 +01:00
}
2012-07-31 17:52:10 +02:00
/* final class RichTaskable12[A,B,C,D,E,F,G,H,I,J,K,L](t12: ((ST[A], ST[B], ST[C], ST[D], ST[E], ST[F], ST[G], ST[H], ST[I], ST[J], ST[K], ST[L]))) extends RichTaskables(k12(t12))
2011-12-13 21:30:06 +01:00
{
type Fun [ M [ _ ] ,Ret ] = ( M [ A ] , M [ B ] , M [ C ] , M [ D ] , M [ E ] , M [ F ] , M [ G ] , M [ H ] , M [ I ] , M [ J ] , M [ K ] , M [ L ] ) => Ret
def identityMap = map ( mkTuple12 )
2012-07-31 17:52:10 +02:00
protected def convert [ M [ _ ] ,R ] ( z : Fun [ M ,R ] ) = z . tupled
2011-12-13 21:30:06 +01:00
}
2012-07-31 17:52:10 +02:00
final class RichTaskable13 [ A ,B ,C ,D ,E ,F ,G ,H ,I ,J ,K ,L ,N ] ( t13 : ( ( ST [ A ] , ST [ B ] , ST [ C ] , ST [ D ] , ST [ E ] , ST [ F ] , ST [ G ] , ST [ H ] , ST [ I ] , ST [ J ] , ST [ K ] , ST [ L ] , ST [ N ] ) ) ) extends RichTaskables ( k13 ( t13 ) )
2011-12-13 21:30:06 +01:00
{
type Fun [ M [ _ ] ,Ret ] = ( M [ A ] , M [ B ] , M [ C ] , M [ D ] , M [ E ] , M [ F ] , M [ G ] , M [ H ] , M [ I ] , M [ J ] , M [ K ] , M [ L ] , M [ N ] ) => Ret
def identityMap = map ( mkTuple13 )
2012-07-31 17:52:10 +02:00
protected def convert [ M [ _ ] ,R ] ( z : Fun [ M ,R ] ) = z . tupled
2011-12-13 21:30:06 +01:00
}
2012-07-31 17:52:10 +02:00
final class RichTaskable14 [ A ,B ,C ,D ,E ,F ,G ,H ,I ,J ,K ,L ,N ,O ] ( t14 : ( ( ST [ A ] , ST [ B ] , ST [ C ] , ST [ D ] , ST [ E ] , ST [ F ] , ST [ G ] , ST [ H ] , ST [ I ] , ST [ J ] , ST [ K ] , ST [ L ] , ST [ N ] , ST [ O ] ) ) ) extends RichTaskables ( k14 ( t14 ) )
2011-12-13 21:30:06 +01:00
{
type Fun [ M [ _ ] ,Ret ] = ( M [ A ] , M [ B ] , M [ C ] , M [ D ] , M [ E ] , M [ F ] , M [ G ] , M [ H ] , M [ I ] , M [ J ] , M [ K ] , M [ L ] , M [ N ] , M [ O ] ) => Ret
def identityMap = map ( mkTuple14 )
2012-07-31 17:52:10 +02:00
protected def convert [ M [ _ ] ,R ] ( z : Fun [ M ,R ] ) = z . tupled
2011-12-13 21:30:06 +01:00
}
2012-07-31 17:52:10 +02:00
final class RichTaskable15 [ A ,B ,C ,D ,E ,F ,G ,H ,I ,J ,K ,L ,N ,O ,P ] ( t15 : ( ( ST [ A ] , ST [ B ] , ST [ C ] , ST [ D ] , ST [ E ] , ST [ F ] , ST [ G ] , ST [ H ] , ST [ I ] , ST [ J ] , ST [ K ] , ST [ L ] , ST [ N ] , ST [ O ] , ST [ P ] ) ) ) extends RichTaskables ( k15 ( t15 ) )
2011-12-13 21:30:06 +01:00
{
type Fun [ M [ _ ] ,Ret ] = ( M [ A ] , M [ B ] , M [ C ] , M [ D ] , M [ E ] , M [ F ] , M [ G ] , M [ H ] , M [ I ] , M [ J ] , M [ K ] , M [ L ] , M [ N ] , M [ O ] , M [ P ] ) => Ret
def identityMap = map ( mkTuple15 )
2012-07-31 17:52:10 +02:00
protected def convert [ M [ _ ] ,R ] ( z : Fun [ M ,R ] ) = z . tupled
} */
2011-01-29 03:15:39 +01:00
2011-08-14 16:53:37 +02:00
implicit def t2ToApp2 [ A ,B ] ( t2 : ( Initialize [ A ] , Initialize [ B ] ) ) : Apply2 [ A ,B ] = new Apply2 ( t2 )
implicit def t3ToApp3 [ A ,B ,C ] ( t3 : ( Initialize [ A ] , Initialize [ B ] , Initialize [ C ] ) ) : Apply3 [ A ,B ,C ] = new Apply3 ( t3 )
implicit def t4ToApp4 [ A ,B ,C ,D ] ( t4 : ( Initialize [ A ] , Initialize [ B ] , Initialize [ C ] , Initialize [ D ] ) ) : Apply4 [ A ,B ,C ,D ] = new Apply4 ( t4 )
implicit def t5ToApp5 [ A ,B ,C ,D ,E ] ( t5 : ( Initialize [ A ] , Initialize [ B ] , Initialize [ C ] , Initialize [ D ] , Initialize [ E ] ) ) : Apply5 [ A ,B ,C ,D ,E ] = new Apply5 ( t5 )
implicit def t6ToApp6 [ A ,B ,C ,D ,E ,F ] ( t6 : ( Initialize [ A ] , Initialize [ B ] , Initialize [ C ] , Initialize [ D ] , Initialize [ E ] , Initialize [ F ] ) ) : Apply6 [ A ,B ,C ,D ,E ,F ] = new Apply6 ( t6 )
implicit def t7ToApp7 [ A ,B ,C ,D ,E ,F ,G ] ( t7 : ( Initialize [ A ] , Initialize [ B ] , Initialize [ C ] , Initialize [ D ] , Initialize [ E ] , Initialize [ F ] , Initialize [ G ] ) ) : Apply7 [ A ,B ,C ,D ,E ,F ,G ] = new Apply7 ( t7 )
implicit def t8ToApp8 [ A ,B ,C ,D ,E ,F ,G ,H ] ( t8 : ( Initialize [ A ] , Initialize [ B ] , Initialize [ C ] , Initialize [ D ] , Initialize [ E ] , Initialize [ F ] , Initialize [ G ] , Initialize [ H ] ) ) : Apply8 [ A ,B ,C ,D ,E ,F ,G ,H ] = new Apply8 ( t8 )
implicit def t9ToApp9 [ A ,B ,C ,D ,E ,F ,G ,H ,I ] ( t9 : ( Initialize [ A ] , Initialize [ B ] , Initialize [ C ] , Initialize [ D ] , Initialize [ E ] , Initialize [ F ] , Initialize [ G ] , Initialize [ H ] , Initialize [ I ] ) ) : Apply9 [ A ,B ,C ,D ,E ,F ,G ,H ,I ] = new Apply9 ( t9 )
2011-12-13 21:30:06 +01:00
implicit def t10ToApp10 [ A ,B ,C ,D ,E ,F ,G ,H ,I ,J ] ( t10 : ( Initialize [ A ] , Initialize [ B ] , Initialize [ C ] , Initialize [ D ] , Initialize [ E ] , Initialize [ F ] , Initialize [ G ] , Initialize [ H ] , Initialize [ I ] , Initialize [ J ] ) ) : Apply10 [ A ,B ,C ,D ,E ,F ,G ,H ,I ,J ] = new Apply10 ( t10 )
implicit def t11ToApp11 [ A ,B ,C ,D ,E ,F ,G ,H ,I ,J ,K ] ( t11 : ( Initialize [ A ] , Initialize [ B ] , Initialize [ C ] , Initialize [ D ] , Initialize [ E ] , Initialize [ F ] , Initialize [ G ] , Initialize [ H ] , Initialize [ I ] , Initialize [ J ] , Initialize [ K ] ) ) : Apply11 [ A ,B ,C ,D ,E ,F ,G ,H ,I ,J ,K ] = new Apply11 ( t11 )
2012-07-31 17:52:10 +02:00
/* implicit def t12ToApp12[A,B,C,D,E,F,G,H,I,J,K,L](t12: (Initialize[A], Initialize[B], Initialize[C], Initialize[D], Initialize[E], Initialize[F], Initialize[G], Initialize[H], Initialize[I], Initialize[J], Initialize[K], Initialize[L]) ): Apply12[A,B,C,D,E,F,G,H,I,J,K,L] = new Apply12(t12)
2011-12-13 21:30:06 +01:00
implicit def t13ToApp13 [ A ,B ,C ,D ,E ,F ,G ,H ,I ,J ,K ,L ,N ] ( t13 : ( Initialize [ A ] , Initialize [ B ] , Initialize [ C ] , Initialize [ D ] , Initialize [ E ] , Initialize [ F ] , Initialize [ G ] , Initialize [ H ] , Initialize [ I ] , Initialize [ J ] , Initialize [ K ] , Initialize [ L ] , Initialize [ N ] ) ) : Apply13 [ A ,B ,C ,D ,E ,F ,G ,H ,I ,J ,K ,L ,N ] = new Apply13 ( t13 )
implicit def t14ToApp14 [ A ,B ,C ,D ,E ,F ,G ,H ,I ,J ,K ,L ,N ,O ] ( t14 : ( Initialize [ A ] , Initialize [ B ] , Initialize [ C ] , Initialize [ D ] , Initialize [ E ] , Initialize [ F ] , Initialize [ G ] , Initialize [ H ] , Initialize [ I ] , Initialize [ J ] , Initialize [ K ] , Initialize [ L ] , Initialize [ N ] , Initialize [ O ] ) ) : Apply14 [ A ,B ,C ,D ,E ,F ,G ,H ,I ,J ,K ,L ,N ,O ] = new Apply14 ( t14 )
implicit def t15ToApp15 [ A ,B ,C ,D ,E ,F ,G ,H ,I ,J ,K ,L ,N ,O ,P ] ( t15 : ( Initialize [ A ] , Initialize [ B ] , Initialize [ C ] , Initialize [ D ] , Initialize [ E ] , Initialize [ F ] , Initialize [ G ] , Initialize [ H ] , Initialize [ I ] , Initialize [ J ] , Initialize [ K ] , Initialize [ L ] , Initialize [ N ] , Initialize [ O ] , Initialize [ P ] ) ) : Apply15 [ A ,B ,C ,D ,E ,F ,G ,H ,I ,J ,K ,L ,N ,O ,P ] = new Apply15 ( t15 )
2012-07-31 17:52:10 +02:00
*/
2011-04-16 18:05:42 +02:00
def mkTuple2 [ A ,B ] = ( a : A , b : B ) => ( a , b )
def mkTuple3 [ A ,B ,C ] = ( a : A , b : B , c : C ) => ( a , b , c )
def mkTuple4 [ A ,B ,C ,D ] = ( a : A , b : B , c : C , d : D ) => ( a , b , c , d )
def mkTuple5 [ A ,B ,C ,D ,E ] = ( a : A , b : B , c : C , d : D , e : E ) => ( a , b , c , d , e )
def mkTuple6 [ A ,B ,C ,D ,E ,F ] = ( a : A , b : B , c : C , d : D , e : E , f : F ) => ( a , b , c , d , e , f )
def mkTuple7 [ A ,B ,C ,D ,E ,F ,G ] = ( a : A , b : B , c : C , d : D , e : E , f : F , g : G ) => ( a , b , c , d , e , f , g )
def mkTuple8 [ A ,B ,C ,D ,E ,F ,G ,H ] = ( a : A , b : B , c : C , d : D , e : E , f : F , g : G , h : H ) => ( a , b , c , d , e , f , g , h )
def mkTuple9 [ A ,B ,C ,D ,E ,F ,G ,H ,I ] = ( a : A , b : B , c : C , d : D , e : E , f : F , g : G , h : H , i : I ) => ( a , b , c , d , e , f , g , h , i )
2011-12-13 21:30:06 +01:00
def mkTuple10 [ A ,B ,C ,D ,E ,F ,G ,H ,I ,J ] = ( a : A , b : B , c : C , d : D , e : E , f : F , g : G , h : H , i : I , j : J ) => ( a , b , c , d , e , f , g , h , i , j )
def mkTuple11 [ A ,B ,C ,D ,E ,F ,G ,H ,I ,J ,K ] = ( a : A , b : B , c : C , d : D , e : E , f : F , g : G , h : H , i : I , j : J , k : K ) => ( a , b , c , d , e , f , g , h , i , j , k )
def mkTuple12 [ A ,B ,C ,D ,E ,F ,G ,H ,I ,J ,K ,L ] = ( a : A , b : B , c : C , d : D , e : E , f : F , g : G , h : H , i : I , j : J , k : K , l : L ) => ( a , b , c , d , e , f , g , h , i , j , k , l )
def mkTuple13 [ A ,B ,C ,D ,E ,F ,G ,H ,I ,J ,K ,L ,N ] = ( a : A , b : B , c : C , d : D , e : E , f : F , g : G , h : H , i : I , j : J , k : K , l : L , n : N ) => ( a , b , c , d , e , f , g , h , i , j , k , l , n )
def mkTuple14 [ A ,B ,C ,D ,E ,F ,G ,H ,I ,J ,K ,L ,N ,O ] = ( a : A , b : B , c : C , d : D , e : E , f : F , g : G , h : H , i : I , j : J , k : K , l : L , n : N , o : O ) => ( a , b , c , d , e , f , g , h , i , j , k , l , n , o )
def mkTuple15 [ A ,B ,C ,D ,E ,F ,G ,H ,I ,J ,K ,L ,N ,O ,P ] = ( a : A , b : B , c : C , d : D , e : E , f : F , g : G , h : H , i : I , j : J , k : K , l : L , n : N , o : O , p : P ) => ( a , b , c , d , e , f , g , h , i , j , k , l , n , o , p )
2011-04-16 18:05:42 +02:00
2011-08-14 16:53:37 +02:00
final class Apply2 [ A ,B ] ( t2 : ( Initialize [ A ] , Initialize [ B ] ) ) {
2012-07-31 17:52:10 +02:00
def apply [ T ] ( z : ( A , B ) => T ) = Def . app [ AList . T2K [ A ,B ] # l , T ] ( t2 ) ( z . tupled ) ( AList . tuple2 [ A ,B ] )
2011-04-16 18:05:42 +02:00
def identity = apply ( mkTuple2 )
2011-01-19 00:24:11 +01:00
}
2011-08-14 16:53:37 +02:00
final class Apply3 [ A ,B ,C ] ( t3 : ( Initialize [ A ] , Initialize [ B ] , Initialize [ C ] ) ) {
2012-07-31 17:52:10 +02:00
def apply [ T ] ( z : ( A , B , C ) => T ) = Def . app [ AList . T3K [ A ,B ,C ] # l , T ] ( t3 ) ( z . tupled ) ( AList . tuple3 [ A ,B ,C ] )
2011-04-16 18:05:42 +02:00
def identity = apply ( mkTuple3 )
2011-01-19 00:24:11 +01:00
}
2011-08-14 16:53:37 +02:00
final class Apply4 [ A ,B ,C ,D ] ( t4 : ( Initialize [ A ] , Initialize [ B ] , Initialize [ C ] , Initialize [ D ] ) ) {
2012-07-31 17:52:10 +02:00
def apply [ T ] ( z : ( A , B , C , D ) => T ) = Def . app [ AList . T4K [ A ,B ,C ,D ] # l , T ] ( t4 ) ( z . tupled ) ( AList . tuple4 [ A ,B ,C ,D ] )
2011-04-16 18:05:42 +02:00
def identity = apply ( mkTuple4 )
2011-01-29 17:22:59 +01:00
}
2011-08-14 16:53:37 +02:00
final class Apply5 [ A ,B ,C ,D ,E ] ( t5 : ( Initialize [ A ] , Initialize [ B ] , Initialize [ C ] , Initialize [ D ] , Initialize [ E ] ) ) {
2012-07-31 17:52:10 +02:00
def apply [ T ] ( z : ( A , B , C , D , E ) => T ) = Def . app [ AList . T5K [ A ,B ,C ,D ,E ] # l , T ] ( t5 ) ( z . tupled ) ( AList . tuple5 [ A ,B ,C ,D ,E ] )
2011-04-16 18:05:42 +02:00
def identity = apply ( mkTuple5 )
2011-02-06 19:01:50 +01:00
}
2011-08-14 16:53:37 +02:00
final class Apply6 [ A ,B ,C ,D ,E ,F ] ( t6 : ( Initialize [ A ] , Initialize [ B ] , Initialize [ C ] , Initialize [ D ] , Initialize [ E ] , Initialize [ F ] ) ) {
2012-07-31 17:52:10 +02:00
def apply [ T ] ( z : ( A , B , C , D , E , F ) => T ) = Def . app [ AList . T6K [ A ,B ,C ,D ,E ,F ] # l , T ] ( t6 ) ( z . tupled ) ( AList . tuple6 [ A ,B ,C ,D ,E ,F ] )
2011-04-16 18:05:42 +02:00
def identity = apply ( mkTuple6 )
2011-02-12 02:22:17 +01:00
}
2011-08-14 16:53:37 +02:00
final class Apply7 [ A ,B ,C ,D ,E ,F ,G ] ( t7 : ( Initialize [ A ] , Initialize [ B ] , Initialize [ C ] , Initialize [ D ] , Initialize [ E ] , Initialize [ F ] , Initialize [ G ] ) ) {
2012-07-31 17:52:10 +02:00
def apply [ T ] ( z : ( A , B , C , D , E , F , G ) => T ) = Def . app [ AList . T7K [ A ,B ,C ,D ,E ,F ,G ] # l , T ] ( t7 ) ( z . tupled ) ( AList . tuple7 [ A ,B ,C ,D ,E ,F ,G ] )
2011-04-16 18:05:42 +02:00
def identity = apply ( mkTuple7 )
}
2011-08-14 16:53:37 +02:00
final class Apply8 [ A ,B ,C ,D ,E ,F ,G ,H ] ( t8 : ( Initialize [ A ] , Initialize [ B ] , Initialize [ C ] , Initialize [ D ] , Initialize [ E ] , Initialize [ F ] , Initialize [ G ] , Initialize [ H ] ) ) {
2012-07-31 17:52:10 +02:00
def apply [ T ] ( z : ( A , B , C , D , E , F , G , H ) => T ) = Def . app [ AList . T8K [ A ,B ,C ,D ,E ,F ,G ,H ] # l , T ] ( t8 ) ( z . tupled ) ( AList . tuple8 [ A ,B ,C ,D ,E ,F ,G ,H ] )
2011-04-16 18:05:42 +02:00
def identity = apply ( mkTuple8 )
}
2011-08-14 16:53:37 +02:00
final class Apply9 [ A ,B ,C ,D ,E ,F ,G ,H ,I ] ( t9 : ( Initialize [ A ] , Initialize [ B ] , Initialize [ C ] , Initialize [ D ] , Initialize [ E ] , Initialize [ F ] , Initialize [ G ] , Initialize [ H ] , Initialize [ I ] ) ) {
2012-07-31 17:52:10 +02:00
def apply [ T ] ( z : ( A , B , C , D , E , F , G , H , I ) => T ) = Def . app [ AList . T9K [ A ,B ,C ,D ,E ,F ,G ,H ,I ] # l , T ] ( t9 ) ( z . tupled ) ( AList . tuple9 [ A ,B ,C ,D ,E ,F ,G ,H ,I ] )
2011-04-16 18:05:42 +02:00
def identity = apply ( mkTuple9 )
}
2011-12-13 21:30:06 +01:00
final class Apply10 [ A ,B ,C ,D ,E ,F ,G ,H ,I ,J ] ( t10 : ( Initialize [ A ] , Initialize [ B ] , Initialize [ C ] , Initialize [ D ] , Initialize [ E ] , Initialize [ F ] , Initialize [ G ] , Initialize [ H ] , Initialize [ I ] , Initialize [ J ] ) ) {
2012-07-31 17:52:10 +02:00
def apply [ T ] ( z : ( A , B , C , D , E , F , G , H , I , J ) => T ) = Def . app [ AList . T10K [ A ,B ,C ,D ,E ,F ,G ,H ,I ,J ] # l , T ] ( t10 ) ( z . tupled ) ( AList . tuple10 [ A ,B ,C ,D ,E ,F ,G ,H ,I ,J ] )
2011-12-13 21:30:06 +01:00
def identity = apply ( mkTuple10 )
}
final class Apply11 [ A ,B ,C ,D ,E ,F ,G ,H ,I ,J ,K ] ( t11 : ( Initialize [ A ] , Initialize [ B ] , Initialize [ C ] , Initialize [ D ] , Initialize [ E ] , Initialize [ F ] , Initialize [ G ] , Initialize [ H ] , Initialize [ I ] , Initialize [ J ] , Initialize [ K ] ) ) {
2012-07-31 17:52:10 +02:00
def apply [ T ] ( z : ( A , B , C , D , E , F , G , H , I , J , K ) => T ) = Def . app [ AList . T11K [ A ,B ,C ,D ,E ,F ,G ,H ,I ,J ,K ] # l , T ] ( t11 ) ( z . tupled ) ( AList . tuple11 [ A ,B ,C ,D ,E ,F ,G ,H ,I ,J ,K ] )
2011-12-13 21:30:06 +01:00
def identity = apply ( mkTuple11 )
}
2012-07-31 17:52:10 +02:00
/* final class Apply12[A,B,C,D,E,F,G,H,I,J,K,L](t12: (Initialize[A], Initialize[B], Initialize[C], Initialize[D], Initialize[E], Initialize[F], Initialize[G], Initialize[H], Initialize[I], Initialize[J], Initialize[K], Initialize[L])) {
2012-07-31 17:52:10 +02:00
def apply [ T ] ( z : ( A , B , C , D , E , F , G , H , I , J , K , L ) => T ) = Def . app ( k12 ( t12 ) ) ( hf12 ( z ) )
2011-12-13 21:30:06 +01:00
def identity = apply ( mkTuple12 )
}
final class Apply13 [ A ,B ,C ,D ,E ,F ,G ,H ,I ,J ,K ,L ,N ] ( t13 : ( Initialize [ A ] , Initialize [ B ] , Initialize [ C ] , Initialize [ D ] , Initialize [ E ] , Initialize [ F ] , Initialize [ G ] , Initialize [ H ] , Initialize [ I ] , Initialize [ J ] , Initialize [ K ] , Initialize [ L ] , Initialize [ N ] ) ) {
2012-07-31 17:52:10 +02:00
def apply [ T ] ( z : ( A , B , C , D , E , F , G , H , I , J , K , L , N ) => T ) = Def . app ( k13 ( t13 ) ) ( hf13 ( z ) )
2011-12-13 21:30:06 +01:00
def identity = apply ( mkTuple13 )
}
final class Apply14 [ A ,B ,C ,D ,E ,F ,G ,H ,I ,J ,K ,L ,N ,O ] ( t14 : ( Initialize [ A ] , Initialize [ B ] , Initialize [ C ] , Initialize [ D ] , Initialize [ E ] , Initialize [ F ] , Initialize [ G ] , Initialize [ H ] , Initialize [ I ] , Initialize [ J ] , Initialize [ K ] , Initialize [ L ] , Initialize [ N ] , Initialize [ O ] ) ) {
2012-07-31 17:52:10 +02:00
def apply [ T ] ( z : ( A , B , C , D , E , F , G , H , I , J , K , L , N , O ) => T ) = Def . app ( k14 ( t14 ) ) ( hf14 ( z ) )
2011-12-13 21:30:06 +01:00
def identity = apply ( mkTuple14 )
}
final class Apply15 [ A ,B ,C ,D ,E ,F ,G ,H ,I ,J ,K ,L ,N ,O ,P ] ( t15 : ( Initialize [ A ] , Initialize [ B ] , Initialize [ C ] , Initialize [ D ] , Initialize [ E ] , Initialize [ F ] , Initialize [ G ] , Initialize [ H ] , Initialize [ I ] , Initialize [ J ] , Initialize [ K ] , Initialize [ L ] , Initialize [ N ] , Initialize [ O ] , Initialize [ P ] ) ) {
2012-07-31 17:52:10 +02:00
def apply [ T ] ( z : ( A , B , C , D , E , F , G , H , I , J , K , L , N , O , P ) => T ) = Def . app ( k15 ( t15 ) ) ( hf15 ( z ) )
2011-12-13 21:30:06 +01:00
def identity = apply ( mkTuple15 )
}
2012-07-31 17:52:10 +02:00
*/
2011-05-24 03:06:33 +02:00
private [ sbt ] def extendScoped ( s1 : Scoped , ss : Seq [ Scoped ] ) : Seq [ AttributeKey [ _ ] ] = s1 . key +: ss . map ( _ . key )
2011-01-19 00:24:11 +01:00
}
2011-05-24 03:06:33 +02:00
import Scoped.extendScoped
2011-10-17 02:20:45 +02:00
/* * Constructs InputKeys, which are associated with input tasks to define a setting. */
2011-01-26 04:20:05 +01:00
object InputKey
{
2012-03-26 02:35:09 +02:00
def apply [ T : Manifest ] ( label : String , description : String = "" , rank : Int = KeyRanks . DefaultInputRank ) : InputKey [ T ] =
apply ( AttributeKey [ InputTask [ T ] ] ( label , description , rank ) )
2011-01-26 04:20:05 +01:00
2012-04-13 23:47:12 +02:00
def apply [ T : Manifest ] ( label : String , description : String , extend1 : Scoped , extendN : Scoped * ) : InputKey [ T ] =
apply ( label , description , KeyRanks . DefaultInputRank , extend1 , extendN : _ * )
2012-03-26 02:35:09 +02:00
def apply [ T : Manifest ] ( label : String , description : String , rank : Int , extend1 : Scoped , extendN : Scoped * ) : InputKey [ T ] =
apply ( AttributeKey [ InputTask [ T ] ] ( label , description , extendScoped ( extend1 , extendN ) , rank ) )
2011-05-24 03:06:33 +02:00
2011-01-26 04:20:05 +01:00
def apply [ T ] ( akey : AttributeKey [ InputTask [ T ] ] ) : InputKey [ T ] =
2011-10-16 23:27:36 +02:00
new InputKey [ T ] { val key = akey ; def scope = Scope . ThisScope }
2011-01-26 04:20:05 +01:00
}
2011-10-17 02:20:45 +02:00
/* * Constructs TaskKeys, which are associated with tasks to define a setting. */
2011-01-19 00:24:11 +01:00
object TaskKey
{
2012-03-26 02:35:09 +02:00
def apply [ T : Manifest ] ( label : String , description : String = "" , rank : Int = KeyRanks . DefaultTaskRank ) : TaskKey [ T ] =
apply ( AttributeKey [ Task [ T ] ] ( label , description , rank ) )
2011-01-19 00:24:11 +01:00
2011-05-26 14:21:26 +02:00
def apply [ T : Manifest ] ( label : String , description : String , extend1 : Scoped , extendN : Scoped * ) : TaskKey [ T ] =
2011-05-24 03:06:33 +02:00
apply ( AttributeKey [ Task [ T ] ] ( label , description , extendScoped ( extend1 , extendN ) ) )
2012-03-26 02:35:09 +02:00
def apply [ T : Manifest ] ( label : String , description : String , rank : Int , extend1 : Scoped , extendN : Scoped * ) : TaskKey [ T ] =
apply ( AttributeKey [ Task [ T ] ] ( label , description , extendScoped ( extend1 , extendN ) , rank ) )
2011-02-12 02:22:17 +01:00
def apply [ T ] ( akey : AttributeKey [ Task [ T ] ] ) : TaskKey [ T ] =
2011-10-16 23:27:36 +02:00
new TaskKey [ T ] { val key = akey ; def scope = Scope . ThisScope }
2011-10-01 20:39:40 +02:00
def local [ T : Manifest ] : TaskKey [ T ] = apply [ T ] ( AttributeKey . local [ Task [ T ] ] )
2011-01-19 00:24:11 +01:00
}
2011-10-17 02:20:45 +02:00
/* * Constructs SettingKeys, which are associated with a value to define a basic setting. */
2011-01-19 00:24:11 +01:00
object SettingKey
{
2012-03-26 02:35:09 +02:00
def apply [ T : Manifest ] ( label : String , description : String = "" , rank : Int = KeyRanks . DefaultSettingRank ) : SettingKey [ T ] =
apply ( AttributeKey [ T ] ( label , description , rank ) )
2011-01-19 00:24:11 +01:00
2011-05-26 14:21:26 +02:00
def apply [ T : Manifest ] ( label : String , description : String , extend1 : Scoped , extendN : Scoped * ) : SettingKey [ T ] =
2011-05-24 03:06:33 +02:00
apply ( AttributeKey [ T ] ( label , description , extendScoped ( extend1 , extendN ) ) )
2012-03-26 02:35:09 +02:00
def apply [ T : Manifest ] ( label : String , description : String , rank : Int , extend1 : Scoped , extendN : Scoped * ) : SettingKey [ T ] =
apply ( AttributeKey [ T ] ( label , description , extendScoped ( extend1 , extendN ) , rank ) )
2011-02-12 02:22:17 +01:00
def apply [ T ] ( akey : AttributeKey [ T ] ) : SettingKey [ T ] =
2011-10-16 23:27:36 +02:00
new SettingKey [ T ] { val key = akey ; def scope = Scope . ThisScope }
2011-10-01 20:39:40 +02:00
def local [ T : Manifest ] : SettingKey [ T ] = apply [ T ] ( AttributeKey . local [ T ] )
2012-03-26 02:35:09 +02:00
}
2012-12-02 09:17:20 +01:00
object settingKey
{
def apply [ T ] ( description : String ) : SettingKey [ T ] = macro std . KeyMacro . settingKeyImpl [ T ]
}
object taskKey
{
def apply [ T ] ( description : String ) : TaskKey [ T ] = macro std . KeyMacro . taskKeyImpl [ T ]
}
object inputKey
{
def apply [ T ] ( description : String ) : TaskKey [ T ] = macro std . KeyMacro . taskKeyImpl [ T ]
}