-
Notifications
You must be signed in to change notification settings - Fork 18
Prebuild Hooks
Danny Thomas edited this page Jun 1, 2016
·
1 revision
PreExecutionActions allows for actions to happen before gradle is executed.
addPreExecute(new PreExecutionAction() {
@Override
void execute(File projectDir, List<String> arguments, List<String> jvmArguments) {
initScript.text = '''
gradle.projectsLoaded {
gradle.rootProject.tasks.create('foo')
}
'''.stripIndent()
}
})
The PreExecutionAction lets you automatically add steps to the test that get executed just before run is called. This is particularly useful when tests change a value that is needed during the execution allowing the action to be defined in a setup, and delayed until the execution.