Open Opalo opened 8 years ago
With the following piece of code:
project.afterEvaluate {
tasks.npm_install.outputs.dir(file('node_modules'))
}
it finally was marked as up-to-date.
It seams path changed. And why such input and output declared not related to workingDir
?
With @Opalo suggested approach I have:
ext.reactAppDir = file("$projectDir/reactapp")
npm_install{
workingDir = reactAppDir
}
project.afterEvaluate { // Bug workaround: @issue https://github.com/srs/gradle-node-plugin/issues/131
tasks.npm_install.inputs.file "${reactAppDir}/package.json"
tasks.npm_install.outputs.dir "${reactAppDir}/node_modules"
tasks.npm_install.outputs.file "${reactAppDir}/package-lock.json"
}
And gradle
complains:
> Task :open-area:npmInstall UP-TO-DATE
A problem was found with the configuration of task ':open-area:npmInstall'. Registering invalid inputs and outputs via TaskInputs and TaskOutputs methods has been deprecated and is scheduled to be removed in Gradle 5.0.
- File '/home/pasha/@Projects/@RLH/portal.java10/open-area/package.json' specified for property '$1' does not exist.
Why are
inputs
andoutputs
fornpm_install
task configured after project is evaluated? I mean this line exactly.Please have a look at the following log extract: