Skip to content

Commit

Permalink
Windows redistributable editor build with android deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshEngebretson committed Nov 2, 2015
1 parent 80e9a3c commit 732c1df
Show file tree
Hide file tree
Showing 26 changed files with 936 additions and 831 deletions.
4 changes: 2 additions & 2 deletions Build/CIScripts/GenEditorData.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ namespace('build', function() {

console.log("Generating Examples & JSDocs");

fs.copySync(atomicRoot + "/Docs/Readme.md", jsDocFolder + "/Readme.md");
fs.copySync(atomicRoot + "/Docs/jsdoc.conf", jsDocFolder + "/jsdoc.conf");
fs.copySync(atomicRoot + "Build/Docs/Readme.md", jsDocFolder + "/Readme.md");
fs.copySync(atomicRoot + "Build/Docs/jsdoc.conf", jsDocFolder + "/jsdoc.conf");

cmds = [
"git clone https://github.com/AtomicGameEngine/AtomicExamples " + buildDir + "AtomicExamples && rm -rf " + buildDir + "AtomicExamples/.git",
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
48 changes: 48 additions & 0 deletions Build/Scripts/BuildAndroid.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
var fs = require('fs-extra');
var path = require("path");
var host = require("./Host");
var atomicRoot = host.atomicRoot;

var buildDir = host.artifactsRoot + "Build/Android/";
var editorAppFolder = host.artifactsRoot + "AtomicEditor/";

namespace('build', function() {

task('android_player', ["build:atomiceditor"], {
async: true
}, function() {

// Clean build
common.cleanCreateDir(buildDir);

process.chdir(buildDir);

var cmds = [];

// Generate bindings for each script package
var scriptPackages = ["Atomic", "AtomicPlayer"];
var bindCmd = host.atomicTool + " bind \"" + atomicRoot + "\" ";

for (var i in scriptPackages) {
cmds.push(bindCmd + "Script/Packages/" + scriptPackages[i] + "/ ANDROID")
}

// Build the Android Player
cmds.push(atomicRoot + "Build/Scripts/Windows/CompileAndroid.bat");

jake.exec(cmds, function() {

// Install Deployment
fs.copySync(buildDir + "Source/AtomicPlayer/Application/libAtomicPlayer.so",
editorAppFolder + "Resources/ToolData/Deployment/Android/libs/armeabi-v7a/libAtomicPlayer.so");

complete();

}, {
printStdout: true,
breakOnError : false
});

});

}); // end of build namespace
Empty file added Build/Scripts/BuildMac.js
Empty file.
67 changes: 67 additions & 0 deletions Build/Scripts/BuildWindows.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
var fs = require('fs-extra');
var path = require("path");
var host = require("./Host");
var atomicRoot = host.atomicRoot;

var buildDir = host.artifactsRoot + "Build/Windows/";
var editorAppFolder = host.artifactsRoot + "AtomicEditor/";

namespace('build', function() {

task('atomiceditor', {
async: true
}, function() {

// Clean build
common.cleanCreateDir(buildDir);
common.cleanCreateDir(editorAppFolder);

process.chdir(buildDir);

var cmds = [];

// Build the AtomicTool
cmds.push(atomicRoot + "Build/Scripts/Windows/CompileAtomicTool.bat");

// Generate bindings for each script package

var scriptPackages = host.getScriptPackages();
var bindCmd = host.atomicTool + " bind \"" + atomicRoot + "\" ";

for (var i in scriptPackages) {
cmds.push(bindCmd + "Script/Packages/" + scriptPackages[i] + "/ WINDOWS")
}

// Build the AtomicEditor
cmds.push(atomicRoot + "Build/Scripts/Windows/CompileAtomicEditor.bat");

jake.exec(cmds, function() {

// Copy the Editor binaries
fs.copySync(buildDir + "Source/AtomicEditor/Release/AtomicEditor.exe",
host.artifactsRoot + "AtomicEditor/AtomicEditor.exe");
fs.copySync(buildDir + "Source/AtomicEditor/Release/D3DCompiler_47.dll",
host.artifactsRoot + "AtomicEditor/D3DCompiler_47.dll");

// We need some resources to run
fs.copySync(atomicRoot + "Resources/CoreData",
editorAppFolder + "Resources/CoreData");

fs.copySync(atomicRoot + "Resources/EditorData",
editorAppFolder + "Resources/EditorData");

fs.copySync(atomicRoot + "Resources/PlayerData",
editorAppFolder + "Resources/PlayerData");

fs.copySync(atomicRoot + "Data/AtomicEditor",
editorAppFolder + "Resources/ToolData");

complete();

}, {
printStdout: true
});

});

}); // end of build namespace
2 changes: 2 additions & 0 deletions Build/Scripts/Host.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ var os = require('os');

if (os.platform() == "win32") {
module.exports = require("./HostWindows");
require("./BuildWindows");
require("./BuildAndroid");
} else if (os.platform() == "darwin") {
module.exports = require("./HostMac");
}
10 changes: 10 additions & 0 deletions Build/Scripts/HostCommon.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,15 @@ process.env.NODE_PATH = atomicRoot + "Build/node_modules/";
require('module').Module._initPaths();
var fs = require('fs-extra');

function getScriptPackages() {

var srcpath = atomicRoot + "Script/Packages/";

return fs.readdirSync(srcpath).filter(function(file) {
return fs.statSync(path.join(srcpath, file)).isDirectory();
});
}

function cleanCreateDir(directory) {

testRemoveDir(directory);
Expand Down Expand Up @@ -46,3 +55,4 @@ exports.artifactsRoot = atomicRoot + "Artifacts/";
exports.cleanCreateDir = cleanCreateDir;
exports.testCreateDir = testCreateDir;
exports.testRemoveDir = testRemoveDir;
exports.getScriptPackages = getScriptPackages;
2 changes: 1 addition & 1 deletion Build/Scripts/HostMac.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ var atomicToolBinary = buildDir + "Source/AtomicTool/Debug/AtomicTool";

namespace('build', function() {

task('atomic', {
task('atomiceditor', {
async: true
}, function() {

Expand Down
43 changes: 2 additions & 41 deletions Build/Scripts/HostWindows.js
Original file line number Diff line number Diff line change
@@ -1,44 +1,5 @@
common = require("./HostCommon");

// forward exports
var atomicRoot = exports.atomicRoot = common.atomicRoot;
var artifactsRoot = exports.artifactsRoot = common.artifactsRoot;
exports.cleanCreateDir = common.cleanCreateDir;

var buildDir = common.artifactsRoot + "Build/Windows/";

var atomicToolBinary = buildDir + "Source/AtomicTool/Release/AtomicTool.exe";

namespace('build', function() {

task('atomic', {
async: true
}, function() {

common.cleanCreateDir(buildDir);

process.chdir(buildDir);

var bindCmd = atomicToolBinary + " bind \"" + atomicRoot + "\" ";

var cmds = [
atomicRoot + "/Build/Scripts/Windows/CompileAtomicTool.bat",
bindCmd + "Script/Packages/Atomic/ WINDOWS",
bindCmd + "Script/Packages/AtomicPlayer/ WINDOWS",
bindCmd + "Script/Packages/ToolCore/ WINDOWS",
bindCmd + "Script/Packages/Editor/ WINDOWS",
bindCmd + "Script/Packages/AtomicNET/ WINDOWS",
atomicRoot + "/Build/Scripts/Windows/CompileAtomic.bat",
]

jake.exec(cmds, function() {

complete();

}, {
printStdout: true
});

});

}); // end of build namespace
exports = module.exports = common;
exports.atomicTool = exports.artifactsRoot + "Build/AtomicTool/AtomicTool.exe";
3 changes: 3 additions & 0 deletions Build/Scripts/Windows/CompileAndroid.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
SET PATH=%ANDROID_NDK%\prebuilt\windows\bin\;%PATH%
cmake -G "Unix Makefiles" -DCMAKE_TOOLCHAIN_FILE=../../../CMake/Toolchains/android.toolchain.cmake -DCMAKE_BUILD_TYPE=Release ../../../
%ANDROID_NDK%\prebuilt\windows\bin\make.exe -j4
3 changes: 0 additions & 3 deletions Build/Scripts/Windows/CompileAtomic.bat

This file was deleted.

3 changes: 3 additions & 0 deletions Build/Scripts/Windows/CompileAtomicEditor.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
call "%VS140COMNTOOLS%..\..\VC\bin\amd64\vcvars64.bat"
cmake ..\\..\\..\\ -DATOMIC_DEV_BUILD=0 -G "Visual Studio 14 2015 Win64"
msbuild /m Atomic.sln /t:AtomicEditor /t:AtomicPlayer /p:Configuration=Release /p:Platform=x64
2 changes: 1 addition & 1 deletion Build/Scripts/Windows/CompileAtomicTool.bat
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
call "%VS140COMNTOOLS%..\..\VC\bin\amd64\vcvars64.bat"
cmake ..\\..\\..\\ -DATOMIC_DEV_BUILD=1 -G "Visual Studio 14 2015 Win64"
cmake ..\\..\\..\\ -DATOMIC_DEV_BUILD=0 -G "Visual Studio 14 2015 Win64"
msbuild /m Atomic.sln /t:AtomicTool /p:Configuration=Release /p:Platform=x64
1 change: 0 additions & 1 deletion BuildAtomic.bat

This file was deleted.

1 change: 1 addition & 0 deletions Build_AtomicEditor.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Build\Windows\node\node.exe Build\node_modules\jake\bin\cli.js -f ./Build/Scripts/Bootstrap.js build:atomiceditor
2 changes: 1 addition & 1 deletion BuildAtomic.sh → Build_AtomicEditor.sh
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#!/bin/sh
./Build/Mac/node/node ./Build/node_modules/jake/bin/cli.js -f ./Build/Scripts/Bootstrap.js build:atomic
./Build/Mac/node/node ./Build/node_modules/jake/bin/cli.js -f ./Build/Scripts/Bootstrap.js build:atomiceditor
Empty file added Build_VS2015_Solution.bat
Empty file.
Empty file added Build_XCode_Workspace.sh
Empty file.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit 732c1df

Please sign in to comment.