altavir
06/02/2023, 11:03 AMnpm
dependencies are not resolved:
> Could not resolve all dependencies for configuration ':visionforge-threejs:npm'.
The project declares repositories, effectively ignoring the repositories you have declared in the settings.
You can figure out how project repositories are declared by configuring your build to fail on project repositories.
See <https://docs.gradle.org/8.1.1/userguide/declaring_repositories.html#sub:fail_build_on_project_repositories> for details.
> Could not find three:0.143.0:.
Required by:
project :visionforge-threejs
> Could not find three-csg-ts:3.1.10:.
Required by:
project :visionforge-threejs
> Could not find three.meshline:1.4.0:.
Required by:
project :visionforge-threejs
anton.bannykh
06/02/2023, 11:04 AMaltavir
06/02/2023, 11:12 AMrepositories
breaks somethingaltavir
06/02/2023, 11:15 AMallprojects {
repositories {
maven("<https://repo.kotlin.link>")
maven("<https://oss.sonatype.org/content/repositories/snapshots>")
mavenCentral()
}
Ilya Goncharov [JB]
06/02/2023, 11:30 AMaltavir
06/02/2023, 11:30 AMaltavir
06/02/2023, 11:31 AMIlya Goncharov [JB]
06/02/2023, 11:32 AM:visionforge-threejs:npm
is path of Gradle configuration, which resolving all JS dependencies, it does not mean that it is related with NPM dependencies directly.
But this Could not find three:0.143.0
looks like npm dependencies is tried to find in maven repo, but not in NPMaltavir
06/02/2023, 11:33 AMaltavir
06/02/2023, 11:34 AMIlya Goncharov [JB]
06/02/2023, 11:34 AMNpmDependency
which is used inside our own NPM integration infrsatructurealtavir
06/02/2023, 11:34 AMaltavir
06/02/2023, 11:35 AMIlya Goncharov [JB]
06/02/2023, 12:01 PMkotlin.js
plugin and explicitly set version to kotlin-wrappers
, configuration works for me (for testing purpose I just leave only :ui:ring
in settings.gradle.kts
)
So if I remove explicit version of kotlin-wrappers
, I get following error
The project declares repositories, effectively ignoring the repositories you have declared in the settings.
You can figure out how project repositories are declared by configuring your build to fail on project repositories.
See <https://docs.gradle.org/8.1.1/userguide/declaring_repositories.html#sub:fail_build_on_project_repositories> for details.
> Could not find org.jetbrains.kotlin-wrappers:kotlin-ring-ui:.
Required by:
project :ui:ring
In fact, we declare repository (as Ivy one) on project to download Node.JS
and Yarn
(but it was that earlier as well). So possibly the dependencyResolutionManagement
has problem here.
Another problem is with NPM dependencies
If I change id("org.jetbrains.kotlin.js")
-> id("space.kscience.gradle.js")
I get
Could not determine the dependencies of task ':ui:ring:packageJson'.
> Could not resolve all dependencies for configuration ':ui:ring:npm'.
> Could not find core-js:3.12.1:.
Required by:
project :ui:ring
> Could not find file-saver:2.0.2:.
Required by:
project :ui:ring
And it looks like some custom job with dependencies in such plugin, because by default NpmDependency
type is not in Gradle resolution process.
So if you have this, maybe you rely on what NpmDependency
type was inherited from, but in 1.9.0
it was a bit changed
Current version of NpmDependency is here (https://github.com/JetBrains/kotlin/blob/9d8e7991a84222abef7db0e3ba4e059efdf627b7/[…]lin/org/jetbrains/kotlin/gradle/targets/js/npm/NpmDependency.kt)altavir
06/02/2023, 1:10 PMaltavir
06/02/2023, 1:14 PM(project.tasks.findByName("jsProcessResources") as? Copy)?.apply {
fromJsDependencies("jsRuntimeClasspath")
}
internal fun Copy.fromJsDependencies(configurationName: String) = project.run {
val configuration = configurations[configurationName]
?: error("Configuration with name $configurationName could not be resolved.")
val projectDeps = configuration.allDependencies.filterIsInstance<ProjectDependency>().map {
it.dependencyProject
}
projectDeps.forEach { dep ->
dep.pluginManager.withPlugin("org.jetbrains.kotlin.multiplatform") {
dep.tasks.findByName("jsProcessResources")?.let { task ->
dependsOn(task)
from(task)
}
}
dep.pluginManager.withPlugin("org.jetbrains.kotlin.js") {
dep.tasks.findByName("processResources")?.let { task ->
dependsOn(task)
from(task)
}
}
}
}
altavir
06/02/2023, 1:15 PMaltavir
06/02/2023, 1:36 PMIlya Goncharov [JB]
06/02/2023, 2:27 PMrepositories
, I am not sure that it is related with JS specific (only one thing, is that we add repository
with nodeJs to project repositories)
I am not sure why it started to reproduced only now, but anyway
With js plugin, configuration called “npm”, and that forces Gradle to create accessor fun npm()
and call of core-js
in ui:ring
is resolved into this accessor, not onto our wrapper, which just create NpmDependency
And if change your plugin on standard org.jetbrains.kotlin.js
, npm()
resolved to our wrapper.
So, that is reason to rename configuration from npm
to something new to get rid of ambiguity
And using of mpp
plugin should help in this case (because in mpp
configuration called jsNpm
instead of just npm
)altavir
06/02/2023, 3:58 PMaltavir
06/02/2023, 4:13 PMaltavir
06/02/2023, 4:46 PMIlya Goncharov [JB]
06/02/2023, 4:47 PMMargarita Bobova
06/05/2023, 8:20 AM