[Gradle, JS] Use name of included build by root project
#KT-32466 fixed #KT-36784 fixed #KT-36864 fixed
This commit is contained in:
+4
-2
@@ -11,6 +11,7 @@ import org.gradle.api.artifacts.ResolvedDependency
|
||||
import org.gradle.api.artifacts.component.ProjectComponentIdentifier
|
||||
import org.gradle.api.attributes.Usage
|
||||
import org.gradle.api.initialization.IncludedBuild
|
||||
import org.gradle.api.internal.artifacts.DefaultProjectComponentIdentifier
|
||||
import org.gradle.api.tasks.Input
|
||||
import org.gradle.api.tasks.InputFiles
|
||||
import org.jetbrains.kotlin.gradle.plugin.KotlinCompilation
|
||||
@@ -27,6 +28,7 @@ import org.jetbrains.kotlin.gradle.targets.js.npm.npmProject
|
||||
import org.jetbrains.kotlin.gradle.targets.js.npm.plugins.CompilationResolverPlugin
|
||||
import org.jetbrains.kotlin.gradle.targets.js.npm.resolved.KotlinCompilationNpmResolution
|
||||
import org.jetbrains.kotlin.gradle.targets.js.npm.tasks.KotlinPackageJsonTask
|
||||
import org.jetbrains.kotlin.gradle.utils.topRealPath
|
||||
import java.io.File
|
||||
import java.io.Serializable
|
||||
|
||||
@@ -204,8 +206,8 @@ internal class KotlinCompilationNpmResolver(
|
||||
}
|
||||
|
||||
if (clazz.isAssignableFrom(artifactId::class.java)) {
|
||||
(artifactId.componentIdentifier as ProjectComponentIdentifier).let { identifier ->
|
||||
val includedBuild = project.gradle.includedBuild(identifier.projectName.removePrefix(":"))
|
||||
(artifactId.componentIdentifier as DefaultProjectComponentIdentifier).let { identifier ->
|
||||
val includedBuild = project.gradle.includedBuild(identifier.identityPath.topRealPath().name!!)
|
||||
internalCompositeDependencies.add(CompositeDependency(dependency, includedBuild))
|
||||
}
|
||||
}
|
||||
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
/*
|
||||
* Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
||||
*/
|
||||
|
||||
package org.jetbrains.kotlin.gradle.utils
|
||||
|
||||
import org.gradle.util.Path
|
||||
|
||||
tailrec fun Path.topRealPath(): Path {
|
||||
val parent = parent
|
||||
parent?.parent ?: return this
|
||||
|
||||
return parent.topRealPath()
|
||||
}
|
||||
Reference in New Issue
Block a user