gulpfile.js 44 KB

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