How to properly register custom tasks entirely in Java?

Please consider the following contents in some build.gradle:

// This is only a JAR, so managing old, binary style.
apply plugin: 'ams_docbeam_raw_server'
apply plugin: 'ams_eclipse_default_code_style'
[...]
ext
{
	svnBinDir	= "${rootDir}/../../../Svn/Bin"
	deployDir	= "${svnBinDir}/DocBeam3/trunk/Docbeamserver/Programme/Versand-Server/lib"
}

The plugins are applied to a time when ext has not yet been processed, correct? Is there some way in the plugins to defer some e.g. creation of tasks to after ext has been processed?

The approach I’m currently using is accessing ext only during the runtime of the task. But one might need some infos of ext to configure a task earlier. Is Project.afterEvaluate the correct API to use or is that too late already?