How to use the cordova-common.superspawn function in cordova-common

To help you get started, we’ve selected a few cordova-common examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github apache / cordova-windows / template / cordova / lib / log.js View on Github external
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.
*/

// requires
var path = require('path');
var et = require('elementtree');
var ConfigParser = require('./ConfigParser.js');
var nopt = require('nopt');

var spawn = require('cordova-common').superspawn.spawn;
var execSync = require('child_process').execSync;

// paths
var platformRoot = path.join(__dirname, '..', '..');
var projectRoot = path.join(platformRoot, '..', '..');
var configPath = path.join(projectRoot, 'config.xml');

// constants
var APP_TRACING_LOG = 'Microsoft-Windows-AppHost/ApplicationTracing';
var ADMIN_LOG = 'Microsoft-Windows-AppHost/Admin';
var ONE_MINUTE = 60 * 1000;

// variables
var appTracingInitialState = null;
var appTracingCurrentState = null;
var adminInitialState = null;
github Swing-team / pendulums-web-client / mobile-app / platforms / android / cordova / lib / builders / ProjectBuilder.js View on Github external
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.
*/
/* eslint no-self-assign: 0 */
/* eslint no-unused-vars: 0 */

var Q = require('q');
var fs = require('fs');
var path = require('path');
var shell = require('shelljs');
var spawn = require('cordova-common').superspawn.spawn;
var events = require('cordova-common').events;
var CordovaError = require('cordova-common').CordovaError;
var check_reqs = require('../check_reqs');
var PackageType = require('../PackageType');
const compareFunc = require('compare-func');

const MARKER = 'YOUR CHANGES WILL BE ERASED!';
const SIGNING_PROPERTIES = '-signing.properties';
const TEMPLATE =
    '# This file is automatically generated.\n' +
    '# Do not modify this file -- ' + MARKER + '\n';

class ProjectBuilder {
    constructor (rootDirectory) {
        this.root = rootDirectory || path.resolve(__dirname, '../../..');
        this.apkDir = path.join(this.root, 'app', 'build', 'outputs', 'apk');
github weexteam / pack-android-tools-for-Apache-Weex / bin / templates / cordova / lib / emulator.js View on Github external
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.
*/

/* jshint sub:true */

var retry      = require('./retry');
var build      = require('./build');
var path = require('path');
var Adb = require('./Adb');
var AndroidManifest = require('./AndroidManifest');
var events = require('cordova-common').events;
var spawn = require('cordova-common').superspawn.spawn;
var CordovaError = require('cordova-common').CordovaError;

var Q             = require('q');
var os            = require('os');
var child_process = require('child_process');

// constants
var ONE_SECOND              = 1000; // in milliseconds
var ONE_MINUTE              = 60 * ONE_SECOND; // in milliseconds
var INSTALL_COMMAND_TIMEOUT = 5 * ONE_MINUTE; // in milliseconds
var NUM_INSTALL_RETRIES     = 3;
var CHECK_BOOTED_INTERVAL   = 3 * ONE_SECOND; // in milliseconds
var EXEC_KILL_SIGNAL        = 'SIGKILL';

/**
 * Returns a Promise for a list of emulator images in the form of objects
github apache / cordova-android / bin / templates / cordova / lib / emulator.js View on Github external
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 android_versions = require('android-versions');
var retry = require('./retry');
var build = require('./build');
var path = require('path');
var Adb = require('./Adb');
var AndroidManifest = require('./AndroidManifest');
var events = require('cordova-common').events;
var superspawn = require('cordova-common').superspawn;
var CordovaError = require('cordova-common').CordovaError;
var shelljs = require('shelljs');
var android_sdk = require('./android_sdk');
var check_reqs = require('./check_reqs');

var os = require('os');
var fs = require('fs');
var child_process = require('child_process');

// constants
var ONE_SECOND = 1000; // in milliseconds
var ONE_MINUTE = 60 * ONE_SECOND; // in milliseconds
var INSTALL_COMMAND_TIMEOUT = 5 * ONE_MINUTE; // in milliseconds
var NUM_INSTALL_RETRIES = 3;
var CHECK_BOOTED_INTERVAL = 3 * ONE_SECOND; // in milliseconds
var EXEC_KILL_SIGNAL = 'SIGKILL';
github alex-shpak / keemob / node_modules / cordova-android / bin / templates / cordova / lib / emulator.js View on Github external
"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.
*/

/* jshint sub:true */

var android_versions = require('android-versions');
var retry = require('./retry');
var build = require('./build');
var path = require('path');
var Adb = require('./Adb');
var AndroidManifest = require('./AndroidManifest');
var events = require('cordova-common').events;
var superspawn = require('cordova-common').superspawn;
var CordovaError = require('cordova-common').CordovaError;
var shelljs = require('shelljs');
var android_sdk = require('./android_sdk');
var check_reqs = require('./check_reqs');

var Q = require('q');
var os = require('os');
var fs = require('fs');
var child_process = require('child_process');

// constants
var ONE_SECOND = 1000; // in milliseconds
var ONE_MINUTE = 60 * ONE_SECOND; // in milliseconds
var INSTALL_COMMAND_TIMEOUT = 5 * ONE_MINUTE; // in milliseconds
var NUM_INSTALL_RETRIES = 3;
var CHECK_BOOTED_INTERVAL = 3 * ONE_SECOND; // in milliseconds
github apache / cordova-android / spec / unit / android_sdk.spec.js View on Github external
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.
*/

const superspawn = require('cordova-common').superspawn;
const fs = require('fs');
const path = require('path');
const rewire = require('rewire');

describe('android_sdk', () => {
    let android_sdk;

    beforeEach(() => {
        android_sdk = rewire('../../bin/templates/cordova/lib/android_sdk');
    });

    describe('sort_by_largest_numerical_suffix', () => {
        it('should return the newest version first', () => {
            const ids = ['android-24', 'android-19', 'android-27', 'android-23'];
            const sortedIds = ['android-27', 'android-24', 'android-23', 'android-19'];
            expect(ids.sort(android_sdk.__get__('sort_by_largest_numerical_suffix'))).toEqual(sortedIds);
github apache / cordova-lib / src / cordova / platform / check.js View on Github external
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 fs = require('fs-extra');
var path = require('path');
var os = require('os');
var semver = require('semver');
var events = require('cordova-common').events;
var superspawn = require('cordova-common').superspawn;
var cordova_util = require('../util');
var HooksRunner = require('../../hooks/HooksRunner');

module.exports = check;

function check (hooksRunner, projectRoot) {
    return Promise.all([
        getCordovaUpdateMessage(), getPlatformUpdateMessages(projectRoot)
    ]).then(messages => {
        events.emit('results', messages.join('\n'));
    });
}

function getCordovaUpdateMessage () {
    return superspawn.spawn('npm',
        ['--loglevel=silent', '--json', 'outdated', 'cordova-lib'],
github holisticon / flynn-book-scanner / app / platforms / android / cordova / lib / build.js View on Github external
"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 Q       = require('q'),
    path    = require('path'),
    fs      = require('fs'),
    nopt = require('nopt');

var Adb = require('./Adb');

var builders = require('./builders/builders');
var events = require('cordova-common').events;
var spawn = require('cordova-common').superspawn.spawn;
var CordovaError = require('cordova-common').CordovaError;

function parseOpts(options, resolvedTarget, projectRoot) {
    options = options || {};
    options.argv = nopt({
        gradle: Boolean,
        ant: Boolean,
        prepenv: Boolean,
        versionCode: String,
        minSdkVersion: String,
        gradleArg: [String, Array],
        keystore: path,
        alias: String,
        storePassword: String,
        password: String,
        keystoreType: String
github apache / cordova-android / bin / templates / cordova / lib / builders / GradleBuilder.js View on Github external
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 Q = require('q');
var fs = require('fs');
var util = require('util');
var path = require('path');
var shell = require('shelljs');
var superspawn = require('cordova-common').superspawn;
var CordovaError = require('cordova-common').CordovaError;
var events = require('cordova-common').events;
var check_reqs = require('../check_reqs');

var GenericBuilder = require('./GenericBuilder');

var MARKER = 'YOUR CHANGES WILL BE ERASED!';
var SIGNING_PROPERTIES = '-signing.properties';
var TEMPLATE =
    '# This file is automatically generated.\n' +
    '# Do not modify this file -- ' + MARKER + '\n';

function GradleBuilder (projectRoot) {
    GenericBuilder.call(this, projectRoot);

    this.binDirs = { gradle: this.binDirs.gradle };
github greenaddress / WalletCordova / platforms / android / cordova / lib / build.js View on Github external
"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 Q       = require('q'),
    path    = require('path'),
    fs      = require('fs'),
    nopt = require('nopt');

var Adb = require('./Adb');

var builders = require('./builders/builders');
var events = require('cordova-common').events;
var spawn = require('cordova-common').superspawn.spawn;
var CordovaError = require('cordova-common').CordovaError;

function parseOpts(options, resolvedTarget) {
    options = options || {};
    options.argv = nopt({
        gradle: Boolean,
        ant: Boolean,
        prepenv: Boolean,
        versionCode: String,
        minSdkVersion: String,
        gradleArg: String,
        keystore: path,
        alias: String,
        storePassword: String,
        password: String,
        keystoreType: String