mirror of
https://github.com/ethauvin/kobalt-doc.git
synced 2025-04-25 03:57:11 -07:00
Update location of Build.kt.
This commit is contained in:
parent
b4f35b8002
commit
67e633810e
5 changed files with 8 additions and 50 deletions
|
@ -82,48 +82,6 @@
|
|||
</ul>
|
||||
|
||||
</p>
|
||||
|
||||
<h2 class="section" id="build-file">Auto complete in build files</h2>
|
||||
<p>
|
||||
It's useful to turn on auto completion for your <code>Build.kt</code> file if you are adding new
|
||||
elements to the DSL. You can achieve this in two steps.
|
||||
</p>
|
||||
|
||||
<h3 class="section" id="sync" indent="1">Sync your build file</h3>
|
||||
<p>
|
||||
This is achieved with the <code>Kobalt / Sync build file</code> menu item. On top of configuring your
|
||||
IDEA project with the correct dependencies, this will also add the <code>kobalt.jar</code> file to your
|
||||
classpath.
|
||||
</p>
|
||||
<p align="center" class="img-rounded">
|
||||
<img width="50%" class="img-rounded" src="../pics/menu-sync.png"/>
|
||||
</p>
|
||||
<p align="center" class="img-rounded">
|
||||
<img width="50%" class="img-rounded" src="../pics/kobalt-jar.png"/>
|
||||
</p>
|
||||
|
||||
|
||||
<h3 class="section" id="compile-build-file" indent="1">Compile your build file</h3>
|
||||
<p>
|
||||
Next, mark the directory that contains your build file as a "Source directory":
|
||||
</p>
|
||||
<p align="center" class="img-rounded">
|
||||
<img width="50%" class="img-rounded" src="../pics/source-root.png"/>
|
||||
</p>
|
||||
<div class="bs-callout bs-callout-warning">
|
||||
<h4>Alternate source directory for <code>Build.kt</code></h4>
|
||||
The default location for <code>Build.kt</code> is in the root directory of your project but
|
||||
you can also put it in <code>kobalt/src/Build.kt</code> and then mark that directory as
|
||||
a source directory.
|
||||
</div>
|
||||
|
||||
<p>
|
||||
You can now use all the IDEA features on your build file:
|
||||
</p>
|
||||
<p align="center">
|
||||
<img class="img-rounded" src="../pics/auto-complete.png"/>
|
||||
</p>
|
||||
|
||||
</div>
|
||||
|
||||
<!-- Table of contents -->
|
||||
|
|
|
@ -96,7 +96,7 @@ This command will do two things:
|
|||
</p>
|
||||
|
||||
<ol>
|
||||
<li>Create a default <code>Build.kt</code> file in your current directory based on what was found there.
|
||||
<li>Create a default <code>kobalt/src/Build.kt</code> file based on what was found there.
|
||||
<li>Install the Kobalt Wrapper in your current directory (script `kobaltw`) and in the <code>kobalt/</code> directory. From now on, you can just use <code>./kobaltw</code> to build and you can ignore <code>$KOBALT_HOME</code>.
|
||||
</ol>
|
||||
|
||||
|
@ -404,9 +404,9 @@ Here are the options that you can pass to <code>./kobaltw</code>:
|
|||
<tr>
|
||||
<td><code>--buildFile</code></td>
|
||||
<td>File</td>
|
||||
<td>Build.kt</td>
|
||||
<td>kobalt/src/Build.kt</td>
|
||||
<td>Specify a build file.</td>
|
||||
<td>Use this option if you are trying to build a project that's not in the current directory.</td>
|
||||
<td>Use this option if you are trying to build a project whose <code>Build.kt</code> is not in <code>kobalt/src</code>.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>--checkVersions</code></td>
|
||||
|
|
|
@ -84,7 +84,7 @@ val jcommander = javaProject {
|
|||
dependenciesTest {
|
||||
compile("org.testng:testng:6.9.5")
|
||||
}
|
||||
|
||||
f
|
||||
assemble {
|
||||
mavenJars {
|
||||
}
|
||||
|
|
|
@ -94,7 +94,7 @@
|
|||
</p>
|
||||
<h3 class="section" indent="1" id="sync-build-file">Synchronization of build files</h3>
|
||||
<p>
|
||||
The plug-in will find your `Build.kt` file and it will automatically update your project's libraries and
|
||||
The plug-in will locate your <code>kobalt/src/Build.kt</code> file and automatically update your project's libraries and
|
||||
dependencies to reflect it. For example, suppose you have the following dependencies:
|
||||
</p>
|
||||
<pre class="brush:java">
|
||||
|
@ -148,8 +148,8 @@ dependencies {
|
|||
|
||||
<h3 class="section" indent="1" id="autocompletion">Auto completion of Build.kt</h3>
|
||||
<p>
|
||||
The plug-in will automatically turn on auto-completion of your <code>Build.kt</code>
|
||||
file if it's located in the <code>kobalt/src</code> directory. Once this is
|
||||
The plug-in will automatically turn on auto-completion of your <code>kobalt/src/Build.kt</code>
|
||||
file. Once this is
|
||||
enabled, you can use everything you use on Kotlin files (auto completion, jump
|
||||
to symbols, even refactorings).
|
||||
</p>
|
||||
|
|
|
@ -354,7 +354,7 @@ public fun myConfig(init: Info.() -> Unit) = Info().apply { init() }</pre>
|
|||
</p>
|
||||
<pre class="brush:java">
|
||||
// Build.kt
|
||||
import.com.example.plugin.myConfig
|
||||
<imp></imp>ort.com.example.plugin.myConfig
|
||||
|
||||
myConfig {
|
||||
publish = true
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue