[Gradle] IdeaKotlinProjectArtifactDependencyMatcher: Migrate to 'BuildIdentifier.getBuildPath'
^KT-58157 In Progress
This commit is contained in:
committed by
Space Team
parent
fc359acb37
commit
33a61c62ba
+2
-2
@@ -13,7 +13,7 @@ import java.io.File
|
|||||||
|
|
||||||
internal class IdeaKotlinProjectArtifactDependencyMatcher(
|
internal class IdeaKotlinProjectArtifactDependencyMatcher(
|
||||||
val type: IdeaKotlinSourceDependency.Type,
|
val type: IdeaKotlinSourceDependency.Type,
|
||||||
val buildId: String,
|
val buildPath: String,
|
||||||
val projectPath: String,
|
val projectPath: String,
|
||||||
val artifactFilePath: FilePathRegex
|
val artifactFilePath: FilePathRegex
|
||||||
) : IdeaKotlinDependencyMatcher {
|
) : IdeaKotlinDependencyMatcher {
|
||||||
@@ -23,7 +23,7 @@ internal class IdeaKotlinProjectArtifactDependencyMatcher(
|
|||||||
override fun matches(dependency: IdeaKotlinDependency): Boolean {
|
override fun matches(dependency: IdeaKotlinDependency): Boolean {
|
||||||
if (dependency !is IdeaKotlinProjectArtifactDependency) return false
|
if (dependency !is IdeaKotlinProjectArtifactDependency) return false
|
||||||
return dependency.type == type &&
|
return dependency.type == type &&
|
||||||
dependency.coordinates.buildId == buildId &&
|
dependency.coordinates.buildPath == buildPath &&
|
||||||
dependency.coordinates.projectPath == projectPath &&
|
dependency.coordinates.projectPath == projectPath &&
|
||||||
dependency.artifactsClasspath.any { artifactFilePath.matches(it) }
|
dependency.artifactsClasspath.any { artifactFilePath.matches(it) }
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -51,12 +51,12 @@ fun projectArtifactDependency(
|
|||||||
buildIdAndProjectPath: String, artifactFilePath: FilePathRegex
|
buildIdAndProjectPath: String, artifactFilePath: FilePathRegex
|
||||||
): IdeaKotlinDependencyMatcher {
|
): IdeaKotlinDependencyMatcher {
|
||||||
val slicedProjectPath = buildIdAndProjectPath.split("::", limit = 2)
|
val slicedProjectPath = buildIdAndProjectPath.split("::", limit = 2)
|
||||||
val buildId = if (slicedProjectPath.size == 2) slicedProjectPath.first() else ":"
|
val buildPath = if (slicedProjectPath.size == 2) slicedProjectPath.first() else ":"
|
||||||
val projectPath = if (slicedProjectPath.size == 2) ":" + slicedProjectPath.last() else slicedProjectPath.last()
|
val projectPath = if (slicedProjectPath.size == 2) ":" + slicedProjectPath.last() else slicedProjectPath.last()
|
||||||
|
|
||||||
return IdeaKotlinProjectArtifactDependencyMatcher(
|
return IdeaKotlinProjectArtifactDependencyMatcher(
|
||||||
type = type,
|
type = type,
|
||||||
buildId = buildId,
|
buildPath = buildPath,
|
||||||
projectPath = projectPath,
|
projectPath = projectPath,
|
||||||
artifactFilePath = artifactFilePath
|
artifactFilePath = artifactFilePath
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user