apache / cordova-windows

@@ -223,7 +223,7 @@
Loading
223 223
        })
224 224
        // CB-11022 return non-falsy value to indicate
225 225
        // that there is no need to run prepare after
226 -
        .thenResolve(true);
226 +
        .then(() => true);
227 227
};
228 228
229 229
/**
@@ -260,7 +260,7 @@
Loading
260 260
        })
261 261
        // CB-11022 return non-falsy value to indicate
262 262
        // that there is no need to run prepare after
263 -
        .thenResolve(true);
263 +
        .then(() => true);
264 264
};
265 265
266 266
/**

@@ -17,7 +17,6 @@
Loading
17 17
       under the License.
18 18
*/
19 19
20 -
var Q = require('q');
21 20
var os = require('os');
22 21
var path = require('path');
23 22
var shell = require('shelljs');
@@ -107,7 +106,7 @@
Loading
107 106
    return spawn('ver').then(function (output) {
108 107
        var match = /\[Version (.*)\]\s*$/.exec(output);
109 108
        return Version.fromString(match[1]);
110 -
    }).fail(function () {
109 +
    }).catch(function () {
111 110
        return Version.fromString(os.release());
112 111
    });
113 112
}
@@ -122,7 +121,7 @@
Loading
122 121
    // Query all keys with Install value equal to 1, then filter out
123 122
    // those, which are not related to VS itself
124 123
    return spawn('reg', ['query', 'HKLM\\SOFTWARE\\Microsoft\\DevDiv\\vs\\Servicing', '/s', '/v', 'Install', '/f', '1', '/d', '/e', '/reg:32'])
125 -
        .fail(function () { return ''; })
124 +
        .catch(function () { return ''; })
126 125
        .then(function (output) {
127 126
            return output.split('\n')
128 127
                .reduce(function (installedVersions, line) {
@@ -139,9 +138,9 @@
Loading
139 138
                .then(function (output) {
140 139
                    var updateVer = Version.fromString(/PackageVersion\s+REG_SZ\s+(.*)/i.exec(output)[1]);
141 140
                    // if update version is lover than Update2, reject the promise
142 -
                    if (VS2013_UPDATE2_RC.gte(updateVer)) return Q.reject();
141 +
                    if (VS2013_UPDATE2_RC.gte(updateVer)) return Promise.reject();
143 142
                    return installedVersions;
144 -
                }).fail(function () {
143 +
                }).catch(function () {
145 144
                    // if we got any errors on previous steps, we're assuming that
146 145
                    // required VS update is not installed.
147 146
                    installedVersions.splice(installedVersions.indexOf('12.0'), 1);
@@ -164,7 +163,7 @@
Loading
164 163
function getInstalledWindowsSdks () {
165 164
    var installedSdks = [];
166 165
    return spawn('reg', ['query', 'HKLM\\SOFTWARE\\Microsoft\\Microsoft SDKs\\Windows', '/s', '/v', 'InstallationFolder', '/reg:32'])
167 -
        .fail(function () { return ''; })
166 +
        .catch(function () { return ''; })
168 167
        .then(function (output) {
169 168
            var re = /\\Microsoft SDKs\\Windows\\v(\d+\.\d+)\s*InstallationFolder\s+REG_SZ\s+(.*)/gim;
170 169
            var match;
@@ -175,7 +174,7 @@
Loading
175 174
                    installedSdks.push(Version.tryParse(match[1]));
176 175
                }
177 176
            }
178 -
        }).thenResolve(installedSdks);
177 +
        }).then(() => installedSdks);
179 178
}
180 179
181 180
/**
@@ -188,7 +187,7 @@
Loading
188 187
function getInstalledPhoneSdks () {
189 188
    var installedSdks = [];
190 189
    return spawn('reg', ['query', 'HKLM\\SOFTWARE\\Microsoft\\Microsoft SDKs\\Windows Phone\\v8.1', '/v', 'InstallationFolder', '/reg:32'])
191 -
        .fail(function () { return ''; })
190 +
        .catch(function () { return ''; })
192 191
        .then(function (output) {
193 192
            var match = /\\Microsoft SDKs\\Windows Phone\\v(\d+\.\d+)\s*InstallationFolder\s+REG_SZ\s+(.*)/gim.exec(output);
194 193
            if (match && shell.test('-e', path.join(match[2], 'SDKManifest.xml'))) {
@@ -196,14 +195,14 @@
Loading
196 195
            }
197 196
        }).then(function () {
198 197
            return spawn('reg', ['query', 'HKLM\\SOFTWARE\\Microsoft\\Microsoft SDKs\\Windows\\v10.0', '/v', 'InstallationFolder', '/reg:32']);
199 -
        }).fail(function () {
198 +
        }).catch(function () {
200 199
            return '';
201 200
        }).then(function (output) {
202 201
            var match = /\\Microsoft SDKs\\Windows\\v(\d+\.\d+)\s*InstallationFolder\s+REG_SZ\s+(.*)/gim.exec(output);
203 202
            if (match && shell.test('-e', path.join(match[2], 'SDKManifest.xml'))) {
204 203
                installedSdks.push(Version.tryParse(match[1]));
205 204
            }
206 -
        }).thenResolve(installedSdks);
205 +
        }).then(() => installedSdks);
207 206
}
208 207
209 208
/**
@@ -245,7 +244,7 @@
Loading
245 244
var checkOS = function (windowsTargetVersion, windowsPhoneTargetVersion) {
246 245
    if (process.platform !== 'win32') {
247 246
        // Build Universal windows apps available for windows platform only, so we reject on others platforms
248 -
        return Q.reject('Cordova tooling for Windows requires Windows OS to build project');
247 +
        return Promise.reject('Cordova tooling for Windows requires Windows OS to build project');
249 248
    }
250 249
251 250
    return getWindowsVersion().then(function (actualVersion) {
@@ -256,7 +255,7 @@
Loading
256 255
            return mapWindowsVersionToName(actualVersion);
257 256
        }
258 257
259 -
        return Q.reject('Current Windows version doesn\'t support building this project. ' +
258 +
        return Promise.reject('Current Windows version doesn\'t support building this project. ' +
260 259
            'Consider upgrading your OS to ' + mapWindowsVersionToName(requiredOsVersion));
261 260
    });
262 261
};
@@ -281,7 +280,7 @@
Loading
281 280
            // console.log('appropriateVersion', appropriateVersion);
282 281
            return appropriateVersion
283 282
                ? shortenVersion(appropriateVersion)
284 -
                : Q.reject('MSBuild tools v.' + shortenVersion(msbuildRequiredVersion) + ' not found. ' +
283 +
                : Promise.reject('MSBuild tools v.' + shortenVersion(msbuildRequiredVersion) + ' not found. ' +
285 284
                    'Please install Visual Studio ' + mapVSVersionToName(getMinimalRequiredVersionFor('visualstudio', windowsTargetVersion, windowsPhoneTargetVersion)) +
286 285
                    ' or higher from https://www.visualstudio.com/downloads/download-visual-studio-vs');
287 286
        });
@@ -291,14 +290,14 @@
Loading
291 290
    var vsRequiredVersion = getMinimalRequiredVersionFor('visualstudio', windowsTargetVersion, windowsPhoneTargetVersion);
292 291
293 292
    if (process.env.VSINSTALLDIR) {
294 -
        return Q('(user-specified via VSINSTALLDIR)');
293 +
        return Promise.resolve('(user-specified via VSINSTALLDIR)');
295 294
    }
296 295
    return getInstalledVSVersions()
297 296
        .then(function (installedVersions) {
298 297
            var appropriateVersion = getHighestAppropriateVersion(installedVersions, vsRequiredVersion);
299 298
            return appropriateVersion
300 299
                ? shortenVersion(appropriateVersion)
301 -
                : Q.reject('Required version of Visual Studio not found. Please install Visual Studio ' +
300 +
                : Promise.reject('Required version of Visual Studio not found. Please install Visual Studio ' +
302 301
                    mapVSVersionToName(vsRequiredVersion) +
303 302
                    ' or higher from https://www.visualstudio.com/downloads/download-visual-studio-vs');
304 303
        });
@@ -312,7 +311,7 @@
Loading
312 311
                return installedSdk.eq(requiredVersion);
313 312
            });
314 313
            if (!hasSdkInstalled) {
315 -
                return Q.reject('Windows SDK not found. Ensure that you have installed ' +
314 +
                return Promise.reject('Windows SDK not found. Ensure that you have installed ' +
316 315
                    'Windows ' + shortenVersion(requiredVersion) + ' SDK along with Visual Studio or install ' +
317 316
                    'Windows ' + shortenVersion(requiredVersion) + ' SDK separately from ' +
318 317
                    'https://dev.windows.com/en-us/downloads');
@@ -332,10 +331,10 @@
Loading
332 331
333 332
            return hasSdkInstalled
334 333
                ? shortenVersion(requiredVersion)
335 -
                : Q.reject();
334 +
                : Promise.reject();
336 335
        })
337 -
        .fail(function () {
338 -
            return Q.reject('Windows Phone SDK not found. Ensure that you have installed ' +
336 +
        .catch(function () {
337 +
            return Promise.reject('Windows Phone SDK not found. Ensure that you have installed ' +
339 338
                'Windows Phone ' + shortenVersion(requiredVersion) + ' SDK along with Visual Studio or install ' +
340 339
                'Windows Phone ' + shortenVersion(requiredVersion) + ' SDK separately from ' +
341 340
                'https://dev.windows.com/develop/download-phone-sdk');
@@ -390,15 +389,15 @@
Loading
390 389
function getConfig () {
391 390
    try {
392 391
        config = config || new ConfigParser(path.join(__dirname, '../../config.xml'));
393 -
        return Q(config);
392 +
        return Promise.resolve(config);
394 393
    } catch (e) {
395 394
        // try again to cover case of being called from command line
396 395
        try {
397 396
            config = config || new ConfigParser(path.join(__dirname, '../../template/config.xml'));
398 -
            return Q(config);
397 +
            return Promise.resolve(config);
399 398
        } catch (e) {
400 399
            // yeah, really no config.xml
401 -
            return Q.reject(new CordovaError('Can\'t check requirements for Windows platform.' +
400 +
            return Promise.reject(new CordovaError('Can\'t check requirements for Windows platform.' +
402 401
                'The config.xml file is either missing or malformed.'));
403 402
        }
404 403
    }
@@ -418,7 +417,7 @@
Loading
418 417
        return promise.then(function () {
419 418
            // If fatal requirement is failed,
420 419
            // we don't need to check others
421 -
            if (fatalIsHit) return Q();
420 +
            if (fatalIsHit) return;
422 421
            var requirement = requirements[idx];
423 422
            return getConfig()
424 423
                .then(function (config) {
@@ -434,7 +433,7 @@
Loading
434 433
                        });
435 434
                });
436 435
        });
437 -
    }, Q())
436 +
    }, Promise.resolve())
438 437
        .then(function () {
439 438
            // When chain is completed, return requirements array to upstream API
440 439
            return result;

@@ -17,7 +17,6 @@
Loading
17 17
       under the License.
18 18
*/
19 19
20 -
var Q = require('q');
21 20
var fs = require('fs');
22 21
var path = require('path');
23 22
var spawn = require('cordova-common').superspawn.spawn;
@@ -44,7 +43,7 @@
Loading
44 43
 *    specific to the deployment tool which created them and are likely used internally.
45 44
 */
46 45
DeploymentTool.prototype.enumerateDevices = function () {
47 -
    return Q.reject('May not use DeploymentTool directly, instead get an instance from DeploymentTool.getDeploymentTool()');
46 +
    return Promise.reject('May not use DeploymentTool directly, instead get an instance from DeploymentTool.getDeploymentTool()');
48 47
};
49 48
50 49
/**
@@ -57,7 +56,7 @@
Loading
57 56
 * @pin Optionally provided if the device requires pairing for deployment.
58 57
 */
59 58
DeploymentTool.prototype.installAppPackage = function (pathToAppxPackage, targetDevice, shouldLaunch, shouldUpdate, pin) {
60 -
    return Q.reject('May not use DeploymentTool directly, instead get an instance from DeploymentTool.getDeploymentTool()');
59 +
    return Promise.reject('May not use DeploymentTool directly, instead get an instance from DeploymentTool.getDeploymentTool()');
61 60
};
62 61
63 62
/**
@@ -67,7 +66,7 @@
Loading
67 66
 * @param targetDevice An object returned from a successful call to enumerateDevices.
68 67
 */
69 68
DeploymentTool.prototype.uninstallAppPackage = function (packageInfo, targetDevice) {
70 -
    return Q.reject('Unable to uninstall any app packages because that feature is not supported.');
69 +
    return Promise.reject('Unable to uninstall any app packages because that feature is not supported.');
71 70
};
72 71
73 72
/**
@@ -77,7 +76,7 @@
Loading
77 76
 * @returns A Promise for an array of app names.
78 77
 */
79 78
DeploymentTool.prototype.getInstalledApps = function (targetDevice) {
80 -
    return Q.reject('Unable to get installed apps because that feature is not supported.');
79 +
    return Promise.reject('Unable to get installed apps because that feature is not supported.');
81 80
};
82 81
83 82
/**
@@ -87,7 +86,7 @@
Loading
87 86
 * @returns A Promise for when the app is launched.
88 87
 */
89 88
DeploymentTool.prototype.launchApp = function (packageInfo, targetDevice) {
90 -
    return Q.reject('Unable to launch an app because that feature is not supported.');
89 +
    return Promise.reject('Unable to launch an app because that feature is not supported.');
91 90
};
92 91
93 92
/**

@@ -17,7 +17,6 @@
Loading
17 17
       under the License.
18 18
*/
19 19
20 -
var Q = require('q');
21 20
var nopt = require('nopt');
22 21
var build = require('./build');
23 22
var utils = require('./utils');
@@ -28,13 +27,13 @@
Loading
28 27
29 28
module.exports.run = function (options) {
30 29
    if (!utils.isCordovaProject(this.root)) {
31 -
        return Q.reject(new CordovaError('Could not find project at ' + this.root));
30 +
        return Promise.reject(new CordovaError('Could not find project at ' + this.root));
32 31
    }
33 32
34 33
    // Check if ran from admin prompt and fail quickly if CLI has administrative permissions
35 34
    // http://stackoverflow.com/a/11995662/64949
36 35
    if (ranWithElevatedPermissions()) {
37 -
        return Q.reject(new CordovaError('Can not run this platform with administrative ' +
36 +
        return Promise.reject(new CordovaError('Can not run this platform with administrative ' +
38 37
            'permissions. Must be run from a non-admin prompt.'));
39 38
    }
40 39
@@ -49,13 +48,13 @@
Loading
49 48
50 49
    // Validate args
51 50
    if (options.debug && options.release) {
52 -
        return Q.reject(new CordovaError('Only one of "debug"/"release" options should be specified'));
51 +
        return Promise.reject(new CordovaError('Only one of "debug"/"release" options should be specified'));
53 52
    }
54 53
    if ((options.device && options.emulator) || ((options.device || options.emulator) && options.target)) {
55 -
        return Q.reject(new CordovaError('Only one of "device"/"emulator"/"target" options should be specified'));
54 +
        return Promise.reject(new CordovaError('Only one of "device"/"emulator"/"target" options should be specified'));
56 55
    }
57 56
    if (args.phone && args.win) {
58 -
        return Q.reject(new CordovaError('Only one of "phone"/"win" options should be specified'));
57 +
        return Promise.reject(new CordovaError('Only one of "phone"/"win" options should be specified'));
59 58
    }
60 59
61 60
    // Get build/deploy options
@@ -71,7 +70,7 @@
Loading
71 70
    var buildTargets = build.getBuildTargets(args.win, args.phone, args.appx);
72 71
73 72
    if (!buildTargets || buildTargets.length <= 0) {
74 -
        return Q.reject(new CordovaError('Unable to determine deploy target.'));
73 +
        return Promise.reject(new CordovaError('Unable to determine deploy target.'));
75 74
    }
76 75
77 76
    // we deploy the first build target so we use buildTargets[0] to determine
@@ -90,7 +89,7 @@
Loading
90 89
                return packages.deployToPhone(pkg, deployTarget, args.win10tools)
91 90
                    .catch(function (e) {
92 91
                        if (options.target || options.emulator || options.device) {
93 -
                            return Q.reject(e); // Explicit target, carry on
92 +
                            return Promise.reject(e); // Explicit target, carry on
94 93
                        }
95 94
                        // 'device' was inferred initially, because no target was specified
96 95
                        return packages.deployToPhone(pkg, 'emulator', args.win10tools);

@@ -17,7 +17,6 @@
Loading
17 17
       under the License.
18 18
*/
19 19
20 -
var Q = require('q');
21 20
var fs = require('fs');
22 21
var path = require('path');
23 22
var utils = require('./utils');
@@ -32,7 +31,7 @@
Loading
32 31
    var appPackages = path.resolve(path.join(__dirname, '..', '..', 'AppPackages'));
33 32
    // reject promise if AppPackages folder doesn't exist
34 33
    if (!fs.existsSync(appPackages)) {
35 -
        return Q.reject('AppPackages folder doesn\'t exist');
34 +
        return Promise.reject('AppPackages folder doesn\'t exist');
36 35
    }
37 36
    // find out and resolve paths for all folders inside AppPackages
38 37
    var pkgDirs = fs.readdirSync(appPackages).map(function (relative) {
@@ -62,13 +61,13 @@
Loading
62 61
                (pkgInfo.archs && pkgInfo.archs.indexOf(buildArch) > -1))) {
63 62
                // if package's properties match properties provided
64 63
                // resolve the promise with this package's info
65 -
                return Q.resolve(pkgInfo);
64 +
                return Promise.resolve(pkgInfo);
66 65
            }
67 66
        }
68 67
    }
69 68
70 69
    // reject because seems that no corresponding packages found
71 -
    return Q.reject('Package with specified parameters not found in AppPackages folder');
70 +
    return Promise.reject('Package with specified parameters not found in AppPackages folder');
72 71
};
73 72
74 73
function getPackagePhoneProductId (packageFile) {
@@ -117,10 +116,10 @@
Loading
117 116
    // because the function is only used for desktop deployment, which always has the same
118 117
    // package name when uninstalling / reinstalling
119 118
    try {
120 -
        return Q.when(AppxManifest.get(path.join(platformPath, 'package.windows.appxmanifest'))
119 +
        return Promise.resolve(AppxManifest.get(path.join(platformPath, 'package.windows.appxmanifest'))
121 120
            .getIdentity().getName());
122 121
    } catch (e) {
123 -
        return Q.reject('Can\'t read package name from manifest ' + e);
122 +
        return Promise.reject('Can\'t read package name from manifest ' + e);
124 123
    }
125 124
}
126 125
@@ -140,11 +139,11 @@
Loading
140 139
            for (var idx in sortedList) {
141 140
                if (sortedList[idx].toString().toLowerCase().indexOf(target) > -1) {
142 141
                    // we should return index based on original list
143 -
                    return Q.resolve(sortedList[idx]);
142 +
                    return Promise.resolve(sortedList[idx]);
144 143
                }
145 144
            }
146 145
        } else if (target === 'device') {
147 -
            return Q.resolve(deviceList[0]);
146 +
            return Promise.resolve(deviceList[0]);
148 147
        } else {
149 148
            var candidateList = deviceList.filter(function (device) {
150 149
                if (device.index === parseInt(target, 10)) {
@@ -160,7 +159,7 @@
Loading
160 159
                return candidateList[0];
161 160
            }
162 161
        }
163 -
        return Q.reject('Specified device not found');
162 +
        return Promise.reject('Specified device not found');
164 163
    });
165 164
};
166 165
@@ -184,7 +183,7 @@
Loading
184 183
module.exports.deployToPhone = function (pkg, deployTarget, targetWindows10, deploymentTool) {
185 184
    var deployment;
186 185
    if (deploymentTool) {
187 -
        deployment = Q(deploymentTool);
186 +
        deployment = Promise.resolve(deploymentTool);
188 187
    } else {
189 188
        deployment = utils.getAppDeployUtils(targetWindows10);
190 189
    }
@@ -216,7 +215,7 @@
Loading
216 215
// deploys specified package to desktop
217 216
module.exports.deployToDesktop = function (pkg, deployTarget) {
218 217
    if (deployTarget !== 'device' && deployTarget !== 'emulator') {
219 -
        return Q.reject('Deploying desktop apps to specific target not supported');
218 +
        return Promise.reject('Deploying desktop apps to specific target not supported');
220 219
    }
221 220
222 221
    return utils.getAppStoreUtils().then(function (appStoreUtils) {

@@ -17,7 +17,6 @@
Loading
17 17
       under the License.
18 18
*/
19 19
20 -
var Q = require('q');
21 20
var fs = require('fs');
22 21
var path = require('path');
23 22
var shell = require('shelljs');
@@ -606,7 +605,7 @@
Loading
606 605
    AppxManifest.purgeCache();
607 606
608 607
    // Update own www dir with project's www assets and plugins' assets and js-files
609 -
    return Q.when(updateWww(cordovaProject, this.locations))
608 +
    return Promise.resolve(updateWww(cordovaProject, this.locations))
610 609
        .then(function () {
611 610
            // update project according to config.xml changes.
612 611
            return updateProjectAccordingTo(self._config, self.locations);
@@ -636,13 +635,13 @@
Loading
636 635
    var projectConfigFile = path.join(projectRoot, 'config.xml');
637 636
    if ((options && options.noPrepare) || !fs.existsSync(projectConfigFile) ||
638 637
            !fs.existsSync(this.locations.configXml)) {
639 -
        return Q();
638 +
        return Promise.resolve();
640 639
    }
641 640
642 641
    var projectConfig = new ConfigParser(this.locations.configXml);
643 642
644 643
    var self = this;
645 -
    return Q().then(function () {
644 +
    return Promise.resolve().then(function () {
646 645
        cleanWww(projectRoot, self.locations);
647 646
        cleanImages(projectRoot, projectConfig, self.locations);
648 647
    });

@@ -17,7 +17,6 @@
Loading
17 17
       under the License.
18 18
*/
19 19
20 -
var Q = require('q');
21 20
var fs = require('fs');
22 21
var path = require('path');
23 22
var spawn = require('cordova-common').superspawn.spawn;
@@ -28,10 +27,10 @@
Loading
28 27
module.exports.getAppStoreUtils = function () {
29 28
    var appStoreUtils = path.join(__dirname, 'WindowsStoreAppUtils.ps1');
30 29
    if (!fs.existsSync(appStoreUtils)) {
31 -
        return Q.reject('Can\'t unblock AppStoreUtils script');
30 +
        return Promise.reject('Can\'t unblock AppStoreUtils script');
32 31
    }
33 32
    return spawn('powershell', ['Unblock-File', module.exports.quote(appStoreUtils)], { stdio: 'ignore' })
34 -
        .thenResolve(appStoreUtils);
33 +
        .then(() => appStoreUtils);
35 34
};
36 35
37 36
// returns path to AppDeploy util from Windows Phone 8.1 SDK
@@ -40,10 +39,10 @@
Loading
40 39
    var tool = DeploymentTool.getDeploymentTool(version);
41 40
42 41
    if (!tool.isAvailable()) {
43 -
        return Q.reject('App deployment utilities: "' + tool.path + '", not found.  Ensure the Windows SDK is installed.');
42 +
        return Promise.reject('App deployment utilities: "' + tool.path + '", not found.  Ensure the Windows SDK is installed.');
44 43
    }
45 44
46 -
    return Q.resolve(tool);
45 +
    return Promise.resolve(tool);
47 46
};
48 47
49 48
// checks to see if a .jsproj file exists in the project root

@@ -17,7 +17,6 @@
Loading
17 17
       under the License.
18 18
*/
19 19
20 -
var Q = require('q');
21 20
var path = require('path');
22 21
var fs = require('fs');
23 22
var shell = require('shelljs');
@@ -116,7 +115,7 @@
Loading
116 115
    var versions = ['15.9', '15.5', '15.0', '14.0', '12.0', '4.0'];
117 116
    events.emit('verbose', 'Searching for available MSBuild versions...');
118 117
119 -
    return Q.all(versions.map(checkMSBuildVersion)).then(function (unprocessedResults) {
118 +
    return Promise.all(versions.map(checkMSBuildVersion)).then(function (unprocessedResults) {
120 119
        return unprocessedResults.filter(function (item) {
121 120
            return !!item;
122 121
        });
@@ -128,12 +127,12 @@
Loading
128 127
module.exports.findAvailableVersion = function () {
129 128
    var versions = ['15.5', '15.0', '14.0', '12.0', '4.0'];
130 129
131 -
    return Q.all(versions.map(checkMSBuildVersion)).then(function (versions) {
130 +
    return Promise.all(versions.map(checkMSBuildVersion)).then(function (versions) {
132 131
        // console.log('findAvailableVersion', versions);
133 132
        // select first msbuild version available, and resolve promise with it
134 133
        var msbuildTools = versions[0] || versions[1] || versions[2] || versions[3] || versions[4];
135 134
136 -
        return msbuildTools ? Q.resolve(msbuildTools) : Q.reject('MSBuild tools not found');
135 +
        return msbuildTools ? Promise.resolve(msbuildTools) : Promise.reject('MSBuild tools not found');
137 136
    });
138 137
};
139 138

@@ -17,7 +17,6 @@
Loading
17 17
       under the License.
18 18
*/
19 19
20 -
var Q = require('q');
21 20
var path = require('path');
22 21
var nopt = require('nopt');
23 22
var shell = require('shelljs');
@@ -51,7 +50,7 @@
Loading
51 50
    ROOT = this.root || ROOT;
52 51
53 52
    if (!utils.isCordovaProject(this.root)) {
54 -
        return Q.reject(new CordovaError('Could not find project at ' + this.root));
53 +
        return Promise.reject(new CordovaError('Could not find project at ' + this.root));
55 54
    }
56 55
57 56
    var buildConfig = parseAndValidateArgs(buildOptions);
@@ -78,7 +77,7 @@
Loading
78 77
            events.emit('verbose', ' BUILD OUTPUT: ' + pkg.appx);
79 78
            return pkg;
80 79
        }).catch(function (error) {
81 -
            return Q.reject(new CordovaError('Build failed', error));
80 +
            return Promise.reject(new CordovaError('Build failed', error));
82 81
        });
83 82
};
84 83
@@ -385,7 +384,7 @@
Loading
385 384
386 385
            return msbuild.buildProject(path.join(ROOT, build.target), config.buildType, build.arch, otherProperties);
387 386
        });
388 -
    }, Q());
387 +
    }, Promise.resolve());
389 388
390 389
    if (shouldBundle) {
391 390
        return buildsCompleted.then(function () {
@@ -453,5 +452,5 @@
Loading
453 452
        .forEach(function (dir) {
454 453
            shell.rm('-rf', path.join(projectPath, dir));
455 454
        });
456 -
    return Q.resolve();
455 +
    return Promise.resolve();
457 456
};
Files Coverage
template/cordova 76.80%
bin/lib/check_reqs.js 31.17%
Project Totals (17 files) 73.48%
Sunburst
The inner-most circle is the entire project, moving away from the center are folders then, finally, a single file. The size and color of each slice is representing the number of statements and the coverage, respectively.
Icicle
The top section represents the entire project. Proceeding with folders and finally individual files. The size and color of each slice is representing the number of statements and the coverage, respectively.
Grid
Each block represents a single file in the project. The size and color of each block is represented by the number of statements and the coverage, respectively.
Loading