Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

keep previous site around for now

  • Loading branch information...
commit 2de78e8311613fbbf2febd4f768fc7bb45acde86 1 parent bb81af7
@harrah harrah authored
Showing with 5,313 additions and 19 deletions.
  1. +0 −1  community-plugins.html
  2. +203 −0 community-plugins.html
  3. +134 −0 community.html
  4. +0 −1  community.html
  5. +0 −1  download.html
  6. +247 −0 download.html
  7. +0 −1  howto.html
  8. +812 −0 howto.html
  9. +143 −0 howto/generatefiles.html
  10. +0 −1  howto/generatefiles.html
  11. +393 −0 howto/inspect.html
  12. +0 −1  howto/inspect.html
  13. +0 −1  howto/interactive.html
  14. +257 −0 howto/interactive.html
  15. +339 −0 howto/logging.html
  16. +0 −1  howto/logging.html
  17. +141 −0 howto/metadata.html
  18. +0 −1  howto/metadata.html
  19. +0 −1  howto/package.html
  20. +144 −0 howto/package.html
  21. +0 −1  howto/runningcommands.html
  22. +135 −0 howto/runningcommands.html
  23. +0 −1  howto/scala.html
  24. +215 −0 howto/scala.html
  25. +139 −0 howto/triggered.html
  26. +0 −1  howto/triggered.html
  27. +0 −1  index.html
  28. +382 −0 index.html
  29. +6 −0 jquery.scrollto.min.js
  30. +0 −1  learn.html
  31. +165 −0 learn.html
  32. +0 −1  plugins.html
  33. +387 −0 plugins.html
  34. +0 −1  repository-rules.html
  35. +60 −0 repository-rules.html
  36. +284 −0 resources/howto-site.css
  37. +279 −0 resources/site.css
  38. +63 −0 resources/syntax.css
  39. +0 −1  talks.html
  40. +139 −0 talks.html
  41. +0 −1  using_sonatype.html
  42. +246 −0 using_sonatype.html
View
1  community-plugins.html
View
203 community-plugins.html
@@ -0,0 +1,203 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en-us">
+<head>
+ <title>Community Plugins - </title>
+ <link href='http://fonts.googleapis.com/css?family=Copse' rel='stylesheet' type='text/css'>
+ <link href='/resources/site.css' rel='stylesheet' type='text/css'>
+ <link href='/resources/syntax.css' rel='stylesheet' type='text/css'>
+ <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js">
+ </script>
+</head>
+<body>
+
+
+ <!-- Topbar
+ ================================================== -->
+ <div class="cf" id="more" >
+ <div id="top">
+ <div class="container">
+ <a class="brand" href="/">SBT</a>
+ <ul class="nav">
+ <li><a href="/learn.html">Learn</a>
+ <li><a href="/download.html">Download</a>
+ <li><a href="/community.html">Community</a></li>
+ <li><a href="#top">Top</a></li>
+ </ul>
+ </div>
+ </div>
+ </div>
+
+
+<div class="cf" id="container">
+ <div class="span2 columns container-spacer"><p>&nbsp;</p></div>
+ <div id="intro" class="span10 columns content">
+ <div id="head" class="cf">
+ <div id="name" class="left">
+ <h1>sbt</h1>
+ <h2>Community Plugins</h2>
+ <p id="what">ensuring everything is possible.</p>
+ </div>
+ <div class="left page-description" id="vc">
+ <p>The <a href="http://github.com/sbt">SBT Organization</a> contains a <a href="http://github.com/sbt/sbt-community-plugins">SBT Community Plugins</a> project. This project aims to unify all the SBT plugins in the community and ensure their compatibility and timely releases with new versions of SBT. There is also a <a href="https://github.com/harrah/xsbt/wiki/sbt-0.10-plugins-list">list of plugins</a> that is up-to-date.</p>
+
+ </div>
+ </div>
+ <div id="features" class="cf">
+ <div id="feature-list">
+ <ul class="left">
+
+
+
+
+ <li><a href="plugins.html">Available Plugins</a></li>
+
+
+
+
+
+
+
+
+
+ <li><a href="#sbtorg">SBT Organization</a></li>
+
+
+
+
+
+
+ </ul>
+ <ul class="left">
+
+
+
+
+
+
+
+ <li><a href="#communityrepo">Community Ivy repository</a></li>
+
+
+
+
+
+
+
+
+
+ <li><a href="#pluginbuild">Community Plugin Build</a></li>
+
+
+
+ </ul>
+ </div>
+ </div>
+ <div id="pagecontent" class="cf">
+
+
+ </div>
+ </div>
+
+ <div id="extra">
+ <ul id="examples">
+
+
+ <li id="communityrepo" class="feature contained"><h4>Community Ivy Repository ####</h4>
+
+<p><a href="http://www.typesafe.com">Typesafe, Inc.</a> has provided a freely available <a href="http://scalasbt.artifactoryonline.com/scalasbt">Ivy Repository</a> for SBT projects to make use of.</p>
+
+<p>If you would like to publish your project to this Ivy repository, first contact <a href="http://groups.google.com/group/sbt-repo-admins?hl=en">sbt-repo-admins</a> and request privileges
+(we have to verify code ownership, rights to publish, etc.). After which, you can deploy your plugins using the following configuration:</p>
+
+<pre><code>publishTo := Some(Resolver.url("sbt-plugin-releases", new URL("http://scalasbt.artifactoryonline.com/scalasbt/sbt-plugin-releases/"))(Resolver.ivyStylePatterns))
+
+publishMavenStyle := false
+</code></pre>
+
+<p>You'll also need to add your credentials somewhere. I use a <code>~/.sbt/sbtpluginpublish.sbt</code> file:</p>
+
+<pre><code>credentials += Credentials("Artifactory Realm", "scalasbt.artifactoryonline.com", "jsuereth", "@my encrypted password@")
+</code></pre>
+
+<p>Where <code>@my encrypted password@</code> is actually obtained using the following <a href="http://wiki.jfrog.org/confluence/display/RTF/Centrally+Secure+Passwords">instructions</a>.</p>
+
+<p><em>Note: Your code must abide by the <a href="repository-rules.html">repository polices</a>.</em></p>
+
+<p>To automatically deploy snapshot/release versions of your plugin use
+the following configuration:</p>
+
+<pre><code>publishTo &lt;&lt;= (version) { version: String =&gt;
+ val scalasbt = "http://scalasbt.artifactoryonline.com/scalasbt/"
+ val (name, url) = if (version.contains("-SNAPSHOT"))
+ ("sbt-plugin-snapshots", scalasbt+"sbt-plugin-snapshots")
+ else
+ ("sbt-plugin-releases", scalasbt+"sbt-plugin-releases")
+ Some(Resolver.url(name, new URL(url))(Resolver.ivyStylePatterns))
+}
+</code></pre>
+
+<p><em>Note: ivy repositories currently don't support Maven-style snapshots.</em></p>
+</li>
+
+
+
+ <li id="sbtorg" class="feature contained"><h4>SBT Organization</h4>
+
+<p>The <a href="http://github.com/sbt">SBT Organization</a> is available for use by any SBT plugin.<br/>
+Developers who contribute their plugins into the community organization will still retain
+control over their repository and its access. The Goal of the SBT organization is to
+organize SBT software into one central location.</p>
+
+<p>A side benefit to using the SBT organization for projects is that you can use gh-pages to host websites in the http://scala-sbt.org domain.</p>
+</li>
+
+
+
+ <li id="pluginbuild" class="feature contained"><h4>SBT Community Plugin Build</h4>
+
+<p>The <a href="http://github.com/sbt/sbt-community-plugins">SBT Community Plugins</a> project aims to build <em>all</em> SBT plugins in a single build.<br/>
+This should enable thorough testing of plugins and ensure that plugins work together.</p>
+</li>
+
+
+ </ul>
+ </div>
+ </div>
+ <div class="span6 columns"><p>&nbsp;</p></div>
+</div>
+
+
+
+<script type="text/javascript" src="/jquery.scrollto.min.js"></script>
+<script type="text/javascript">
+ (function($){ $(function(){
+ $("#top").click(function(){ $("#intro").ScrollTo(); })
+
+ var applyH = function() {
+ $("#intro, .feature").each(function (i, elt) {
+ if ($(elt).height() < $(window).height()) {
+ $(elt).height($(window).height());
+ }
+ });
+ };
+ $(window).bind('resize', function() { applyH(); });
+ applyH();
+
+ $('#features a, .st').click(function(e){
+ var h = $(this).attr('href');
+ if(h && h[0] && h[0] == '#') {
+ e.preventDefault();
+
+ $(h).ScrollTo({
+ callback:function(){ window.location.hash = h;}
+ });
+ }
+ });
+ });})(jQuery);
+</script>
+
+</body>
+</html>
+
View
134 community.html
@@ -0,0 +1,134 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en-us">
+<head>
+ <title>Community - </title>
+ <link href='http://fonts.googleapis.com/css?family=Copse' rel='stylesheet' type='text/css'>
+ <link href='/resources/site.css' rel='stylesheet' type='text/css'>
+ <link href='/resources/syntax.css' rel='stylesheet' type='text/css'>
+ <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js">
+ </script>
+</head>
+<body>
+
+
+ <!-- Topbar
+ ================================================== -->
+ <div class="cf" id="more" >
+ <div id="top">
+ <div class="container">
+ <a class="brand" href="/">SBT</a>
+ <ul class="nav">
+ <li><a href="/learn.html">Learn</a>
+ <li><a href="/download.html">Download</a>
+ <li><a href="/community.html">Community</a></li>
+ <li><a href="#top">Top</a></li>
+ </ul>
+ </div>
+ </div>
+ </div>
+
+
+<div class="cf" id="container">
+ <div class="span2 columns container-spacer"><p>&nbsp;</p></div>
+ <div id="intro" class="span10 columns content">
+ <div id="head" class="cf">
+ <div id="name" class="left">
+ <h1>sbt</h1>
+ <h2>Community</h2>
+ <p id="what">Amazing People, including you</p>
+ </div>
+ <div class="left page-description" id="vc">
+ <p>A wonderful, highly engaged community that you can talk to and be a part of.</p>
+
+ </div>
+ </div>
+ <div id="features" class="cf">
+ <div id="feature-list">
+ <ul class="left">
+
+
+
+
+ <li><a href="http://groups.google.com/group/simple-build-tool/topics">Mailing List</a></li>
+
+
+
+
+
+
+
+
+
+ <li><a href="http://github.com/harrah/xsbt">Source Code</a></li>
+
+
+
+ </ul>
+ <ul class="left">
+
+
+
+
+
+
+
+ <li><a href="community-plugins.html">Community Plugins</a></li>
+
+
+
+
+
+
+ </ul>
+ </div>
+ </div>
+ <div id="pagecontent" class="cf">
+
+
+ </div>
+ </div>
+
+ <div id="extra">
+ <ul id="examples">
+
+ </ul>
+ </div>
+ </div>
+ <div class="span6 columns"><p>&nbsp;</p></div>
+</div>
+
+
+
+<script type="text/javascript" src="/jquery.scrollto.min.js"></script>
+<script type="text/javascript">
+ (function($){ $(function(){
+ $("#top").click(function(){ $("#intro").ScrollTo(); })
+
+ var applyH = function() {
+ $("#intro, .feature").each(function (i, elt) {
+ if ($(elt).height() < $(window).height()) {
+ $(elt).height($(window).height());
+ }
+ });
+ };
+ $(window).bind('resize', function() { applyH(); });
+ applyH();
+
+ $('#features a, .st').click(function(e){
+ var h = $(this).attr('href');
+ if(h && h[0] && h[0] == '#') {
+ e.preventDefault();
+
+ $(h).ScrollTo({
+ callback:function(){ window.location.hash = h;}
+ });
+ }
+ });
+ });})(jQuery);
+</script>
+
+</body>
+</html>
+
View
1  community.html
View
1  download.html
View
247 download.html
@@ -0,0 +1,247 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en-us">
+<head>
+ <title>download - </title>
+ <link href='http://fonts.googleapis.com/css?family=Copse' rel='stylesheet' type='text/css'>
+ <link href='/resources/site.css' rel='stylesheet' type='text/css'>
+ <link href='/resources/syntax.css' rel='stylesheet' type='text/css'>
+ <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js">
+ </script>
+</head>
+<body>
+
+
+ <!-- Topbar
+ ================================================== -->
+ <div class="cf" id="more" >
+ <div id="top">
+ <div class="container">
+ <a class="brand" href="/">SBT</a>
+ <ul class="nav">
+ <li><a href="/learn.html">Learn</a>
+ <li><a href="/download.html">Download</a>
+ <li><a href="/community.html">Community</a></li>
+ <li><a href="#top">Top</a></li>
+ </ul>
+ </div>
+ </div>
+ </div>
+
+
+<div class="cf" id="container">
+ <div class="span2 columns container-spacer"><p>&nbsp;</p></div>
+ <div id="intro" class="span10 columns content">
+ <div id="head" class="cf">
+ <div id="name" class="left">
+ <h1>sbt</h1>
+ <h2>download</h2>
+ <p id="what">up and running in moments.</p>
+ </div>
+ <div class="left page-description" id="vc">
+ <p>The <a href="http://github.com/sbt/sbt-launcher-package">SBT Launcher</a> project contains a set of native packages for use in your operating system.</p>
+
+<p><a href="#windows">msi</a> | <a href="#rpm">yum</a> | <a href="#deb">apt-get</a> | <a href="#mac">homebrew</a> | <a href="#manual">by hand</a></p>
+
+ </div>
+ </div>
+ <div id="features" class="cf">
+ <div id="feature-list">
+ <ul class="left">
+
+
+
+
+ <li><a href="#windows">Windows MSI downloads</a></li>
+
+
+
+
+
+
+
+
+
+ <li><a href="#deb">Apt Repository</a></li>
+
+
+
+
+
+
+
+
+
+ <li><a href="#manual">Manual Installation</a></li>
+
+
+
+ </ul>
+ <ul class="left">
+
+
+
+
+
+
+
+ <li><a href="#rpm">Yum Repository</a></li>
+
+
+
+
+
+
+
+
+
+ <li><a href="#mac">Homebrew</a></li>
+
+
+
+
+
+
+ </ul>
+ </div>
+ </div>
+ <div id="pagecontent" class="cf">
+ <!-- This page has no content. -->
+
+
+
+
+ </div>
+ </div>
+
+ <div id="extra">
+ <ul id="examples">
+
+
+ <li id="windows" class="feature contained"><h4>Windows Releases</h4>
+
+<p><a href="http://scalasbt.artifactoryonline.com/scalasbt/sbt-native-packages/org/scala-sbt/sbt/0.12.0/sbt.msi">Click here</a> for the latest windows MSI.</p>
+
+<p><em>Note: please make sure to report any issues you may find <a href="https://github.com/sbt/sbt-launcher-package/issues">here</a>.</em></p>
+</li>
+
+
+
+ <li id="rpm" class="feature contained"><h4>Yum Repositories</h4>
+
+<p>The sbt package is available from the <a href="http://rpm.typesafe.com">Typesafe Yum Repository</a>.
+Please install <a href="http://rpm.typesafe.com/typesafe-repo-2.0.0-1.noarch.rpm">this rpm</a> to add the typesafe yum repository to your list of approved sources.
+Then run:</p>
+
+<pre><code>yum install sbt
+</code></pre>
+
+<p> to grab the latest release of sbt.</p>
+
+<p><em>Note: please make sure to report any issues you may find <a href="https://github.com/sbt/sbt-launcher-package/issues">here</a>.</em>"</p>
+</li>
+
+
+
+ <li id="deb" class="feature contained"><h4>APT Repositories</h4>
+
+<p>The sbt package is available from the <a href="http://apt.typesafe.com">Typesafe Debian Repository</a>.
+Please install <a href="http://apt.typesafe.com/repo-deb-build-0002.deb">this deb</a> to enable the typesafe repository.
+Then run:</p>
+
+<pre><code>apt-get install sbt
+</code></pre>
+
+<p>to grab the latest release of sbt.</p>
+
+<p> <em>Note: please make sure to report any issues you may find <a href="https://github.com/sbt/sbt-launcher-package/issues">here</a>.</em>"</p>
+</li>
+
+
+
+ <li id="mac" class="feature contained"><h4>Hombrew</h4>
+
+<p>Use HomeBrew:</p>
+
+<pre><code>$ brew install sbt
+</code></pre>
+</li>
+
+
+
+ <li id="manual" class="feature contained"><h4>Pre-Built Zip files</h4>
+
+<p>Download one of the pre-built <a href="http://scalasbt.artifactoryonline.com/scalasbt/sbt-native-packages/org/scala-sbt/sbt/0.12.0/sbt.zip">zip</a>
+or <a href="http://scalasbt.artifactoryonline.com/scalasbt/sbt-native-packages/org/scala-sbt/sbt/0.12.0/sbt.tgz">tgz</a> and
+add the bin/ to your path.</p>
+
+<h4>By Hand installation</h4>
+
+<p>First, download the <a href="http://typesafe.artifactoryonline.com/typesafe/ivy-releases/org.scala-sbt/sbt-launch/0.12.0/sbt-launch.jar">launcher jar</a>
+and place it somewhere useful.
+THEN, create a script in that same directory.</p>
+
+<h5>Windows</h5>
+
+<p>Create a <code>sbt.bat</code> file next to the launch jar.</p>
+
+<pre><code>set SCRIPT_DIR=%~dp0
+java -Xmx512M -jar "%SCRIPT_DIR%sbt-launch.jar" %*
+</code></pre>
+
+<p>Add the directory containing <code>sbt.bat</code> to the windows path.</p>
+
+<h5>Unix-Like</h5>
+
+<p>Create a <code>sbt</code> script (a good place is <code>~/bin/sbt</code></p>
+
+<pre><code>java -Xmx512M -jar `dirname $0`/sbt-launch.jar "$@"
+</code></pre>
+
+<p>then make the script executable:</p>
+
+<pre><code>$ chmod u+x ~/bin/sbt
+</code></pre>
+</li>
+
+
+ </ul>
+ </div>
+ </div>
+ <div class="span6 columns"><p>&nbsp;</p></div>
+</div>
+
+
+
+<script type="text/javascript" src="/jquery.scrollto.min.js"></script>
+<script type="text/javascript">
+ (function($){ $(function(){
+ $("#top").click(function(){ $("#intro").ScrollTo(); })
+
+ var applyH = function() {
+ $("#intro, .feature").each(function (i, elt) {
+ if ($(elt).height() < $(window).height()) {
+ $(elt).height($(window).height());
+ }
+ });
+ };
+ $(window).bind('resize', function() { applyH(); });
+ applyH();
+
+ $('#features a, .st').click(function(e){
+ var h = $(this).attr('href');
+ if(h && h[0] && h[0] == '#') {
+ e.preventDefault();
+
+ $(h).ScrollTo({
+ callback:function(){ window.location.hash = h;}
+ });
+ }
+ });
+ });})(jQuery);
+</script>
+
+</body>
+</html>
+
View
1  howto.html
View
812 howto.html
@@ -0,0 +1,812 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en-us">
+<head>
+ <title>How to... - </title>
+ <link href='http://fonts.googleapis.com/css?family=Copse' rel='stylesheet' type='text/css'>
+ <link href='/resources/howto-site.css' rel='stylesheet' type='text/css'>
+ <link href='/resources/syntax.css' rel='stylesheet' type='text/css'>
+ <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js">
+ </script>
+</head>
+<body>
+
+
+ <!-- Topbar
+ ================================================== -->
+ <div class="cf" id="more" >
+ <div id="top">
+ <div class="container">
+ <a class="brand" href="/">SBT</a>
+ <ul class="nav">
+ <li><a href="/learn.html">Learn</a>
+ <li><a href="/download.html">Download</a>
+ <li><a href="/community.html">Community</a></li>
+ <li><a href="#top">Top</a></li>
+ </ul>
+ </div>
+ </div>
+ </div>
+
+
+<div class="cf" id="container">
+ <div class="span2 columns container-spacer"><p>&nbsp;</p></div>
+ <div id="intro" class="span10 columns content">
+ <div id="head" class="cf">
+ <h2><span style="color:black;">sbt</span> How to...</h2>
+ </div>
+ <div id="pagecontent" class="cf">
+
+
+<h3>Project metadata <a href="/howto/metadata.html">(details)</a></h3>
+
+
+
+
+<p>... set the project name <a href="/howto/metadata.html#name">(details)</a></p>
+
+
+
+
+<div class="highlight"><pre><code class="scala"> <span class="n">name</span> <span class="o">:=</span> <span class="s">&quot;demo&quot;</span>
+</code></pre>
+</div>
+
+
+
+
+<p>... set the project version <a href="/howto/metadata.html#version">(details)</a></p>
+
+
+
+
+<div class="highlight"><pre><code class="scala"> <span class="n">version</span> <span class="o">:=</span> <span class="s">&quot;1.0&quot;</span>
+</code></pre>
+</div>
+
+
+
+
+<p>... set the project organization <a href="/howto/metadata.html#organization">(details)</a></p>
+
+
+
+
+<div class="highlight"><pre><code class="scala"> <span class="n">organization</span> <span class="o">:=</span> <span class="s">&quot;org.example&quot;</span>
+</code></pre>
+</div>
+
+
+
+
+<p>... set the project homepage and other metadata used in a published pom.xml <a href="/howto/metadata.html#other">(details)</a></p>
+
+
+
+
+<h3>Triggered execution <a href="/howto/triggered.html">(details)</a></h3>
+
+
+
+
+<p>... run a command when sources change <a href="/howto/triggered.html#basic">(details)</a></p>
+
+
+
+
+<div class="highlight"><pre><code class="console"><span class="go"> &gt; ~ test </span>
+</code></pre>
+</div>
+
+
+
+
+<p>... run multiple commands when sources change <a href="/howto/triggered.html#multi">(details)</a></p>
+
+
+
+
+<div class="highlight"><pre><code class="console"><span class="go"> &gt; ~ ;a ;b </span>
+</code></pre>
+</div>
+
+
+
+
+<p>... configure the sources that are checked for changes <a href="/howto/triggered.html#sources">(details)</a></p>
+
+
+
+
+<div class="highlight"><pre><code class="scala"> <span class="n">watchSources</span> <span class="o">&lt;+=</span> <span class="n">baseDirectory</span> <span class="o">{</span> <span class="k">_</span> <span class="o">/</span> <span class="s">&quot;examples.txt&quot;</span> <span class="o">}</span>
+</code></pre>
+</div>
+
+
+
+
+<p>... set the time interval between checks for changes to sources <a href="/howto/triggered.html#interval">(details)</a></p>
+
+
+
+
+<div class="highlight"><pre><code class="scala"> <span class="n">pollInterval</span> <span class="o">:=</span> <span class="mi">1000</span> <span class="c1">// in ms </span>
+</code></pre>
+</div>
+
+
+
+
+<h3>Running commands <a href="/howto/runningcommands.html">(details)</a></h3>
+
+
+
+
+<p>... pass arguments to a command or task in batch mode <a href="/howto/runningcommands.html#batch">(details)</a></p>
+
+
+
+
+<div class="highlight"><pre><code class="console"><span class="go"> $ sbt clean &quot;test-only org.example.Test&quot; &quot;run-main demo.Main a b c&quot; </span>
+</code></pre>
+</div>
+
+
+
+
+<p>... provide multiple commands to run consecutively <a href="/howto/runningcommands.html#multi">(details)</a></p>
+
+
+
+
+<div class="highlight"><pre><code class="console"><span class="go"> &gt; ;clean ;compile </span>
+</code></pre>
+</div>
+
+
+
+
+<p>... read commands from a file <a href="/howto/runningcommands.html#read">(details)</a></p>
+
+
+
+
+<div class="highlight"><pre><code class="console"><span class="go"> &gt; &lt; /path/to/file </span>
+</code></pre>
+</div>
+
+
+
+
+<p>... define an alias for a command or task <a href="/howto/runningcommands.html#alias">(details)</a></p>
+
+
+
+
+<div class="highlight"><pre><code class="console"><span class="go"> &gt; alias h=help </span>
+</code></pre>
+</div>
+
+
+
+
+<p>... quickly evaluate a Scala expression <a href="/howto/runningcommands.html#eval">(details)</a></p>
+
+
+
+
+<div class="highlight"><pre><code class="console"><span class="go"> &gt; eval 2+2 </span>
+</code></pre>
+</div>
+
+
+
+
+<h3>Generating files <a href="/howto/generatefiles.html">(details)</a></h3>
+
+
+
+
+<p>... generate sources <a href="/howto/generatefiles.html#sources">(details)</a></p>
+
+
+
+
+<div class="highlight"><pre><code class="scala"> <span class="n">sourceGenerators</span> <span class="n">in</span> <span class="nc">Compile</span> <span class="o">&lt;+=</span> <span class="o">&lt;</span><span class="n">your</span> <span class="nc">Task</span><span class="o">[</span><span class="kt">Seq</span><span class="o">[</span><span class="kt">File</span><span class="o">]]</span> <span class="n">here</span><span class="o">&gt;</span>
+</code></pre>
+</div>
+
+
+
+
+<p>... generate resources <a href="/howto/generatefiles.html#resources">(details)</a></p>
+
+
+
+
+<div class="highlight"><pre><code class="scala"> <span class="n">resourceGenerators</span> <span class="n">in</span> <span class="nc">Compile</span> <span class="o">&lt;+=</span> <span class="o">&lt;</span><span class="n">your</span> <span class="nc">Task</span><span class="o">[</span><span class="kt">Seq</span><span class="o">[</span><span class="kt">File</span><span class="o">]]</span> <span class="n">here</span><span class="o">&gt;</span>
+</code></pre>
+</div>
+
+
+
+
+<h3>Interactive mode <a href="/howto/interactive.html">(details)</a></h3>
+
+
+
+
+<p>... use tab completion <a href="/howto/interactive.html#basic_completion">(details)</a></p>
+
+
+
+
+<div class="highlight"><pre><code class="console"><span class="go"> &gt; test-only &lt;TAB&gt; </span>
+</code></pre>
+</div>
+
+
+
+
+<p>... show more tab completion suggestions <a href="/howto/interactive.html#verbose_completion">(details)</a>
+ <p>Press tab multiple times.</p></p>
+
+
+
+
+<p>... view basic JLine keybindings <a href="/howto/interactive.html#show_keybindings">(details)</a></p>
+
+
+
+
+<div class="highlight"><pre><code class="console"><span class="go"> &gt; console-quick</span>
+<span class="go">scala&gt; :keybindings</span>
+<span class="go"> </span>
+</code></pre>
+</div>
+
+
+
+
+<p>... modify the default JLine keybindings <a href="/howto/interactive.html#change_keybindings">(details)</a></p>
+
+
+
+
+<p>... configure the prompt string <a href="/howto/interactive.html#prompt">(details)</a></p>
+
+
+
+
+<div class="highlight"><pre><code class="scala"> <span class="n">shellPrompt</span> <span class="o">:=</span> <span class="o">{</span> <span class="o">(</span><span class="n">s</span><span class="k">:</span> <span class="kt">State</span><span class="o">)</span> <span class="k">=&gt;</span> <span class="nc">System</span><span class="o">.</span><span class="n">getProperty</span><span class="o">(</span><span class="s">&quot;user.name&quot;</span><span class="o">)</span> <span class="o">+</span> <span class="s">&quot;&gt; &quot;</span> <span class="o">}</span>
+</code></pre>
+</div>
+
+
+
+
+<p>... use history <a href="/howto/interactive.html#history">(details)</a></p>
+
+
+
+
+<div class="highlight"><pre><code class="console"><span class="go"> &gt; ! </span>
+</code></pre>
+</div>
+
+
+
+
+<p>... change the location of the interactive history file <a href="/howto/interactive.html#history_file">(details)</a></p>
+
+
+
+
+<div class="highlight"><pre><code class="scala"> <span class="n">historyPath</span> <span class="o">&lt;&lt;=</span> <span class="n">baseDirectory</span><span class="o">(</span><span class="n">t</span> <span class="k">=&gt;</span> <span class="nc">Some</span><span class="o">(</span><span class="n">t</span> <span class="o">/</span> <span class="s">&quot;.history&quot;</span><span class="o">))</span>
+</code></pre>
+</div>
+
+
+
+
+<p>... share interactive history across projects <a href="/howto/interactive.html#share_history">(details)</a></p>
+
+
+
+
+<div class="highlight"><pre><code class="scala"> <span class="n">historyPath</span> <span class="o">&lt;&lt;=</span> <span class="o">(</span><span class="n">target</span> <span class="n">in</span> <span class="nc">LocalRootProject</span><span class="o">)</span> <span class="o">{</span> <span class="n">t</span> <span class="k">=&gt;</span> <span class="nc">Some</span><span class="o">(</span><span class="n">t</span> <span class="o">/</span> <span class="s">&quot;.history&quot;</span><span class="o">)</span> <span class="o">}</span>
+</code></pre>
+</div>
+
+
+
+
+<p>... disable interactive history <a href="/howto/interactive.html#disable_history">(details)</a></p>
+
+
+
+
+<div class="highlight"><pre><code class="scala"> <span class="n">historyPath</span> <span class="o">:=</span> <span class="nc">None</span>
+</code></pre>
+</div>
+
+
+
+
+<p>... start interactive mode after executing some commands first <a href="/howto/interactive.html#pre_commands">(details)</a></p>
+
+
+
+
+<div class="highlight"><pre><code class="console"><span class="go"> $ sbt clean compile shell </span>
+</code></pre>
+</div>
+
+
+
+
+<h3>Configure and use Scala <a href="/howto/scala.html">(details)</a></h3>
+
+
+
+
+<p>... set the Scala version used for building the project <a href="/howto/scala.html#version">(details)</a></p>
+
+
+
+
+<div class="highlight"><pre><code class="scala"> <span class="n">version</span> <span class="o">:=</span> <span class="s">&quot;1.0&quot;</span>
+</code></pre>
+</div>
+
+
+
+
+<p>... disable the automatic dependency on the Scala library <a href="/howto/scala.html#noauto">(details)</a></p>
+
+
+
+
+<div class="highlight"><pre><code class="scala"> <span class="n">autoScalaLibrary</span> <span class="o">:=</span> <span class="kc">false</span>
+</code></pre>
+</div>
+
+
+
+
+<p>... temporarily switch to a different Scala version <a href="/howto/scala.html#temporary">(details)</a></p>
+
+
+
+
+<div class="highlight"><pre><code class="console"><span class="go"> &gt; ++ 2.8.2 </span>
+</code></pre>
+</div>
+
+
+
+
+<p>... use a local Scala installation for building a project <a href="/howto/scala.html#local">(details)</a></p>
+
+
+
+
+<div class="highlight"><pre><code class="scala"> <span class="n">scalaHome</span> <span class="o">:=</span> <span class="nc">Some</span><span class="o">(</span><span class="n">file</span><span class="o">(</span><span class="s">&quot;/path/to/scala/home/&quot;</span><span class="o">))</span>
+</code></pre>
+</div>
+
+
+
+
+<p>... build a project against multiple Scala versions <a href="/howto/scala.html#cross">(details)</a></p>
+
+
+
+
+<p>... enter the Scala REPL with a project's dependencies on the classpath, but not the compiled project classes <a href="/howto/scala.html#console-quick">(details)</a></p>
+
+
+
+
+<div class="highlight"><pre><code class="console"><span class="go"> &gt; console-quick </span>
+</code></pre>
+</div>
+
+
+
+
+<p>... enter the Scala REPL with a project's dependencies and compiled code on the classpath <a href="/howto/scala.html#console">(details)</a></p>
+
+
+
+
+<div class="highlight"><pre><code class="console"><span class="go"> &gt; console </span>
+</code></pre>
+</div>
+
+
+
+
+<p>... enter the Scala REPL with plugins and the build definition on the classpath <a href="/howto/scala.html#console-project">(details)</a></p>
+
+
+
+
+<div class="highlight"><pre><code class="console"><span class="go"> &gt; console-project </span>
+</code></pre>
+</div>
+
+
+
+
+<p>... define the initial commands evaluated when entering the Scala REPL <a href="/howto/scala.html#initial">(details)</a></p>
+
+
+
+
+<div class="highlight"><pre><code class="scala"> <span class="n">initialCommands</span> <span class="n">in</span> <span class="n">console</span> <span class="o">:=</span> <span class="s">&quot;&quot;&quot;println(&quot;Hi!&quot;)&quot;&quot;&quot;</span>
+</code></pre>
+</div>
+
+
+
+
+<p>... use the Scala REPL from project code <a href="/howto/scala.html#embed">(details)</a></p>
+
+
+
+
+<h3>Configure packaging <a href="/howto/package.html">(details)</a></h3>
+
+
+
+
+<p>... use the packaged jar on classpaths instead of class directory <a href="/howto/package.html#export">(details)</a></p>
+
+
+
+
+<div class="highlight"><pre><code class="scala"> <span class="n">exportJars</span> <span class="o">:=</span> <span class="kc">true</span>
+</code></pre>
+</div>
+
+
+
+
+<p>... add manifest attributes <a href="/howto/package.html#manifest">(details)</a></p>
+
+
+
+
+<div class="highlight"><pre><code class="scala"> <span class="n">packageOptions</span> <span class="n">in</span> <span class="o">(</span><span class="nc">Compile</span><span class="o">,</span> <span class="n">packageBin</span><span class="o">)</span> <span class="o">+=</span> <span class="nc">Package</span><span class="o">.</span><span class="nc">ManifestAttributes</span><span class="o">(</span> <span class="nc">Attributes</span><span class="o">.</span><span class="nc">Name</span><span class="o">.</span><span class="nc">SEALED</span> <span class="o">-&gt;</span> <span class="s">&quot;true&quot;</span> <span class="o">)</span>
+</code></pre>
+</div>
+
+
+
+
+<p>... change the file name of a package <a href="/howto/package.html#name">(details)</a></p>
+
+
+
+
+<p>... modify the contents of the package <a href="/howto/package.html#contents">(details)</a></p>
+
+
+
+
+<div class="highlight"><pre><code class="scala"> <span class="n">mappings</span> <span class="n">in</span> <span class="o">(</span><span class="nc">Compile</span><span class="o">,</span> <span class="n">packageBin</span><span class="o">)</span> <span class="o">&lt;+=</span> <span class="n">baseDirectory</span> <span class="o">{</span> <span class="n">dir</span> <span class="k">=&gt;</span> <span class="o">(</span> <span class="n">dir</span> <span class="o">/</span> <span class="s">&quot;example.txt&quot;</span><span class="o">)</span> <span class="o">-&gt;</span> <span class="s">&quot;out/example.txt&quot;</span> <span class="o">}</span>
+</code></pre>
+</div>
+
+
+
+
+<h3>Configure and use logging <a href="/howto/logging.html">(details)</a></h3>
+
+
+
+
+<p>... view the logging output of the previously executed command <a href="/howto/logging.html#last">(details)</a></p>
+
+
+
+
+<div class="highlight"><pre><code class="console"><span class="go"> &gt; last </span>
+</code></pre>
+</div>
+
+
+
+
+<p>... view the previous logging output of a specific task <a href="/howto/logging.html#tasklast">(details)</a></p>
+
+
+
+
+<div class="highlight"><pre><code class="console"><span class="go"> &gt; last compile </span>
+</code></pre>
+</div>
+
+
+
+
+<p>... show warnings from the previous compilation <a href="/howto/logging.html#printwarnings">(details)</a></p>
+
+
+
+
+<div class="highlight"><pre><code class="console"><span class="go"> &gt; print-warnings </span>
+</code></pre>
+</div>
+
+
+
+
+<p>... change the logging level globally <a href="/howto/logging.html#level">(details)</a></p>
+
+
+
+
+<div class="highlight"><pre><code class="console"><span class="go"> &gt; set every logLevel := Level.Debug </span>
+</code></pre>
+</div>
+
+
+
+
+<p>... change the logging level for a specific task, configuration, or project <a href="/howto/logging.html#tasklevel">(details)</a></p>
+
+
+
+
+<div class="highlight"><pre><code class="scala"> <span class="n">logLevel</span> <span class="n">in</span> <span class="n">compile</span> <span class="o">:=</span> <span class="nc">Level</span><span class="o">.</span><span class="nc">Debug</span>
+</code></pre>
+</div>
+
+
+
+
+<p>... configure printing of stack traces <a href="/howto/logging.html#trace">(details)</a></p>
+
+
+
+
+<div class="highlight"><pre><code class="console"><span class="go"> &gt; set every traceLevel := 5` </span>
+</code></pre>
+</div>
+
+
+
+
+<p>... print the output of tests immediately instead of buffering <a href="/howto/logging.html#nobuffer">(details)</a></p>
+
+
+
+
+<div class="highlight"><pre><code class="scala"> <span class="n">logBuffered</span> <span class="o">:=</span> <span class="kc">false</span>
+</code></pre>
+</div>
+
+
+
+
+<p>... add a custom logger <a href="/howto/logging.html#custom">(details)</a></p>
+
+
+
+
+<p>... log messages from a task <a href="/howto/logging.html#log">(details)</a></p>
+
+
+
+
+<h3>Inspect the build <a href="/howto/inspect.html">(details)</a></h3>
+
+
+
+
+<p>... show or search help for a command, task, or setting <a href="/howto/inspect.html#taskhelp">(details)</a></p>
+
+
+
+
+<div class="highlight"><pre><code class="console"><span class="go"> &gt; help compile </span>
+</code></pre>
+</div>
+
+
+
+
+<p>... list available tasks <a href="/howto/inspect.html#listtasks">(details)</a></p>
+
+
+
+
+<div class="highlight"><pre><code class="console"><span class="go"> &gt; tasks </span>
+</code></pre>
+</div>
+
+
+
+
+<p>... list available settings <a href="/howto/inspect.html#listsettings">(details)</a></p>
+
+
+
+
+<div class="highlight"><pre><code class="console"><span class="go"> &gt; settings </span>
+</code></pre>
+</div>
+
+
+
+
+<p>... display forward and reverse dependencies of a setting or task <a href="/howto/inspect.html#dependencies">(details)</a></p>
+
+
+
+
+<div class="highlight"><pre><code class="console"><span class="go"> &gt; inspect compile </span>
+</code></pre>
+</div>
+
+
+
+
+<p>... display tree of setting/task dependencies <a href="/howto/inspect.html#taskdependencytree">(details)</a></p>
+
+
+
+
+<div class="highlight"><pre><code class="console"><span class="go"> &gt; inspect compile </span>
+</code></pre>
+</div>
+
+
+
+
+<p>... display the description and type of a setting or task <a href="/howto/inspect.html#description">(details)</a></p>
+
+
+
+
+<div class="highlight"><pre><code class="console"><span class="go"> &gt; help compile </span>
+</code></pre>
+</div>
+
+
+
+
+<p>... display the delegation chain of a setting or task <a href="/howto/inspect.html#delegates">(details)</a></p>
+
+
+
+
+<div class="highlight"><pre><code class="console"><span class="go"> &gt; inspect compile </span>
+</code></pre>
+</div>
+
+
+
+
+<p>... display related settings or tasks <a href="/howto/inspect.html#related">(details)</a></p>
+
+
+
+
+<div class="highlight"><pre><code class="console"><span class="go"> &gt; inspect compile </span>
+</code></pre>
+</div>
+
+
+
+
+<p>... show the current session (temporary) settings <a href="/howto/inspect.html#session">(details)</a></p>
+
+
+
+
+<div class="highlight"><pre><code class="console"><span class="go"> &gt; session list </span>
+</code></pre>
+</div>
+
+
+
+
+<p>... show the list of projects and builds <a href="/howto/inspect.html#projects">(details)</a></p>
+
+
+
+
+<div class="highlight"><pre><code class="console"><span class="go"> &gt; projects </span>
+</code></pre>
+</div>
+
+
+
+
+<p>... show basic information about sbt and the current build <a href="/howto/inspect.html#about">(details)</a></p>
+
+
+
+
+<div class="highlight"><pre><code class="console"><span class="go"> &gt; about </span>
+</code></pre>
+</div>
+
+
+
+
+<p>... show the value of a setting <a href="/howto/inspect.html#value">(details)</a></p>
+
+
+
+
+<div class="highlight"><pre><code class="console"><span class="go"> &gt; show name </span>
+</code></pre>
+</div>
+
+
+
+
+<p>... show the result of executing a task <a href="/howto/inspect.html#result">(details)</a></p>
+
+
+
+
+<div class="highlight"><pre><code class="console"><span class="go"> &gt; show update </span>
+</code></pre>
+</div>
+
+
+
+
+<p>... show the classpath used for compilation or testing <a href="/howto/inspect.html#classpath">(details)</a></p>
+
+
+
+
+<div class="highlight"><pre><code class="console"><span class="go"> &gt; show compile:dependency-classpath </span>
+</code></pre>
+</div>
+
+
+
+
+<p>... show the main classes detected in a project <a href="/howto/inspect.html#applications">(details)</a></p>
+
+
+
+
+<div class="highlight"><pre><code class="console"><span class="go"> &gt; show compile:discovered-main-classes </span>
+</code></pre>
+</div>
+
+
+
+
+<p>... show the test classes detected in a project <a href="/howto/inspect.html#tests">(details)</a></p>
+
+
+
+
+<div class="highlight"><pre><code class="console"><span class="go"> &gt; show defined-test-names </span>
+</code></pre>
+</div>
+
+
+
+
+ </div>
+ </div>
+ </div>
+ <div class="span6 columns"><p>&nbsp;</p></div>
+</div>
+
+
+</body>
+</html>
+
+
View
143 howto/generatefiles.html
@@ -0,0 +1,143 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en-us">
+<head>
+ <title>Generating files - </title>
+ <link href='http://fonts.googleapis.com/css?family=Copse' rel='stylesheet' type='text/css'>
+ <link href='/resources/howto-site.css' rel='stylesheet' type='text/css'>
+ <link href='/resources/syntax.css' rel='stylesheet' type='text/css'>
+ <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js">
+ </script>
+</head>
+<body>
+
+
+<div class="cf" id="container">
+ <div class="span2 columns container-spacer"><p>&nbsp;</p></div>
+ <div id="intro" class="span10 columns content">
+ <div id="head" class="cf">
+ <h2>Generating files</h2>
+ </div>
+ <div class="cf"><div id="feature-list">
+ <h3> How to ...</h3>
+ <ul class="left" id="section-toc">
+
+ <li id="feature"><h5>... <a href="#sources">generate sources</a></h5></li>
+
+ <li id="feature"><h5>... <a href="#resources">generate resources</a></h5></li>
+
+ </ul>
+ </div></div>
+ <div id="pagecontent" class="cf">
+ <p>sbt provides standard hooks for adding source or resource generation tasks.</p>
+
+<h4 id="sources">Generate sources</h4>
+
+
+<p>A source generation task should generate sources in a subdirectory of <code>sourceManaged</code> and return a sequence of files generated. The key to add the task to is called <code>sourceGenerators</code>. It should be scoped according to whether the generated files are main (<code>Compile</code>) or test (<code>Test</code>) sources. This basic structure looks like:</p>
+
+<div class="highlight"><pre><code class="scala"><span class="n">sourceGenerators</span> <span class="n">in</span> <span class="nc">Compile</span> <span class="o">&lt;+=</span> <span class="o">&lt;</span><span class="n">your</span> <span class="nc">Task</span><span class="o">[</span><span class="kt">Seq</span><span class="o">[</span><span class="kt">File</span><span class="o">]]</span> <span class="n">here</span><span class="o">&gt;</span>
+</code></pre>
+</div>
+
+
+<p>For example, assuming a method <code>def makeSomeSources(base: File): Seq[File]</code>,</p>
+
+<div class="highlight"><pre><code class="scala"><span class="n">sourceGenerators</span> <span class="n">in</span> <span class="nc">Compile</span> <span class="o">&lt;+=</span> <span class="n">sourceManaged</span> <span class="n">in</span> <span class="nc">Compile</span> <span class="n">map</span> <span class="o">{</span> <span class="n">outDir</span><span class="k">:</span> <span class="kt">File</span> <span class="o">=&gt;</span>
+ <span class="n">makeSomeSources</span><span class="o">(</span><span class="n">outDir</span> <span class="o">/</span> <span class="s">&quot;demo&quot;</span><span class="o">)</span>
+<span class="o">}</span>
+</code></pre>
+</div>
+
+
+<p>As a specific example, the following generates a hello world source file:</p>
+
+<div class="highlight"><pre><code class="scala"><span class="n">sourceGenerators</span> <span class="n">in</span> <span class="nc">Compile</span> <span class="o">&lt;+=</span> <span class="n">sourceManaged</span> <span class="n">in</span> <span class="nc">Compile</span> <span class="n">map</span> <span class="o">{</span> <span class="n">dir</span> <span class="k">=&gt;</span>
+ <span class="k">val</span> <span class="n">file</span> <span class="k">=</span> <span class="n">dir</span> <span class="o">/</span> <span class="s">&quot;demo&quot;</span> <span class="o">/</span> <span class="s">&quot;Test.scala&quot;</span>
+ <span class="nc">IO</span><span class="o">.</span><span class="n">write</span><span class="o">(</span><span class="n">file</span><span class="o">,</span> <span class="s">&quot;&quot;&quot;object Test extends App { println(&quot;Hi&quot;) }&quot;&quot;&quot;</span><span class="o">)</span>
+ <span class="nc">Seq</span><span class="o">(</span><span class="n">file</span><span class="o">)</span>
+<span class="o">}</span>
+</code></pre>
+</div>
+
+
+<p>Executing 'run' will print "Hi". Change <code>Compile</code> to <code>Test</code> to make it a test source. For efficiency, you would only want to generate sources when necessary and not every run.</p>
+
+<p>By default, generated sources are not included in the packaged source artifact. To do so, add them as you would other mappings. See <code>Adding files to a package</code>.</p>
+
+<h4 id="resources">Generate resources</h4>
+
+
+<p>A resource generation task should generate resources in a subdirectory of <code>resourceManaged</code> and return a sequence of files generated. The key to add the task to is called <code>resourceGenerators</code>. It should be scoped according to whether the generated files are main (<code>Compile</code>) or test (<code>Test</code>) resources. This basic structure looks like:</p>
+
+<div class="highlight"><pre><code class="scala"><span class="n">resourceGenerators</span> <span class="n">in</span> <span class="nc">Compile</span> <span class="o">&lt;+=</span> <span class="o">&lt;</span><span class="n">your</span> <span class="nc">Task</span><span class="o">[</span><span class="kt">Seq</span><span class="o">[</span><span class="kt">File</span><span class="o">]]</span> <span class="n">here</span><span class="o">&gt;</span>
+</code></pre>
+</div>
+
+
+<p>For example, assuming a method <code>def makeSomeResources(base: File): Seq[File]</code>,</p>
+
+<div class="highlight"><pre><code class="scala"><span class="n">resourceGenerators</span> <span class="n">in</span> <span class="nc">Compile</span> <span class="o">&lt;+=</span> <span class="n">resourceManaged</span> <span class="n">in</span> <span class="nc">Compile</span> <span class="n">map</span> <span class="o">{</span> <span class="n">outDir</span><span class="k">:</span> <span class="kt">File</span> <span class="o">=&gt;</span>
+ <span class="n">makeSomeResources</span><span class="o">(</span><span class="n">outDir</span> <span class="o">/</span> <span class="s">&quot;demo&quot;</span><span class="o">)</span>
+<span class="o">}</span>
+</code></pre>
+</div>
+
+
+<p>As a specific example, the following generates a properties file containing the application name and version:</p>
+
+<div class="highlight"><pre><code class="scala"><span class="n">resourceGenerators</span> <span class="n">in</span> <span class="nc">Compile</span> <span class="o">&lt;+=</span>
+ <span class="o">(</span><span class="n">resourceManaged</span> <span class="n">in</span> <span class="nc">Compile</span><span class="o">,</span> <span class="n">name</span><span class="o">,</span> <span class="n">version</span><span class="o">)</span> <span class="n">map</span> <span class="o">{</span> <span class="o">(</span><span class="n">dir</span><span class="o">,</span> <span class="n">n</span><span class="o">,</span> <span class="n">v</span><span class="o">)</span> <span class="k">=&gt;</span>
+ <span class="k">val</span> <span class="n">file</span> <span class="k">=</span> <span class="n">dir</span> <span class="o">/</span> <span class="s">&quot;demo&quot;</span> <span class="o">/</span> <span class="s">&quot;myapp.properties&quot;</span>
+ <span class="k">val</span> <span class="n">contents</span> <span class="k">=</span> <span class="s">&quot;name=%s\nversion=%s&quot;</span><span class="o">.</span><span class="n">format</span><span class="o">(</span><span class="n">n</span><span class="o">,</span><span class="n">v</span><span class="o">)</span>
+ <span class="nc">IO</span><span class="o">.</span><span class="n">write</span><span class="o">(</span><span class="n">file</span><span class="o">,</span> <span class="n">contents</span><span class="o">)</span>
+ <span class="nc">Seq</span><span class="o">(</span><span class="n">file</span><span class="o">)</span>
+ <span class="o">}</span>
+<span class="o">}</span>
+</code></pre>
+</div>
+
+
+<p>Change <code>Compile</code> to <code>Test</code> to make it a test resource. Normally, you would only want to generate resources when necessary and not every run.</p>
+
+<p>By default, generated resources are not included in the packaged source artifact. To do so, add them as you would other mappings. See the <code>Adding files to a package</code> section.</p>
+
+ </div>
+ </div>
+ </div>
+</div>
+
+
+
+<script type="text/javascript" src="/jquery.scrollto.min.js"></script>
+<script type="text/javascript">
+ (function($){ $(function(){
+ $("#top").click(function(){ $("#intro").ScrollTo(); })
+
+ var applyH = function() {
+ $("#intro, .feature").each(function (i, elt) {
+ if ($(elt).height() < $(window).height()) {
+ $(elt).height($(window).height());
+ }
+ });
+ };
+ $(window).bind('resize', function() { applyH(); });
+ applyH();
+
+ $('#features a, .st').click(function(e){
+ var h = $(this).attr('href');
+ if(h && h[0] && h[0] == '#') {
+ e.preventDefault();
+
+ $(h).ScrollTo({
+ callback:function(){ window.location.hash = h;}
+ });
+ }
+ });
+ });})(jQuery);
+</script>
+
+</body>
+</html>
+
View
1  howto/generatefiles.html
View
393 howto/inspect.html
@@ -0,0 +1,393 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en-us">
+<head>
+ <title>Inspect the build - </title>
+ <link href='http://fonts.googleapis.com/css?family=Copse' rel='stylesheet' type='text/css'>
+ <link href='/resources/howto-site.css' rel='stylesheet' type='text/css'>
+ <link href='/resources/syntax.css' rel='stylesheet' type='text/css'>
+ <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js">
+ </script>
+</head>
+<body>
+
+
+<div class="cf" id="container">
+ <div class="span2 columns container-spacer"><p>&nbsp;</p></div>
+ <div id="intro" class="span10 columns content">
+ <div id="head" class="cf">
+ <h2>Inspect the build</h2>
+ </div>
+ <div class="cf"><div id="feature-list">
+ <h3> How to ...</h3>
+ <ul class="left" id="section-toc">
+
+ <li id="feature"><h5>... <a href="#taskhelp">show or search help for a command, task, or setting</a></h5></li>
+
+ <li id="feature"><h5>... <a href="#listtasks">list available tasks</a></h5></li>
+
+ <li id="feature"><h5>... <a href="#listsettings">list available settings</a></h5></li>
+
+ <li id="feature"><h5>... <a href="#dependencies">display forward and reverse dependencies of a setting or task</a></h5></li>
+
+ <li id="feature"><h5>... <a href="#taskdependencytree">display tree of setting/task dependencies</a></h5></li>
+
+ <li id="feature"><h5>... <a href="#description">display the description and type of a setting or task</a></h5></li>
+
+ <li id="feature"><h5>... <a href="#delegates">display the delegation chain of a setting or task</a></h5></li>
+
+ <li id="feature"><h5>... <a href="#related">display related settings or tasks</a></h5></li>
+
+ <li id="feature"><h5>... <a href="#session">show the current session (temporary) settings</a></h5></li>
+
+ <li id="feature"><h5>... <a href="#projects">show the list of projects and builds</a></h5></li>
+
+ <li id="feature"><h5>... <a href="#about">show basic information about sbt and the current build</a></h5></li>
+
+ <li id="feature"><h5>... <a href="#value">show the value of a setting</a></h5></li>
+
+ <li id="feature"><h5>... <a href="#result">show the result of executing a task</a></h5></li>
+
+ <li id="feature"><h5>... <a href="#classpath">show the classpath used for compilation or testing</a></h5></li>
+
+ <li id="feature"><h5>... <a href="#applications">show the main classes detected in a project</a></h5></li>
+
+ <li id="feature"><h5>... <a href="#tests">show the test classes detected in a project</a></h5></li>
+
+ </ul>
+ </div></div>
+ <div id="pagecontent" class="cf">
+ <h4 id="taskhelp">Show or search help for a command, task, or setting</h4>
+
+
+<p>The <code>help</code> command is used to show available commands and search the help for commands, tasks, or settings.
+If run without arguments, <code>help</code> lists the available commands.</p>
+
+<div class="highlight"><pre><code class="console"><span class="gp">&gt;</span> <span class="nb">help</span>
+
+<span class="go"> help Displays this help message or prints detailed help on </span>
+<span class="go"> requested commands (run &#39;help &lt;command&gt;&#39;).</span>
+<span class="go"> about Displays basic information about sbt and the build.</span>
+<span class="go"> reload (Re)loads the project in the current directory</span>
+<span class="go"> ...</span>
+</code></pre>
+</div>
+
+
+
+
+<div class="highlight"><pre><code class="console"><span class="gp">&gt;</span> <span class="nb">help </span>compile
+</code></pre>
+</div>
+
+
+<p>If the argument passed to <code>help</code> is the name of an existing command, setting or task, the help
+for that entity is displayed. Otherwise, the argument is interpreted as a regular expression that
+is used to search the help of all commands, settings and tasks.</p>
+
+<p>The <code>tasks</code> command is like <code>help</code>, but operates only on tasks.
+Similarly, the <code>settings</code> command only operates on settings.</p>
+
+<p>See also <code>help help</code>, <code>help tasks</code>, and <code>help settings</code>.</p>
+
+<h4 id="listtasks">List available tasks</h4>
+
+
+<p>The <code>tasks</code> command, without arguments, lists the most commonly used tasks.
+It can take a regular expression to search task names and descriptions.
+The verbosity can be increased to show or search less commonly used tasks.
+See <code>help tasks</code> for details.</p>
+
+<h4 id="listsettings">List available tasks</h4>
+
+
+<p>The <code>settings</code> command, without arguments, lists the most commonly used settings.
+It can take a regular expression to search setting names and descriptions.
+The verbosity can be increased to show or search less commonly used settings.
+See <code>help settings</code> for details.</p>
+
+<h4 id="dependencies">Display forward and reverse dependencies of a setting or task</h4>
+
+
+<p>The <code>inspect</code> command displays several pieces of information about a given setting or task, including
+the dependencies of a task/setting as well as the tasks/settings that depend on the it. For example,</p>
+
+<div class="highlight"><pre><code class="console"><span class="gp">&gt;</span> inspect <span class="nb">test</span>:compile
+<span class="go">...</span>
+<span class="go">[info] Dependencies:</span>
+<span class="go">[info] test:compile::compile-inputs</span>
+<span class="go">[info] test:compile::streams</span>
+<span class="go">[info] Reverse dependencies:</span>
+<span class="go">[info] test:defined-test-names</span>
+<span class="go">[info] test:defined-sbt-plugins</span>
+<span class="go">[info] test:print-warnings</span>
+<span class="go">[info] test:discovered-main-classes</span>
+<span class="go">[info] test:defined-tests</span>
+<span class="go">[info] test:exported-products</span>
+<span class="go">[info] test:products</span>
+<span class="go">...</span>
+</code></pre>
+</div>
+
+
+<p>See the <a href="https://github.com/harrah/xsbt/wiki/Inspecting-Settings">Inspecting Settings</a> page for details.</p>
+
+<h4 id="taskdependencytree">Display tree of setting/task dependencies</h4>
+
+
+<p>In addition to displaying immediate forward and reverse dependencies as described in the previous section,
+the <code>inspect</code> command can display the full dependency tree for a task or setting.
+For example,</p>
+
+<div class="highlight"><pre><code class="console"><span class="gp">&gt;</span> inspect tree clean
+<span class="go">[info] *:clean = Task[Unit]</span>
+<span class="go">[info] +-*:clean-files = List(&lt;project&gt;/lib_managed, &lt;project&gt;/target)</span>
+<span class="go">[info] | +-{.}/*:managed-directory = lib_managed</span>
+<span class="go">[info] | +-*:target = target</span>
+<span class="go">[info] | +-*:base-directory = &lt;project&gt;</span>
+<span class="go">[info] | +-*:this-project = Project(id: demo, base: &lt;project&gt;, ...</span>
+<span class="go">[info] | </span>
+<span class="go">[info] +-*:clean-keep-files = List(&lt;project&gt;/target/.history)</span>
+<span class="go">[info] +-*:history = Some(&lt;project&gt;/target/.history)</span>
+<span class="go">...</span>
+</code></pre>
+</div>
+
+
+<p>For each task, <code>inspect tree</code> show the type of the value generated by the task.
+For a setting, the <code>toString</code> of the setting is displayed.
+See the <a href="https://github.com/harrah/xsbt/wiki/Inspecting-Settings">Inspecting Settings</a> page for details on the <code>inspect</code> command.</p>
+
+<h4 id="description">Display the description and type of a setting or task</h4>
+
+
+<p>While the <code>help</code>, <code>settings</code>, and <code>tasks</code> commands display a description of a task,
+the <code>inspect</code> command also shows the type of a setting or task and the value of a setting.
+For example:</p>
+
+<div class="highlight"><pre><code class="console"><span class="gp">&gt;</span> inspect update
+<span class="go">[info] Task: sbt.UpdateReport</span>
+<span class="go">[info] Description:</span>
+<span class="go">[info] Resolves and optionally retrieves dependencies, producing a report.</span>
+<span class="go">...</span>
+</code></pre>
+</div>
+
+
+
+
+<div class="highlight"><pre><code class="console"><span class="gp">&gt;</span> inspect scala-version
+<span class="go">[info] Setting: java.lang.String = 2.9.2</span>
+<span class="go">[info] Description:</span>
+<span class="go">[info] The version of Scala used for building.</span>
+<span class="go">...</span>
+</code></pre>
+</div>
+
+
+<p>See the <a href="https://github.com/harrah/xsbt/wiki/Inspecting-Settings">Inspecting Settings</a> page for details.</p>
+
+<h4 id="delegates">Display the delegation chain of a setting or task</h4>
+
+
+<p>See the <a href="https://github.com/harrah/xsbt/wiki/Inspecting-Settings">Inspecting Settings</a> page for details.</p>
+
+<h4 id="related">Display related settings or tasks</h4>
+
+
+<p>The <code>inspect</code> command can help find scopes where a setting or task is defined.
+The following example shows that different options may be specified to the Scala
+for testing and API documentation generation.</p>
+
+<div class="highlight"><pre><code class="console"><span class="gp">&gt;</span> inspect scalac-options
+<span class="go">...</span>
+<span class="go">[info] Related:</span>
+<span class="go">[info] compile:doc::scalac-options</span>
+<span class="go">[info] test:scalac-options</span>
+<span class="go">[info] */*:scalac-options</span>
+<span class="go">[info] test:doc::scalac-options</span>
+</code></pre>
+</div>
+
+
+<p>See the <a href="https://github.com/harrah/xsbt/wiki/Inspecting-Settings">Inspecting Settings</a> page for details.</p>
+
+<h4 id="projects">Show the list of projects and builds</h4>
+
+
+<p>The <code>projects</code> command displays the currently loaded projects.
+The projects are grouped by their enclosing build and the current project is indicated by an asterisk.
+For example,</p>
+
+<div class="highlight"><pre><code class="console"><span class="gp">&gt;</span> projects
+<span class="go">[info] In file:/home/user/demo/</span>
+<span class="go">[info] * parent</span>
+<span class="go">[info] sub</span>
+<span class="go">[info] In file:/home/user/dep/</span>
+<span class="go">[info] sample</span>
+</code></pre>
+</div>
+
+
+
+
+<h4 id="session">Show the current session (temporary) settings</h4>
+
+
+<p><code>session list</code> displays the settings that have been added at the command line for the current project. For example,</p>
+
+<div class="highlight"><pre><code class="console"><span class="gp">&gt;</span> session list
+<span class="go"> 1. maxErrors := 5</span>
+<span class="go"> 2. scalacOptions += &quot;-explaintypes&quot;</span>
+</code></pre>
+</div>
+
+
+<p><code>session list-all</code> displays the settings added for all projects.
+For details, see <code>help session</code>.</p>
+
+<h4 id="about">Show basic information about sbt and the current build</h4>
+
+
+
+
+<div class="highlight"><pre><code class="console"><span class="gp">&gt;</span> about
+<span class="go">[info] This is sbt 0.12.0</span>
+<span class="go">[info] The current project is {file:~/code/sbt.github.com/}default</span>
+<span class="go">[info] The current project is built against Scala 2.9.2</span>
+<span class="go">[info] Available Plugins: com.jsuereth.ghpages.GhPages, com.jsuereth.git.GitPlugin, com.jsuereth.sbtsite.SitePlugin</span>
+<span class="go">[info] sbt, sbt plugins, and build definitions are using Scala 2.9.2</span>
+</code></pre>
+</div>
+
+
+
+
+<h4 id="value">Show the value of a setting</h4>
+
+
+<p>The <code>inspect</code> shows the value of a setting as part of its output, but the <code>show</code> command is dedicated to this job.
+It shows the output of the setting provided as an argument.
+For example,</p>
+
+<div class="highlight"><pre><code class="console"><span class="gp">&gt;</span> show organization
+<span class="go">[info] com.github.sbt </span>
+</code></pre>
+</div>
+
+
+<p>The <code>show</code> command also works for tasks, described next.</p>
+
+<h4 id="result">Show the result of executing a task</h4>
+
+
+
+
+<div class="highlight"><pre><code class="console"><span class="gp">&gt;</span> show update
+<span class="go">... &lt;output of update&gt; ...</span>
+<span class="go">[info] Update report:</span>
+<span class="go">[info] Resolve time: 122 ms, Download time: 5 ms, Download size: 0 bytes</span>
+<span class="go">[info] compile:</span>
+<span class="go">[info] org.scala-lang:scala-library:2.9.2: ...</span>
+</code></pre>
+</div>
+
+
+<p>The <code>show</code> command will execute the task provided as an argument and then print the result.
+Note that this is different from the behavior of the <code>inspect</code> command (described in other sections),
+which does not execute a task and thus can only display its type and not its generated value.</p>
+
+<h4 id="compilecp">Show the classpath used for compilation or testing</h4>
+
+
+
+
+<div class="highlight"><pre><code class="console"><span class="gp">&gt;</span> show compile:dependency-classpath
+<span class="go">...</span>
+<span class="go">[info] ArrayBuffer(Attributed(~/.sbt/0.12.0/boot/scala-2.9.2/lib/scala-library.jar))</span>
+</code></pre>
+</div>
+
+
+<p>For the test classpath,</p>
+
+<div class="highlight"><pre><code class="console"><span class="gp">&gt;</span> show <span class="nb">test</span>:dependency-classpath
+<span class="go">...</span>
+<span class="go">[info] ArrayBuffer(Attributed(~/code/sbt.github.com/target/scala-2.9.2/classes), Attributed(~/.sbt/0.12.0/boot/scala-2.9.2/lib/scala-library.jar), Attributed(~/.ivy2/cache/junit/junit/jars/junit-4.8.2.jar))</span>
+</code></pre>
+</div>
+
+
+
+
+<h4 id="applications">Show the main classes detected in a project</h4>
+
+
+<p>sbt detects the classes with public, static main methods for use by the <code>run</code> method and to tab-complete the <code>run-main</code> method.
+The <code>discovered-main-classes</code> task does this discovery and provides as its result the list of class names.
+For example, the following shows the main classes discovered in the main sources:</p>
+
+<div class="highlight"><pre><code class="console"><span class="gp">&gt;</span> show compile:discovered-main-classes
+<span class="go">... &lt;runs compile if out of date&gt; ...</span>
+<span class="go">[info] List(org.example.Main)</span>
+</code></pre>
+</div>
+
+
+
+
+<h4 id="tests">Show the test classes detected in a project</h4>
+
+
+<p>sbt detects tests according to fingerprints provided by test frameworks.
+The <code>defined-test-names</code> task provides as its result the list of test names detected in this way.
+For example,</p>
+
+<div class="highlight"><pre><code class="console"><span class="gp">&gt;</span> show <span class="nb">test</span>:defined-test-names
+<span class="go">... &lt; runs test:compile if out of date &gt; ...</span>
+<span class="go">[info] List(org.example.TestA, org.example.TestB)</span>
+</code></pre>
+</div>
+
+
+
+
+ </div>
+ </div>
+ </div>
+</div>
+
+
+
+<script type="text/javascript" src="/jquery.scrollto.min.js"></script>
+<script type="text/javascript">
+ (function($){ $(function(){
+ $("#top").click(function(){ $("#intro").ScrollTo(); })
+
+ var applyH = function() {
+ $("#intro, .feature").each(function (i, elt) {
+ if ($(elt).height() < $(window).height()) {
+ $(elt).height($(window).height());
+ }
+ });
+ };
+ $(window).bind('resize', function() { applyH(); });
+ applyH();
+
+ $('#features a, .st').click(function(e){
+ var h = $(this).attr('href');
+ if(h && h[0] && h[0] == '#') {
+ e.preventDefault();
+
+ $(h).ScrollTo({
+ callback:function(){ window.location.hash = h;}
+ });
+ }
+ });
+ });})(jQuery);
+</script>
+
+</body>
+</html>
+
View
1  howto/inspect.html
View
1  howto/interactive.html
View
257 howto/interactive.html
@@ -0,0 +1,257 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en-us">
+<head>
+ <title>Interactive mode - </title>
+ <link href='http://fonts.googleapis.com/css?family=Copse' rel='stylesheet' type='text/css'>
+ <link href='/resources/howto-site.css' rel='stylesheet' type='text/css'>
+ <link href='/resources/syntax.css' rel='stylesheet' type='text/css'>
+ <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js">
+ </script>
+</head>
+<body>
+
+
+<div class="cf" id="container">
+ <div class="span2 columns container-spacer"><p>&nbsp;</p></div>
+ <div id="intro" class="span10 columns content">
+ <div id="head" class="cf">
+ <h2>Interactive mode</h2>
+ </div>
+ <div class="cf"><div id="feature-list">
+ <h3> How to ...</h3>
+ <ul class="left" id="section-toc">
+
+ <li id="feature"><h5>... <a href="#basic_completion">use tab completion</a></h5></li>
+
+ <li id="feature"><h5>... <a href="#verbose_completion">show more tab completion suggestions</a></h5></li>
+
+ <li id="feature"><h5>... <a href="#show_keybindings">view basic JLine keybindings</a></h5></li>
+
+ <li id="feature"><h5>... <a href="#change_keybindings">modify the default JLine keybindings</a></h5></li>
+
+ <li id="feature"><h5>... <a href="#prompt">configure the prompt string</a></h5></li>
+
+ <li id="feature"><h5>... <a href="#history">use history</a></h5></li>
+
+ <li id="feature"><h5>... <a href="#history_file">change the location of the interactive history file</a></h5></li>
+
+ <li id="feature"><h5>... <a href="#share_history">share interactive history across projects</a></h5></li>
+
+ <li id="feature"><h5>... <a href="#disable_history">disable interactive history</a></h5></li>
+
+ <li id="feature"><h5>... <a href="#pre_commands">start interactive mode after executing some commands first</a></h5></li>
+
+ </ul>
+ </div></div>
+ <div id="pagecontent" class="cf">
+ <p>By default, sbt's interactive mode is started when no commands are provided on the command line or when the <code>shell</code> command is invoked.</p>
+
+<h4 id="basic_completion">Using tab completion</h4>
+
+
+<p>As the name suggests, tab completion is invoked by hitting the tab key.
+Suggestions are provided that can complete the text entered to the left of the current cursor position.
+Any part of the suggestion that is unambiguous is automatically appended to the current text.
+Commands typically support tab completion for most of their syntax.</p>
+
+<p>As an example, entering <code>tes</code> and hitting tab:</p>
+
+<pre><code>&gt; tes&lt;TAB&gt;
+</code></pre>
+
+<p>results in sbt appending a <code>t</code>:</p>
+
+<pre><code>&gt; test
+</code></pre>
+
+<p>To get further completions, hit tab again:</p>
+
+<pre><code>&gt; test&lt;TAB&gt;
+test-frameworks test-listeners test-loader test-only test-options test:
+</code></pre>
+
+<p>Now, there is more than one possibility for the next character, so sbt prints the available options.
+We will select <code>test-only</code> and get more suggestions by entering the rest of the command and hitting tab twice:</p>
+
+<pre><code>&gt; test-only&lt;TAB&gt;&lt;TAB&gt;
+-- sbt.DagSpecification sbt.EmptyRelationTest sbt.KeyTest sbt.RelationTest sbt.SettingsTest
+</code></pre>
+
+<p>The first tab inserts an unambiguous space and the second suggests names of tests to run.
+The suggestion of <code>--</code> is for the separator between test names and options provided to the test framework.
+The other suggestions are names of test classes for one of sbt's modules.
+Test name suggestions require tests to be compiled first.
+If tests have been added, renamed, or removed since the last test compilation, the completions will be out of date until another successful compile.</p>
+
+<h4 id="verbose_completion">Showing more completions</h4>
+
+
+<p>Some commands have different levels of completion. Hitting tab multiple times increases the verbosity of completions. (Presently, this feature is rarely used.)</p>
+
+<h4 id="show_keybindings">Showing JLine keybindings</h4>
+
+
+<p>Both the Scala and sbt command prompts use JLine for interaction. The Scala REPL contains a <code>:keybindings</code> command to show many of the keybindings used for JLine. For sbt, this can be used by running one of the <code>console</code> commands (<code>console</code>, <code>console-quick</code>, or <code>console-project</code>) and then running <code>:keybindings</code>. For example:</p>
+
+<pre><code>&gt; console-project
+[info] Starting scala interpreter...
+...
+scala&gt; :keybindings
+Reading jline properties for default key bindings.
+Accuracy not guaranteed: treat this as a guideline only.
+
+1 CTRL-A: move to the beginning of the line
+2 CTRL-B: move to the previous character
+...
+</code></pre>
+
+<h4 id="change_keybindings">Changing JLine keybindings</h4>
+
+
+<p>JLine, used by both Scala and sbt, uses a configuration file for many of its keybindings.
+The location of this file can be changed with the system property <code>jline.keybindings</code>.
+The default keybindings file is included in the sbt launcher and may be used as a starting point for customization.</p>
+
+<h4 id="prompt">Configure the prompt string</h4>
+
+
+<p>By default, sbt only displays <code>&gt;</code> to prompt for a command.
+This can be changed through the <code>shellPrompt</code> setting, which has type <code>State =&gt; String</code>.
+<a href="https://github.com/harrah/xsbt/wiki/Build-State">State</a> contains all state for sbt and thus provides access to all build information for use in the prompt string.</p>
+
+<p>Examples:</p>
+
+<div class="highlight"><pre><code class="scala"><span class="c1">// set the prompt (for this build) to include the project id.</span>
+<span class="n">shellPrompt</span> <span class="n">in</span> <span class="nc">ThisBuild</span> <span class="o">:=</span> <span class="o">{</span> <span class="n">state</span> <span class="k">=&gt;</span> <span class="nc">Project</span><span class="o">.</span><span class="n">extract</span><span class="o">(</span><span class="n">state</span><span class="o">).</span><span class="n">currentRef</span><span class="o">.</span><span class="n">project</span> <span class="o">+</span> <span class="s">&quot;&gt; &quot;</span> <span class="o">}</span>
+
+<span class="c1">// set the prompt (for the current project) to include the username</span>
+<span class="n">shellPrompt</span> <span class="o">:=</span> <span class="o">{</span> <span class="n">state</span> <span class="k">=&gt;</span> <span class="nc">System</span><span class="o">.</span><span class="n">getProperty</span><span class="o">(</span><span class="s">&quot;user.name&quot;</span><span class="o">)</span> <span class="o">+</span> <span class="s">&quot;&gt; &quot;</span> <span class="o">}</span>
+</code></pre>
+</div>
+
+
+
+
+<h4 id="history">Using history</h4>
+
+
+<p>Interactive mode remembers history even if you exit sbt and restart it.
+The simplest way to access history is to press the up arrow key to cycle
+through previously entered commands. Use <code>Ctrl+r</code> to incrementally
+search history backwards. The following commands are supported:</p>
+
+<ul>
+<li><code>!</code> Show history command help.</li>
+<li><code>!!</code> Execute the previous command again.</li>
+<li><code>!:</code> Show all previous commands.</li>
+<li><code>!:n</code> Show the last n commands.</li>
+<li><code>!n</code> Execute the command with index <code>n</code>, as shown by the <code>!:</code> command.</li>
+<li><code>!-n</code> Execute the nth command before this one.</li>
+<li><code>!string</code> Execute the most recent command starting with 'string'</li>
+<li><code>!?string</code> Execute the most recent command containing 'string'</li>
+</ul>
+
+
+<h4 id="history_file">Changing the history file location</h4>
+
+
+<p>By default, interactive history is stored in the <code>target/</code> directory for the current project (but is not removed by a <code>clean</code>).
+History is thus separate for each subproject.
+The location can be changed with the <code>historyPath</code> setting, which has type <code>Option[File]</code>.
+For example, history can be stored in the root directory for the project instead of the output directory:</p>
+
+<div class="highlight"><pre><code class="scala"><span class="n">historyPath</span> <span class="o">&lt;&lt;=</span> <span class="n">baseDirectory</span><span class="o">(</span><span class="n">t</span> <span class="k">=&gt;</span> <span class="nc">Some</span><span class="o">(</span><span class="n">t</span> <span class="o">/</span> <span class="s">&quot;.history&quot;</span><span class="o">))</span>
+</code></pre>
+</div>
+
+
+<p>The history path needs to be set for each project, since sbt will use the value of <code>historyPath</code> for the current project (as selected by the <code>project</code> command).</p>
+
+<h4 id="share_history">Use the same history for all projects</h4>
+
+
+<p>The previous section describes how to configure the location of the history file.
+This setting can be used to share the interactive history among all projects in a build instead of using a different history for each project.
+The way this is done is to set <code>historyPath</code> to be the same file, such as a file in the root project's <code>target/</code> directory:</p>
+
+<div class="highlight"><pre><code class="scala"><span class="n">historyPath</span> <span class="o">&lt;&lt;=</span>
+ <span class="o">(</span><span class="n">target</span> <span class="n">in</span> <span class="nc">LocalRootProject</span><span class="o">)</span> <span class="o">{</span> <span class="n">t</span> <span class="k">=&gt;</span>
+ <span class="nc">Some</span><span class="o">(</span><span class="n">t</span> <span class="o">/</span> <span class="s">&quot;.history&quot;</span><span class="o">)</span>
+ <span class="o">}</span>
+</code></pre>
+</div>
+
+
+<p>The <code>in LocalRootProject</code> part means to get the output directory for the root project for the build.</p>
+
+<h4 id="disable_history">Disable interactive history</h4>
+
+
+<p>If, for whatever reason, you want to disable history, set <code>historyPath</code> to <code>None</code> in each project it should be disabled in:</p>
+
+<div class="highlight"><pre><code class="scala"><span class="n">historyPath</span> <span class="o">:=</span> <span class="nc">None</span>
+</code></pre>
+</div>
+
+