@@ -116,7 +116,7 @@ class DependencyReplaceHelper(private val pluginContext: IPluginContext) {
116
116
// 获取所有的模块工程集合
117
117
val moduleProjectList = pluginContext.getModuleProjectList()
118
118
119
- // 从集合中查找到需要替换依赖的module工程, 如果currentProject==app工程 , 这里查询结果是null
119
+ // 从集合中查找到需要替换依赖的module工程, 如果 currentProject == app 工程 , 这里查询结果是null
120
120
val moduleProject = moduleProjectList.firstOrNull { it.moduleExtension.name == currentProject.path }
121
121
122
122
// 替换所有待处理的module工程依赖
@@ -129,7 +129,8 @@ class DependencyReplaceHelper(private val pluginContext: IPluginContext) {
129
129
handleReplaceDependency(configuration, dependency, currentProject)
130
130
}
131
131
}
132
- // 把下层的依赖投递到上层, 由于下层的module变成aar后会丢失它所引入的依赖,因此需要将这些依赖回传给上层
132
+
133
+ // 把下层的依赖投递到上层, 由于下层的 module 变成 aar 后会丢失它所引入的依赖,因此需要将这些依赖回传给上层
133
134
if (parent == pluginContext.getApplyProject() || (parent != null && moduleProject != null && moduleProject.cacheValid)) {
134
135
// 原始类型
135
136
DependencyUtils .copyDependencyWithPrefix(currentProject, parent, " " )
@@ -138,8 +139,8 @@ class DependencyReplaceHelper(private val pluginContext: IPluginContext) {
138
139
// release前缀类型
139
140
DependencyUtils .copyDependencyWithPrefix(currentProject, parent, " release" )
140
141
// 变体前缀
141
- val flavorName = moduleProject!! .moduleExtension.flavorName
142
- if (flavorName.isNotBlank()) {
142
+ val flavorName = moduleProject? .moduleExtension? .flavorName
143
+ if (flavorName != null && flavorName .isNotBlank() && flavorName.isNotEmpty ()) {
143
144
// api debugApi tiyaDebugApi
144
145
DependencyUtils .copyDependencyWithPrefix(currentProject, parent, flavorName)
145
146
DependencyUtils .copyDependencyWithPrefix(currentProject, parent, flavorName + " Debug" )
0 commit comments