Skip to content

Commit b3b3f53

Browse files
committed
build: exclude npm test directories on Windows
npm test directories are excluded on other platforms by `tools/install.py`. Do the same on Windows. Fixes: #22901 PR-URL: #23001 Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: João Reis <reis@janeasystems.com>
1 parent 1d56ad0 commit b3b3f53

File tree

2 files changed

+20
-10
lines changed

2 files changed

+20
-10
lines changed

tools/msvs/msi/nodemsi.wixproj

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<?xml version="1.0" encoding="utf-8"?>
1+
<?xml version="1.0" encoding="utf-8"?>
22
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
33
<PropertyGroup>
44
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
@@ -16,23 +16,23 @@
1616
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
1717
<OutputPath>..\..\..\</OutputPath>
1818
<IntermediateOutputPath>obj\$(Configuration)\</IntermediateOutputPath>
19-
<DefineConstants>Debug;ProductVersion=$(NodeVersion);FullVersion=$(FullVersion);DistTypeDir=$(DistTypeDir);NoETW=$(NoETW);NpmSourceDir=..\..\..\deps\npm\;ProgramFilesFolderId=ProgramFilesFolder</DefineConstants>
19+
<DefineConstants>Debug;ProductVersion=$(NodeVersion);FullVersion=$(FullVersion);DistTypeDir=$(DistTypeDir);NoETW=$(NoETW);NpmSourceDir=..\..\..\Release\node-v$(FullVersion)-win-$(Platform)\node_modules\npm\;ProgramFilesFolderId=ProgramFilesFolder</DefineConstants>
2020
</PropertyGroup>
2121
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
2222
<OutputPath>..\..\..\</OutputPath>
2323
<IntermediateOutputPath>obj\$(Configuration)\</IntermediateOutputPath>
24-
<DefineConstants>Debug;ProductVersion=$(NodeVersion);FullVersion=$(FullVersion);DistTypeDir=$(DistTypeDir);NoETW=$(NoETW);NpmSourceDir=..\..\..\deps\npm\;ProgramFilesFolderId=ProgramFilesFolder</DefineConstants>
24+
<DefineConstants>Debug;ProductVersion=$(NodeVersion);FullVersion=$(FullVersion);DistTypeDir=$(DistTypeDir);NoETW=$(NoETW);NpmSourceDir=..\..\..\Release\node-v$(FullVersion)-win-$(Platform)\node_modules\npm\;ProgramFilesFolderId=ProgramFilesFolder</DefineConstants>
2525
</PropertyGroup>
2626
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x64' ">
2727
<OutputPath>..\..\..\</OutputPath>
2828
<IntermediateOutputPath>obj\$(Configuration)\</IntermediateOutputPath>
29-
<DefineConstants>Debug;ProductVersion=$(NodeVersion);FullVersion=$(FullVersion);DistTypeDir=$(DistTypeDir);NoETW=$(NoETW);NpmSourceDir=..\..\..\deps\npm\;ProgramFilesFolderId=ProgramFiles64Folder</DefineConstants>
29+
<DefineConstants>Debug;ProductVersion=$(NodeVersion);FullVersion=$(FullVersion);DistTypeDir=$(DistTypeDir);NoETW=$(NoETW);NpmSourceDir=..\..\..\Release\node-v$(FullVersion)-win-$(Platform)\node_modules\npm\;ProgramFilesFolderId=ProgramFiles64Folder</DefineConstants>
3030
<Cultures>en-US</Cultures>
3131
</PropertyGroup>
3232
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x64' ">
3333
<OutputPath>..\..\..\</OutputPath>
3434
<IntermediateOutputPath>obj\$(Configuration)\</IntermediateOutputPath>
35-
<DefineConstants>Debug;ProductVersion=$(NodeVersion);FullVersion=$(FullVersion);DistTypeDir=$(DistTypeDir);NoETW=$(NoETW);NpmSourceDir=..\..\..\deps\npm\;ProgramFilesFolderId=ProgramFiles64Folder</DefineConstants>
35+
<DefineConstants>Debug;ProductVersion=$(NodeVersion);FullVersion=$(FullVersion);DistTypeDir=$(DistTypeDir);NoETW=$(NoETW);NpmSourceDir=..\..\..\Release\node-v$(FullVersion)-win-$(Platform)\node_modules\npm\;ProgramFilesFolderId=ProgramFiles64Folder</DefineConstants>
3636
</PropertyGroup>
3737
<PropertyGroup>
3838
<EnableProjectHarvesting>True</EnableProjectHarvesting>
@@ -73,7 +73,7 @@
7373
</ItemGroup>
7474
<Import Project="$(WixTargetsPath)" />
7575
<Target Name="BeforeBuild">
76-
<HeatDirectory ToolPath="$(WixToolPath)" Directory="..\..\..\deps\npm" PreprocessorVariable="var.NpmSourceDir" DirectoryRefId="NodeModulesFolder" ComponentGroupName="NpmSourceFiles" GenerateGuidsNow="true" SuppressFragments="false" OutputFile="..\..\..\npm.wxs" RunAsSeparateProcess="true">
76+
<HeatDirectory ToolPath="$(WixToolPath)" Directory="..\..\..\Release\node-v$(FullVersion)-win-$(Platform)\node_modules\npm" PreprocessorVariable="var.NpmSourceDir" DirectoryRefId="NodeModulesFolder" ComponentGroupName="NpmSourceFiles" GenerateGuidsNow="true" SuppressFragments="false" OutputFile="..\..\..\npm.wxs" RunAsSeparateProcess="true">
7777
</HeatDirectory>
7878
</Target>
7979
<PropertyGroup>

vcbuild.bat

+14-4
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ set sign=
2525
set nosnapshot=
2626
set cctest_args=
2727
set test_args=
28+
set stage_package=
2829
set package=
2930
set msi=
3031
set upload=
@@ -153,6 +154,9 @@ if defined build_release (
153154
set "pch="
154155
)
155156

157+
if defined msi set stage_package=1
158+
if defined package set stage_package=1
159+
156160
:: assign path to node_exe
157161
set "node_exe=%config%\node.exe"
158162
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
313317

314318
:licensertf
315319
@rem Skip license.rtf generation if not requested.
316-
if not defined licensertf goto package
320+
if not defined licensertf goto stage_package
317321

318322
%config%\node.exe tools\license2rtf.js < LICENSE > %config%\license.rtf
319323
if errorlevel 1 echo Failed to generate license.rtf&goto exit
320324

321-
:package
322-
if not defined package goto msi
325+
:stage_package
326+
if not defined stage_package goto install-doctools
327+
323328
echo Creating package...
324329
cd Release
330+
rmdir /S /Q node-v%FULLVERSION%-win-%target_arch% > nul 2> nul
325331
mkdir node-v%FULLVERSION%-win-%target_arch% > nul 2> nul
326332
mkdir node-v%FULLVERSION%-win-%target_arch%\node_modules > nul 2>nul
327333

@@ -333,7 +339,7 @@ copy /Y ..\README.md node-v%FULLVERSION%-win-%target_arch%\ > nul
333339
if errorlevel 1 echo Cannot copy README.md && goto package_error
334340
copy /Y ..\CHANGELOG.md node-v%FULLVERSION%-win-%target_arch%\ > nul
335341
if errorlevel 1 echo Cannot copy CHANGELOG.md && goto package_error
336-
robocopy /e ..\deps\npm node-v%FULLVERSION%-win-%target_arch%\node_modules\npm > nul
342+
robocopy ..\deps\npm node-v%FULLVERSION%-win-%target_arch%\node_modules\npm /e /xd test > nul
337343
if errorlevel 8 echo Cannot copy npm package && goto package_error
338344
copy /Y ..\deps\npm\bin\npm node-v%FULLVERSION%-win-%target_arch%\ > nul
339345
if errorlevel 1 echo Cannot copy npm && goto package_error
@@ -349,7 +355,11 @@ if not defined noetw (
349355
copy /Y ..\src\res\node_etw_provider.man node-v%FULLVERSION%-win-%target_arch%\ > nul
350356
if errorlevel 1 echo Cannot copy node_etw_provider.man && goto package_error
351357
)
358+
cd ..
352359

360+
:package
361+
if not defined package goto msi
362+
cd Release
353363
echo Creating node-v%FULLVERSION%-win-%target_arch%.7z
354364
del node-v%FULLVERSION%-win-%target_arch%.7z > nul 2> nul
355365
7z a -r -mx9 -t7z node-v%FULLVERSION%-win-%target_arch%.7z node-v%FULLVERSION%-win-%target_arch% > nul

0 commit comments

Comments
 (0)