Skip to content

Commit f5bc276

Browse files
committed
docs: add android-bom and update documents
1 parent f54db63 commit f5bc276

12 files changed

Lines changed: 205 additions & 22 deletions

docs-source/src/en/guide/quick-start.md

Lines changed: 23 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,17 @@ Modify the Java version of Kotlin in your project's `build.gradle.kts` to 17 or
3939

4040
> Kotlin DSL
4141
42-
```kt
42+
```kotlin
4343
android {
4444
compileOptions {
4545
sourceCompatibility = JavaVersion.VERSION_17
4646
targetCompatibility = JavaVersion.VERSION_17
4747
}
48-
kotlinOptions {
49-
jvmTarget = "17"
48+
}
49+
50+
tasks.withType<KotlinJvmCompile>().configureEach {
51+
compilerOptions {
52+
jvmTarget.set(JvmTarget.JVM_17)
5053
}
5154
}
5255
```
@@ -58,21 +61,30 @@ you can choose the modules you want to introduce as dependencies and apply them
5861

5962
You can click on the corresponding modules below to view detailed functionality introductions.
6063

64+
::: tip Version Notes
65+
66+
Starting from `1.1.0`, Android modules are released with a unified version, so in most cases you only need to care about the same major version,
67+
and you can also directly refer to [android-bom](../library/android-bom.md) below to use BOM for unified dependency version management.
68+
69+
Jetpack Compose modules currently still keep independent versions, because some modules are still in the Alpha stage and their release cadence is not forced to stay in sync with their submodules.
70+
71+
For details, please see the [changelog](../about/changelog.md).
72+
73+
:::
74+
75+
### Android
76+
77+
- [android-bom](../library/android-bom.md)
6178
- [ui-component](../library/ui-component.md)
6279
- [ui-component-adapter](../library/ui-component-adapter.md)
6380
- [ui-extension](../library/ui-extension.md)
6481
- [system-extension](../library/system-extension.md)
6582
- [permission-extension](../library/permission-extension.md)
66-
- [compose-extension](../library/compose-extension.md)
67-
- [compose-multiplatform](../library/compose-multiplatform.md)
6883

69-
## Project Template
84+
### Jetpack Compose
7085

71-
You can use the project template we provide to quickly create a project that integrates `BetterAndroid` dependencies.
72-
73-
- [android-app-template](https://github.com/BetterAndroid/android-app-template)
74-
- [android-compose-app-template](https://github.com/BetterAndroid/android-compose-app-template)
75-
- [compose-multiplatform-template](https://github.com/BetterAndroid/compose-multiplatform-template)
86+
- [compose-extension](../library/compose-extension.md)
87+
- [compose-multiplatform](../library/compose-multiplatform.md)
7688

7789
## Demo
7890

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
# android-bom
2+
3+
![Maven Central](https://img.shields.io/maven-central/v/com.highcapable.betterandroid/android-bom?logo=apachemaven&logoColor=orange&style=flat-square)
4+
<span style="margin-left: 5px"/>
5+
![Maven metadata URL](https://img.shields.io/maven-metadata/v?metadataUrl=https%3A%2F%2Fraw.githubusercontent.com%2FHighCapable%2Fmaven-repository%2Frefs%2Fheads%2Fmain%2Frepository%2Freleases%2Fcom%2Fhighcapable%2Fbetterandroid%2Fandroid-bom%2Fmaven-metadata.xml&logo=apachemaven&logoColor=orange&label=highcapable-maven-releases&style=flat-square)
6+
7+
This is the BOM dependency for unified version management of Android modules.
8+
9+
## Configure Dependency
10+
11+
You can add this module to your project using the following method.
12+
13+
### Version Catalog (Recommended)
14+
15+
Add dependency in your project's `gradle/libs.versions.toml`.
16+
17+
```toml
18+
[versions]
19+
betterandroid-android-bom = "<version>"
20+
21+
[libraries]
22+
betterandroid-android-bom = { module = "com.highcapable.betterandroid:android-bom", version.ref = "betterandroid-android-bom" }
23+
betterandroid-ui-component = { module = "com.highcapable.betterandroid:ui-component" }
24+
betterandroid-ui-component-adapter = { module = "com.highcapable.betterandroid:ui-component-adapter" }
25+
betterandroid-ui-extension = { module = "com.highcapable.betterandroid:ui-extension" }
26+
betterandroid-system-extension = { module = "com.highcapable.betterandroid:system-extension" }
27+
```
28+
29+
Configure dependency in your project's `build.gradle.kts`.
30+
31+
```kotlin
32+
implementation(platform(libs.betterandroid.android.bom))
33+
34+
implementation(libs.betterandroid.ui.component)
35+
implementation(libs.betterandroid.ui.component.adapter)
36+
implementation(libs.betterandroid.ui.extension)
37+
implementation(libs.betterandroid.system.extension)
38+
```
39+
40+
Please change `<version>` to the version displayed at the top of this document.
41+
42+
### Traditional Method
43+
44+
Configure dependency in your project's `build.gradle.kts`.
45+
46+
```kotlin
47+
implementation(platform("com.highcapable.betterandroid:android-bom:<version>"))
48+
49+
implementation("com.highcapable.betterandroid:ui-component")
50+
implementation("com.highcapable.betterandroid:ui-component-adapter")
51+
implementation("com.highcapable.betterandroid:ui-extension")
52+
implementation("com.highcapable.betterandroid:system-extension")
53+
```
54+
55+
Please change `<version>` to the version displayed at the top of this document.
56+
57+
## Function Introduction
58+
59+
`android-bom` does not contain actual code itself. It only serves as the BOM of Android modules for unified dependency version management.
60+
61+
It currently manages the versions of the following modules:
62+
63+
- [ui-component](./ui-component.md)
64+
- [ui-component-adapter](./ui-component-adapter.md)
65+
- [ui-extension](./ui-extension.md)
66+
- [system-extension](./system-extension.md)
67+
68+
::: tip
69+
70+
Jetpack Compose related modules are not included in this BOM, and they currently still keep independent version.
71+
72+
:::

docs-source/src/en/library/system-extension.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ This is a dependency for system layer related extensions.
1212

1313
You can add this module to your project using the following method.
1414

15+
If you are using multiple Android modules at the same time, we recommend that you first refer to [android-bom](./android-bom.md) to use BOM for unified version management.
16+
1517
### Version Catalog (Recommended)
1618

1719
Add dependency in your project's `gradle/libs.versions.toml`.

docs-source/src/en/library/ui-component-adapter.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ This is a dependency for UI (user interface) adapter components.
1212

1313
You can add this module to your project using the following method.
1414

15+
If you are using multiple Android modules at the same time, we recommend that you first refer to [android-bom](./android-bom.md) to use BOM for unified version management.
16+
1517
### Version Catalog (Recommended)
1618

1719
Add dependency in your project's `gradle/libs.versions.toml`.

docs-source/src/en/library/ui-component.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ This is a dependency for UI (user interface) related components.
1212

1313
You can add this module to your project using the following method.
1414

15+
If you are using multiple Android modules at the same time, we recommend that you first refer to [android-bom](./android-bom.md) to use BOM for unified version management.
16+
1517
### Version Catalog (Recommended)
1618

1719
Add dependency in your project's `gradle/libs.versions.toml`.

docs-source/src/en/library/ui-extension.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ This is a dependency for UI (user interface) related extensions.
1212

1313
You can add this module to your project using the following method.
1414

15+
If you are using multiple Android modules at the same time, we recommend that you first refer to [android-bom](./android-bom.md) to use BOM for unified version management.
16+
1517
### Version Catalog (Recommended)
1618

1719
Add dependency in your project's `gradle/libs.versions.toml`.

docs-source/src/zh-cn/guide/quick-start.md

Lines changed: 22 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,17 @@ repositories {
3636

3737
在你的项目 `build.gradle.kts` 中修改 Kotlin 的 Java 版本为 17 及以上。
3838

39-
```kt
39+
```kotlin
4040
android {
4141
compileOptions {
4242
sourceCompatibility = JavaVersion.VERSION_17
4343
targetCompatibility = JavaVersion.VERSION_17
4444
}
45-
kotlinOptions {
46-
jvmTarget = "17"
45+
}
46+
47+
tasks.withType<KotlinJvmCompile>().configureEach {
48+
compilerOptions {
49+
jvmTarget.set(JvmTarget.JVM_17)
4750
}
4851
}
4952
```
@@ -54,21 +57,29 @@ android {
5457

5558
你可以点击下方对应的模块前往查看详细的功能介绍。
5659

60+
::: tip 版本说明
61+
62+
Android 子模块从 `1.1.0` 起开始采用统一版本进行发布,通常情况下你只需要关注同一个主版本即可,你也可以直接参考下方的 [android-bom](../library/android-bom.md) 使用 BOM 统一管理依赖版本。
63+
64+
Jetpack Compose 子模块目前仍保持独立版本,这是因为部分模块仍处于 Alpha 阶段,版本节奏不会强制与其子模块保持一致。
65+
66+
详情请见 [更新日志](../about/changelog.md)
67+
68+
:::
69+
70+
### Android
71+
72+
- [android-bom](../library/android-bom.md)
5773
- [ui-component](../library/ui-component.md)
5874
- [ui-component-adapter](../library/ui-component-adapter.md)
5975
- [ui-extension](../library/ui-extension.md)
6076
- [system-extension](../library/system-extension.md)
6177
- [permission-extension](../library/permission-extension.md)
62-
- [compose-extension](../library/compose-extension.md)
63-
- [compose-multiplatform](../library/compose-multiplatform.md)
6478

65-
## 项目模版
79+
### Jetpack Compose
6680

67-
你可以使用我们提供的项目模版来快速创建一个集成了 `BetterAndroid` 依赖的项目。
68-
69-
- [android-app-template](https://github.com/BetterAndroid/android-app-template)
70-
- [android-compose-app-template](https://github.com/BetterAndroid/android-compose-app-template)
71-
- [compose-multiplatform-template](https://github.com/BetterAndroid/compose-multiplatform-template)
81+
- [compose-extension](../library/compose-extension.md)
82+
- [compose-multiplatform](../library/compose-multiplatform.md)
7283

7384
## Demo
7485

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
# android-bom
2+
3+
![Maven Central](https://img.shields.io/maven-central/v/com.highcapable.betterandroid/android-bom?logo=apachemaven&logoColor=orange&style=flat-square)
4+
<span style="margin-left: 5px"/>
5+
![Maven metadata URL](https://img.shields.io/maven-metadata/v?metadataUrl=https%3A%2F%2Fraw.githubusercontent.com%2FHighCapable%2Fmaven-repository%2Frefs%2Fheads%2Fmain%2Frepository%2Freleases%2Fcom%2Fhighcapable%2Fbetterandroid%2Fandroid-bom%2Fmaven-metadata.xml&logo=apachemaven&logoColor=orange&label=highcapable-maven-releases&style=flat-square)
6+
7+
这是针对 Android 子模块统一版本管理的 BOM 依赖。
8+
9+
## 配置依赖
10+
11+
你可以使用如下方式将此模块添加到你的项目中。
12+
13+
### Version Catalog (推荐)
14+
15+
在你的项目 `gradle/libs.versions.toml` 中添加依赖。
16+
17+
```toml
18+
[versions]
19+
betterandroid-android-bom = "<version>"
20+
21+
[libraries]
22+
betterandroid-android-bom = { module = "com.highcapable.betterandroid:android-bom", version.ref = "betterandroid-android-bom" }
23+
betterandroid-ui-component = { module = "com.highcapable.betterandroid:ui-component" }
24+
betterandroid-ui-component-adapter = { module = "com.highcapable.betterandroid:ui-component-adapter" }
25+
betterandroid-ui-extension = { module = "com.highcapable.betterandroid:ui-extension" }
26+
betterandroid-system-extension = { module = "com.highcapable.betterandroid:system-extension" }
27+
```
28+
29+
在你的项目 `build.gradle.kts` 中配置依赖。
30+
31+
```kotlin
32+
implementation(platform(libs.betterandroid.android.bom))
33+
34+
implementation(libs.betterandroid.ui.component)
35+
implementation(libs.betterandroid.ui.component.adapter)
36+
implementation(libs.betterandroid.ui.extension)
37+
implementation(libs.betterandroid.system.extension)
38+
```
39+
40+
请将 `<version>` 修改为此文档顶部显示的版本。
41+
42+
### 传统方式
43+
44+
在你的项目 `build.gradle.kts` 中配置依赖。
45+
46+
```kotlin
47+
implementation(platform("com.highcapable.betterandroid:android-bom:<version>"))
48+
49+
implementation("com.highcapable.betterandroid:ui-component")
50+
implementation("com.highcapable.betterandroid:ui-component-adapter")
51+
implementation("com.highcapable.betterandroid:ui-extension")
52+
implementation("com.highcapable.betterandroid:system-extension")
53+
```
54+
55+
请将 `<version>` 修改为此文档顶部显示的版本。
56+
57+
## 功能介绍
58+
59+
`android-bom` 本身不包含实际代码,它仅作为 Android 子模块的 BOM 用于统一管理依赖版本。
60+
61+
目前它会管理以下模块的版本:
62+
63+
- [ui-component](./ui-component.md)
64+
- [ui-component-adapter](./ui-component-adapter.md)
65+
- [ui-extension](./ui-extension.md)
66+
- [system-extension](./system-extension.md)
67+
68+
::: tip
69+
70+
Jetpack Compose 相关模块不包含在此 BOM 中,它们目前仍保持独立版本。
71+
72+
:::

docs-source/src/zh-cn/library/system-extension.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212

1313
你可以使用如下方式将此模块添加到你的项目中。
1414

15+
如果你正在同时使用多个 Android 子模块,我们推荐你优先参考 [android-bom](./android-bom.md) 使用 BOM 统一管理版本。
16+
1517
### Version Catalog (推荐)
1618

1719
在你的项目 `gradle/libs.versions.toml` 中添加依赖。

docs-source/src/zh-cn/library/ui-component-adapter.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212

1313
你可以使用如下方式将此模块添加到你的项目中。
1414

15+
如果你正在同时使用多个 Android 子模块,我们推荐你优先参考 [android-bom](./android-bom.md) 使用 BOM 统一管理版本。
16+
1517
### Version Catalog (推荐)
1618

1719
在你的项目 `gradle/libs.versions.toml` 中添加依赖。

0 commit comments

Comments
 (0)