apply plugin: 'com.android.application' android { compileSdkVersion rootProject.ext.compileSdkVersion buildToolsVersion rootProject.ext.buildToolsVersion defaultConfig { applicationId "com.hjq.demo" minSdkVersion 14 targetSdkVersion rootProject.ext.targetSdkVersion versionCode 10 versionName "1.0" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" } //APK 签名的那些事:https://www.jianshu.com/p/a1f8e5896aa2 // signingConfigs { // release { // keyAlias '密钥别称' // keyPassword '密钥密码' // storeFile file('E:/MySign.jks') // storePassword '密钥库密码' // } // // debug { // keyAlias '密钥别称' // keyPassword '密钥密码' // storeFile file('E:/MySign.jks') // storePassword '密钥库密码' // } // } buildTypes { release { // 不显示Log buildConfigField "boolean", "LOG_DEBUG", "false" // 移除无用的resource文件,前提minifyEnabled必须打开 shrinkResources true // ZipAlign优化 zipAlignEnabled true // 设置混淆 minifyEnabled true //加载默认混淆配置涵 proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' // 正式环境签名 //signingConfig signingConfigs.release } debug { //ZipAlign优化 zipAlignEnabled false //设置混淆 minifyEnabled false //加载默认混淆配置涵 proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' // 开发环境签名 //signingConfig signingConfigs.debug } } flavorDimensions "default"//这个名字貌似随便取,也可以有多个,总之一定要有 //多渠道打包 productFlavors { kuan {} //酷安 tencent {} //应用宝 baidu {} //百度 xiaomi {} //小米 huawei {} //华为 google {} //谷歌 productFlavors.all { flavor -> flavor.manifestPlaceholders = [UMENG_CHANNEL_VALUE: name] } } // JNI 目录 sourceSets { main { jniLibs.srcDirs = ['libs'] } } } // api 与 implementation的区别:https://www.jianshu.com/p/8962d6ba936e dependencies { // 依赖 libs 目录下所有 Jar 包 implementation fileTree(include: ['*.jar'], dir: 'libs') // 基础库(不包任何第三方框架) implementation project(':base') // 自定义 View implementation project(':widget') // 友盟 implementation project(':umeng') // Dialog implementation project(':dialog') // 示例:添加一个 aar 包 // implementation(name: 'password_dialog', ext: 'aar') implementation "com.android.support:appcompat-v7:$rootProject.ext.supportLibraryVersion" implementation "com.android.support:design:$rootProject.ext.supportLibraryVersion" implementation "com.android.support:support-v4:$rootProject.ext.supportLibraryVersion" implementation "com.android.support:cardview-v7:$rootProject.ext.supportLibraryVersion" implementation "com.android.support.constraint:constraint-layout:$rootProject.ext.constraintlayoutVersion" // Dex分包,解决 65k 问题 implementation 'com.android.support:multidex:1.0.3' // ButterKnife注解库:https://github.com/JakeWharton/butterknife implementation 'com.jakewharton:butterknife:9.0.0-rc1' annotationProcessor 'com.jakewharton:butterknife-compiler:9.0.0-rc1' // 状态栏沉浸:https://github.com/gyf-dev/ImmersionBar implementation 'com.gyf.immersionbar:immersionbar:2.3.3-beta09' // 侧滑功能:https://github.com/bingoogolapple/BGASwipeBackLayout-Android implementation 'cn.bingoogolapple:bga-swipebacklayout:1.2.0' // 权限请求框架:https://github.com/getActivity/XXPermissions implementation 'com.hjq:xxpermissions:5.2' // 标题栏:https://github.com/getActivity/TitleBar implementation 'com.hjq:titlebar:5.0' // 吐司工具类:https://github.com/getActivity/ToastUtils implementation 'com.hjq:toast:5.2' // 圆形的ImageView:https://github.com/hdodenhof/CircleImageView implementation 'de.hdodenhof:circleimageview:2.2.0' // RecyclerView:https://github.com/CymChad/BaseRecyclerViewAdapterHelper // 工具类集合:https://github.com/Blankj/AndroidUtilCode // 图片选择:https://github.com/zhihu/Matisse // 上拉下拉:https://github.com/bingoogolapple/BGARefreshLayout-Android // 轮播图:https://github.com/bingoogolapple/BGABanner-Android // 二维码:https://github.com/bingoogolapple/BGAQRCode-Android } repositories { flatDir { dirs 'libs' //就是你放aar的目录地址 } }