Skip to content

Instantly share code, notes, and snippets.

@youxiachai
Created December 12, 2013 07:44
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save youxiachai/7924511 to your computer and use it in GitHub Desktop.
Save youxiachai/7924511 to your computer and use it in GitHub Desktop.
apply plugin: 'android'
tasks.withType(Compile) {
options.encoding = "UTF-8"
}
dependencies {
// compile fileTree(dir: 'libs', include: '*.jar')
compile files('libs/fastjson-1.1.34.android.jar')
compile files('libs/umeng_sdk.jar')
compile files('libs/youxiachai-aquery-ajax.jar')
compile project(':Yodbank_Library.SlidingMenu')
}
android {
compileSdkVersion 17
buildToolsVersion "18.1.0"
signingConfigs {
alphaConfig {
storeFile file("alpha.keystore")
storePassword "xxxxxx"
keyAlias "xxx"
keyPassword "xxxxx"
}
}
buildTypes {
release {
runProguard true
proguardFile 'proguard-android.txt'
}
alpha {
packageNameSuffix ".alpha"
runProguard true
proguardFile 'proguard-android.txt'
signingConfig signingConfigs.alphaConfig
}
}
productFlavors {
}
sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = ['src']
resources.srcDirs = ['src']
aidl.srcDirs = ['src']
renderscript.srcDirs = ['src']
res.srcDirs = ['res']
assets.srcDirs = ['assets']
}
// Move the tests to tests/java, tests/res, etc...
// Move the build types to build-types/<type>
// For instance, build-types/debug/java, build-types/debug/AndroidManifest.xml, ...
// This moves them out of them default location under src/<type>/... which would
// conflict with src/ being used by the main source set.
// Adding new build types or product flavors should be accompanied
// by a similar customization.
debug.setRoot('build-types/debug')
release.setRoot('build-types/release')
alpha.setRoot('build-types/alpha');
}
}
Copy link

ghost commented Apr 3, 2014

Hi, 请教一下,我通过setRoot来设置flavor或者buildTypes的代码目录,如果是配置文件则没有问题,如果是java文件就会报“类重复”的编译错误?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment