This repository contains various example projects built with Kobalt. You can build them all from the root directory with
A simple project.
A project that mixes Java and Kotlin sources.
This project demonstrates the use of flavors with Kobalt, which let you produce different artifacts with similar sources based on which task you run:
$ ./kobaltw flavors:runFreeDebug ... ========== flavors:runFreeDebug Instanting a product: Free product $ ./kobaltw flavors:runProDebug ... ========== flavors:runProDebug Instanting a product: Pro product
This project has two
Products.kt source files in the
src/pro/kotlin directories respectively. The task you run decides which one gets compiled and run.
A basic Android example.
An Android example showing resource merging and flavors. Try the following target:
Then launch the app called "Kobalt Helloworld" on your device. Other targets of interest:
Each of these will display their product flavor and build type on the main screen along with a different background color (green for "free" and red for "pro") to demonstrate various layouts based on the product flavor.
Illustrate how to run an annotation processor with Kobalt. All you need to do is declare that your project depends on the annotation processor project and Kobalt will automatically run the annotation processor before building your project. This example was written by Sargun Vohra.
See it in action with:
Illustrate how to build a project with native libraries. This build is using the
native() directive to specify the three native LibJWGL libraries it uses and then a simple
kobaltw rubik:run will take care of running the Rubik application with all the paths correctly configured.