gulpfile.js 44 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034
  1. var gulp = require('gulp'),
  2. //var deleted = require('gulp-deleted');
  3. del = require('del'),
  4. //uglify = require('gulp-tm-uglify'),
  5. uglify = require('gulp-uglify-es').default,
  6. rename = require('gulp-rename'),
  7. changed = require('gulp-changed'),
  8. gulpif = require('gulp-if'),
  9. minimist = require('minimist'),
  10. ftp = require('gulp-ftp'),
  11. sftp = require('gulp-sftp-up4'),
  12. JSFtp = require('jsftp'),
  13. gutil = require('gulp-util'),
  14. fs = require("fs");
  15. concat = require('gulp-concat');
  16. //let uglify = require('gulp-uglify-es').default;
  17. var through2 = require('through2');
  18. var path = require('path');
  19. var sourceMap = require('gulp-sourcemaps');
  20. var assetRev = require('gulp-tm-asset-rev');
  21. var apps = require('./gulpapps.js');
  22. var ftpconfig = require('./gulpconfig.js');
  23. var o_options = minimist(process.argv.slice(2), {//upload: local ftp or sftp
  24. string: ["ev", "upload", "location", "host", "user", "pass", "port", "remotePath", "dest", "src", "lp"]
  25. });
  26. function getEvOptions(ev){
  27. options.ev = ev;
  28. return (ftpconfig[ev]) || {
  29. 'location': '',
  30. 'host': '',
  31. 'user': '',
  32. 'pass': '',
  33. "port": null,
  34. "remotePath": "",
  35. "dest": "dest",
  36. "upload": ""
  37. }
  38. }
  39. function setOptions(op1, op2){
  40. if (!op2) op2 = {};
  41. options.upload = op1.upload || op2.upload || "";
  42. options.location = op1.location || op2.location || "";
  43. options.host = op1.host || op2.host || "";
  44. options.user = op1.user || op2.user || "";
  45. options.pass = op1.pass || op2.pass || "";
  46. options.port = op1.port || op2.port || "";
  47. options.remotePath = op1.remotePath || op2.remotePath || "";
  48. options.dest = op1.dest || op2.dest || "dest";
  49. options.lp = op1.lp || op2.lp || "zh-cn";
  50. }
  51. var options = {};
  52. setOptions(o_options, getEvOptions(o_options.ev));
  53. var appTasks = [];
  54. function createDefaultTask(path, isMin, thisOptions) {
  55. gulp.task(path, function (cb) {
  56. //var srcFile = 'source/' + path + '/**/*';
  57. var option = thisOptions || options;
  58. var src;
  59. var dest = option.dest+'/' + path + '/';
  60. let ev = option.ev
  61. var evList = Object.keys(ftpconfig).map((i)=>{ return (i==ev) ? "*"+i : i; });
  62. if (isMin){
  63. var src_min = ['source/' + path + '/**/*.js', '!**/*.spec.js', '!**/test/**'];
  64. var src_move = ['source/' + path + '/**/*', '!**/*.spec.js', '!**/test/**'];
  65. gutil.log("Move-Uglify", ":", gutil.colors.green(gutil.colors.blue(path), gutil.colors.white('->'), dest));
  66. return gulp.src(src_min)
  67. .pipe(changed(dest))
  68. .pipe(uglify())
  69. .pipe(rename({ extname: '.min.js' }))
  70. .pipe(gulpif((option.upload == 'local' && option.location != ''), gulp.dest(option.location + path + '/')))
  71. .pipe(gulpif((option.upload == 'ftp' && option.host != ''), ftp({
  72. host: option.host,
  73. user: option.user || 'anonymous',
  74. pass: option.pass || '@anonymous',
  75. port: option.port || 21,
  76. remotePath: (option.remotePath || '/') + path
  77. })))
  78. .pipe(gulpif((option.upload == 'sftp' && option.host != ''), sftp({
  79. host: option.host,
  80. user: option.user || 'anonymous',
  81. pass: option.pass || null,
  82. port: option.port || 22,
  83. remotePath: (option.remotePath || '/') + path
  84. })))
  85. .pipe(gulpif((option.ev == "dev" || option.ev == "pro") ,gulp.dest(dest)))
  86. .pipe(gulp.src(src_move))
  87. .pipe(changed(dest))
  88. .pipe(gulpif((option.upload == 'local' && option.location != ''), gulp.dest(option.location + path + '/')))
  89. .pipe(gulpif((option.upload == 'ftp' && option.host != ''), ftp({
  90. host: option.host,
  91. user: option.user || 'anonymous',
  92. pass: option.pass || '@anonymous',
  93. port: option.port || 21,
  94. remotePath: (option.remotePath || '/') + path
  95. })))
  96. .pipe(gulpif((option.upload == 'sftp' && option.host != ''), sftp({
  97. host: option.host,
  98. user: option.user || 'anonymous',
  99. pass: option.pass || null,
  100. port: option.port || 22,
  101. remotePath: (option.remotePath || '/') + path
  102. })))
  103. .pipe(gulp.dest(dest))
  104. .pipe(gutil.noop());
  105. }else{
  106. src = ['source/' + path + '/**/*', '!**/*.spec.js', '!**/test/**'];
  107. gutil.log("Move", ":", gutil.colors.green(gutil.colors.blue(path), gutil.colors.white('->'), dest));
  108. return gulp.src(src)
  109. .pipe(changed(dest))
  110. .pipe(gulpif((option.upload == 'local' && option.location != ''), gulp.dest(option.location + path + '/')))
  111. .pipe(gulpif((option.upload == 'ftp' && option.host != ''), ftp({
  112. host: option.host,
  113. user: option.user || 'anonymous',
  114. pass: option.pass || '@anonymous',
  115. port: option.port || 21,
  116. remotePath: (option.remotePath || '/') + path
  117. })))
  118. .pipe(gulpif((option.upload == 'sftp' && option.host != ''), sftp({
  119. host: option.host,
  120. user: option.user || 'anonymous',
  121. pass: option.pass || null,
  122. port: option.port || 22,
  123. remotePath: (option.remotePath || '/') + path
  124. })))
  125. .pipe(gulp.dest(dest))
  126. .pipe(gutil.noop());
  127. }
  128. });
  129. }
  130. function createXFormConcatTask(path, isMin, thisOptions) {
  131. gulp.task(path+" : concat", function(){
  132. var option = thisOptions || options;
  133. var src = [
  134. 'source/o2_core/o2/widget/AttachmentController.js',
  135. 'source/o2_core/o2/xScript/Macro.js',
  136. 'source/o2_core/o2/widget/Tab.js',
  137. 'source/o2_core/o2/widget/O2Identity.js',
  138. 'source/' + path + '/Form.js',
  139. 'source/' + path + '/$Module.js',
  140. 'source/' + path + '/$Input.js',
  141. 'source/' + path + '/Div.js',
  142. 'source/' + path + '/Combox.js',
  143. 'source/' + path + '/DatagridMobile.js',
  144. 'source/' + path + '/DatagridPC.js',
  145. 'source/' + path + '/Textfield.js',
  146. 'source/' + path + '/Personfield.js',
  147. 'source/' + path + '/Button.js',
  148. 'source/' + path + '/ViewSelector.js',
  149. 'source/' + path + '/*.js',
  150. 'source/x_component_process_Work/Processor.js',
  151. '!source/' + path + '/Office.js'
  152. ];
  153. var dest = option.dest+'/' + path + '/';
  154. return gulp.src(src)
  155. .pipe(sourceMap.init())
  156. .pipe(concat('$all.js'))
  157. .pipe(gulpif((option.upload == 'local' && option.location != ''), gulp.dest(option.location + path + '/')))
  158. .pipe(gulpif((option.upload == 'ftp' && option.host != ''), ftp({
  159. host: option.host,
  160. user: option.user || 'anonymous',
  161. pass: option.pass || '@anonymous',
  162. port: option.port || 21,
  163. remotePath: (option.remotePath || '/') + path
  164. })))
  165. .pipe(gulpif((option.upload == 'sftp' && option.host != ''), sftp({
  166. host: option.host,
  167. user: option.user || 'anonymous',
  168. pass: option.pass || null,
  169. port: option.port || 22,
  170. remotePath: (option.remotePath || '/') + path
  171. })))
  172. .pipe(gulp.dest(dest))
  173. .pipe(concat('$all.min.js'))
  174. .pipe(uglify())
  175. .pipe(sourceMap.write(""))
  176. .pipe(gulpif((option.upload == 'local' && option.location != ''), gulp.dest(option.location + path + '/')))
  177. .pipe(gulpif((option.upload == 'ftp' && option.host != ''), ftp({
  178. host: option.host,
  179. user: option.user || 'anonymous',
  180. pass: option.pass || '@anonymous',
  181. port: option.port || 21,
  182. remotePath: (option.remotePath || '/') + path
  183. })))
  184. .pipe(gulpif((option.upload == 'sftp' && option.host != ''), sftp({
  185. host: option.host,
  186. user: option.user || 'anonymous',
  187. pass: option.pass || null,
  188. port: option.port || 22,
  189. remotePath: (option.remotePath || '/') + path
  190. })))
  191. .pipe(gulp.dest(dest))
  192. });
  193. }
  194. function createO2ConcatTask(path, isMin, thisOptions) {
  195. gulp.task(path+" : concat", function(){
  196. var option = thisOptions || options;
  197. var src = [
  198. 'source/o2_lib/mootools/mootools-1.6.0_all.js',
  199. 'source/o2_lib/mootools/plugin/mBox.js',
  200. 'source/' + path + '/o2.js'
  201. ];
  202. var dest = option.dest+'/' + path + '/';
  203. return gulp.src(src)
  204. .pipe(sourceMap.init())
  205. .pipe(concat('o2.js'))
  206. .pipe(gulpif((option.upload == 'local' && option.location != ''), gulp.dest(option.location + path + '/')))
  207. .pipe(gulpif((option.upload == 'ftp' && option.host != ''), ftp({
  208. host: option.host,
  209. user: option.user || 'anonymous',
  210. pass: option.pass || '@anonymous',
  211. port: option.port || 21,
  212. remotePath: (option.remotePath || '/') + path
  213. })))
  214. .pipe(gulpif((option.upload == 'sftp' && option.host != ''), sftp({
  215. host: option.host,
  216. user: option.user || 'anonymous',
  217. pass: option.pass || null,
  218. port: option.port || 22,
  219. remotePath: (option.remotePath || '/') + path
  220. })))
  221. .pipe(gulp.dest(dest))
  222. .pipe(concat('o2.min.js'))
  223. .pipe(uglify())
  224. //.pipe(rename({ extname: '.min.js' }))
  225. .pipe(sourceMap.write(""))
  226. .pipe(gulpif((option.upload == 'local' && option.location != ''), gulp.dest(option.location + path + '/')))
  227. .pipe(gulpif((option.upload == 'ftp' && option.host != ''), ftp({
  228. host: option.host,
  229. user: option.user || 'anonymous',
  230. pass: option.pass || '@anonymous',
  231. port: option.port || 21,
  232. remotePath: (option.remotePath || '/') + path
  233. })))
  234. .pipe(gulpif((option.upload == 'sftp' && option.host != ''), sftp({
  235. host: option.host,
  236. user: option.user || 'anonymous',
  237. pass: option.pass || null,
  238. port: option.port || 22,
  239. remotePath: (option.remotePath || '/') + path
  240. })))
  241. .pipe(gulp.dest(dest))
  242. });
  243. gulp.task(path+".xDesktop : concat", function(){
  244. var option = thisOptions || options;
  245. var src = [
  246. 'source/'+path+'/o2/widget/Common.js',
  247. 'source/'+path+'/o2/widget/Dialog.js',
  248. 'source/'+path+'/o2/widget/UUID.js',
  249. 'source/'+path+'/o2/xDesktop/Common.js',
  250. 'source/'+path+'/o2/xDesktop/Actions/RestActions.js',
  251. 'source/'+path+'/o2/xAction/RestActions.js',
  252. 'source/'+path+'/o2/xDesktop/Access.js',
  253. 'source/'+path+'/o2/xDesktop/Dialog.js',
  254. 'source/'+path+'/o2/xDesktop/Menu.js',
  255. 'source/'+path+'/o2/xDesktop/UserData.js',
  256. 'source/x_component_Template/MPopupForm.js',
  257. 'source/'+path+'/o2/xDesktop/Authentication.js',
  258. 'source/'+path+'/o2/xDesktop/Dialog.js',
  259. 'source/'+path+'/o2/xDesktop/Window.js',
  260. 'source/x_component_Common/Main.js'
  261. ];
  262. var dest = option.dest+'/' + path + '/o2/xDesktop/';
  263. return gulp.src(src)
  264. .pipe(sourceMap.init())
  265. .pipe(concat('$all.js'))
  266. .pipe(gulpif((option.upload == 'local' && option.location != ''), gulp.dest(option.location + path + '/o2/xDesktop/')))
  267. .pipe(gulpif((option.upload == 'ftp' && option.host != ''), ftp({
  268. host: option.host,
  269. user: option.user || 'anonymous',
  270. pass: option.pass || '@anonymous',
  271. port: option.port || 21,
  272. remotePath: (option.remotePath || '/') + path+"/o2/xDesktop/"
  273. })))
  274. .pipe(gulpif((option.upload == 'sftp' && option.host != ''), sftp({
  275. host: option.host,
  276. user: option.user || 'anonymous',
  277. pass: option.pass || null,
  278. port: option.port || 22,
  279. remotePath: (option.remotePath || '/') + path+"/o2/xDesktop/"
  280. })))
  281. .pipe(gulp.dest(dest))
  282. .pipe(concat('$all.min.js'))
  283. .pipe(uglify())
  284. //.pipe(rename({ extname: '.min.js' }))
  285. .pipe(sourceMap.write(""))
  286. .pipe(gulpif((option.upload == 'local' && option.location != ''), gulp.dest(option.location + path + '/o2/xDesktop/')))
  287. .pipe(gulpif((option.upload == 'ftp' && option.host != ''), ftp({
  288. host: option.host,
  289. user: option.user || 'anonymous',
  290. pass: option.pass || '@anonymous',
  291. port: option.port || 21,
  292. remotePath: (option.remotePath || '/') + path+"/o2/xDesktop/"
  293. })))
  294. .pipe(gulpif((option.upload == 'sftp' && option.host != ''), sftp({
  295. host: option.host,
  296. user: option.user || 'anonymous',
  297. pass: option.pass || null,
  298. port: option.port || 22,
  299. remotePath: (option.remotePath || '/') + path+"/o2/xDesktop/"
  300. })))
  301. .pipe(gulp.dest(dest))
  302. });
  303. gulp.task(path+" : bundle", function(){
  304. var option = thisOptions || options;
  305. var src = [
  306. 'source/o2_lib/mootools/mootools-1.6.0_all.js',
  307. 'source/o2_lib/mootools/plugin/mBox.js',
  308. 'source/' + path + '/o2.js',
  309. 'source/x_desktop/js/base.js',
  310. 'source/x_desktop/js/base_loader.js',
  311. "source/o2_core/o2/framework.js"
  312. ];
  313. var dest = option.dest+'/' + path + '/';
  314. return gulp.src(src)
  315. .pipe(sourceMap.init())
  316. .pipe(concat('bundle.js'))
  317. .pipe(gulpif((option.upload == 'local' && option.location != ''), gulp.dest(option.location + path + '/')))
  318. .pipe(gulpif((option.upload == 'ftp' && option.host != ''), ftp({
  319. host: option.host,
  320. user: option.user || 'anonymous',
  321. pass: option.pass || '@anonymous',
  322. port: option.port || 21,
  323. remotePath: (option.remotePath || '/') + path
  324. })))
  325. .pipe(gulpif((option.upload == 'sftp' && option.host != ''), sftp({
  326. host: option.host,
  327. user: option.user || 'anonymous',
  328. pass: option.pass || null,
  329. port: option.port || 22,
  330. remotePath: (option.remotePath || '/') + path
  331. })))
  332. .pipe(gulp.dest(dest))
  333. .pipe(concat('bundle.min.js'))
  334. .pipe(uglify())
  335. //.pipe(rename({ extname: '.min.js' }))
  336. .pipe(sourceMap.write(""))
  337. .pipe(gulpif((option.upload == 'local' && option.location != ''), gulp.dest(option.location + path + '/')))
  338. .pipe(gulpif((option.upload == 'ftp' && option.host != ''), ftp({
  339. host: option.host,
  340. user: option.user || 'anonymous',
  341. pass: option.pass || '@anonymous',
  342. port: option.port || 21,
  343. remotePath: (option.remotePath || '/') + path
  344. })))
  345. .pipe(gulpif((option.upload == 'sftp' && option.host != ''), sftp({
  346. host: option.host,
  347. user: option.user || 'anonymous',
  348. pass: option.pass || null,
  349. port: option.port || 22,
  350. remotePath: (option.remotePath || '/') + path
  351. })))
  352. .pipe(gulp.dest(dest))
  353. });
  354. }
  355. function concat_Actions(){
  356. return through2.obj(function (file, enc, cb) {
  357. debugger;
  358. if (file.isNull()) {
  359. this.push(file);
  360. return cb();
  361. }
  362. if (file.isStream()) {
  363. this.emit('error', new gutil.PluginError(PLUGIN_NAME, 'Streaming not supported'));
  364. return cb();
  365. }
  366. var content = file.contents.toString();
  367. var o = path.parse(file.path);
  368. var name = o.name;
  369. content = "var actionJson = "+content;
  370. content = content+"\nif (!o2.xAction.RestActions.Action[\""+name+"\"]) o2.xAction.RestActions.Action[\""+name+"\"] = new Class({Extends: o2.xAction.RestActions.Action});";
  371. content = content+"\no2.Actions.actions[\""+name+"\"] = new o2.xAction.RestActions.Action[\""+name+"\"](\""+name+"\", actionJson);";
  372. file.contents = new Buffer.from(content);
  373. this.push(file);
  374. cb();
  375. });
  376. }
  377. function concat_Style(){
  378. return through2.obj(function (file, enc, cb) {
  379. if (file.isNull()) {
  380. this.push(file);
  381. return cb();
  382. }
  383. if (file.isStream()) {
  384. this.emit('error', new gutil.PluginError(PLUGIN_NAME, 'Streaming not supported'));
  385. return cb();
  386. }
  387. var content = file.contents.toString();
  388. //name = ".."+file.path.replace(process.cwd(), "").replace(/\\/g, "/").substring("/source".length);
  389. var name = file.path.replace(process.cwd(), "").replace(/\\/g, "/")
  390. name = ".."+name.substring(name.indexOf("/source")+7);
  391. content = "var csskey = encodeURIComponent(\""+name+"\");\no2.widget.css[csskey]="+content;
  392. file.contents = new Buffer.from(content);
  393. this.push(file);
  394. cb();
  395. });
  396. }
  397. function createBaseWorkConcatStyleTask(path){
  398. gulp.task(path+".base_work : style", function(){
  399. return gulp.src([
  400. "source/x_component_process_Work/$Main/default/css.wcss",
  401. "source/x_component_process_Xform/$Form/default/css.wcss",
  402. "source/o2_core/o2/widget/$Tab/mobileForm/css.wcss",
  403. "source/o2_core/o2/widget/$Menu/tab/css.wcss",
  404. "source/o2_core/o2/widget/$Tab/form/css.wcss",
  405. "source/x_component_process_Xform/$Form/default/doc.wcss",
  406. "source/o2_core/o2/widget/$Toolbar/documentEdit/css.wcss",
  407. "source/o2_core/o2/widget/$Toolbar/documentEdit_side/css.wcss"
  408. ])
  409. .pipe(concat_Style())
  410. .pipe(concat('js/base_work_style_temp.js'))
  411. .pipe(gulp.dest('source/x_desktop/'))
  412. })
  413. }
  414. function createBaseWorkConcatActionTask(path){
  415. gulp.task(path+".base_work : action", function(){
  416. return gulp.src([
  417. "source/o2_core/o2/xAction/services/x_organization_assemble_authentication.json",
  418. "source/o2_core/o2/xAction/services/x_processplatform_assemble_surface.json",
  419. "source/o2_core/o2/xAction/services/x_organization_assemble_control.json",
  420. "source/o2_core/o2/xAction/services/x_query_assemble_surface.json",
  421. "source/o2_core/o2/xAction/services/x_cms_assemble_control.json",
  422. "source/o2_core/o2/xAction/services/x_program_center.json",
  423. "source/o2_core/o2/xAction/services/x_organization_assemble_personal.json"
  424. ])
  425. .pipe(concat_Actions())
  426. .pipe(concat('js/base_work_actions_temp.js'))
  427. .pipe(gulp.dest('source/x_desktop/'))
  428. })
  429. }
  430. function createBaseWorkConcatDelTempTask(path) {
  431. gulp.task(path+".base_work : clean", function(cb){
  432. var dest = [
  433. 'source/'+path+'/js/base_work_actions_temp.js',
  434. 'source/'+path+'/js/base_work_style_temp.js'
  435. ];
  436. return del(dest, cb);
  437. });
  438. }
  439. function createBaseWorkConcatBodyTask(path, isMin, thisOptions) {
  440. gulp.task(path+".base_work : concat", function(){
  441. var option = thisOptions || options;
  442. var src = [
  443. 'source/' + path + '/js/base_concat_head.js',
  444. 'source/o2_core/o2/lp/'+(option.lp || 'zh-cn')+'.js',
  445. 'source/x_component_process_Work/lp/'+(option.lp || 'zh-cn')+'.js',
  446. 'source/x_component_process_Xform/lp/'+(option.lp || 'zh-cn')+'.js',
  447. 'source/x_component_Selector/lp/'+(option.lp || 'zh-cn')+'.js',
  448. 'source/' + path + '/js/base_work_style_temp.js',
  449. 'source/o2_core/o2/widget/Common.js',
  450. 'source/o2_core/o2/widget/Dialog.js',
  451. 'source/o2_core/o2/widget/UUID.js',
  452. 'source/o2_core/o2/widget/Menu.js',
  453. 'source/o2_core/o2/widget/Toolbar.js',
  454. 'source/o2_core/o2/xDesktop/Common.js',
  455. 'source/o2_core/o2/xDesktop/Actions/RestActions.js',
  456. 'source/o2_core/o2/xAction/RestActions.js',
  457. 'source/o2_core/o2/xDesktop/Access.js',
  458. 'source/o2_core/o2/xDesktop/Dialog.js',
  459. 'source/o2_core/o2/xDesktop/Menu.js',
  460. 'source/o2_core/o2/xDesktop/UserData.js',
  461. 'source/x_component_Template/MPopupForm.js',
  462. 'source/o2_core/o2/xDesktop/Authentication.js',
  463. 'source/o2_core/o2/xDesktop/Window.js',
  464. 'source/x_component_Common/Main.js',
  465. 'source/x_component_process_Work/Main.js',
  466. 'source/x_component_Selector/package.js',
  467. 'source/x_component_Selector/Person.js',
  468. 'source/x_component_Selector/Identity.js',
  469. 'source/x_component_Selector/Unit.js',
  470. 'source/x_component_Selector/IdentityWidthDuty.js',
  471. 'source/x_component_Selector/IdentityWidthDutyCategoryByUnit.js',
  472. 'source/x_component_Selector/UnitWithType.js',
  473. 'source/o2_core/o2/xScript/Actions/UnitActions.js',
  474. 'source/o2_core/o2/xScript/Actions/ScriptActions.js',
  475. 'source/o2_core/o2/xScript/Actions/CMSScriptActions.js',
  476. 'source/o2_core/o2/xScript/Actions/PortalScriptActions.js',
  477. 'source/o2_core/o2/xScript/Environment.js',
  478. 'source/x_component_Template/MTooltips.js',
  479. 'source/x_component_Template/MSelector.js',
  480. 'source/o2_core/o2/xAction/services/x_organization_assemble_authentication.js',
  481. 'source/o2_core/o2/xAction/services/x_processplatform_assemble_surface.js',
  482. 'source/o2_core/o2/xAction/services/x_cms_assemble_control.js',
  483. 'source/o2_core/o2/xAction/services/x_organization_assemble_control.js',
  484. 'source/o2_core/o2/xAction/services/x_query_assemble_surface.js',
  485. 'source/o2_core/o2/xAction/services/x_organization_assemble_personal.js',
  486. 'source/' + path + '/js/base_work_actions_temp.js',
  487. 'source/' + path + '/js/base.js',
  488. 'source/' + path + '/js/base_loader.js'
  489. ];
  490. var dest = option.dest+'/' + path + '/';
  491. return gulp.src(src)
  492. .pipe(sourceMap.init())
  493. .pipe(concat('js/base_work.js'))
  494. .pipe(gulpif((option.upload == 'local' && option.location != ''), gulp.dest(option.location + path + '/')))
  495. .pipe(gulpif((option.upload == 'ftp' && option.host != ''), ftp({
  496. host: option.host,
  497. user: option.user || 'anonymous',
  498. pass: option.pass || '@anonymous',
  499. port: option.port || 21,
  500. remotePath: (option.remotePath || '/') + path
  501. })))
  502. .pipe(gulpif((option.upload == 'sftp' && option.host != ''), sftp({
  503. host: option.host,
  504. user: option.user || 'anonymous',
  505. pass: option.pass || null,
  506. port: option.port || 22,
  507. remotePath: (option.remotePath || '/') + path
  508. })))
  509. .pipe(gulp.dest(dest))
  510. .pipe(uglify())
  511. .pipe(concat('js/base_work.min.js'))
  512. .pipe( sourceMap.write("") )
  513. .pipe(gulpif((option.upload == 'local' && option.location != ''), gulp.dest(option.location + path + '/')))
  514. .pipe(gulpif((option.upload == 'ftp' && option.host != ''), ftp({
  515. host: option.host,
  516. user: option.user || 'anonymous',
  517. pass: option.pass || '@anonymous',
  518. port: option.port || 21,
  519. remotePath: (option.remotePath || '/') + path
  520. })))
  521. .pipe(gulpif((option.upload == 'sftp' && option.host != ''), sftp({
  522. host: option.host,
  523. user: option.user || 'anonymous',
  524. pass: option.pass || null,
  525. port: option.port || 22,
  526. remotePath: (option.remotePath || '/') + path
  527. })))
  528. .pipe(gulp.dest(dest))
  529. });
  530. }
  531. function createBaseWorkConcatTask(path, isMin, thisOptions){
  532. createBaseWorkConcatActionTask(path);
  533. createBaseWorkConcatStyleTask(path);
  534. createBaseWorkConcatBodyTask(path, isMin, thisOptions);
  535. createBaseWorkConcatDelTempTask(path);
  536. gulp.task( path+".base_work", gulp.series(path+".base_work : action", path+".base_work : style", path+".base_work : concat", path+".base_work : clean"));
  537. }
  538. function createBasePortalConcatStyleTask(path){
  539. gulp.task(path+".base_portal : style", function(){
  540. return gulp.src([
  541. "source/x_component_process_Work/$Main/default/css.wcss",
  542. "source/x_component_portal_Portal/$Main/default/css.wcss",
  543. "source/x_component_process_Xform/$Form/default/css.wcss",
  544. "source/o2_core/o2/widget/$Tab/mobileForm/css.wcss",
  545. "source/o2_core/o2/widget/$Menu/tab/css.wcss"
  546. ])
  547. .pipe(concat_Style())
  548. .pipe(concat('js/base_portal_style_temp.js'))
  549. .pipe(gulp.dest('source/x_desktop/'))
  550. })
  551. }
  552. function createBasePortalConcatActionTask(path){
  553. gulp.task(path+".base_portal : action", function(){
  554. return gulp.src([
  555. "source/o2_core/o2/xAction/services/x_organization_assemble_authentication.json",
  556. "source/o2_core/o2/xAction/services/x_portal_assemble_surface.json",
  557. "source/o2_core/o2/xAction/services/x_organization_assemble_control.json",
  558. "source/o2_core/o2/xAction/services/x_query_assemble_surface.json",
  559. "source/o2_core/o2/xAction/services/x_cms_assemble_control.json",
  560. "source/o2_core/o2/xAction/services/x_program_center.json",
  561. "source/o2_core/o2/xAction/services/x_organization_assemble_personal.json"
  562. ])
  563. .pipe(concat_Actions())
  564. .pipe(concat('js/base_portal_actions_temp.js'))
  565. .pipe(gulp.dest('source/x_desktop/'))
  566. })
  567. }
  568. function createBasePortalConcatDelTempTask(path) {
  569. gulp.task(path+".base_portal : clean", function(cb){
  570. var dest = [
  571. 'source/'+path+'/js/base_portal_actions_temp.js',
  572. 'source/'+path+'/js/base_portal_style_temp.js'
  573. ];
  574. return del(dest, cb);
  575. });
  576. }
  577. function createBasePortalConcatBodyTask(path, isMin, thisOptions) {
  578. gulp.task(path+".base_portal : concat", function(){
  579. var option = thisOptions || options;
  580. var src = [
  581. 'source/' + path + '/js/base_concat_head.js',
  582. 'source/o2_core/o2/lp/'+(option.lp || 'zh-cn')+'.js',
  583. 'source/' + path + '/js/base_portal_style_temp.js',
  584. 'source/o2_core/o2/widget/Common.js',
  585. 'source/o2_core/o2/widget/Dialog.js',
  586. 'source/o2_core/o2/widget/UUID.js',
  587. 'source/o2_core/o2/widget/Menu.js',
  588. 'source/o2_core/o2/widget/Toolbar.js',
  589. 'source/o2_core/o2/xDesktop/Common.js',
  590. 'source/o2_core/o2/xDesktop/Actions/RestActions.js',
  591. 'source/o2_core/o2/xAction/RestActions.js',
  592. 'source/o2_core/o2/xDesktop/Access.js',
  593. 'source/o2_core/o2/xDesktop/Dialog.js',
  594. 'source/o2_core/o2/xDesktop/Menu.js',
  595. 'source/o2_core/o2/xDesktop/UserData.js',
  596. 'source/x_component_Template/MPopupForm.js',
  597. 'source/o2_core/o2/xDesktop/Authentication.js',
  598. 'source/o2_core/o2/xDesktop/Window.js',
  599. 'source/x_component_Common/Main.js',
  600. 'source/x_component_process_Work/lp/'+(option.lp || 'zh-cn')+'.js',
  601. 'source/x_component_portal_Portal/lp/'+(option.lp || 'zh-cn')+'.js',
  602. 'source/x_component_process_Xform/lp/'+(option.lp || 'zh-cn')+'.js',
  603. 'source/x_component_Selector/lp/'+(option.lp || 'zh-cn')+'.js',
  604. 'source/x_component_portal_Portal/Main.js',
  605. 'source/x_component_Selector/package.js',
  606. 'source/x_component_Selector/Person.js',
  607. 'source/x_component_Selector/Identity.js',
  608. 'source/x_component_Selector/Unit.js',
  609. 'source/x_component_Selector/IdentityWidthDuty.js',
  610. 'source/x_component_Selector/IdentityWidthDutyCategoryByUnit.js',
  611. 'source/x_component_Selector/UnitWithType.js',
  612. 'source/o2_core/o2/xScript/Actions/UnitActions.js',
  613. 'source/o2_core/o2/xScript/Actions/ScriptActions.js',
  614. 'source/o2_core/o2/xScript/Actions/CMSScriptActions.js',
  615. 'source/o2_core/o2/xScript/Actions/PortalScriptActions.js',
  616. 'source/o2_core/o2/xScript/PageEnvironment.js',
  617. 'source/o2_core/o2/xAction/services/x_organization_assemble_authentication.js',
  618. 'source/o2_core/o2/xAction/services/x_cms_assemble_control.js',
  619. 'source/o2_core/o2/xAction/services/x_organization_assemble_control.js',
  620. 'source/o2_core/o2/xAction/services/x_query_assemble_surface.js',
  621. 'source/o2_core/o2/xAction/services/x_organization_assemble_personal.js',
  622. 'source/' + path + '/js/base_portal_actions_temp.js',
  623. 'source/' + path + '/js/base.js',
  624. 'source/' + path + '/js/base_loader.js'
  625. ];
  626. var dest = option.dest+'/' + path + '/';
  627. return gulp.src(src)
  628. .pipe(sourceMap.init())
  629. .pipe(concat('js/base_portal.js'))
  630. .pipe(gulpif((option.upload == 'local' && option.location != ''), gulp.dest(option.location + path + '/')))
  631. .pipe(gulpif((option.upload == 'ftp' && option.host != ''), ftp({
  632. host: option.host,
  633. user: option.user || 'anonymous',
  634. pass: option.pass || '@anonymous',
  635. port: option.port || 21,
  636. remotePath: (option.remotePath || '/') + path
  637. })))
  638. .pipe(gulpif((option.upload == 'sftp' && option.host != ''), sftp({
  639. host: option.host,
  640. user: option.user || 'anonymous',
  641. pass: option.pass || null,
  642. port: option.port || 22,
  643. remotePath: (option.remotePath || '/') + path
  644. })))
  645. .pipe(gulp.dest(dest))
  646. // .pipe(gulp.src(src))
  647. .pipe(concat('js/base_portal.min.js'))
  648. .pipe(uglify())
  649. .pipe( sourceMap.write("") )
  650. // .pipe(rename({ extname: '.min.js' }))
  651. .pipe(gulpif((option.upload == 'local' && option.location != ''), gulp.dest(option.location + path + '/')))
  652. .pipe(gulpif((option.upload == 'ftp' && option.host != ''), ftp({
  653. host: option.host,
  654. user: option.user || 'anonymous',
  655. pass: option.pass || '@anonymous',
  656. port: option.port || 21,
  657. remotePath: (option.remotePath || '/') + path
  658. })))
  659. .pipe(gulpif((option.upload == 'sftp' && option.host != ''), sftp({
  660. host: option.host,
  661. user: option.user || 'anonymous',
  662. pass: option.pass || null,
  663. port: option.port || 22,
  664. remotePath: (option.remotePath || '/') + path
  665. })))
  666. .pipe(gulp.dest(dest))
  667. });
  668. }
  669. function createBasePortalConcatTask(path, isMin, thisOptions){
  670. createBasePortalConcatActionTask(path);
  671. createBasePortalConcatStyleTask(path);
  672. createBasePortalConcatBodyTask(path, isMin, thisOptions);
  673. createBasePortalConcatDelTempTask(path);
  674. gulp.task( path+".base_portal", gulp.series(path+".base_portal : action", path+".base_portal : style", path+".base_portal : concat", path+".base_portal : clean"));
  675. }
  676. function createBaseConcatTask(path, isMin, thisOptions){
  677. gulp.task(path+".base", function(){
  678. var option = thisOptions || options;
  679. var src = [
  680. 'source/' + path + '/js/base.js',
  681. 'source/' + path + '/js/base_loader.js'
  682. ];
  683. var dest = option.dest+'/' + path + '/';
  684. return gulp.src(src)
  685. .pipe(sourceMap.init())
  686. .pipe(concat('js/base.js'))
  687. .pipe(gulpif((option.upload == 'local' && option.location != ''), gulp.dest(option.location + path + '/')))
  688. .pipe(gulpif((option.upload == 'ftp' && option.host != ''), ftp({
  689. host: option.host,
  690. user: option.user || 'anonymous',
  691. pass: option.pass || '@anonymous',
  692. port: option.port || 21,
  693. remotePath: (option.remotePath || '/') + path
  694. })))
  695. .pipe(gulpif((option.upload == 'sftp' && option.host != ''), sftp({
  696. host: option.host,
  697. user: option.user || 'anonymous',
  698. pass: option.pass || null,
  699. port: option.port || 22,
  700. remotePath: (option.remotePath || '/') + path
  701. })))
  702. .pipe(gulp.dest(dest))
  703. // .pipe(gulp.src(src))
  704. .pipe(concat('js/base.min.js'))
  705. .pipe(uglify())
  706. .pipe( sourceMap.write("") )
  707. // .pipe(rename({ extname: '.min.js' }))
  708. .pipe(gulpif((option.upload == 'local' && option.location != ''), gulp.dest(option.location + path + '/')))
  709. .pipe(gulpif((option.upload == 'ftp' && option.host != ''), ftp({
  710. host: option.host,
  711. user: option.user || 'anonymous',
  712. pass: option.pass || '@anonymous',
  713. port: option.port || 21,
  714. remotePath: (option.remotePath || '/') + path
  715. })))
  716. .pipe(gulpif((option.upload == 'sftp' && option.host != ''), sftp({
  717. host: option.host,
  718. user: option.user || 'anonymous',
  719. pass: option.pass || null,
  720. port: option.port || 22,
  721. remotePath: (option.remotePath || '/') + path
  722. })))
  723. .pipe(gulp.dest(dest))
  724. });
  725. }
  726. function getAppTask(path, isMin, thisOptions) {
  727. if (path==="x_component_process_Xform"){
  728. createDefaultTask(path, isMin, thisOptions);
  729. createXFormConcatTask(path, isMin, thisOptions);
  730. return gulp.series(path, path+" : concat");
  731. }else if (path==="o2_core"){
  732. createDefaultTask(path, isMin, thisOptions);
  733. createO2ConcatTask(path, isMin, thisOptions);
  734. return gulp.series(path, path+" : concat", path+".xDesktop : concat", path+" : bundle");
  735. }else if (path==="x_desktop") {
  736. createDefaultTask(path, isMin, thisOptions);
  737. createBaseWorkConcatTask(path, isMin, thisOptions);
  738. createBasePortalConcatTask(path, isMin, thisOptions);
  739. createBaseConcatTask(path, isMin, thisOptions);
  740. return gulp.series(path, path+".base_work", path+".base_portal", path+".base");
  741. //return gulp.series(path, path+".base_work : concat");
  742. }else{
  743. createDefaultTask(path, isMin, thisOptions);
  744. return gulp.series(path);
  745. }
  746. }
  747. //var taskObj = {};
  748. apps.map(function (app) {
  749. var taskName;
  750. var isMin = (app.tasks.indexOf("min")!==-1);
  751. taskName = app.folder;
  752. appTasks.push(taskName);
  753. gulp.task(taskName, getAppTask(app.folder, isMin));
  754. // //var isMin = (app.tasks.indexOf("min")!==-1);
  755. // taskName = app.folder+"_release";
  756. // //appTasks.push(taskName);
  757. // gulp.task(taskName, getAppTask(app.folder, isMin, release_options));
  758. });
  759. // Object.keys(taskObj).map(function(k){
  760. // exports[k] = parallel(taskObj[k]);
  761. // });
  762. //exports[app.folder] = parallel(minTask, moveTask);
  763. function getCleanTask(path) {
  764. return function (cb) {
  765. if (path){
  766. var dest = (path=="/") ? options.dest+"/" : options.dest+'/' + path + '/';
  767. gutil.log("Clean", ":", gutil.colors.red(dest));
  768. del.sync(dest, cb);
  769. cb();
  770. }else{
  771. cb();
  772. }
  773. }
  774. }
  775. function cleanRemoteFtp(f, cb) {
  776. var file = options.remotePath + f;
  777. var ftp = new JSFtp({
  778. host: options.host,
  779. user: options.user || 'anonymous',
  780. pass: options.pass || null,
  781. port: options.port || 21
  782. });
  783. ftp.raw('dele ' + file, function (err) {
  784. if (err) { cb(); return; }
  785. if (file.substring(file.length - 3).toLowerCase() == ".js") {
  786. file = file.replace('.js', ".min.js");
  787. ftp.raw('dele ' + file, function (err) {
  788. if (err) { cb(); return; }
  789. if (file.indexOf("/") != -1) {
  790. var p = file.substring(0, file.lastIndexOf("/"));
  791. ftp.raw('rmd ' + p, function (err) {
  792. if (err) { cb(); return; }
  793. ftp.raw.quit();
  794. cb();
  795. });
  796. }
  797. });
  798. } else {
  799. if (file.indexOf("/") != -1) {
  800. var pPath = file.substring(0, file.lastIndexOf("/"));
  801. ftp.raw('rmd ' + pPath, function (err) {
  802. if (err) { cb(); return; }
  803. ftp.raw.quit();
  804. cb();
  805. });
  806. }
  807. }
  808. });
  809. }
  810. function cleanRemoteLocal(f, cb) {
  811. var file = options.location + f;
  812. del(file, { force: true, dryRun: true }, function () {
  813. if (file.substring(file.length - 3).toLowerCase() == ".js") {
  814. var minfile = file.replace('.js', ".min.js");
  815. del(minfile, { force: true, dryRun: true }, function () {
  816. var p = file.substring(0, file.lastIndexOf("/"));
  817. fs.rmdir(p, function (err) {
  818. if (err) { }
  819. cb();
  820. })
  821. });
  822. } else {
  823. var p = file.substring(0, file.lastIndexOf("/"));
  824. fs.rmdir(p, function (err) {
  825. if (err) { }
  826. cb();
  827. })
  828. }
  829. });
  830. }
  831. function getCleanRemoteTask(path) {
  832. return function (cb) {
  833. if (options.upload) {
  834. var file = path.replace(/\\/g, "/");
  835. file = file.substring(file.indexOf("source/") + 7);
  836. if (options.upload == 'local' && options.location != '') cleanRemoteLocal(file, cb);
  837. if (options.upload == 'ftp' && options.host != '') cleanRemoteFtp(file, cb);
  838. } else {
  839. if (cb) cb();
  840. }
  841. }
  842. }
  843. function getWatchTask(path) {
  844. return (path) ? function (cb) {
  845. gutil.log("watch", ":", gutil.colors.green(path, "is watching ..."));
  846. gulp.watch(['source/' + path + '/**/*', "!./**/test/**"], { "events": ['addDir', 'add', 'change'] }, gulp.parallel([path]));
  847. } : function(cb){cb();};
  848. }
  849. gulp.task("clean", getCleanTask(options.src))
  850. gulp.task("watch", getWatchTask(options.src));
  851. gulp.task("index", function () {
  852. var src = ['source/favicon.ico', 'source/index.html'];
  853. var dest = options.dest;
  854. return gulp.src(src)
  855. .pipe(changed(dest))
  856. .pipe(gulpif((options.upload == 'local' && options.location != ''), gulp.dest(options.location + '/')))
  857. .pipe(gulpif((options.upload == 'ftp' && options.host != ''), ftp({
  858. host: options.host,
  859. user: options.user || 'anonymous',
  860. pass: options.pass || '@anonymous',
  861. port: options.port || 21,
  862. remotePath: (options.remotePath || '/')
  863. })))
  864. .pipe(gulpif((options.upload == 'sftp' && options.host != ''), ftp({
  865. host: options.host,
  866. user: options.user || 'anonymous',
  867. pass: options.pass || null,
  868. port: options.port || 22,
  869. remotePath: (options.remotePath || '/')
  870. })))
  871. .pipe(gulp.dest(dest))
  872. .pipe(gutil.noop());
  873. });
  874. gulp.task("cleanAll", getCleanTask('/'));
  875. gulp.task("o2:new-v:html", function () {
  876. var path = "x_desktop";
  877. var src = '/source/x_desktop/*.html';
  878. var dest = options.dest + '/x_desktop/';
  879. return gulp.src(src)
  880. .pipe(assetRev())
  881. .pipe(gulpif((options.upload == 'local' && options.location != ''), gulp.dest(options.location + path + '/')))
  882. .pipe(gulpif((options.upload == 'ftp' && options.host != ''), ftp({
  883. host: options.host,
  884. user: options.user || 'anonymous',
  885. pass: options.pass || '@anonymous',
  886. port: options.port || 21,
  887. remotePath: (options.remotePath || '/') + path
  888. })))
  889. .pipe(gulpif((options.upload == 'sftp' && options.host != ''), sftp({
  890. host: options.host,
  891. user: options.user || 'anonymous',
  892. pass: options.pass || null,
  893. port: options.port || 22,
  894. remotePath: (options.remotePath || '/') + path
  895. })))
  896. .pipe(gulp.dest(dest))
  897. .pipe(gutil.noop());
  898. });
  899. gulp.task("o2:new-v:o2", function () {
  900. var path = "o2_core";
  901. var src = options.dest +'/o2_core/o2.js';
  902. var dest = options.dest +'/o2_core/';
  903. return gulp.src(src)
  904. .pipe(assetRev())
  905. .pipe(gulpif((options.upload == 'local' && options.location != ''), gulp.dest(options.location + path + '/')))
  906. .pipe(gulpif((options.upload == 'ftp' && options.host != ''), ftp({
  907. host: options.host,
  908. user: options.user || 'anonymous',
  909. pass: options.pass || '@anonymous',
  910. port: options.port || 21,
  911. remotePath: (options.remotePath || '/') + path
  912. })))
  913. .pipe(gulpif((options.upload == 'sftp' && options.host != ''), sftp({
  914. host: options.host,
  915. user: options.user || 'anonymous',
  916. pass: options.pass || null,
  917. port: options.port || 22,
  918. remotePath: (options.remotePath || '/') + path
  919. })))
  920. .pipe(gulp.dest(dest))
  921. .pipe(uglify())
  922. .pipe(rename({ extname: '.min.js' }))
  923. .pipe(gulpif((options.upload == 'local' && options.location != ''), gulp.dest(options.location + path + '/')))
  924. .pipe(gulpif((options.upload == 'ftp' && options.host != ''), ftp({
  925. host: options.host,
  926. user: options.user || 'anonymous',
  927. pass: options.pass || '@anonymous',
  928. port: options.port || 21,
  929. remotePath: (options.remotePath || '/') + path
  930. })))
  931. .pipe(gulpif((options.upload == 'sftp' && options.host != ''), sftp({
  932. host: options.host,
  933. user: options.user || 'anonymous',
  934. pass: options.pass || null,
  935. port: options.port || 22,
  936. remotePath: (options.remotePath || '/') + path
  937. })))
  938. .pipe(gulp.dest(dest))
  939. .pipe(gutil.noop());
  940. });
  941. gulp.task("o2:new-v", gulp.parallel("o2:new-v:o2", "o2:new-v:html"));
  942. gulp.task("git_clean", function (cb) {
  943. var dest = 'D:/O2/github/huqi1980/o2oa/o2web/source/';
  944. del(dest, { dryRun: true, force: true }, cb);
  945. });
  946. gulp.task("git_dest", function () {
  947. var dest = "D:/O2/github/huqi1980/o2oa/o2web/source";
  948. return gulp.src(["source/**/*", "!./**/test/**"])
  949. .pipe(changed(dest))
  950. .pipe(gulp.dest(dest))
  951. });
  952. gulp.task("git", gulp.series('git_clean', 'git_dest'));
  953. gulp.task("default", gulp.series(gulp.parallel(appTasks, 'index'), "o2:new-v"));
  954. function build(){
  955. options.ev = "p";
  956. options.upload = o_options.upload || "";
  957. options.location = o_options.location || uploadOptions.location;
  958. options.host = o_options.host || uploadOptions.host;
  959. options.user = o_options.user || uploadOptions.user;
  960. options.pass = o_options.pass || uploadOptions.pass;
  961. options.port = o_options.port || uploadOptions.port;
  962. options.remotePath = o_options.remotePath || uploadOptions.remotePath;
  963. options.dest = o_options.dest || uploadOptions.dest || "dest";
  964. };
  965. gulp.task("build", gulp.series("clean", gulp.parallel(appTasks, 'index'), "o2:new-v"))