Update to build with gradle as a library project