Nit: I don't think this assertion is necessary, it might conflict with gradle's ability to allow users to ignore tasks.  Also for uniformity it might be nice to set the ClientLibDirectory in the closure at the top of the method (whenTaskAdded).