Skip to content

rtc11/buildk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BuildK

Build K logo
Simple build tool for Kotlin.

🛠️ Install

cargo install --git https://github.com/rtc11/buildk

📜 Manifest

An empty buildk.toml is required in project root.

See default configurations:

buildk config

Properties with defaults:

[project]
path = "<cwd>"
src  = "<cwd>/src"
test = "<cwd>/test"
main = "Main.kt"
out  = "<cwd>/out"

[compile]
org.jetbrains.kotlin.kotlin-stdlib = "1.9.22"

[runtime]

[test]
org.junit.platform.junit-platform-console-standalone = "1.10.1"
org.junit.jupiter.junit-jupiter-api = "5.5.2"

[repos]
mavenCentral = "https://repo1.maven.org/maven2"

[kotlin]
path = "/usr/local/Cellar/kotlin/1.9.22/"

[java]
path = "/usr/local/Cellar/openjdk/17.0.1/"

Which gives the following project structure:

project
└── .buildk.toml                  # Manifest
    ├── src                       
    │   └── Main.kt               # Source code
    ├── test                      
    │   └── MainTest.kt           # Test code (JUnit 5)
    └── out
        ├── cache.json            # Build cache
        ├── app.jar               # Release (fat-jar)
        ├── src         
        │   └── Mainkt.class      # Compiled sources
        └── test
            └── MainTestkt.class  # Compiled test sources

🪄 Commands

Show commands

buildk help
A Kotlin build tool for the 21st century

Usage: buildk [OPTIONS] <COMMAND>

Commands:
  build, -b  Build the project
  clean, -c  Clean the output directory
  config     Show the project configuration
  deps       Print the dependencies
  fetch      Fetch the dependencies
  init       Initialize the project
  release    Create a release (jar)
  run, -r    Run the project
  test, -t   Run JUnit tests
  tree       Print the build tree
  path       
  help       Print this message or the help of the given subcommand(s)

Options:
  -q             
  -h, --help     Print help
  -V, --version  Print version

Dev

Faster builds with rayon (currently only with nightly)

RUSTFLAGS="-Z threads=8" cargo +nightly build --release

🚧 TODO

  • Java runtime dependency resolution
  • Java compile time dependency resolution
  • AVL trees for dependency graph?
  • Resolve maven artifacts
  • Resolve gradle dependencies
  • Resolve buildk packages
  • Resolve local packages
  • Resolve git packages
  • Publish buildk packages
  • Buildk published packages can be stored on github package registry?
  • Resolve conflicting dependency versions
  • Resolve cyclic transitive dependencies
  • Cache classpath (complete dependency graph per used dependency)
  • Support multi module
  • Create a project graph for enabling parallel compilation
  • Early cut off improvements
    • Checking timestamp on files is not always sufficient. E.g. when adding a comment.
  • Shared cache
    • Build once on one machine, share the result in the cloud
  • Platform libs must be configurable (e.g. junit or kotlin-std:1.9.22)
    • Kotlin std
    • Test libs
    • Java std
  • Tests are automatically found
  • Manually create build-tree based on project package/imports
  • KSP (kotlin compiler plugin) must be implemented in kotlin. Used for generating smarter build-trees
  • Configurable repositories
  • Add init command for setting up basic project
  • Kotlinc must be first looked up in manifest before trying to look for env-vars and default locations
  • When downloading deps and transitive deps fails, the imported dependency is cached and no transitive will be wodnloaded again
  • Use crossbeam for concurrency downloads?
  • Use Rayon for parallel compilation?
  • Use ripgrep for lexing/ksp/avl/build-tree?
  • Use prodash instead of stdout?

About

Build tool for kotlin

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages