【发布时间】:2015-01-18 05:00:24
【问题描述】:
当我从 build.gradle 文件导入 IntelliJ 14.0.2 时,如果我在 sourceSet 中指定 manifest.srcFile 则不会生成 .iml 并且永远不会设置 contentRoot - 基本上没有项目,它是只是一个文件列表。
有人遇到过这个问题吗?
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.0.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
repositories {
mavenCentral()
}
apply plugin: 'android'
android {
compileSdkVersion 21
buildToolsVersion "21.1.2"
defaultConfig {
minSdkVersion 14
targetSdkVersion 19
versionCode 1
versionName "0.01"
}
sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
}
}
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt')
}
debug {
debuggable true
}
}
}
dependencies {
// all *.jar files in the libs dir
compile fileTree(dir: 'libs', include: ['*.jar'])
// remote dependencies
compile 'com.android.support:appcompat-v7:21.0.3'
}
【问题讨论】:
标签: java android intellij-idea gradle android-gradle-plugin