Skip to content

Commit 388101f

Browse files
tylerbertrandepugh
andauthored
Use separate nodeProjectDir for each subproject (#2680)
Using a shared nodeProjectDir caused multiple nodeSetup tasks to step on each others' toes. The com.github.node-gradle.node plugin doesn't fully support reusing nodeProjectDir, and each nodeSetup task will clean up the existing nodeProjectDir before unpacking the node installation into it. This can result in tasks seeing issues when trying to use npm/node while a nodeSetup task from another project is cleaning it up. use nodeProjectDir instead of rootNodeDir --------- Co-authored-by: Eric Pugh <[email protected]>
1 parent 9bfae53 commit 388101f

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

gradle/node.gradle

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,7 @@ configure([project(":solr:packaging"), project(":solr:solr-ref-guide"), project(
3535
}
3636

3737
project.ext {
38-
rootNodeDir = "$rootDir/.gradle/node"
39-
nodeProjectDir = file("$rootNodeDir/$project.name")
38+
nodeProjectDir = layout.projectDirectory.dir(".gradle/node")
4039
}
4140

4241
node {
@@ -49,10 +48,10 @@ configure([project(":solr:packaging"), project(":solr:solr-ref-guide"), project(
4948
}
5049

5150
// The directory where Node.js is unpacked (when download is true)
52-
workDir = file("${project.ext.rootNodeDir}/nodejs")
51+
workDir = file("${project.ext.nodeProjectDir.getAsFile().path}/nodejs")
5352

5453
// The directory where npm is installed (when a specific version is defined)
55-
npmWorkDir = file("${project.ext.rootNodeDir}/npm")
54+
npmWorkDir = file("${project.ext.nodeProjectDir.getAsFile().path}/npm")
5655

5756
// The Node.js project directory location
5857
// This is where the package.json file and node_modules directory are located

solr/CHANGES.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ Optimizations
166166

167167
Bug Fixes
168168
---------------------
169-
(No changes)
169+
* PR#2680: Improve reliablity of NpmTasks finding needed files/commands. (Tyler Bertrand via Eric Pugh)
170170

171171
Dependency Upgrades
172172
---------------------

0 commit comments

Comments
 (0)