Closed dvoloshyn closed 1 year ago
I made a quick test to see if this happens out of the box and on the bright side, it doesn't. Unfortunately that means I'm not able to reproduce this.
Can you see if you can make a test that triggers it?
I added this to src/test/groovy/com/github/gradle/node/yarn/task/YarnSetupTask_integTest.groovy
and ran ./gradlew :test --tests "com.github.gradle.node.yarn.task.YarnSetupTask_integTest"
The two directories are from src/test/resources/fixtures
package com.github.gradle.node.yarn.task
import com.github.gradle.AbstractIntegTest
import static org.gradle.testkit.runner.TaskOutcome.*
class YarnSetupTask_integTest extends AbstractIntegTest {
def 'execute yarnSetup twice and check up-to-date'() {
given:
copyResources("fixtures/yarn")
copyResources("fixtures/javascript-project")
when:
def result1 = build("yarnSetup").task(":yarnSetup").outcome
def result2 = build("yarnSetup").task(":yarnSetup").outcome
then:
result1 == SUCCESS
result2 == UP_TO_DATE
}
}
I have a multimodule yarn UI project when every module is built using
yarn
and could depend on other modules. It means yarnSetup is executed before every other YarnTask. I noticed that it's almost always reinstalling yarn. The following is printed to console (reduced):I checked that file and found that properties "_requiredBy" and "_where" are different.
What could be done to avoid reinstalling yarn all the time?