Skip to content
This repository has been archived by the owner on Jan 3, 2020. It is now read-only.

Initial checkin for the Node.js UWP code #1

Merged
merged 12 commits into from
May 22, 2015
Prev Previous commit
Next Next commit
Fixing bug in build batch file
  • Loading branch information
Munyiri Kamau committed May 14, 2015
commit 09b0fb76061d08267100052e45ee45a9a3b61dc1
18 changes: 11 additions & 7 deletions build.bat
Original file line number Diff line number Diff line change
@@ -1,17 +1,25 @@
@echo off

set copyrelease=
set target_arch=
set target_arch=
set target_arch=
set buildall=

if /i "%1"=="copyrelease" set copyrelease=1
if /i "%1"=="arm" set target_arch=arm
if /i "%1"=="x86" set target_arch=x86
if /i "%1"=="x64" set target_arch=x64

set node_dir=c:\Repos\node
set node_dir=C:\Repos\node
set release_dir=c:\buildoutput\node-uwp

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be better not to hardcode these. Instead, give an error and bail if they are not defined.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will fix.


if "%target_arch%"=="arm" goto arm
if "%target_arch%"=="x86" goto x86
if "%target_arch%"=="x64" goto x64

set buildall=1

:arm
@rem build node.dll
call "%node_dir%\vcbuild.bat" arm chakra uwp-dll withoutssl
Expand All @@ -25,9 +33,7 @@ if defined copyrelease (
echo D | xcopy /y /f /i "%node_dir%\Release\node.dll" "%release_dir%\ARM"
echo D | xcopy /y /f /i %~dp0\ARM\release\nodeuwp\nodeuwp.dll "%release_dir%\ARM"
)
@rem reset target_arch and exit
set target_arch=arm
if "%target_arch%"=="arm" goto end
if not defined buildall goto end

:x86

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The x86, x64 and arm labels seem to contain almost identical commands. Consider unifying and using variable expansion.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's cleaner and more readable the way it is since it's small. I'd need to introduce a loop which I would unnecessarily complicate it (esp. since I have a "buildall" option for all labels).

@rem build node.dll
Expand All @@ -42,9 +48,7 @@ if defined copyrelease (
echo D | xcopy /y /f /i "%node_dir%\Release\node.dll" "%release_dir%\x86"
echo D | xcopy /y /f /i %~dp0\release\nodeuwp\nodeuwp.dll "%release_dir%\x86"
)
@rem reset target_arch and exit
set target_arch=x86
if "%target_arch%"=="x86" goto end
if not defined buildall goto end

:x64
@rem build node.dll
Expand Down