[Gradle, JS] Force full configuring of NPM tasks in idea import
This commit is contained in:
+6
-2
@@ -108,7 +108,11 @@ internal class KotlinCompilationNpmResolver(
|
||||
fun getResolutionOrResolveIfForced(): KotlinCompilationNpmResolution? {
|
||||
if (resolution != null) return resolution
|
||||
if (packageJsonTaskHolder.get().state.upToDate) return resolve(skipWriting = true)
|
||||
if (resolver.forceFullResolve && resolution == null) return resolve()
|
||||
if (resolver.forceFullResolve && resolution == null) {
|
||||
// need to force all NPM tasks to be configured in IDEA import
|
||||
project.tasks.implementing(RequiresNpmDependencies::class).all {}
|
||||
return resolve()
|
||||
}
|
||||
return null
|
||||
}
|
||||
|
||||
@@ -284,7 +288,7 @@ internal class KotlinCompilationNpmResolver(
|
||||
internalDependencies.map { it.npmProject.name },
|
||||
internalCompositeDependencies.flatMap { it.getPackages() },
|
||||
externalGradleDependencies.map { it.artifact.file },
|
||||
externalNpmDependencies.map { "${it.scope} ${it.key}:${it.version}" }
|
||||
externalNpmDependencies.map { it.uniqueRepresentation() }
|
||||
)
|
||||
|
||||
fun createPackageJson(skipWriting: Boolean): KotlinCompilationNpmResolution {
|
||||
|
||||
+1
-1
@@ -121,6 +121,6 @@ internal class KotlinProjectNpmResolver(
|
||||
*
|
||||
* TODO properly express within the type system? The result should be a TaskCollection<T & R>
|
||||
*/
|
||||
private fun <T : Task, R : Any> TaskCollection<T>.implementing(kclass: KClass<R>): TaskCollection<T> =
|
||||
internal fun <T : Task, R : Any> TaskCollection<T>.implementing(kclass: KClass<R>): TaskCollection<T> =
|
||||
@Suppress("UNCHECKED_CAST")
|
||||
withType(kclass.java as Class<T>)
|
||||
Reference in New Issue
Block a user