Adding a jar to the buildscript classpath from a task

Is it possible to add a jar to the buildscript classpath dependencies from a Task?

If yes, how would I do that?

It’s not possible to do this. The classpath needs to be known before any tasks run.

Figured as much, thanks.