Skip to content

Registration settings

Use these settings to select registered declarations, locate the Godot project, and control dependency registration files.

Registration selection

registration.annotationProcessingMode

Controls how classes and members are selected for registration.

Default: AnnotationProcessingMode.Inferred

1
2
3
4
5
import godot.annotation.processor.classgraph.AnnotationProcessingMode

godot {
    registration.annotationProcessingMode.set(AnnotationProcessingMode.Inferred)
}

Accepted values: Explicit, Inferred, Automatic. See Registration modes for exact selection and export behavior. The IDE's inspection mode is configured separately.

Godot project layout and registration output

Project classes use source files. These settings locate the Godot project and control generated .gdj files for dependency classes.

godotProjectDirectory

Directory that contains project.godot.

Default:

  • the current Gradle project directory

Use this when the Gradle project lives in a subdirectory:

1
2
3
godot {
    godotProjectDirectory.set(file(".."))
}

registration.gdjFilesDirectory

Base directory where newly created external-dependency .gdj registration files are written. The directory is created only when there is a new .gdj file to place there. Classes from the current Godot project use their source files directly.

Default:

  • <godotProjectDirectory>/gdj

Example:

1
2
3
godot {
    registration.gdjFilesDirectory.set(file("custom-gdj"))
}

registration.disableGdj

Disables external-dependency .gdj registration file handling while keeping class scanning and registrar generation enabled.

Default:

  • false

Example:

1
2
3
godot {
    registration.disableGdj.set(true)
}

When enabled, the plugin:

  • still scans compiled user code for registered classes
  • still generates registrar sources/resources
  • skips scanning the Godot project for existing .gdj files
  • skips staged .gdj generation
  • skips copying, replacing, or deleting .gdj files in the Godot project

registration.gdjFilesLayoutMode

Controls how .gdj files are laid out inside each library's directory under registration.gdjFilesDirectory.

Values:

  • RegistrationFileLayoutMode.FLAT: write .gdj files directly into the library's directory
  • RegistrationFileLayoutMode.HIERARCHICAL: mirror the package hierarchy before the .gdj file

Default:

  • RegistrationFileLayoutMode.FLAT

Example:

1
2
3
4
5
import godot.registrar.generator.RegistrationFileLayoutMode

godot {
    registration.gdjFilesLayoutMode.set(RegistrationFileLayoutMode.HIERARCHICAL)
}

registration.gdjFilesIndentation

Controls the indentation used inside generated .gdj files.

Values:

  • RegistrationFileIndentation.SPACE
  • RegistrationFileIndentation.TAB

Default:

  • RegistrationFileIndentation.SPACE

Example:

1
2
3
4
5
import godot.registrar.generator.RegistrationFileIndentation

godot {
    registration.gdjFilesIndentation.set(RegistrationFileIndentation.TAB)
}

registration.nameMode

Controls the prefix policy for registered class names. The base name is the nonblank @Script.className, or the simple JVM class name. Custom names still receive the selected prefix; dots and hyphens are then replaced with underscores. See registered class names.

Values:

  • RegisteredNameMode.SIMPLE_NAME: use the simple class name
  • RegisteredNameMode.FQ_NAME: use the fully qualified class name
  • RegisteredNameMode.PROJECT_PREFIX: use the simple class name for the current project, and prefix external classes with their source project name

Default:

  • RegisteredNameMode.SIMPLE_NAME

Example:

1
2
3
4
5
import godot.registrar.generator.RegisteredNameMode

godot {
    registration.nameMode.set(RegisteredNameMode.FQ_NAME)
}