Skip to content

Commit

Permalink
Remove platform-specific commands
Browse files Browse the repository at this point in the history
No longer need the platform-specific commands.

ISSUE=#193
  • Loading branch information
romandev committed Nov 22, 2017
1 parent 57bd300 commit 09e24cb
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 72 deletions.
82 changes: 19 additions & 63 deletions binding.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -31,30 +31,12 @@
'target_name': 'bacardi',
'dependencies': [
'idl',
'<!(<(bacardi_command) node -p "require(\'node-addon-api\').gyp")',
],
'conditions': [
['OS!="win"',
{
'dependencies': [
'<!@(./bootstrap/command/node -p \'require("node-addon-api").gyp\')',
],
'include_dirs': [
'./',
'<@(SHARED_INTERMEDIATE_DIR)',
'<!@(./bootstrap/command/node -p \'require("node-addon-api").include\')',
],
}],
['OS=="win"',
{
'dependencies': [
'<!(third_party\\node\\node.exe -p "require(\'node-addon-api\').gyp")',
],
'include_dirs': [
'./',
'<@(SHARED_INTERMEDIATE_DIR)',
'<!@(third_party\\node\\node.exe -p "require(\'node-addon-api\').include")',
],
}],
'include_dirs': [
'./',
'<@(SHARED_INTERMEDIATE_DIR)',
'<!@(<(bacardi_command) node -p "require(\'node-addon-api\').include")',
],
'sources': [
'<!@(<(bacardi_command) list_cpp_files --silent)',
Expand All @@ -76,29 +58,17 @@
'outputs': [
'<@(PRODUCT_DIR)/generator',
],
'conditions': [
['OS!="win"',
{
'action': [
'<@(PRODUCT_DIR)/../../bootstrap/command/tsc',
'<@(_inputs)',
'--outDir',
'<@(_outputs)',
],
}],
['OS=="win"',
{
'action': [
'<@(PRODUCT_DIR)/../../third_party/node/node.exe <@(PRODUCT_DIR)/../../node_modules/typescript/bin/tsc --lib es2015',
'<@(_inputs)',
'--outDir',
'<@(_outputs)',
],
}],
'action': [
'<(module_root_dir)/<(bacardi_command)',
'tsc',
'<@(_inputs)',
'--outDir',
'<@(_outputs)',
],
},
],
},

{
'target_name': 'idl',
'type': 'none',
Expand All @@ -114,27 +84,13 @@
'outputs': [
'<!@(<(bacardi_command) list_generated_cpp_files --silent)',
],
'conditions': [
['OS!="win"',
{
'action': [
'<@(PRODUCT_DIR)/../../bootstrap/command/node',
'<@(PRODUCT_DIR)/generator/main.js',
'<(module_root_dir)',
'<@(SHARED_INTERMEDIATE_DIR)',
'<@(_inputs)',
],
}],
['OS=="win"',
{
'action': [
'<@(PRODUCT_DIR)/../../third_party/node/node.exe',
'<@(PRODUCT_DIR)/generator/main.js',
'<(module_root_dir)',
'<@(SHARED_INTERMEDIATE_DIR)',
'<@(_inputs)',
],
}],
'action': [
'<(module_root_dir)/<(bacardi_command)',
'node',
'<@(PRODUCT_DIR)/generator/main.js',
'<(module_root_dir)',
'<@(SHARED_INTERMEDIATE_DIR)',
'<@(_inputs)',
],
},
],
Expand Down
3 changes: 2 additions & 1 deletion bootstrap/bacardi.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,9 @@ if [ ! -f .last_update ] || [ package.json -nt .last_update ]; then
npm install
fi

sub_command=$(basename $(echo $1 | sed 's/\\/\//g'))
for command in $(ls $(bootstrap_command_path)); do
if [ "$1" = "$command" ]; then
if [ "$sub_command" = "$command" ]; then
shift
$(bootstrap_command_path)/$command $@
exit
Expand Down
16 changes: 8 additions & 8 deletions generator/generator.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@
{
'variables': {
'generator_files': [
'base/file.ts',
'parser/idl_definition.ts',
'parser/idl_definition_factory.ts',
'parser/idl_identifier.ts',
'parser/idl_interface.ts',
'parser/parser.ts',
'reader/simple_reader.ts',
'main.ts',
'<(module_root_dir)/generator/base/file.ts',
'<(module_root_dir)/generator/parser/idl_definition.ts',
'<(module_root_dir)/generator/parser/idl_definition_factory.ts',
'<(module_root_dir)/generator/parser/idl_identifier.ts',
'<(module_root_dir)/generator/parser/idl_interface.ts',
'<(module_root_dir)/generator/parser/parser.ts',
'<(module_root_dir)/generator/reader/simple_reader.ts',
'<(module_root_dir)/generator/main.ts',
],
},
}

0 comments on commit 09e24cb

Please sign in to comment.