StigPatchSpec

data class StigPatchSpec(val file: File, val find: String, val replace: String, val regex: Boolean = true, val skipIfContains: String? = null, val required: Boolean = true, val description: String? = null, val replaceFromFile: File? = null)

Specification for a single source-code patch.

Two ways to specify the replacement text:

  • replace: inline replacement string (supports regex backreferences)

  • replaceFromFile: a resolved File whose content is read at task execution time and used as the replacement text. When both are set, replaceFromFile content is appended/prepended to replace depending on the pattern.

The file field is always the patch target (the resolved file to be patched).

Constructors

Link copied to clipboard
constructor(file: File, find: String, replace: String, regex: Boolean = true, skipIfContains: String? = null, required: Boolean = true, description: String? = null, replaceFromFile: File? = null)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
@get:Input
@get:Optional
val description: String?
Link copied to clipboard
@get:InputFile
@get:PathSensitive(value = PathSensitivity.ABSOLUTE)
val file: File

Resolved absolute file on disk — the patch target.

Link copied to clipboard
@get:Input
val find: String
Link copied to clipboard
@get:Input
val regex: Boolean
Link copied to clipboard
@get:Input
val replace: String
Link copied to clipboard
@get:InputFile
@get:PathSensitive(value = PathSensitivity.ABSOLUTE)
@get:Optional
val replaceFromFile: File?

Optional resolved file whose content is used as the replacement text. Read at task execution time — no configuration-time file I/O. When set, replace acts as a template where {{CONTENT}} is substituted with the file's trimmed content.

Link copied to clipboard
@get:Input
val required: Boolean
Link copied to clipboard
@get:Input
@get:Optional
val skipIfContains: String?