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

Commit

Permalink
build: add ChakraCore SDK to packages
Browse files Browse the repository at this point in the history
Reviewed-By: Hitesh Kanwathirtha <hiteshk@microsoft.com>
PR-URL: #145
  • Loading branch information
joaocgreis committed Nov 28, 2016
1 parent e11f649 commit 64480a5
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 8 deletions.
4 changes: 4 additions & 0 deletions deps/chakrashim/npm
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash
DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )/.." && pwd )
export NPM_CONFIG_NODEDIR="$DIR"
$DIR/lib/node_modules/npm/bin/npm-cli.js "$@"
10 changes: 2 additions & 8 deletions tools/install.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,14 +89,8 @@ def npm_files(action):
paths = [os.path.join(dirname, basename) for basename in basenames]
action(paths, target_path + dirname[9:] + '/')

# create/remove symlink
link_path = abspath(install_path, 'bin/npm')
if action == uninstall:
action([link_path], 'bin/npm')
elif action == install:
try_symlink('../lib/node_modules/npm/bin/npm-cli.js', link_path)
else:
assert(0) # unhandled action type
# create/remove npm invoke script
action(['deps/chakrashim/npm'], 'bin/npm')

def subdir_files(path, dest, action):
ret = {}
Expand Down
15 changes: 15 additions & 0 deletions vcbuild.bat
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,21 @@ if not defined noperfctr (
if errorlevel 1 echo Cannot copy node_perfctr_provider.man && goto package_error
)

:: ChakraCore SDK for native modules
robocopy ..\ node-v%FULLVERSION%-win-%target_arch%\sdk\ *.h *.inc common.gypi /XD debug release build icu core test genfiles /S > nul
if errorlevel 8 echo Cannot copy SDK contents && goto package_error
mkdir node-v%FULLVERSION%-win-%target_arch%\sdk\%config% > nul 2> nul
copy /Y node.lib node-v%FULLVERSION%-win-%target_arch%\sdk\%config%\ > nul
if errorlevel 1 echo Cannot copy node.lib && goto package_error
copy /Y chakracore.lib node-v%FULLVERSION%-win-%target_arch%\sdk\%config%\ > nul
if errorlevel 1 echo Cannot copy chakracore.lib && goto package_error
set "pkgnpmsh=node-v%FULLVERSION%-win-%target_arch%/npm"
node.exe -e "var data=fs.readFileSync('%pkgnpmsh%', 'utf8').split('\n');data.splice(-2, 0, 'export NPM_CONFIG_NODEDIR=\"$basedir/sdk\"');fs.writeFileSync('%pkgnpmsh%', data.join('\n'))"
if errorlevel 1 echo Cannot change %pkgnpmsh% && goto package_error
set "pkgnpmcmd=node-v%FULLVERSION%-win-%target_arch%/npm.cmd"
node.exe -e "var data=fs.readFileSync('%pkgnpmcmd%', 'utf8').split('\n');data.splice(-2, 0, 'SET \"NPM_CONFIG_NODEDIR=%%~dp0\\sdk\"');fs.writeFileSync('%pkgnpmcmd%', data.join('\n'))"
if errorlevel 1 echo Cannot change %pkgnpmcmd% && goto package_error

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
Expand Down

0 comments on commit 64480a5

Please sign in to comment.