From b3b3f53a339135903133842888467a0e6798acd0 Mon Sep 17 00:00:00 2001 From: Richard Lau Date: Fri, 21 Sep 2018 17:30:08 +0100 Subject: [PATCH] build: exclude npm test directories on Windows MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit npm test directories are excluded on other platforms by `tools/install.py`. Do the same on Windows. Fixes: https://github.com/nodejs/node/issues/22901 PR-URL: https://github.com/nodejs/node/pull/23001 Reviewed-By: Joyee Cheung Reviewed-By: James M Snell Reviewed-By: Refael Ackermann Reviewed-By: João Reis --- tools/msvs/msi/nodemsi.wixproj | 12 ++++++------ vcbuild.bat | 18 ++++++++++++++---- 2 files changed, 20 insertions(+), 10 deletions(-) diff --git a/tools/msvs/msi/nodemsi.wixproj b/tools/msvs/msi/nodemsi.wixproj index 6c23c1650baed3..66a97f243d8dde 100644 --- a/tools/msvs/msi/nodemsi.wixproj +++ b/tools/msvs/msi/nodemsi.wixproj @@ -1,4 +1,4 @@ - + Debug @@ -16,23 +16,23 @@ ..\..\..\ obj\$(Configuration)\ - Debug;ProductVersion=$(NodeVersion);FullVersion=$(FullVersion);DistTypeDir=$(DistTypeDir);NoETW=$(NoETW);NpmSourceDir=..\..\..\deps\npm\;ProgramFilesFolderId=ProgramFilesFolder + Debug;ProductVersion=$(NodeVersion);FullVersion=$(FullVersion);DistTypeDir=$(DistTypeDir);NoETW=$(NoETW);NpmSourceDir=..\..\..\Release\node-v$(FullVersion)-win-$(Platform)\node_modules\npm\;ProgramFilesFolderId=ProgramFilesFolder ..\..\..\ obj\$(Configuration)\ - Debug;ProductVersion=$(NodeVersion);FullVersion=$(FullVersion);DistTypeDir=$(DistTypeDir);NoETW=$(NoETW);NpmSourceDir=..\..\..\deps\npm\;ProgramFilesFolderId=ProgramFilesFolder + Debug;ProductVersion=$(NodeVersion);FullVersion=$(FullVersion);DistTypeDir=$(DistTypeDir);NoETW=$(NoETW);NpmSourceDir=..\..\..\Release\node-v$(FullVersion)-win-$(Platform)\node_modules\npm\;ProgramFilesFolderId=ProgramFilesFolder ..\..\..\ obj\$(Configuration)\ - Debug;ProductVersion=$(NodeVersion);FullVersion=$(FullVersion);DistTypeDir=$(DistTypeDir);NoETW=$(NoETW);NpmSourceDir=..\..\..\deps\npm\;ProgramFilesFolderId=ProgramFiles64Folder + Debug;ProductVersion=$(NodeVersion);FullVersion=$(FullVersion);DistTypeDir=$(DistTypeDir);NoETW=$(NoETW);NpmSourceDir=..\..\..\Release\node-v$(FullVersion)-win-$(Platform)\node_modules\npm\;ProgramFilesFolderId=ProgramFiles64Folder en-US ..\..\..\ obj\$(Configuration)\ - Debug;ProductVersion=$(NodeVersion);FullVersion=$(FullVersion);DistTypeDir=$(DistTypeDir);NoETW=$(NoETW);NpmSourceDir=..\..\..\deps\npm\;ProgramFilesFolderId=ProgramFiles64Folder + Debug;ProductVersion=$(NodeVersion);FullVersion=$(FullVersion);DistTypeDir=$(DistTypeDir);NoETW=$(NoETW);NpmSourceDir=..\..\..\Release\node-v$(FullVersion)-win-$(Platform)\node_modules\npm\;ProgramFilesFolderId=ProgramFiles64Folder True @@ -73,7 +73,7 @@ - + diff --git a/vcbuild.bat b/vcbuild.bat index 56d51b8342dd87..b90d2b09cc4402 100644 --- a/vcbuild.bat +++ b/vcbuild.bat @@ -25,6 +25,7 @@ set sign= set nosnapshot= set cctest_args= set test_args= +set stage_package= set package= set msi= set upload= @@ -153,6 +154,9 @@ if defined build_release ( set "pch=" ) +if defined msi set stage_package=1 +if defined package set stage_package=1 + :: assign path to node_exe set "node_exe=%config%\node.exe" set "node_gyp_exe="%node_exe%" deps\npm\node_modules\node-gyp\bin\node-gyp" @@ -313,15 +317,17 @@ if errorlevel 1 echo Failed to sign exe&goto exit :licensertf @rem Skip license.rtf generation if not requested. -if not defined licensertf goto package +if not defined licensertf goto stage_package %config%\node.exe tools\license2rtf.js < LICENSE > %config%\license.rtf if errorlevel 1 echo Failed to generate license.rtf&goto exit -:package -if not defined package goto msi +:stage_package +if not defined stage_package goto install-doctools + echo Creating package... cd Release +rmdir /S /Q node-v%FULLVERSION%-win-%target_arch% > nul 2> nul mkdir node-v%FULLVERSION%-win-%target_arch% > nul 2> nul mkdir node-v%FULLVERSION%-win-%target_arch%\node_modules > nul 2>nul @@ -333,7 +339,7 @@ copy /Y ..\README.md node-v%FULLVERSION%-win-%target_arch%\ > nul if errorlevel 1 echo Cannot copy README.md && goto package_error copy /Y ..\CHANGELOG.md node-v%FULLVERSION%-win-%target_arch%\ > nul if errorlevel 1 echo Cannot copy CHANGELOG.md && goto package_error -robocopy /e ..\deps\npm node-v%FULLVERSION%-win-%target_arch%\node_modules\npm > nul +robocopy ..\deps\npm node-v%FULLVERSION%-win-%target_arch%\node_modules\npm /e /xd test > nul if errorlevel 8 echo Cannot copy npm package && goto package_error copy /Y ..\deps\npm\bin\npm node-v%FULLVERSION%-win-%target_arch%\ > nul if errorlevel 1 echo Cannot copy npm && goto package_error @@ -349,7 +355,11 @@ if not defined noetw ( copy /Y ..\src\res\node_etw_provider.man node-v%FULLVERSION%-win-%target_arch%\ > nul if errorlevel 1 echo Cannot copy node_etw_provider.man && goto package_error ) +cd .. +:package +if not defined package goto msi +cd Release echo Creating node-v%FULLVERSION%-win-%target_arch%.7z del node-v%FULLVERSION%-win-%target_arch%.7z > nul 2> nul 7z a -r -mx9 -t7z node-v%FULLVERSION%-win-%target_arch%.7z node-v%FULLVERSION%-win-%target_arch% > nul