|
1 | | -//Cross walk process |
2 | | - |
3 | | -//See the cordova-engine-crosswalk plugin for how to install the browser as a plugin |
4 | | -//https://github.com/MobileChromeApps/cordova-crosswalk-engine |
5 | | - |
6 | | -//Find CrossWalk webviews here: |
7 | | -//https://download.01.org/crosswalk/releases/crosswalk/android/stable/ |
8 | | - |
9 | | -//Download the release for cordova-crosswalk-engine |
10 | | -//Download the release for cordova-android with crosswalk |
11 | | -//Ensure Android API 19 is installed |
12 | | -//Run ionic platform rm android |
13 | | -//Run ionic platform add ./engine/cordova-android-crosswalk |
14 | | -//Run ionic plugin add ./engine/cordova-crosswalk-engine |
15 | | -//Run android update project on android file |
16 | | -//Run project - cordova run android BUILD_MULTIPLE_APKS=true |
17 | | - |
18 | | -var argv = require('optimist').argv, |
19 | | - Task = require('./task').Task, |
20 | | - _ = require('underscore'), |
21 | | - IonicProject = require('./project'), |
22 | | - IonicAppLib = require('ionic-app-lib'), |
23 | | - Info = IonicAppLib.info, |
24 | | - Browser = IonicAppLib.browser; |
| 1 | +//Deprecated |
| 2 | +var argv = Task = require('./task').Task; |
25 | 3 |
|
26 | 4 | var IonicTask = function() {}; |
27 | 5 | IonicTask.prototype = new Task(); |
28 | 6 |
|
29 | 7 | IonicTask.prototype.run = function run(ionic) { |
30 | | - try { |
31 | | - var self = this; |
32 | | - this.ionic = ionic; |
33 | | - |
34 | | - if(!Info.checkRuntime()) { |
35 | | - console.log('\nPlease update your runtime environment before running the browser command'); |
36 | | - return |
37 | | - } |
38 | | - |
39 | | - if(argv._.length < 2) { |
40 | | - return this.ionic.fail('Invalid command usage', 'browser'); |
41 | | - } |
42 | | - |
43 | | - var cmdArg, x, y, hasValidCmd = false; |
44 | | - |
45 | | - cmdArg = argv._[1] |
46 | | - |
47 | | - var validCommands = 'add remove rm list ls revert versions clean upgrade'.split(' '); |
48 | | - for(y=0; y<validCommands.length; y++) { |
49 | | - if(cmdArg == validCommands[y]) { |
50 | | - hasValidCmd = true; |
51 | | - break; |
52 | | - } |
53 | | - } |
54 | | - |
55 | | - if(!hasValidCmd) { |
56 | | - return this.ionic.fail('You did not supply a valid command', 'browser'); |
57 | | - } |
58 | | - |
59 | | - var appDirectory = process.cwd(); |
60 | | - var platform = argv._[2], |
61 | | - browserToInstall = argv._[2]; |
62 | | - |
63 | | - var dontSavePlatformsPlugins = !(argv.nosave || argv.n); |
64 | | - |
65 | | - switch(cmdArg) { |
66 | | - case 'add': |
67 | | - Browser.addBrowser(appDirectory, browserToInstall, dontSavePlatformsPlugins); |
68 | | - break; |
69 | | - case 'clean': |
70 | | - Browser.clean(appDirectory); |
71 | | - break; |
72 | | - case 'remove': |
73 | | - case 'rm': |
74 | | - Browser.removeBrowser(appDirectory, browserToInstall); |
75 | | - break; |
76 | | - case 'revert': |
77 | | - Browser.revertBrowser(appDirectory, platform); |
78 | | - break; |
79 | | - case 'list': |
80 | | - case 'ls': |
81 | | - Browser.listBrowsers(appDirectory); |
82 | | - break; |
83 | | - case 'upgrade': |
84 | | - Browser.upgradeCrosswalk(appDirectory); |
85 | | - break; |
86 | | - case 'update': |
87 | | - case 'up': |
88 | | - Browser.addBrowser(appDirectory); |
89 | | - break; |
90 | | - case 'check': |
91 | | - console.log('Checking for engine'); |
92 | | - break; |
93 | | - case 'info': |
94 | | - case 'versions': |
95 | | - Browser.listInstalledBrowsers(appDirectory); |
96 | | - } |
97 | | - |
98 | | - } catch (ex) { |
99 | | - console.log(ex.stack); |
100 | | - console.log('Exception:', ex); |
101 | | - } |
102 | | - |
| 8 | + console.log( |
| 9 | + 'The browser task has been deprecated.\n' + |
| 10 | + 'Please use the Cordova Crosswalk plugin instead:\n\n' + |
| 11 | + 'ionic platform add android\n' + |
| 12 | + 'ionic plugin add cordova-plugin-crosswalk-webview\n' |
| 13 | + ); |
103 | 14 | }; |
104 | 15 |
|
105 | 16 | exports.IonicTask = IonicTask; |
0 commit comments