From d1c68295c004e7980f66e12c03efbbf1c52eba98 Mon Sep 17 00:00:00 2001 From: Mark Harrah Date: Fri, 30 Aug 2013 18:34:54 -0400 Subject: [PATCH] Docs: removing remaining mentions of "~=" --- src/sphinx/Detailed-Topics/Artifacts.rst | 10 +++++--- .../Detailed-Topics/Library-Management.rst | 5 ++-- .../Detailed-Topics/Parallel-Execution.rst | 5 +++- .../Advanced-Configurations-Example.rst | 2 +- src/sphinx/Extending/Build-Loaders.rst | 3 ++- .../Getting-Started/Library-Dependencies.rst | 4 +-- src/sphinx/Getting-Started/Summary.rst | 2 +- src/sphinx/Howto/logging.rst | 5 ++-- src/sphinx/Name-Index.rst | 2 +- src/sphinx/faq.rst | 25 ++++++++----------- 10 files changed, 32 insertions(+), 31 deletions(-) diff --git a/src/sphinx/Detailed-Topics/Artifacts.rst b/src/sphinx/Detailed-Topics/Artifacts.rst index e744247d9..7723a4310 100644 --- a/src/sphinx/Detailed-Topics/Artifacts.rst +++ b/src/sphinx/Detailed-Topics/Artifacts.rst @@ -56,8 +56,9 @@ To modify the type of the main artifact, for example: :: - artifact in (Compile, packageBin) ~= { (art: Artifact) => - art.copy(`type` = "bundle") + artifact in (Compile, packageBin) := { + val previous: Artifact = (artifact in (Compile, packageBin)).value + previous.copy(`type` = "bundle") } The generated artifact name is determined by the `artifactName` @@ -170,8 +171,9 @@ instead of the `.jar` file. publishArtifact in (Compile, packageBin) := false // create an Artifact for publishing the .war file - artifact in (Compile, packageWar) ~= { (art: Artifact) => - art.copy(`type` = "war", extension = "war") + artifact in (Compile, packageWar) := { + val previous: Artifact = (artifact in (Compile, packageWar)).value + previous.copy(`type` = "war", extension = "war") } // add the .war file to what gets published diff --git a/src/sphinx/Detailed-Topics/Library-Management.rst b/src/sphinx/Detailed-Topics/Library-Management.rst index b0ef8df72..242fbebe1 100644 --- a/src/sphinx/Detailed-Topics/Library-Management.rst +++ b/src/sphinx/Detailed-Topics/Library-Management.rst @@ -333,8 +333,9 @@ To define extra attributes on the current project: :: - projectID ~= { id => - id extra("color" -> "blue", "component" -> "compiler-interface") + projectID := { + val previous = projectID.value + previous.extra("color" -> "blue", "component" -> "compiler-interface") } Inline Ivy XML diff --git a/src/sphinx/Detailed-Topics/Parallel-Execution.rst b/src/sphinx/Detailed-Topics/Parallel-Execution.rst index d72ead04a..649853b04 100644 --- a/src/sphinx/Detailed-Topics/Parallel-Execution.rst +++ b/src/sphinx/Detailed-Topics/Parallel-Execution.rst @@ -288,7 +288,10 @@ tags applied to it. Only the first computation is labeled. compile := myCompileTask.value - compile ~= { ... do some post processing ... } + compile := { + val result = compile.value + ... do some post processing ... + } Is this desirable? expected? If not, what is a better, alternative behavior? diff --git a/src/sphinx/Examples/Advanced-Configurations-Example.rst b/src/sphinx/Examples/Advanced-Configurations-Example.rst index af473e729..03146b384 100644 --- a/src/sphinx/Examples/Advanced-Configurations-Example.rst +++ b/src/sphinx/Examples/Advanced-Configurations-Example.rst @@ -49,7 +49,7 @@ need Saxon. By depending only on the `scalate` configuration of classpathConfiguration in Common := CustomCompile, // Modify the default Ivy configurations. // 'overrideConfigs' ensures that Compile is replaced by CustomCompile - ivyConfigurations ~= overrideConfigs(Scalate, Saxon, Common, CustomCompile), + ivyConfigurations := overrideConfigs(Scalate, Saxon, Common, CustomCompile)(ivyConfigurations.value), // Put all dependencies without an explicit configuration into Common (optional) defaultConfiguration := Some(Common), // Declare dependencies in the appropriate configurations diff --git a/src/sphinx/Extending/Build-Loaders.rst b/src/sphinx/Extending/Build-Loaders.rst index 14b47a9b8..c4c2da5d2 100644 --- a/src/sphinx/Extending/Build-Loaders.rst +++ b/src/sphinx/Extending/Build-Loaders.rst @@ -269,7 +269,8 @@ like a local directory. :: - buildDependencies in Global ~= { deps => + buildDependencies in Global := { + val deps = (buildDependencies in Global).value val oldURI = uri("...") // the URI to replace val newURI = uri("...") // the URI replacing oldURI def substitute(dep: ClasspathDep[ProjectRef]): ClasspathDep[ProjectRef] = diff --git a/src/sphinx/Getting-Started/Library-Dependencies.rst b/src/sphinx/Getting-Started/Library-Dependencies.rst index feca9a495..da4563741 100644 --- a/src/sphinx/Getting-Started/Library-Dependencies.rst +++ b/src/sphinx/Getting-Started/Library-Dependencies.rst @@ -30,9 +30,7 @@ Dependencies in `lib` go on all the classpaths (for `compile`, `test`, `run`, and `console`). If you wanted to change the classpath for just one of those, you would adjust `dependencyClasspath in Compile` or `dependencyClasspath in Runtime` -for example. You could use `~=` to get the previous classpath value, -filter some entries out, and return a new classpath value. See :doc:`more about settings ` -for details of `~=`. +for example. There's nothing to add to `build.sbt` to use unmanaged dependencies, though you could change the `unmanagedBase` key if you'd like to use diff --git a/src/sphinx/Getting-Started/Summary.rst b/src/sphinx/Getting-Started/Summary.rst index c8f8ae0c9..041fb12e2 100644 --- a/src/sphinx/Getting-Started/Summary.rst +++ b/src/sphinx/Getting-Started/Summary.rst @@ -23,7 +23,7 @@ sbt: The Core Concepts - your build definition is one big list of `Setting` objects, where a `Setting` transforms the set of key-value pairs sbt uses to perform tasks. -- to create a `Setting`, call one of a few methods on a key: `:=`, `+=`, `++=`, or `~=`. +- to create a `Setting`, call one of a few methods on a key: `:=`, `+=`, or `++=`. - there is no mutable state, only transformation; for example, a `Setting` transforms sbt's collection of key-value pairs into a new collection. It doesn't change anything in-place. diff --git a/src/sphinx/Howto/logging.rst b/src/sphinx/Howto/logging.rst index 57e5bb0c6..1a1b8eedb 100644 --- a/src/sphinx/Howto/logging.rst +++ b/src/sphinx/Howto/logging.rst @@ -241,13 +241,14 @@ This means that it can provide different logging based on the task that requests :: - extraLoggers ~= { currentFunction => + extraLoggers := { + val currentFunction = extraLoggers.value (key: ScopedKey[_]) => { myCustomLogger(key) +: currentFunction(key) } } -Here, we take the current function for the setting `currentFunction` and provide a new function. +Here, we take the current function `currentFunction` for the setting and provide a new function. The new function prepends our custom logger to the ones provided by the old function. .. howto:: diff --git a/src/sphinx/Name-Index.rst b/src/sphinx/Name-Index.rst index a4178642a..467b7323e 100644 --- a/src/sphinx/Name-Index.rst +++ b/src/sphinx/Name-Index.rst @@ -98,7 +98,7 @@ Settings and Tasks See the :doc:`Getting Started Guide ` for details. -- `:=`, `+=`, `++=`, `~=` These +- `:=`, `+=`, `++=` These construct a `Setting <../api/sbt/Init$Setting.html>`_, which is the fundamental type in the :doc:`settings ` system. - `value` This uses the value of another setting or task in the definition of a new setting or task. diff --git a/src/sphinx/faq.rst b/src/sphinx/faq.rst index 9c60225cc..7c6d2fad8 100644 --- a/src/sphinx/faq.rst +++ b/src/sphinx/faq.rst @@ -86,7 +86,7 @@ You may run `sbt console`. Build definitions ----------------- -What are the `:=`, `+=`, `++=`, and `~=` methods? +What are the `:=`, `+=`, and `++=` methods? ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ These are methods on keys used to construct a `Setting` or a `Task`. The Getting @@ -393,7 +393,10 @@ basic structure of defining `onLoad`: // Compose our new function 'f' with the existing transformation. { val f: State => State = ... - onLoad in Global ~= (f compose _) + onLoad in Global := { + val previous = (onLoad in Global).value + f compose previous + } } Example of project load/unload hooks @@ -413,7 +416,10 @@ has been loaded and prints that number: println("Project load count: " + previous) s.put(key, previous + 1) } - onLoad in Global ~= (f compose _) + onLoad in Global := { + val previous = (onLoad in Global).value + f compose previous + } } Errors @@ -455,17 +461,9 @@ A more subtle variation of this error occurs when using :doc:`scoped settings