Gradle-Android:classpath()来自哪里?

时间:2018-04-27 10:41:56

标签: android-gradle build.gradle

以下是Android应用的根 build.gradle 文件。我想问一下声明 classpath()方法的位置。我想在Project中,但我无法在reference中找到它。

buildscript {

    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.0.1'


        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        google()
        jcenter()
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

1 个答案:

答案 0 :(得分:2)

在界面ScriptHandler中,classpathpublic static final String CLASSPATH_CONFIGURATION "classpath"的配置值。

您可以buildscript.CLASSPATH_CONFIGURATION通过buildscript来回复ScriptHandler