Skip to content

Commit

Permalink
Fixed scalacOptions examples
Browse files Browse the repository at this point in the history
Updated scalacOptions examples to output correct Seq[String]'s - raised here: sbt/website#501
  • Loading branch information
mattkirwan authored Mar 30, 2018
1 parent b74d564 commit 56515aa
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions 1.x/docs/Task-Graph.html
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,10 @@ <h2 id="Task+graph">Task graph<a href="#Task+graph" class="header-link"><span cl
val ur = update.value // update task happens-before scalacOptions
val x = clean.value // clean task happens-before scalacOptions
// ---- scalacOptions begins here ----
ur.allConfigurations.take(3)
ur.allConfigurations.take(3).map(_.toString)
}
</code></pre><p><code>update.value</code> and <code>clean.value</code> declare task dependencies,
whereas <code>ur.allConfigurations.take(3)</code> is the body of the task.
whereas <code>ur.allConfigurations.take(3).map(_.toString)</code> is the body of the task.
</p><p><code>.value</code> is not a normal Scala method call. <code>build.sbt</code> DSL
uses a macro to lift these outside of the task body.
<strong>Both <code>update</code> and <code>clean</code> tasks are completed
Expand All @@ -90,7 +90,7 @@ <h2 id="Task+graph">Task graph<a href="#Task+graph" class="header-link"><span cl
log.info(&quot;123&quot;)
val ur = update.value // update task happens-before scalacOptions
log.info(&quot;456&quot;)
ur.allConfigurations.take(3)
ur.allConfigurations.take(3).map(_.toString)
}
)
</code></pre><p>Next, from sbt shell type <code>scalacOptions</code>:
Expand All @@ -116,7 +116,7 @@ <h2 id="Task+graph">Task graph<a href="#Task+graph" class="header-link"><span cl
if (false) {
val x = clean.value // clean task happens-before scalacOptions
}
ur.allConfigurations.take(3)
ur.allConfigurations.take(3).map(_.toString)
}
)
</code></pre><p>Next, from sbt shell type <code>run</code> then <code>scalacOptions</code>:
Expand Down Expand Up @@ -150,7 +150,7 @@ <h2 id="Task+graph">Task graph<a href="#Task+graph" class="header-link"><span cl
</p><p>We’ve inlined a few examples:
</p><pre><code class="prettyprint lang-scala">scalacOptions := {
val x = clean.value
update.value.allConfigurations.take(3)
update.value.allConfigurations.take(3).map(_.toString)
}
</code></pre><p>Note whether <code>.value</code> calls are inlined, or placed anywhere in the task body,
they are still evaluated before entering the task body.
Expand Down Expand Up @@ -448,4 +448,4 @@ <h2>Commercial Support</h2>
</div>
</div>
</body>
</html>
</html>

0 comments on commit 56515aa

Please sign in to comment.