-
- All Implemented Interfaces:
-
java.io.Serializable
public class GitHooksExtension implements Serializable
DSL entry point, to be applied to settings.gradle.kts.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public classGitHooksExtension.Companion
-
Constructor Summary
Constructors Constructor Description GitHooksExtension(Settings settings)
-
Method Summary
Modifier and Type Method Description final FilegetPath()final UnitsetPath(File path)The git repository root. final SettingsgetSettings()final Unithook(String hookName, Function1<ScriptContext, Unit> configuration)Defines a new hook with an arbitrary name. final UnitpreCommit(Function1<ScriptContext, Unit> configuration)Pre-commit hook. final UnitcommitMsg(Function1<CommitMsgScriptContext, Unit> configuration)Commit-msg hook. final UnitcreateHooks(Boolean overwriteExisting)To be called to force the hook creation in case of necessity. -
-
Method Detail
-
setPath
final Unit setPath(File path)
The git repository root. If unset, it will be searched recursively from the project root towards the filesystem root.
-
getSettings
final Settings getSettings()
-
hook
final Unit hook(String hookName, Function1<ScriptContext, Unit> configuration)
Defines a new hook with an arbitrary name.
-
preCommit
final Unit preCommit(Function1<ScriptContext, Unit> configuration)
Pre-commit hook.
-
commitMsg
final Unit commitMsg(Function1<CommitMsgScriptContext, Unit> configuration)
Commit-msg hook.
-
createHooks
final Unit createHooks(Boolean overwriteExisting)
To be called to force the hook creation in case of necessity. If passed
true, overwrites in case the script is already present and different than expected.
-
-
-
-