2011-02-27 05:34:39 +01:00
|
|
|
/* sbt -- Simple Build Tool
|
|
|
|
|
* Copyright 2011 Mark Harrah
|
|
|
|
|
*/
|
|
|
|
|
package sbt
|
|
|
|
|
|
|
|
|
|
import java.io.File
|
|
|
|
|
import EvaluateTask.{resolvedScoped, streams}
|
|
|
|
|
import complete._
|
|
|
|
|
import inc.Analysis
|
|
|
|
|
import std.TaskExtra._
|
|
|
|
|
import scala.xml.NodeSeq
|
|
|
|
|
import org.apache.ivy.core.module.{descriptor, id}
|
|
|
|
|
import descriptor.ModuleDescriptor, id.ModuleRevisionId
|
|
|
|
|
import org.scalatools.testing.Framework
|
|
|
|
|
|
|
|
|
|
object Keys
|
|
|
|
|
{
|
2011-02-27 06:36:54 +01:00
|
|
|
// logging
|
2011-03-02 12:46:28 +01:00
|
|
|
val logLevel = SettingKey[Level.Value]("log-level")
|
|
|
|
|
val persistLogLevel = SettingKey[Level.Value]("persist-log-level")
|
2011-02-27 06:36:54 +01:00
|
|
|
|
2011-02-27 05:56:30 +01:00
|
|
|
// Project keys
|
2011-03-02 12:46:28 +01:00
|
|
|
val projectCommand = AttributeKey[Boolean]("project-command")
|
|
|
|
|
val sessionSettings = AttributeKey[SessionSettings]("session-settings")
|
|
|
|
|
val buildStructure = AttributeKey[Load.BuildStructure]("build-structure")
|
|
|
|
|
val appConfiguration = SettingKey[xsbti.AppConfiguration]("app-configuration")
|
2011-03-03 12:44:19 +01:00
|
|
|
val thisProject = SettingKey[ResolvedProject]("this-project")
|
2011-03-02 12:46:28 +01:00
|
|
|
val thisProjectRef = SettingKey[ProjectRef]("this-project-ref")
|
|
|
|
|
val configuration = SettingKey[Configuration]("configuration")
|
|
|
|
|
val commands = SettingKey[Seq[Command]]("commands")
|
2011-02-27 05:56:30 +01:00
|
|
|
|
|
|
|
|
// Command keys
|
2011-03-02 12:46:28 +01:00
|
|
|
val logged = AttributeKey[Logger]("log")
|
|
|
|
|
val historyPath = SettingKey[Option[File]]("history")
|
|
|
|
|
val shellPrompt = SettingKey[State => String]("shell-prompt")
|
|
|
|
|
val analysis = AttributeKey[inc.Analysis]("analysis")
|
|
|
|
|
val watch = SettingKey[Watched]("watch")
|
|
|
|
|
val pollInterval = SettingKey[Int]("poll-interval")
|
|
|
|
|
val watchSources = TaskKey[Seq[File]]("watch-sources")
|
|
|
|
|
val watchTransitiveSources = TaskKey[Seq[File]]("watch-transitive-sources")
|
2011-02-27 05:56:30 +01:00
|
|
|
|
2011-02-27 05:34:39 +01:00
|
|
|
// Path Keys
|
2011-03-02 12:46:28 +01:00
|
|
|
val baseDirectory = SettingKey[File]("base-directory")
|
|
|
|
|
val target = SettingKey[File]("target")
|
|
|
|
|
val sourceDirectory = SettingKey[File]("source-directory")
|
|
|
|
|
val sourceManaged = SettingKey[File]("source-managed")
|
|
|
|
|
val scalaSource = SettingKey[File]("scala-source")
|
|
|
|
|
val javaSource = SettingKey[File]("java-source")
|
|
|
|
|
val javaSourceRoots = SettingKey[Seq[File]]("java-source-roots")
|
|
|
|
|
val resourceDirectory = SettingKey[File]("resource-directory")
|
|
|
|
|
val sourceDirectories = SettingKey[Seq[File]]("source-directories")
|
|
|
|
|
val resourceDirectories = SettingKey[Seq[File]]("resource-directories")
|
|
|
|
|
val classDirectory = SettingKey[File]("class-directory")
|
|
|
|
|
val docDirectory = SettingKey[File]("doc-directory")
|
|
|
|
|
val cacheDirectory = SettingKey[File]("cache-directory")
|
|
|
|
|
val sourceFilter = SettingKey[FileFilter]("source-filter")
|
|
|
|
|
val defaultExcludes = SettingKey[FileFilter]("default-excludes")
|
|
|
|
|
val sources = TaskKey[Seq[File]]("sources")
|
|
|
|
|
val cleanFiles = SettingKey[Seq[File]]("clean-files")
|
|
|
|
|
val crossPaths = SettingKey[Boolean]("cross-paths")
|
2011-02-27 05:34:39 +01:00
|
|
|
|
|
|
|
|
// compile/doc keys
|
2011-03-02 12:46:28 +01:00
|
|
|
val maxErrors = SettingKey[Int]("max-errors")
|
|
|
|
|
val scaladocOptions = SettingKey[Seq[String]]("scaladoc-options")
|
|
|
|
|
val scalacOptions = SettingKey[Seq[String]]("scalac-options")
|
|
|
|
|
val javacOptions = SettingKey[Seq[String]]("javac-options")
|
|
|
|
|
val initialCommands = SettingKey[String]("initial-commands")
|
2011-03-05 14:25:17 +01:00
|
|
|
val compileInputs = TaskKey[Compiler.Inputs]("compile-inputs")
|
2011-03-02 12:46:28 +01:00
|
|
|
val scalaInstance = SettingKey[ScalaInstance]("scala-instance")
|
|
|
|
|
val scalaVersion = SettingKey[String]("scala-version")
|
2011-02-27 05:34:39 +01:00
|
|
|
|
2011-03-02 12:46:28 +01:00
|
|
|
val webappDir = SettingKey[File]("webapp-dir")
|
2011-02-27 05:34:39 +01:00
|
|
|
|
2011-03-02 12:46:28 +01:00
|
|
|
val clean = TaskKey[Unit]("clean")
|
|
|
|
|
val console = TaskKey[Unit]("console")
|
|
|
|
|
val consoleQuick = TaskKey[Unit]("console-quick")
|
|
|
|
|
val consoleProject = TaskKey[Unit]("console-project")
|
|
|
|
|
val compile = TaskKey[Analysis]("compile")
|
2011-03-05 14:25:17 +01:00
|
|
|
val compilers = TaskKey[Compiler.Compilers]("compilers")
|
2011-03-02 12:46:28 +01:00
|
|
|
val doc = TaskKey[File]("doc")
|
|
|
|
|
val copyResources = TaskKey[Traversable[(File,File)]]("copy-resources")
|
|
|
|
|
val resources = TaskKey[Seq[File]]("resources")
|
|
|
|
|
val aggregate = SettingKey[Aggregation]("aggregate")
|
2011-02-27 05:34:39 +01:00
|
|
|
|
|
|
|
|
// package keys
|
2011-03-02 12:46:28 +01:00
|
|
|
val packageBin = TaskKey[Package.Configuration]("package")
|
|
|
|
|
val packageDoc = TaskKey[Package.Configuration]("package-doc")
|
|
|
|
|
val packageSrc = TaskKey[Package.Configuration]("package-src")
|
|
|
|
|
val packageOptions = TaskKey[Seq[PackageOption]]("package-options")
|
|
|
|
|
val jarPath = SettingKey[File]("jar-path")
|
|
|
|
|
val jarName = SettingKey[ArtifactName]("jar-name")
|
|
|
|
|
val jarType = SettingKey[String]("jar-type")
|
|
|
|
|
val nameToString = SettingKey[ArtifactName => String]("name-to-string")
|
|
|
|
|
val mappings = TaskKey[Seq[(File,String)]]("mappings")
|
2011-02-27 05:34:39 +01:00
|
|
|
|
|
|
|
|
// Run Keys
|
2011-03-02 12:46:28 +01:00
|
|
|
val selectMainClass = TaskKey[Option[String]]("select-main-class")
|
|
|
|
|
val mainClass = TaskKey[Option[String]]("main-class")
|
|
|
|
|
val run = InputKey[Unit]("run")
|
|
|
|
|
val discoveredMainClasses = TaskKey[Seq[String]]("discovered-main-classes")
|
|
|
|
|
val runner = SettingKey[ScalaRun]("runner")
|
2011-02-27 05:34:39 +01:00
|
|
|
|
2011-03-02 12:46:28 +01:00
|
|
|
val fork = SettingKey[Boolean]("fork")
|
|
|
|
|
val outputStrategy = SettingKey[Option[sbt.OutputStrategy]]("output-strategy")
|
|
|
|
|
val javaHome = SettingKey[Option[File]]("java-home")
|
|
|
|
|
val javaOptions = SettingKey[Seq[String]]("java-options")
|
2011-02-27 05:34:39 +01:00
|
|
|
|
|
|
|
|
// Test Keys
|
2011-03-02 12:46:28 +01:00
|
|
|
val testLoader = TaskKey[ClassLoader]("test-loader")
|
|
|
|
|
val loadedTestFrameworks = TaskKey[Map[TestFramework,Framework]]("loaded-test-frameworks")
|
|
|
|
|
val definedTests = TaskKey[Seq[TestDefinition]]("defined-tests")
|
2011-03-05 14:25:17 +01:00
|
|
|
val executeTests = TaskKey[Tests.Output]("execute-tests")
|
2011-03-02 12:46:28 +01:00
|
|
|
val test = TaskKey[Unit]("test")
|
|
|
|
|
val testOnly = InputKey[Unit]("test-only")
|
|
|
|
|
val testOptions = TaskKey[Seq[TestOption]]("test-options")
|
|
|
|
|
val testFrameworks = SettingKey[Seq[TestFramework]]("test-frameworks")
|
|
|
|
|
val testListeners = TaskKey[Iterable[TestReportListener]]("test-listeners")
|
2011-02-27 05:34:39 +01:00
|
|
|
|
|
|
|
|
// Classpath/Dependency Management Keys
|
|
|
|
|
type Classpath = Seq[Attributed[File]]
|
|
|
|
|
|
2011-03-02 12:46:28 +01:00
|
|
|
val name = SettingKey[String]("name")
|
|
|
|
|
val normalizedName = SettingKey[String]("normalized-name")
|
|
|
|
|
val organization = SettingKey[String]("organization")
|
|
|
|
|
val defaultConfiguration = SettingKey[Option[Configuration]]("default-configuration")
|
|
|
|
|
val defaultConfigurationMapping = SettingKey[String]("default-configuration-mapping")
|
2011-02-27 05:34:39 +01:00
|
|
|
|
2011-03-02 12:46:28 +01:00
|
|
|
val products = TaskKey[Classpath]("products")
|
|
|
|
|
val unmanagedClasspath = TaskKey[Classpath]("unmanaged-classpath")
|
|
|
|
|
val unmanagedJars = TaskKey[Classpath]("unmanaged-jars")
|
|
|
|
|
val managedClasspath = TaskKey[Classpath]("managed-classpath")
|
|
|
|
|
val internalDependencyClasspath = TaskKey[Classpath]("internal-dependency-classpath")
|
|
|
|
|
val externalDependencyClasspath = TaskKey[Classpath]("external-dependency-classpath")
|
|
|
|
|
val dependencyClasspath = TaskKey[Classpath]("dependency-classpath")
|
|
|
|
|
val fullClasspath = TaskKey[Classpath]("full-classpath")
|
2011-02-27 05:34:39 +01:00
|
|
|
|
2011-03-02 12:46:28 +01:00
|
|
|
val ivyConfiguration = TaskKey[IvyConfiguration]("ivy-configuration")
|
|
|
|
|
val moduleSettings = TaskKey[ModuleSettings]("module-settings")
|
|
|
|
|
val unmanagedBase = SettingKey[File]("unmanaged-base")
|
|
|
|
|
val updateConfiguration = SettingKey[UpdateConfiguration]("update-configuration")
|
|
|
|
|
val ivySbt = TaskKey[IvySbt]("ivy-sbt")
|
|
|
|
|
val ivyModule = TaskKey[IvySbt#Module]("ivy-module")
|
|
|
|
|
val classpathFilter = SettingKey[FileFilter]("classpath-filter")
|
|
|
|
|
val update = TaskKey[Map[String,Seq[File]]]("update")
|
2011-02-27 05:34:39 +01:00
|
|
|
|
2011-03-02 12:46:28 +01:00
|
|
|
val publishConfiguration = TaskKey[PublishConfiguration]("publish-configuration")
|
|
|
|
|
val publishLocalConfiguration = TaskKey[PublishConfiguration]("publish-local-configuration")
|
|
|
|
|
val makePomConfiguration = SettingKey[MakePomConfiguration]("make-pom-configuration")
|
|
|
|
|
val packageToPublish = TaskKey[Unit]("package-to-publish")
|
|
|
|
|
val deliverDepends = TaskKey[Unit]("deliver-depends")
|
|
|
|
|
val publishMavenStyle = SettingKey[Boolean]("publish-maven-style")
|
2011-02-27 05:34:39 +01:00
|
|
|
|
2011-03-02 12:46:28 +01:00
|
|
|
val makePom = TaskKey[File]("make-pom")
|
|
|
|
|
val deliver = TaskKey[Unit]("deliver")
|
|
|
|
|
val deliverLocal = TaskKey[Unit]("deliver-local")
|
|
|
|
|
val publish = TaskKey[Unit]("publish")
|
|
|
|
|
val publishLocal = TaskKey[Unit]("publish-local")
|
2011-02-27 05:34:39 +01:00
|
|
|
|
2011-03-02 12:46:28 +01:00
|
|
|
val moduleID = SettingKey[String]("module-id")
|
|
|
|
|
val version = SettingKey[String]("version")
|
|
|
|
|
val projectID = SettingKey[ModuleID]("project-id")
|
|
|
|
|
val baseResolvers = SettingKey[Seq[Resolver]]("base-resolvers")
|
|
|
|
|
val projectResolver = TaskKey[Resolver]("project-resolver")
|
|
|
|
|
val resolvers = TaskKey[Seq[Resolver]]("resolvers")
|
|
|
|
|
val otherResolvers = SettingKey[Seq[Resolver]]("other-resolvers")
|
|
|
|
|
val moduleConfigurations = SettingKey[Seq[ModuleConfiguration]]("module-configurations")
|
|
|
|
|
val retrievePattern = SettingKey[String]("retrieve-pattern")
|
|
|
|
|
val retrieveConfiguration = SettingKey[Option[RetrieveConfiguration]]("retrieve-configuration")
|
|
|
|
|
val offline = SettingKey[Boolean]("offline")
|
|
|
|
|
val ivyPaths = SettingKey[IvyPaths]("ivy-paths")
|
|
|
|
|
val libraryDependencies = SettingKey[Seq[ModuleID]]("library-dependencies")
|
|
|
|
|
val allDependencies = TaskKey[Seq[ModuleID]]("all-dependencies")
|
|
|
|
|
val projectDependencies = TaskKey[Seq[ModuleID]]("project-dependencies")
|
|
|
|
|
val ivyXML = SettingKey[NodeSeq]("ivy-xml")
|
|
|
|
|
val ivyScala = SettingKey[Option[IvyScala]]("ivy-scala")
|
|
|
|
|
val ivyValidate = SettingKey[Boolean]("ivy-validate")
|
|
|
|
|
val ivyLoggingLevel = SettingKey[UpdateLogging.Value]("ivy-logging-level")
|
|
|
|
|
val publishTo = SettingKey[Option[Resolver]]("publish-to")
|
|
|
|
|
val pomName = SettingKey[ArtifactName]("pom-name")
|
|
|
|
|
val pomFile = SettingKey[File]("pom-file")
|
|
|
|
|
val pomArtifact = SettingKey[Seq[Artifact]]("pom-artifact")
|
|
|
|
|
val artifacts = SettingKey[Seq[Artifact]]("artifacts")
|
|
|
|
|
val projectDescriptors = TaskKey[Map[ModuleRevisionId,ModuleDescriptor]]("project-descriptors")
|
|
|
|
|
val autoUpdate = SettingKey[Boolean]("auto-update")
|
2011-02-27 05:34:39 +01:00
|
|
|
|
|
|
|
|
// special
|
2011-03-02 12:46:28 +01:00
|
|
|
val settings = TaskKey[Settings[Scope]]("settings")
|
2011-02-27 05:34:39 +01:00
|
|
|
}
|