码迷,mamicode.com
首页 > 移动开发 > 详细

设置安卓构建全局环境变量

时间:2019-11-28 23:02:48      阅读:127      评论:0      收藏:0      [点我收藏+]

标签:roo   cti   xxx   build   ntb   indicator   项目   ica   too   

新建xxx.gradle

ext {
    android = [compileSdkVersion: 29,
               buildToolsVersion: "29.0.0",
               minSdkVersion    : 19,
               targetSdkVersion : 29,
               applicationId    : ‘com.imooc.imooc_voice‘,
               versionCode      : 2,
               versionName      : ‘1.1‘,
               multiDexEnabled  : true,]
    depsVersion = [appcompact     : ‘29.0.0‘,
                   design         : ‘29.0.0‘,
                   recyclerview   : ‘29.0.0‘,
                   constraint     : ‘1.1.3‘,
                   eventbus       : ‘3.1.1‘,
                   greendao       : ‘3.2.2‘,
                   rxjava         : ‘2.2.9‘,
                   rxandroid      : ‘2.1.1‘,
                   arouterapi     : ‘1.5.0‘,
                   aroutercompiler: ‘1.2.2‘,
                   magicindicator : ‘1.5.0‘,
                   glide          : ‘4.9.0‘,
                   glidecompiler  : ‘4.9.0‘,
                   okhttp         : ‘3.3.0‘,
                   gson           : ‘2.8.0‘,
    ]

    depsLibs = [appcompact     : ‘androidx.appcompat:appcompat:1.0.0‘,
                design         : ‘com.google.android.material:material:1.0.0‘,
                recyclerview   : ‘androidx.recyclerview:recyclerview:1.0.0‘,
                constraint     : ‘androidx.constraintlayout:constraintlayout:1.1.3‘,
                eventbus       : "org.greenrobot:eventbus:${depsVersion.eventbus}",
                greendao       : "org.greenrobot:greendao:${depsVersion.greendao}",
                rxjava         : "io.reactivex.rxjava2:rxjava:${depsVersion.rxjava}",
                rxandroid      : "io.reactivex.rxjava2:rxandroid:${depsVersion.rxandroid}",
                arouterapi     : "com.alibaba:arouter-api:${depsVersion.arouterapi}",
                aroutercompiler: "com.alibaba:arouter-compiler:${depsVersion.aroutercompiler}",
                magicindicator : "com.github.hackware1993:MagicIndicator:${depsVersion.magicindicator}",
                glide          : "com.github.bumptech.glide:glide:${depsVersion.glide}",
                glidecompiler  : "com.github.bumptech.glide:compiler:${depsVersion.glidecompiler}",
                okhttp         : "com.squareup.okhttp3:okhttp:${depsVersion.okhttp}",
                gson           : "com.google.code.gson:gson:${depsVersion.gson}",
    ]
}

 

 

2. 项目根build.gradle 引入

//引入根工程下的统一版本管理文件
apply from: this.rootProject.file(‘imooc.gradle‘)

 

3. 每个模块引用

    compileSdkVersion rootProject.android.compileSdkVersion

 

设置安卓构建全局环境变量

标签:roo   cti   xxx   build   ntb   indicator   项目   ica   too   

原文地址:https://www.cnblogs.com/allenxieyusheng/p/11954305.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!