toolbox
toolbox copied to clipboard
Allow usingInitScript(Consumer) for inline configuration of init script
Instead of:
def initScriptFile = file('init.gradle')
initScriptFile << configurePluginClasspathAsInitScriptDependencies() << '''
apply plugin: dev.nokee.init.NokeeInitPlugin
'''
executer = executer.usingInitScript(initScriptFile).
we could have something like:
executer = executer.usingInitScript(nokeeInitScript())
private static Consumer<InitScriptBuilder> nokeeInitScript() {
return builder -> builder.inDirectoryAt('init.gradle').configurePluginClasspathAsInitScriptDependencies().applyPlugin('dev.nokee.init.NokeeInitPlugin')
}
The InitScript
builder would allow setting the init script in the init.d
directory if needed but would also fail if using a shared directory.
An experimentation of this work is under Nokee, there are still quite a bit of open questions so we will unscheduled it for now.