Skip to content

Commit 8bdb2c0

Browse files
committed
升级 Gradle 版本到 9.2
1 parent 5166e77 commit 8bdb2c0

10 files changed

Lines changed: 36 additions & 27 deletions

File tree

app/build.gradle

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,12 @@ apply from : '../common.gradle'
99

1010
// Android 代码规范文档:https://github.com/getActivity/AndroidCodeStandard
1111
android {
12+
namespace 'com.hjq.demo'
13+
14+
buildFeatures {
15+
// 是否生成 BuildConfig 类
16+
buildConfig true
17+
}
1218

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

build.gradle

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
// AndroidProject 版本:v15.0
22
plugins {
3-
id 'com.android.application' version '7.4.2' apply false
4-
id 'org.jetbrains.kotlin.android' version '1.8.22' apply false
3+
id 'com.android.application' version '8.13.2' apply false
4+
id 'com.android.library' version '8.13.2' apply false
5+
id 'org.jetbrains.kotlin.android' version '2.2.21' apply false
56
// AOP 插件:https://github.com/FlyJingFish/AndroidAOP
67
id 'io.github.flyjingfish.androidaop' version '2.7.4' apply false
78
// 多 buildType 图标插件:https://github.com/usefulness/easylauncher-gradle-plugin

common.gradle

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,10 @@ android {
3636
}
3737

3838
// 代码警告配置
39-
lintOptions {
40-
// 禁用文本硬编码警告
41-
disable 'HardcodedText'
42-
// 禁用图片描述警告
43-
disable 'ContentDescription'
39+
lint {
40+
// HardcodedText:禁用文本硬编码警告
41+
// ContentDescription:禁用图片描述警告
42+
disable 'HardcodedText', 'ContentDescription'
4443
}
4544

4645
// 读取 local.properties 文件配置
@@ -62,15 +61,7 @@ android {
6261
}
6362
}
6463

65-
afterEvaluate {
66-
// 前提条件是这个 Module 工程必须是 Library 类型,并且排除名为 umeng 的 Module 工程
67-
if (android.defaultConfig.applicationId == null && "umeng" != getName()) {
68-
// 排除 BuildConfig.class
69-
generateReleaseBuildConfig.enabled = false
70-
generatePreviewBuildConfig.enabled = false
71-
generateDebugBuildConfig.enabled = false
72-
}
73-
}
64+
7465

7566
dependencies {
7667
// 依赖 libs 目录下所有的 jar 和 aar 包

gradle.properties

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@
1212
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
1313
# org.gradle.parallel = true
1414

15-
# 为 Studio 分配默认的内存大小
15+
# Default memory allocation for Gradle JVM
1616
org.gradle.jvmargs = -Xmx3072m
1717

18-
# 表示使用 AndroidX
18+
# Enable AndroidX
1919
android.useAndroidX = true
20-
# 表示将第三方库迁移到 AndroidX
20+
# Enable Jetifier to migrate third-party libraries to AndroidX
2121
android.enableJetifier = true
2222

23-
android.aapt2Version=8.6.1-11315950
24-
android.suppressUnsupportedCompileSdk=35
23+
# Use transitive R class for backward compatibility with old code
24+
android.nonTransitiveRClass=false

gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ zipStoreBase=GRADLE_USER_HOME
22
zipStorePath=wrapper/dists
33
distributionBase=GRADLE_USER_HOME
44
distributionPath=wrapper/dists
5-
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.6-all.zip
5+
distributionUrl=https\://services.gradle.org/distributions/gradle-9.2.0-all.zip

library/base/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ plugins {
44
apply from : '../../common.gradle'
55

66
android {
7+
namespace 'com.hjq.base'
78

89
defaultConfig {
910
// 模块混淆配置

library/copy/build.gradle

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
plugins {
22
id 'com.android.library'
33
}
4-
apply from: '../../common.gradle'
4+
apply from: '../../common.gradle'
5+
6+
android {
7+
namespace 'com.hjq.copy'
8+
}

library/umeng/build.gradle

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ plugins {
44
apply from : '../../common.gradle'
55

66
android {
7+
namespace 'com.hjq.umeng'
8+
9+
buildFeatures {
10+
// 是否生成 BuildConfig 类
11+
buildConfig true
12+
}
713

814
defaultConfig {
915
// 模块混淆配置

library/widget/build.gradle

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ plugins {
33
}
44
apply from : '../../common.gradle'
55

6+
android {
7+
namespace 'com.hjq.widget'
8+
}
9+
610
dependencies {
711
// 基础库(不包任何第三方框架)
812
implementation project(':library:base')

settings.gradle

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@ pluginManagement {
1616
mavenCentral()
1717
// Google 仓库:https://maven.google.com/web/index.html
1818
google()
19-
// noinspection JcenterRepositoryObsolete
20-
jcenter()
2119
}
2220
}
2321
dependencyResolutionManagement {
@@ -36,8 +34,6 @@ dependencyResolutionManagement {
3634
mavenCentral()
3735
// Google 仓库:https://maven.google.com/web/index.html
3836
google()
39-
// noinspection JcenterRepositoryObsolete
40-
jcenter()
4137
}
4238
}
4339

0 commit comments

Comments
 (0)