-
Notifications
You must be signed in to change notification settings - Fork 22
Expand file tree
/
Copy pathProjectConsole.html
More file actions
64 lines (64 loc) · 3.51 KB
/
ProjectConsole.html
File metadata and controls
64 lines (64 loc) · 3.51 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
<html>
<head>
<title>ProjectConsole</title>
<meta name="robots" content="noindex, nofollow" />
</head>
<body>
<div id="wikipage">
<table>
<tbody>
<tr>
<td style="vertical-align:top; padding-left:5px">
<div id="wikiheader">
<span style="font-size:120%;font-weight:bold">ProjectConsole</span>
<div>
</div>
</div>
<div id="wikicontent">
<div class="vt" id="wikimaincol">
<h1><a name="Project_Console"></a>Project Console<a href="#Project_Console" class="section_anchor"></a></h1>
<h2><a name="Description"></a>Description<a href="#Description" class="section_anchor"></a></h2>
<p>The <tt>console-project</tt> action starts the Scala interpreter with access to your project and to <tt>sbt</tt>. Specifically, the interpreter is started up with these commands already executed: </p>
<pre class="prettyprint">> val current: <YourProjectType> = <your project definition>
> import sbt._
> import Process._
> import current._
> </pre>
<p>This can be useful for creating and modifying your build in the same way that the Scala interpreter is normally used to explore writing code. Note that this gives you raw access to your build. Think about what you pass to <tt>FileUtilities.clean</tt>, for example. </p>
<h2><a name="Examples"></a>Examples<a href="#Examples" class="section_anchor"></a></h2>
<p>Clean classes directory: </p>
<pre class="prettyprint">> FileUtilities.clean(mainCompilePath.asFile :: Nil, log)</pre>
<p>Show current compile options: </p>
<pre class="prettyprint">> compileOptions.foreach(println)</pre>
<p>Show additionally configured repositories. Then, show all repositories, including defaults. </p>
<pre class="prettyprint">> repositories.foreach(println)
> ivyRepositories.foreach(println)</pre>
<p>Show the compile, test, and optional classpaths: </p>
<pre class="prettyprint">> compileClasspath
> testClasspath
> optionalClasspath</pre>
<p>Run the <tt>console</tt> task to drop to another interactive prompt with your project (not the build) on the classpath: </p>
<pre class="prettyprint">> console.run</pre>
<p>Run external processes: </p>
<pre class="prettyprint">> "tar -zcvf project-src.tar.gz src" !
> "find project -name *.jar" !
> "cat project/build.properties" #| "grep sbt.version" #> new File("sbt-version") !
> "grep -r null src" #|| "echo null-free" !
> new URL("http://databinder.net/dispatch/About") #> new File("About.html") !</pre>
<p>Show the dependencies on external jars computed during compilation: </p>
<pre class="prettyprint">> compile.run
> mainDependencies.external
> mainDependencies.libraries
> mainDependencies.scalaJars</pre>
<p><tt>external</tt> consists of dependencies outside of the project, like the Java standard library. <tt>libraries</tt> are managed or unmanaged dependencies other than Scala libraries. <tt>scalaJars</tt> includes <tt>scala-library.jar</tt> and <tt>scala-compiler.jar</tt> if your project uses them. </p>
</div>
</div> </td>
</tr>
<tr>
</tr>
</tbody>
</table>
</div>
<script type="text/javascript" src="http://www.gstatic.com/codesite/ph/5509366563142316864/js/dit_scripts.js"></script>
</body>
</html>