Skip to content

Commit

Permalink
Atomic C# iOS
Browse files Browse the repository at this point in the history
Squashed commits:
[82410ba] Updating Linux Build
[38113c5] Build updates for Windows
[9024b32] Handle iOS AtomicNET reference on binary editor
[6a2b2d6] Map to AnyCPU for iPhone libraries, which aren't executables
[1f9bc0f] ./Build_AtomicEditor.sh --with-ios --with-android working on Mac
[1807791] Running on iOS
[10a6d4f] WIP Atomic C# iOS support
  • Loading branch information
JoshEngebretson committed Sep 13, 2016
1 parent 64c3dd2 commit 1ec8f10
Show file tree
Hide file tree
Showing 40 changed files with 1,497 additions and 373 deletions.
58 changes: 58 additions & 0 deletions Build/CMake/IOS/AtomicNET.framework.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleIdentifier</key>
<string>com.atomicgameengine.atomicnetframework</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>Mono</string>
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>3.12</string>
<key>NSPrincipalClass</key>
<string></string>
<key>CFBundleExecutable</key>
<string>AtomicNETNative</string>

<key>BuildMachineOSBuild</key>
<string>13F34</string>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleSupportedPlatforms</key>
<array>
<string>iPhoneOS</string>
</array>
<key>DTCompiler</key>
<string>com.apple.compilers.llvm.clang.1_0</string>
<key>DTPlatformBuild</key>
<string>12D508</string>
<key>DTPlatformName</key>
<string>iphoneos</string>
<key>DTPlatformVersion</key>
<string>8.2</string>
<key>DTSDKBuild</key>
<string>12D508</string>
<key>DTSDKName</key>
<string>iphoneos8.2</string>
<key>DTXcode</key>
<string>0620</string>
<key>DTXcodeBuild</key>
<string>6C131e</string>
<key>MinimumOSVersion</key>
<string>8.0</string>
<key>UIDeviceFamily</key>
<array>
<integer>1</integer>
<integer>2</integer>
</array>
</dict>
</plist>
60 changes: 60 additions & 0 deletions Build/Scripts/Bootstrap.js
Original file line number Diff line number Diff line change
@@ -1 +1,61 @@

var os = require('os');

// Parse args
var options = require('./Minimist')(process.argv.slice(2));
var cmd = options._[0];

// Load `jake` global
require('../node_modules/jake/lib/jake');

// Load jake tasks, etc
var host = require('./Host');

// Make options availabe to host
host.options = options;

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("--------------------------")

process.exit(0);
}

if (options["help"]) {
printHelp();
}

// Atomic Editor Build
if (cmd == "buildeditor") {

console.log("\n\nBuilding Atomic Editor, this process will take a few minutes\n");

var buildTask = jake.Task['build:atomiceditor'];

if (options["with-android"]) {

if (!process.env.ANDROID_NDK) {
console.log("\nANDROID_NDK environment variable not set, exiting\n");
process.exit(1);
}
}

if (options["with-ios"]) {

if (os.platform() != "darwin") {
console.log("\niOS platform requires macOS, exiting\n");
process.exit(1);
}
}

buildTask.invoke();

}
21 changes: 13 additions & 8 deletions Build/Scripts/BuildAndroid.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ var fs = require('fs-extra');
var path = require("path");
var host = require("./Host");
var os = require('os');
var atomicRoot = host.atomicRoot;

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

namespace('build', function() {
Expand All @@ -12,34 +12,39 @@ namespace('build', function() {
async: true
}, function() {

// Clean build
common.cleanCreateDir(buildDir);
var options = host.options;
var cleanBuild = options["noclean"] ? false : true;
var debug = options["debug"] ? true : false;
var config = debug ? "Debug" : "Release";


host.setupDirs(cleanBuild, [buildDir]);

process.chdir(buildDir);

var cmds = [];

if (os.platform() == "win32") {
cmds.push(atomicRoot + "Build/Scripts/Windows/CompileAndroid.bat");
cmds.push(atomicRoot + "Build/Scripts/Windows/CompileAndroid.bat " + config);
}
else {
cmds.push("cmake -G \"Unix Makefiles\" -DCMAKE_TOOLCHAIN_FILE=../../../Build/CMake/Toolchains/android.toolchain.cmake -DCMAKE_BUILD_TYPE=Release ../../../");
cmds.push("cmake -G \"Unix Makefiles\" -DCMAKE_TOOLCHAIN_FILE=../../../Build/CMake/Toolchains/android.toolchain.cmake -DCMAKE_BUILD_TYPE=" + config + " ../../../");
cmds.push("make -j4");
}

jake.exec(cmds, function() {

var editorAppFolder = host.artifactsRoot + (os.platform() == "win32" ? "AtomicEditor/" : "AtomicEditor/AtomicEditor.app/");
var editorResourceFolder = host.artifactsRoot + (os.platform() == "win32" ? "AtomicEditor/Resources/" : "AtomicEditor/AtomicEditor.app/Contents/Resources/");

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

complete();

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

});
Expand Down
44 changes: 44 additions & 0 deletions Build/Scripts/BuildAtomicNET.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
var fs = require('fs-extra');
var path = require("path");
var host = require("./Host");
var os = require('os');
var atomicRoot = host.atomicRoot;

namespace('build', function() {

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

var options = host.options;

var android = options["with-android"] ? true : false;
var ios = options["with-ios"] ? true : false;
var debug = options["debug"] ? true : false;

var cmds = [];

platforms = "-platform desktop";
if (android)
platforms += " -platform android";
if (ios)
platforms += " -platform ios";

var netCmd = host.atomicTool + " net compile " + atomicRoot + "Script/AtomicNET/AtomicNETProject.json " + platforms + " -config " + (debug ? "Debug" : "Release");

console.log(netCmd);

cmds.push(netCmd);

jake.exec(cmds, function() {

complete();

}, {
printStdout: true,
printStderr: true
});

});

}); // end of build namespace
48 changes: 48 additions & 0 deletions Build/Scripts/BuildIOS.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 os = require('os');

var atomicRoot = host.atomicRoot;
var buildDir = host.artifactsRoot + "Build/IOS/";

namespace('build', function() {

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

var options = host.options;
var cleanBuild = options["noclean"] ? false : true;
var debug = options["debug"] ? true : false;

var NETNativeSrcDir = buildDir + "Source/AtomicNET/NETNative/" + (debug ? "Debug" : "Release") + "-iphoneos/";
var NETNativeDestDir = host.artifactsRoot + "AtomicNET/" + (debug ? "Debug" : "Release") + "/Native/iOS/";

host.setupDirs(cleanBuild, [buildDir, NETNativeDestDir]);

process.chdir(buildDir);

var cmds = [];

cmds.push("cmake -DIOS=1 -DATOMIC_DEV_BUILD=0 -G Xcode ../../../");
cmds.push("xcodebuild -configuration " + (debug ? "Debug" : "Release") + " -parallelizeTargets -jobs 4");
//cmds.push("cd \"" + NETNativeSrcDir + "\" && install_name_tool -id @rpath/AtomicNETNative.framework/AtomicNETNative AtomicNETNative.framework/AtomicNETNative");
//cmds.push("cd \"" + NETNativeSrcDir + "\" && codesign --deep --force --verify --sign \"iPhone Developer\" ./AtomicNETNative.framework/");
cmds.push("cd \"" + NETNativeSrcDir + "\" && zip -r AtomicNETNative.framework.zip AtomicNETNative.framework");

jake.exec(cmds, function() {

fs.copySync(NETNativeSrcDir + "AtomicNETNative.framework", NETNativeDestDir + "AtomicNETNative.framework");
fs.copySync(NETNativeSrcDir + "AtomicNETNative.framework.zip", NETNativeDestDir + "AtomicNETNative.framework.zip");

complete();

}, {
printStdout: true,
printStderr: true
});

});

}); // end of build namespace
Loading

0 comments on commit 1ec8f10

Please sign in to comment.