Explorar el Código

打包时产生API文件

tangxl hace 5 años
padre
commit
8dcfd5a8d2
Se han modificado 2 ficheros con 12 adiciones y 2 borrados
  1. 9 0
      gulpfile.js
  2. 3 2
      package.json

+ 9 - 0
gulpfile.js

@@ -803,6 +803,14 @@ function build_web_v_html() {
         .pipe(gulp.dest(dest))
         .pipe(gutil.noop());
 }
+function build_web_api() {
+    var src = 'o2web/api/**/*';
+    var dest = 'target/o2server/servers/webServer/api/';
+    return gulp.src(src)
+        .pipe(assetRev())
+        .pipe(gulp.dest(dest))
+        .pipe(gutil.noop());
+}
 function build_web_v_o2() {
     var src = 'target/o2server/servers/webServer/o2_core//o2.js';
     var dest = 'target/o2server/servers/webServer/o2_core/';
@@ -897,6 +905,7 @@ exports.build_web = gulp.series(
         build_bundle
     ),
     build_web_v_html,
+    build_web_api,
     build_web_v_o2);
 
 if (os.platform().indexOf("win")==-1){

+ 3 - 2
package.json

@@ -15,7 +15,8 @@
                 "build_server": "gulp build_server",
                 "build_server_script": "cd o2server && mvn clean && mvn install",
                 "build_web": "gulp build_web",
-                "build_parallel": "npm run build_server && npm run build_web",
+                "build_api": "jsdoc -c o2web/jsdoc.conf.json -q version=${VAPI}",
+                "build_parallel": "npm run build_server && VAPI=${VAPI} npm run build_api &&  npm run build_web",
                 "deploy": "gulp deploy",
                 "deploy:win": "gulp deploy --e windows",
                 "deploy:linux": "gulp deploy --e linux",
@@ -35,7 +36,7 @@
                 "build:macos": "npm run clear  && npm run build_parallel && npm run deploy:macos ",
                 "build:risc": "npm run clear &&  npm run build_parallel && npm run deploy:risc ",
                 "build:rpi": "npm run clear &&  npm run build_parallel && npm run deploy:rpi",
-                "build_ci": "npm run clear && npm run preperation && npm run build_parallel && npm run deploy",
+                "build_ci": "npm run clear && npm run preperation && VAPI=${VAPI} npm run build_parallel && npm run deploy",
                 "build_ci:win": "npm run clear && npm run preperation:win && npm run build_parallel && npm run deploy:win ",
                 "build_ci:linux": "npm run clear && npm run preperation:linux && npm run build_parallel && npm run deploy:linux ",
                 "build_ci:aix": "npm run clear && npm run preperation:aix && npm run build_parallel && npm run deploy:aix",