def processAirbridgeJSON = {
    def content = '{}'.getBytes()

    def json = rootProject.file('../airbridge.json')
    if (json.exists()) {
        content = json.readBytes()
    }

    def file = rootProject.file('app/src/main/assets/airbridge.json')
    if (!file.exists()) {
        file.getParentFile().mkdirs()
        file.createNewFile()
    }

    file.write(new String(content))
}

preBuild.dependsOn processAirbridgeJSON