nilupeng
2022-01-29 0c89bf11bcddd39b5193bb19e28399648c59a2b8
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
plugins {
    id 'com.android.application'
}
 
android {
    compileSdk 31
 
    defaultConfig {
        applicationId "com.runt.open.mvvm"
        minSdk 23
        targetSdk 31
        versionCode 1
        versionName "1.0"
 
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }
 
    buildTypes {
        debug{
            minifyEnabled false
            buildConfigField 'String','HOST_IP_ADDR','"http://192.168.100.82:8080/"'
            buildConfigField 'String','ENVIRONMENT','"release"'
            resValue "string", "app_name", "MVVM开源项目测试"
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
        release {
            minifyEnabled false
            buildConfigField 'String','HOST_IP_ADDR','"http://192.168.100.82:8080/"'
            buildConfigField 'String','ENVIRONMENT','"release"'
            resValue "string", "app_name", "MVVM开源项目"
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
    buildFeatures {
        viewBinding true
    }
    android.applicationVariants.all { variant ->
        variant.outputs.all {
            def viron
 
            if (buildType.name.equals('release')) {
                viron = "正式版";
            }else if (buildType.name.equals('debug')) {
                viron = "开发版";
            }
            outputFileName =  "MVVM开源项目-" + viron + "-v" +
                    defaultConfig.versionName +"-" + defaultConfig.versionCode +"-" + new Date().format("MMddHHmm", TimeZone.getTimeZone("UTC"))+
                    ".apk"
        }
    }
}
 
dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'androidx.appcompat:appcompat:1.2.0'
    implementation 'com.google.android.material:material:1.3.0'
    implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
    implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.3.1'
    implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.3.1'
    implementation 'androidx.navigation:navigation-fragment:2.3.5'
    implementation 'androidx.navigation:navigation-ui:2.3.5'
    testImplementation 'junit:junit:4.+'
    androidTestImplementation 'androidx.test.ext:junit:1.1.2'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
    //// 注意:分包之后不会有默认的Header和Footer需要手动添加!还是原来的三种方法!
    implementation  'com.scwang.smart:refresh-layout-kernel:2.0.1'      //核心必须依赖
    implementation  'com.scwang.smart:refresh-header-classics:2.0.1'    //经典刷新头
    implementation 'com.github.d-max:spots-dialog:1.1@aar'//loading view
    implementation 'com.google.code.gson:gson:2.8.6'
    implementation 'com.squareup.okhttp3:okhttp:4.9.0'
    implementation 'com.squareup.retrofit2:retrofit:2.9.0'
    implementation 'com.squareup.retrofit2:adapter-rxjava2:2.9.0'    //RXjava和retrofit结合
    implementation 'com.guolindev.permissionx:permissionx:1.6.0'    //权限依赖
    implementation 'com.github.bumptech.glide:glide:4.12.0'
    annotationProcessor 'com.github.bumptech.glide:compiler:4.12.0'
    implementation 'com.pangle.cn:ads-sdk-pro:4.0.2.2'//字节跳动  穿山甲广告
    implementation 'com.tencent.bugly:crashreport:latest.release' //其中latest.release指代最新Bugly SDK版本号,也可以指定明确的版本号,例如2.1.9
    implementation 'com.tencent.bugly:nativecrashreport:latest.release' //其中latest.release指代最新Bugly NDK版本号,也可以指定明确的版本号,例如3.0
    implementation 'com.facebook.rebound:rebound:0.3.6'//Rebound  “弹簧”动画效果的第三方工具包,由FaceBook
    implementation 'com.github.zhaolei9527:BottomMenu:v1.0.1'//底部菜单弹框
}