Browse Source

CLI updates

Josh Engebretson 10 years ago
parent
commit
b51de67d32

+ 1 - 0
CLI/atomic-cli-mac-data/.gitignore

@@ -0,0 +1 @@
+data/*

+ 0 - 0
CLI/atomic-cli-mac/.npmignore → CLI/atomic-cli-mac-data/.npmignore


+ 8 - 0
CLI/atomic-cli-mac-data/index.js

@@ -0,0 +1,8 @@
+
+var ATOMICTOOL_BIN = __dirname  + "/data/editor/AtomicEditor.app/Contents/Applications/CommandLine/AtomicTool";
+var ATOMICEDITOR_DATADIR = __dirname  + "/data/editor/AtomicEditor.app/Contents/Resources";
+
+module.exports = {
+  "ATOMICTOOL_BIN" : ATOMICTOOL_BIN,
+  "ATOMICEDITOR_DATADIR" : ATOMICEDITOR_DATADIR
+}

+ 12 - 0
CLI/atomic-cli-mac-data/package.json

@@ -0,0 +1,12 @@
+{
+  "description": "Mac data for atomic-cli-mac package",
+  "engines": {
+    "node": ">=0.8.0"
+  },
+  "homepage": "http://www.AtomicGameEngine.com",
+  "files" : ["data"],
+  "main": "./index.js",
+  "name": "atomic-cli-mac-data",
+  "version": "0.0.1",
+  "os" : ["darwin"]
+}

+ 9 - 9
CLI/atomic-cli-mac/index.js

@@ -1,10 +1,10 @@
 
-var PLATFORM_DATA_DIR = __dirname + "/data";
-var ATOMICTOOL_BIN = __dirname + "/bin/AtomicTool";
-var EDITOR_APPLICATION = __dirname + "/bin/editor/AtomicEditor.app/Contents/MacOS/AtomicEditor";
-var EDITOR_DATA_DIR = __dirname + "/bin/editor/AtomicEditor.app/Contents/Resources";
-
-exports.PLATFORM_DATA_DIR = PLATFORM_DATA_DIR;
-exports.EDITOR_APPLICATION = EDITOR_APPLICATION;
-exports.EDITOR_DATA_DIR = EDITOR_DATA_DIR;
-exports.ATOMICTOOL_BIN = ATOMICTOOL_BIN;
+
+// ln -sf /Users/josh/Dev/atomic/AtomicGameEngine/Artifacts/MacOSX_Package/AtomicEditor.app ./AtomicEditor.app
+
+atomic_data = require('atomic-cli-mac-data');
+
+module.exports = {
+  "ATOMICTOOL_BIN" : atomic_data.ATOMICTOOL_BIN,
+  "ATOMICEDITOR_DATADIR" : atomic_data.ATOMICEDITOR_DATADIR
+}

+ 22 - 0
CLI/atomic-cli-mac/node_modules/atomic-cli-mac-data/package.json

@@ -0,0 +1,22 @@
+{
+  "description": "Mac data for atomic-cli-mac package",
+  "engines": {
+    "node": ">=0.8.0"
+  },
+  "homepage": "http://www.AtomicGameEngine.com",
+  "files": [
+    "data"
+  ],
+  "main": "./index.js",
+  "name": "atomic-cli-mac-data",
+  "version": "0.0.1",
+  "os": [
+    "darwin"
+  ],
+  "readme": "ERROR: No README data found!",
+  "_id": "[email protected]",
+  "scripts": {},
+  "_shasum": "eeaecf9004ed31d645c5cad559f845f57c594915",
+  "_from": "atomic-cli-mac-data",
+  "_resolved": "file:atomic-cli-mac-data"
+}

+ 2 - 1
CLI/atomic-cli-mac/package.json

@@ -8,6 +8,7 @@
     "url": "https://github.com/AtomicGameEngine/AtomicGameEngine/issues"
   },
   "dependencies": {
+    "atomic-cli-mac-data" : "file:atomic-cli-mac-data"    
   },
   "description": "Mac dependencies for atomic-cli package",
   "engines": {
@@ -23,6 +24,6 @@
   "name": "atomic-cli-mac",
   "preferGlobal": true,
   "repository": "https://github.com/AtomicGameEngine/AtomicGameEngine",
-  "version": "0.0.0",
+  "version": "0.0.1",
   "os" : ["darwin"]
 }

+ 4 - 0
CLI/atomic-cli/Notes.txt

@@ -0,0 +1,4 @@
+
+atomic-cli
+  optional os specific package
+    tarball data package

+ 63 - 0
CLI/atomic-cli/bin/atomic-cli.js

@@ -0,0 +1,63 @@
+#!/usr/bin/env node
+"use strict";
+
+// https://github.com/yeoman/update-notifier
+
+// https://github.com/tj/commander.js
+var path = require("path");
+var program = require('commander');
+var cli = require("atomic-cli")
+
+
+
+program
+  .version('0.0.1')
+  .parse(process.argv);
+
+// new project command
+program
+  .command('new <folder>')
+  .description('creates a new project in the specified folder')
+  .action(function(folder){
+    cli.newProject(folder)
+    .then(function () {
+        console.log("New Atomic project created in " + path.resolve(folder));
+    })
+    .catch(function (error) {
+        console.error("Error: Could not create " + path.resolve(folder));
+        process.exit(1);
+    });
+
+  });
+
+program
+  .command('add <platform>')
+  .description('adds a platform to the project')
+  .action(function(platform){
+    cli.addPlatform(platform)
+    .then(function () {
+    })
+    .catch(function (error) {
+        process.exit(1);
+    });
+
+  });
+
+
+program
+  .command('run <platform> [no-build]')
+  .description('runs the project on a specified platform')
+  .action(function(platform){
+    cli.run(platform)
+    .then(function () {
+    })
+    .catch(function (error) {
+        process.exit(1);
+    });
+
+  });
+
+
+  program.parse(process.argv);
+
+  if (!program.args.length) program.help();

+ 0 - 0
CLI/atomic-cli/lib/atomicdata.js


+ 0 - 0
CLI/atomic-cli/lib/atomiceditor.js


+ 104 - 0
CLI/atomic-cli/lib/atomictool.js

@@ -0,0 +1,104 @@
+
+var Q = require("q");
+var fs = require("fs");
+var os = require("os");
+var path = require("path");
+var spawn = require("child_process").spawn;
+
+var cli = require ("atomic-cli")
+
+try {
+  var platform_cli = require('atomic-cli-mac');
+}
+catch (e) {
+  console.log(e);
+}
+
+var mode = process.env.ATOMIC_GAME_ENGINE_ENV || 'production';
+if (mode == 'dev')
+  platform_cli.ATOMICTOOL_BIN = "/Users/josh/Dev/atomic/AtomicGameEngine-build/Source/AtomicTool/AtomicTool"
+
+// Commands ----------------------
+
+var newProject = function(folder) {
+  return atomictool(["new", folder], {output:true});
+}
+
+var addPlatform = function (platform) {
+  return atomictool(["platform-add", platform], {output:true});
+};
+
+var build = function (platform) {
+
+  console.log("building");
+  return atomictool(["build", platform], {output:true});
+};
+
+var run = function (platform, opts) {
+
+    opts = opts || {};
+    var debug = opts.debug;
+
+    var run = function () {
+
+        switch (platform) {
+
+        case "web":
+            var url = "http://localhost:" + HTTP_PORT + "/AtomicPlayer.html";
+            console.log("Launching: " + url);
+
+            var open = require("open");
+            open(url);
+            break;
+
+          case "mac":
+              var open = require("open");
+              open(path.resolve("Build/Mac-Build/AtomicPlayer.app"));
+              break;
+
+        }
+    };
+
+    return opts.noBuild ? run(platform) : build([platform], opts).then(function () {
+        return run();
+    });
+};
+
+
+// Utils --------------
+
+var exec = function (command, flags, opts) {
+    opts = opts || {};
+    if (opts.verbose !== false) {
+        console.log([command].concat(flags).join(" "));
+    }
+
+    var deferred = Q.defer();
+    var child = spawn(command, flags, {stdio: (opts.output === false) ? "ignore" : "inherit"});
+    child.on("close", function (code) {
+        if (code && opts.check !== false) {
+            deferred.reject();
+        }
+        deferred.resolve(code);
+    });
+    child.on("error", function (error) {
+        deferred.reject(error);
+    });
+    return deferred.promise;
+};
+
+
+var atomictool = function (flags, opts) {
+    opts = opts || {};
+    flags.unshift(platform_cli.ATOMICEDITOR_DATADIR);
+    flags.unshift("--cli-data-path");
+    return exec(platform_cli.ATOMICTOOL_BIN, flags, opts);
+};
+
+module.exports = {
+  "atomictool" : atomictool,
+  "newProject" : newProject,
+  "addPlatform" : addPlatform,
+  "build" : build,
+  "run" : run
+}

+ 15 - 0
CLI/atomic-cli/lib/main.js

@@ -0,0 +1,15 @@
+
+
+var mode = process.env.ATOMIC_GAME_ENGINE_ENV || 'production';
+
+var atomictool = require ("./atomictool.js");
+
+module.exports = {
+
+  "mode" : mode,
+  "newProject" : atomictool.newProject,
+  "addPlatform" : atomictool.addPlatform,
+  "build" : atomictool.build,
+  "run" : atomictool.run
+
+}

+ 9 - 15
CLI/atomic-cli/package.json

@@ -4,26 +4,19 @@
     "name": "Atomic Game Engine",
     "url": "http://www.AtomicGameEngine.com"
   },
-  "bin": { "atomic-cli" : "./cli.js" },
   "bugs": {
     "url": "https://github.com/AtomicGameEngine/AtomicGameEngine/issues"
   },
   "dependencies": {
-    "adm-zip": "~0.4.3",
-    "argparse": "~0.1.15",
-    "connect": "~2.8.3",
-    "js-yaml": "~2.1.0",
-    "ncp": "~0.4.2",
-    "open": "~0.0.3",
-    "q": "~0.9.6",
-    "watch": "~0.8.0",
-    "websocket": "~1.0.8",
-    "wrench": "~1.5.1",
-    "xmldom": "~0.1.16",
-    "httpreq": "*"
+    "q": "*",
+    "commander" : "*",
+    "update-notifier" : "*",
+    "open": "*"
+  },
+  "devDependencies" : {
   },
   "optionalDependencies" : {
-    "atomic-cli-mac" : "./atomic-cli-mac-disabled/"
+    "atomic-cli-mac" : "*"
   },
   "description": "CLI for the Atomic Game Engine",
   "engines": {
@@ -34,7 +27,8 @@
     "type": "Atomic Game Engine",
     "url": "https://github.com/AtomicGameEngine/AtomicGameEngine/blob/master/LICENSE.md"
   }],
-  "main": "index.js",
+  "bin": { "atomic-cli" : "./bin/atomic-cli.js" },
+  "main": "./lib/main.js",
   "name": "atomic-cli",
   "preferGlobal": true,
   "repository": "https://github.com/AtomicGameEngine/AtomicGameEngine",

+ 0 - 0
CLI/atomic-cli-mac/.gitignore → CLI/attic/atomic-cli-mac/.gitignore


+ 0 - 0
CLI/attic/atomic-cli-mac/.npmignore


+ 10 - 0
CLI/attic/atomic-cli-mac/index.js

@@ -0,0 +1,10 @@
+
+var PLATFORM_DATA_DIR = __dirname + "/data";
+var ATOMICTOOL_BIN = __dirname + "/bin/AtomicTool";
+var EDITOR_APPLICATION = __dirname + "/bin/editor/AtomicEditor.app/Contents/MacOS/AtomicEditor";
+var EDITOR_DATA_DIR = __dirname + "/bin/editor/AtomicEditor.app/Contents/Resources";
+
+exports.PLATFORM_DATA_DIR = PLATFORM_DATA_DIR;
+exports.EDITOR_APPLICATION = EDITOR_APPLICATION;
+exports.EDITOR_DATA_DIR = EDITOR_DATA_DIR;
+exports.ATOMICTOOL_BIN = ATOMICTOOL_BIN;

+ 28 - 0
CLI/attic/atomic-cli-mac/package.json

@@ -0,0 +1,28 @@
+{
+  "author": {
+    "email": "[email protected]",
+    "name": "Atomic Game Engine",
+    "url": "http://www.AtomicGameEngine.com"
+  },
+  "bugs": {
+    "url": "https://github.com/AtomicGameEngine/AtomicGameEngine/issues"
+  },
+  "dependencies": {
+  },
+  "description": "Mac dependencies for atomic-cli package",
+  "engines": {
+    "node": ">=0.8.0"
+  },
+  "homepage": "http://www.AtomicGameEngine.com",
+   "licenses": [{
+    "type": "Atomic Game Engine",
+    "url": "https://github.com/AtomicGameEngine/AtomicGameEngine/blob/master/LICENSE.md"
+  }],
+  "files" : ["bin"],
+  "main": "./index.js",
+  "name": "atomic-cli-mac",
+  "preferGlobal": true,
+  "repository": "https://github.com/AtomicGameEngine/AtomicGameEngine",
+  "version": "0.0.1",
+  "os" : ["darwin"]
+}

+ 1 - 0
CLI/attic/atomic-cli/.gitignore

@@ -0,0 +1 @@
+node_modules/*

+ 0 - 0
CLI/atomic-cli/README.md → CLI/attic/atomic-cli/README.md


+ 0 - 0
CLI/atomic-cli/cli.js → CLI/attic/atomic-cli/cli.js


+ 19 - 0
CLI/attic/atomic-cli/data/cdn.json

@@ -0,0 +1,19 @@
+{
+  "local" : {
+    "server" : "http://127.0.0.1",
+    "editor" : {
+      "version" : "0.2.1",
+      "mac" : "/cli-cdn/mac/atomic-editor"
+    },
+    "atomictool" : {
+      "version" : "0.2.1",
+      "mac" : "/cli-cdn/mac/atomic-tool"
+    }
+  },
+  "testing" : {
+
+  },
+  "production" : {
+
+  }
+}

+ 1 - 0
CLI/atomic-cli/index.js → CLI/attic/atomic-cli/index.js

@@ -87,6 +87,7 @@ exports.editor = function () {
 };
 
 exports.run = function (platform, opts) {
+  
     opts = opts || {};
     var debug = opts.debug;
 

+ 25 - 0
CLI/attic/atomic-cli/lib/cdn.js

@@ -0,0 +1,25 @@
+
+
+// CDN
+var cdnroot = JSON.parse(fs.readFileSync(__dirname + "/../data/cdn.json"))
+var branch;
+
+// TODO: otherwise we need to use the package data
+if (process.env.ATOMIC_DEV_LOCAL) {
+  branch = "local";
+}
+
+var cdn = cdnroot[branch]
+var cdnServer = cdn["server"];
+var cdnEditorVersion = cdn["editor"]["version"];
+var cdnAtomicToolVersion = cdn["atomictool"]["version"];
+
+var home = osenv.home();
+var atomicRootDir = home + "/.atomicgameengine/" + branch;
+
+// CDN url for editor
+var cdnEditorURL;
+
+if (process.platform == "darwin") {
+  cdnEditorURL = cdnServer + cdn["editor"] + "-" + cdnEditorVersion + ".zip";
+}

+ 45 - 0
CLI/attic/atomic-cli/package.json

@@ -0,0 +1,45 @@
+{
+  "author": {
+    "email": "[email protected]",
+    "name": "Atomic Game Engine",
+    "url": "http://www.AtomicGameEngine.com"
+  },
+  "bin": { "atomic-cli" : "./cli.js" },
+  "bugs": {
+    "url": "https://github.com/AtomicGameEngine/AtomicGameEngine/issues"
+  },
+  "dependencies": {
+    "adm-zip": "~0.4.3",
+    "argparse": "~0.1.15",
+    "connect": "~2.8.3",
+    "js-yaml": "~2.1.0",
+    "ncp": "~0.4.2",
+    "open": "~0.0.3",
+    "q": "~0.9.6",
+    "watch": "~0.8.0",
+    "websocket": "~1.0.8",
+    "wrench": "~1.5.1",
+    "xmldom": "~0.1.16",
+    "osenv" : "*",
+    "httpreq": "*",
+    "semver" : "*",
+    "mkdirp" : "*"
+  },
+  "description": "CLI for the Atomic Game Engine",
+  "engines": {
+    "node": ">=0.8.0"
+  },
+  "homepage": "http://www.AtomicGameEngine.com",
+   "licenses": [{
+    "type": "Atomic Game Engine",
+    "url": "https://github.com/AtomicGameEngine/AtomicGameEngine/blob/master/LICENSE.md"
+  }],
+  "files" : [
+    "data"
+  ],
+  "main": "index.js",
+  "name": "atomic-cli",
+  "preferGlobal": true,
+  "repository": "https://github.com/AtomicGameEngine/AtomicGameEngine",
+  "version": "0.2.4"
+}

+ 0 - 0
CLI/attic/atomic-cli/scripts/atomiccdn.js


+ 1 - 0
CLI/attic/atomic-cli/scripts/atomiceditor.js

@@ -0,0 +1 @@
+"use strict";

+ 65 - 0
CLI/attic/atomic-cli/scripts/postinstall.js

@@ -0,0 +1,65 @@
+"use strict";
+
+var fs = require("fs");
+var path = require('path');
+var osenv = require("osenv");
+var semver = require("semver")
+var mkdirp = require("mkdirp")
+var atomiceditor = require("./atomiceditor");
+var exists = fs.exists || path.exists;
+
+var mkdirSync = function (path) {
+
+  if (exists(path))
+    return;
+
+  mkdirp.sync(path);
+
+}
+
+var updateEditor = function() {
+
+}
+
+var editorUpdateRequired = function(path) {
+
+  if (!exists(path))
+    return true;
+
+  // JSON.parse(fs.readFileSync(path))
+  // console.log ( semver.major(semver.valid("2.0.0")));
+}
+
+// CDN
+var cdnroot = JSON.parse(fs.readFileSync(__dirname + "/../data/cdn.json"))
+var branch;
+
+// TODO: otherwise we need to use the package data
+if (process.env.ATOMIC_DEV_LOCAL) {
+  branch = "local";
+}
+
+var cdn = cdnroot[branch]
+var cdnServer = cdn["server"];
+var cdnEditorVersion = cdn["editor"]["version"];
+var cdnAtomicToolVersion = cdn["atomictool"]["version"];
+
+var home = osenv.home();
+var atomicRootDir = home + "/.atomicgameengine/" + branch;
+
+// CDN url for editor
+var cdnEditorURL;
+
+if (process.platform == "darwin") {
+  cdnEditorURL = cdnServer + cdn["editor"] + "-" + cdnEditorVersion + ".zip";
+}
+
+// ensure atomic's home exists
+mkdirSync(atomicRootDir);
+
+var editorUpdate = false;
+
+if (editorUpdateRequired(atomicRootDir)) {
+  editorUpdate = true;
+  console.log("Editor Update Required");
+}

+ 59 - 58
Rakefile

@@ -23,8 +23,8 @@ if $HOST_OS == "darwin"
   $QT_BIN_DIR = "#{ENV["QT_SDK"]}/bin"
 else
   $QT_BIN_DIR = "C:\\Qt\\5.4\\msvc2013_64\\bin"
-  QT_CREATOR_BIN_DIR = "C:\\Qt\\Tools\\QtCreator\\bin"  
-  ENV['PATH'] = "#{QT_CREATOR_BIN_DIR};" + ENV['PATH']    
+  QT_CREATOR_BIN_DIR = "C:\\Qt\\Tools\\QtCreator\\bin"
+  ENV['PATH'] = "#{QT_CREATOR_BIN_DIR};" + ENV['PATH']
 end
 
 
@@ -43,11 +43,11 @@ namespace :android  do
       sh "#{BUILD_FOLDER}/JSBind #{$RAKE_ROOT} ANDROID"
       sh "cmake -DCMAKE_TOOLCHAIN_FILE=#{$RAKE_ROOT}/CMake/Toolchains/android.toolchain.cmake -DCMAKE_BUILD_TYPE=Release ../../"
       sh "make -j8"
-    end 
-    
+    end
+
   end
 
-end  
+end
 
 namespace :ios do
 
@@ -63,11 +63,11 @@ namespace :ios do
       sh "#{BUILD_FOLDER}/JSBind #{$RAKE_ROOT} IOS"
       sh "cmake -DIOS=1 -DCMAKE_BUILD_TYPE=Release -G Xcode ../../"
       sh "xcodebuild -configuration Release"
-    end 
-    
+    end
+
   end
 
-end  
+end
 
 
 namespace :web do
@@ -84,7 +84,7 @@ namespace :web do
       sh "#{BUILD_FOLDER}/JSBind #{$RAKE_ROOT} WEB"
       sh "cmake -DEMSCRIPTEN=1 -DATOMIC_BUILD_2D=1 -DCMAKE_TOOLCHAIN_FILE=#{$RAKE_ROOT}/CMake/Toolchains/emscripten.toolchain.cmake -DCMAKE_BUILD_TYPE=Release ../../"
       sh "make -j8"
-    end 
+    end
 
     Dir.chdir("#{CMAKE_WEB_BUILD_FOLDER}/Source/AtomicPlayer") do
       sh "mv AtomicPlayer AtomicPlayer.bc"
@@ -93,24 +93,24 @@ namespace :web do
 
   end
 
-end  
+end
 
 
 namespace :macosx do
 
-  
+
   CMAKE_MACOSX_BUILD_FOLDER = "#{ARTIFACTS_FOLDER}/MacOSX_Build"
   MACOSX_PACKAGE_FOLDER = "#{ARTIFACTS_FOLDER}/MacOSX_Package"
 
   task :clean do
 
     folders = ["#{CMAKE_MACOSX_BUILD_FOLDER}", "#{MACOSX_PACKAGE_FOLDER}",
-               "#{ARTIFACTS_FOLDER}/Android_Build", "#{ARTIFACTS_FOLDER}/Web_Build",  
+               "#{ARTIFACTS_FOLDER}/Android_Build", "#{ARTIFACTS_FOLDER}/Web_Build",
                "#{ARTIFACTS_FOLDER}/AtomicExamples", "#{ARTIFACTS_FOLDER}/Docs",
                "#{ARTIFACTS_FOLDER}/Examples",  "#{ARTIFACTS_FOLDER}/AtomicTiled_Build",
                "#{ARTIFACTS_FOLDER}/IOS_Build", "#{ARTIFACTS_FOLDER}/IOSDeploy_Build"]
 
-    for index in 0 ... folders.size    
+    for index in 0 ... folders.size
 
         if Dir.exists?(folders[index])
             puts "rm -rf #{folders[index]}"
@@ -120,8 +120,8 @@ namespace :macosx do
         if Dir.exists?(folders[index])
             abort("Unable to clean #{folders[index]}")
         end
-    
-    end           
+
+    end
 
   end
 
@@ -131,7 +131,7 @@ namespace :macosx do
 
     Dir.chdir(CMAKE_MACOSX_BUILD_FOLDER) do
       sh "cmake ../../ -DCMAKE_BUILD_TYPE=Release"
-    end 
+    end
 
 	end
 
@@ -142,7 +142,7 @@ namespace :macosx do
       sh "cp ./Source/AtomicJS/JSBind/JSBind #{BUILD_FOLDER}/JSBind"
     end
 
-  end 
+  end
 
 	task :generate_javascript_bindings => "macosx:jsbind" do
 
@@ -165,7 +165,7 @@ namespace :macosx do
       sh "cp -r out #{ARTIFACTS_FOLDER}/Docs"
     end
 
-  end  
+  end
 
   task :generate_examples do
 
@@ -182,14 +182,14 @@ namespace :macosx do
       sh "mkdir Examples"
 
       sh "git clone https://github.com/AtomicGameEngine/AtomicExamples"
-      
+
       Dir.chdir("AtomicExamples") do
         sh "git archive master | tar -x -C #{ARTIFACTS_FOLDER}/Examples"
       end
 
     end
 
-  end  
+  end
 
 	task :player => "macosx:generate_javascript_bindings" do
 
@@ -204,17 +204,17 @@ namespace :macosx do
   task :editor => ["macosx:player"] do
 
     Dir.chdir(CMAKE_MACOSX_BUILD_FOLDER) do
-      
+
       sh "make -j8 BuildEditorFiles"
 
     end
 
   end
 
-  task :cli => ["macosx:player", "macosx:editor"] do
+  task :atomictool => ["macosx:player", "macosx:editor"] do
 
     Dir.chdir(CMAKE_MACOSX_BUILD_FOLDER) do
-      
+
       sh "make -j8 AtomicTool"
 
     end
@@ -232,16 +232,17 @@ namespace :package do
                           'ios:player',
                           "atomictiled:osx",
                           'macosx:editor',
-                          'macosx:generate_examples', 
+                          'macosx:atomictool',
+                          'macosx:generate_examples',
                           'macosx:generate_docs'] do
 
-      FileUtils.mkdir_p(MACOSX_PACKAGE_FOLDER)                    
+      FileUtils.mkdir_p(MACOSX_PACKAGE_FOLDER)
 
       MAC_PLAYER_APP_FOLDER_SRC = "#{CMAKE_MACOSX_BUILD_FOLDER}/Source/AtomicPlayer/AtomicPlayer.app"
       MAC_EDITOR_APP_FOLDER_SRC = "#{CMAKE_MACOSX_BUILD_FOLDER}/Source/AtomicEditor/AtomicEditor.app"
 
       # Resources
-      COREDATA_FOLDER_SRC = "#{$RAKE_ROOT}/Data/AtomicPlayer/Resources/CoreData"    
+      COREDATA_FOLDER_SRC = "#{$RAKE_ROOT}/Data/AtomicPlayer/Resources/CoreData"
       EDITORRESOURCES_FOLDER_SRC = "#{$RAKE_ROOT}/Data/AtomicEditor/Resources/EditorData"
       EDITORAPPLICATIONDATA_FOLDER_SRC = "#{$RAKE_ROOT}/Data/AtomicEditor"
 
@@ -257,7 +258,7 @@ namespace :package do
       DOCS_FOLDER_SRC = "#{ARTIFACTS_FOLDER}/Docs"
 
       MAC_EDITOR_APP_FOLDER_DST = "#{MACOSX_PACKAGE_FOLDER}/AtomicEditor.app"
-      MAC_EDITOR_APP_RESOURCE_FOLDER_DST = "#{MACOSX_PACKAGE_FOLDER}/AtomicEditor.app/Contents/Resources"      
+      MAC_EDITOR_APP_RESOURCE_FOLDER_DST = "#{MACOSX_PACKAGE_FOLDER}/AtomicEditor.app/Contents/Resources"
 
       # Copy the Editor application
       sh "cp -r #{MAC_EDITOR_APP_FOLDER_SRC} #{MACOSX_PACKAGE_FOLDER}/AtomicEditor.app"
@@ -312,11 +313,13 @@ namespace :package do
 
       FileUtils.cp("#{CMAKE_IOSDEPLOY_BUILD_FOLDER}/ios-deploy", "#{APPLICATIONS_FOLDER_DST}/CommandLine/ios-deploy")
 
+      FileUtils.cp("#{CMAKE_MACOSX_BUILD_FOLDER}/Source/AtomicTool/AtomicTool", "#{APPLICATIONS_FOLDER_DST}/CommandLine/AtomicTool")
+
   end
 
   task :macosx_editor do
 
-    EDITOR_APP_FOLDER = "#{MACOSX_PACKAGE_FOLDER}/AtomicEditor.app" 
+    EDITOR_APP_FOLDER = "#{MACOSX_PACKAGE_FOLDER}/AtomicEditor.app"
     if (!File.file?("#{EDITOR_APP_FOLDER}/Contents/Resources/Deployment/Win64/AtomicPlayer.exe"))
       abort("Missing Windows player, please run rake package:windows_editor from Windows")
     end
@@ -325,30 +328,28 @@ namespace :package do
 
       if (File.file?("AtomicEditor_MacOSX.zip"))
         sh "rm AtomicEditor_MacOSX.zip"
-      end 
+      end
 
       if (File.file?("AtomicEditor_MacOSX.zip"))
         abort ("Couldn't remove editor")
-      end       
+      end
 
       sh "zip -r AtomicEditor_MacOSX.zip ./AtomicEditor.app"
       sh "zip -T AtomicEditor_MacOSX.zip"
 
     end
 
-
-
   end
 
 
-  task :windows_preflight => ['windows:clean', 
-                              'windows:editor', 
+  task :windows_preflight => ['windows:clean',
+                              'windows:editor',
                               'atomictiled:windows' ] do
-                          
+
 
     ATOMICBUILDBOX_SOURCE_DIR =  "#{$RAKE_ROOT}/../AtomicBuildBox/Windows/x64"
-    EDITOR_APP_FOLDER_DST = "#{WINDOWS_PACKAGE_FOLDER}/AtomicEditor" 
-    
+    EDITOR_APP_FOLDER_DST = "#{WINDOWS_PACKAGE_FOLDER}/AtomicEditor"
+
     FileUtils.mkdir_p(EDITOR_APP_FOLDER_DST)
 
     PLAYER_APP_EXE_SRC = "#{CMAKE_WINDOWS_BUILD_FOLDER}/Source/AtomicPlayer/AtomicPlayer.exe"
@@ -357,7 +358,7 @@ namespace :package do
     DEPLOYMENT_FOLDER = "#{EDITOR_APP_FOLDER_DST}/Deployment/Win64"
 
     # Resources
-    COREDATA_FOLDER_SRC = "#{$RAKE_ROOT}/Data/AtomicPlayer/Resources/CoreData"    
+    COREDATA_FOLDER_SRC = "#{$RAKE_ROOT}/Data/AtomicPlayer/Resources/CoreData"
     EDITORRESOURCES_FOLDER_SRC = "#{$RAKE_ROOT}/Data/AtomicEditor/Resources/EditorData"
     EDITORAPPLICATIONDATA_FOLDER_SRC = "#{$RAKE_ROOT}/Data/AtomicEditor"
 
@@ -366,14 +367,14 @@ namespace :package do
 
     #Examples
     #Example info could possibly go in the AtomicExamples repo
-    EXAMPLEINFO_FOLDER_SRC = "#{EDITORAPPLICATIONDATA_FOLDER_SRC}/ExampleInfo"    
-    
+    EXAMPLEINFO_FOLDER_SRC = "#{EDITORAPPLICATIONDATA_FOLDER_SRC}/ExampleInfo"
+
     FileUtils.cp_r("#{COREDATA_FOLDER_SRC}", "#{EDITOR_APP_FOLDER_DST}/CoreData")
     FileUtils.cp_r("#{EDITORRESOURCES_FOLDER_SRC}", "#{EDITOR_APP_FOLDER_DST}/EditorData")
 
     FileUtils.cp_r("#{PROJECTTEMPLATES_FOLDER_SRC}", "#{EDITOR_APP_FOLDER_DST}/ProjectTemplates")
     FileUtils.cp_r("#{EXAMPLEINFO_FOLDER_SRC}", "#{EDITOR_APP_FOLDER_DST}/ExampleInfo")
-    
+
     FileUtils.mkdir_p("#{DEPLOYMENT_FOLDER}")
     FileUtils.cp("#{ATOMICBUILDBOX_SOURCE_DIR}/D3DCompiler_47.dll", "#{DEPLOYMENT_FOLDER}/D3DCompiler_47.dll")
     FileUtils.cp("#{PLAYER_APP_EXE_SRC}", "#{DEPLOYMENT_FOLDER}/AtomicPlayer.exe")
@@ -388,7 +389,7 @@ namespace :package do
     FileUtils.cp("#{ATOMICTILED_BUILD_DIR}/tiled.exe", "#{ATOMICTILED_DEPLOYED_DIR}")
     FileUtils.cp("#{ATOMICTILED_BUILD_DIR}/tiled.dll", "#{ATOMICTILED_DEPLOYED_DIR}")
 
-    ENV['PATH'] = "#{$QT_BIN_DIR};" + ENV['PATH'] 
+    ENV['PATH'] = "#{$QT_BIN_DIR};" + ENV['PATH']
     Dir.chdir(ATOMICTILED_DEPLOYED_DIR) do
       sh "windeployqt.exe --release #{ATOMICTILED_DEPLOYED_DIR}/tiled.exe"
       FileUtils.cp("#{ATOMICBUILDBOX_SOURCE_DIR}/msvcp120.dll", "#{ATOMICTILED_DEPLOYED_DIR}/msvcp120.dll")
@@ -407,13 +408,13 @@ namespace :package do
 
       if (File.exists?("AtomicEditor_Windows.zip"))
         FileUtils.rm("AtomicEditor_Windows.zip")
-      end 
+      end
 
       if (File.exists?("AtomicEditor_Windows.zip"))
         abort("Unable to remove AtomicEditor_Windows.zip")
-      end 
- 
-    end  
+      end
+
+    end
 
     DEPLOYMENT_FOLDER = "#{EDITOR_APP_FOLDER_DST}/Deployment"
     FileUtils.cp_r("#{MAC_ARTIFACTS_SRC}/Deployment/Android", "#{EDITOR_APP_FOLDER_DST}/Deployment/Android")
@@ -435,7 +436,7 @@ namespace :package do
       sh "\"C:\\Program Files\\7-Zip\\7z.exe\" a -tzip AtomicEditor_Windows.zip AtomicEditor"
       sh "\"C:\\Program Files\\7-Zip\\7z.exe\" t AtomicEditor_Windows.zip"
 
-    end  
+    end
 
   end
 
@@ -454,17 +455,17 @@ namespace :windows do
                "#{ARTIFACTS_FOLDER}/AtomicExamples", "#{ARTIFACTS_FOLDER}/Docs",
                "#{ARTIFACTS_FOLDER}/Examples",  "#{ARTIFACTS_FOLDER}/AtomicTiled_Build"]
 
-    for index in 0 ... folders.size    
+    for index in 0 ... folders.size
 
         if Dir.exists?(folders[index])
-            FileUtils.rmtree(folders[index])          
+            FileUtils.rmtree(folders[index])
         end
 
         if Dir.exists?(folders[index])
             abort("Unable to clean #{folders[index]}")
         end
-    
-    end           
+
+    end
 
   end
 
@@ -474,7 +475,7 @@ namespace :windows do
 
     Dir.chdir(CMAKE_WINDOWS_BUILD_FOLDER) do
       sh "cmake ../../ -G\"NMake Makefiles JOM\" -DCMAKE_BUILD_TYPE=Release"
-    end 
+    end
 
 	end
 
@@ -500,7 +501,7 @@ namespace :windows do
   task :editor => "windows:player" do
 
     Dir.chdir(CMAKE_WINDOWS_BUILD_FOLDER) do
-      
+
       sh "jom -j4 AtomicEditor"
 
     end
@@ -514,26 +515,26 @@ task :iosdeploy do
   CMAKE_IOSDEPLOY_BUILD_FOLDER = "#{ARTIFACTS_FOLDER}/ios-deploy"
 
   if Dir.exists?(CMAKE_IOSDEPLOY_BUILD_FOLDER)
-      FileUtils.rmtree(CMAKE_IOSDEPLOY_BUILD_FOLDER)          
+      FileUtils.rmtree(CMAKE_IOSDEPLOY_BUILD_FOLDER)
   end
 
   Dir.chdir("#{ARTIFACTS_FOLDER}") do
 
     sh "git clone https://github.com/AtomicGameEngine/ios-deploy"
-    
+
     Dir.chdir("ios-deploy") do
       sh "make"
     end
 
   end
 
-end  
+end
 
 namespace :atomictiled do
 
   task :windows do
 
-    ENV['PATH'] = "#{$QT_BIN_DIR};" + ENV['PATH']    
+    ENV['PATH'] = "#{$QT_BIN_DIR};" + ENV['PATH']
 
     FileUtils.mkdir_p(ATOMICTILED_BUILD_DIR)
 
@@ -556,4 +557,4 @@ namespace :atomictiled do
   end
 
 
-end
+end

+ 1 - 1
Source/ToolCore/Command/NewProjectCmd.cpp

@@ -57,7 +57,7 @@ void NewProjectCmd::Run()
 
     ToolSystem* tsystem = GetSubsystem<ToolSystem>();
     String templateDir = tsystem->GetDataPath();
-    templateDir += "/Atomic/ProjectTemplates/Project2D/Resources";
+    templateDir += "ProjectTemplates/Project2D/Resources";
 
     Poco::File projectSrc(templateDir.CString());
     if (!projectSrc.exists() || !projectSrc.isDirectory())