mac
2024-10-28 4449e3420c355a712323f3e507d0b14c395f43d9
app/build.gradle
@@ -24,18 +24,18 @@
            keyPassword '85521566'
        }
    }
    compileSdk 30
    compileSdkVersion 34
    defaultConfig {
        applicationId "com.hdl.photovoltaic"
        minSdk 23
        targetSdk 30
        minSdkVersion 23
        targetSdkVersion 34
        versionCode 1
        versionName "1.3.2"//版本规则1.3是产品功能迭代用的,最后一位0是我们修复bug用的
        versionName "1.4.3"//版本规则1.3是产品功能迭代用的,最后一位0是我们修复bug用的
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
        multiDexEnabled true
        manifestPlaceholders = mfph
        ndk {
            abiFilters 'x86', 'armeabi-v7a', "arm64-v8a" //不支持armeabi
            abiFilters 'armeabi-v7a', "arm64-v8a" //不支持armeabi
        }
        manifestPlaceholders = [
@@ -62,6 +62,10 @@
        ]
    }
    // 保证其他的lib没有被preDex
    dexOptions {
        preDexLibraries = false
    }
    repositories {
        flatDir {
            dirs 'libs'
@@ -73,12 +77,20 @@
        //noCompress 'foo', 'bar'
        ignoreAssetsPattern "!.svn:!.git:.*:!CVS:!thumbs.db:!picasa.ini:!*.scc:*~"
    }
//    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
//    }
    /**
     * 打包自动命名
     */
    android.applicationVariants.configureEach { variant ->
        variant.outputs.configureEach {
            outputFileName = "photovoltaic_${name}_v${versionName}_${generateTime()}.apk"
            outputFileName = "photovoltaic_v${versionName}_${generateTime()}_${getEnvironmentVersion(2)}.apk"
        }
    }
@@ -107,6 +119,20 @@
    return new Date().format("yyyyMMddHHmm")
}
//环境版本号:此版本号用于标注当前版本的软件处于哪个开发阶段,当软件进入到另一个阶段时需要修改此版本号。
static String getEnvironmentVersion(int environmentVersionValue) {
    if (environmentVersionValue == 1) {
        return "dev"//开发阶段版本。(一般不向外部发布,bug会比较多,功能也不全,一般只有开发人员使用。)
    } else if (environmentVersionValue == 2) {
        return "test"//测试阶段版本。(这个阶段版本会配合测试人员修复bug,直到满足发布条件。)
    } else if (environmentVersionValue == 3) {
        return "beta"//公测阶段版本。(公开测试版本,一般是内测通过的,主要会有"粉丝用户"使用体验。)
    } else if (environmentVersionValue == 4) {
        return "release"
//发布阶段版本。(该版本意味"最终版本",在前面版本的一系列测试版之后,终归会有一个正式版本,是最终交付用户使用的一个版本。该版本有时也称为标准版。一般情况下,Release不会以单词形式出现在软件封面上。)
    }
}
dependencies {
    implementation fileTree(include: ['*.jar', '*.aar'], dir: 'libs')
@@ -117,14 +143,17 @@
    implementation 'androidx.navigation:navigation-fragment:2.3.5'
    implementation 'androidx.navigation:navigation-ui:2.3.5'
    implementation 'androidx.legacy:legacy-support-v4:1.0.0'
    //时间库
    implementation project(path: ':pickerview')
    //图表库
    implementation project(path: ':aa_chart_core')
    //国家列表和手机区号库
    implementation project(path: ':countrypicker')
    //二维码库
    implementation project(path: ':third-zxing')
    //Link本地库(在线依赖网络库)
    implementation 'com.hdl.android:pmsdk:1.0.2'
    implementation 'com.hdl.android:debugsdk:1.0.16'
    implementation 'com.hdl.android:pmsdk:1.0.9'
    implementation 'com.hdl.android:debugsdk:1.0.52'
    testImplementation 'junit:junit:4.13.2'
    androidTestImplementation 'androidx.test.ext:junit:1.1.3'
@@ -136,8 +165,9 @@
    //Eventbus事件发布与接收
    implementation 'org.greenrobot:eventbus:3.3.1'
    //屏幕适配
    //屏幕适配库
    implementation 'com.github.JessYanCoding:AndroidAutoSize:v1.2.1'
    //图片加载库
    implementation 'com.github.bumptech.glide:glide:4.13.0'
@@ -172,11 +202,6 @@
    implementation 'cn.jiguang.sdk:jpush-google:5.2.2'
    //分析和用户标签等功能(可选,集成极光分析SDK后,即可支持行为触发推送消息、推送转化率统计,用户行为分)
    implementation 'cn.jiguang.sdk:joperate:2.0.2'
    //PickerView
    implementation 'com.contrarywind:Android-PickerView:4.1.9'
    //若不集成厂商通道,可直接跳过以下依赖