From abbf4ade79f4f9bdbd2806c2797201c65ca82a31 Mon Sep 17 00:00:00 2001
From: Cedric Beust
+ Note: Kobalt doesn't need any environment variable to run, the environment variable used above
+ is only here for clarity.
+
Change to your project directory and call the 2. Initialize your project for Kobalt
+ 2. Initialize your project
kobaltw
command with --init
:
kobalt/src/Build.kt
file based on what was found there.
- kobalt/
directory. From now on, you can just use ./kobaltw
to build and you can ignore $KOBALT_HOME
.
+ kobalt/src/Build.kt
file based on what was found in your project.
+ kobaltw
) and a few additional files in the kobalt/wrapper
directory. From now on, you can just use ./kobaltw
to build and you can ignore $KOBALT_HOME
.
You can now attempt to build your project with Kobalt: @@ -74,7 +78,7 @@ $KOBALT_HOME/kobaltw --init
Build.kt
for the Wasabi HTTP framework:
import com.beust.kobalt.* import com.beust.kobalt.plugin.packaging.assemble @@ -89,7 +93,7 @@ val p = kotlinProject { artifactId = name version = "0.1" - //tells Kobalt to also search here for dependencies + // Tell Kobalt to also search here for dependencies val repos = repos("http://oss.sonatype.org/content/repositories/snapshots") dependencies { @@ -110,7 +114,7 @@ val p = kotlinProject { "joda-time:joda-time:2.3") } - //these are only downloaded when running the test task + // Test dependencies dependenciesTest { compile("junit:junit:4.9", "org.mockito:mockito-all:1.9.5", @@ -118,7 +122,7 @@ val p = kotlinProject { "org.apache.httpcomponents:httpclient:4.5.1") } - //tells kobalt to produce a jar + // Tell kobalt to produce a jar assemble { jar { } @@ -126,12 +130,17 @@ val p = kotlinProject { }-
If you're using Intellij IDEA, make sure you've installed the Kobalt plugin and then go to Kobalt -> Sync Build File
. This will download dependencies in a way that IDEA understand so you no loger get errors.
+ From this point, you can either learn how to install the Kobalt IDEA plug-in or read Kobalt's documentation. +
+ +Since Kobalt's build files are actual Kotlin files, not only can you leverage auto-completion @@ -163,7 +165,7 @@ val jcommander = javaProject {
-Kobalt is currently in Beta but I'm already using it to build most of my projects. Here are links to a few build files you can inspect to get a feel for what Kobalt enables: +Kobalt is currently in Beta but already used in several projects. Here are links to a few build files you can inspect to get a feel for what Kobalt enables:
+ Proceed to the Getting Started section to learn more about Kobalt. +
+ + +