Update generatefiles.rst

Wrapped the resource generation with `Def.task`.  Otherwise this example does not compile.