Last active
December 15, 2015 02:49
-
-
Save xuwei-k/5190339 to your computer and use it in GitHub Desktop.
git diff v0.12.3:main/Keys.scala v0.13.0-M2:main/src/main/scala/sbt/Keys.scala
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/v0.12.3:main/Keys.scala b/v0.13.0-M2:main/src/main/scala/sbt/Keys.scala | |
index 49bf4d1..fa0e04e 100644 | |
--- a/v0.12.3:main/Keys.scala | |
+++ b/v0.13.0-M2:main/src/main/scala/sbt/Keys.scala | |
@@ -5,7 +5,7 @@ package sbt | |
import java.io.File | |
import java.net.URL | |
- import Project.ScopedKey | |
+ import Def.ScopedKey | |
import complete._ | |
import inc.Analysis | |
import inc.Locate.DefinesClass | |
@@ -14,7 +14,7 @@ package sbt | |
import scala.xml.{Node => XNode, NodeSeq} | |
import org.apache.ivy.core.module.{descriptor, id} | |
import descriptor.ModuleDescriptor, id.ModuleRevisionId | |
- import org.scalatools.testing.Framework | |
+ import testing.Framework | |
import Configurations.CompilerPlugin | |
import Types.Id | |
import KeyRanks._ | |
@@ -38,9 +38,9 @@ object Keys | |
// Project keys | |
val projectCommand = AttributeKey[Boolean]("project-command", "Marks Commands that were registered for the current Project.", Invisible) | |
val sessionSettings = AttributeKey[SessionSettings]("session-settings", "Tracks current build, project, and setting modifications.", DSetting) | |
- val stateBuildStructure = AttributeKey[Load.BuildStructure]("build-structure", "Data structure containing all information about the build definition.", BSetting) | |
- val buildStructure = TaskKey[Load.BuildStructure]("build-structure", "Provides access to the build structure, settings, and streams manager.", DTask) | |
- val loadedBuild = SettingKey[Load.LoadedBuild]("loaded-build", "Provides access to the loaded project structure. This is the information available before settings are evaluated.", DSetting) | |
+ val stateBuildStructure = AttributeKey[BuildStructure]("build-structure", "Data structure containing all information about the build definition.", BSetting) | |
+ val buildStructure = TaskKey[BuildStructure]("build-structure", "Provides access to the build structure, settings, and streams manager.", DTask) | |
+ val loadedBuild = SettingKey[LoadedBuild]("loaded-build", "Provides access to the loaded project structure. This is the information available before settings are evaluated.", DSetting) | |
val buildDependencies = SettingKey[BuildDependencies]("build-dependencies", "Definitive source of inter-project dependencies for compilation and dependency management.\n\tThis is populated by default by the dependencies declared on Project instances, but may be modified.\n\tThe main restriction is that new builds may not be introduced.", DSetting) | |
val appConfiguration = SettingKey[xsbti.AppConfiguration]("app-configuration", "Provides access to the launched sbt configuration, including the ScalaProvider, Launcher, and GlobalLock.", DSetting) | |
val thisProject = SettingKey[ResolvedProject]("this-project", "Provides the current project for the referencing scope.", CSetting) | |
@@ -70,10 +70,6 @@ object Keys | |
// Path Keys | |
val baseDirectory = SettingKey[File]("base-directory", "The base directory. Depending on the scope, this is the base directory for the build, project, configuration, or task.", AMinusSetting) | |
- val globalBaseDirectory = AttributeKey[File]("global-base-directory", "The base directory for global sbt configuration and staging.", DSetting) | |
- val globalPluginsDirectory = AttributeKey[File]("global-plugins-directory", "The base directory for global sbt plugins.", DSetting) | |
- val globalSettingsDirectory = AttributeKey[File]("global-settings-directory", "The base directory for global sbt settings.", DSetting) | |
- val stagingDirectory = AttributeKey[File]("staging-directory", "The directory for staging remote projects.", DSetting) | |
val target = SettingKey[File]("target", "Main directory for files generated by the build.", AMinusSetting) | |
val crossTarget = SettingKey[File]("cross-target", "Main directory for files generated by the build that are cross-built.", BSetting) | |
@@ -93,12 +89,6 @@ object Keys | |
// Filters | |
val includeFilter = SettingKey[FileFilter]("include-filter", "Filter for including sources and resources files from default directories.", CSetting) | |
val excludeFilter = SettingKey[FileFilter]("exclude-filter", "Filter for excluding sources and resources files from default directories.", CSetting) | |
- @deprecated("Use `includeFilter`, scoped by respective classpath related task instead. For example, `includeFilter in unmanagedJars`", "0.11.0") | |
- val classpathFilter = SettingKey[FileFilter]("classpath-filter", "Filter for selecting unmanaged dependencies.", DSetting) | |
- @deprecated("Use `includeFilter`, scoped by respective source related task instead. For example, `includeFilter in unmanagedSources`", "0.11.0") | |
- val sourceFilter = SettingKey[FileFilter]("source-filter", "Filter for selecting sources from default directories.", DSetting) | |
- @deprecated("Use `excludeFilter`, scoped by respective task instead. For example, `excludeFilter in unmanagedSources`", "0.11.0") | |
- val defaultExcludes = SettingKey[FileFilter]("default-excludes", "Filter for excluding files, such as sources and resources, by default.", DSetting) | |
// Resource paths | |
val resourceDirectory = SettingKey[File]("resource-directory", "Default unmanaged resource directory, used for user-defined resources.", ASetting) | |
@@ -112,8 +102,7 @@ object Keys | |
// Output paths | |
val classDirectory = SettingKey[File]("class-directory", "Directory for compiled classes and copied resources.", AMinusSetting) | |
- @deprecated("Use `target`, scoped by the doc task. For example, `target in Compile in doc`", "0.11.0") | |
- val docDirectory = SettingKey[File]("doc-directory", "Directory for generated documentation.", DSetting) | |
+ @deprecated("Use the cacheDirectory provided by streams.", "0.13.0") | |
val cacheDirectory = SettingKey[File]("cache-directory", "Directory used for caching task data.", BMinusSetting) | |
val cleanFiles = SettingKey[Seq[File]]("clean-files", "The files to recursively delete during a clean.", BSetting) | |
val cleanKeepFiles = SettingKey[Seq[File]]("clean-keep-files", "Files to keep during a clean.", CSetting) | |
@@ -127,10 +116,9 @@ object Keys | |
// compile/doc keys | |
val autoCompilerPlugins = SettingKey[Boolean]("auto-compiler-plugins", "If true, enables automatically generating -Xplugin arguments to the compiler based on the classpath for the " + CompilerPlugin.name + " configuration.", AMinusSetting) | |
val maxErrors = SettingKey[Int]("max-errors", "The maximum number of errors, such as compile errors, to list.", ASetting) | |
- @deprecated("Use `scalacOptions`, scoped by the doc task. For example, `scalacOptions in Compile in doc`", "0.11.0") | |
- val scaladocOptions = TaskKey[Seq[String]]("scaladoc-options", "Options for Scaladoc.", DTask) | |
val scalacOptions = TaskKey[Seq[String]]("scalac-options", "Options for the Scala compiler.", BPlusTask) | |
val javacOptions = TaskKey[Seq[String]]("javac-options", "Options for the Java compiler.", BPlusTask) | |
+ val incOptions = TaskKey[sbt.inc.IncOptions]("inc-options", "Options for the incremental compiler.", BTask) | |
val compileOrder = SettingKey[CompileOrder]("compile-order", "Configures the order in which Java and sources within a single compilation are compiled. Valid values are: JavaThenScala, ScalaThenJava, or Mixed.", BPlusSetting) | |
val initialCommands = SettingKey[String]("initial-commands", "Initial commands to execute when starting up the Scala interpreter.", AMinusSetting) | |
val cleanupCommands = SettingKey[String]("cleanup-commands", "Commands to execute before the Scala interpreter exits.", BMinusSetting) | |
@@ -160,6 +148,7 @@ object Keys | |
val doc = TaskKey[File]("doc", "Generates API documentation.", AMinusTask) | |
val copyResources = TaskKey[Seq[(File,File)]]("copy-resources", "Copies resources to the output directory.", AMinusTask) | |
val aggregate = SettingKey[Boolean]("aggregate", "Configures task aggregation.", BMinusSetting) | |
+ val sourcePositionMappers = TaskKey[Seq[xsbti.Position => Option[xsbti.Position]]]("source-position-mappers", "Maps positions in generated source files to the original source it was generated from", DTask) | |
// package keys | |
val packageBin = TaskKey[File]("package-bin", "Produces a main artifact, such as a binary jar.", ATask) | |
@@ -190,6 +179,7 @@ object Keys | |
val connectInput = SettingKey[Boolean]("connect-input", "If true, connects standard input when running a main class forked.", CSetting) | |
val javaHome = SettingKey[Option[File]]("java-home", "Selects the Java installation used for compiling and forking. If None, uses the Java installation running the build.", ASetting) | |
val javaOptions = TaskKey[Seq[String]]("java-options", "Options passed to a new JVM when forking.", BPlusTask) | |
+ val envVars = TaskKey[Map[String,String]]("envVars", "Environment variables used when forking a new JVM", BTask) | |
// Test Keys | |
val testLoader = TaskKey[ClassLoader]("test-loader", "Provides the class loader used for testing.", DTask) | |
@@ -204,12 +194,12 @@ object Keys | |
val testFrameworks = SettingKey[Seq[TestFramework]]("test-frameworks", "Registered, although not necessarily present, test frameworks.", CTask) | |
val testListeners = TaskKey[Seq[TestReportListener]]("test-listeners", "Defines test listeners.", DTask) | |
val testExecution = TaskKey[Tests.Execution]("test-execution", "Settings controlling test execution", DTask) | |
- val testFilter = TaskKey[Seq[String] => String => Boolean]("test-filter", "Filter controlling whether the test is executed", DTask) | |
+ val testFilter = TaskKey[Seq[String] => Seq[String => Boolean]]("test-filter", "Filter controlling whether the test is executed", DTask) | |
val testGrouping = TaskKey[Seq[Tests.Group]]("test-grouping", "Collects discovered tests into groups. Whether to fork and the options for forking are configurable on a per-group basis.", BMinusTask) | |
val isModule = AttributeKey[Boolean]("is-module", "True if the target is a module.", DSetting) | |
// Classpath/Dependency Management Keys | |
- type Classpath = Seq[Attributed[File]] | |
+ type Classpath = Def.Classpath | |
val name = SettingKey[String]("name", "Project name.", APlusSetting) | |
val normalizedName = SettingKey[String]("normalized-name", "Project name transformed from mixed case and spaces to lowercase and dash-separated.", BSetting) | |
@@ -220,6 +210,10 @@ object Keys | |
val organization = SettingKey[String]("organization", "Organization/group ID.", APlusSetting) | |
val organizationName = SettingKey[String]("organization-name", "Organization full/formal name.", BMinusSetting) | |
val organizationHomepage = SettingKey[Option[URL]]("organization-homepage", "Organization homepage.", BMinusSetting) | |
+ val apiURL = SettingKey[Option[URL]]("api-url", "Base URL for API documentation.", BMinusSetting) | |
+ val entryApiURL = AttributeKey[URL]("entry-api-url", "Base URL for the API documentation for a classpath entry.") | |
+ val apiMappings = TaskKey[Map[File,URL]]("api-mappings", "Mappings from classpath entry to API documentation base URL.", BMinusSetting) | |
+ val autoAPIMappings = SettingKey[Boolean]("auto-api-mappings", "If true, automatically manages mappings to the API doc URL.", BMinusSetting) | |
val scmInfo = SettingKey[Option[ScmInfo]]("scm-info", "Basic SCM information for the project.", BMinusSetting) | |
val projectInfo = SettingKey[ModuleInfo]("project-info", "Addition project information like formal name, homepage, licenses etc.", CSetting) | |
val defaultConfiguration = SettingKey[Option[Configuration]]("default-configuration", "Defines the configuration used when none is specified for a dependency.", CSetting) | |
@@ -253,7 +247,8 @@ object Keys | |
val updateSbtClassifiers = TaskKey[UpdateReport]("update-sbt-classifiers", "Resolves and optionally retrieves classifiers, such as javadocs and sources, for sbt, transitively.", BPlusTask, updateClassifiers) | |
val publishConfiguration = TaskKey[PublishConfiguration]("publish-configuration", "Configuration for publishing to a repository.", DTask) | |
- val publishLocalConfiguration = TaskKey[PublishConfiguration]("publish-local-configuration", "Configuration for publishing to the local repository.", DTask) | |
+ val publishLocalConfiguration = TaskKey[PublishConfiguration]("publish-local-configuration", "Configuration for publishing to the local Ivy repository.", DTask) | |
+ val publishM2Configuration = TaskKey[PublishConfiguration]("publish-m2-configuration", "Configuration for publishing to the local Maven repository.", DTask) | |
val deliverConfiguration = TaskKey[DeliverConfiguration]("deliver-configuration", "Configuration for generating the finished Ivy file for publishing.", DTask) | |
val deliverLocalConfiguration = TaskKey[DeliverConfiguration]("deliver-local-configuration", "Configuration for generating the finished Ivy file for local publishing.", DTask) | |
val makePomConfiguration = SettingKey[MakePomConfiguration]("make-pom-configuration", "Configuration for generating a pom.", DSetting) | |
@@ -265,7 +260,8 @@ object Keys | |
val deliver = TaskKey[File]("deliver", "Generates the Ivy file for publishing to a repository.", BTask) | |
val deliverLocal = TaskKey[File]("deliver-local", "Generates the Ivy file for publishing to the local repository.", BTask) | |
val publish = TaskKey[Unit]("publish", "Publishes artifacts to a repository.", APlusTask) | |
- val publishLocal = TaskKey[Unit]("publish-local", "Publishes artifacts to the local repository.", APlusTask) | |
+ val publishLocal = TaskKey[Unit]("publish-local", "Publishes artifacts to the local Ivy repository.", APlusTask) | |
+ val publishM2 = TaskKey[Unit]("publish-m2", "Publishes artifacts to the local Maven repository.", ATask) | |
val pomExtra = SettingKey[NodeSeq]("pom-extra", "Extra XML to insert into the generated POM.", BSetting) | |
val pomPostProcess = SettingKey[XNode => XNode]("pom-post-process", "Transforms the generated POM.", CSetting) | |
@@ -279,6 +275,7 @@ object Keys | |
val projectID = SettingKey[ModuleID]("project-id", "The dependency management descriptor for the current module.", BMinusSetting) | |
val overrideBuildResolvers = SettingKey[Boolean]("override-build-resolvers", "Whether or not all the build resolvers should be overriden with what's defined from the launcher.", BMinusSetting) | |
val bootResolvers = TaskKey[Option[Seq[Resolver]]]("boot-resolvers", "The resolvers used by the sbt launcher.", BMinusSetting) | |
+ val appResolvers = SettingKey[Option[Seq[Resolver]]]("app-resolvers", "The resolvers configured for this application by the sbt launcher.", BMinusSetting) | |
val externalResolvers = TaskKey[Seq[Resolver]]("external-resolvers", "The external resolvers for automatically managed dependencies.", BMinusSetting) | |
val resolvers = SettingKey[Seq[Resolver]]("resolvers", "The user-defined additional resolvers for automatically managed dependencies.", BMinusTask) | |
val projectResolver = TaskKey[Resolver]("project-resolver", "Resolver that handles inter-project dependencies.", DTask) | |
@@ -310,7 +307,9 @@ object Keys | |
val classifiersModule = TaskKey[GetClassifiersModule]("classifiers-module", rank = CTask) | |
val conflictWarning = SettingKey[ConflictWarning]("conflict-warning", "Configures warnings for conflicts in dependency management.", CSetting) | |
+ val conflictManager = SettingKey[ConflictManager]("conflict-manager", "Selects the conflict manager to use for dependency management.", CSetting) | |
val autoScalaLibrary = SettingKey[Boolean]("auto-scala-library", "Adds a dependency on scala-library if true.", ASetting) | |
+ val managedScalaInstance = SettingKey[Boolean]("managed-scala-instance", "Automatically obtains Scala tools as managed dependencies if true.", BSetting) | |
val sbtResolver = SettingKey[Resolver]("sbt-resolver", "Provides a resolver for obtaining sbt as a dependency.", BMinusSetting) | |
val sbtDependency = SettingKey[ModuleID]("sbt-dependency", "Provides a definition for declaring the current version of sbt.", BMinusSetting) | |
val sbtVersion = SettingKey[String]("sbt-version", "Provides the version of sbt. This setting should be not be modified.", AMinusSetting) | |
@@ -323,21 +322,19 @@ object Keys | |
val tags = SettingKey[Seq[(Tags.Tag,Int)]]("tags", ConcurrentRestrictions.tagsKey.label, BSetting) | |
val concurrentRestrictions = SettingKey[Seq[Tags.Rule]]("concurrent-restrictions", "Rules describing restrictions on concurrent task execution.", BSetting) | |
val cancelable = SettingKey[Boolean]("cancelable", "Enables (true) or disables (false) the ability to interrupt task execution with CTRL+C.", BMinusSetting) | |
- val settingsData = TaskKey[Settings[Scope]]("settings-data", "Provides access to the project data for the build.", DTask) | |
- @deprecated("Use Keys.settingsData.", "0.12.0") | |
- val settings = settingsData | |
+ val settingsData = std.FullInstance.settingsData | |
val streams = TaskKey[TaskStreams]("streams", "Provides streams for logging and persisting data.", DTask) | |
val isDummyTask = AttributeKey[Boolean]("is-dummy-task", "Internal: used to identify dummy tasks. sbt injects values for these tasks at the start of task execution.", Invisible) | |
val taskDefinitionKey = AttributeKey[ScopedKey[_]]("task-definition-key", "Internal: used to map a task back to its ScopedKey.", Invisible) | |
val (executionRoots, dummyRoots)= dummy[Seq[ScopedKey[_]]]("execution-roots", "The list of root tasks for this task execution. Roots are the top-level tasks that were directly requested to be run.") | |
val (state, dummyState) = dummy[State]("state", "Current build state.") | |
val (streamsManager, dummyStreamsManager) = dummy[Streams]("streams-manager", "Streams manager, which provides streams for different contexts.") | |
- val resolvedScoped = SettingKey[ScopedKey[_]]("resolved-scoped", "The ScopedKey for the referencing setting or task.", DSetting) | |
+ val stateStreams = AttributeKey[Streams]("streams-manager", "Streams manager, which provides streams for different contexts. Setting this on State will override the default Streams implementation.") | |
+ val resolvedScoped = Def.resolvedScoped | |
val pluginData = TaskKey[PluginData]("plugin-data", "Information from the plugin build needed in the main build definition.", DTask) | |
- private[sbt] val parseResult: TaskKey[Any] = TaskKey("$parse-result", "Internal: used to implement input tasks.", Invisible) | |
- val triggeredBy = AttributeKey[Seq[Task[_]]]("triggered-by") | |
- val runBefore = AttributeKey[Seq[Task[_]]]("run-before") | |
+ val triggeredBy = Def.triggeredBy | |
+ val runBefore = Def.runBefore | |
type Streams = std.Streams[ScopedKey[_]] | |
type TaskStreams = std.TaskStreams[ScopedKey[_]] | |
@@ -345,52 +342,8 @@ object Keys | |
def dummy[T: Manifest](name: String, description: String): (TaskKey[T], Task[T]) = (TaskKey[T](name, description, DTask), dummyTask(name)) | |
def dummyTask[T](name: String): Task[T] = | |
{ | |
- val base: Task[T] = task( error("Dummy task '" + name + "' did not get converted to a full task.") ) named name | |
+ val base: Task[T] = task( sys.error("Dummy task '" + name + "' did not get converted to a full task.") ) named name | |
base.copy(info = base.info.set(isDummyTask, true)) | |
} | |
def isDummy(t: Task[_]): Boolean = t.info.attributes.get(isDummyTask) getOrElse false | |
} | |
- | |
-object KeyRanks | |
-{ | |
- // task and setting ranks, used to prioritize displaying information | |
- // main tasks | |
- final val APlusTask = 4 | |
- final val ATask = 5 | |
- final val AMinusTask = 6 | |
- | |
- // main settings | |
- final val APlusSetting = 9 | |
- final val ASetting = 10 | |
- final val AMinusSetting = 11 | |
- | |
- // less major tasks or tasks that print useful information | |
- final val BPlusTask = 29 | |
- final val BTask = 30 | |
- final val BMinusTask = 31 | |
- | |
- // secondary settings | |
- final val BPlusSetting = 39 | |
- final val BSetting = 40 | |
- final val BMinusSetting = 41 | |
- | |
- // advanced settings | |
- final val CSetting = 100 | |
- // advanced tasks | |
- final val CTask = 200 | |
- // explicit settings | |
- final val DSetting = 10000 | |
- // explicit tasks | |
- final val DTask = 20000 | |
- | |
- final val MainTaskCutoff = AMinusTask | |
- final val MainSettingCutoff = AMinusSetting | |
- final val MainCutoff = math.max(AMinusTask, AMinusSetting) | |
- | |
- final val DefaultTaskRank = (ATask + BTask)/2 | |
- final val DefaultInputRank = ATask // input tasks are likely a main task | |
- final val DefaultSettingRank = (ASetting + BSetting) / 2 | |
- | |
- // implementation details | |
- val Invisible = Int.MaxValue | |
-} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment