What is the best way to do inline testing in gradle build script?

Would like to check certain settings in my build script at build time. E.g. I have a task that copies an icon file. I want to check that the image has the correct dimensions (100x100) and warn the user if it isn’t. I am currently using assert statements to do this but it seems a bit heavy handed as it fails the entire build.

If you just want to warn the user you could simply output a logging statement.

logger.warn ‘Icon size must be 100x100’