Gradle noobie,有点困惑。我试图从命令行告诉 gradle 使用不同的构建脚本,但是每当我这样做时,它都会告诉我它找不到我的依赖项。
每当我打电话时:
gradle -b build.gradle
它工作得很好。
但是当我打电话时:
gradle -b other.gradle
它试图找到我的依赖项。例如
* What went wrong:
A problem occurred evaluating root project '<main_app>'.
> Project with path ':facebook-android-sdk-3.0.1:facebook' could not be found in root project '<main_app>'.
我在完全相同的目录中使用完全相同的构建脚本,只是名称不同。这里是:
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.4.2'
}
}
apply plugin: 'android'
dependencies {
compile project(':facebook-android-sdk-3.0.1:facebook')
}
android {
buildToolsVersion "17.0"
compileSdkVersion 17
sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = ['src']
resources.srcDirs = ['src']
aidl.srcDirs = ['src']
renderscript.srcDirs = ['src']
res.srcDirs = ['res']
assets.srcDirs = ['assets']
}
}
}
我的 settings.gradle 文件:
include '<app_module>'
include '<:facebook-android-sdk-3.0.1:facebook>'