mac
2023-12-15 8087a7d587c9bc3a448e4421bc604f3e71f181a3
app/build.gradle
@@ -1,24 +1,70 @@
plugins {
    id 'com.android.application'
}
//必须配置uni
def mfph = [
        //宿主包名
        "apk.applicationId": "com.hdl.photovoltaic",
]
android {
    compileSdk 32
    signingConfigs {
        debug {
            storeFile file('../keystore/Untitled')
            keyAlias 'photovotaic'
            storePassword '85521566'
            keyPassword '85521566'
        }
        release {
            storeFile file('../keystore/Untitled')
            keyAlias 'photovotaic'
            storePassword '85521566'
            keyPassword '85521566'
        }
    }
    compileSdk 30
    defaultConfig {
        applicationId "com.hdl.photovoltaic"
        minSdk 23
        targetSdk 32
        targetSdk 30
        versionCode 1
        versionName "1.0"
        versionName "1.1.2"//版本规则1.1是产品功能迭代用的,最后一位1是我们修复bug用的
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
        multiDexEnabled true
        manifestPlaceholders = mfph
        ndk {
            abiFilters 'x86', 'armeabi-v7a', "arm64-v8a" //不支持armeabi
        }
    }
    //此处配置必须添加 否则无法正确运行uni
    aaptOptions {
        additionalParameters '--auto-add-overlay'
        //noCompress 'foo', 'bar'
        ignoreAssetsPattern "!.svn:!.git:.*:!CVS:!thumbs.db:!picasa.ini:!*.scc:*~"
    }
    repositories {
        flatDir {
            dirs 'libs'
        }
    }
    /**
     * 打包自动命名
     */
    android.applicationVariants.configureEach { variant ->
        variant.outputs.configureEach {
            outputFileName = "photovoltaic_${name}_v${versionName}_${generateTime()}.apk"
        }
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
            signingConfig signingConfigs.release
        }
        debug {
            signingConfig signingConfigs.debug
        }
    }
@@ -29,6 +75,10 @@
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
}
//构建时间
static def generateTime() {
    return new Date().format("yyyyMMddHHmm")
}
dependencies {
@@ -41,25 +91,57 @@
    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: ':countrypicker')
    //二维码库
    implementation project(path: ':third-zxing')
    //Link本地库
    implementation project(path: ':HDLLinkLocalSdk')
//    implementation project(path: ':HDLLinkPMSdk')
    testImplementation 'junit:junit:4.13.2'
    androidTestImplementation 'androidx.test.ext:junit:1.1.3'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
//    implementation 'org.greenrobot:eventbus:3.0.0'
    implementation 'com.hdl.hdlhttp:hxhttp:1.0.4'
    //okhttp 打印
    implementation 'com.squareup.okhttp3:logging-interceptor:4.9.1'
    //Eventbus事件发布与接收
    implementation 'org.greenrobot:eventbus:3.3.1'
    //屏幕适配
    implementation 'com.github.JessYanCoding:AndroidAutoSize:v1.2.1'
    //图片加载库
    implementation 'com.github.bumptech.glide:glide:4.12.0'
    annotationProcessor 'com.github.bumptech.glide:compiler:4.12.0'
    //********UniSDK必须添加的依赖 start********
    implementation "androidx.recyclerview:recyclerview:1.0.0"
    implementation 'com.alibaba:fastjson:1.2.66'
    implementation 'com.facebook.fresco:fresco:2.5.0'
    implementation 'com.facebook.fresco:animated-gif:2.5.0'
    implementation 'com.alibaba:fastjson:1.2.66'//必须集成,fastjson功能需要
    implementation 'com.facebook.fresco:fresco:2.5.0'//必须集成,图片加载需要
    implementation 'com.facebook.fresco:animated-gif:2.5.0'//必须集成,图片加载需要
    implementation 'com.facebook.fresco:webpsupport:2.5.0'
    implementation 'com.facebook.fresco:animated-webp:2.5.0'
    implementation 'com.github.bumptech.glide:glide:4.9.0'
    implementation 'com.github.bumptech.glide:glide:4.9.0'//必须集成,图片加载需要
    implementation 'com.android.support:multidex:1.0.3'
    implementation 'androidx.webkit:webkit:1.3.0'
    implementation 'androidx.webkit:webkit:1.3.0'//3.6.15版本之后 必须集成,用来支持暗黑模式
    //********UniSDK必须添加的依赖 end********
    //NanoHTTPD搭建服务器
    implementation 'org.nanohttpd:nanohttpd:2.3.1'
    //Apache FileUtils 第三方工具类
    implementation 'commons-io:commons-io:2.11.0'
    //权限请求框架
    implementation 'com.github.getActivity:XXPermissions:12.8'
    //通用适配器
    implementation 'com.github.CymChad:BaseRecyclerViewAdapterHelper:3.0.6'
//    //极光
//    implementation 'cn.jiguang.sdk:jpush:4.6.2'  // 此处以JPush 4.6.2 版本为例。
//    implementation 'cn.jiguang.sdk:jcore:3.2.2'  // 此处以JCore 3.2.2 版本为例。
}