Skip to content
Tools to make componentized javascript easier
Branch: master
Clone or download
Type Name Latest commit message Commit time
Failed to load latest commit information.
bin using closure-compiler jar from brew formula Jul 15, 2013
homebrew latest closure compiler, updated pointer to latest linter Jun 1, 2012


Helper to make using Google Closure Tools easier.
By Kevin Moore


The Closure Tools let you build dependency files, compile your javascript, lint* and fix*.

...but you end up passing a lot of command line parameters to each.

kbuild lets you define a single yaml file (config.kb) in the root of your project to make using these tools a lot easier.

* If you install closure_linter. See below.

kbuild --help

usage: kbuild [-h] [--buildfile BUILDFILE] [--debug]
              [--language_in {ECMASCRIPT3,ECMASCRIPT5,ECMASCRIPT5_STRICT}]

Prepare a closure-based javascript set.

positional arguments:
                        Specify to either create a [deps] file, generate
                        [compile]d output, run [fix]jsstyle, run gjs[lint],
                        [build] deps then compile, or [fb] to fix then build.
                        (default: deps)

optional arguments:
  -h, --help            show this help message and exit
  --buildfile BUILDFILE
                        The yaml config file to use. (default: config.kb)
  --debug, -d           Enable debug output when in compile mode. (default:
                        Sets what language spec that input sources conform.
                        (default: ECMASCRIPT5_STRICT)
  --show_command, -sc   Show the command line that is run for the given
                        options. (default: False)


  • java - Tested with 1.6
  • python - 2.7 is required
    • yaml - pip install PyYAML - for parsing the config file
    • termcolor - pip install termcolor - to enable pretty output of info and errors
    • closure_linter (optional) - pip install
      • enables kbuild fix and kbuild lint

Show me an example

kbuild is used in these OSS projects by Pixel Lab.

ThinkQR is the easiest to start with.
If you're cloning these locally, make sure you sync up all of the submodules before you try kbuild.

config.kb file from ThinkQR

# kbuild file -
closure_path: js/closure
  - js/app/application.js
  - js/app
  - js/pl/src
deps_path: js/deps.js
compile_path: js/compiled.js
  - js/externs/jquery-1.6.js
  - js/app
  - js/pl/src/
  - js/loader.js
You can’t perform that action at this time.