var init = function () { projectDir = jetpack; tmpDir = projectDir.dir('./tmp', { empty: true }); releasesDir = projectDir.dir('./releases'); manifest = projectDir.read('app/package.json', 'json'); packName = manifest.name + '_' + manifest.version; packDir = tmpDir.dir(packName); readyAppDir = packDir.cwd('opt', manifest.name); return Q(); }
var cleanupRuntime = function() { finalAppDir.remove('Contents/Resources/default_app'); finalAppDir.remove('Contents/Resources/atom.icns'); return Q(); }
var signApp = function () { var identity = utils.getSigningId(); if (identity) { var cmd = 'codesign --deep --force --sign "' + identity + '" "' + finalAppDir.path() + '"'; gulpUtil.log('Signing with:', cmd); return Q.nfcall(child_process.exec, cmd); } else { return Q(); } }
var renameApp = function() { // Rename helpers [' Helper EH', ' Helper NP', ' Helper'].forEach(function (helper_suffix) { finalAppDir.rename('Contents/Frameworks/Electron' + helper_suffix + '.app/Contents/MacOS/Electron' + helper_suffix, manifest.productName + helper_suffix ); finalAppDir.rename('Contents/Frameworks/Electron' + helper_suffix + '.app', manifest.productName + helper_suffix + '.app'); }); // Rename application finalAppDir.rename('Contents/MacOS/Electron', manifest.productName); return Q(); }
var finalize = function () { // Create .desktop file from the template var desktop = projectDir.read('resources/linux/app.desktop'); desktop = utils.replace(desktop, { name: manifest.name, productName: manifest.productName, description: manifest.description, version: manifest.version, author: manifest.author }); packDir.write('usr/share/applications/' + manifest.name + '.desktop', desktop); // Copy icon projectDir.copy('resources/icon.png', readyAppDir.path('icon.png')); return Q(); }
var init = function () { projectDir = jetpack; tmpDir = projectDir.dir('./tmp', { empty: true }); releasesDir = projectDir.dir('./releases'); manifest = projectDir.read('app/package.json', 'json'); readyAppDir = tmpDir.cwd(manifest.name); return Q(); }
var finalize = function () { // Prepare main Info.plist var info = projectDir.read('resources/osx/Info.plist'); info = utils.replace(info, { productName: manifest.productName, identifier: manifest.identifier, version: manifest.version }); finalAppDir.write('Contents/Info.plist', info); // Prepare Info.plist of Helper apps [' EH', ' NP', ''].forEach(function (helper_suffix) { info = projectDir.read('resources/osx/helper_apps/Info' + helper_suffix + '.plist'); info = utils.replace(info, { productName: manifest.productName, identifier: manifest.identifier }); finalAppDir.write('Contents/Frameworks/Electron Helper' + helper_suffix + '.app/Contents/Info.plist', info); }); // Copy icon projectDir.copy('resources/osx/icon.icns', finalAppDir.path('Contents/Resources/icon.icns')); return Q(); }
var init = function () { projectDir = jetpack; tmpDir = projectDir.dir('./tmp', { empty: true }); releasesDir = projectDir.dir('./releases'); manifest = projectDir.read('app/package.json', 'json'); finalAppDir = tmpDir.cwd(manifest.productName + '.app'); return Q(); }
maybeRunFileTransferServer () { return Q().then(() => { const plugins = this.config.getPlugins(); for (let i = 0; i < plugins.length; i++) { if (plugins[i].indexOf('cordova-plugin-file-transfer') >= 0 && !this.config.getFileTransferServer() && !this.config.isCI()) { return this.server.startFileTransferServer(this.tempFolder.name); } } }); }
chooseTargetForIOS (emulator, target) { logger.info('cordova-paramedic: Choosing Target for iOS'); const simulatorModelId = utilities.getSimulatorModelId(this.cli, target); const simulatorData = utilities.getSimulatorData(simulatorModelId); return Q({ target: simulatorModelId, simId: simulatorData.simId }); }
uninstallAppWindows (targetObj) { const platformPath = path.join(this.appPath, 'platforms', 'windows'); const packageJSPath = path.join(platformPath, 'cordova', 'lib', 'package.js'); const programFilesPath = process.env['ProgramFiles(x86)'] || process.env.ProgramFiles; const appDeployPath = path.join(programFilesPath, 'Microsoft SDKs', 'Windows Phone', 'v8.1', 'Tools', 'AppDeploy', 'AppDeployCmd.exe'); if (fs.existsSync(packageJSPath)) { const packageJS = require(packageJSPath); const appId = packageJS.getAppId(platformPath); const uninstallCommand = '"' + appDeployPath + '"' + ' /uninstall ' + appId + ' /targetdevice:' + targetObj.target; return this.executeUninstallCommand(uninstallCommand); } return Q(); }
uninstallApp (targetObj, app) { if (!targetObj || !targetObj.target) { return Q(); } switch (this.platform) { case utilities.ANDROID: return this.uninstallAppAndroid(targetObj, app); case utilities.IOS: return this.uninstallAppIOS(targetObj, app); case utilities.WINDOWS: return this.uninstallAppWindows(targetObj, app); default: return Q(); } }
var overallResult = function() { return processes.reduce(function(nextProcess, f) { return nextProcess.then(f); }, Q()); }
checkPlatformRequirements () { if (this.isBrowser) return Q(); logger.normal('cordova-paramedic: checking the requirements for platform: ' + this.platformId); return execPromise(this.config.getCli() + ' requirements ' + this.platformId + utilities.PARAMEDIC_COMMON_CLI_ARGS) .then(() => { logger.info('cordova-paramedic: successfully finished checking the requirements for platform: ' + this.platformId); }); }
it('Too much pending', function(done){ var lock = new AsyncLock({maxPending : 1}); lock.acquire('key', function(){ return Q().delay(20); // jshint ignore:line }); lock.acquire('key', function(){ return Q().delay(20); // jshint ignore:line }); lock.acquire('key', function(){}) .catch(function(e){ done(); }); });