zhaochengyang 5 anos atrás
commit
51bc534678
100 arquivos alterados com 3313 adições e 0 exclusões
  1. 58 0
      RubikCube/.laya/compile.js
  2. 43 0
      RubikCube/.laya/launch.json
  3. 314 0
      RubikCube/.laya/publish.js
  4. 178 0
      RubikCube/.laya/publish_bdgame.js
  5. 447 0
      RubikCube/.laya/publish_oppogame.js
  6. 89 0
      RubikCube/.laya/publish_qqgame.js
  7. 732 0
      RubikCube/.laya/publish_vivogame.js
  8. 418 0
      RubikCube/.laya/publish_wxgame.js
  9. 519 0
      RubikCube/.laya/publish_xmgame.js
  10. 6 0
      RubikCube/.rpt2_cache/rpt2_16c1bda467ce14747890b34f5f8873592d6d44db/code/cache/6bc1cfb0ce331de751109e16b4e4f9b8a703b07f
  11. 4 0
      RubikCube/.rpt2_cache/rpt2_16c1bda467ce14747890b34f5f8873592d6d44db/code/cache/d86a5ea00449d44be440351cc6f809c280bc39c4
  12. 0 0
      RubikCube/.rpt2_cache/rpt2_16c1bda467ce14747890b34f5f8873592d6d44db/types/cache/2f45d61fdd4cd95d19a817d8dccef1f394f41161
  13. 0 0
      RubikCube/.rpt2_cache/rpt2_16c1bda467ce14747890b34f5f8873592d6d44db/types/cache/443fd6a490f7894f91e7a67f5e027b058d0fddc8
  14. 0 0
      RubikCube/.rpt2_cache/rpt2_16c1bda467ce14747890b34f5f8873592d6d44db/types/cache/9fb10094dd32c323b6326e45638cab33c989acfd
  15. 0 0
      RubikCube/.rpt2_cache/rpt2_16c1bda467ce14747890b34f5f8873592d6d44db/types/cache/f880455b4be375ff2982326db9d5653b835a44dd
  16. 4 0
      RubikCube/.rpt2_cache/rpt2_17f6e31a80dbd776fa2022a18f0e9b6966320c6f/code/cache/02332a65a403196a4abd93a4cac71ebf633de2ff
  17. 6 0
      RubikCube/.rpt2_cache/rpt2_17f6e31a80dbd776fa2022a18f0e9b6966320c6f/code/cache/6bc1cfb0ce331de751109e16b4e4f9b8a703b07f
  18. 0 0
      RubikCube/.rpt2_cache/rpt2_17f6e31a80dbd776fa2022a18f0e9b6966320c6f/types/cache/2f45d61fdd4cd95d19a817d8dccef1f394f41161
  19. 0 0
      RubikCube/.rpt2_cache/rpt2_17f6e31a80dbd776fa2022a18f0e9b6966320c6f/types/cache/443fd6a490f7894f91e7a67f5e027b058d0fddc8
  20. 0 0
      RubikCube/.rpt2_cache/rpt2_17f6e31a80dbd776fa2022a18f0e9b6966320c6f/types/cache/9fb10094dd32c323b6326e45638cab33c989acfd
  21. 0 0
      RubikCube/.rpt2_cache/rpt2_17f6e31a80dbd776fa2022a18f0e9b6966320c6f/types/cache/f880455b4be375ff2982326db9d5653b835a44dd
  22. 9 0
      RubikCube/.rpt2_cache/rpt2_1aa73514e5a5f15f23206c8bcbf9114260ab2a8a/code/cache/00f51599e58e82839168c4a92292dbf4dde00905
  23. 5 0
      RubikCube/.rpt2_cache/rpt2_1aa73514e5a5f15f23206c8bcbf9114260ab2a8a/code/cache/0a86cf680231255d05327a8360e0a62fd91a866d
  24. 8 0
      RubikCube/.rpt2_cache/rpt2_1aa73514e5a5f15f23206c8bcbf9114260ab2a8a/code/cache/0d0116bf7d1e89c72351ac8b1e6ef422686c3632
  25. 5 0
      RubikCube/.rpt2_cache/rpt2_1aa73514e5a5f15f23206c8bcbf9114260ab2a8a/code/cache/196d5b15ac5d957ef121fd229a231620156b6dd6
  26. 5 0
      RubikCube/.rpt2_cache/rpt2_1aa73514e5a5f15f23206c8bcbf9114260ab2a8a/code/cache/26267b63ac8859f184c112e53a8a743bfd2a5b9e
  27. 5 0
      RubikCube/.rpt2_cache/rpt2_1aa73514e5a5f15f23206c8bcbf9114260ab2a8a/code/cache/2f2779be53b42561a4f5add47fd92e4fabd04b11
  28. 8 0
      RubikCube/.rpt2_cache/rpt2_1aa73514e5a5f15f23206c8bcbf9114260ab2a8a/code/cache/3aa5348e4faa774e20f0667e770f5662b938498d
  29. 9 0
      RubikCube/.rpt2_cache/rpt2_1aa73514e5a5f15f23206c8bcbf9114260ab2a8a/code/cache/41ebbfa096ec21675b47d279f33573847037165a
  30. 8 0
      RubikCube/.rpt2_cache/rpt2_1aa73514e5a5f15f23206c8bcbf9114260ab2a8a/code/cache/45af196622619d93bd7a403f94cd18bc4906da53
  31. 9 0
      RubikCube/.rpt2_cache/rpt2_1aa73514e5a5f15f23206c8bcbf9114260ab2a8a/code/cache/4f8aeafddd93013d5fe230bc247b1d8a88e371b0
  32. 8 0
      RubikCube/.rpt2_cache/rpt2_1aa73514e5a5f15f23206c8bcbf9114260ab2a8a/code/cache/5cc361e49638e621049d4edf9a78e2122019d2af
  33. 14 0
      RubikCube/.rpt2_cache/rpt2_1aa73514e5a5f15f23206c8bcbf9114260ab2a8a/code/cache/673d53f61d72a5789a1dcb2e5ff8e7083266e168
  34. 5 0
      RubikCube/.rpt2_cache/rpt2_1aa73514e5a5f15f23206c8bcbf9114260ab2a8a/code/cache/676979bd676ce413d4d97d4a5cac3d1ca73aa3f4
  35. 5 0
      RubikCube/.rpt2_cache/rpt2_1aa73514e5a5f15f23206c8bcbf9114260ab2a8a/code/cache/6f3f94aad37b09dc2bfc4611d053c061ef83621c
  36. 10 0
      RubikCube/.rpt2_cache/rpt2_1aa73514e5a5f15f23206c8bcbf9114260ab2a8a/code/cache/8a5dc72b5f64ec62bc36c5e9697e2b9b1c863b88
  37. 9 0
      RubikCube/.rpt2_cache/rpt2_1aa73514e5a5f15f23206c8bcbf9114260ab2a8a/code/cache/92bf2bda935f67e3d7a621ad782101f654b41216
  38. 8 0
      RubikCube/.rpt2_cache/rpt2_1aa73514e5a5f15f23206c8bcbf9114260ab2a8a/code/cache/99f1ad39370f719db390d6969a6d6d917739676a
  39. 9 0
      RubikCube/.rpt2_cache/rpt2_1aa73514e5a5f15f23206c8bcbf9114260ab2a8a/code/cache/9adfa6d710be702915d681cf5db8113c94d648c0
  40. 5 0
      RubikCube/.rpt2_cache/rpt2_1aa73514e5a5f15f23206c8bcbf9114260ab2a8a/code/cache/a76b6dffc994d4a7b92dc9f0525ac1a539a325ee
  41. 9 0
      RubikCube/.rpt2_cache/rpt2_1aa73514e5a5f15f23206c8bcbf9114260ab2a8a/code/cache/af5b88cfd577a44e3d27dfb88ee5e13f9582e577
  42. 9 0
      RubikCube/.rpt2_cache/rpt2_1aa73514e5a5f15f23206c8bcbf9114260ab2a8a/code/cache/d0e66fb93272333bee6a334ac552b8d314446c0a
  43. 5 0
      RubikCube/.rpt2_cache/rpt2_1aa73514e5a5f15f23206c8bcbf9114260ab2a8a/code/cache/e7af6844847455c6426f58da4b1d4bb2315e2a49
  44. 12 0
      RubikCube/.rpt2_cache/rpt2_1aa73514e5a5f15f23206c8bcbf9114260ab2a8a/code/cache/faa44ca2ddf01ea41c5a8ed36075aa2649217ea1
  45. 8 0
      RubikCube/.rpt2_cache/rpt2_1aa73514e5a5f15f23206c8bcbf9114260ab2a8a/code/cache/fd27f0c2497c06cd7802ea022411807119a1bb50
  46. 0 0
      RubikCube/.rpt2_cache/rpt2_1aa73514e5a5f15f23206c8bcbf9114260ab2a8a/types/cache/2d88ee78092edaa8de37d473c33839d03b25dd94
  47. 0 0
      RubikCube/.rpt2_cache/rpt2_1aa73514e5a5f15f23206c8bcbf9114260ab2a8a/types/cache/7abd7e3427a705f9bdcccbe9b1644869f8c30a6d
  48. 0 0
      RubikCube/.rpt2_cache/rpt2_1aa73514e5a5f15f23206c8bcbf9114260ab2a8a/types/cache/a880bb9992db11ff6ad31e0f506b3d706bab6071
  49. 0 0
      RubikCube/.rpt2_cache/rpt2_1aa73514e5a5f15f23206c8bcbf9114260ab2a8a/types/cache/b696fc35a59eac53016022d354027340008887e0
  50. 4 0
      RubikCube/.rpt2_cache/rpt2_2ae18f126d9500f48269dab254e3874438435f18/code/cache/02332a65a403196a4abd93a4cac71ebf633de2ff
  51. 6 0
      RubikCube/.rpt2_cache/rpt2_2ae18f126d9500f48269dab254e3874438435f18/code/cache/6bc1cfb0ce331de751109e16b4e4f9b8a703b07f
  52. 0 0
      RubikCube/.rpt2_cache/rpt2_2ae18f126d9500f48269dab254e3874438435f18/types/cache/2f45d61fdd4cd95d19a817d8dccef1f394f41161
  53. 0 0
      RubikCube/.rpt2_cache/rpt2_2ae18f126d9500f48269dab254e3874438435f18/types/cache/443fd6a490f7894f91e7a67f5e027b058d0fddc8
  54. 0 0
      RubikCube/.rpt2_cache/rpt2_2ae18f126d9500f48269dab254e3874438435f18/types/cache/9fb10094dd32c323b6326e45638cab33c989acfd
  55. 0 0
      RubikCube/.rpt2_cache/rpt2_2ae18f126d9500f48269dab254e3874438435f18/types/cache/f880455b4be375ff2982326db9d5653b835a44dd
  56. 9 0
      RubikCube/.rpt2_cache/rpt2_39343d15e8eb1e0266d3dfba53da0a008ee3d156/code/cache/00f51599e58e82839168c4a92292dbf4dde00905
  57. 5 0
      RubikCube/.rpt2_cache/rpt2_39343d15e8eb1e0266d3dfba53da0a008ee3d156/code/cache/0a86cf680231255d05327a8360e0a62fd91a866d
  58. 8 0
      RubikCube/.rpt2_cache/rpt2_39343d15e8eb1e0266d3dfba53da0a008ee3d156/code/cache/0d0116bf7d1e89c72351ac8b1e6ef422686c3632
  59. 5 0
      RubikCube/.rpt2_cache/rpt2_39343d15e8eb1e0266d3dfba53da0a008ee3d156/code/cache/196d5b15ac5d957ef121fd229a231620156b6dd6
  60. 5 0
      RubikCube/.rpt2_cache/rpt2_39343d15e8eb1e0266d3dfba53da0a008ee3d156/code/cache/26267b63ac8859f184c112e53a8a743bfd2a5b9e
  61. 9 0
      RubikCube/.rpt2_cache/rpt2_39343d15e8eb1e0266d3dfba53da0a008ee3d156/code/cache/41ebbfa096ec21675b47d279f33573847037165a
  62. 8 0
      RubikCube/.rpt2_cache/rpt2_39343d15e8eb1e0266d3dfba53da0a008ee3d156/code/cache/45af196622619d93bd7a403f94cd18bc4906da53
  63. 9 0
      RubikCube/.rpt2_cache/rpt2_39343d15e8eb1e0266d3dfba53da0a008ee3d156/code/cache/4f8aeafddd93013d5fe230bc247b1d8a88e371b0
  64. 8 0
      RubikCube/.rpt2_cache/rpt2_39343d15e8eb1e0266d3dfba53da0a008ee3d156/code/cache/5cc361e49638e621049d4edf9a78e2122019d2af
  65. 14 0
      RubikCube/.rpt2_cache/rpt2_39343d15e8eb1e0266d3dfba53da0a008ee3d156/code/cache/673d53f61d72a5789a1dcb2e5ff8e7083266e168
  66. 5 0
      RubikCube/.rpt2_cache/rpt2_39343d15e8eb1e0266d3dfba53da0a008ee3d156/code/cache/676979bd676ce413d4d97d4a5cac3d1ca73aa3f4
  67. 5 0
      RubikCube/.rpt2_cache/rpt2_39343d15e8eb1e0266d3dfba53da0a008ee3d156/code/cache/6f3f94aad37b09dc2bfc4611d053c061ef83621c
  68. 11 0
      RubikCube/.rpt2_cache/rpt2_39343d15e8eb1e0266d3dfba53da0a008ee3d156/code/cache/7ee8406b609853cfa532cbd85da62a22deb4bc87
  69. 5 0
      RubikCube/.rpt2_cache/rpt2_39343d15e8eb1e0266d3dfba53da0a008ee3d156/code/cache/80e22317916e5015d26469c22bc7be4e63c8ddfe
  70. 8 0
      RubikCube/.rpt2_cache/rpt2_39343d15e8eb1e0266d3dfba53da0a008ee3d156/code/cache/83df4a37b62e1f86d7ee951c0c69e70c494f1809
  71. 9 0
      RubikCube/.rpt2_cache/rpt2_39343d15e8eb1e0266d3dfba53da0a008ee3d156/code/cache/92bf2bda935f67e3d7a621ad782101f654b41216
  72. 8 0
      RubikCube/.rpt2_cache/rpt2_39343d15e8eb1e0266d3dfba53da0a008ee3d156/code/cache/99f1ad39370f719db390d6969a6d6d917739676a
  73. 7 0
      RubikCube/.rpt2_cache/rpt2_39343d15e8eb1e0266d3dfba53da0a008ee3d156/code/cache/a61c934e7f562bf08877b4ce2d28166cffd155fa
  74. 9 0
      RubikCube/.rpt2_cache/rpt2_39343d15e8eb1e0266d3dfba53da0a008ee3d156/code/cache/af5b88cfd577a44e3d27dfb88ee5e13f9582e577
  75. 9 0
      RubikCube/.rpt2_cache/rpt2_39343d15e8eb1e0266d3dfba53da0a008ee3d156/code/cache/d0e66fb93272333bee6a334ac552b8d314446c0a
  76. 5 0
      RubikCube/.rpt2_cache/rpt2_39343d15e8eb1e0266d3dfba53da0a008ee3d156/code/cache/e7af6844847455c6426f58da4b1d4bb2315e2a49
  77. 8 0
      RubikCube/.rpt2_cache/rpt2_39343d15e8eb1e0266d3dfba53da0a008ee3d156/code/cache/fd52c028d4635ba00b6c7b7230b6ecec80936904
  78. 0 0
      RubikCube/.rpt2_cache/rpt2_39343d15e8eb1e0266d3dfba53da0a008ee3d156/types/cache/2d88ee78092edaa8de37d473c33839d03b25dd94
  79. 0 0
      RubikCube/.rpt2_cache/rpt2_39343d15e8eb1e0266d3dfba53da0a008ee3d156/types/cache/7abd7e3427a705f9bdcccbe9b1644869f8c30a6d
  80. 0 0
      RubikCube/.rpt2_cache/rpt2_39343d15e8eb1e0266d3dfba53da0a008ee3d156/types/cache/a880bb9992db11ff6ad31e0f506b3d706bab6071
  81. 0 0
      RubikCube/.rpt2_cache/rpt2_39343d15e8eb1e0266d3dfba53da0a008ee3d156/types/cache/b696fc35a59eac53016022d354027340008887e0
  82. 7 0
      RubikCube/.rpt2_cache/rpt2_5325f18c9665847b323cb40a11844f0a22896979/code/cache/023cf0fa34c7c52b4db8e48c8d3301138d124f1b
  83. 9 0
      RubikCube/.rpt2_cache/rpt2_5325f18c9665847b323cb40a11844f0a22896979/code/cache/0597bea2751b5b538b312fba7c7d3cc47eaf2205
  84. 5 0
      RubikCube/.rpt2_cache/rpt2_5325f18c9665847b323cb40a11844f0a22896979/code/cache/0a86cf680231255d05327a8360e0a62fd91a866d
  85. 8 0
      RubikCube/.rpt2_cache/rpt2_5325f18c9665847b323cb40a11844f0a22896979/code/cache/0d0116bf7d1e89c72351ac8b1e6ef422686c3632
  86. 5 0
      RubikCube/.rpt2_cache/rpt2_5325f18c9665847b323cb40a11844f0a22896979/code/cache/0f56012f97bf1338cbfeb5eb677235b631353196
  87. 5 0
      RubikCube/.rpt2_cache/rpt2_5325f18c9665847b323cb40a11844f0a22896979/code/cache/196d5b15ac5d957ef121fd229a231620156b6dd6
  88. 7 0
      RubikCube/.rpt2_cache/rpt2_5325f18c9665847b323cb40a11844f0a22896979/code/cache/22136957b59413f7aa764083a4efb1e36dc52e95
  89. 5 0
      RubikCube/.rpt2_cache/rpt2_5325f18c9665847b323cb40a11844f0a22896979/code/cache/26267b63ac8859f184c112e53a8a743bfd2a5b9e
  90. 11 0
      RubikCube/.rpt2_cache/rpt2_5325f18c9665847b323cb40a11844f0a22896979/code/cache/4203da2495b57ba1a6fff61c602d62dfa7604694
  91. 5 0
      RubikCube/.rpt2_cache/rpt2_5325f18c9665847b323cb40a11844f0a22896979/code/cache/43dd7b41ef8d68b3d8c6876edcdacf72a7726da4
  92. 8 0
      RubikCube/.rpt2_cache/rpt2_5325f18c9665847b323cb40a11844f0a22896979/code/cache/45af196622619d93bd7a403f94cd18bc4906da53
  93. 5 0
      RubikCube/.rpt2_cache/rpt2_5325f18c9665847b323cb40a11844f0a22896979/code/cache/4667303fd76c5e6b6f4de88006bf21c7e96b964a
  94. 9 0
      RubikCube/.rpt2_cache/rpt2_5325f18c9665847b323cb40a11844f0a22896979/code/cache/4f8aeafddd93013d5fe230bc247b1d8a88e371b0
  95. 8 0
      RubikCube/.rpt2_cache/rpt2_5325f18c9665847b323cb40a11844f0a22896979/code/cache/5cc361e49638e621049d4edf9a78e2122019d2af
  96. 14 0
      RubikCube/.rpt2_cache/rpt2_5325f18c9665847b323cb40a11844f0a22896979/code/cache/673d53f61d72a5789a1dcb2e5ff8e7083266e168
  97. 5 0
      RubikCube/.rpt2_cache/rpt2_5325f18c9665847b323cb40a11844f0a22896979/code/cache/676979bd676ce413d4d97d4a5cac3d1ca73aa3f4
  98. 5 0
      RubikCube/.rpt2_cache/rpt2_5325f18c9665847b323cb40a11844f0a22896979/code/cache/6f3f94aad37b09dc2bfc4611d053c061ef83621c
  99. 8 0
      RubikCube/.rpt2_cache/rpt2_5325f18c9665847b323cb40a11844f0a22896979/code/cache/99f1ad39370f719db390d6969a6d6d917739676a
  100. 0 0
      RubikCube/.rpt2_cache/rpt2_5325f18c9665847b323cb40a11844f0a22896979/code/cache/af5b88cfd577a44e3d27dfb88ee5e13f9582e577

+ 58 - 0
RubikCube/.laya/compile.js

@@ -0,0 +1,58 @@
+// v1.1.0
+//是否使用IDE自带的node环境和插件,设置false后,则使用自己环境(使用命令行方式执行)
+let useIDENode = process.argv[0].indexOf("LayaAir") > -1 ? true : false;
+//获取Node插件和工作路径
+let ideModuleDir = useIDENode ? process.argv[1].replace("gulp\\bin\\gulp.js", "").replace("gulp/bin/gulp.js", "") : "";
+let workSpaceDir = useIDENode ? process.argv[2].replace("--gulpfile=", "").replace("\\.laya\\compile.js", "").replace("/.laya/compile.js", "") : "./../";
+
+const gulp = require(ideModuleDir + "gulp");
+const rollup = require(ideModuleDir + "rollup");
+const typescript = require(ideModuleDir + 'rollup-plugin-typescript2');//typescript2 plugin
+const glsl = require(ideModuleDir + 'rollup-plugin-glsl');
+
+// 如果是发布时调用编译功能,增加prevTasks
+let prevTasks = "";
+if (global.publish) {
+	prevTasks = ["loadConfig"];
+}
+
+//使用browserify,转换ts到js,并输出到bin/js目录
+gulp.task("compile", prevTasks, function () {
+	// 发布时调用编译功能,判断是否点击了编译选项
+	if (global.publish && !global.config.compile) {
+		return;
+	} else if (global.publish && global.config.compile) {
+		// 发布时调用编译,workSpaceDir使用publish.js里的变量
+		workSpaceDir = global.workSpaceDir;
+	}
+
+	return rollup.rollup({
+		input: workSpaceDir + '/src/Main.ts',
+		treeshake: true,//建议忽略
+		plugins: [
+			typescript({
+				check: false, //Set to false to avoid doing any diagnostic checks on the code
+				tsconfigOverride:{compilerOptions:{removeComments: true}}
+			}),
+			glsl({
+				// By default, everything gets included
+				include: /.*(.glsl|.vs|.fs)$/,
+				sourceMap: true,
+				compress:false
+			}),
+			/*terser({
+				output: {
+				},
+				numWorkers:1,//Amount of workers to spawn. Defaults to the number of CPUs minus 1
+				sourcemap: false
+			})*/        
+		]
+	}).then(bundle => {
+		return bundle.write({
+			file: workSpaceDir + '/bin/js/bundle.js',
+			format: 'iife',
+			name: 'laya',
+			sourcemap: true
+		});
+	});
+});

+ 43 - 0
RubikCube/.laya/launch.json

@@ -0,0 +1,43 @@
+{
+	"version": "0.2.0",
+	"configurations": [ 
+		{
+			"name": "layaAir",
+			"type": "chrome",
+			"request": "launch",
+			"file": "${workspaceRoot}/bin/index.html",
+			"runtimeExecutable": "${execPath}",
+			"useBuildInServer": true,
+			"sourceMaps": true,
+			"webRoot": "${workspaceRoot}",
+			"port": 9222,
+			"fixedPort":false,
+			"sourceMapPathOverrides": {
+				"src/*": "${workspaceRoot}/src/*"
+			}		
+		},
+		{
+			"name": "chrome调试",
+			"type": "chrome",
+			"request": "launch",
+			"file": "${workspaceRoot}/bin/index.html",
+			// "换成自己的谷歌安装路径,": 比如
+			//window 默认安装路径为: "C:/Program Files (x86)/Google/Chrome/Application/chrome.exe"
+			//mac 系统上的默认安装路径为 "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome";
+			// "runtimeExecutable": "C:/Program Files (x86)/Google/Chrome/Application/chrome.exe",
+			"runtimeArgs": [
+				"--allow-file-access-from-files",
+				"--allow-file-access-frome-files",
+				" --disable-web-security"
+			],
+			"sourceMaps": true,
+			"webRoot": "${workspaceRoot}",
+			//假如谷歌调试报userDataDir不可用,请把谷歌安装路径取得管理员权限,或者更换${tmpdir}为其他可以读写的文件夹,也可以删除。
+			"userDataDir": "${workspaceRoot}/.laya/chrome",
+			"fixedPort":false,
+			"sourceMapPathOverrides": {
+				"src/*": "${workspaceRoot}/src/*"
+			}		
+		}
+	]
+}

+ 314 - 0
RubikCube/.laya/publish.js

@@ -0,0 +1,314 @@
+// v1.5.0
+//是否使用IDE自带的node环境和插件,设置false后,则使用自己环境(使用命令行方式执行)
+const useIDENode = process.argv[0].indexOf("LayaAir") > -1 ? true : false;
+//获取Node插件和工作路径
+let ideModuleDir = useIDENode ? process.argv[1].replace("gulp\\bin\\gulp.js", "").replace("gulp/bin/gulp.js", "") : "";
+let workSpaceDir = useIDENode ? process.argv[2].replace("--gulpfile=", "").replace("\\.laya\\publish.js", "").replace("/.laya/publish.js", "") + "/" : "./../";
+
+//引用插件模块
+const gulp = require(ideModuleDir + "gulp");
+const fs = require("fs");
+const path = require("path");
+const uglify = require(ideModuleDir + 'gulp-uglify-es').default;
+const jsonminify = require(ideModuleDir + "gulp-jsonminify");
+const image = require(ideModuleDir + "gulp-image");
+const rev = require(ideModuleDir + "gulp-rev");
+const revdel = require(ideModuleDir + "gulp-rev-delete-original");
+const revCollector = require(ideModuleDir + 'gulp-rev-collector');
+const del = require(ideModuleDir + "del");
+const requireDir = require(ideModuleDir + 'require-dir');
+
+global.ideModuleDir = ideModuleDir;
+global.workSpaceDir = workSpaceDir;
+
+// 结合compile.js使用
+global.publish = true;
+const fileList = ["compile.js", "publish_xmgame.js", "publish_oppogame.js", "publish_vivogame.js", "publish_wxgame.js", "publish_bdgame.js", "publish_qqgame.js"];
+requireDir('./', {
+	filter: function (fullPath) {
+		// 只用到了compile.js和publish.js
+		if (fileList.includes(path.basename(fullPath))) {
+			return true;
+		} else {
+			return false;
+		}
+	}
+});
+
+const QUICKGAMELIST = ["xmgame", "oppogame", "vivogame"];
+
+// 清理临时文件夹,加载配置
+let config,
+	releaseDir,
+	binPath,
+	platform,
+	isOpendataProj = false;
+gulp.task("loadConfig", function () {
+	platform = "web"
+	if (!useIDENode && process.argv.length > 5 && process.argv[4] == "--config") {
+		platform = process.argv[5].replace(".json", "");
+	}
+	if (useIDENode && process.argv.length >= 4 && process.argv[3].startsWith("--config") && process.argv[3].endsWith(".json")) {
+		platform = process.argv[3].match(/(\w+).json/)[1];
+	}
+	let _path;
+	if (!useIDENode) {
+		_path = platform + ".json";
+		releaseDir = "../release/" + platform;
+		binPath = "../bin/";
+	}
+	if (useIDENode) {
+		_path = path.join(workSpaceDir, ".laya", `${platform}.json`);
+		releaseDir = path.join(workSpaceDir, "release", platform).replace(/\\/g, "/");
+		binPath = path.join(workSpaceDir, "bin").replace(/\\/g, "/");
+	}
+	global.platform = platform;
+	let file = fs.readFileSync(_path, "utf-8");
+	if (file) {
+		if (QUICKGAMELIST.includes(platform)) {
+			file = file.replace(/\$basePath/g, releaseDir + "/temprelease");
+		} else {
+			file = file.replace(/\$basePath/g, releaseDir);
+		}
+		config = JSON.parse(file);
+		global.config = config;
+	}
+	// 是否是开放域项目
+	let projInfoPath = path.join(workSpaceDir, path.basename(workSpaceDir) + ".laya");
+	let isExist = fs.existsSync(projInfoPath);
+	if (isExist) {
+		try {
+			let projInfo = fs.readFileSync(projInfoPath, "utf8");
+			projInfo = projInfo && JSON.parse(projInfo);
+			isOpendataProj = projInfo.layaProType === 12;
+		} catch (e) {}
+	}
+});
+
+// 清理release文件夹
+gulp.task("clearReleaseDir", ["compile"], function (cb) {
+	if (config.clearReleaseDir) {
+		let delList = [releaseDir, releaseDir + "_pack", config.packfileTargetValue];
+		// 小米快游戏,使用即存的项目,删掉Laya工程文件,保留小米环境项目文件
+		if (platform === "xmgame") {
+			let xmProjSrc = path.join(releaseDir, config.xmInfo.projName);
+			// 不要删掉manifest.json/main.js文件
+			// 这里不是node-glob语法,详见: https://github.com/sindresorhus/del
+			delList = [`${xmProjSrc}/**`, `!${xmProjSrc}`, `!${xmProjSrc}/node_modules/**`, `!${xmProjSrc}/sign/**`, `!${xmProjSrc}/{babel.config.js,main.js,manifest.json,package.json,package-lock.json}`];
+		} else if (platform === "oppogame") {
+			let oppoProjSrc = path.join(releaseDir, config.oppoInfo.projName);
+			delList = [`${oppoProjSrc}/**`, `!${oppoProjSrc}`, `!${oppoProjSrc}/dist/**`, `!${oppoProjSrc}/{manifest.json}`];
+		} else if (platform === "vivogame") {
+			let vvProj = path.join(releaseDir, config.vivoInfo.projName);
+			let vvProjSrc = path.join(vvProj, "src");
+			// 不要删掉manifest.json/main.js文件
+			// 这里不是node-glob语法,详见: https://github.com/sindresorhus/del
+			delList = [`${vvProjSrc}/**`, `!${vvProjSrc}`, `!${vvProjSrc}/sign/**`, `!${vvProjSrc}/{game.js,manifest.json}`];
+			delList = delList.concat(`${vvProj}/engine/**`, `${vvProj}/config/**`);
+		}
+		del(delList, { force: true }).then(paths => {
+			cb();
+		});
+	} else cb();
+});
+
+// copy bin文件到release文件夹
+gulp.task("copyFile", ["clearReleaseDir"], function () {
+	let baseCopyFilter = [`${workSpaceDir}/bin/**/*.*`, `!${workSpaceDir}/bin/indexmodule.html`, `!${workSpaceDir}/bin/import/*.*`];
+	// 只拷贝index.js中引用的类库
+	if (config.onlyIndexJS) {
+		baseCopyFilter = baseCopyFilter.concat(`!${workSpaceDir}/bin/libs/*.*`);
+	}
+	if (platform === "wxgame" && isOpendataProj) { // 开放域项目微信发布,仅拷贝用到的文件
+		config.copyFilesFilter = [`${workSpaceDir}/bin/js/bundle.js`, `${workSpaceDir}/bin/index.js`, `${workSpaceDir}/bin/game.js`];
+		if (config.projectType !== "as") { // 开放域精简类库
+			config.copyFilesFilter.push(`${workSpaceDir}/bin/libs/laya.opendata.js`);
+		}
+	} else if (platform === "wxgame") { // 微信项目,不拷贝index.html,不拷贝百度bin目录中的文件
+		config.copyFilesFilter = baseCopyFilter.concat([`!${workSpaceDir}/bin/index.html`, `!${workSpaceDir}/bin/{project.swan.json,swan-game-adapter.js}`]);
+	} else if (platform === "bdgame") { // 百度项目,不拷贝index.html,不拷贝微信bin目录中的文件
+		config.copyFilesFilter = baseCopyFilter.concat([`!${workSpaceDir}/bin/index.html`, `!${workSpaceDir}/bin/{project.config.json,weapp-adapter.js}`]);
+	} else { // web|QQ项目|bili|快游戏,不拷贝微信、百度在bin目录中的文件
+		config.copyFilesFilter = baseCopyFilter.concat([`!${workSpaceDir}/bin/{game.js,game.json,project.config.json,weapp-adapter.js,project.swan.json,swan-game-adapter.js}`]);
+	}
+	// bili/alipay/qq,不拷贝index.html
+	if (["biligame", "Alipaygame", "qqgame"].includes(platform)) {
+		config.copyFilesFilter = config.copyFilesFilter.concat([`!${workSpaceDir}/bin/index.html`]);
+	}
+	// 快游戏,需要新建一个快游戏项目,拷贝的只是项目的一部分,将文件先拷贝到文件夹的临时目录中去
+	if (QUICKGAMELIST.includes(platform)) {
+		config.copyFilesFilter = config.copyFilesFilter.concat([`!${workSpaceDir}/bin/index.html`]);
+		releaseDir = global.tempReleaseDir = path.join(releaseDir, "temprelease");
+	}
+	if (config.exclude) { // 排除文件
+		config.excludeFilter.forEach(function(item, index, list) {
+			releaseDir = releaseDir.replace(/\\/g, "/");
+			config.excludeFilter[index] = item.replace(releaseDir, binPath);
+		});
+		config.copyFilesFilter = config.copyFilesFilter.concat(config.excludeFilter);
+	}
+	global.releaseDir = releaseDir;
+	var stream = gulp.src(config.copyFilesFilter, { base: `${workSpaceDir}/bin` });
+	return stream.pipe(gulp.dest(releaseDir));
+});
+
+// copy libs中的js文件到release文件夹
+gulp.task("copyLibsJsFile", ["copyFile"], function () {
+	if (!config.onlyIndexJS) {
+		return;
+	}
+	if (platform === "wxgame" && isOpendataProj) { // 开放域项目微信发布,拷贝文件时已经拷贝类库文件了
+		return;
+	}
+	// 开放域项目,as语言,没有libs目录,mac系统报错
+	let libs = path.join(workSpaceDir, "bin", "libs");
+	if (!fs.existsSync(libs)) {
+		return;
+	}
+	// 分析index.js
+	let indexJSPath = path.join(workSpaceDir, "bin", "index.js");
+	let indexJsContent = fs.readFileSync(indexJSPath, "utf8");
+	let libsList = indexJsContent.match(/loadLib\(['"]libs\/[\w-./]+\.(js|wasm)['"]\)/g);
+	if (!libsList) {
+		libsList = [];
+	}
+	let 
+		item,
+		libsName = "",
+		libsStr = "";
+	for (let i = 0, len = libsList.length; i < len; i++) {
+		item = libsList[i];
+		libsName = item.match(/loadLib\(['"]libs\/([\w-./]+\.(js|wasm))['"]\)/);
+		libsStr += libsStr ? `,${libsName[1]}` : libsName[1];
+	}
+	// 发布web项目,如果使用了physics3D,默认拷贝runtime
+	if (platform === "web" && libsStr.includes("laya.physics3D")) {
+		libsStr += ',laya.physics3D.runtime.js';
+	}
+	let copyLibsList = [`${workSpaceDir}/bin/libs/{${libsStr}}`];
+	if (!libsStr.includes(",")) {
+		copyLibsList = [`${workSpaceDir}/bin/libs/${libsStr}`];
+	}
+	var stream = gulp.src(copyLibsList, { base: `${workSpaceDir}/bin` });
+	return stream.pipe(gulp.dest(releaseDir));
+});
+
+// 压缩json
+gulp.task("compressJson", ["copyLibsJsFile"], function () {
+	if (config.compressJson) {
+		return gulp.src(config.compressJsonFilter, { base: releaseDir })
+			.pipe(jsonminify())
+			.pipe(gulp.dest(releaseDir));
+	}
+});
+
+// 压缩js
+gulp.task("compressJs", ["compressJson"], function () {
+	if (config.compressJs) {
+		return gulp.src(config.compressJsFilter, { base: releaseDir })
+			.pipe(uglify({
+				mangle: {
+					keep_fnames:true
+				}
+			}))
+			.on('error', function (err) {
+				console.warn(err.toString());
+			})
+			.pipe(gulp.dest(releaseDir));
+	}
+});
+
+// 压缩png,jpg
+gulp.task("compressImage", ["compressJs"], function () {
+	if (config.compressImage) {
+		return gulp.src(config.compressImageFilter, { base: releaseDir })
+			.pipe(image({
+				pngquant: true,			//PNG优化工具
+				optipng: false,			//PNG优化工具
+				zopflipng: true,		//PNG优化工具
+				jpegRecompress: false,	//jpg优化工具
+				mozjpeg: true,			//jpg优化工具
+				guetzli: false,			//jpg优化工具
+				gifsicle: false,		//gif优化工具
+				svgo: false,			//SVG优化工具
+				concurrent: 10,			//并发线程数
+				quiet: true 			//是否是静默方式
+				// optipng: ['-i 1', '-strip all', '-fix', '-o7', '-force'],
+				// pngquant: ['--speed=1', '--force', 256],
+				// zopflipng: ['-y', '--lossy_8bit', '--lossy_transparent'],
+				// jpegRecompress: ['--strip', '--quality', 'medium', '--min', 40, '--max', 80],
+				// mozjpeg: ['-optimize', '-progressive'],
+				// guetzli: ['--quality', 85]
+			}))
+			.pipe(gulp.dest(releaseDir));
+	}
+});
+
+// 生成版本管理信息
+gulp.task("version1", ["compressImage"], function () {
+	if (config.version) {
+		return gulp.src(config.versionFilter, { base: releaseDir })
+			.pipe(rev())
+			.pipe(gulp.dest(releaseDir))
+			.pipe(revdel())
+			.pipe(rev.manifest("version.json"))
+			.pipe(gulp.dest(releaseDir));
+	}
+});
+
+// 替换index.js里面的变化的文件名
+gulp.task("version2", ["version1"], function () {
+	if (config.version) {
+		//替换index.html和index.js里面的文件名称
+
+		let htmlPath = releaseDir + "/index.html";
+		let versionPath = releaseDir + "/version.json";
+		let gameJSPath = releaseDir + "/game.js";
+		let mainJSPath = releaseDir + "/main.js";
+		let indexJSPath;
+		let versionCon = fs.readFileSync(versionPath, "utf8");
+		versionCon = JSON.parse(versionCon);
+		indexJSPath = releaseDir + "/" + versionCon["index.js"];
+		// 替换config.packfileFullValue中的路径
+		let packfileStr = JSON.stringify(config.packfileFullValue).replace(/\\\\/g, "/");
+		let tempPackfile = `${workSpaceDir}/.laya/configTemp.json`;
+		fs.writeFileSync(tempPackfile, packfileStr, "utf8");
+
+		let srcList = [versionPath, indexJSPath, tempPackfile];
+		if (fs.existsSync(htmlPath)) {
+			srcList.push(htmlPath);
+		}
+		if (fs.existsSync(gameJSPath)) {
+			srcList.push(gameJSPath);
+		}
+		if (fs.existsSync(mainJSPath)) {
+			srcList.push(mainJSPath);
+		}
+		return gulp.src(srcList)
+			.pipe(revCollector())
+			.pipe(gulp.dest(releaseDir));
+	}
+});
+
+// 筛选4M包
+gulp.task("packfile", ["version2"], function() {
+	if (config.version) {
+		// 从release目录取得带有版本号的目录
+		let tempPackfile = `${workSpaceDir}/.laya/configTemp.json`;
+		let releasePackfile = `${releaseDir}/configTemp.json`;
+		let packfileStr = fs.readFileSync(releasePackfile, "utf8");
+		config.packfileFullValue = JSON.parse(packfileStr);
+		// 删掉临时目录
+		fs.unlinkSync(tempPackfile);
+		fs.unlinkSync(releasePackfile);
+	}
+	if (config.packfile) { // 提取本地包(文件列表形式)
+		return gulp.src(config.packfileFullValue, { base: releaseDir })
+			.pipe(gulp.dest(config.packfileTargetValue || releaseDir + "_pack"));
+	}
+});
+
+// 起始任务
+gulp.task("publish", ["buildXiaomiProj", "buildOPPOProj", "buildVivoProj", "buildWXProj", "buildBDProj", "buildQQProj"], function () {
+	console.log("All tasks completed!");
+});

+ 178 - 0
RubikCube/.laya/publish_bdgame.js

@@ -0,0 +1,178 @@
+// v1.2.0
+// publish 2.x 也是用这个文件,需要做兼容
+let isPublish2 = process.argv[2].includes("publish_bdgame.js") && process.argv[3].includes("--evn=publish2");
+// 获取Node插件和工作路径
+let ideModuleDir, workSpaceDir;
+if (isPublish2) {
+	//是否使用IDE自带的node环境和插件,设置false后,则使用自己环境(使用命令行方式执行)
+	const useIDENode = process.argv[0].indexOf("LayaAir") > -1 ? true : false;
+	ideModuleDir = useIDENode ? process.argv[1].replace("gulp\\bin\\gulp.js", "").replace("gulp/bin/gulp.js", "") : "";
+	workSpaceDir = useIDENode ? process.argv[2].replace("--gulpfile=", "").replace("\\.laya\\publish_bdgame.js", "").replace("/.laya/publish_bdgame.js", "") + "/" : "./../";
+} else {
+	ideModuleDir = global.ideModuleDir;
+	workSpaceDir = global.workSpaceDir;
+}
+
+//引用插件模块
+const gulp = require(ideModuleDir + "gulp");
+const fs = require("fs");
+const path = require("path");
+const crypto = require("crypto");
+const childProcess = require("child_process");
+const del = require(ideModuleDir + "del");
+const revCollector = require(ideModuleDir + 'gulp-rev-collector');
+let commandSuffix = ".cmd";
+let prevTasks = ["packfile"];
+if (isPublish2) {
+	prevTasks = "";
+}
+
+let 
+    config,
+	platform,
+    releaseDir;
+let isGlobalCli = true;
+let versionCon; // 版本管理version.json
+// 应该在publish中的,但是为了方便发布2.0及IDE 1.x,放在这里修改
+gulp.task("preCreate_BD", prevTasks, function() {
+	if (isPublish2) {
+		let pubsetPath = path.join(workSpaceDir, ".laya", "pubset.json");
+		let content = fs.readFileSync(pubsetPath, "utf8");
+		let pubsetJson = JSON.parse(content);
+		platform = "bdgame";
+		releaseDir = path.join(workSpaceDir, "release", platform).replace(/\\/g, "/");
+		config = pubsetJson[3];
+	} else {
+		platform = global.platform;
+		releaseDir = global.releaseDir;
+		config = global.config;
+	}
+	// 如果不是百度小游戏
+	if (platform !== "bdgame") {
+		return;
+	}
+	if (process.platform === "darwin") {
+		commandSuffix = "";
+	}
+	let copyLibsList = [`${workSpaceDir}/bin/libs/laya.bdmini.js`];
+	var stream = gulp.src(copyLibsList, { base: `${workSpaceDir}/bin` });
+	return stream.pipe(gulp.dest(releaseDir));
+});
+
+gulp.task("copyPlatformFile_BD", ["preCreate_BD"], function() {
+	// 如果不是百度小游戏
+	if (platform !== "bdgame") {
+		return;
+	}
+	let adapterPath = path.join(ideModuleDir, "../", "out", "layarepublic", "LayaAirProjectPack", "lib", "data", "bdfiles");
+	// 如果新建项目时已经点击了"微信/百度小游戏bin目录快速调试",不再拷贝
+	let isHadBdFiles =
+		fs.existsSync(path.join(workSpaceDir, "bin", "game.js")) &&
+		fs.existsSync(path.join(workSpaceDir, "bin", "game.json")) &&
+		fs.existsSync(path.join(workSpaceDir, "bin", "project.swan.json")) &&
+		fs.existsSync(path.join(workSpaceDir, "bin", "swan-game-adapter.js"));
+	if (isHadBdFiles) {
+		return;
+	}
+	let stream = gulp.src(adapterPath + "/*.*");
+	return stream.pipe(gulp.dest(releaseDir));
+});
+
+gulp.task("modifyFile_BD", ["copyPlatformFile_BD"], function() {
+	// 如果不是百度小游戏
+	if (platform !== "bdgame") {
+		return;
+	}
+	if (config.version) {
+		let versionPath = releaseDir + "/version.json";
+		versionCon = fs.readFileSync(versionPath, "utf8");
+		versionCon = JSON.parse(versionCon);
+	}
+	let indexJsStr = (versionCon && versionCon["index.js"]) ? versionCon["index.js"] :  "index.js";
+	// 百度小游戏项目,修改index.js
+	let filePath = path.join(releaseDir, indexJsStr);
+	if (!fs.existsSync(filePath)) {
+		return;
+	}
+	let fileContent = fs.readFileSync(filePath, "utf8");
+	fileContent = fileContent.replace(/loadLib(\(['"])/gm, "require$1./");
+	fs.writeFileSync(filePath, fileContent, "utf8");
+});
+
+// 开放域的情况下,合并game.js和index.js,并删除game.js
+gulp.task("openData_BD", ["modifyFile_BD"], function (cb) {
+	// 如果不是百度小游戏
+	if (platform !== "bdgame") {
+		return cb();
+	}
+	if (config.openDataZone) {
+		let versionCon;
+		if (config.version) {
+			let versionPath = releaseDir + "/version.json";
+			versionCon = fs.readFileSync(versionPath, "utf8");
+			versionCon = JSON.parse(versionCon);
+		}
+		let indexJsStr = (versionCon && versionCon["index.js"]) ? versionCon["index.js"] :  "index.js";
+		let indexPath = path.join(releaseDir, indexJsStr);
+		let indexjs = readFile(indexPath);
+		let gamejs = readFile(releaseDir + "/game.js");
+		if (gamejs && indexjs) {
+			gamejs = gamejs.replace(`require("index.js")`, indexjs);
+			fs.writeFileSync(indexPath, gamejs, 'utf-8');
+		}
+		return cb();
+	}
+	cb();
+});
+
+function readFile(path) {
+	if (fs.existsSync(path)) {
+		return fs.readFileSync(path, "utf-8");
+	}
+	return null;
+}
+
+gulp.task("version_BD", ["openData_BD"], function() {
+	// 如果不是百度小游戏
+	if (platform !== "bdgame") {
+		return;
+	}
+	if (config.version) {
+		let versionPath = releaseDir + "/version.json";
+		let gameJSPath = releaseDir + "/game.js";
+		let srcList = [versionPath, gameJSPath];
+		return gulp.src(srcList)
+			.pipe(revCollector())
+			.pipe(gulp.dest(releaseDir));
+	}
+});
+
+gulp.task("optimizeOpen_BD", ["version_BD"], function(cb) {
+	// 如果不是百度小游戏
+	if (platform !== "bdgame") {
+		return cb();
+	}
+	let bdOptimize = config.bdOptimize;
+	if (!bdOptimize || !bdOptimize.useOptimizeOpen) {
+		return cb();
+	}
+	// 首屏加载优化(秒开),修改game.json
+	let filePath = path.join(releaseDir, "game.json");
+	if (!fs.existsSync(filePath)) {
+		return cb();
+	}
+	let fileContent = fs.readFileSync(filePath, "utf8");
+	let fileConObj = JSON.parse(fileContent);
+	if (bdOptimize.preloadRes) {
+		fileConObj.preloadResources = bdOptimize.preloadResList;
+	} else {
+		delete fileConObj.preloadResources;
+	}
+
+	fs.writeFileSync(filePath, JSON.stringify(fileConObj, null, 4), "utf8");
+	return cb();
+});
+
+gulp.task("buildBDProj", ["optimizeOpen_BD"], function() {
+	console.log("all tasks completed");
+});

+ 447 - 0
RubikCube/.laya/publish_oppogame.js

@@ -0,0 +1,447 @@
+// v1.2.0
+// publish 2.x 也是用这个文件,需要做兼容
+let isPublish2 = process.argv[2].includes("publish_oppogame.js") && process.argv[3].includes("--evn=publish2");
+// 获取Node插件和工作路径
+let ideModuleDir, workSpaceDir;
+if (isPublish2) {
+	//是否使用IDE自带的node环境和插件,设置false后,则使用自己环境(使用命令行方式执行)
+	const useIDENode = process.argv[0].indexOf("LayaAir") > -1 ? true : false;
+	ideModuleDir = useIDENode ? process.argv[1].replace("gulp\\bin\\gulp.js", "").replace("gulp/bin/gulp.js", "") : "";
+	workSpaceDir = useIDENode ? process.argv[2].replace("--gulpfile=", "").replace("\\.laya\\publish_oppogame.js", "").replace("/.laya/publish_oppogame.js", "") + "/" : "./../";
+} else {
+	ideModuleDir = global.ideModuleDir;
+	workSpaceDir = global.workSpaceDir;
+}
+
+//引用插件模块
+const gulp = require(ideModuleDir + "gulp");
+const fs = require("fs");
+const path = require("path");
+const childProcess = require("child_process");
+const del = require(ideModuleDir + "del");
+const revCollector = require(ideModuleDir + 'gulp-rev-collector');
+let commandSuffix = ".cmd";
+
+let prevTasks = ["packfile"];
+if (isPublish2) {
+	prevTasks = "";
+}
+
+let 
+    config,
+	platform,
+	releaseDir,
+    toolkitPath,
+    tempReleaseDir, // OPPO临时拷贝目录
+	projDir; // OPPO快游戏工程目录
+let versionCon; // 版本管理version.json
+// 创建OPPO项目前,拷贝OPPO引擎库、修改index.js
+// 应该在publish中的,但是为了方便发布2.0及IDE 1.x,放在这里修改
+gulp.task("preCreate_OPPO", prevTasks, function() {
+	if (isPublish2) {
+		let pubsetPath = path.join(workSpaceDir, ".laya", "pubset.json");
+		let content = fs.readFileSync(pubsetPath, "utf8");
+		let pubsetJson = JSON.parse(content);
+		platform = "oppogame";
+		releaseDir = path.join(workSpaceDir, "release", platform).replace(/\\/g, "/");
+		releaseDir = tempReleaseDir = path.join(releaseDir, "temprelease");
+		config = pubsetJson[5]; // 只用到了 config.oppoInfo|config.oppoSign
+	} else {
+		platform = global.platform;
+		releaseDir = global.releaseDir;
+		tempReleaseDir = global.tempReleaseDir;
+		config = global.config;
+	}
+    toolkitPath = path.join(ideModuleDir, "../", "out", "layarepublic", "oppo", "quickgame-toolkit");
+	// 如果不是OPPO快游戏
+	if (platform !== "oppogame") {
+		return;
+	}
+	if (process.platform === "darwin") {
+		commandSuffix = "";
+	}
+	let copyLibsList = [`${workSpaceDir}/bin/libs/laya.quickgamemini.js`];
+	var stream = gulp.src(copyLibsList, { base: `${workSpaceDir}/bin` });
+	return stream.pipe(gulp.dest(tempReleaseDir));
+});
+
+// 新建OPPO项目-OPPO项目与其他项目不同,需要安装OPPO quickgame node_modules,并打包成.rpk文件
+gulp.task("installModules_OPPO", ["preCreate_OPPO"], function() {
+	// 如果不是OPPO快游戏
+	if (platform !== "oppogame") {
+		return;
+	}
+	releaseDir = path.dirname(releaseDir);
+	projDir = path.join(releaseDir, config.oppoInfo.projName);
+    // 如果IDE里对应OPPO包已经install node_modules了,忽略这一步
+    if (fs.existsSync(path.join(toolkitPath, "node_modules"))) {
+        return;
+    }
+	// 安装OPPO quickgame node_modules
+	return new Promise((resolve, reject) => {
+		console.log("开始安装OPPO quickgame node_modules,请耐心等待...");
+		let cmd = `npm${commandSuffix}`;
+		let args = ["install"];
+        
+        let cp = childProcess.spawn(cmd, args, {
+            cwd: toolkitPath
+        });
+        
+		cp.stdout.on('data', (data) => {
+			console.log(`stdout: ${data}`);
+		});
+		
+		cp.stderr.on('data', (data) => {
+			console.log(`stderr: ${data}`);
+			// reject();
+		});
+		
+		cp.on('close', (code) => {
+			console.log(`子进程退出码:${code}`);
+			resolve();
+		});
+	});
+});
+
+// 拷贝文件到OPPO快游戏
+gulp.task("copyFileToProj_OPPO", ["installModules_OPPO"], function() {
+	// 如果不是OPPO快游戏
+	if (platform !== "oppogame") {
+		return;
+	}
+	// 将临时文件夹中的文件,拷贝到项目中去
+	let originalDir = `${tempReleaseDir}/**/*.*`;
+	let stream = gulp.src(originalDir);
+	return stream.pipe(gulp.dest(path.join(projDir)));
+});
+
+// 拷贝icon到OPPO快游戏
+gulp.task("copyIconToProj_OPPO", ["copyFileToProj_OPPO"], function() {
+	// 如果不是OPPO快游戏
+	if (platform !== "oppogame") {
+		return;
+	}
+	let originalDir = config.oppoInfo.icon;
+	let stream = gulp.src(originalDir);
+	return stream.pipe(gulp.dest(path.join(projDir)));
+});
+
+// 清除OPPO快游戏临时目录
+gulp.task("clearTempDir_OPPO", ["copyIconToProj_OPPO"], function() {
+	// 如果不是OPPO快游戏
+	if (platform !== "oppogame") {
+		return;
+	}
+	// 删掉临时目录
+	return del([tempReleaseDir], { force: true });
+});
+
+// 生成release签名(私钥文件 private.pem 和证书文件 certificate.pem )
+gulp.task("generateSign_OPPO", ["clearTempDir_OPPO"], function() {
+	// 如果不是OPPO快游戏
+	if (platform !== "oppogame") {
+		return;
+    }
+    if (!config.oppoSign.generateSign) {
+        return;
+    }
+	// https://doc.quickapp.cn/tools/compiling-tools.html
+	return new Promise((resolve, reject) => {
+		let cmd = "openssl";
+		let args = ["req", "-newkey", "rsa:2048", "-nodes", "-keyout", "private.pem", 
+					"-x509", "-days", "3650", "-out", "certificate.pem"];
+		let opts = {
+			cwd: projDir,
+			shell: true
+		};
+		let cp = childProcess.spawn(cmd, args, opts);
+		cp.stdout.on('data', (data) => {
+			console.log(`stdout: ${data}`);
+		});
+
+		cp.stderr.on('data', (data) => {
+			console.log(`stderr: ${data}`);
+			data += "";
+			if (data.includes("Country Name")) {
+				cp.stdin.write(`${config.oppoSign.countryName}\n`);
+				console.log(`Country Name: ${config.oppoSign.countryName}`);
+			} else if (data.includes("Province Name")) {
+				cp.stdin.write(`${config.oppoSign.provinceName}\n`);
+				console.log(`Province Name: ${config.oppoSign.provinceName}`);
+			} else if (data.includes("Locality Name")) {
+				cp.stdin.write(`${config.oppoSign.localityName}\n`);
+				console.log(`Locality Name: ${config.oppoSign.localityName}`);
+			} else if (data.includes("Organization Name")) {
+				cp.stdin.write(`${config.oppoSign.orgName}\n`);
+				console.log(`Organization Name: ${config.oppoSign.orgName}`);
+			} else if (data.includes("Organizational Unit Name")) {
+				cp.stdin.write(`${config.oppoSign.orgUnitName}\n`);
+				console.log(`Organizational Unit Name: ${config.oppoSign.orgUnitName}`);
+			} else if (data.includes("Common Name")) {
+				cp.stdin.write(`${config.oppoSign.commonName}\n`);
+				console.log(`Common Name: ${config.oppoSign.commonName}`);
+			} else if (data.includes("Email Address")) {
+				cp.stdin.write(`${config.oppoSign.emailAddr}\n`);
+				console.log(`Email Address: ${config.oppoSign.emailAddr}`);
+				// cp.stdin.end();
+			}
+			// reject();
+		});
+
+		cp.on('close', (code) => {
+			console.log(`子进程退出码:${code}`);
+			resolve();
+		});
+	});
+});
+
+// 拷贝sign文件到指定位置
+gulp.task("copySignFile_OPPO", ["generateSign_OPPO"], function() {
+	// 如果不是OPPO快游戏
+	if (platform !== "oppogame") {
+		return;
+    }
+    if (config.oppoSign.generateSign) { // 新生成的签名
+        // 移动签名文件到项目中(Laya & OPPO快游戏项目中)
+        let 
+            privatePem = path.join(projDir, "private.pem"),
+            certificatePem = path.join(projDir, "certificate.pem");
+        let isSignExits = fs.existsSync(privatePem) && fs.existsSync(certificatePem);
+        if (!isSignExits) {
+            return;
+        }
+        let 
+            xiaomiDest = `${projDir}/sign/release`,
+            layaDest = `${workSpaceDir}/sign/release`;
+        let stream = gulp.src([privatePem, certificatePem]);
+        return stream.pipe(gulp.dest(xiaomiDest))
+                    .pipe(gulp.dest(layaDest));
+    } else if (config.oppoInfo.useReleaseSign && !config.oppoSign.generateSign) { // 使用release签名,并且没有重新生成
+        // 从项目中将签名拷贝到OPPO快游戏项目中
+        let 
+            privatePem = path.join(workSpaceDir, "sign", "release", "private.pem"),
+            certificatePem = path.join(workSpaceDir, "sign", "release", "certificate.pem");
+        let isSignExits = fs.existsSync(privatePem) && fs.existsSync(certificatePem);
+        if (!isSignExits) {
+            return;
+        }
+        let 
+            xiaomiDest = `${projDir}/sign/release`;
+        let stream = gulp.src([privatePem, certificatePem]);
+        return stream.pipe(gulp.dest(xiaomiDest));
+    }
+});
+
+gulp.task("deleteSignFile_OPPO", ["copySignFile_OPPO"], function() {
+	// 如果不是OPPO快游戏
+	if (platform !== "oppogame") {
+		return;
+	}
+	if (config.oppoSign.generateSign) { // 新生成的签名
+		let 
+            privatePem = path.join(projDir, "private.pem"),
+            certificatePem = path.join(projDir, "certificate.pem");
+		return del([privatePem, certificatePem], { force: true });
+	}
+});
+
+gulp.task("modifyFile_OPPO", ["deleteSignFile_OPPO"], function() {
+	// 如果不是OPPO快游戏
+	if (platform !== "oppogame") {
+		return;
+	}
+	// 修改manifest.json文件
+	let manifestPath = path.join(projDir, "manifest.json");
+	let IDEManifestPath = path.join(toolkitPath, "tpl", "manifest.json");
+	if (!fs.existsSync(IDEManifestPath)) {
+		return;
+	}
+	let manifestContent = fs.readFileSync(IDEManifestPath, "utf8");
+	let manifestJson = JSON.parse(manifestContent);
+	manifestJson.package = config.oppoInfo.package;
+	manifestJson.name = config.oppoInfo.name;
+	manifestJson.orientation = config.oppoInfo.orientation;
+	manifestJson.config.logLevel = config.oppoInfo.logLevel || "off";
+	manifestJson.versionName = config.oppoInfo.versionName;
+	manifestJson.versionCode = config.oppoInfo.versionCode;
+	manifestJson.minPlatformVersion = config.oppoInfo.minPlatformVersion;
+	manifestJson.icon = `./${path.basename(config.oppoInfo.icon)}`;
+	if (config.oppoInfo.subpack) {
+		manifestJson.subpackages = config.oppoSubpack;
+	}
+	fs.writeFileSync(manifestPath, JSON.stringify(manifestJson, null, 4), "utf8");
+
+	if (config.version) {
+		let versionPath = projDir + "/version.json";
+		versionCon = fs.readFileSync(versionPath, "utf8");
+		versionCon = JSON.parse(versionCon);
+	}
+	let indexJsStr = (versionCon && versionCon["index.js"]) ? versionCon["index.js"] :  "index.js";
+	// OPPO项目,修改main.js
+	let filePath = path.join(projDir, "main.js");
+	// 这个地方,1.x IDE和2.x IDE 不一致
+	let fileContent = `window.navigator.userAgent = 'Mozilla/5.0 (Linux; Android 5.1.1; Nexus 6 Build/LYZ28E) AppleWebKit/603.1.30 (KHTML, like Gecko) Mobile/14E8301 OPPO MiniGame NetType/WIFI Language/zh_CN';
+require("./libs/laya.quickgamemini.js");\nrequire("index.js");`;
+	fs.writeFileSync(filePath, fileContent, "utf8");
+
+	// OPPO项目,修改index.js
+	let indexFilePath = path.join(projDir, indexJsStr);
+	if (!fs.existsSync(indexFilePath)) {
+		return;
+	}
+	let indexFileContent = fs.readFileSync(indexFilePath, "utf8");
+	indexFileContent = indexFileContent.replace(/loadLib(\(['"])/gm, "require$1./");
+	fs.writeFileSync(indexFilePath, indexFileContent, "utf8");
+});
+
+gulp.task("version_OPPO", ["modifyFile_OPPO"], function () {
+	// 如果不是OPPO快游戏
+	if (platform !== "oppogame") {
+		return;
+	}
+	if (config.version) {
+		let versionPath = projDir + "/version.json";
+		let mainJSPath = projDir + "/main.js";
+		let srcList = [versionPath, mainJSPath];
+		return gulp.src(srcList)
+			.pipe(revCollector())
+			.pipe(gulp.dest(projDir));
+	}
+});
+
+// 打包rpk
+gulp.task("buildRPK_OPPO", ["version_OPPO"], function() {
+	// 如果不是OPPO快游戏
+	if (platform !== "oppogame") {
+		return;
+	}
+	// 在OPPO轻游戏项目目录中执行:
+    // quickgame pack || quickgame pack release
+    // quickgame subpack --no-build-js || quickgame subpack release --no-build-js
+	let cmdStr = "";
+	let packStr = "pack";
+	let nobuildjs = "";
+	if (config.oppoInfo.subpack) {
+		packStr = "subpack";
+		nobuildjs = "--no-build-js";
+	}
+    if (config.oppoInfo.useReleaseSign) {
+        cmdStr = "release";
+    }
+	return new Promise((resolve, reject) => {
+		let cmd = path.join(toolkitPath, "lib", "bin", `quickgame${commandSuffix}`);
+		let args = [packStr, cmdStr, nobuildjs];
+		let opts = {
+			cwd: projDir
+		};
+		let cp = childProcess.spawn(cmd, args, opts);
+		// let cp = childProcess.spawn('npx.cmd', ['-v']);
+		cp.stdout.on('data', (data) => {
+			console.log(`stdout: ${data}`);
+		});
+
+		cp.stderr.on('data', (data) => {
+			console.log(`stderr: ${data}`);
+			// reject();
+		});
+
+		cp.on('close', (code) => {
+			console.log(`子进程退出码:${code}`);
+			resolve();
+		});
+	});
+});
+
+gulp.task("pushRPK_OPPO", ["buildRPK_OPPO"], function() {
+	// 如果不是OPPO快游戏
+	if (platform !== "oppogame") {
+		return;
+	}
+	if (!config.oppoInfo.oppoDebug) {
+        return;
+    }
+	// 在OPPO轻游戏项目目录中执行:
+    // adb push dist/game.rpk sdcard/games
+	// adb push idePath/resources/app/out/layarepublic/oppo/instant_app_settings.properties
+	// adb shell am start -n com.nearme.instant.platform/com.oppo.autotest.main.InstantAppActivity
+	return new Promise((resolve, reject) => {
+		let cmd = "adb";
+		let sdGamesPath = config.oppoInfo.subpack ? "sdcard/subPkg" : "sdcard/games";
+		let args = ["push", `dist/${config.oppoInfo.package}${config.oppoInfo.useReleaseSign ? ".signed" : ""}.rpk`, sdGamesPath];
+		let opts = {
+			cwd: projDir
+		};
+		let cp = childProcess.spawn(cmd, args, opts);
+		// let cp = childProcess.spawn('npx.cmd', ['-v']);
+		cp.stdout.on('data', (data) => {
+			console.log(`stdout: ${data}`);
+		});
+
+		cp.stderr.on('data', (data) => {
+			console.log(`stderr: ${data}`);
+			// reject();
+		});
+
+		cp.on('close', (code) => {
+			console.log(`1) push_RPK 子进程退出码:${code}`);
+			resolve();
+		});
+	}).then(() => {
+		return new Promise((resolve, reject) => {
+			// 如果是分包,需要修改里面的内容
+			let oppoPropPath = path.join(ideModuleDir, "../", `/out/layarepublic/oppo/instant_app_settings.properties`);
+			if (config.oppoInfo.subpack) {
+				fs.writeFileSync(oppoPropPath, "default_tab_index=4", "utf8");
+			} else {
+				fs.writeFileSync(oppoPropPath, "default_tab_index=2", "utf8");
+			}
+			let cmd = "adb";
+			let args = ["push", oppoPropPath, "sdcard/"];
+			let opts = {
+				cwd: projDir
+			};
+			let cp = childProcess.spawn(cmd, args, opts);
+			// let cp = childProcess.spawn('npx.cmd', ['-v']);
+			cp.stdout.on('data', (data) => {
+				console.log(`stdout: ${data}`);
+			});
+	
+			cp.stderr.on('data', (data) => {
+				console.log(`stderr: ${data}`);
+				// reject();
+			});
+	
+			cp.on('close', (code) => {
+				console.log(`2) push_RPK 子进程退出码:${code}`);
+				resolve();
+			});
+		});
+	}).then(() => {
+		return new Promise((resolve, reject) => {
+			let cmd = "adb";
+			let args = ["shell", "am", "start", "-n", "com.nearme.instant.platform/com.oppo.autotest.main.InstantAppActivity"];
+			let opts = {
+				cwd: projDir
+			};
+			let cp = childProcess.spawn(cmd, args, opts);
+			// let cp = childProcess.spawn('npx.cmd', ['-v']);
+			cp.stdout.on('data', (data) => {
+				console.log(`stdout: ${data}`);
+			});
+	
+			cp.stderr.on('data', (data) => {
+				console.log(`stderr: ${data}`);
+				// reject();
+			});
+	
+			cp.on('close', (code) => {
+				console.log(`3) push_RPK 子进程退出码:${code}`);
+				resolve();
+			});
+		});
+	});
+});
+
+gulp.task("buildOPPOProj", ["pushRPK_OPPO"], function() {
+	console.log("all tasks completed");
+});

+ 89 - 0
RubikCube/.laya/publish_qqgame.js

@@ -0,0 +1,89 @@
+// v1.0.0
+// publish 2.x 也是用这个文件,需要做兼容
+let isPublish2 = process.argv[2].includes("publish_qqgame.js") && process.argv[3].includes("--evn=publish2");
+// 获取Node插件和工作路径
+let ideModuleDir, workSpaceDir;
+if (isPublish2) {
+	//是否使用IDE自带的node环境和插件,设置false后,则使用自己环境(使用命令行方式执行)
+	const useIDENode = process.argv[0].indexOf("LayaAir") > -1 ? true : false;
+	ideModuleDir = useIDENode ? process.argv[1].replace("gulp\\bin\\gulp.js", "").replace("gulp/bin/gulp.js", "") : "";
+	workSpaceDir = useIDENode ? process.argv[2].replace("--gulpfile=", "").replace("\\.laya\\publish_qqgame.js", "").replace("/.laya/publish_qqgame.js", "") + "/" : "./../";
+} else {
+	ideModuleDir = global.ideModuleDir;
+	workSpaceDir = global.workSpaceDir;
+}
+
+//引用插件模块
+const gulp = require(ideModuleDir + "gulp");
+const fs = require("fs");
+const path = require("path");
+const crypto = require("crypto");
+const childProcess = require("child_process");
+const del = require(ideModuleDir + "del");
+const revCollector = require(ideModuleDir + 'gulp-rev-collector');
+let commandSuffix = ".cmd";
+let prevTasks = ["packfile"];
+if (isPublish2) {
+	prevTasks = "";
+}
+
+let 
+    config,
+	platform,
+    releaseDir;
+let isGlobalCli = true;
+let versionCon; // 版本管理version.json
+// 应该在publish中的,但是为了方便发布2.0及IDE 1.x,放在这里修改
+gulp.task("preCreate_QQ", prevTasks, function() {
+	if (isPublish2) {
+		let pubsetPath = path.join(workSpaceDir, ".laya", "pubset.json");
+		let content = fs.readFileSync(pubsetPath, "utf8");
+		let pubsetJson = JSON.parse(content);
+		platform = "qqgame";
+		releaseDir = path.join(workSpaceDir, "release", platform).replace(/\\/g, "/");
+		config = pubsetJson[2];
+	} else {
+		platform = global.platform;
+		releaseDir = global.releaseDir;
+		config = global.config;
+	}
+	// 如果不是QQ小游戏
+	if (platform !== "qqgame") {
+		return;
+	}
+	if (process.platform === "darwin") {
+		commandSuffix = "";
+	}
+	let copyLibsList = [`${workSpaceDir}/bin/libs/laya.qqmini.js`];
+	var stream = gulp.src(copyLibsList, { base: `${workSpaceDir}/bin` });
+	return stream.pipe(gulp.dest(releaseDir));
+});
+
+gulp.task("copyPlatformFile_QQ", ["preCreate_QQ"], function() {
+	// 如果不是QQ小游戏
+	if (platform !== "qqgame") {
+		return;
+	}
+	let adapterPath = path.join(ideModuleDir, "../", "out", "layarepublic", "LayaAirProjectPack", "lib", "data", "qqfiles");
+	let stream = gulp.src(adapterPath + "/*.*");
+	return stream.pipe(gulp.dest(releaseDir));
+});
+
+gulp.task("version_QQ", ["copyPlatformFile_QQ"], function() {
+	// 如果不是QQ小游戏
+	if (platform !== "qqgame") {
+		return;
+	}
+	if (config.version) {
+		let versionPath = releaseDir + "/version.json";
+		let gameJSPath = releaseDir + "/game.js";
+		let srcList = [versionPath, gameJSPath];
+		return gulp.src(srcList)
+			.pipe(revCollector())
+			.pipe(gulp.dest(releaseDir));
+	}
+});
+
+gulp.task("buildQQProj", ["version_QQ"], function() {
+	console.log("all tasks completed");
+});

+ 732 - 0
RubikCube/.laya/publish_vivogame.js

@@ -0,0 +1,732 @@
+// v1.2.1
+// publish 2.x 也是用这个文件,需要做兼容
+let isPublish2 = process.argv[2].includes("publish_vivogame.js") && process.argv[3].includes("--evn=publish2");
+// 获取Node插件和工作路径
+let ideModuleDir, workSpaceDir;
+if (isPublish2) {
+	//是否使用IDE自带的node环境和插件,设置false后,则使用自己环境(使用命令行方式执行)
+	const useIDENode = process.argv[0].indexOf("LayaAir") > -1 ? true : false;
+	ideModuleDir = useIDENode ? process.argv[1].replace("gulp\\bin\\gulp.js", "").replace("gulp/bin/gulp.js", "") : "";
+	workSpaceDir = useIDENode ? process.argv[2].replace("--gulpfile=", "").replace("\\.laya\\publish_vivogame.js", "").replace("/.laya/publish_vivogame.js", "") + "/" : "./../";
+} else {
+	ideModuleDir = global.ideModuleDir;
+	workSpaceDir = global.workSpaceDir;
+}
+
+//引用插件模块
+const gulp = require(ideModuleDir + "gulp");
+const fs = require("fs");
+const path = require("path");
+const childProcess = require("child_process");
+const del = require(ideModuleDir + "del");
+const iconv =  require(ideModuleDir + "iconv-lite");
+const revCollector = require(ideModuleDir + 'gulp-rev-collector');
+let commandSuffix = ".cmd";
+
+let prevTasks = ["packfile"];
+if (isPublish2) {
+	prevTasks = "";
+}
+
+let 
+    config,
+	platform,
+	releaseDir,
+    tempReleaseDir, // vivo临时拷贝目录
+	projDir, // vivo快游戏工程目录
+	isDealNoCompile = true,
+	physicsLibsPathList = [],
+	isExistEngineFolder = false; // bin目录下是否存在engine文件夹
+let projSrc;
+let versionCon; // 版本管理version.json
+// 创建vivo项目前,拷贝vivo引擎库、修改index.js
+// 应该在publish中的,但是为了方便发布2.0及IDE 1.x,放在这里修改
+gulp.task("preCreate_VIVO", prevTasks, function() {
+	if (isPublish2) {
+		let pubsetPath = path.join(workSpaceDir, ".laya", "pubset.json");
+		let content = fs.readFileSync(pubsetPath, "utf8");
+		let pubsetJson = JSON.parse(content);
+		platform = "vivogame";
+		releaseDir = path.join(workSpaceDir, "release", platform).replace(/\\/g, "/");
+		releaseDir = tempReleaseDir = path.join(releaseDir, "temprelease");
+		config = pubsetJson[6]; // 只用到了 config.vivoInfo|config.vivoSign
+	} else {
+		platform = global.platform;
+		releaseDir = global.releaseDir;
+		tempReleaseDir = global.tempReleaseDir;
+		config = global.config;
+	}
+	// 如果不是vivo快游戏
+	if (platform !== "vivogame") {
+		return;
+	}
+	if (process.platform === "darwin") {
+		commandSuffix = "";
+	}
+	let copyLibsList = [`${workSpaceDir}/bin/libs/laya.vvmini.js`];
+	var stream = gulp.src(copyLibsList, { base: `${workSpaceDir}/bin` });
+	return stream.pipe(gulp.dest(tempReleaseDir));
+});
+
+gulp.task("copyPlatformFile_VIVO", ["preCreate_VIVO"], function() {
+	// 如果不是vivo快游戏
+	if (platform !== "vivogame") {
+		return;
+	}
+	let vivoAdapterPath = path.join(ideModuleDir, "../", "out", "layarepublic", "LayaAirProjectPack", "lib", "data", "vivofiles");
+	let copyLibsList = [`${vivoAdapterPath}/**/*.*`];
+	var stream = gulp.src(copyLibsList);
+	return stream.pipe(gulp.dest(tempReleaseDir));
+});
+
+// 检查是否全局安装了qgame
+gulp.task("createGlobalQGame_VIVO", ["copyPlatformFile_VIVO"], function() {
+	// 如果不是vivo快游戏
+	if (platform !== "vivogame") {
+		return;
+	}
+	releaseDir = path.dirname(releaseDir);
+	projDir = path.join(releaseDir, config.vivoInfo.projName);
+	projSrc = path.join(projDir, "src");
+	// npm view @vivo-minigame/cli version
+	// npm install -g @vivo-minigame/cli
+	let remoteVersion, localVersion;
+	let isGetRemote, isGetLocal;
+	let isUpdateGlobalQGame = true;
+	return new Promise((resolve, reject) => { // 远程版本号
+		childProcess.exec("npm view  @vivo-minigame/cli version", function(error, stdout, stderr) {
+			if (!stdout) { // 获取 @vivo-minigame/cli 远程版本号失败
+				console.log("Failed to get the remote version number");
+				resolve();
+				return;
+			}
+			remoteVersion = stdout;
+			isGetRemote = true;
+			if (isGetRemote && isGetLocal) {
+				isUpdateGlobalQGame = remoteVersion != localVersion;
+				console.log(`remoteVersion: ${remoteVersion}, localVersion: ${localVersion}`);
+				resolve();
+			}
+		});
+		childProcess.exec("mg -v", { cwd: `${projDir}/node_modules` }, function(error, stdout, stderr) {
+			if (!stdout) { // 获取  @vivo-minigame/cli 本地版本号失败
+				console.log("Failed to get the local version number");
+				resolve();
+				return;
+			}
+			localVersion = stdout;
+			isGetLocal = true;
+			if (isGetRemote && isGetLocal) {
+				isUpdateGlobalQGame = remoteVersion != localVersion;
+				console.log(`remoteVersion: ${remoteVersion}, localVersion: ${localVersion}`);
+				resolve();
+			}
+		});
+		setTimeout(() => {
+			if (!isGetLocal || !isGetRemote) {
+				console.log("Failed to get the local or remote version number");
+				resolve();
+				return;
+			}
+		}, 10000);
+	}).then(() => {
+		return new Promise((resolve, reject) => {
+			if (!isUpdateGlobalQGame) {
+				resolve();
+				return;
+			}
+			console.log("全局安装@vivo-minigame/cli");
+			// npm install -g @vivo-minigame/cli
+			let cmd = `npm${commandSuffix}`;
+			let args = ["install", "@vivo-minigame/cli", "-g"];
+			let cp = childProcess.spawn(cmd, args);
+			
+			cp.stdout.on('data', (data) => {
+				console.log(`stdout: ${data}`);
+			});
+	
+			cp.stderr.on('data', (data) => {
+				console.log(`stderr: ${data}`);
+				// reject();
+			});
+	
+			cp.on('close', (code) => {
+				console.log(`2 end) npm install -g @vivo-minigame/cli:${code}`);
+				resolve();
+			});
+		});
+	}).catch((e) => {
+		console.log("catch e", e);
+	});
+});
+
+gulp.task("createProj_VIVO", ["createGlobalQGame_VIVO"], function() {
+	// 如果不是vivo快游戏
+	if (platform !== "vivogame") {
+		return;
+	}
+	// 如果有即存项目,不再新建
+	let isProjExist = fs.existsSync(projDir + "/node_modules") && 
+					  fs.existsSync(projDir + "/sign");
+	if (isProjExist) {
+		// 检测是否需要升级
+		let packageCon = fs.readFileSync(`${projDir}/package.json`, "utf8");
+		let minigamePath = path.join(projDir, "minigame.config.js");
+		if (packageCon.includes("@vivo-minigame/cli-service") && fs.existsSync(minigamePath)) {
+			return;
+		}
+	}
+	// 如果有即存项目,但是是旧的项目,删掉后重新创建
+	return new Promise((resolve, reject) => {
+		if (!fs.existsSync(projDir)) {
+			return resolve();
+		}
+		let delList = [projDir];
+		del(delList, { force: true }).then(paths => {
+			resolve();
+		});
+	}).then(function() {
+		// 在项目中创建vivo项目
+		return new Promise((resolve, reject) => {
+			console.log("(proj)开始创建vivo快游戏项目");
+			// mg init <project-name>
+			let cmd = `mg${commandSuffix}`;
+			let args = ["init", config.vivoInfo.projName];
+			let opts = {
+				cwd: releaseDir,
+				shell: true
+			};
+
+			let cp = childProcess.spawn(cmd, args, opts);
+			
+			cp.stdout.on('data', (data) => {
+				console.log(`stdout: ${data}`);
+			});
+			
+			cp.stderr.on('data', (data) => {
+				console.log(`stderr: ${data}`);
+				// reject();
+			});
+			
+			cp.on('close', (code) => {
+				cp = null;
+				console.log(`子进程退出码:${code}`);
+				resolve();
+			});
+		});
+	});
+});
+
+// 拷贝文件到vivo快游戏
+gulp.task("copyFileToProj_VIVO", ["createProj_VIVO"], function() {
+	// 如果不是vivo快游戏
+	if (platform !== "vivogame") {
+		return;
+	}
+	// 如果有js/main.js,将其删除
+	let vivoMainPath = path.join(projDir, "src", "js", "main.js");
+	if (fs.existsSync(vivoMainPath)) {
+		fs.unlinkSync(vivoMainPath);
+	}
+	// 将临时文件夹中的文件,拷贝到项目中去
+	let originalDir = `${tempReleaseDir}/**/*.*`;
+	let stream = gulp.src(originalDir);
+	return stream.pipe(gulp.dest(path.join(projSrc)));
+});
+
+// 拷贝icon到vivo快游戏
+gulp.task("copyIconToProj_VIVO", ["copyFileToProj_VIVO"], function() {
+	// 如果不是vivo快游戏
+	if (platform !== "vivogame") {
+		return;
+	}
+	let originalDir = config.vivoInfo.icon;
+	let stream = gulp.src(originalDir);
+	return stream.pipe(gulp.dest(projSrc));
+});
+
+// 清除vivo快游戏临时目录
+gulp.task("clearTempDir_VIVO", ["copyIconToProj_VIVO"], function() {
+	// 如果不是vivo快游戏
+	if (platform !== "vivogame") {
+		return;
+	}
+	// 删掉临时目录
+	return del([tempReleaseDir], { force: true });
+});
+
+// 生成release签名(私钥文件 private.pem 和证书文件 certificate.pem )
+gulp.task("generateSign_VIVO", ["clearTempDir_VIVO"], function() {
+	// 如果不是vivo快游戏
+	if (platform !== "vivogame") {
+		return;
+    }
+    if (!config.vivoSign.generateSign) {
+        return;
+    }
+	// https://doc.quickapp.cn/tools/compiling-tools.html
+	return new Promise((resolve, reject) => {
+		let cmd = "openssl";
+		let args = ["req", "-newkey", "rsa:2048", "-nodes", "-keyout", "private.pem", 
+					"-x509", "-days", "3650", "-out", "certificate.pem"];
+		let opts = {
+			cwd: projDir,
+			shell: true
+		};
+		let cp = childProcess.spawn(cmd, args, opts);
+		cp.stdout.on('data', (data) => {
+			console.log(`stdout: ${data}`);
+		});
+
+		cp.stderr.on('data', (data) => {
+			console.log(`stderr: ${data}`);
+			data += "";
+			if (data.includes("Country Name")) {
+				cp.stdin.write(`${config.vivoSign.countryName}\n`);
+				console.log(`Country Name: ${config.vivoSign.countryName}`);
+			} else if (data.includes("Province Name")) {
+				cp.stdin.write(`${config.vivoSign.provinceName}\n`);
+				console.log(`Province Name: ${config.vivoSign.provinceName}`);
+			} else if (data.includes("Locality Name")) {
+				cp.stdin.write(`${config.vivoSign.localityName}\n`);
+				console.log(`Locality Name: ${config.vivoSign.localityName}`);
+			} else if (data.includes("Organization Name")) {
+				cp.stdin.write(`${config.vivoSign.orgName}\n`);
+				console.log(`Organization Name: ${config.vivoSign.orgName}`);
+			} else if (data.includes("Organizational Unit Name")) {
+				cp.stdin.write(`${config.vivoSign.orgUnitName}\n`);
+				console.log(`Organizational Unit Name: ${config.vivoSign.orgUnitName}`);
+			} else if (data.includes("Common Name")) {
+				cp.stdin.write(`${config.vivoSign.commonName}\n`);
+				console.log(`Common Name: ${config.vivoSign.commonName}`);
+			} else if (data.includes("Email Address")) {
+				cp.stdin.write(`${config.vivoSign.emailAddr}\n`);
+				console.log(`Email Address: ${config.vivoSign.emailAddr}`);
+				// cp.stdin.end();
+			}
+			// reject();
+		});
+
+		cp.on('close', (code) => {
+			console.log(`子进程退出码:${code}`);
+			resolve();
+		});
+	});
+});
+
+// 拷贝sign文件到指定位置
+gulp.task("copySignFile_VIVO", ["generateSign_VIVO"], function() {
+	// 如果不是vivo快游戏
+	if (platform !== "vivogame") {
+		return;
+    }
+    if (config.vivoSign.generateSign) { // 新生成的签名
+        // 移动签名文件到项目中(Laya & vivo快游戏项目中)
+        let 
+            privatePem = path.join(projDir, "private.pem"),
+            certificatePem = path.join(projDir, "certificate.pem");
+        let isSignExits = fs.existsSync(privatePem) && fs.existsSync(certificatePem);
+        if (!isSignExits) {
+            return;
+        }
+        let 
+            xiaomiDest = `${projDir}/sign/release`,
+            layaDest = `${workSpaceDir}/sign/release`;
+        let stream = gulp.src([privatePem, certificatePem]);
+        return stream.pipe(gulp.dest(xiaomiDest))
+                    .pipe(gulp.dest(layaDest));
+    } else if (config.vivoInfo.useReleaseSign && !config.vivoSign.generateSign) { // 使用release签名,并且没有重新生成
+        // 从项目中将签名拷贝到vivo快游戏项目中
+        let 
+            privatePem = path.join(workSpaceDir, "sign", "release", "private.pem"),
+            certificatePem = path.join(workSpaceDir, "sign", "release", "certificate.pem");
+        let isSignExits = fs.existsSync(privatePem) && fs.existsSync(certificatePem);
+        if (!isSignExits) {
+            return;
+        }
+        let 
+            xiaomiDest = `${projDir}/sign/release`;
+        let stream = gulp.src([privatePem, certificatePem]);
+        return stream.pipe(gulp.dest(xiaomiDest));
+    }
+});
+
+gulp.task("deleteSignFile_VIVO", ["copySignFile_VIVO"], function() {
+	// 如果不是vivo快游戏
+	if (platform !== "vivogame") {
+		return;
+	}
+	if (config.vivoSign.generateSign) { // 新生成的签名
+		let 
+            privatePem = path.join(projDir, "private.pem"),
+            certificatePem = path.join(projDir, "certificate.pem");
+		return del([privatePem, certificatePem], { force: true });
+	}
+});
+
+gulp.task("modifyFile_VIVO", ["deleteSignFile_VIVO"], function() {
+	// 如果不是vivo快游戏
+	if (platform !== "vivogame") {
+		return;
+	}
+	// 修改manifest.json文件
+	let manifestPath = path.join(projSrc, "manifest.json");
+	if (!fs.existsSync(manifestPath)) {
+		return;
+	}
+	let manifestContent = fs.readFileSync(manifestPath, "utf8");
+	let manifestJson = JSON.parse(manifestContent);
+	manifestJson.package = config.vivoInfo.package;
+	manifestJson.name = config.vivoInfo.name;
+	manifestJson.orientation = config.vivoInfo.orientation;
+	manifestJson.config.logLevel = config.vivoInfo.logLevel || "off";
+	manifestJson.deviceOrientation = config.vivoInfo.orientation;
+	manifestJson.versionName = config.vivoInfo.versionName;
+	manifestJson.versionCode = config.vivoInfo.versionCode;
+	manifestJson.minPlatformVersion = config.vivoInfo.minPlatformVersion;
+	manifestJson.icon = `/${path.basename(config.vivoInfo.icon)}`;
+	if (config.vivoInfo.subpack) { // 分包
+		manifestJson.subpackages = config.vivoSubpack;
+	} else {
+		delete manifestJson.subpackages;
+	}
+	// 增加thirdEngine字段
+	let EngineVersion = getEngineVersion();
+	if (EngineVersion) {
+		manifestJson.thirdEngine = {
+			"laya": EngineVersion
+		};
+	}
+	fs.writeFileSync(manifestPath, JSON.stringify(manifestJson, null, 4), "utf8");
+	
+	if (config.version) {
+		let versionPath = projSrc + "/version.json";
+		versionCon = fs.readFileSync(versionPath, "utf8");
+		versionCon = JSON.parse(versionCon);
+	}
+	let indexJsStr = (versionCon && versionCon["index.js"]) ? versionCon["index.js"] :  "index.js";
+	// 修改game.js文件
+	let content = `require("./qgame-adapter.js");\nif(!window.navigator)\n\twindow.navigator = {};\nwindow.navigator.userAgent = 'Mozilla/5.0 (Linux; Android 5.1.1; Nexus 6 Build/LYZ28E) AppleWebKit/603.1.30 (KHTML, like Gecko) Mobile/14E8301 VVGame NetType/WIFI Language/zh_CN';
+require("./libs/laya.vvmini.js");\nrequire("./index.js");`;
+	let gameJsPath = path.join(projSrc, "game.js");
+	fs.writeFileSync(gameJsPath, content, "utf8");
+
+	// vivo项目,修改index.js
+	let filePath = path.join(projSrc, indexJsStr);
+	if (!fs.existsSync(filePath)) {
+		return;
+	}
+	let fileContent = fs.readFileSync(filePath, "utf8");
+	fileContent = fileContent.replace(/loadLib(\(['"])/gm, "require$1./");
+	fs.writeFileSync(filePath, fileContent, "utf8");
+})
+
+function getEngineVersion() {
+	let coreLibPath = path.join(workSpaceDir, "bin", "libs", "laya.core.js");
+	let isHasCoreLib = fs.existsSync(coreLibPath);
+	let isOldAsProj = fs.existsSync(`${workSpaceDir}/asconfig.json`) && !isHasCoreLib;
+	let isNewTsProj = fs.existsSync(`${workSpaceDir}/src/tsconfig.json`) && !isHasCoreLib;
+	let EngineVersion;
+	if (isHasCoreLib) {
+		let con = fs.readFileSync(coreLibPath, "utf8");
+		let matchList = con.match(/Laya\.version\s*=\s*['"]([0-9\.]+(beta)?.*)['"]/);
+		if (!Array.isArray(matchList)) {
+			return null;
+		}
+		EngineVersion = matchList[1];
+	} else { // newts项目和旧版本as项目
+		if (isOldAsProj) {
+			let coreLibFilePath = path.join(workSpaceDir, "libs", "laya", "src", "Laya.as");
+			if (!fs.existsSync(coreLibFilePath)) {
+				return null;
+			}
+			let con = fs.readFileSync(coreLibFilePath, "utf8");
+			let matchList = con.match(/version:String\s*=\s*['"]([0-9\.]+(beta)?.*)['"]/);
+			if (!Array.isArray(matchList)) {
+				return null;
+			}
+			EngineVersion = matchList[1];
+		} else if (isNewTsProj) {
+			let coreLibFilePath = path.join(workSpaceDir, "libs", "Laya.ts");
+			if (!fs.existsSync(coreLibFilePath)) {
+				return null;
+			}
+			let con = fs.readFileSync(coreLibFilePath, "utf8");
+			let matchList = con.match(/static\s*version:\s*string\s*=\s*['"]([0-9\.]+(beta)?.*)['"]/);
+			if (!Array.isArray(matchList)) {
+				return null;
+			}
+			EngineVersion = matchList[1];
+		}
+	}
+	return EngineVersion;
+}
+
+gulp.task("version_VIVO", ["modifyFile_VIVO"], function () {
+	// 如果不是vivo快游戏
+	if (platform !== "vivogame") {
+		return;
+	}
+	if (config.version) {
+		let versionPath = projSrc + "/version.json";
+		let mainJSPath = projSrc + "/game.js";
+		let srcList = [versionPath, mainJSPath];
+		return gulp.src(srcList)
+			.pipe(revCollector())
+			.pipe(gulp.dest(projSrc));
+	}
+});
+
+// 处理engine文件夹
+gulp.task("dealEngineFolder1_VIVO", ["version_VIVO"], function() {
+	// 如果项目中有engine文件夹,我们默认该开发者是熟悉VIVO发布流程的,已经处理好所有的逻辑
+	// 值得注意的:
+	// 1) 如果有engine文件夹而未处理2D物理库(box2d.js/physics.js),项目将无法运行
+	// 2) 如果未处理3D物理库(physics3D.js),打包时间将会很长
+
+	// 如果不是vivo快游戏
+	if (platform !== "vivogame") {
+		return;
+	}
+	let engineFolder = path.join(projDir, "src", "engine");
+	isExistEngineFolder = fs.existsSync(engineFolder);
+	if (!isExistEngineFolder) {
+		return;
+	}
+
+	let adapterOriginalPath = path.join(projDir, "src", "qgame-adapter.js");
+
+	// 不想写一堆task任务,500ms默认拷贝完成吧
+	// 未来有了更好的解决方案再修改
+	return new Promise(function(resolve, reject) {
+		// 将engine文件夹拷贝到projRoot下
+		setTimeout(resolve, 500);
+		var stream = gulp.src([`${engineFolder}/**/*.*`], {base: `${projDir}/src`});
+		return stream.pipe(gulp.dest(projDir));
+	}).then(function() {
+		return new Promise(function(resolve, reject) {
+			// 将adapter.js拷贝到engine文件夹中
+			setTimeout(resolve, 500);
+			var stream = gulp.src([adapterOriginalPath]);
+			return stream.pipe(gulp.dest(`${projDir}/engine`));
+		});
+	}).then(function() {
+		return new Promise(function(resolve, reject) {
+			// 删掉src下的engine和adapter
+			setTimeout(resolve, 500);
+			return del([engineFolder, adapterOriginalPath], { force: true });
+		});
+	}).catch(function(err) {
+		console.log(err);
+	});
+});
+
+gulp.task("dealEngineFolder2_VIVO", ["dealEngineFolder1_VIVO"], function() {
+	// 如果不是vivo快游戏
+	if (platform !== "vivogame") {
+		return;
+	}
+	if (!isExistEngineFolder) {
+		return;
+	}
+	
+	let engineFolder = path.join(projDir, "engine");
+	let engineFileList = fs.readdirSync(engineFolder);
+	// 修改配置文件
+	configVivoConfigFile(engineFileList);
+});
+
+// 如果项目中用到了 box2d.js|laya.physics.js/laya.physics3D.js ,需要特殊处理
+// 之前处理的是有项目中已经存在engine文件夹的情况,现在开始处理没有文件夹的情况
+gulp.task("dealNoCompile1_VIVO", ["dealEngineFolder2_VIVO"], function() {
+	// 如果不是vivo快游戏
+	if (platform !== "vivogame") {
+		return;
+	}
+	if (!isDealNoCompile) {
+		return;
+	}
+
+	// let indexJsStr = (versionCon && versionCon["index.js"]) ? versionCon["index.js"] :  "index.js";
+	// let bundleJsStr = (versionCon && versionCon["js/bundle.js"]) ? versionCon["js/bundle.js"] :  "js/bundle.js";
+	// let box2dJsStr = (versionCon && versionCon["libs/box2d.js"]) ? versionCon["libs/box2d.js"] :  "libs/box2d.js";
+	// let physicsJsStr = (versionCon && versionCon["libs/laya.physics.js"]) ? versionCon["libs/laya.physics.js"] :  "libs/laya.physics.js";
+	// let physics3DJsStr = (versionCon && versionCon["libs/laya.physics3D.js"]) ? versionCon["libs/laya.physics3D.js"] :  "libs/laya.physics3D.js";
+
+	// // 修改index.js,去掉物理库前面的libs
+	// let filePath = path.join(projSrc, indexJsStr);
+	// let fileContent = fs.readFileSync(filePath, "utf8");
+	// let physicsNameList = [];
+
+	// if (fileContent.includes(bundleJsStr)) {
+	// 	let adapterJsPath = path.join(projSrc, bundleJsStr);
+	// 	physicsNameList.push(bundleJsStr);
+	// 	physicsLibsPathList.push(adapterJsPath);
+	// }
+	// if (fileContent.includes(box2dJsStr)) {
+	// 	let libPath = path.join(projSrc, box2dJsStr);
+	// 	physicsNameList.push(box2dJsStr);
+	// 	physicsLibsPathList.push(libPath);
+	// }
+	// if (fileContent.includes(physicsJsStr)) {
+	// 	let libPath = path.join(projSrc, physicsJsStr);
+	// 	physicsNameList.push(physicsJsStr);
+	// 	physicsLibsPathList.push(libPath);
+	// }
+	// if (fileContent.includes(physics3DJsStr)) {
+	// 	let libPath = path.join(projSrc, physics3DJsStr);
+	// 	physicsNameList.push(physics3DJsStr);
+	// 	physicsLibsPathList.push(libPath);
+	// }
+	// if (physicsLibsPathList.length > 0) {
+	// 	let adapterJsPath = path.join(projSrc, "qgame-adapter.js");
+	// 	physicsNameList.push("qgame-adapter.js");
+	// 	physicsLibsPathList.push(adapterJsPath);
+	// }
+
+
+	// 将js/bundle.js | libs/*.* qgame-adapter.js 全放到engine文件夹中
+	let indexJsStr = (versionCon && versionCon["index.js"]) ? versionCon["index.js"] :  "index.js";
+	let bundleJsStr = (versionCon && versionCon["js/bundle.js"]) ? versionCon["js/bundle.js"] :  "js/bundle.js";
+
+	// 修改index.js,去掉物理库前面的libs
+	let filePath = path.join(projSrc, indexJsStr);
+	let fileContent = fs.readFileSync(filePath, "utf8");
+	let physicsNameList = [];
+
+	if (fileContent.includes(bundleJsStr)) {
+		let adapterJsPath = path.join(projSrc, bundleJsStr);
+		physicsNameList.push(bundleJsStr);
+		physicsLibsPathList.push(adapterJsPath);
+	}
+	let libsList = fs.readdirSync(path.join(projSrc, "libs"));
+	let libsFileName, libsFilePath;
+	for (let i = 0, len = libsList.length; i < len; i++) {
+		libsFileName = libsList[i];
+		libsFilePath = path.join(projSrc, "libs", libsFileName);
+		physicsNameList.push(`libs/${libsFileName}`);
+		physicsLibsPathList.push(libsFilePath);
+	}
+	if (physicsLibsPathList.length > 0) {
+		let adapterJsPath = path.join(projSrc, "qgame-adapter.js");
+		physicsNameList.push("qgame-adapter.js");
+		physicsLibsPathList.push(adapterJsPath);
+	}
+
+	// 修改配置文件
+	configVivoConfigFile(physicsNameList);
+
+	// 将物理库、qgame-adapter.js拷贝到engine中
+	var stream = gulp.src(physicsLibsPathList, {base: projSrc});
+	return stream.pipe(gulp.dest(path.join(projDir, "engine")));
+});
+
+function configVivoConfigFile(engineFileList) {
+	let vvConfigPath = path.join(projDir, "minigame.config.js");
+	let content = fs.readFileSync(vvConfigPath, "utf8");
+	let externalsStr = 'const externals = [\n';
+	let libName;
+	for (let i = 0, len = engineFileList.length; i < len; i++) {
+		libName = engineFileList[i];
+		if (i !== 0) {
+			externalsStr += ',\n';
+		}
+		// 不要改这里的缩进,否则最终的结果不好看
+		externalsStr += `{
+		module_name:'./${libName}',
+		module_path:'./${libName}',
+		module_from:'engine/${libName}'
+	}`;
+	}
+	externalsStr += '\t]';
+	content = content.replace(/const externals = \[([^*].|\n|\r)*\]/gm, externalsStr);
+	fs.writeFileSync(vvConfigPath, content, "utf8");
+}
+
+gulp.task("dealNoCompile2_VIVO", ["dealNoCompile1_VIVO"], function() {
+	// 如果不是vivo快游戏
+	if (platform !== "vivogame") {
+		return;
+	}
+	if (!isDealNoCompile || physicsLibsPathList.length === 0) {
+		return;
+	}
+	return del(physicsLibsPathList, { force: true });
+});
+
+// 打包rpk
+gulp.task("buildRPK_VIVO", ["dealNoCompile2_VIVO"], function() {
+	// 如果不是vivo快游戏
+	if (platform !== "vivogame") {
+		return;
+	}
+	// 在vivo轻游戏项目目录中执行:
+    // npm run build || npm run release
+    let cmdStr = "build";
+    if (config.vivoInfo.useReleaseSign) {
+        cmdStr = "release";
+    }
+	return new Promise((resolve, reject) => {
+		let cmd = `npm${commandSuffix}`;
+		let args = ["run", cmdStr];
+		let opts = {
+			cwd: projDir
+		};
+		let cp = childProcess.spawn(cmd, args, opts);
+		// let cp = childProcess.spawn(`npx${commandSuffix}`, ['-v']);
+		cp.stdout.on('data', (data) => {
+			console.log(`stdout: ${data}`);
+		});
+
+		cp.stderr.on('data', (data) => {
+			console.log(`stderr: ${data}`);
+			console.log(`stderr(iconv): ${iconv.decode(data, 'gbk')}`);
+			
+			// reject();
+		});
+
+		cp.on('close', (code) => {
+			console.log(`子进程退出码:${code}`);
+			resolve();
+		});
+	});
+});
+
+gulp.task("showQRCode_VIVO", ["buildRPK_VIVO"], function() {
+	// 如果不是vivo快游戏
+	if (platform !== "vivogame") {
+		return;
+	}
+	// 在vivo轻游戏项目目录中执行:
+	// npm run server
+	return new Promise((resolve, reject) => {
+		let cmd = `npm${commandSuffix}`;
+		let args = ["run", "server"];
+		let opts = {
+			cwd: projDir
+		};
+		let cp = childProcess.spawn(cmd, args, opts);
+		// let cp = childProcess.spawn(`npx${commandSuffix}`, ['-v']);
+		cp.stdout.on('data', (data) => {
+			console.log(`${data}`);
+			// 输出pid,macos要用: macos无法kill进程树,也无法执行命令获取3000端口pid(没有查询权限),导致无法kill这个进程
+			console.log('vv_qrcode_pid:' + cp.pid);
+		});
+
+		cp.stderr.on('data', (data) => {
+			console.log(`stderr: ${data}`);
+			console.log(`stderr(iconv): ${iconv.decode(data, 'gbk')}`);
+			// reject();
+		});
+
+		cp.on('close', (code) => {
+			console.log(`子进程退出码:${code}`);
+			resolve();
+		});
+	});
+});
+
+
+gulp.task("buildVivoProj", ["showQRCode_VIVO"], function() {
+	console.log("all tasks completed");
+});

+ 418 - 0
RubikCube/.laya/publish_wxgame.js

@@ -0,0 +1,418 @@
+// v1.2.0
+// publish 2.x 也是用这个文件,需要做兼容
+let isPublish2 = process.argv[2].includes("publish_wxgame.js") && process.argv[3].includes("--evn=publish2");
+// 获取Node插件和工作路径
+let ideModuleDir, workSpaceDir;
+if (isPublish2) {
+	//是否使用IDE自带的node环境和插件,设置false后,则使用自己环境(使用命令行方式执行)
+	const useIDENode = process.argv[0].indexOf("LayaAir") > -1 ? true : false;
+	ideModuleDir = useIDENode ? process.argv[1].replace("gulp\\bin\\gulp.js", "").replace("gulp/bin/gulp.js", "") : "";
+	workSpaceDir = useIDENode ? process.argv[2].replace("--gulpfile=", "").replace("\\.laya\\publish_wxgame.js", "").replace("/.laya/publish_wxgame.js", "") + "/" : "./../";
+} else {
+	ideModuleDir = global.ideModuleDir;
+	workSpaceDir = global.workSpaceDir;
+}
+
+//引用插件模块
+const gulp = require(ideModuleDir + "gulp");
+const fs = require("fs");
+const path = require("path");
+const crypto = require("crypto");
+const childProcess = require("child_process");
+const del = require(ideModuleDir + "del");
+const revCollector = require(ideModuleDir + 'gulp-rev-collector');
+let commandSuffix = ".cmd";
+const provider = "wxe24357b5ce551510";
+const fullRemoteEngineList = ["laya.core.js", "laya.webgl.js", "laya.filter.js", "laya.ani.js", "laya.d3.js", "laya.html.js", "laya.particle.js", "laya.ui.js", "bytebuffer.js"];
+
+let prevTasks = ["packfile"];
+if (isPublish2) {
+	prevTasks = "";
+}
+
+let 
+    config,
+	platform,
+    releaseDir;
+let isGlobalCli = true;
+let isOpendataProj;
+let versionCon; // 版本管理version.json
+// 应该在publish中的,但是为了方便发布2.0及IDE 1.x,放在这里修改
+gulp.task("preCreate_WX", prevTasks, function() {
+	if (isPublish2) {
+		let pubsetPath = path.join(workSpaceDir, ".laya", "pubset.json");
+		let content = fs.readFileSync(pubsetPath, "utf8");
+		let pubsetJson = JSON.parse(content);
+		platform = "wxgame";
+		releaseDir = path.join(workSpaceDir, "release", platform).replace(/\\/g, "/");
+		config = pubsetJson[1];
+	} else {
+		platform = global.platform;
+		releaseDir = global.releaseDir;
+		config = global.config;
+	}
+	// 如果不是微信小游戏
+	if (platform !== "wxgame") {
+		return;
+	}
+	if (process.platform === "darwin") {
+		commandSuffix = "";
+	}
+	// 是否是开放域项目
+	let projInfoPath = path.join(workSpaceDir, path.basename(workSpaceDir) + ".laya");
+	let isExist = fs.existsSync(projInfoPath);
+	if (isExist) {
+		try {
+			let projInfo = fs.readFileSync(projInfoPath, "utf8");
+			projInfo = projInfo && JSON.parse(projInfo);
+			isOpendataProj = projInfo.layaProType === 12;
+		} catch (e) {}
+	}
+	if (isOpendataProj) {
+		return;
+	}
+	let copyLibsList = [`${workSpaceDir}/bin/libs/laya.wxmini.js`];
+	var stream = gulp.src(copyLibsList, { base: `${workSpaceDir}/bin` });
+	return stream.pipe(gulp.dest(releaseDir));
+});
+
+gulp.task("copyPlatformFile_WX", ["preCreate_WX"], function() {
+	// 如果不是微信小游戏
+	if (platform !== "wxgame") {
+		return;
+	}
+	let adapterPath = path.join(ideModuleDir, "../", "out", "layarepublic", "LayaAirProjectPack", "lib", "data", "wxfiles");
+	// 开放域项目
+	if (isOpendataProj) {
+		let platformDir = path.join(adapterPath, "weapp-adapter.js");
+		let stream = gulp.src(platformDir);
+		return stream.pipe(gulp.dest(releaseDir));
+	}
+	// 如果新建项目时已经点击了"微信/百度小游戏bin目录快速调试",不再拷贝
+	let isHadWXFiles =
+		fs.existsSync(path.join(workSpaceDir, "bin", "game.js")) &&
+		fs.existsSync(path.join(workSpaceDir, "bin", "game.json")) &&
+		fs.existsSync(path.join(workSpaceDir, "bin", "project.config.json")) &&
+		fs.existsSync(path.join(workSpaceDir, "bin", "weapp-adapter.js"));
+	if (isHadWXFiles) {
+		return;
+	}
+	let copyLibsList = [`${adapterPath}/*.*`];
+	var stream = gulp.src(copyLibsList);
+	return stream.pipe(gulp.dest(releaseDir));
+});
+
+// 开放域的情况下,合并game.js和index.js,并删除game.js
+gulp.task("openData_WX", ["copyPlatformFile_WX"], function (cb) {
+	// 如果不是微信小游戏
+	if (platform !== "wxgame") {
+		return cb();
+	}
+	if (config.openDataZone) {
+		let versionCon;
+		if (config.version) {
+			let versionPath = releaseDir + "/version.json";
+			versionCon = fs.readFileSync(versionPath, "utf8");
+			versionCon = JSON.parse(versionCon);
+		}
+		let indexJsStr = (versionCon && versionCon["index.js"]) ? versionCon["index.js"] :  "index.js";
+		let indexPath = path.join(releaseDir, indexJsStr);
+		let indexjs = readFile(indexPath);
+		let gamejs = readFile(releaseDir + "/game.js");
+		if (gamejs && indexjs) {
+			gamejs = gamejs.replace(`require("index.js")`, indexjs);
+			fs.writeFileSync(indexPath, gamejs, 'utf-8');
+		}
+		if (isOpendataProj) {
+			// 开放域项目,将game.js删掉,发布最小包
+			del(`${releaseDir}/game.js`, { force: true }).then(paths => {
+				cb();
+			});
+		} else {
+			cb();
+		}
+	} else {
+		cb();
+	}
+});
+
+function readFile(path) {
+	if (fs.existsSync(path)) {
+		return fs.readFileSync(path, "utf-8");
+	}
+	return null;
+}
+
+gulp.task("version_WX", ["openData_WX"], function() {
+	// 如果不是微信小游戏
+	if (platform !== "wxgame") {
+		return;
+	}
+	if (config.version) {
+		let versionPath = releaseDir + "/version.json";
+		let gameJSPath = releaseDir + "/game.js";
+		let srcList = [versionPath, gameJSPath];
+		return gulp.src(srcList)
+			.pipe(revCollector())
+			.pipe(gulp.dest(releaseDir));
+	}
+});
+
+gulp.task("optimizeOpen_WX", ["version_WX"], function(cb) {
+	// 如果不是微信小游戏
+	if (platform !== "wxgame") {
+		return cb();
+	}
+	let wxOptimize = config.wxOptimize;
+	if (!wxOptimize || !wxOptimize.useOptimizeOpen) { // 没有使用微信引擎插件,还是像以前一样发布
+		return cb();
+	}
+	// 首屏加载优化(秒开),修改game.json
+	let filePath = path.join(releaseDir, "game.json");
+	if (!fs.existsSync(filePath)) {
+		return cb();
+	}
+	let fileContent = fs.readFileSync(filePath, "utf8");
+	let fileConObj = JSON.parse(fileContent);
+	if (wxOptimize.preloadRes) {
+		fileConObj.preloadResources = wxOptimize.preloadResList;
+	} else {
+		delete fileConObj.preloadResources;
+	}
+	if (wxOptimize.preloadSubpack) {
+		fileConObj.preloadSubpackages = wxOptimize.preloadSubpackList;
+	} else {
+		delete fileConObj.preloadSubpackages;
+	}
+	fs.writeFileSync(filePath, JSON.stringify(fileConObj, null, 4), "utf8");
+	return cb();
+});
+
+gulp.task("pluginEngin_WX", ["optimizeOpen_WX"], function(cb) {
+	// 如果不是微信小游戏
+	if (platform !== "wxgame") {
+		return cb();
+	}
+	if (!config.uesEnginePlugin) { // 没有使用微信引擎插件,还是像以前一样发布
+		return cb();
+	}
+	if (config.version) {
+		let versionPath = releaseDir + "/version.json";
+		versionCon = fs.readFileSync(versionPath, "utf8");
+		versionCon = JSON.parse(versionCon);
+	}
+	let indexJsStr = (versionCon && versionCon["index.js"]) ? versionCon["index.js"] :  "index.js";
+	
+	// 获取version等信息
+	let coreLibPath = path.join(workSpaceDir, "bin", "libs", "laya.core.js");
+	let isHasCoreLib = fs.existsSync(coreLibPath);
+	let isOldAsProj = fs.existsSync(`${workSpaceDir}/asconfig.json`) && !isHasCoreLib;
+	let EngineVersion = getEngineVersion();
+	if (!EngineVersion) {
+		throw new Error(`读取引擎版本号失败,请于服务提供商联系!`);
+	}
+	if (!EngineVersion || EngineVersion.includes("beta") || !canUsePluginEngine(EngineVersion)) {
+		throw new Error(`该版本引擎无法使用引擎插件功能(engineVersion: ${EngineVersion})`);
+	}
+	console.log(`通过版本号检查:  ${EngineVersion}`);
+	// 使用引擎插件
+	let localUseEngineList = [];
+	let copyEnginePathList;
+	new Promise(function(resolve, reject) {
+		console.log(`修改game.js和game.json`);
+		// 1) 修改game.js和game.json
+		// 修改game.js
+		let gameJsPath = path.join(releaseDir, "game.js");
+		let gameJscontent = `require("weapp-adapter.js");\nrequire("./libs/laya.wxmini.js");\nrequirePlugin('layaPlugin');\nwindow.loadLib = require;\nrequire("./${indexJsStr}");`;
+		fs.writeFileSync(gameJsPath, gameJscontent, "utf8");
+		// 修改game.json,使其支持引擎插件
+		let gameJsonPath = path.join(releaseDir, "game.json");
+		let gameJsonContent = fs.readFileSync(gameJsonPath, "utf8");
+		let conJson = JSON.parse(gameJsonContent);
+		conJson.plugins = {
+			"layaPlugin": {
+				"version": EngineVersion,
+				"provider": provider,
+				"path": "laya-libs"
+			}
+		}
+		gameJsonContent = JSON.stringify(conJson, null, 4);
+		fs.writeFileSync(gameJsonPath, gameJsonContent, "utf8");
+		resolve();
+	}).then(function() {
+		return new Promise(function(resolve, reject) {
+			console.log(`确定用到的插件引擎`);
+			// 2) 确定用到了那些插件引擎,并将插件引擎从index.js的引用中去掉
+			let indexJsPath = path.join(releaseDir, indexJsStr);
+			let indexJsCon = fs.readFileSync(indexJsPath, "utf8");
+			let item, fullRequireItem;
+			for (let i = 0, len = fullRemoteEngineList.length; i < len; i++) {
+				item = fullRemoteEngineList[i];
+				fullRequireItem = `loadLib("libs/${item}")`;
+				if (indexJsCon.includes(fullRequireItem)) {
+					localUseEngineList.push(item);
+					indexJsCon = indexJsCon.replace(fullRequireItem, "");
+				}
+			}
+			if (isOldAsProj) { // 如果as语言,开发者将laya.js也写入index.js中了,将其删掉
+				fullRequireItem = `loadLib("laya.js")`;
+				if (indexJsCon.includes(fullRequireItem)) {
+					indexJsCon = indexJsCon.replace(fullRequireItem, "");
+				}
+			}
+			fs.writeFileSync(indexJsPath, indexJsCon, "utf8");
+			// ts/js再次修改game.js,仅引用使用到的类库
+			// as因为本地只有laya.js,无法仅引用使用到的类库
+			if (!isOldAsProj) {
+				let pluginCon = "";
+				localUseEngineList.forEach(function(item) {
+					pluginCon += `requirePlugin("layaPlugin/${item}");\n`;
+				});
+				let gameJsPath = path.join(releaseDir, "game.js");
+				let gameJsCon = fs.readFileSync(gameJsPath, "utf8");
+				gameJsCon = gameJsCon.replace(`requirePlugin('layaPlugin');`, pluginCon);
+				fs.writeFileSync(gameJsPath, gameJsCon, "utf8");
+			}
+			resolve();
+		});
+	}).then(function() {
+		return new Promise(function(resolve, reject) {
+			console.log(`将本地的引擎插件移动到laya-libs中`);
+			// 3) 将本地的引擎插件移动到laya-libs中
+			copyEnginePathList = [`${releaseDir}/libs/{${localUseEngineList.join(",")}}`];
+			if (isOldAsProj) { // 单独拷贝laya.js
+				copyEnginePathList = [`${releaseDir}/laya.js`];
+			}
+			gulp.src(copyEnginePathList).pipe(gulp.dest(`${releaseDir}/laya-libs`));
+			setTimeout(resolve, 500);
+		});
+	}).then(function() {
+		return new Promise(function(resolve, reject) {
+			console.log(`将libs中的本地引擎插件删掉`);
+			// 4) 将libs中的本地引擎插件删掉
+			del(copyEnginePathList, { force: true }).then(resolve);
+		});
+	}).then(function() {
+		return new Promise(async function(resolve, reject) {
+			console.log(`完善引擎插件目录`);
+			// 5) 引擎插件目录laya-libs中还需要新建几个文件,使该目录能够使用
+			if (isOldAsProj) { // 单独拷贝laya.js
+				localUseEngineList.push("laya.js");
+			}
+			let 
+				layalibsPath = path.join(releaseDir, "laya-libs"),
+				engineIndex = path.join(layalibsPath, "index.js"),
+				engineplugin = path.join(layalibsPath, "plugin.json"),
+				enginesignature = path.join(layalibsPath, "signature.json");
+			// index.js
+			if (!fs.existsSync(layalibsPath)) {
+				throw new Error("引擎插件目录创建失败,请与服务提供商联系!");
+			}
+			let indexCon = "";
+			localUseEngineList.forEach(function(item) {
+				indexCon += `require("./${item}");\n`;
+			});
+			fs.writeFileSync(engineIndex, indexCon, "utf8");
+			// plugin.json
+			let pluginCon = {"main": "index.js"};
+			fs.writeFileSync(engineplugin, JSON.stringify(pluginCon, null, 4), "utf8");
+			// signature.json
+			let signatureCon = {
+				"provider": provider,
+				"signature": []
+			};
+			localUseEngineList.unshift("index.js");
+			let fileName, md5Str;
+			for (let i = 0, len = localUseEngineList.length; i < len; i++) {
+				fileName = localUseEngineList[i];
+				let md5Str = await getFileMd5(path.join(releaseDir, "laya-libs", fileName));
+				signatureCon.signature.push({
+					"path": fileName,
+					"md5": md5Str
+				});
+			}
+			fs.writeFileSync(enginesignature, JSON.stringify(signatureCon, null, 4), "utf8");
+			resolve();
+		});
+	})
+	.then(function() {
+		cb();
+	}).catch(function(e) {
+		throw e;
+	})
+});
+
+function getEngineVersion() {
+	let coreLibPath = path.join(workSpaceDir, "bin", "libs", "laya.core.js");
+	let isHasCoreLib = fs.existsSync(coreLibPath);
+	let isOldAsProj = fs.existsSync(`${workSpaceDir}/asconfig.json`) && !isHasCoreLib;
+	let isNewTsProj = fs.existsSync(`${workSpaceDir}/src/tsconfig.json`) && !isHasCoreLib;
+	let EngineVersion;
+	if (isHasCoreLib) {
+		let con = fs.readFileSync(coreLibPath, "utf8");
+		let matchList = con.match(/Laya\.version\s*=\s*['"]([0-9\.]+(beta)?.*)['"]/);
+		if (!Array.isArray(matchList)) {
+			return null;
+		}
+		EngineVersion = matchList[1];
+	} else { // newts项目和旧版本as项目
+		if (isOldAsProj) {
+			let coreLibFilePath = path.join(workSpaceDir, "libs", "laya", "src", "Laya.as");
+			if (!fs.existsSync(coreLibFilePath)) {
+				return null;
+			}
+			let con = fs.readFileSync(coreLibFilePath, "utf8");
+			let matchList = con.match(/version:String\s*=\s*['"]([0-9\.]+(beta)?.*)['"]/);
+			if (!Array.isArray(matchList)) {
+				return null;
+			}
+			EngineVersion = matchList[1];
+		} else if (isNewTsProj) {
+			let coreLibFilePath = path.join(workSpaceDir, "libs", "Laya.ts");
+			if (!fs.existsSync(coreLibFilePath)) {
+				return null;
+			}
+			let con = fs.readFileSync(coreLibFilePath, "utf8");
+			let matchList = con.match(/static\s*version:\s*string\s*=\s*['"]([0-9\.]+(beta)?.*)['"]/);
+			if (!Array.isArray(matchList)) {
+				return null;
+			}
+			EngineVersion = matchList[1];
+		}
+	}
+	return EngineVersion;
+}
+
+function getFileMd5(filePath) {
+	return new Promise(function(resolve, reject) {
+		let md5 = crypto.createHash('md5');
+		let stream = fs.createReadStream(filePath);
+		stream.on("data", function(data) {
+			md5.update(data);
+		});
+		stream.on("end", function() {
+			let md5Str = md5.digest('hex');
+			return resolve(md5Str);
+		});
+	});
+}
+
+function canUsePluginEngine(version) {
+	const minVersionNum = "2.0.2";
+	let compileMacthList = minVersionNum.match(/^(\d+)\.(\d+)\.(\d+)/);
+	let matchList = version.match(/^(\d+)\.(\d+)\.(\d+)/);
+    if (matchList[1] > compileMacthList[1]) {
+        return true;
+	}
+    if (matchList[1] === compileMacthList[1] && matchList[2] > compileMacthList[2]) {
+        return true;
+    }
+    if (matchList[1] === compileMacthList[1] && matchList[2] === compileMacthList[2] && matchList[3] >= compileMacthList[3]) {
+        return true;
+    }
+    return false;
+}
+
+gulp.task("buildWXProj", ["pluginEngin_WX"], function() {
+	console.log("all tasks completed");
+});

+ 519 - 0
RubikCube/.laya/publish_xmgame.js

@@ -0,0 +1,519 @@
+// v1.2.0
+// publish 2.x 也是用这个文件,需要做兼容
+let isPublish2 = process.argv[2].includes("publish_xmgame.js") && process.argv[3].includes("--evn=publish2");
+// 获取Node插件和工作路径
+let ideModuleDir, workSpaceDir;
+if (isPublish2) {
+	//是否使用IDE自带的node环境和插件,设置false后,则使用自己环境(使用命令行方式执行)
+	const useIDENode = process.argv[0].indexOf("LayaAir") > -1 ? true : false;
+	ideModuleDir = useIDENode ? process.argv[1].replace("gulp\\bin\\gulp.js", "").replace("gulp/bin/gulp.js", "") : "";
+	workSpaceDir = useIDENode ? process.argv[2].replace("--gulpfile=", "").replace("\\.laya\\publish_xmgame.js", "").replace("/.laya/publish_xmgame.js", "") + "/" : "./../";
+} else {
+	ideModuleDir = global.ideModuleDir;
+	workSpaceDir = global.workSpaceDir;
+}
+
+//引用插件模块
+const gulp = require(ideModuleDir + "gulp");
+const fs = require("fs");
+const path = require("path");
+const childProcess = require("child_process");
+const del = require(ideModuleDir + "del");
+const revCollector = require(ideModuleDir + 'gulp-rev-collector');
+let commandSuffix = ".cmd";
+
+let prevTasks = ["packfile"];
+if (isPublish2) {
+	prevTasks = "";
+}
+
+let 
+    config,
+	platform,
+	releaseDir,
+    tempReleaseDir, // 小米临时拷贝目录
+	projDir; // 小米快游戏工程目录
+let IDEXMProjPath,
+	isUpdateIDEXMProj = false;
+let versionCon; // 版本管理version.json
+// 创建小米项目前,拷贝小米引擎库、修改index.js
+// 应该在publish中的,但是为了方便发布2.0及IDE 1.x,放在这里修改
+gulp.task("preCreate_XM", prevTasks, function() {
+	if (isPublish2) {
+		let pubsetPath = path.join(workSpaceDir, ".laya", "pubset.json");
+		let content = fs.readFileSync(pubsetPath, "utf8");
+		let pubsetJson = JSON.parse(content);
+		platform = "xmgame";
+		releaseDir = path.join(workSpaceDir, "release", platform).replace(/\\/g, "/");
+		releaseDir = tempReleaseDir = path.join(releaseDir, "temprelease");
+		config = pubsetJson[4]; // 只用到了 config.xmInfo|config.xmSign
+	} else {
+		platform = global.platform;
+		releaseDir = global.releaseDir;
+		tempReleaseDir = global.tempReleaseDir;
+		config = global.config;
+	}
+	// 如果不是小米快游戏
+	if (platform !== "xmgame") {
+		return;
+	}
+	if (process.platform === "darwin") {
+		commandSuffix = "";
+	}
+	let copyLibsList = [`${workSpaceDir}/bin/libs/laya.xmmini.js`];
+	var stream = gulp.src(copyLibsList, { base: `${workSpaceDir}/bin` });
+	return stream.pipe(gulp.dest(tempReleaseDir));
+});
+
+gulp.task("copyPlatformFile_XM", ["preCreate_XM"], function() {
+	// 如果不是小米快游戏
+	if (platform !== "xmgame") {
+		return;
+	}
+	let xmAdapterPath = path.join(ideModuleDir, "../", "out", "layarepublic", "LayaAirProjectPack", "lib", "data", "xmfiles");
+	let copyLibsList = [`${xmAdapterPath}/**/*.*`];
+	var stream = gulp.src(copyLibsList);
+	return stream.pipe(gulp.dest(tempReleaseDir));
+});
+
+// 新建小米项目-小米项目与其他项目不同,需要新建小米快游戏项目,并打包成.rpk文件
+gulp.task("checkIDEProj_XM", ["copyPlatformFile_XM"], function() {
+	// 如果不是小米快游戏
+	if (platform !== "xmgame") {
+		return;
+	}
+	if (!ideModuleDir) {
+		return;
+	}
+	IDEXMProjPath = path.join(ideModuleDir, "../", "out", "layarepublic", "xm");
+	if (process.platform === "darwin") {
+		return;
+	}
+	let ideLastXMProjPath = path.join(IDEXMProjPath, config.xmInfo.projName);
+	// 如果IDE中没有小米项目,跳过这一步
+	let isProjExist = fs.existsSync(ideLastXMProjPath + "/node_modules") && 
+					  fs.existsSync(ideLastXMProjPath + "/sign");
+	if (!isProjExist) {
+		console.log("IDE中没有小米项目,跳过检查小米项目版本号这一步");
+		return;
+	}
+	// 如果IDE中项目已经存在了,检查版本号
+	// npm view quickgame-cli version
+	// npm ls quickgame-cli
+	let remoteVersion, localVersion;
+	let isGetRemote, isGetLocal;
+	return new Promise((resolve, reject) => { // 远程版本号
+		childProcess.exec("npm view quickgame-cli version", function(error, stdout, stderr) {
+			if (!stdout) { // 获取 quickgame-cli 远程版本号失败
+				reject();
+				return;
+			}
+			remoteVersion = stdout;
+			isGetRemote = true;
+			if (isGetRemote && isGetLocal) {
+				resolve();
+			}
+		});
+		childProcess.exec("npm ls quickgame-cli", { cwd: ideLastXMProjPath }, function(error, stdout, stderr) {
+			if (!stdout) { // 获取 quickgame-cli 本地版本号失败
+				reject();
+				return;
+			}
+			localVersion = stdout.match(/quickgame-cli@(.+)/);
+			localVersion = localVersion && localVersion[1];
+			isGetLocal = true;
+			if (isGetRemote && isGetLocal) {
+				resolve();
+			}
+		});
+		setTimeout(() => {
+			if (!isGetLocal || !isGetRemote) {
+				console.log("获取远程版本号或本地版本号失败");
+				reject();
+				return;
+			}
+		}, 10000);
+	}).then(() => { // 比较两个版本号
+		if (!remoteVersion || !localVersion) {
+			console.log("获取远程版本号或本地版本号失败!");
+		}
+		console.log("quickgame-cli -> ", localVersion, "|", remoteVersion);
+		if (remoteVersion.trim() !== localVersion.trim()) { // 仅当两个版本号都获取到并且不相等,置为需要更新(true)
+			isUpdateIDEXMProj = true;
+		}
+	}).catch((e) => {
+		console.log("获取远程版本号或本地版本号失败 -> ", remoteVersion, "|", localVersion);
+		console.log(e);
+	});
+});
+
+gulp.task("createIDEProj_XM", ["checkIDEProj_XM"], function() {
+	// 如果不是小米快游戏
+	if (platform !== "xmgame") {
+		return;
+	}
+	if (!ideModuleDir) {
+		return;
+	}
+	if (process.platform === "darwin") {
+		return;
+	}
+	let ideLastXMProjPath = path.join(IDEXMProjPath, config.xmInfo.projName);
+	// 如果有即存项目,不再新建
+	let isProjExist = fs.existsSync(ideLastXMProjPath + "/node_modules") && 
+					  fs.existsSync(ideLastXMProjPath + "/sign");
+	if (isProjExist && !isUpdateIDEXMProj) { // 项目存在并且不需要更新IDE中的小米项目
+		return;
+	}
+	return new Promise((resolve, reject) => {
+		console.log("(IDE)开始创建小米快游戏项目,请耐心等待(预计需要10分钟)...");
+		let cmd = `npx${commandSuffix}`;
+		let args = ["create-quickgame", config.xmInfo.projName, `path=${IDEXMProjPath}`,
+					`package=${config.xmInfo.package}`, `versionName=${config.xmInfo.versionName}`,
+					`versionCode=${config.xmInfo.versionCode}`, `minPlatformVersion=${config.xmInfo.minPlatformVersion}`,
+                    `icon=/layaicon/${path.basename(config.xmInfo.icon)}`, `name=${config.xmInfo.name}`, `rebuild=true`];
+        console.log(JSON.stringify(args));
+        
+        let cp = childProcess.spawn(cmd, args);
+        
+		cp.stdout.on('data', (data) => {
+			console.log(`stdout: ${data}`);
+		});
+		
+		cp.stderr.on('data', (data) => {
+			console.log(`stderr: ${data}`);
+			// reject();
+		});
+		
+		cp.on('close', (code) => {
+			console.log(`子进程退出码:${code}`);
+			resolve();
+		});
+	});
+});
+
+gulp.task("createProj_XM", ["createIDEProj_XM"], function() {
+	// 如果不是小米快游戏
+	if (platform !== "xmgame") {
+		return;
+	}
+	releaseDir = path.dirname(releaseDir);
+	projDir = path.join(releaseDir, config.xmInfo.projName);
+	// 如果有即存项目,不再新建
+	let isProjExist = fs.existsSync(projDir + "/node_modules") && 
+					  fs.existsSync(projDir + "/sign");
+	if (isProjExist) {
+		return;
+	}
+	// 如果IDE中有即存项目,不再新建,从IDE中拷贝
+	let ideLastXMProjPath = path.join(IDEXMProjPath, config.xmInfo.projName);
+	let isIDEXMProjExist = fs.existsSync(ideLastXMProjPath + "/node_modules") && 
+						fs.existsSync(ideLastXMProjPath + "/sign");
+	if (isIDEXMProjExist) { // 如果用的IDE并且有IDEXM目录
+		console.log("使用IDE中的小米游戏项目,拷贝...");
+		// node-glob语法中,* 无法匹配 .开头的文件(夹),必须手动匹配
+		let IDEXMProjPathStr = [`${IDEXMProjPath}/**/*.*`, `${ideLastXMProjPath}/node_modules/.bin/*.*`];
+		var stream = gulp.src(IDEXMProjPathStr, { base: IDEXMProjPath});
+		return stream.pipe(gulp.dest(releaseDir));
+	}
+	// 在项目中创建小米项目
+	return new Promise((resolve, reject) => {
+		console.log("(proj)开始创建小米快游戏项目,请耐心等待(预计需要10分钟)...");
+		let cmd = `npx${commandSuffix}`;
+		let args = ["create-quickgame", config.xmInfo.projName, `path=${releaseDir}`,
+					`package=${config.xmInfo.package}`, `versionName=${config.xmInfo.versionName}`,
+					`versionCode=${config.xmInfo.versionCode}`, `minPlatformVersion=${config.xmInfo.minPlatformVersion}`,
+                    `icon=/layaicon/${path.basename(config.xmInfo.icon)}`, `name=${config.xmInfo.name}`, `rebuild=true`];
+        console.log(JSON.stringify(args));
+        
+        let cp = childProcess.spawn(cmd, args);
+        
+		cp.stdout.on('data', (data) => {
+			console.log(`stdout: ${data}`);
+		});
+		
+		cp.stderr.on('data', (data) => {
+			console.log(`stderr: ${data}`);
+			// reject();
+		});
+		
+		cp.on('close', (code) => {
+			console.log(`子进程退出码:${code}`);
+			resolve();
+		});
+	});
+});
+
+// 拷贝文件到小米快游戏
+gulp.task("copyFileToProj_XM", ["createProj_XM"], function() {
+	// 如果不是小米快游戏
+	if (platform !== "xmgame") {
+		return;
+	}
+	// 将临时文件夹中的文件,拷贝到项目中去
+	let originalDir = `${tempReleaseDir}/**/*.*`;
+	let stream = gulp.src(originalDir);
+	return stream.pipe(gulp.dest(path.join(projDir)));
+});
+
+// 拷贝icon到小米快游戏
+gulp.task("copyIconToProj_XM", ["copyFileToProj_XM"], function() {
+	// 如果不是小米快游戏
+	if (platform !== "xmgame") {
+		return;
+	}
+	let originalDir = config.xmInfo.icon;
+	let stream = gulp.src(originalDir);
+	return stream.pipe(gulp.dest(path.join(projDir, "layaicon")));
+});
+
+// 清除小米快游戏临时目录
+gulp.task("clearTempDir_XM", ["copyIconToProj_XM"], function() {
+	// 如果不是小米快游戏
+	if (platform !== "xmgame") {
+		return;
+	}
+	// 删掉临时目录
+	return del([tempReleaseDir], { force: true });
+});
+
+// 生成release签名(私钥文件 private.pem 和证书文件 certificate.pem )
+gulp.task("generateSign_XM", ["clearTempDir_XM"], function() {
+	// 如果不是小米快游戏
+	if (platform !== "xmgame") {
+		return;
+    }
+    if (!config.xmSign.generateSign) {
+        return;
+    }
+	// https://doc.quickapp.cn/tools/compiling-tools.html
+	return new Promise((resolve, reject) => {
+		let cmd = "openssl";
+		let args = ["req", "-newkey", "rsa:2048", "-nodes", "-keyout", "private.pem", 
+					"-x509", "-days", "3650", "-out", "certificate.pem"];
+		let opts = {
+			cwd: projDir,
+			shell: true
+		};
+		let cp = childProcess.spawn(cmd, args, opts);
+		cp.stdout.on('data', (data) => {
+			console.log(`stdout: ${data}`);
+		});
+
+		cp.stderr.on('data', (data) => {
+			console.log(`stderr: ${data}`);
+			data += "";
+			if (data.includes("Country Name")) {
+				cp.stdin.write(`${config.xmSign.countryName}\n`);
+				console.log(`Country Name: ${config.xmSign.countryName}`);
+			} else if (data.includes("Province Name")) {
+				cp.stdin.write(`${config.xmSign.provinceName}\n`);
+				console.log(`Province Name: ${config.xmSign.provinceName}`);
+			} else if (data.includes("Locality Name")) {
+				cp.stdin.write(`${config.xmSign.localityName}\n`);
+				console.log(`Locality Name: ${config.xmSign.localityName}`);
+			} else if (data.includes("Organization Name")) {
+				cp.stdin.write(`${config.xmSign.orgName}\n`);
+				console.log(`Organization Name: ${config.xmSign.orgName}`);
+			} else if (data.includes("Organizational Unit Name")) {
+				cp.stdin.write(`${config.xmSign.orgUnitName}\n`);
+				console.log(`Organizational Unit Name: ${config.xmSign.orgUnitName}`);
+			} else if (data.includes("Common Name")) {
+				cp.stdin.write(`${config.xmSign.commonName}\n`);
+				console.log(`Common Name: ${config.xmSign.commonName}`);
+			} else if (data.includes("Email Address")) {
+				cp.stdin.write(`${config.xmSign.emailAddr}\n`);
+				console.log(`Email Address: ${config.xmSign.emailAddr}`);
+				// cp.stdin.end();
+			}
+			// reject();
+		});
+
+		cp.on('close', (code) => {
+			console.log(`子进程退出码:${code}`);
+			resolve();
+		});
+	});
+});
+
+// 拷贝sign文件到指定位置
+gulp.task("copySignFile_XM", ["generateSign_XM"], function() {
+	// 如果不是小米快游戏
+	if (platform !== "xmgame") {
+		return;
+    }
+    if (config.xmSign.generateSign) { // 新生成的签名
+        // 移动签名文件到项目中(Laya & 小米快游戏项目中)
+        let 
+            privatePem = path.join(projDir, "private.pem"),
+            certificatePem = path.join(projDir, "certificate.pem");
+        let isSignExits = fs.existsSync(privatePem) && fs.existsSync(certificatePem);
+        if (!isSignExits) {
+            return;
+        }
+        let 
+            xiaomiDest = `${projDir}/sign/release`,
+            layaDest = `${workSpaceDir}/sign/release`;
+        let stream = gulp.src([privatePem, certificatePem]);
+        return stream.pipe(gulp.dest(xiaomiDest))
+                    .pipe(gulp.dest(layaDest));
+    } else if (config.xmInfo.useReleaseSign && !config.xmSign.generateSign) { // 使用release签名,并且没有重新生成
+        // 从项目中将签名拷贝到小米快游戏项目中
+        let 
+            privatePem = path.join(workSpaceDir, "sign", "release", "private.pem"),
+            certificatePem = path.join(workSpaceDir, "sign", "release", "certificate.pem");
+        let isSignExits = fs.existsSync(privatePem) && fs.existsSync(certificatePem);
+        if (!isSignExits) {
+            return;
+        }
+        let 
+            xiaomiDest = `${projDir}/sign/release`;
+        let stream = gulp.src([privatePem, certificatePem]);
+        return stream.pipe(gulp.dest(xiaomiDest));
+    }
+});
+
+gulp.task("deleteSignFile_XM", ["copySignFile_XM"], function() {
+	// 如果不是小米快游戏
+	if (platform !== "xmgame") {
+		return;
+	}
+	if (config.xmSign.generateSign) { // 新生成的签名
+		let 
+            privatePem = path.join(projDir, "private.pem"),
+            certificatePem = path.join(projDir, "certificate.pem");
+		return del([privatePem, certificatePem], { force: true });
+	}
+});
+
+gulp.task("modifyFile_XM", ["deleteSignFile_XM"], function() {
+	// 如果不是小米快游戏
+	if (platform !== "xmgame") {
+		return;
+	}
+	// 修改manifest.json文件
+	let manifestPath = path.join(projDir, "manifest.json");
+	if (!fs.existsSync(manifestPath)) {
+		return;
+	}
+	let manifestContent = fs.readFileSync(manifestPath, "utf8");
+	let manifestJson = JSON.parse(manifestContent);
+	manifestJson.package = config.xmInfo.package;
+	manifestJson.name = config.xmInfo.name;
+	manifestJson.orientation = config.xmInfo.orientation;
+	manifestJson.config.logLevel = config.xmInfo.logLevel || "off";
+	manifestJson.versionName = config.xmInfo.versionName;
+	manifestJson.versionCode = config.xmInfo.versionCode;
+	manifestJson.minPlatformVersion = config.xmInfo.minPlatformVersion;
+	manifestJson.icon = `/layaicon/${path.basename(config.xmInfo.icon)}`;
+	fs.writeFileSync(manifestPath, JSON.stringify(manifestJson, null, 4), "utf8");
+
+	if (config.version) {
+		let versionPath = projDir + "/version.json";
+		versionCon = fs.readFileSync(versionPath, "utf8");
+		versionCon = JSON.parse(versionCon);
+	}
+	let indexJsStr = (versionCon && versionCon["index.js"]) ? versionCon["index.js"] :  "index.js";
+	// 修改main.js文件
+	let content = 'require("./qg-adapter.js");\nrequire("./libs/laya.xmmini.js");\nrequire("./index.js");';
+	let mainJsPath = path.join(projDir, "main.js");
+	fs.writeFileSync(mainJsPath, content, "utf8");
+
+	// 小米项目,修改index.js
+	let filePath = path.join(projDir, indexJsStr);
+	if (!fs.existsSync(filePath)) {
+		return;
+	}
+	let fileContent = fs.readFileSync(filePath, "utf8");
+	fileContent = fileContent.replace(/loadLib(\(['"])/gm, "require$1./");
+	fs.writeFileSync(filePath, fileContent, "utf8");
+})
+
+gulp.task("version_XM", ["modifyFile_XM"], function () {
+	// 如果不是小米快游戏
+	if (platform !== "xmgame") {
+		return;
+	}
+	if (config.version) {
+		let versionPath = projDir + "/version.json";
+		let mainJSPath = projDir + "/main.js";
+		let srcList = [versionPath, mainJSPath];
+		return gulp.src(srcList)
+			.pipe(revCollector())
+			.pipe(gulp.dest(projDir));
+	}
+});
+
+// 打包rpk
+gulp.task("buildRPK_XM", ["version_XM"], function() {
+	// 如果不是小米快游戏
+	if (platform !== "xmgame") {
+		return;
+	}
+	// 在小米轻游戏项目目录中执行:
+    // npm run build || npm run release
+    let cmdStr = "build";
+    if (config.xmInfo.useReleaseSign) {
+        cmdStr = "release";
+    }
+	return new Promise((resolve, reject) => {
+		let cmd = `npm${commandSuffix}`;
+		let args = ["run", cmdStr];
+		let opts = {
+			cwd: projDir
+		};
+		let cp = childProcess.spawn(cmd, args, opts);
+		// let cp = childProcess.spawn(`npx${commandSuffix}`, ['-v']);
+		cp.stdout.on('data', (data) => {
+			console.log(`stdout: ${data}`);
+		});
+
+		cp.stderr.on('data', (data) => {
+			console.log(`stderr: ${data}`);
+			// reject();
+		});
+
+		cp.on('close', (code) => {
+			console.log(`子进程退出码:${code}`);
+			resolve();
+		});
+	});
+});
+
+gulp.task("showQRCode_XM", ["buildRPK_XM"], function() {
+	// 如果不是小米快游戏
+	if (platform !== "xmgame") {
+		return;
+	}
+	// 在小米轻游戏项目目录中执行:
+	// npm run server
+	return new Promise((resolve, reject) => {
+		let cmd = `npm${commandSuffix}`;
+		let args = ["run", "server"];
+		let opts = {
+			cwd: projDir
+		};
+		let cp = childProcess.spawn(cmd, args, opts);
+		// let cp = childProcess.spawn(`npx${commandSuffix}`, ['-v']);
+		cp.stdout.on('data', (data) => {
+			console.log(`${data}`);
+			// 输出pid,macos要用: macos无法kill进程树,也无法执行命令获取3000端口pid(没有查询权限),导致无法kill这个进程
+			console.log('xm_qrcode_pid:' + cp.pid);
+		});
+
+		cp.stderr.on('data', (data) => {
+			console.log(`stderr: ${data}`);
+			// reject();
+		});
+
+		cp.on('close', (code) => {
+			console.log(`子进程退出码:${code}`);
+			resolve();
+		});
+	});
+});
+
+
+gulp.task("buildXiaomiProj", ["showQRCode_XM"], function() {
+	console.log("all tasks completed");
+});

Diferenças do arquivo suprimidas por serem muito extensas
+ 6 - 0
RubikCube/.rpt2_cache/rpt2_16c1bda467ce14747890b34f5f8873592d6d44db/code/cache/6bc1cfb0ce331de751109e16b4e4f9b8a703b07f


Diferenças do arquivo suprimidas por serem muito extensas
+ 4 - 0
RubikCube/.rpt2_cache/rpt2_16c1bda467ce14747890b34f5f8873592d6d44db/code/cache/d86a5ea00449d44be440351cc6f809c280bc39c4


+ 0 - 0
RubikCube/.rpt2_cache/rpt2_16c1bda467ce14747890b34f5f8873592d6d44db/types/cache/2f45d61fdd4cd95d19a817d8dccef1f394f41161


+ 0 - 0
RubikCube/.rpt2_cache/rpt2_16c1bda467ce14747890b34f5f8873592d6d44db/types/cache/443fd6a490f7894f91e7a67f5e027b058d0fddc8


+ 0 - 0
RubikCube/.rpt2_cache/rpt2_16c1bda467ce14747890b34f5f8873592d6d44db/types/cache/9fb10094dd32c323b6326e45638cab33c989acfd


+ 0 - 0
RubikCube/.rpt2_cache/rpt2_16c1bda467ce14747890b34f5f8873592d6d44db/types/cache/f880455b4be375ff2982326db9d5653b835a44dd


Diferenças do arquivo suprimidas por serem muito extensas
+ 4 - 0
RubikCube/.rpt2_cache/rpt2_17f6e31a80dbd776fa2022a18f0e9b6966320c6f/code/cache/02332a65a403196a4abd93a4cac71ebf633de2ff


Diferenças do arquivo suprimidas por serem muito extensas
+ 6 - 0
RubikCube/.rpt2_cache/rpt2_17f6e31a80dbd776fa2022a18f0e9b6966320c6f/code/cache/6bc1cfb0ce331de751109e16b4e4f9b8a703b07f


+ 0 - 0
RubikCube/.rpt2_cache/rpt2_17f6e31a80dbd776fa2022a18f0e9b6966320c6f/types/cache/2f45d61fdd4cd95d19a817d8dccef1f394f41161


+ 0 - 0
RubikCube/.rpt2_cache/rpt2_17f6e31a80dbd776fa2022a18f0e9b6966320c6f/types/cache/443fd6a490f7894f91e7a67f5e027b058d0fddc8


+ 0 - 0
RubikCube/.rpt2_cache/rpt2_17f6e31a80dbd776fa2022a18f0e9b6966320c6f/types/cache/9fb10094dd32c323b6326e45638cab33c989acfd


+ 0 - 0
RubikCube/.rpt2_cache/rpt2_17f6e31a80dbd776fa2022a18f0e9b6966320c6f/types/cache/f880455b4be375ff2982326db9d5653b835a44dd


Diferenças do arquivo suprimidas por serem muito extensas
+ 9 - 0
RubikCube/.rpt2_cache/rpt2_1aa73514e5a5f15f23206c8bcbf9114260ab2a8a/code/cache/00f51599e58e82839168c4a92292dbf4dde00905


Diferenças do arquivo suprimidas por serem muito extensas
+ 5 - 0
RubikCube/.rpt2_cache/rpt2_1aa73514e5a5f15f23206c8bcbf9114260ab2a8a/code/cache/0a86cf680231255d05327a8360e0a62fd91a866d


Diferenças do arquivo suprimidas por serem muito extensas
+ 8 - 0
RubikCube/.rpt2_cache/rpt2_1aa73514e5a5f15f23206c8bcbf9114260ab2a8a/code/cache/0d0116bf7d1e89c72351ac8b1e6ef422686c3632


Diferenças do arquivo suprimidas por serem muito extensas
+ 5 - 0
RubikCube/.rpt2_cache/rpt2_1aa73514e5a5f15f23206c8bcbf9114260ab2a8a/code/cache/196d5b15ac5d957ef121fd229a231620156b6dd6


+ 5 - 0
RubikCube/.rpt2_cache/rpt2_1aa73514e5a5f15f23206c8bcbf9114260ab2a8a/code/cache/26267b63ac8859f184c112e53a8a743bfd2a5b9e

@@ -0,0 +1,5 @@
+{
+  "code": "export class Global {\r\n}\r\nGlobal.VERSION = \"1.0.0\";\r\nGlobal.CFG = \"123\";\r\n//# sourceMappingURL=Global.js.map",
+  "references": [],
+  "map": "{\"version\":3,\"file\":\"Global.js\",\"sourceRoot\":\"\",\"sources\":[\"../../src/Global.ts\"],\"names\":[],\"mappings\":\"AAAA,MAAM,OAAO,MAAM;;AACR,cAAO,GAAG,OAAO,CAAC;AAClB,UAAG,GAAG,KAAK,CAAC\"}"
+}

Diferenças do arquivo suprimidas por serem muito extensas
+ 5 - 0
RubikCube/.rpt2_cache/rpt2_1aa73514e5a5f15f23206c8bcbf9114260ab2a8a/code/cache/2f2779be53b42561a4f5add47fd92e4fabd04b11


Diferenças do arquivo suprimidas por serem muito extensas
+ 8 - 0
RubikCube/.rpt2_cache/rpt2_1aa73514e5a5f15f23206c8bcbf9114260ab2a8a/code/cache/3aa5348e4faa774e20f0667e770f5662b938498d


Diferenças do arquivo suprimidas por serem muito extensas
+ 9 - 0
RubikCube/.rpt2_cache/rpt2_1aa73514e5a5f15f23206c8bcbf9114260ab2a8a/code/cache/41ebbfa096ec21675b47d279f33573847037165a


Diferenças do arquivo suprimidas por serem muito extensas
+ 8 - 0
RubikCube/.rpt2_cache/rpt2_1aa73514e5a5f15f23206c8bcbf9114260ab2a8a/code/cache/45af196622619d93bd7a403f94cd18bc4906da53


Diferenças do arquivo suprimidas por serem muito extensas
+ 9 - 0
RubikCube/.rpt2_cache/rpt2_1aa73514e5a5f15f23206c8bcbf9114260ab2a8a/code/cache/4f8aeafddd93013d5fe230bc247b1d8a88e371b0


Diferenças do arquivo suprimidas por serem muito extensas
+ 8 - 0
RubikCube/.rpt2_cache/rpt2_1aa73514e5a5f15f23206c8bcbf9114260ab2a8a/code/cache/5cc361e49638e621049d4edf9a78e2122019d2af


Diferenças do arquivo suprimidas por serem muito extensas
+ 14 - 0
RubikCube/.rpt2_cache/rpt2_1aa73514e5a5f15f23206c8bcbf9114260ab2a8a/code/cache/673d53f61d72a5789a1dcb2e5ff8e7083266e168


Diferenças do arquivo suprimidas por serem muito extensas
+ 5 - 0
RubikCube/.rpt2_cache/rpt2_1aa73514e5a5f15f23206c8bcbf9114260ab2a8a/code/cache/676979bd676ce413d4d97d4a5cac3d1ca73aa3f4


Diferenças do arquivo suprimidas por serem muito extensas
+ 5 - 0
RubikCube/.rpt2_cache/rpt2_1aa73514e5a5f15f23206c8bcbf9114260ab2a8a/code/cache/6f3f94aad37b09dc2bfc4611d053c061ef83621c


Diferenças do arquivo suprimidas por serem muito extensas
+ 10 - 0
RubikCube/.rpt2_cache/rpt2_1aa73514e5a5f15f23206c8bcbf9114260ab2a8a/code/cache/8a5dc72b5f64ec62bc36c5e9697e2b9b1c863b88


Diferenças do arquivo suprimidas por serem muito extensas
+ 9 - 0
RubikCube/.rpt2_cache/rpt2_1aa73514e5a5f15f23206c8bcbf9114260ab2a8a/code/cache/92bf2bda935f67e3d7a621ad782101f654b41216


Diferenças do arquivo suprimidas por serem muito extensas
+ 8 - 0
RubikCube/.rpt2_cache/rpt2_1aa73514e5a5f15f23206c8bcbf9114260ab2a8a/code/cache/99f1ad39370f719db390d6969a6d6d917739676a


Diferenças do arquivo suprimidas por serem muito extensas
+ 9 - 0
RubikCube/.rpt2_cache/rpt2_1aa73514e5a5f15f23206c8bcbf9114260ab2a8a/code/cache/9adfa6d710be702915d681cf5db8113c94d648c0


Diferenças do arquivo suprimidas por serem muito extensas
+ 5 - 0
RubikCube/.rpt2_cache/rpt2_1aa73514e5a5f15f23206c8bcbf9114260ab2a8a/code/cache/a76b6dffc994d4a7b92dc9f0525ac1a539a325ee


Diferenças do arquivo suprimidas por serem muito extensas
+ 9 - 0
RubikCube/.rpt2_cache/rpt2_1aa73514e5a5f15f23206c8bcbf9114260ab2a8a/code/cache/af5b88cfd577a44e3d27dfb88ee5e13f9582e577


Diferenças do arquivo suprimidas por serem muito extensas
+ 9 - 0
RubikCube/.rpt2_cache/rpt2_1aa73514e5a5f15f23206c8bcbf9114260ab2a8a/code/cache/d0e66fb93272333bee6a334ac552b8d314446c0a


Diferenças do arquivo suprimidas por serem muito extensas
+ 5 - 0
RubikCube/.rpt2_cache/rpt2_1aa73514e5a5f15f23206c8bcbf9114260ab2a8a/code/cache/e7af6844847455c6426f58da4b1d4bb2315e2a49


Diferenças do arquivo suprimidas por serem muito extensas
+ 12 - 0
RubikCube/.rpt2_cache/rpt2_1aa73514e5a5f15f23206c8bcbf9114260ab2a8a/code/cache/faa44ca2ddf01ea41c5a8ed36075aa2649217ea1


Diferenças do arquivo suprimidas por serem muito extensas
+ 8 - 0
RubikCube/.rpt2_cache/rpt2_1aa73514e5a5f15f23206c8bcbf9114260ab2a8a/code/cache/fd27f0c2497c06cd7802ea022411807119a1bb50


+ 0 - 0
RubikCube/.rpt2_cache/rpt2_1aa73514e5a5f15f23206c8bcbf9114260ab2a8a/types/cache/2d88ee78092edaa8de37d473c33839d03b25dd94


+ 0 - 0
RubikCube/.rpt2_cache/rpt2_1aa73514e5a5f15f23206c8bcbf9114260ab2a8a/types/cache/7abd7e3427a705f9bdcccbe9b1644869f8c30a6d


+ 0 - 0
RubikCube/.rpt2_cache/rpt2_1aa73514e5a5f15f23206c8bcbf9114260ab2a8a/types/cache/a880bb9992db11ff6ad31e0f506b3d706bab6071


+ 0 - 0
RubikCube/.rpt2_cache/rpt2_1aa73514e5a5f15f23206c8bcbf9114260ab2a8a/types/cache/b696fc35a59eac53016022d354027340008887e0


Diferenças do arquivo suprimidas por serem muito extensas
+ 4 - 0
RubikCube/.rpt2_cache/rpt2_2ae18f126d9500f48269dab254e3874438435f18/code/cache/02332a65a403196a4abd93a4cac71ebf633de2ff


Diferenças do arquivo suprimidas por serem muito extensas
+ 6 - 0
RubikCube/.rpt2_cache/rpt2_2ae18f126d9500f48269dab254e3874438435f18/code/cache/6bc1cfb0ce331de751109e16b4e4f9b8a703b07f


+ 0 - 0
RubikCube/.rpt2_cache/rpt2_2ae18f126d9500f48269dab254e3874438435f18/types/cache/2f45d61fdd4cd95d19a817d8dccef1f394f41161


+ 0 - 0
RubikCube/.rpt2_cache/rpt2_2ae18f126d9500f48269dab254e3874438435f18/types/cache/443fd6a490f7894f91e7a67f5e027b058d0fddc8


+ 0 - 0
RubikCube/.rpt2_cache/rpt2_2ae18f126d9500f48269dab254e3874438435f18/types/cache/9fb10094dd32c323b6326e45638cab33c989acfd


+ 0 - 0
RubikCube/.rpt2_cache/rpt2_2ae18f126d9500f48269dab254e3874438435f18/types/cache/f880455b4be375ff2982326db9d5653b835a44dd


Diferenças do arquivo suprimidas por serem muito extensas
+ 9 - 0
RubikCube/.rpt2_cache/rpt2_39343d15e8eb1e0266d3dfba53da0a008ee3d156/code/cache/00f51599e58e82839168c4a92292dbf4dde00905


Diferenças do arquivo suprimidas por serem muito extensas
+ 5 - 0
RubikCube/.rpt2_cache/rpt2_39343d15e8eb1e0266d3dfba53da0a008ee3d156/code/cache/0a86cf680231255d05327a8360e0a62fd91a866d


Diferenças do arquivo suprimidas por serem muito extensas
+ 8 - 0
RubikCube/.rpt2_cache/rpt2_39343d15e8eb1e0266d3dfba53da0a008ee3d156/code/cache/0d0116bf7d1e89c72351ac8b1e6ef422686c3632


Diferenças do arquivo suprimidas por serem muito extensas
+ 5 - 0
RubikCube/.rpt2_cache/rpt2_39343d15e8eb1e0266d3dfba53da0a008ee3d156/code/cache/196d5b15ac5d957ef121fd229a231620156b6dd6


+ 5 - 0
RubikCube/.rpt2_cache/rpt2_39343d15e8eb1e0266d3dfba53da0a008ee3d156/code/cache/26267b63ac8859f184c112e53a8a743bfd2a5b9e

@@ -0,0 +1,5 @@
+{
+  "code": "export class Global {\r\n}\r\nGlobal.VERSION = \"1.0.0\";\r\nGlobal.CFG = \"123\";\r\n//# sourceMappingURL=Global.js.map",
+  "references": [],
+  "map": "{\"version\":3,\"file\":\"Global.js\",\"sourceRoot\":\"\",\"sources\":[\"../../src/Global.ts\"],\"names\":[],\"mappings\":\"AAAA,MAAM,OAAO,MAAM;;AACR,cAAO,GAAG,OAAO,CAAC;AAClB,UAAG,GAAG,KAAK,CAAC\"}"
+}

Diferenças do arquivo suprimidas por serem muito extensas
+ 9 - 0
RubikCube/.rpt2_cache/rpt2_39343d15e8eb1e0266d3dfba53da0a008ee3d156/code/cache/41ebbfa096ec21675b47d279f33573847037165a


Diferenças do arquivo suprimidas por serem muito extensas
+ 8 - 0
RubikCube/.rpt2_cache/rpt2_39343d15e8eb1e0266d3dfba53da0a008ee3d156/code/cache/45af196622619d93bd7a403f94cd18bc4906da53


Diferenças do arquivo suprimidas por serem muito extensas
+ 9 - 0
RubikCube/.rpt2_cache/rpt2_39343d15e8eb1e0266d3dfba53da0a008ee3d156/code/cache/4f8aeafddd93013d5fe230bc247b1d8a88e371b0


Diferenças do arquivo suprimidas por serem muito extensas
+ 8 - 0
RubikCube/.rpt2_cache/rpt2_39343d15e8eb1e0266d3dfba53da0a008ee3d156/code/cache/5cc361e49638e621049d4edf9a78e2122019d2af


Diferenças do arquivo suprimidas por serem muito extensas
+ 14 - 0
RubikCube/.rpt2_cache/rpt2_39343d15e8eb1e0266d3dfba53da0a008ee3d156/code/cache/673d53f61d72a5789a1dcb2e5ff8e7083266e168


Diferenças do arquivo suprimidas por serem muito extensas
+ 5 - 0
RubikCube/.rpt2_cache/rpt2_39343d15e8eb1e0266d3dfba53da0a008ee3d156/code/cache/676979bd676ce413d4d97d4a5cac3d1ca73aa3f4


Diferenças do arquivo suprimidas por serem muito extensas
+ 5 - 0
RubikCube/.rpt2_cache/rpt2_39343d15e8eb1e0266d3dfba53da0a008ee3d156/code/cache/6f3f94aad37b09dc2bfc4611d053c061ef83621c


Diferenças do arquivo suprimidas por serem muito extensas
+ 11 - 0
RubikCube/.rpt2_cache/rpt2_39343d15e8eb1e0266d3dfba53da0a008ee3d156/code/cache/7ee8406b609853cfa532cbd85da62a22deb4bc87


Diferenças do arquivo suprimidas por serem muito extensas
+ 5 - 0
RubikCube/.rpt2_cache/rpt2_39343d15e8eb1e0266d3dfba53da0a008ee3d156/code/cache/80e22317916e5015d26469c22bc7be4e63c8ddfe


Diferenças do arquivo suprimidas por serem muito extensas
+ 8 - 0
RubikCube/.rpt2_cache/rpt2_39343d15e8eb1e0266d3dfba53da0a008ee3d156/code/cache/83df4a37b62e1f86d7ee951c0c69e70c494f1809


Diferenças do arquivo suprimidas por serem muito extensas
+ 9 - 0
RubikCube/.rpt2_cache/rpt2_39343d15e8eb1e0266d3dfba53da0a008ee3d156/code/cache/92bf2bda935f67e3d7a621ad782101f654b41216


Diferenças do arquivo suprimidas por serem muito extensas
+ 8 - 0
RubikCube/.rpt2_cache/rpt2_39343d15e8eb1e0266d3dfba53da0a008ee3d156/code/cache/99f1ad39370f719db390d6969a6d6d917739676a


Diferenças do arquivo suprimidas por serem muito extensas
+ 7 - 0
RubikCube/.rpt2_cache/rpt2_39343d15e8eb1e0266d3dfba53da0a008ee3d156/code/cache/a61c934e7f562bf08877b4ce2d28166cffd155fa


Diferenças do arquivo suprimidas por serem muito extensas
+ 9 - 0
RubikCube/.rpt2_cache/rpt2_39343d15e8eb1e0266d3dfba53da0a008ee3d156/code/cache/af5b88cfd577a44e3d27dfb88ee5e13f9582e577


Diferenças do arquivo suprimidas por serem muito extensas
+ 9 - 0
RubikCube/.rpt2_cache/rpt2_39343d15e8eb1e0266d3dfba53da0a008ee3d156/code/cache/d0e66fb93272333bee6a334ac552b8d314446c0a


Diferenças do arquivo suprimidas por serem muito extensas
+ 5 - 0
RubikCube/.rpt2_cache/rpt2_39343d15e8eb1e0266d3dfba53da0a008ee3d156/code/cache/e7af6844847455c6426f58da4b1d4bb2315e2a49


Diferenças do arquivo suprimidas por serem muito extensas
+ 8 - 0
RubikCube/.rpt2_cache/rpt2_39343d15e8eb1e0266d3dfba53da0a008ee3d156/code/cache/fd52c028d4635ba00b6c7b7230b6ecec80936904


+ 0 - 0
RubikCube/.rpt2_cache/rpt2_39343d15e8eb1e0266d3dfba53da0a008ee3d156/types/cache/2d88ee78092edaa8de37d473c33839d03b25dd94


+ 0 - 0
RubikCube/.rpt2_cache/rpt2_39343d15e8eb1e0266d3dfba53da0a008ee3d156/types/cache/7abd7e3427a705f9bdcccbe9b1644869f8c30a6d


+ 0 - 0
RubikCube/.rpt2_cache/rpt2_39343d15e8eb1e0266d3dfba53da0a008ee3d156/types/cache/a880bb9992db11ff6ad31e0f506b3d706bab6071


+ 0 - 0
RubikCube/.rpt2_cache/rpt2_39343d15e8eb1e0266d3dfba53da0a008ee3d156/types/cache/b696fc35a59eac53016022d354027340008887e0


+ 7 - 0
RubikCube/.rpt2_cache/rpt2_5325f18c9665847b323cb40a11844f0a22896979/code/cache/023cf0fa34c7c52b4db8e48c8d3301138d124f1b

@@ -0,0 +1,7 @@
+{
+  "code": "import { ui } from \"../ui/layaMaxUI\";\r\nexport class InGameView extends ui.InGameViewUI {\r\n    constructor() {\r\n        super();\r\n        InGameView.ins = this;\r\n    }\r\n    static get Instance() {\r\n        if (InGameView.ins == null) {\r\n            return new InGameView();\r\n        }\r\n        return InGameView.ins;\r\n    }\r\n    OnShow() {\r\n    }\r\n    OnHide() {\r\n    }\r\n}\r\n//# sourceMappingURL=InGameView.js.map",
+  "references": [
+    "E:/LayaProject/RubikCube/src/ui/layaMaxUI.ts"
+  ],
+  "map": "{\"version\":3,\"file\":\"InGameView.js\",\"sourceRoot\":\"\",\"sources\":[\"../../../src/View/InGameView.ts\"],\"names\":[],\"mappings\":\"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,iBAAiB,CAAC;AACrC,MAAM,OAAO,UAAW,SAAQ,EAAE,CAAC,YAAY;IAE3C;QACI,KAAK,EAAE,CAAC;QACR,UAAU,CAAC,GAAG,GAAG,IAAI,CAAC;IAC1B,CAAC;IACM,MAAM,KAAK,QAAQ;QACtB,IAAG,UAAU,CAAC,GAAG,IAAI,IAAI,EAAC;YACtB,OAAO,IAAI,UAAU,EAAE,CAAC;SAC3B;QACD,OAAO,UAAU,CAAC,GAAG,CAAC;IAC1B,CAAC;IACD,MAAM;IAEN,CAAC;IACD,MAAM;IAEN,CAAC;CACJ\"}"
+}

Diferenças do arquivo suprimidas por serem muito extensas
+ 9 - 0
RubikCube/.rpt2_cache/rpt2_5325f18c9665847b323cb40a11844f0a22896979/code/cache/0597bea2751b5b538b312fba7c7d3cc47eaf2205


Diferenças do arquivo suprimidas por serem muito extensas
+ 5 - 0
RubikCube/.rpt2_cache/rpt2_5325f18c9665847b323cb40a11844f0a22896979/code/cache/0a86cf680231255d05327a8360e0a62fd91a866d


Diferenças do arquivo suprimidas por serem muito extensas
+ 8 - 0
RubikCube/.rpt2_cache/rpt2_5325f18c9665847b323cb40a11844f0a22896979/code/cache/0d0116bf7d1e89c72351ac8b1e6ef422686c3632


+ 5 - 0
RubikCube/.rpt2_cache/rpt2_5325f18c9665847b323cb40a11844f0a22896979/code/cache/0f56012f97bf1338cbfeb5eb677235b631353196

@@ -0,0 +1,5 @@
+{
+  "code": "export class CameraManager {\r\n    constructor() {\r\n        CameraManager.ins = this;\r\n    }\r\n    static get Instance() {\r\n        if (CameraManager.ins == null) {\r\n            return new CameraManager();\r\n        }\r\n        return CameraManager.ins;\r\n    }\r\n}\r\n//# sourceMappingURL=CameraManager.js.map",
+  "references": [],
+  "map": "{\"version\":3,\"file\":\"CameraManager.js\",\"sourceRoot\":\"\",\"sources\":[\"../../../src/Manager/CameraManager.ts\"],\"names\":[],\"mappings\":\"AAAA,MAAM,OAAO,aAAa;IAEtB;QACI,aAAa,CAAC,GAAG,GAAG,IAAI,CAAC;IAC7B,CAAC;IACM,MAAM,KAAK,QAAQ;QACtB,IAAG,aAAa,CAAC,GAAG,IAAI,IAAI,EAAC;YACzB,OAAO,IAAI,aAAa,EAAE,CAAC;SAC9B;QACD,OAAO,aAAa,CAAC,GAAG,CAAC;IAC7B,CAAC;CAIJ\"}"
+}

Diferenças do arquivo suprimidas por serem muito extensas
+ 5 - 0
RubikCube/.rpt2_cache/rpt2_5325f18c9665847b323cb40a11844f0a22896979/code/cache/196d5b15ac5d957ef121fd229a231620156b6dd6


+ 7 - 0
RubikCube/.rpt2_cache/rpt2_5325f18c9665847b323cb40a11844f0a22896979/code/cache/22136957b59413f7aa764083a4efb1e36dc52e95

@@ -0,0 +1,7 @@
+{
+  "code": "import { ui } from \"../ui/layaMaxUI\";\r\nexport class HomeView extends ui.InGameViewUI {\r\n    constructor() {\r\n        super();\r\n        HomeView.ins = this;\r\n    }\r\n    static get Instance() {\r\n        if (HomeView.ins == null) {\r\n            return new HomeView();\r\n        }\r\n        return HomeView.ins;\r\n    }\r\n    OnShow() {\r\n    }\r\n    OnHide() {\r\n    }\r\n}\r\n//# sourceMappingURL=HomeView.js.map",
+  "references": [
+    "E:/LayaProject/RubikCube/src/ui/layaMaxUI.ts"
+  ],
+  "map": "{\"version\":3,\"file\":\"HomeView.js\",\"sourceRoot\":\"\",\"sources\":[\"../../../src/View/HomeView.ts\"],\"names\":[],\"mappings\":\"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,iBAAiB,CAAC;AACrC,MAAM,OAAO,QAAS,SAAQ,EAAE,CAAC,YAAY;IAEzC;QACI,KAAK,EAAE,CAAC;QACR,QAAQ,CAAC,GAAG,GAAG,IAAI,CAAC;IACxB,CAAC;IACM,MAAM,KAAK,QAAQ;QACtB,IAAG,QAAQ,CAAC,GAAG,IAAI,IAAI,EAAC;YACpB,OAAO,IAAI,QAAQ,EAAE,CAAC;SACzB;QACD,OAAO,QAAQ,CAAC,GAAG,CAAC;IACxB,CAAC;IACD,MAAM;IAEN,CAAC;IACD,MAAM;IAEN,CAAC;CACJ\"}"
+}

+ 5 - 0
RubikCube/.rpt2_cache/rpt2_5325f18c9665847b323cb40a11844f0a22896979/code/cache/26267b63ac8859f184c112e53a8a743bfd2a5b9e

@@ -0,0 +1,5 @@
+{
+  "code": "export class Global {\r\n}\r\nGlobal.VERSION = \"1.0.0\";\r\nGlobal.CFG = \"123\";\r\n//# sourceMappingURL=Global.js.map",
+  "references": [],
+  "map": "{\"version\":3,\"file\":\"Global.js\",\"sourceRoot\":\"\",\"sources\":[\"../../src/Global.ts\"],\"names\":[],\"mappings\":\"AAAA,MAAM,OAAO,MAAM;;AACR,cAAO,GAAG,OAAO,CAAC;AAClB,UAAG,GAAG,KAAK,CAAC\"}"
+}

Diferenças do arquivo suprimidas por serem muito extensas
+ 11 - 0
RubikCube/.rpt2_cache/rpt2_5325f18c9665847b323cb40a11844f0a22896979/code/cache/4203da2495b57ba1a6fff61c602d62dfa7604694


+ 5 - 0
RubikCube/.rpt2_cache/rpt2_5325f18c9665847b323cb40a11844f0a22896979/code/cache/43dd7b41ef8d68b3d8c6876edcdacf72a7726da4

@@ -0,0 +1,5 @@
+{
+  "code": "export class LevelManager {\r\n    constructor() {\r\n        LevelManager.ins = this;\r\n    }\r\n    static get Instance() {\r\n        if (LevelManager.ins == null) {\r\n            return new LevelManager();\r\n        }\r\n        return LevelManager.ins;\r\n    }\r\n}\r\n//# sourceMappingURL=LevelManager.js.map",
+  "references": [],
+  "map": "{\"version\":3,\"file\":\"LevelManager.js\",\"sourceRoot\":\"\",\"sources\":[\"../../../src/Manager/LevelManager.ts\"],\"names\":[],\"mappings\":\"AAAA,MAAM,OAAO,YAAY;IAErB;QACI,YAAY,CAAC,GAAG,GAAG,IAAI,CAAC;IAC5B,CAAC;IACM,MAAM,KAAK,QAAQ;QACtB,IAAG,YAAY,CAAC,GAAG,IAAI,IAAI,EAAC;YACxB,OAAO,IAAI,YAAY,EAAE,CAAC;SAC7B;QACD,OAAO,YAAY,CAAC,GAAG,CAAC;IAC5B,CAAC;CAEJ\"}"
+}

Diferenças do arquivo suprimidas por serem muito extensas
+ 8 - 0
RubikCube/.rpt2_cache/rpt2_5325f18c9665847b323cb40a11844f0a22896979/code/cache/45af196622619d93bd7a403f94cd18bc4906da53


Diferenças do arquivo suprimidas por serem muito extensas
+ 5 - 0
RubikCube/.rpt2_cache/rpt2_5325f18c9665847b323cb40a11844f0a22896979/code/cache/4667303fd76c5e6b6f4de88006bf21c7e96b964a


Diferenças do arquivo suprimidas por serem muito extensas
+ 9 - 0
RubikCube/.rpt2_cache/rpt2_5325f18c9665847b323cb40a11844f0a22896979/code/cache/4f8aeafddd93013d5fe230bc247b1d8a88e371b0


Diferenças do arquivo suprimidas por serem muito extensas
+ 8 - 0
RubikCube/.rpt2_cache/rpt2_5325f18c9665847b323cb40a11844f0a22896979/code/cache/5cc361e49638e621049d4edf9a78e2122019d2af


Diferenças do arquivo suprimidas por serem muito extensas
+ 14 - 0
RubikCube/.rpt2_cache/rpt2_5325f18c9665847b323cb40a11844f0a22896979/code/cache/673d53f61d72a5789a1dcb2e5ff8e7083266e168


Diferenças do arquivo suprimidas por serem muito extensas
+ 5 - 0
RubikCube/.rpt2_cache/rpt2_5325f18c9665847b323cb40a11844f0a22896979/code/cache/676979bd676ce413d4d97d4a5cac3d1ca73aa3f4


Diferenças do arquivo suprimidas por serem muito extensas
+ 5 - 0
RubikCube/.rpt2_cache/rpt2_5325f18c9665847b323cb40a11844f0a22896979/code/cache/6f3f94aad37b09dc2bfc4611d053c061ef83621c


Diferenças do arquivo suprimidas por serem muito extensas
+ 8 - 0
RubikCube/.rpt2_cache/rpt2_5325f18c9665847b323cb40a11844f0a22896979/code/cache/99f1ad39370f719db390d6969a6d6d917739676a


+ 0 - 0
RubikCube/.rpt2_cache/rpt2_5325f18c9665847b323cb40a11844f0a22896979/code/cache/af5b88cfd577a44e3d27dfb88ee5e13f9582e577


Alguns arquivos não foram mostrados porque muitos arquivos mudaram nesse diff