Kobalt

A universal build system for the exigent developer.

1. Download Kobalt

Download the zip file then unzip it in a location we'll call KOBALT_HOME:

cd $KOBALT_HOME
unzip kobalt-xxx.zip

2. Initialize your project for Kobalt

Change to your project directory and call the kobaltw command with --init:

cd ~/java/project
$KOBALT_HOME/kobaltw --init

This command will do two things:

  1. Create a default kobalt/src/Build.kt file based on what was found there.
  2. Install the Kobalt Wrapper in your current directory (script `kobaltw`) and in the kobalt/ 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:

./kobaltw assemble
If your project follows a regular build structure (e.g. Maven's hierarchy), this should compile your file and create a .jar file. If not, you will have to make a few edits to your Build.kt. As of this writing, Kobalt supports Java and Kotlin projects.

3. Edit Build.kt

import com.beust.kobalt.*
import com.beust.kobalt.plugin.kotlin.kotlinProject

val kobalt = kotlinProject {
    name = "kobalt"
    group = "com.beust"
    artifactId = name
    version = "0.62"
    directory = homeDir("kotlin/kobalt")
}