Gradle plugin for Kaitai: declarative language to generate binary data parsers
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

Maven Central Gradle Plugin Portal License

Build Status CircleCI

Gradle plugin for


Minimum configuration

  • Add plugin dependency
buildscript {
    repositories {
    dependencies {
  • Apply plugin
apply plugin: 'name.valery1707.kaitai'
  • Add Kaitai compile dependencies
repositories {
dependencies {
  • Configure plugin (all params are optional)
kaitai {
    packageName = ''

Plugin parameters

Name Type Since Description
skip boolean 0.1.0 Skip plugin execution (don't read/validate any files, don't generate any java types).

Default: false
url 0.1.0 Direct link onto KaiTai universal zip archive.

Default: Detected from version
version String 0.1.0 Version of KaiTai library.

Default: 0.8
cacheDir 0.1.0 Cache directory for download KaiTai library.

Default: build/tmp/kaitai-cache
sourceDirectory 0.1.0 Source directory with Kaitai Struct language files.

Default: src/main/resources/kaitai
includes String[] 0.1.0 Include wildcard pattern list.

Default: ["*.ksy"]
excludes String[] 0.1.0 Exclude wildcard pattern list.

Default: []
output 0.1.0 Target directory for generated Java source files.

Default: build/generated/kaitai
packageName String 0.1.0 Target package for generated Java source files.

Default: Trying to get project's group or kaitai otherwise


For debug on integration tests you must previously call some gradle tasks: jar assemble pluginUnderTestMetadata

Deploy new version manually:

  1. Update version inside build.gradle.kts and into releasing value and commit with Prepare release 0.2.0
  2. Prepare from
  3. Run ./gradlew clean build uploadArchives
  4. Open Staging Repository
  5. Search for namevalery1707 and select founded
  6. Check content on tab Content
  7. Press Close with comment Release version 0.2.0
  8. Wait for operation:
  9. On failure:
    • Check reason on tab Activity
    • Press Drop with some comment
  10. Press Release with comment Release version 0.2.0
  11. Check exists for Gradle API keys in local configuration
  12. Run ./gradlew publishPlugins
  13. Update version into snapshot value and commit with Prepare for next development iteration