[Gradle, JS] Fix Native test and not consider artifact in path
This commit is contained in:
+2
-1
@@ -308,7 +308,8 @@ internal class CacheBuilder(
|
||||
val dependenciesCacheDirectories = getDependenciesCacheDirectories(
|
||||
rootCacheDirectory,
|
||||
dependency,
|
||||
libraryFilter = { libraryFilter(it.file) }
|
||||
libraryFilter = { libraryFilter(it.file) },
|
||||
considerArtifact = true
|
||||
) ?: return
|
||||
|
||||
val nameMap: MutableMap<String, ResolvedArtifact> = mutableMapOf()
|
||||
|
||||
+8
-2
@@ -60,13 +60,19 @@ private fun computeDependenciesHash(dependency: ResolvedDependency): String {
|
||||
fun getDependenciesCacheDirectories(
|
||||
rootCacheDirectory: File,
|
||||
dependency: ResolvedDependency,
|
||||
libraryFilter: (ResolvedArtifact) -> Boolean = { it.file.absolutePath.endsWith(".klib") }
|
||||
libraryFilter: (ResolvedArtifact) -> Boolean = { it.file.absolutePath.endsWith(".klib") },
|
||||
considerArtifact: Boolean = false
|
||||
): List<File>? {
|
||||
return getAllDependencies(dependency)
|
||||
.flatMap { childDependency ->
|
||||
childDependency.moduleArtifacts.map {
|
||||
if (libraryFilter(it)) {
|
||||
val cacheDirectory = getCacheDirectory(rootCacheDirectory, childDependency, it, libraryFilter)
|
||||
val cacheDirectory = getCacheDirectory(
|
||||
rootCacheDirectory,
|
||||
childDependency,
|
||||
if (considerArtifact) it else null,
|
||||
libraryFilter
|
||||
)
|
||||
if (!cacheDirectory.exists()) return null
|
||||
cacheDirectory
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user