mac
2024-01-02 d1ebb94e1a17b7c25d4fcf73d85345d92cc86b5c
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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
plugins {
    id 'com.android.application'
}
//必须配置uni
def mfph = [
        //宿主包名
        "apk.applicationId": "com.hdl.photovoltaic",
]
 
android {
    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 30
        versionCode 1
        versionName "1.1.3"//版本规则1.1是产品功能迭代用的,最后一位1是我们修复bug用的
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
        multiDexEnabled true
        manifestPlaceholders = mfph
        ndk {
            abiFilters 'x86', 'armeabi-v7a', "arm64-v8a" //不支持armeabi
        }
 
        manifestPlaceholders = [
                JPUSH_PKGNAME: applicationId,
                //JPush 上注册的包名对应的 Appkey.
                JPUSH_APPKEY : "3baee103750e192ba68f3878",
                //暂时填写默认值即可.
                JPUSH_CHANNEL: "developer-default",
 
//                //若不集成厂商通道,可直接跳过以下配置
//                MEIZU_APPKEY : "MZ-魅族的APPKEY",
//                MEIZU_APPID : "MZ-魅族的APPID",
//                XIAOMI_APPID : "MI-小米的APPID",
//                XIAOMI_APPKEY : "MI-小米的APPKEY",
//                OPPO_APPKEY : "OP-oppo的APPKEY",
//                OPPO_APPID : "OP-oppo的APPID",
//                OPPO_APPSECRET : "OP-oppo的APPSECRET",
//                VIVO_APPKEY : "vivo的APPKEY",
//                VIVO_APPID : "vivo的APPID",
//                HONOR_APPID : "Honor的APP ID",
 
        ]
 
    }
    repositories {
        flatDir {
            dirs 'libs'
        }
    }
    //此处配置必须添加 否则无法正确运行uni
    aaptOptions {
        additionalParameters '--auto-add-overlay'
        //noCompress 'foo', 'bar'
        ignoreAssetsPattern "!.svn:!.git:.*:!CVS:!thumbs.db:!picasa.ini:!*.scc:*~"
    }
    /**
     * 打包自动命名
     */
    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
 
        }
    }
 
    buildFeatures {
        viewBinding true
    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
}
//构建时间
static def generateTime() {
    return new Date().format("yyyyMMddHHmm")
}
 
dependencies {
 
    implementation fileTree(include: ['*.jar', '*.aar'], dir: 'libs')
 
    implementation 'androidx.appcompat:appcompat:1.3.0'
    implementation 'com.google.android.material:material:1.4.0'
    implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
    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'//必须集成,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.android.support:multidex:1.0.3'
    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'
 
    // 此处以JPush 5.0.3 版本为例,注意:从 5.0.0 版本开始可以自动拉取 JCore 包,无需另外配置
    implementation 'cn.jiguang.sdk:jpush-google:5.2.2'
    //分析和用户标签等功能(可选,集成极光分析SDK后,即可支持行为触发推送消息、推送转化率统计,用户行为分)
    implementation 'cn.jiguang.sdk:joperate:2.0.2'
 
 
//    //若不集成厂商通道,可直接跳过以下依赖
//    // 极光厂商插件版本与接入 JPush 版本保持一致,下同
//    // 接入华为厂商
//    implementation 'com.huawei.hms:push:6.9.0.300'
//    implementation 'cn.jiguang.sdk.plugin:huawei:5.0.3'
//    // 接入 FCM 厂商
//    implementation 'com.google.firebase:firebase-messaging:23.1.2'
//    implementation 'cn.jiguang.sdk.plugin:fcm:5.0.3'
//    // 接入魅族厂商
//    implementation 'cn.jiguang.sdk.plugin:meizu:5.0.3'
//    // 接入 VIVO 厂商
//    implementation 'cn.jiguang.sdk.plugin:vivo:5.0.3'
//    // 接入小米厂商
//    implementation 'cn.jiguang.sdk.plugin:xiaomi:5.0.3'
//    // 接入 OPPO 厂商
//    implementation 'cn.jiguang.sdk.plugin:oppo:5.0.3'
//    // JPush Android SDK v4.6.0 开始,需要单独引入 oppo 厂商 aar ,请下载官网 SDK 包并把 jpush-android-xxx-release/third-push/oppo/libs 下的 aar 文件单独拷贝一份到应用 module/libs 下
//    implementation(name: 'com.heytap.msp-push-3.1.0', ext: 'aar')
//
//    //以下为 OPPO 3.1.0 aar需要依赖
//    implementation 'com.google.code.gson:gson:2.6.2'
//    implementation 'commons-codec:commons-codec:1.6'
//    implementation 'androidx.annotation:annotation:1.1.0'
//    // 接入荣耀厂商
//    implementation 'cn.jiguang.sdk.plugin:honor:5.0.3'
//    //需要单独引入荣耀厂商 aar ,请下载官网 SDK 包并把 jpush-android-xxx-release/third-push/honor/libs 下的 aar 文件单独拷贝一份到应用 module/libs 下
//    implementation(name: 'HiPushSdk-v7.0.41.301', ext: 'aar')
 
 
//    应用 Module 配置
//    如果选择的厂商通道包含了 Huawei 厂商通道和 FCM 厂商通道,则需要额外执行以下操作,若未选择可忽略本步骤。
//    FCM:在 Firebase 上创建和 JPush 上同包名的待发布应用,创建完成后下载该应用的 google-services.json 配置文件并添加到应用的 module 目录下。
//    Huawei:在 Huawei 上创建和 JPush 上同包名的待发布应用,创建完成后下载该应用的 agconnect-services.json 配置文件并添加到应用的 module 目录下。
 
 
}