Class JacetExtension

java.lang.Object
de.irotation.jacet.gradle.JacetExtension

public abstract class JacetExtension extends Object
DSL extension for configuring the jacet formatter.

Configuration is layered, highest priority last: built-in FormatterOptions.defaults() < .jacet.json < this jacet { } block. The plugin loads .jacet.json by walking up from the project directory (mirroring the CLI); any property set here overrides the file. An unset property falls through to the file value, then to the default shown below. The string-valued properties accept a fixed vocabulary and fail the build with a clear message on any other value (see applyOverrides(FormatterOptions)).

Use configFile to point at a specific .jacet.json instead of the walk-up lookup (the counterpart of the CLI's --config).

jacet {
  configFile = file("config/.jacet.json")                  // optional: skip walk-up, use this file
  printWidth = 140                                          // line width, default 140
  tabWidth = 2                                              // indent width, default 2
  useTabs = false                                           // indent with tabs, default false
  forceBraces = true                                        // brace single-statement bodies, default true
  endOfLine = "lf"                                          // one of: lf, crlf, cr, auto; default lf
  staticImports = "top"                                     // one of: top, bottom, mixed; default top
  importGroups = ["java", "javax", "jakarta", "org", "com", "de"] // ordered group prefixes
}
  • Constructor Details

    • JacetExtension

      public JacetExtension()
  • Method Details

    • getConfigFile

      public abstract org.gradle.api.file.RegularFileProperty getConfigFile()
    • getPrintWidth

      public abstract org.gradle.api.provider.Property<Integer> getPrintWidth()
    • getTabWidth

      public abstract org.gradle.api.provider.Property<Integer> getTabWidth()
    • getUseTabs

      public abstract org.gradle.api.provider.Property<Boolean> getUseTabs()
    • getForceBraces

      public abstract org.gradle.api.provider.Property<Boolean> getForceBraces()
    • getEndOfLine

      public abstract org.gradle.api.provider.Property<String> getEndOfLine()
    • getStaticImports

      public abstract org.gradle.api.provider.Property<String> getStaticImports()
    • getImportGroups

      public abstract org.gradle.api.provider.ListProperty<String> getImportGroups()