每当创建一个项目时应先把config.gradle建立起来
1.在根目下创建一个config.gradle文件
2.把内容填上
3.在build.gradle里面引用config.gradle
4.在模块中可以使用config.gradle里面的变量
1.在根目下创建一个config.gradle文件
2.config.gradle把内容填上
ext {
android = [
applicationId : "com.example.imooc_voice",
compileSdkVersion: 28,
minSdkVersion : 19,
targetSdkVersion : 28,
versionCode : 1,
versionName : "1.0",
multiDexEnabled : true
]
depsVersion = [
appcompat : '28.0.0',
design : '28.0.0',
recyclerview : '28.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 = [
//android兼容包
appcompat : "com.android.support:appcompat-v7:${depsVersion.appcompat}",
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}",
//ViewPager指示器
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}",
]
}
网友评论