mirror of
https://github.com/HighCapable/SweetDependency.git
synced 2025-09-05 18:25:48 +08:00
Compare commits
19 Commits
Author | SHA1 | Date | |
---|---|---|---|
f92dcfa446
|
|||
222ea51ac7
|
|||
2e298071d3
|
|||
87928e9af6
|
|||
fb5727fec7
|
|||
6627e99564
|
|||
7fe824bab5
|
|||
46683cfb2e
|
|||
586499c4f4
|
|||
78527bb302
|
|||
f767fb6694
|
|||
f2949d9039
|
|||
43c7c35309
|
|||
4e18f9f011
|
|||
15282cb16d
|
|||
afe30a9ec1
|
|||
800d97dace
|
|||
9209be3ea0
|
|||
fab9eee279
|
@@ -64,6 +64,12 @@
|
||||
|
||||
本项目同样使用了 **SweetProperty**。
|
||||
|
||||
## 捐赠支持
|
||||
|
||||
工作不易,无意外情况此项目将继续维护下去,提供更多可能,欢迎打赏。
|
||||
|
||||
<img src="https://github.com/fankes/fankes/blob/main/img-src/payment_code.jpg?raw=true" width = "500" alt="Payment Code"/>
|
||||
|
||||
## Star History
|
||||
|
||||

|
||||
|
@@ -9,4 +9,14 @@
|
||||
- 使用 `net.lingala.zip4j` 取代 JDK 默认创建压缩文档功能修复在 Windows 平台中 Gradle 8.0.2+ 版本创建的 JAR 损坏导致找不到生成的 Class 问题
|
||||
- 重构自动生成代码部分的装载功能,增加可能找不到 Class 的错误提示
|
||||
- 新增在设置了未定义版本的插件依赖条件下直接运行自动装配相关 Gradle Task 将抛出异常
|
||||
- 修复可能的旧版本 Gradle 在使用 `repositories` 的 `content` 功能会抛出异常
|
||||
- 修复可能的旧版本 Gradle 在使用 `repositories` 的 `content` 功能会抛出异常
|
||||
|
||||
## 1.0.2 | 2023.09.26
|
||||
|
||||
- 自动生成代码功能将始终输出源码文件,以方便在生成失败的时候进行调试
|
||||
- 修复部分连续名称的依赖可能导致生成失败的问题
|
||||
- 修复插件自身检查更新功能失效
|
||||
- 修复 Gradle 生命周期问题,可能导致 `autowire` 方法的项目作用域不正确
|
||||
- 改进并采用 Gradle 项目命名规范
|
||||
- 新增依赖命名空间可启用或禁用生成功能,更新后需要参考文档自行迁移部分配置文件的节点名称否则会发生错误
|
||||
- 新增使用 `<plugins>::` 或 `<libraries>::` 可以访问其它节点的依赖名称、别名并设置到 `version-ref` 功能
|
@@ -11,4 +11,15 @@
|
||||
- Refactor the loading function of the automatically generated code part, and add an error message that classes may not be found
|
||||
- Added an exception will be thrown when running the autowire related Gradle task directly
|
||||
under the condition of setting an undefined version of plugins
|
||||
- Fix possible old version of Gradle throwing exception when using `content` function of `repositories`
|
||||
- Fix possible old version of Gradle throwing exception when using `content` function of `repositories`
|
||||
|
||||
## 1.0.2 | 2023.09.26
|
||||
|
||||
- The automatic code generation function will always output source code files to facilitate debugging when the generation fails
|
||||
- Fix dependencies with some consecutive names may cause generation failure
|
||||
- Fix plugin own update function
|
||||
- Fix Gradle lifecycle problem that may cause the project scope of the `autowire` method to be incorrect
|
||||
- Improve and adopt Gradle project naming convention
|
||||
- Added dependencies namespace to enable or disable the generation function, after the update, you need to refer to the documentation to migrate the
|
||||
node names of some configuration files yourself, otherwise errors will occur
|
||||
- Added the function of using `<plugins>::` or `<libraries>::` to access the dependencies name and alias of other nodes and set them to `version-ref`
|
@@ -2,7 +2,7 @@
|
||||
|
||||
在开始使用之前,建议你仔细阅读此文档,以便你能更好地了解它的作用方式与功能。
|
||||
|
||||
你可以在项目的根目录找到 examples 中的 Demo,并参考此文档食用效果更佳。
|
||||
你可以在项目的根目录找到 samples 中的 Demo,并参考此文档食用效果更佳。
|
||||
|
||||
## 工作原理
|
||||
|
||||
@@ -157,11 +157,19 @@ preferences:
|
||||
# 没有命名空间:implementation(com.mydemo.test.test)
|
||||
# 存在命名空间:implementation(libs.com.mydemo.test.test)
|
||||
dependencies-namespace:
|
||||
# 插件依赖必须存在命名空间,如果不设置,其默认为 "libs"
|
||||
plugins: libs
|
||||
# 库依赖的命名空间可选
|
||||
# 如果你不需要库依赖的命名空间,请删除此节点
|
||||
libraries: libs
|
||||
plugins:
|
||||
# 如果你希望关闭自动生成,可以设置为 false
|
||||
# 在决定关闭时请确保构建脚本中已不存在自动生成的代码,防止发生错误
|
||||
enable: true
|
||||
# 插件依赖必须存在命名空间,如果不设置,其默认为 "libs"
|
||||
name: libs
|
||||
libraries:
|
||||
# 如果你希望关闭自动生成,可以设置为 false
|
||||
# 在决定关闭时请确保构建脚本中已不存在自动生成的代码,防止发生错误
|
||||
enable: true
|
||||
# 库依赖的命名空间可选
|
||||
# 如果你不需要库依赖的命名空间,请删除此节点
|
||||
name: libs
|
||||
# 依赖版本过滤器
|
||||
# 如果你需要排除一些不希望被更新到的依赖版本 (例如测试版本) 可以手动进行配置
|
||||
# 默认情况下过滤器已帮你自动排除测试版本,无需对此项进行配置
|
||||
@@ -338,6 +346,9 @@ plugins:
|
||||
org.jetbrains.kotlin.android:
|
||||
alias: kotlin-android
|
||||
version: 1.8.10
|
||||
com.google.devtools.ksp:
|
||||
alias: kotlin-ksp
|
||||
version: 1.8.10-1.0.9
|
||||
|
||||
# 配置需要使用的库依赖
|
||||
libraries:
|
||||
@@ -381,6 +392,12 @@ libraries:
|
||||
# 注意:如果你声明了 "version-ref",此依赖将在自动装配和更新中被排除
|
||||
# 注意:如果你声明了 "version-ref","auto-update"、"repositories"、"version-filter" 将无效
|
||||
version-ref: <this>::core # 或 "androidx.core:core" 以及 "androidx-core" (别名)
|
||||
com.google.devtools.ksp:
|
||||
symbol-processing-api:
|
||||
# 如果你想引用一个不属于当前作用域 ("libraries") 的依赖或别名,你需要声明其所属的作用域
|
||||
# 例如引用 "plugins" 作用域中的依赖别名 "kotlin-ksp",你需要使用 "<plugins>::" 作为开头进行声明
|
||||
# 同理,在 "plugins" 作用域中需要使用 "<libraries>::" 作为开头进行声明
|
||||
version-ref: <plugins>::kotlin-ksp # 或 "<plugins>::com.google.devtools.ksp"
|
||||
com.squareup.okhttp3:
|
||||
okhttp:
|
||||
# 如果你在版本中声明了一个 "version-filter" 中存在的版本 (内置过滤器或排除列表)
|
||||
|
@@ -2,7 +2,7 @@
|
||||
|
||||
Before you start using it, it is recommended that you read this document carefully so that you can better understand how it works and its functions.
|
||||
|
||||
You can find the demo in examples in the root directory of the project, and refer to this document for better use.
|
||||
You can find the demo in samples in the root directory of the project, and refer to this document for better use.
|
||||
|
||||
## Working Principle
|
||||
|
||||
@@ -166,11 +166,21 @@ preferences:
|
||||
# No namespace: implementation(com.mydemo.test.test)
|
||||
# Has namespace: implementation(libs.com.mydemo.test.test)
|
||||
dependencies-namespace:
|
||||
# Plugin dependencies namespace must exist, if not set, the default is "libs"
|
||||
plugins: libs
|
||||
# Library dependencies namespace is optional
|
||||
# If you don't need the namespace of library dependencies, delete this node
|
||||
plugins:
|
||||
# If you want to turn off automatic generation, you can set it to false
|
||||
# Note: When deciding to close,
|
||||
# make sure that there is no automatically generated code in the build script to prevent errors
|
||||
enable: true
|
||||
# Plugin dependencies namespace must exist, if not set, the default is "libs"
|
||||
name: libs
|
||||
libraries: libs
|
||||
# If you want to turn off automatic generation, you can set it to false
|
||||
# Note: When deciding to close,
|
||||
# make sure that there is no automatically generated code in the build script to prevent errors
|
||||
enable: true
|
||||
# Library dependencies namespace is optional
|
||||
# If you don't need the namespace of library dependencies, delete this node
|
||||
name: libs
|
||||
# Dependencies version filter
|
||||
# If you need to exclude some dependency versions that you don't want to be updated to (such as test versions),
|
||||
# you can configure them manually
|
||||
@@ -358,6 +368,9 @@ plugins:
|
||||
org.jetbrains.kotlin.android:
|
||||
alias: kotlin-android
|
||||
version: 1.8.10
|
||||
com.google.devtools.ksp:
|
||||
alias: kotlin-ksp
|
||||
version: 1.8.10-1.0.9
|
||||
|
||||
# Configure libraries that need to be used
|
||||
libraries:
|
||||
@@ -406,6 +419,14 @@ libraries:
|
||||
# Note: If you declare "version-ref", this dependency will be excluded from autowiring and updating
|
||||
# Note: If you declare "version-ref", "auto-update", "repositories", "version-filter" will not work
|
||||
version-ref: <this>::core # Or "androidx.core:core" and "androidx-core" (alias)
|
||||
com.google.devtools.ksp:
|
||||
symbol-processing-api:
|
||||
# If you want to reference a dependency or alias that does not belong to the current scope ("libraries"),
|
||||
# you need to declare the scope it belongs to
|
||||
# For example, to reference the dependency alias "kotlin-ksp" in the "plugins" scope,
|
||||
# you need to use "<plugins>::" as the beginning of the declaration
|
||||
# Similarly, you need to use "<libraries>::" as the beginning of the declaration in the "plugins" scope
|
||||
version-ref: <plugins>::kotlin-ksp # Or "<plugins>::com.google.devtools.ksp"
|
||||
com.squareup.okhttp3:
|
||||
okhttp:
|
||||
# If you declare a version in the version that exists in "version-filter" (internal filter or exclude list)
|
||||
|
@@ -1,13 +1,13 @@
|
||||
# Project Configuration
|
||||
project.name=SweetDependency
|
||||
project.description=An easy autowire and manage dependencies Gradle plugin
|
||||
project.description=An easy autowire and manage dependencies Gradle plugin.
|
||||
project.url=https://github.com/HighCapable/SweetDependency
|
||||
project.groupName=com.highcapable.sweetdependency
|
||||
project.moduleName=sweet-dependency
|
||||
project.version=1.0.1
|
||||
project.version=1.0.2
|
||||
project.licence.name=Apache License 2.0
|
||||
project.licence.url=https://github.com/HighCapable/SweetDependency/blob/master/LICENSE
|
||||
project.developer.id=0
|
||||
project.developer.id="0"
|
||||
project.developer.name=fankes
|
||||
project.developer.email=qzmmcn@163.com
|
||||
# Gradle Plugin Configuration
|
||||
|
@@ -1,4 +1,3 @@
|
||||
enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS")
|
||||
pluginManagement {
|
||||
repositories {
|
||||
gradlePluginPortal()
|
||||
@@ -8,8 +7,8 @@ pluginManagement {
|
||||
}
|
||||
}
|
||||
plugins {
|
||||
id("com.highcapable.sweetdependency") version "1.0.1"
|
||||
id("com.highcapable.sweetproperty") version "1.0.2"
|
||||
id("com.highcapable.sweetdependency") version "1.0.2"
|
||||
id("com.highcapable.sweetproperty") version "1.0.3"
|
||||
}
|
||||
sweetDependency {
|
||||
isEnableVerboseMode = false
|
||||
@@ -21,10 +20,7 @@ sweetProperty {
|
||||
isEnableRestrictedAccess = true
|
||||
}
|
||||
}
|
||||
rootProject { sourcesCode { isEnable = false } }
|
||||
project("sweetdependency-gradle-plugin") {
|
||||
buildScript { isEnableTypeAutoConversion = false }
|
||||
}
|
||||
rootProject { all { isEnable = false } }
|
||||
}
|
||||
rootProject.name = "SweetDependency"
|
||||
include(":sweetdependency-gradle-plugin")
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SweetDependency - An easy autowire and manage dependencies Gradle plugin
|
||||
* SweetDependency - An easy autowire and manage dependencies Gradle plugin.
|
||||
* Copyright (C) 2019-2023 HighCapable
|
||||
* https://github.com/HighCapable/SweetDependency
|
||||
*
|
||||
@@ -17,7 +17,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* This file is Created by fankes on 2023/5/17.
|
||||
* This file is created by fankes on 2023/5/17.
|
||||
*/
|
||||
package com.highcapable.sweetdependency
|
||||
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SweetDependency - An easy autowire and manage dependencies Gradle plugin
|
||||
* SweetDependency - An easy autowire and manage dependencies Gradle plugin.
|
||||
* Copyright (C) 2019-2023 HighCapable
|
||||
* https://github.com/HighCapable/SweetDependency
|
||||
*
|
||||
@@ -17,7 +17,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* This file is Created by fankes on 2023/5/18.
|
||||
* This file is created by fankes on 2023/5/18.
|
||||
*/
|
||||
@file:Suppress("unused")
|
||||
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SweetDependency - An easy autowire and manage dependencies Gradle plugin
|
||||
* SweetDependency - An easy autowire and manage dependencies Gradle plugin.
|
||||
* Copyright (C) 2019-2023 HighCapable
|
||||
* https://github.com/HighCapable/SweetDependency
|
||||
*
|
||||
@@ -17,7 +17,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* This file is Created by fankes on 2023/5/17.
|
||||
* This file is created by fankes on 2023/5/17.
|
||||
*/
|
||||
package com.highcapable.sweetdependency.document
|
||||
|
||||
@@ -48,30 +48,43 @@ internal data class PreferencesDocument(
|
||||
internal var versionFilter: VersionFilterDocument = VersionFilterDocument()
|
||||
) : IYamlDocument {
|
||||
|
||||
/**
|
||||
* 依赖命名空间文档实体
|
||||
* @param plugins 插件依赖
|
||||
* @param libraries 库依赖
|
||||
*/
|
||||
@Serializable
|
||||
internal data class DependenciesNamespaceDocument(
|
||||
@SerialName("plugins")
|
||||
var plugins: String = "libs",
|
||||
var plugins: NamespaceOptionDocument = NamespaceOptionDocument(name = "libs"),
|
||||
@SerialName("libraries")
|
||||
var libraries: String = ""
|
||||
var libraries: NamespaceOptionDocument = NamespaceOptionDocument()
|
||||
) : IYamlDocument {
|
||||
|
||||
init {
|
||||
if (plugins.isNotBlank() && libraries.isNotBlank() && plugins == libraries)
|
||||
if (plugins.name.isNotBlank() && libraries.name.isNotBlank() && plugins.name == libraries.name)
|
||||
SError.make("Duplicated dependencies namespace \"$plugins\"")
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 命名空间选项文档实体
|
||||
* @param isEnable 是否启用
|
||||
* @param name 名称
|
||||
*/
|
||||
@Serializable
|
||||
internal data class NamespaceOptionDocument(
|
||||
@SerialName("enable")
|
||||
var isEnable: Boolean = true,
|
||||
@SerialName("name")
|
||||
var name: String = ""
|
||||
) : IYamlDocument {
|
||||
|
||||
/**
|
||||
* 获取插件依赖命名空间
|
||||
* 获取名称
|
||||
* @return [String]
|
||||
*/
|
||||
internal fun plugins() = plugins.apply { checkingName("plugins namespace", isCheckExtName = true) }.camelcase()
|
||||
|
||||
/**
|
||||
* 获取库依赖命名空间
|
||||
* @return [String]
|
||||
*/
|
||||
internal fun libraries() = libraries.apply { checkingName("libraries namespace", isCheckExtName = true) }.camelcase()
|
||||
internal fun name() = name.apply { checkingName("dependencies namespace", isCheckExtName = true) }.camelcase()
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SweetDependency - An easy autowire and manage dependencies Gradle plugin
|
||||
* SweetDependency - An easy autowire and manage dependencies Gradle plugin.
|
||||
* Copyright (C) 2019-2023 HighCapable
|
||||
* https://github.com/HighCapable/SweetDependency
|
||||
*
|
||||
@@ -17,7 +17,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* This file is Created by fankes on 2023/5/17.
|
||||
* This file is created by fankes on 2023/5/17.
|
||||
*/
|
||||
package com.highcapable.sweetdependency.document
|
||||
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SweetDependency - An easy autowire and manage dependencies Gradle plugin
|
||||
* SweetDependency - An easy autowire and manage dependencies Gradle plugin.
|
||||
* Copyright (C) 2019-2023 HighCapable
|
||||
* https://github.com/HighCapable/SweetDependency
|
||||
*
|
||||
@@ -17,7 +17,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* This file is Created by fankes on 2023/5/17.
|
||||
* This file is created by fankes on 2023/5/17.
|
||||
*/
|
||||
@file:Suppress("MemberVisibilityCanBePrivate")
|
||||
|
||||
@@ -29,7 +29,6 @@ import com.highcapable.sweetdependency.document.factory.RepositoryList
|
||||
import com.highcapable.sweetdependency.document.factory.checkingName
|
||||
import com.highcapable.sweetdependency.document.factory.convertToDependencyAmbiguousName
|
||||
import com.highcapable.sweetdependency.gradle.entity.DependencyName
|
||||
import com.highcapable.sweetdependency.gradle.entity.DependencyVersion
|
||||
import com.highcapable.sweetdependency.utils.capitalize
|
||||
import com.highcapable.sweetdependency.utils.debug.SError
|
||||
import com.highcapable.sweetdependency.utils.findDuplicates
|
||||
@@ -141,26 +140,33 @@ internal data class RootConfigDocument(
|
||||
* @param duplicate 允许重复 - 忽略处理后版本重复的异常 - 默认否
|
||||
* @return [DependencyMap]
|
||||
*/
|
||||
internal fun plugins(duplicate: Boolean = false) = createPlugins().resolveDependencies(typeName = "plugin", duplicate)
|
||||
internal fun plugins(duplicate: Boolean = false) = resolveDependencies(typeName = "plugin", duplicate)
|
||||
|
||||
/**
|
||||
* 获取当前库依赖数组
|
||||
* @param duplicate 允许重复 - 忽略处理后版本重复的异常 - 默认否
|
||||
* @return [DependencyMap]
|
||||
*/
|
||||
internal fun libraries(duplicate: Boolean = false) = createLibraries().resolveDependencies(typeName = "library", duplicate)
|
||||
internal fun libraries(duplicate: Boolean = false) = resolveDependencies(typeName = "library", duplicate)
|
||||
|
||||
/**
|
||||
* 处理依赖数组
|
||||
* @param typeName 依赖类型名称
|
||||
* @param duplicate 允许重复 - 忽略处理后版本重复的异常 - 默认否
|
||||
* @return [DependencyMap]
|
||||
*/
|
||||
private fun DependencyMap.resolveDependencies(typeName: String, duplicate: Boolean = false) = apply {
|
||||
private fun resolveDependencies(typeName: String, duplicate: Boolean = false): DependencyMap {
|
||||
val plugins = createPlugins()
|
||||
val libraries = createLibraries()
|
||||
val currentDependencies = when (typeName) {
|
||||
"plugin" -> plugins
|
||||
"library" -> libraries
|
||||
else -> SError.make("Unknown dependency type \"$typeName\"")
|
||||
}
|
||||
val firstTypeName = typeName.capitalize()
|
||||
val checkDuplicateAlias = mutableMapOf<String, String>()
|
||||
val refLibraries = mutableListOf<Triple<DependencyName, String, DependencyVersion>>()
|
||||
val ambiguousNames = mutableListOf<String>()
|
||||
eachDependencies { dependencyName, artifact ->
|
||||
currentDependencies.eachDependencies { dependencyName, artifact ->
|
||||
artifact.alias.checkingName("$typeName \"$dependencyName\" alias", isCheckMultiName = true)
|
||||
artifact.versions().forEach { (name, _) -> name.checkingName("$typeName \"$dependencyName\" version alias") }
|
||||
if (artifact.alias.isNotBlank())
|
||||
@@ -177,27 +183,46 @@ internal data class RootConfigDocument(
|
||||
)
|
||||
if (artifact.versionRef.isNotBlank() && artifact.versionRef.startsWith("<this>::"))
|
||||
artifact.versionRef = artifact.versionRef.replace("<this>:", dependencyName.groupId)
|
||||
refLibraries.add(Triple(dependencyName, artifact.alias, artifact.version()))
|
||||
}
|
||||
eachDependencies { dependencyName, artifact ->
|
||||
currentDependencies.eachDependencies { dependencyName, artifact ->
|
||||
/** 处理版本引用 */
|
||||
fun resolveVersionRef() {
|
||||
refLibraries.firstOrNull { artifact.versionRef.let { e -> e == it.first.current || e == it.second } }?.also {
|
||||
if (dependencyName == it.first || dependencyName.current == it.second)
|
||||
var scopeName = typeName
|
||||
val versionRef = artifact.versionRef.replace("<plugins>::", "").replace("<libraries>::", "")
|
||||
when {
|
||||
artifact.versionRef.startsWith("<plugins>::") -> {
|
||||
scopeName = "plugins"
|
||||
plugins
|
||||
}
|
||||
artifact.versionRef.startsWith("<libraries>::") -> {
|
||||
scopeName = "libraries"
|
||||
libraries
|
||||
}
|
||||
else -> {
|
||||
scopeName = when (typeName) {
|
||||
"plugin" -> "plugins"
|
||||
"library" -> "libraries"
|
||||
else -> "unknown"
|
||||
}; currentDependencies
|
||||
}
|
||||
}.filter { (dependencyName, artifact) ->
|
||||
versionRef.let { it == dependencyName.current || it == artifact.alias }
|
||||
}.entries.firstOrNull()?.also { (resolveDependencyName, resolveArtifact) ->
|
||||
if (dependencyName == resolveDependencyName || dependencyName.current == resolveArtifact.alias)
|
||||
SError.make("$firstTypeName \"$dependencyName\" declared \"version-ref\" from itself (recursive call found)")
|
||||
when {
|
||||
it.third.isNoSpecific -> SError.make(
|
||||
"$firstTypeName \"${it.first}\" does not specify a version, so it can no longer be " +
|
||||
resolveArtifact.version().isNoSpecific -> SError.make(
|
||||
"$firstTypeName \"$resolveDependencyName\" does not specify a version, so it can no longer be " +
|
||||
"declared as \"version-ref\" by $typeName \"$dependencyName\""
|
||||
)
|
||||
it.third.isBlank -> SError.make(
|
||||
"$firstTypeName \"${it.first}\" already has \"version-ref\" declared, so it can no longer" +
|
||||
resolveArtifact.version().isBlank -> SError.make(
|
||||
"$firstTypeName \"$resolveDependencyName\" already has \"version-ref\" declared, so it can no longer" +
|
||||
" be declared as \"version-ref\" by $typeName \"$dependencyName\" (recursive call found)"
|
||||
)
|
||||
}; artifact.updateVersion(it.third)
|
||||
}; artifact.updateVersion(resolveArtifact.version())
|
||||
} ?: SError.make(
|
||||
"Could not found any versions or dependencies associated with " +
|
||||
"version-ref \"${artifact.versionRef}\" of $typeName \"$dependencyName\""
|
||||
"Could not found any versions or $scopeName associated with " +
|
||||
"version-ref \"$versionRef\" of $typeName \"$dependencyName\""
|
||||
)
|
||||
}
|
||||
if (artifact.version().isNoSpecific) return@eachDependencies
|
||||
@@ -208,16 +233,17 @@ internal data class RootConfigDocument(
|
||||
else if (artifact.version().isBlank.not() && artifact.versionRef.isNotBlank() && duplicate.not())
|
||||
SError.make("$firstTypeName \"$dependencyName\" can only have one \"version\" or \"version-ref\" node, please delete one")
|
||||
}
|
||||
eachDependencies { dependencyName, artifact ->
|
||||
currentDependencies.eachDependencies { dependencyName, artifact ->
|
||||
ambiguousNames.add(dependencyName.ambiguousName())
|
||||
if (artifact.alias.isNotBlank()) {
|
||||
artifact.alias.checkingName("$typeName \"$dependencyName\" alias", isCheckMultiName = true)
|
||||
ambiguousNames.add(artifact.alias.convertToDependencyAmbiguousName())
|
||||
}; this[dependencyName] = artifact
|
||||
}; currentDependencies[dependencyName] = artifact
|
||||
}
|
||||
if (ambiguousNames.hasDuplicate()) ambiguousNames.findDuplicates().forEach {
|
||||
SError.make("Found ambiguous name \"$it\" in declared dependencies, please checking your $typeName aliases that your declared")
|
||||
} else ambiguousNames.clear()
|
||||
return currentDependencies
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SweetDependency - An easy autowire and manage dependencies Gradle plugin
|
||||
* SweetDependency - An easy autowire and manage dependencies Gradle plugin.
|
||||
* Copyright (C) 2019-2023 HighCapable
|
||||
* https://github.com/HighCapable/SweetDependency
|
||||
*
|
||||
@@ -17,7 +17,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* This file is Created by fankes on 2023/6/9.
|
||||
* This file is created by fankes on 2023/6/9.
|
||||
*/
|
||||
package com.highcapable.sweetdependency.document
|
||||
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SweetDependency - An easy autowire and manage dependencies Gradle plugin
|
||||
* SweetDependency - An easy autowire and manage dependencies Gradle plugin.
|
||||
* Copyright (C) 2019-2023 HighCapable
|
||||
* https://github.com/HighCapable/SweetDependency
|
||||
*
|
||||
@@ -17,7 +17,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* This file is Created by fankes on 2023/5/31.
|
||||
* This file is created by fankes on 2023/5/31.
|
||||
*/
|
||||
package com.highcapable.sweetdependency.document.factory
|
||||
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SweetDependency - An easy autowire and manage dependencies Gradle plugin
|
||||
* SweetDependency - An easy autowire and manage dependencies Gradle plugin.
|
||||
* Copyright (C) 2019-2023 HighCapable
|
||||
* https://github.com/HighCapable/SweetDependency
|
||||
*
|
||||
@@ -17,7 +17,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* This file is Created by fankes on 2023/6/1.
|
||||
* This file is created by fankes on 2023/6/1.
|
||||
*/
|
||||
package com.highcapable.sweetdependency.document.mapping
|
||||
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SweetDependency - An easy autowire and manage dependencies Gradle plugin
|
||||
* SweetDependency - An easy autowire and manage dependencies Gradle plugin.
|
||||
* Copyright (C) 2019-2023 HighCapable
|
||||
* https://github.com/HighCapable/SweetDependency
|
||||
*
|
||||
@@ -17,7 +17,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* This file is Created by fankes on 2023/6/1.
|
||||
* This file is created by fankes on 2023/6/1.
|
||||
*/
|
||||
package com.highcapable.sweetdependency.document.mapping.entity
|
||||
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SweetDependency - An easy autowire and manage dependencies Gradle plugin
|
||||
* SweetDependency - An easy autowire and manage dependencies Gradle plugin.
|
||||
* Copyright (C) 2019-2023 HighCapable
|
||||
* https://github.com/HighCapable/SweetDependency
|
||||
*
|
||||
@@ -17,7 +17,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* This file is Created by fankes on 2023/6/28.
|
||||
* This file is created by fankes on 2023/6/28.
|
||||
*/
|
||||
package com.highcapable.sweetdependency.environment
|
||||
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SweetDependency - An easy autowire and manage dependencies Gradle plugin
|
||||
* SweetDependency - An easy autowire and manage dependencies Gradle plugin.
|
||||
* Copyright (C) 2019-2023 HighCapable
|
||||
* https://github.com/HighCapable/SweetDependency
|
||||
*
|
||||
@@ -17,7 +17,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* This file is Created by fankes on 2023/5/31.
|
||||
* This file is created by fankes on 2023/5/31.
|
||||
*/
|
||||
package com.highcapable.sweetdependency.exception
|
||||
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SweetDependency - An easy autowire and manage dependencies Gradle plugin
|
||||
* SweetDependency - An easy autowire and manage dependencies Gradle plugin.
|
||||
* Copyright (C) 2019-2023 HighCapable
|
||||
* https://github.com/HighCapable/SweetDependency
|
||||
*
|
||||
@@ -17,7 +17,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* This file is Created by fankes on 2023/5/26.
|
||||
* This file is created by fankes on 2023/5/26.
|
||||
*/
|
||||
package com.highcapable.sweetdependency.gradle.delegate
|
||||
|
||||
@@ -47,10 +47,10 @@ internal object GradleDelegate {
|
||||
callOnSettingsLoaded(settings)
|
||||
settings.gradle.settingsEvaluated { callOnSettingsEvaluate(settings = this) }
|
||||
settings.gradle.projectsLoaded {
|
||||
callOnProjectLoaded(rootProject, isRoot = true)
|
||||
rootProject.beforeEvaluate { callOnProjectLoaded(project = this, isRoot = true) }
|
||||
rootProject.afterEvaluate { callOnProjectEvaluate(project = this, isRoot = true) }
|
||||
rootProject.subprojects.forEach {
|
||||
callOnProjectLoaded(it, isRoot = false)
|
||||
it.beforeEvaluate { callOnProjectLoaded(project = this, isRoot = false) }
|
||||
it.afterEvaluate { callOnProjectEvaluate(project = this, isRoot = false) }
|
||||
}
|
||||
}
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SweetDependency - An easy autowire and manage dependencies Gradle plugin
|
||||
* SweetDependency - An easy autowire and manage dependencies Gradle plugin.
|
||||
* Copyright (C) 2019-2023 HighCapable
|
||||
* https://github.com/HighCapable/SweetDependency
|
||||
*
|
||||
@@ -17,7 +17,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* This file is Created by fankes on 2023/5/29.
|
||||
* This file is created by fankes on 2023/5/29.
|
||||
*/
|
||||
package com.highcapable.sweetdependency.gradle.delegate
|
||||
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SweetDependency - An easy autowire and manage dependencies Gradle plugin
|
||||
* SweetDependency - An easy autowire and manage dependencies Gradle plugin.
|
||||
* Copyright (C) 2019-2023 HighCapable
|
||||
* https://github.com/HighCapable/SweetDependency
|
||||
*
|
||||
@@ -17,7 +17,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* This file is Created by fankes on 2023/6/25.
|
||||
* This file is created by fankes on 2023/6/25.
|
||||
*/
|
||||
@file:Suppress("USELESS_ELVIS", "KotlinRedundantDiagnosticSuppress")
|
||||
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SweetDependency - An easy autowire and manage dependencies Gradle plugin
|
||||
* SweetDependency - An easy autowire and manage dependencies Gradle plugin.
|
||||
* Copyright (C) 2019-2023 HighCapable
|
||||
* https://github.com/HighCapable/SweetDependency
|
||||
*
|
||||
@@ -17,7 +17,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* This file is Created by fankes on 2023/8/16.
|
||||
* This file is created by fankes on 2023/8/16.
|
||||
*/
|
||||
@file:Suppress("unused", "MemberVisibilityCanBePrivate")
|
||||
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SweetDependency - An easy autowire and manage dependencies Gradle plugin
|
||||
* SweetDependency - An easy autowire and manage dependencies Gradle plugin.
|
||||
* Copyright (C) 2019-2023 HighCapable
|
||||
* https://github.com/HighCapable/SweetDependency
|
||||
*
|
||||
@@ -17,7 +17,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* This file is Created by fankes on 2023/8/18.
|
||||
* This file is created by fankes on 2023/8/18.
|
||||
*/
|
||||
package com.highcapable.sweetdependency.gradle.entity
|
||||
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SweetDependency - An easy autowire and manage dependencies Gradle plugin
|
||||
* SweetDependency - An easy autowire and manage dependencies Gradle plugin.
|
||||
* Copyright (C) 2019-2023 HighCapable
|
||||
* https://github.com/HighCapable/SweetDependency
|
||||
*
|
||||
@@ -17,7 +17,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* This file is Created by fankes on 2023/6/16.
|
||||
* This file is created by fankes on 2023/6/16.
|
||||
*/
|
||||
@file:Suppress("MemberVisibilityCanBePrivate")
|
||||
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SweetDependency - An easy autowire and manage dependencies Gradle plugin
|
||||
* SweetDependency - An easy autowire and manage dependencies Gradle plugin.
|
||||
* Copyright (C) 2019-2023 HighCapable
|
||||
* https://github.com/HighCapable/SweetDependency
|
||||
*
|
||||
@@ -17,7 +17,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* This file is Created by fankes on 2023/6/23.
|
||||
* This file is created by fankes on 2023/6/23.
|
||||
*/
|
||||
package com.highcapable.sweetdependency.gradle.entity
|
||||
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SweetDependency - An easy autowire and manage dependencies Gradle plugin
|
||||
* SweetDependency - An easy autowire and manage dependencies Gradle plugin.
|
||||
* Copyright (C) 2019-2023 HighCapable
|
||||
* https://github.com/HighCapable/SweetDependency
|
||||
*
|
||||
@@ -17,7 +17,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* This file is Created by fankes on 2023/5/27.
|
||||
* This file is created by fankes on 2023/5/27.
|
||||
*/
|
||||
@file:Suppress("unused", "USELESS_CAST", "KotlinRedundantDiagnosticSuppress")
|
||||
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SweetDependency - An easy autowire and manage dependencies Gradle plugin
|
||||
* SweetDependency - An easy autowire and manage dependencies Gradle plugin.
|
||||
* Copyright (C) 2019-2023 HighCapable
|
||||
* https://github.com/HighCapable/SweetDependency
|
||||
*
|
||||
@@ -17,7 +17,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* This file is Created by fankes on 2023/6/2.
|
||||
* This file is created by fankes on 2023/6/2.
|
||||
*/
|
||||
@file:Suppress("USELESS_ELVIS", "KotlinRedundantDiagnosticSuppress", "UselessCallOnNotNull")
|
||||
|
||||
@@ -49,23 +49,23 @@ import org.gradle.plugin.use.PluginDependency
|
||||
|
||||
/**
|
||||
* 获取指定项目的完整名称
|
||||
* @param isUseColon 是否在子项目前使用冒号 - 默认是
|
||||
* @return [String]
|
||||
*/
|
||||
internal val Project.fullName
|
||||
get(): String {
|
||||
val baseNames = mutableListOf<String>()
|
||||
internal fun Project.fullName(isUseColon: Boolean = true): String {
|
||||
val isRoot = this == rootProject
|
||||
val baseNames = mutableListOf<String>()
|
||||
|
||||
/**
|
||||
* 递归子项目
|
||||
* @param project 当前项目
|
||||
*/
|
||||
fun fetchChild(project: Project) {
|
||||
project.parent?.also { if (it != it.rootProject) fetchChild(it) }
|
||||
baseNames.add(project.name)
|
||||
}
|
||||
fetchChild(project = this)
|
||||
return buildString { baseNames.onEach { append(":$it") }.clear() }.drop(1)
|
||||
}
|
||||
/**
|
||||
* 递归子项目
|
||||
* @param project 当前项目
|
||||
*/
|
||||
fun fetchChild(project: Project) {
|
||||
project.parent?.also { if (it != it.rootProject) fetchChild(it) }
|
||||
baseNames.add(project.name)
|
||||
}; fetchChild(project = this)
|
||||
return buildString { baseNames.onEach { append(":$it") }.clear() }.let { if (isUseColon && isRoot.not()) it else it.drop(1) }
|
||||
}
|
||||
|
||||
/**
|
||||
* 向构建脚本添加自定义依赖
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SweetDependency - An easy autowire and manage dependencies Gradle plugin
|
||||
* SweetDependency - An easy autowire and manage dependencies Gradle plugin.
|
||||
* Copyright (C) 2019-2023 HighCapable
|
||||
* https://github.com/HighCapable/SweetDependency
|
||||
*
|
||||
@@ -17,7 +17,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* This file is Created by fankes on 2023/5/19.
|
||||
* This file is created by fankes on 2023/5/19.
|
||||
*/
|
||||
@file:Suppress("MemberVisibilityCanBePrivate")
|
||||
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SweetDependency - An easy autowire and manage dependencies Gradle plugin
|
||||
* SweetDependency - An easy autowire and manage dependencies Gradle plugin.
|
||||
* Copyright (C) 2019-2023 HighCapable
|
||||
* https://github.com/HighCapable/SweetDependency
|
||||
*
|
||||
@@ -17,7 +17,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* This file is Created by fankes on 2023/5/26.
|
||||
* This file is created by fankes on 2023/5/26.
|
||||
*/
|
||||
package com.highcapable.sweetdependency.gradle.proxy
|
||||
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SweetDependency - An easy autowire and manage dependencies Gradle plugin
|
||||
* SweetDependency - An easy autowire and manage dependencies Gradle plugin.
|
||||
* Copyright (C) 2019-2023 HighCapable
|
||||
* https://github.com/HighCapable/SweetDependency
|
||||
*
|
||||
@@ -17,7 +17,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* This file is Created by fankes on 2023/5/28.
|
||||
* This file is created by fankes on 2023/5/28.
|
||||
*/
|
||||
@file:Suppress("USELESS_ELVIS", "KotlinRedundantDiagnosticSuppress")
|
||||
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SweetDependency - An easy autowire and manage dependencies Gradle plugin
|
||||
* SweetDependency - An easy autowire and manage dependencies Gradle plugin.
|
||||
* Copyright (C) 2019-2023 HighCapable
|
||||
* https://github.com/HighCapable/SweetDependency
|
||||
*
|
||||
@@ -17,7 +17,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* This file is Created by fankes on 2023/8/17.
|
||||
* This file is created by fankes on 2023/8/17.
|
||||
*/
|
||||
package com.highcapable.sweetdependency.gradle.wrapper
|
||||
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SweetDependency - An easy autowire and manage dependencies Gradle plugin
|
||||
* SweetDependency - An easy autowire and manage dependencies Gradle plugin.
|
||||
* Copyright (C) 2019-2023 HighCapable
|
||||
* https://github.com/HighCapable/SweetDependency
|
||||
*
|
||||
@@ -17,7 +17,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* This file is Created by fankes on 2023/6/10.
|
||||
* This file is created by fankes on 2023/6/10.
|
||||
*/
|
||||
package com.highcapable.sweetdependency.gradle.wrapper.type
|
||||
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SweetDependency - An easy autowire and manage dependencies Gradle plugin
|
||||
* SweetDependency - An easy autowire and manage dependencies Gradle plugin.
|
||||
* Copyright (C) 2019-2023 HighCapable
|
||||
* https://github.com/HighCapable/SweetDependency
|
||||
*
|
||||
@@ -17,7 +17,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* This file is Created by fankes on 2023/5/16.
|
||||
* This file is created by fankes on 2023/5/16.
|
||||
*/
|
||||
package com.highcapable.sweetdependency.manager
|
||||
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SweetDependency - An easy autowire and manage dependencies Gradle plugin
|
||||
* SweetDependency - An easy autowire and manage dependencies Gradle plugin.
|
||||
* Copyright (C) 2019-2023 HighCapable
|
||||
* https://github.com/HighCapable/SweetDependency
|
||||
*
|
||||
@@ -17,7 +17,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* This file is Created by fankes on 2023/6/29.
|
||||
* This file is created by fankes on 2023/6/29.
|
||||
*/
|
||||
@file:Suppress("MemberVisibilityCanBePrivate")
|
||||
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SweetDependency - An easy autowire and manage dependencies Gradle plugin
|
||||
* SweetDependency - An easy autowire and manage dependencies Gradle plugin.
|
||||
* Copyright (C) 2019-2023 HighCapable
|
||||
* https://github.com/HighCapable/SweetDependency
|
||||
*
|
||||
@@ -17,7 +17,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* This file is Created by fankes on 2023/6/6.
|
||||
* This file is created by fankes on 2023/6/6.
|
||||
*/
|
||||
package com.highcapable.sweetdependency.manager
|
||||
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SweetDependency - An easy autowire and manage dependencies Gradle plugin
|
||||
* SweetDependency - An easy autowire and manage dependencies Gradle plugin.
|
||||
* Copyright (C) 2019-2023 HighCapable
|
||||
* https://github.com/HighCapable/SweetDependency
|
||||
*
|
||||
@@ -17,7 +17,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* This file is Created by fankes on 2023/5/16.
|
||||
* This file is created by fankes on 2023/5/16.
|
||||
*/
|
||||
package com.highcapable.sweetdependency.manager.const
|
||||
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SweetDependency - An easy autowire and manage dependencies Gradle plugin
|
||||
* SweetDependency - An easy autowire and manage dependencies Gradle plugin.
|
||||
* Copyright (C) 2019-2023 HighCapable
|
||||
* https://github.com/HighCapable/SweetDependency
|
||||
*
|
||||
@@ -17,7 +17,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* This file is Created by fankes on 2023/5/18.
|
||||
* This file is created by fankes on 2023/5/18.
|
||||
*/
|
||||
package com.highcapable.sweetdependency.manager.const
|
||||
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SweetDependency - An easy autowire and manage dependencies Gradle plugin
|
||||
* SweetDependency - An easy autowire and manage dependencies Gradle plugin.
|
||||
* Copyright (C) 2019-2023 HighCapable
|
||||
* https://github.com/HighCapable/SweetDependency
|
||||
*
|
||||
@@ -17,7 +17,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* This file is Created by fankes on 2023/6/25.
|
||||
* This file is created by fankes on 2023/6/25.
|
||||
*/
|
||||
@file:Suppress("unused", "MemberVisibilityCanBePrivate")
|
||||
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SweetDependency - An easy autowire and manage dependencies Gradle plugin
|
||||
* SweetDependency - An easy autowire and manage dependencies Gradle plugin.
|
||||
* Copyright (C) 2019-2023 HighCapable
|
||||
* https://github.com/HighCapable/SweetDependency
|
||||
*
|
||||
@@ -17,7 +17,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* This file is Created by fankes on 2023/5/16.
|
||||
* This file is created by fankes on 2023/5/16.
|
||||
*/
|
||||
package com.highcapable.sweetdependency.manager.content
|
||||
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SweetDependency - An easy autowire and manage dependencies Gradle plugin
|
||||
* SweetDependency - An easy autowire and manage dependencies Gradle plugin.
|
||||
* Copyright (C) 2019-2023 HighCapable
|
||||
* https://github.com/HighCapable/SweetDependency
|
||||
*
|
||||
@@ -17,7 +17,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* This file is Created by fankes on 2023/5/21.
|
||||
* This file is created by fankes on 2023/5/21.
|
||||
*/
|
||||
package com.highcapable.sweetdependency.manager.helper
|
||||
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SweetDependency - An easy autowire and manage dependencies Gradle plugin
|
||||
* SweetDependency - An easy autowire and manage dependencies Gradle plugin.
|
||||
* Copyright (C) 2019-2023 HighCapable
|
||||
* https://github.com/HighCapable/SweetDependency
|
||||
*
|
||||
@@ -17,7 +17,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* This file is Created by fankes on 2023/6/13.
|
||||
* This file is created by fankes on 2023/6/13.
|
||||
*/
|
||||
package com.highcapable.sweetdependency.manager.helper
|
||||
|
||||
@@ -76,9 +76,9 @@ internal object DependencyDeployHelper {
|
||||
* @param settings 当前设置
|
||||
*/
|
||||
internal fun generateVersionCatalogs(settings: Settings) {
|
||||
val pluginsNamespace = SweetDependencyConfigs.document.preferences().dependenciesNamespace.plugins()
|
||||
runCatching {
|
||||
settings.dependencyResolutionManagement.versionCatalogs.create(pluginsNamespace) {
|
||||
val pluginsOption = SweetDependencyConfigs.document.preferences().dependenciesNamespace.plugins
|
||||
if (pluginsOption.isEnable) runCatching {
|
||||
settings.dependencyResolutionManagement.versionCatalogs.create(pluginsOption.name()) {
|
||||
Dependencies.plugins().forEach { (dependencyName, artifact) ->
|
||||
if (GradleTaskManager.isInternalRunningTask && artifact.version().isAutowire) SError.make(
|
||||
"""
|
||||
@@ -140,8 +140,14 @@ internal object DependencyDeployHelper {
|
||||
* @param rootProject 当前根项目
|
||||
*/
|
||||
internal fun resolveAccessors(rootProject: Project) {
|
||||
val librariesOption = SweetDependencyConfigs.document.preferences().dependenciesNamespace.libraries
|
||||
if (librariesOption.isEnable.not()) {
|
||||
accessorsPomData.relativePomPath.toFile().takeIf { it.exists() }?.deleteRecursively()
|
||||
accessorsGenerator.clearGeneratedData()
|
||||
return
|
||||
}
|
||||
if (Dependencies.isOutdate || accessorsDir.resolve(accessorsPomData.relativePomPath).isEmpty())
|
||||
accessorsGenerator.build().compile(accessorsPomData, accessorsDir.absolutePath, accessorsGenerator.compileStubFiles)
|
||||
accessorsGenerator.build(librariesOption.name()).compile(accessorsPomData, accessorsDir.absolutePath, accessorsGenerator.compileStubFiles)
|
||||
rootProject.addDependencyToBuildScript(accessorsDir.absolutePath, accessorsPomData)
|
||||
}
|
||||
|
||||
@@ -185,7 +191,7 @@ internal object DependencyDeployHelper {
|
||||
}
|
||||
|
||||
/**
|
||||
* 处理自动装配的依赖
|
||||
* 处理自动装配的库依赖
|
||||
* @param project 当前项目 - 默认为 [ProjectTransaction.current]
|
||||
* @param params 当前参数数组
|
||||
* @return [Any]
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SweetDependency - An easy autowire and manage dependencies Gradle plugin
|
||||
* SweetDependency - An easy autowire and manage dependencies Gradle plugin.
|
||||
* Copyright (C) 2019-2023 HighCapable
|
||||
* https://github.com/HighCapable/SweetDependency
|
||||
*
|
||||
@@ -17,7 +17,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* This file is Created by fankes on 2023/6/6.
|
||||
* This file is created by fankes on 2023/6/6.
|
||||
*/
|
||||
package com.highcapable.sweetdependency.manager.maven
|
||||
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SweetDependency - An easy autowire and manage dependencies Gradle plugin
|
||||
* SweetDependency - An easy autowire and manage dependencies Gradle plugin.
|
||||
* Copyright (C) 2019-2023 HighCapable
|
||||
* https://github.com/HighCapable/SweetDependency
|
||||
*
|
||||
@@ -17,7 +17,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* This file is Created by fankes on 2023/6/6.
|
||||
* This file is created by fankes on 2023/6/6.
|
||||
*/
|
||||
package com.highcapable.sweetdependency.manager.maven.entity
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user