1
0
Fork 0
mirror of https://github.com/ethauvin/kobalt-doc.git synced 2025-04-25 03:57:11 -07:00

Add Homebrew instructions.

This commit is contained in:
Cedric Beust 2016-02-23 21:00:42 +04:00
parent ae5d0712f8
commit 68d5919e44

View file

@ -40,34 +40,42 @@
<nav id="kobalt-navbar" class="navbar navbar-default">
</nav>
<div class="col-md-9">
<h2 class="section" id="downloading">1. Download Kobalt</h2>
<h2 class="section" id="installing">1. Install Kobalt</h2>
<h3 class="section" indent="1" id="homebrew">With HomeBrew</h3>
<p>
<a href="https://github.com/cbeust/kobalt/releases/latest">Download the zip file</a> then unzip it in a location we'll call <code>KOBALT_HOME</code>:
If you are on MacOS and have <code>brew</code> installed:
<pre class="brush:plain">
$ brew install kobalt
$ which kobaltw
/usr/local/bin/brew</pre>
</p>
<h3 class="section" indent="1" id="manually">Manually</h3>
<p>
<a href="https://github.com/cbeust/kobalt/releases/latest">Download the zip file</a> and unzip it in a that you can add to your <code>$PATH</code> variable:
</p>
<pre class="brush:plain">
cd $KOBALT_HOME
cd yourLocation
unzip kobalt-xxx.zip
</pre>
<p>
<em>Note: Kobalt doesn't need any environment variable to run, the environment variable used above
is only here for clarity.</em>
</p>
<h2 class="section" id="initialize">2. Initialize your project</h2>
<p>
Change to your project directory and call the <code>kobaltw</code> command with <code>--init</code>:
</p>
<h2 class="section" id="initialize">2. Initialize your project</h2>
<p>
Change to your project directory and call the <code>kobaltw</code> command with <code>--init</code>:
</p>
<pre class="brush:plain">
cd ~/java/project
$KOBALT_HOME/kobaltw --init java
kobaltw --init java
</pre>
<p>
This command will do two things:
</p>
<ol>
<li>Create a default <code>kobalt/src/Build.kt</code> suitable for a brand new Java project.
<li>Install the Kobalt Wrapper in your current directory (a script called <code>kobaltw</code>) and a few additional files in the <code>kobalt/wrapper</code> directory. From now on, you can just use <code>./kobaltw</code> to build and you can ignore <code>$KOBALT_HOME</code>.
<p>
This command will do two things:
</p>
<ol>
<li>Create a default <code>kobalt/src/Build.kt</code> file based on what was found in your project.</li>
<li>Install the Kobalt Wrapper in your current directory (a script called <code>kobaltw</code>) and a few additional files in the <code>kobalt/wrapper</code> directory.</li>
</ol>
<p>
From now on, you can just use <code>./kobaltw</code> to build and you can ignore the <code>kobaltw</code> on your path (this command is only useful for initializing projects).
</p>
<p>
You can now attempt to build your project with Kobalt:
</p>
<pre class="brush:plain">
@ -76,6 +84,7 @@ You can now attempt to build your project with Kobalt:
If your project follows a regular build structure (e.g. <a href="https://maven.apache.org/guides/introduction/introduction-to-the-standard-directory-layout.html">Maven's hierarchy</a>), this should compile your file and create a .jar file. If not, you will have to make a few edits to your <code>Build.kt</code>.
As of this writing, Kobalt supports Java and Kotlin projects.
<h2 class="section" id="edit">3. Edit kobalt/src/Build.kt</h2>
<p>The build file generated by default might need some editing before you can build your project, so take a look at it and adjust whatever is necessary (e.g. package name, version, etc...)</p>