Browse Source

add in --with-docs task

JimMarlowe 9 years ago
parent
commit
b87fa99f67

+ 1 - 0
Build/Scripts/Bootstrap.js

@@ -26,6 +26,7 @@ function printHelp() {
     console.log("--debug         : Build debug version of the editor and associated platform runtimes")
     console.log("--noclean       : Do not clean before building, useful during development")
     console.log("--nonet         : Build without AtomicNET C# scripting support")
+    console.log("--with-docs     : Build and install API documents into the editor")
     console.log("--with-examples : Install examples into the editor")
     console.log("--------------------------")
 

+ 35 - 0
Build/Scripts/BuildCommon.js

@@ -7,8 +7,11 @@ var glob = require('glob');
 
 var Tslint = require("tslint");
 
+var fso = require('fs');
+var buildInfoDir = atomicRoot + "Source/AtomicBuildInfo/";
 var editorAppFolder = host.artifactsRoot + "AtomicEditor/";
 var toolDataFolder = editorAppFolder + "Resources/ToolData/";
+var jsDocFolder = host.artifactsRoot + "Build/JSDoc/";
 
 namespace('build', function() {
 
@@ -210,7 +213,39 @@ namespace('build', function() {
 
     });
 
+ 
+  task('gendocs', {
+    async: true
+    }, function() {
+
+    fs.copySync(atomicRoot + "Build/Docs/Readme.md", jsDocFolder + "Readme.md");
+    fs.copySync(atomicRoot + "Build/Docs/atomic-theme", jsDocFolder + "atomic-theme");
+
+    cmds = [
+      "cd " + jsDocFolder + " && echo {} > package.json", // newer versions of npm require package.json to be in the folder or else it searches up the heirarchy
+      "cd " + jsDocFolder + " && npm install typedoc",
+      "cd " + jsDocFolder + " && ./node_modules/.bin/typedoc --out out " + toolDataFolder + "TypeScriptSupport/Atomic.d.ts --module commonjs --includeDeclarations --mode file --theme atomic-theme --name 'Atomic Game Engine' --readme ./Readme.md",
+    ];
 
+    jake.exec(cmds, function() {
+        
+      common.cleanCreateDir( toolDataFolder + "Docs");
+
+      fs.copySync(jsDocFolder + "out", toolDataFolder + "Docs/JSDocs");
+    
+      complete();
+
+      console.log( "completed installing API documentation" );
+
+    }, {
+        
+      printStdout: true
+
+    });
+
+  });
+  
+  
   task('genexamples', {
     async: true
     }, function() {

+ 5 - 0
Build/Scripts/BuildLinux.js

@@ -105,6 +105,7 @@ namespace('build', function() {
 
         var android = options["with-android"] ? true : false;
         var cleanBuild = options["noclean"] ? false : true;
+        var installDocs = options["with-docs"] ? true : false;
         var installExamples = options["with-examples"] ? true : false;
         debug = options["debug"] ? true : false;
         config = debug ? "Debug" : "Release";
@@ -155,6 +156,10 @@ namespace('build', function() {
             rootTask.addListener('complete', function () {
                 console.log("\n\nAtomic Editor built to " + editorAppFolder + "\n\n");
 
+                if (installDocs) {
+                    jake.Task['build:gendocs'].invoke();
+                }
+
                 if (installExamples) {
                     jake.Task['build:genexamples'].invoke();
                 }

+ 5 - 0
Build/Scripts/BuildMac.js

@@ -89,6 +89,7 @@ namespace('build', function() {
         var android = options["with-android"] ? true : false;
         var ios = options["with-ios"] ? true : false;
         var cleanBuild = options["noclean"] ? false : true;
+        var installDocs = options["with-docs"] ? true : false;
         var installExamples = options["with-examples"] ? true : false;
         debug = options["debug"] ? true : false;
         config = debug ? "Debug" : "Release";
@@ -146,6 +147,10 @@ namespace('build', function() {
             rootTask.addListener('complete', function () {
                 console.log("\n\nAtomic Editor built to " + editorAppFolder + "\n\n");
 
+                if (installDocs) {
+                    jake.Task['build:gendocs'].invoke();
+                }
+
                 if (installExamples) {
                     jake.Task['build:genexamples'].invoke();
                 }

+ 5 - 0
Build/Scripts/BuildWindows.js

@@ -88,6 +88,7 @@ namespace('build', function() {
 
         var android = options["with-android"] ? true : false;
         var cleanBuild = options["noclean"] ? false : true;
+        var installDocs = options["with-docs"] ? true : false;
         var installExamples = options["with-examples"] ? true : false;
         debug = options["debug"] ? true : false;
         config = debug ? "Debug" : "Release";
@@ -133,6 +134,10 @@ namespace('build', function() {
             rootTask.addListener('complete', function () {
                 console.log("\n\nAtomic Editor built to " + editorAppFolder + "\n\n");
 
+                if (installDocs) {
+                    jake.Task['build:gendocs'].invoke();
+                }
+
                 if (installExamples) {
                     jake.Task['build:genexamples'].invoke();
                 }