updated build script to support latest version of Gradle

Change-Id: I06ce952d45163d9e436af77b068c588fe5168c0a