UpdateStrategy

Defines a strategy for updating an existing configuration file to match a newer default version.

An implementation of this interface provides the logic to determine whether an update is needed, and performs any necessary modifications to the target configuration file while preserving existing values and comments as needed.

This interface is typically used by format-specific update handlers (e.g., YAML, JSON).

Example usage:

UpdateStrategy { context ->
// perform update logic using context.targetFile and context.resourcePath
true // return true if the config file was updated, false otherwise
}

See also

for the data provided to the update logic

Functions

Link copied to clipboard
abstract fun updateIfNeeded(context: UpdateContext): Boolean

Attempts to update the target configuration file.