This repository has been archived by the owner. It is now read-only.
Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
[CB-2980] Added the install-emulator script
Reviewed by Jeffrey Heifetz <jheifetz@blackberry.com> Tested by Tracy Li <tli@blackberry.com>
- Loading branch information
1 parent
a009d87
commit 6f63be2cc4cf0f997a4a69ef348e7216d9414d4a
Showing
6 changed files
with
146 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#!/bin/sh | ||
<<COMMENT | ||
Licensed to the Apache Software Foundation (ASF) under one | ||
or more contributor license agreements. See the NOTICE file | ||
distributed with this work for additional information | ||
regarding copyright ownership. The ASF licenses this file | ||
to you under the Apache License, Version 2.0 (the | ||
"License"); you may not use this file except in compliance | ||
with the License. You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, | ||
software distributed under the License is distributed on an | ||
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
KIND, either express or implied. See the License for the | ||
specific language governing permissions and limitations | ||
under the License. | ||
COMMENT | ||
CORDOVA_DIR=$(dirname "$0") | ||
source "$CORDOVA_DIR/init" | ||
|
||
"$CORDOVA_NODE/node" "$CORDOVA_DIR/lib/install-emulator" "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
@ECHO OFF | ||
goto comment | ||
Licensed to the Apache Software Foundation (ASF) under one | ||
or more contributor license agreements. See the NOTICE file | ||
distributed with this work for additional information | ||
regarding copyright ownership. The ASF licenses this file | ||
to you under the Apache License, Version 2.0 (the | ||
"License"); you may not use this file except in compliance | ||
with the License. You may obtain a copy of the License at | ||
|
||
http://www.apache.org/licenses/LICENSE-2.0 | ||
|
||
Unless required by applicable law or agreed to in writing, | ||
software distributed under the License is distributed on an | ||
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
KIND, either express or implied. See the License for the | ||
specific language governing permissions and limitations | ||
under the License. | ||
:comment | ||
call "%~dps0init" | ||
"%CORDOVA_NODE%\node.exe" "%~dps0\lib\install-emulator" %* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
#!/usr/bin/env node | ||
|
||
/* | ||
* Copyright 2012 Research In Motion Limited. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
var path = require("path"), | ||
utils = require("./utils"), | ||
options = require('commander'), | ||
runUtils = require("./run-utils"), | ||
logger = require("./logger"), | ||
async = require("async"); | ||
|
||
options | ||
.usage('[--target=id]') | ||
.option('--target <id>', 'specifies the target to run the application') | ||
.option('--devicepass <password>', 'device password') | ||
.option('--query', 'query on the commandline when a password is needed') | ||
.option('-k, --keystorepass <password>', 'the password of signing key; needed for creating debug token') | ||
.option('--no-uninstall', 'does not uninstall application from device') | ||
.option('--no-launch', 'do not launch the application on device') | ||
.on('--help', function() { | ||
console.log(' Examples:'); | ||
console.log(''); | ||
console.log(" Deploying to a predefined target"); | ||
console.log(' $ run --target=Z10'); | ||
console.log(''); | ||
}); | ||
process.argv.forEach(function (argument, index, args) { | ||
if (argument.match(/^--target=/)) { | ||
args.splice(index, 1, "--target", argument.substr("--target=".length)); | ||
} | ||
}); | ||
|
||
options.parse(process.argv); | ||
|
||
options.emulator = true; | ||
async.waterfall( | ||
[ | ||
runUtils.getValidatedTarget.bind(this, options), | ||
runUtils.checkBuild, | ||
runUtils.uninstall.bind(this, options), | ||
runUtils.deployToTarget.bind(this, options) | ||
], | ||
function (err) { | ||
if (err) { | ||
if (typeof err === "string") { | ||
logger.error(err); | ||
process.exit(1); | ||
} else if (typeof err === "number") { | ||
process.exit(err); | ||
} | ||
} else { | ||
process.exit(0); | ||
} | ||
} | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters