Skip to content
This repository has been archived by the owner on Aug 10, 2021. It is now read-only.

Version 0.7 of the gradle plugin breaks the com.moowork.node plugin #1612

Closed
SalomonBrys opened this issue May 19, 2018 · 5 comments
Closed

Comments

@SalomonBrys
Copy link

The plugin com.moowork.node is the plugin that is used in the Kotlin Javascript examples to run Kotlin/JS unit tests.

However, the mere fact to apply the konan plugin in a different module makes the node plugin fail.

Moere specifically, it fails to download NodeJS:

$ ./gradlew test
Starting a Gradle Daemon, 5 stopped Daemons could not be reused, use --status for details
> Task :js:nodeSetup FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':js:nodeSetup'.
> Could not resolve all files for configuration ':js:detachedConfiguration1'.
   > Could not find org.nodejs:node:6.9.1.
     Searched in the following locations:
         https://nodejs.org/dist/v6.9.1/node.module
         https://nodejs.org/dist/v6.9.1/ivy.xml
     Required by:
         project :js

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 10s

Here is a test project that demonstrates the issue.
Just run ./gradlew test

Note that this only happens if you don't have the NodeJS archive downloaded in cache, so be sure to remove it from Gradle cache before running the test:

rm -rf ~/.gradle/caches/modules-2/files-2.1/org.nodejs/
@StefMa
Copy link
Contributor

StefMa commented May 19, 2018 via email

@vvlevchenko
Copy link
Contributor

I afraid It's problem of nodejs plugin. there is PR-296 making nodejs plugin compatible with gradle-4.5+ (gradle_metadata feature, which will be enabled by default in gradle-5.0), but it hasn't been applied yet.

@olonho
Copy link
Contributor

olonho commented Jun 1, 2018

Anyone aware of ways how to reach NodeJs plugin developers? As they ignore the pull request, it is hard do much about it.

@SalomonBrys
Copy link
Author

I created PR-85 on JetBrains/kotlin-examples project that uses another NodeJS plugin which works with Gradle 4.6+ and therefore Kotlin/Native ,

@sandwwraith
Copy link
Member

@SalomonBrys There is a workaround for it; add this to build.gradle of js module:

// Workaround the problem with Node downloading
repositories.whenObjectAdded {
    if (it instanceof IvyArtifactRepository) {
        metadataSources {
            artifact()
        }
    }
}

See it in action here.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants