Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
anjiemo committed Apr 8, 2024
2 parents ad11787 + 17ca985 commit c1717a1
Show file tree
Hide file tree
Showing 98 changed files with 915 additions and 786 deletions.
78 changes: 42 additions & 36 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
import org.json.JSONObject
import groovy.json.JsonSlurper

import java.security.MessageDigest

apply plugin: 'com.android.application'
apply plugin: 'io.github.wurensen.android-aspectjx'
apply from: '../common.gradle'
apply plugin: 'com.google.devtools.ksp'
apply plugin: 'dagger.hilt.android.plugin'
apply plugin: 'com.huawei.agconnect'
apply plugin: 'android.aop'

// Android 代码规范文档:https://github.com/getActivity/AndroidCodeStandard
android {

// 设置命名空间:https://developer.android.com/build/configure-app-module#set-namespace
namespace 'cn.cqautotest.sunnybeach'

// 资源目录存放指引:https://developer.android.google.cn/guide/topics/resources/providing-resources
defaultConfig {

Expand Down Expand Up @@ -120,19 +123,6 @@ android {
}
}


// AOP 配置(exclude 和 include 二选一)
// 需要进行配置,否则就会引发冲突,具体表现为:
// 第一种:编译不过去,报错:java.util.zip.ZipException:Cause: zip file is empty
// 第二种:编译能过去,但运行时报错:ClassNotFoundException: Didn't find class on path: DexPathList
aspectjx {
// 排除一些第三方库的包名(Gson、 LeakCanary 和 AOP 有冲突)
// exclude 'androidx', 'com.google', 'com.squareup', 'org.apache', 'com.alipay', 'com.taobao', 'versions.9'
// 只对以下包名做 AOP 处理
include android.defaultConfig.applicationId
}
namespace 'cn.cqautotest.sunnybeach'

applicationVariants.configureEach { variant ->
// apk 输出文件名配置
variant.outputs.configureEach { output ->
Expand Down Expand Up @@ -167,12 +157,12 @@ def printAppConfig(final variantName) {
try {
def outputDirPath = "${projectDir.path}${File.separator}$variantName"
def apkConfig = new File("$outputDirPath${File.separator}output-metadata.json").getText()
def apkConfigJson = new JSONObject(apkConfig)
def elements = apkConfigJson.optJSONArray("elements")
def outputConfig = elements.getJSONObject(0)
def outputFileName = outputConfig.optString("outputFile")
def versionName = outputConfig.optString("versionName")
def versionCode = outputConfig.optString("versionCode")
def apkConfigJson = new JsonSlurper().parseText(apkConfig)
def elements = apkConfigJson.elements
def outputConfig = elements[0]
def outputFileName = outputConfig.outputFile
def versionName = outputConfig.versionName
def versionCode = outputConfig.versionCode
def apkFile = new File(outputDirPath + File.separator + outputFileName)
def apkMd5 = generateMD5(apkFile)
println("apkConfig:===> variantName is $variantName versionName is $versionName")
Expand Down Expand Up @@ -204,33 +194,48 @@ static def generateMD5(final file) {
// api 与 implementation 的区别:https://www.jianshu.com/p/8962d6ba936e
dependencies {
def paging_version = "3.2.0"
def nav_version = "2.6.0"
def nav_version = "2.7.7"
def emoji2_version = "1.0.0-beta01"
def room_version = "2.5.2"
def work_version = "2.8.1"
def room_version = "2.6.1"
def work_version = "2.9.0"
def markwon_version = "4.6.2"
def prism_version = "2.0.0"
def qmui_arch_version = '2.0.1'
def aria_version = '3.8.16'

// 基类封装
implementation project(':library:base')
// implementation project(':library:base')
// 控件封装
implementation project(':library:widget')
// implementation project(':library:widget')
// 友盟封装
implementation project(':library:umeng')
// implementation project(':library:umeng')
// 网络封装
implementation project(':library:network')
// implementation project(':library:network')

// 友盟公共库
implementation 'com.umeng.umsdk:common:9.4.7'
implementation 'com.umeng.umsdk:asms:1.4.1'
// 友盟分享库
implementation 'com.umeng.umsdk:share-core:7.1.7'
// 友盟微信分享
implementation 'com.umeng.umsdk:share-wx:7.1.7'
// 友盟 QQ 分享
implementation 'com.umeng.umsdk:share-qq:7.1.7'

// QQ 组件:https://wiki.open.qq.com/wiki/QQ%E7%94%A8%E6%88%B7%E8%83%BD%E5%8A%9B
implementation 'com.tencent.tauth:qqopensdk:3.53.0'
// 微信组件:https://developers.weixin.qq.com/doc/oplatform/Mobile_App/Access_Guide/Android.html
implementation 'com.tencent.mm.opensdk:wechat-sdk-android-without-mta:6.7.9'

// 单元测试
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'

implementation 'androidx.core:core-ktx:1.10.1'
implementation 'androidx.activity:activity-ktx:1.7.2'
implementation 'androidx.fragment:fragment-ktx:1.6.1'
implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.6.1'
implementation 'androidx.core:core-ktx:1.12.0'
implementation 'androidx.activity:activity-ktx:1.8.2'
implementation 'androidx.fragment:fragment-ktx:1.6.2'
implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.7.0'

// Room 数据库:https://developer.android.com/jetpack/androidx/releases/room
// CodeLab:https://developer.android.com/codelabs/android-room-with-a-view-kotlin#0
Expand Down Expand Up @@ -266,11 +271,11 @@ dependencies {
// 网络请求框架:https://github.com/getActivity/EasyHttp
implementation 'com.github.getActivity:EasyHttp:10.2'
// OkHttp 框架:https://github.com/square/okhttp
compileOnly 'com.squareup.okhttp3:okhttp:4.11.0'
compileOnly 'com.squareup.okhttp3:okhttp:4.12.0'
// Android网络请求库:https://github.com/square/retrofit
implementation 'com.squareup.retrofit2:retrofit:2.9.0'
implementation 'com.squareup.retrofit2:converter-gson:2.9.0'
implementation 'com.squareup.okhttp3:logging-interceptor:4.11.0'
implementation 'com.squareup.okhttp3:logging-interceptor:4.12.0'

// Json 解析框架:https://github.com/google/gson
implementation 'com.google.code.gson:gson:2.10.1'
Expand All @@ -280,8 +285,9 @@ dependencies {
// Shape 框架:https://github.com/getActivity/ShapeView
implementation 'com.github.getActivity:ShapeView:8.5'

// AOP 插件库:https://mvnrepository.com/artifact/org.aspectj/aspectjrt
implementation 'org.aspectj:aspectjrt:1.9.19'
implementation "io.github.FlyJingFish.AndroidAop:android-aop-core:${android_aop_version}"
implementation "io.github.FlyJingFish.AndroidAop:android-aop-annotation:${android_aop_version}"
ksp "io.github.FlyJingFish.AndroidAop:android-aop-ksp:${android_aop_version}"

// 图片加载框架:https://github.com/bumptech/glide
// 官方使用文档:https://github.com/Muyangmin/glide-docs-cn
Expand Down
Binary file added app/libs/base-release.aar
Binary file not shown.
Binary file added app/libs/network-release.aar
Binary file not shown.
Binary file added app/libs/umeng-release.aar
Binary file not shown.
Binary file added app/libs/widget-release.aar
Binary file not shown.
15 changes: 0 additions & 15 deletions app/src/main/java/cn/cqautotest/sunnybeach/aop/CheckNet.kt

This file was deleted.

51 changes: 0 additions & 51 deletions app/src/main/java/cn/cqautotest/sunnybeach/aop/CheckNetAspect.kt

This file was deleted.

6 changes: 4 additions & 2 deletions app/src/main/java/cn/cqautotest/sunnybeach/aop/Log.kt
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
package cn.cqautotest.sunnybeach.aop

import com.flyjingfish.android_aop_annotation.anno.AndroidAopPointCut

/**
* author : Android 轮子哥
* github : https://github.com/getActivity/AndroidProject-Kotlin
* time : 2019/12/06
* desc : Debug 日志注解
*/
@AndroidAopPointCut(LogInterceptCut::class)
@Retention(AnnotationRetention.RUNTIME)
@Target(
AnnotationTarget.FUNCTION,
AnnotationTarget.PROPERTY_GETTER,
AnnotationTarget.PROPERTY_SETTER,
AnnotationTarget.CONSTRUCTOR
AnnotationTarget.PROPERTY_SETTER
)
annotation class Log constructor(val value: String = "AppLog")
140 changes: 0 additions & 140 deletions app/src/main/java/cn/cqautotest/sunnybeach/aop/LogAspect.kt

This file was deleted.

Loading

0 comments on commit c1717a1

Please sign in to comment.