mirror of
https://github.com/HighCapable/SweetDependency.git
synced 2025-09-05 10:15:44 +08:00
docs: update guide
This commit is contained in:
@@ -31,6 +31,9 @@
|
|||||||
|
|
||||||
如果你的项目依然在使用 `buildscript` 的方式进行管理,请迁移到新方式,否则会发生错误。
|
如果你的项目依然在使用 `buildscript` 的方式进行管理,请迁移到新方式,否则会发生错误。
|
||||||
|
|
||||||
|
如果你的项目不能使用 `dependencyResolutionManagement` 进行管理,你可以参考此页面最下方的 [自定义选项](#自定义选项)
|
||||||
|
通过配置 `isUseDependencyResolutionManagement = false` 来使用传统的库依赖管理方式。
|
||||||
|
|
||||||
## 快速开始
|
## 快速开始
|
||||||
|
|
||||||
首先,打开你根项目的 `settings.gradle` 或 `settings.gradle.kts`。
|
首先,打开你根项目的 `settings.gradle` 或 `settings.gradle.kts`。
|
||||||
@@ -1149,6 +1152,11 @@ sweetDependency {
|
|||||||
// SweetDependency 配置文件名称
|
// SweetDependency 配置文件名称
|
||||||
configFileName = "sweet-dependency-config.yaml"
|
configFileName = "sweet-dependency-config.yaml"
|
||||||
|
|
||||||
|
// 是否使用 Settings.dependencyResolutionManagement 管理库依赖
|
||||||
|
// 此功能默认启用,如果你的项目必须存在自定义的 "repositories" 方法块,请关闭此功能
|
||||||
|
// 注意:关闭后配置文件中的 "repositories-mode" 选项将不再有效
|
||||||
|
isUseDependencyResolutionManagement = true
|
||||||
|
|
||||||
// 是否启用依赖自动装配日志
|
// 是否启用依赖自动装配日志
|
||||||
// 此功能默认启用,会在当前根项目 (Root Project) 的 ".gradle/sweet-dependency" 目录下创建日志文件
|
// 此功能默认启用,会在当前根项目 (Root Project) 的 ".gradle/sweet-dependency" 目录下创建日志文件
|
||||||
isEnableDependenciesAutowireLog = true
|
isEnableDependenciesAutowireLog = true
|
||||||
@@ -1165,6 +1173,7 @@ sweetDependency {
|
|||||||
sweetDependency {
|
sweetDependency {
|
||||||
enable true
|
enable true
|
||||||
configFileName 'sweet-dependency-config.yaml'
|
configFileName 'sweet-dependency-config.yaml'
|
||||||
|
useDependencyResolutionManagement true
|
||||||
enableDependenciesAutowireLog true
|
enableDependenciesAutowireLog true
|
||||||
enableVerboseMode true
|
enableVerboseMode true
|
||||||
}
|
}
|
||||||
|
@@ -32,6 +32,10 @@ Note that `SweetDependency` supports at least Gradle `7.x.x` and is managed usin
|
|||||||
|
|
||||||
If your project is still managed using the `buildscript` method, please migrate to the new method, otherwise errors will occur.
|
If your project is still managed using the `buildscript` method, please migrate to the new method, otherwise errors will occur.
|
||||||
|
|
||||||
|
If your project cannot be managed using `dependencyResolutionManagement`, you can refer to the [Custom Preferences](#custom-preferences)
|
||||||
|
at the bottom of this page,
|
||||||
|
use traditional library dependency management by configuring `isUseDependencyResolutionManagement = false`.
|
||||||
|
|
||||||
## Quick Start
|
## Quick Start
|
||||||
|
|
||||||
First, open `settings.gradle` or `settings.gradle.kts` of your root project.
|
First, open `settings.gradle` or `settings.gradle.kts` of your root project.
|
||||||
@@ -1219,6 +1223,12 @@ sweetDependency {
|
|||||||
// SweetDependency configuration file name
|
// SweetDependency configuration file name
|
||||||
configFileName = "sweet-dependency-config.yaml"
|
configFileName = "sweet-dependency-config.yaml"
|
||||||
|
|
||||||
|
// Whether to use Settings.dependencyResolutionManagement to manage library dependencies
|
||||||
|
// This function is enabled by default,
|
||||||
|
// if your project must have a custom "repositories" method block, please disable this function
|
||||||
|
// Note: The "repositories-mode" option in the configuration file will no longer be effective after disabled
|
||||||
|
isUseDependencyResolutionManagement = true
|
||||||
|
|
||||||
// Whether to enable dependency autowiring logging
|
// Whether to enable dependency autowiring logging
|
||||||
// This function is enabled by default and will create a log file in the ".gradle/sweet-dependency" directory of the current root project
|
// This function is enabled by default and will create a log file in the ".gradle/sweet-dependency" directory of the current root project
|
||||||
isEnableDependenciesAutowireLog = true
|
isEnableDependenciesAutowireLog = true
|
||||||
@@ -1236,6 +1246,7 @@ sweetDependency {
|
|||||||
sweetDependency {
|
sweetDependency {
|
||||||
enable true
|
enable true
|
||||||
configFileName 'sweet-dependency-config.yaml'
|
configFileName 'sweet-dependency-config.yaml'
|
||||||
|
useDependencyResolutionManagement true
|
||||||
enableDependenciesAutowireLog true
|
enableDependenciesAutowireLog true
|
||||||
enableVerboseMode true
|
enableVerboseMode true
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user