# All files / dist/platformTools target.js

14.67% Statements 11/75
0% Branches 0/57
0% Functions 0/15
33.33% Lines 9/27

Press n or j to go to the next uncovered block, b, p or k for the previous block.

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    924x
    4x
    4x
    4x

    4x

    4x

    4x

    4x

    4x
     var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.targetList=exports.targetLaunch=void 0;var _regenerator=_interopRequireDefault(require("@babel/runtime/regenerator"));
    var _chalk=_interopRequireDefault(require("chalk"));
    var _path=_interopRequireDefault(require("path"));
    var _inquirer=_interopRequireDefault(require("inquirer"));
    var _common=require("../common");

    var _setupTools=_interopRequireDefault(require("../setupTools"));
    var _constants=require("../constants");
    var _tizen=require("../platformTools/tizen");
    var _webos=require("../platformTools/webos");
    var _android=require("../platformTools/android");
    var _apple=require("../platformTools/apple");
    var _firefox=require("../platformTools/firefox");

    var targetLaunch=function targetLaunch(c){var platform,program,target;return _regenerator.default.async(function targetLaunch$(_context){while(1){switch(_context.prev=_context.next){case 0:
    (0,_common.logTask)('_runLaunch');_context.next=3;return _regenerator.default.awrap(

    (0,_common.isPlatformSupported)(c));case 3:

    platform=c.platform,program=c.program;
    target=program.target||c.files.private.config.defaultTargets[platform];_context.t0=

    platform;_context.next=_context.t0===
    _constants.ANDROID?8:_context.t0===
    _constants.ANDROID_TV?8:_context.t0===
    _constants.ANDROID_WEAR?8:_context.t0===

    _constants.IOS?10:_context.t0===
    _constants.TVOS?10:_context.t0===

    _constants.TIZEN?12:_context.t0===

    _constants.WEBOS?14:_context.t0===

    _constants.KAIOS?16:18;break;case 8:(0,_android.launchAndroidSimulator)(c,platform,target).then(function(){return resolve();}).catch(function(e){return reject(e);});return _context.abrupt("return");case 10:(0,_apple.launchAppleSimulator)(c,platform,target).then(function(){return resolve();}).catch(function(e){return reject(e);});return _context.abrupt("return");case 12:(0,_tizen.launchTizenSimulator)(c,target).then(function(){return resolve();}).catch(function(e){return reject(e);});return _context.abrupt("return");case 14:(0,_webos.launchWebOSimulator)(c,target).then(function(){return resolve();}).catch(function(e){return reject(e);});return _context.abrupt("return");case 16:
    (0,_firefox.launchKaiOSSimulator)(c,target).
    then(function(){return resolve();}).
    catch(function(e){return reject(e);});return _context.abrupt("return");case 18:return _context.abrupt("return",

    Promise.reject("\"target launch\" command does not support "+
    _chalk.default.white.bold(
    platform)+" platform yet. You will have to launch the emulator manually. Working on it!"));case 19:case"end":return _context.stop();}}});};exports.targetLaunch=targetLaunch;

    var targetList=function targetList(c){var platform,throwError,setupInstance;return _regenerator.default.async(function targetList$(_context2){while(1){switch(_context2.prev=_context2.next){case 0:
    (0,_common.logTask)('targetList');_context2.next=3;return _regenerator.default.awrap(

    (0,_common.isPlatformSupported)(c));case 3:

    platform=c.platform;if(
    (0,_common.isPlatformSupportedSync)(platform)){_context2.next=6;break;}return _context2.abrupt("return");case 6:

    throwError=function throwError(err){
    throw err;
    };_context2.t0=

    platform;_context2.next=_context2.t0===
    _constants.ANDROID?10:_context2.t0===
    _constants.ANDROID_TV?10:_context2.t0===
    _constants.ANDROID_WEAR?10:_context2.t0===

    _constants.IOS?15:_context2.t0===
    _constants.TVOS?15:_context2.t0===

    _constants.WEBOS?16:19;break;case 10:if((0,_common.checkSdk)(c,platform,_common.logError)){_context2.next=14;break;}setupInstance=(0,_setupTools.default)(c);_context2.next=14;return _regenerator.default.awrap(setupInstance.askToInstallSDK('android'));case 14:return _context2.abrupt("return",(0,_android.listAndroidTargets)(c,platform));case 15:return _context2.abrupt("return",(0,_apple.listAppleDevices)(c,platform));case 16:if(
    (0,_common.checkSdk)(c,platform,throwError)){_context2.next=18;break;}return _context2.abrupt("return");case 18:return _context2.abrupt("return",
    (0,_webos.listWebOSTargets)(c));case 19:throw"\"target list\" command does not support "+

    _chalk.default.white.bold(platform)+" platform yet. Working on it!";case 20:case"end":return _context2.stop();}}});};exports.targetList=targetList;
    //# sourceMappingURL=target.js.map