ソースを参照

add with-docs, with-examples

JimMarlowe 9 年 前
コミット
67b044139b

+ 8 - 6
Build/Scripts/Bootstrap.js

@@ -20,12 +20,14 @@ function printHelp() {
 
     console.log("\nAtomic Editor Build Script")
     console.log("--------------------------")
-    console.log("--help         : This help text")
-    console.log("--with-android : Build with Android platform support");
-    console.log("--with-ios     : Build with iOS platform support");
-    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("--help          : This help text")
+    console.log("--with-android  : Build with Android platform support");
+    console.log("--with-ios      : Build with iOS platform support");
+    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("--------------------------")
 
     process.exit(0);

+ 62 - 0
Build/Scripts/BuildCommon.js

@@ -7,6 +7,12 @@ 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() {
 
     // Linting task
@@ -207,5 +213,61 @@ 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() {
+    
+    common.cleanCreateDir( toolDataFolder + "AtomicExamples");
+
+    cmds = [
+      "git clone https://github.com/AtomicGameEngine/AtomicExamples " + toolDataFolder + "AtomicExamples && rm -rf " + toolDataFolder + "AtomicExamples/.git",
+    ];
+
+    jake.exec(cmds, function() {
+
+      complete();
+      console.log( "completed installing example programs" )
+
+        }, {
+
+      printStdout: true
+
+    });
+
+  });
+
+
 
 }); // end of build namespace

+ 12 - 1
Build/Scripts/BuildLinux.js

@@ -105,6 +105,8 @@ 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";
 
@@ -153,7 +155,16 @@ namespace('build', function() {
 
             rootTask.addListener('complete', function () {
                 console.log("\n\nAtomic Editor built to " + editorAppFolder + "\n\n");
-                complete();
+
+                if (installDocs) {
+                    jake.Task['build:gendocs'].invoke();
+                }
+
+                if (installExamples) {
+                    jake.Task['build:genexamples'].invoke();
+                }
+
+               complete();
             });
 
             rootTask.invoke();

+ 11 - 0
Build/Scripts/BuildMac.js

@@ -89,6 +89,8 @@ 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";
 
@@ -144,6 +146,15 @@ 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();
+                }
+
                 complete();
             });
 

+ 11 - 0
Build/Scripts/BuildWindows.js

@@ -88,6 +88,8 @@ 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";
 
@@ -131,6 +133,15 @@ 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();
+                }
+
                 complete();
             });