Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/185.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 如何调用build.gradle中buildscript函数的用户定义的存储库内方法函数_Android_Gradle_Android Gradle Plugin_Build.gradle_Gradle Plugin - Fatal编程技术网

Android 如何调用build.gradle中buildscript函数的用户定义的存储库内方法函数

Android 如何调用build.gradle中buildscript函数的用户定义的存储库内方法函数,android,gradle,android-gradle-plugin,build.gradle,gradle-plugin,Android,Gradle,Android Gradle Plugin,Build.gradle,Gradle Plugin,我在project level build.gradle中定义了一个函数 def isGood(){ return true } 同样在项目级别,我想在buildscript函数的存储库内调用这个函数。但是从这里不能叫isGood。为什么?我该怎么做呢 buildscript { repositories { if(isGood()) {. // isGood cannot be found here. I want to call isGood functi

我在project level build.gradle中定义了一个函数

def isGood(){
    return true
}
同样在项目级别,我想在buildscript函数的存储库内调用这个函数。但是从这里不能叫isGood。为什么?我该怎么做呢

buildscript {
    repositories {

        if(isGood()) {. // isGood cannot be found here. I want to call isGood function here. How can I do that?
            maven { url "https://something" }
        }

    }
    dependencies {

    }
}