Converted generation of java file to gradle