android studio build.gradle 文件中的风格依赖关系,这可能吗?

dependencies by flavor in android studio build.gradle file, is it possible?

我的 build.gradle 文件中的图像我有以下依赖项:

依赖关系{ 编译 'com.android.support:support-v13:22.1.1' 编译 'com.android.support:appcompat-v7:22.1.1' 编译 'com.jakewharton:butterknife:6.0.0' }

假设我定义了以下产品口味:

productFlavors {
    germanyMock {
        applicationId "org.mymocksite.mock"
    }

    usaMock {
        applicationId "org.myqasite.qa"
    }

}

假设我只想通过风味来依赖,那么我可以这样做吗:

dependencies {
    compile 'com.android.support:support-v13:22.1.1'
    compile 'com.android.support:appcompat-v7:22.1.1'
    usaMockcompile 'com.jakewharton:butterknife:6.0.0'//this does not work for me
}

所以上面的内容对我不起作用,但我在想,因为有一个 testCompile,我认为 mockCompile 不应该有 flavorCompile 吗?如果不是,我如何才能看到所有可用的 "compiles"?

更改为 usaMockCompile 从 c 更改为 C.

dependencies {
    compile 'com.android.support:support-v13:22.1.1'
    compile 'com.android.support:appcompat-v7:22.1.1'
    usaMockCompile 'com.jakewharton:butterknife:6.0.0'
}