// This script must be applied in app/build.gradle for the paths here to work correctly def copyMockFilesNeeded() { def srcGoogleServicesFile = file("../mock/mock-google-services.json") def destGoogleServicesFile = file("google-services.json") if (!destGoogleServicesFile.exists()) { destGoogleServicesFile.write(srcGoogleServicesFile.text) } } afterEvaluate { copyMockFilesNeeded() }