Skip to content

Configuration

Jinx supports three configuration methods. Priority order (higher overrides lower):

Gradle DSL / -A compiler options > jinx.yaml > defaults

jinx.yaml

Create jinx.yaml in your project root. Jinx searches upward from the working directory, so a file at the repository root covers all subprojects.

profiles:
dev:
naming:
maxLength: 30
strategy: NO_OP
prod:
naming:
maxLength: 63
strategy: SNAKE_CASE

Activate a profile (in order of precedence):

  1. Gradle DSL: profile.set("prod")
  2. Environment variable: JINX_PROFILE=prod
  3. Default: dev

Configuration Options

naming.maxLength

Maximum length for generated constraint and index names.

DefaultRecommended values
30PostgreSQL: 63  /  MySQL: 64

When a generated name exceeds this limit, Jinx truncates it and appends a short hash to preserve uniqueness.

naming.strategy

Controls how Java field/class names are converted to physical column names.

ValueBehaviorExample
NO_OPNo conversion (default)myColumnmyColumn
SNAKE_CASEcamelCase → snake_casemyColumnmy_column

Gradle DSL

jinx {
profile.set("prod")
naming {
maxLength.set(63)
strategy.set("SNAKE_CASE")
}
database {
dialect.set("mysql")
}
output {
format.set("sql")
directory.set("build/jinx")
}
}

Gradle DSL values override jinx.yaml. The plugin translates them into -A compiler arguments automatically.


Direct Annotation Processor Options (-A)

When using the annotation processor without the Gradle plugin:

compileJava {
options.compilerArgs += [
'-Ajinx.naming.maxLength=63',
'-Ajinx.naming.strategy=SNAKE_CASE',
'-Ajinx.profile=prod'
]
}
KeyDescription
jinx.naming.maxLengthMaximum constraint/index name length
jinx.naming.strategyNaming strategy (NO_OP or SNAKE_CASE)
jinx.profileActive profile for jinx.yaml lookup

Support Matrix

Settingjinx.yamlGradle DSL-A option
profile
naming.maxLength
naming.strategy
database.dialect
output.format
output.directory