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 47d3e28
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 101 deletions.
86 changes: 18 additions & 68 deletions binding.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,6 @@
# limitations under the License.

{
'includes': [
'generator/generator.gypi',
],

'variables': {
'bacardi_command%': './bacardi',
'conditions': [
Expand All @@ -31,30 +27,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 @@ -71,34 +49,20 @@
{
'action_name': 'tsc',
'inputs': [
'<@(generator_files)',
],
'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',
'--outDir',
'<@(_outputs)',
],
},
],
},

{
'target_name': 'idl',
'type': 'none',
Expand All @@ -114,27 +78,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
9 changes: 8 additions & 1 deletion bootstrap/command/tsc
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,11 @@
# See the License for the specific language governing permissions and
# limitations under the License.

tsc --lib es2015 $@
. $BACARDI_PATH/bootstrap/common/path_info.sh
. $BACARDI_PATH/bootstrap/common/platform_info.sh

if is_windows_platform; then
$(bacardi_path)/node_modules/.bin/tsc.cmd
else
$(bacardi_path)/node_modules/.bin/tsc
fi
28 changes: 0 additions & 28 deletions generator/generator.gypi

This file was deleted.

8 changes: 5 additions & 3 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@
"compilerOptions": {
"baseUrl": ".",
"experimentalDecorators": true,
"noImplicitAny": true,
"noImplicitReturns": true,
"lib": ["es2015"],
"preserveConstEnums": true,
"sourceMap": true,
"target": "es5"
}
},
"include": [
"generator/**/*"
]
}

0 comments on commit 47d3e28

Please sign in to comment.