apply plugin: 'com.android.application'
def buildTime() {
def date = new Date()
def formattedDate = date.format('yyyyMMdd')
return "_$formattedDate"
}
dependencies {
// 在eclipse 中导入了 ['android-support-multidex.jar', 'org.apache.http.legacy.jar'], 因此需要删除。
compile fileTree(dir: 'libs', include: '*.jar', exclude:['android-support-multidex.jar', 'org.apache.http.legacy.jar'])
compile project(':androidv4:lib:StggerGrid')
compile project(':androidv4:lib:ImageSlider:Library')
compile project(':androidv4:lib:SwipeMenuListView')
compile project(':androidv4:lib:StickyListHeaders-master:library')
compile project(':androidv4:lib:Squareup')
compile project(':androidv4:lib:android-menudrawer-master:menudrawer')
compile project(':androidv4:lib:Signature')
compile project(':androidv4:lib:FloatingActionButton-master:library:src:main')
compile project(':androidv4:lib:HorizontalVariableListView:main')
compile project(':androidv4:lib:ViewPagerIndicator-master:ViewPagerIndicator_Library')
compile project(':androidv4:lib:PhotoView-master:library:src:main')
// compile project(':v7-6.0:appcompat')
compile 'com.android.support:appcompat-v7:23.2.1'
compile 'com.android.support:design:23.2.1'
compile 'com.android.support:cardview-v7:23.2.1'
// 分包
compile 'com.android.support:multidex:1.0.0'
// 状态栏
compile 'com.readystatesoftware.systembartint:systembartint:1.0.3'
// 处理android6.0权限问题
compile 'com.anthonycr.grant:permissions:1.0'
// 聊天输入框
compile 'com.github.w446108264:XhsEmoticonsKeyboard:2.0.2'
compile 'com.github.w446108264:AndroidEmoji:1.0.0'
compile project(':reclib-testemoticons')
// Required -- JUnit 4 framework
testCompile 'junit:junit:4.12'
// Optional -- Mockito framework
testCompile 'org.mockito:mockito-core:1.10.19'
}
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
aaptOptions.cruncherEnabled = false
aaptOptions.useNewCruncher = false
sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = ['src']
resources.srcDirs = ['src']
aidl.srcDirs = ['src']
renderscript.srcDirs = ['src']
res.srcDirs = ['res']
assets.srcDirs = ['assets']
// 自动创建时没有这个,需要加上
jniLibs.srcDirs = ['libs']
}
// Move the tests to tests/java, tests/res, etc...
instrumentTest.setRoot('tests')
// 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')
}
defaultConfig {
minSdkVersion 15
targetSdkVersion 23
// 开启分包 65536
multiDexEnabled true
}
// 忽略错误
lintOptions {
checkReleaseBuilds false
// Or, if you prefer, you can continue to check for errors in release builds,
// but continue the build even when errors are found:
abortOnError false
}
// 如果打包过程中,报outofmemory异常,适当增加内存
dexOptions {
javaMaxHeapSize "4g"
}
// 导入的第三方包如果存在下面这些文件,有可能会冲突,可以在打包中排出这些文件
packagingOptions {
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/NOTICE'
exclude 'META-INF/LICENSE'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
}
useLibrary 'org.apache.http.legacy'
// buildTypes {
//
// }
//
// productFlavors {
// sunyun {}
// yinman{}
//
// applicationVariants.all { variant ->
// variant.outputs.each { output ->
//
// def newName = variant.baseName.replace("-release", "") + buildTime() + ".apk";
// output.outputFile = new File("${project.rootDir}/apk/", newName);
// }
// }
// }
}
eclipse迁移到android studio
最新推荐文章于 2024-09-13 08:51:43 发布