Revert "Remove gradle invocation from compile script."

This reverts commit a65fa9d9364135ccd0a751d5c13d3056e873f556.