From 80e9a3c9b775c34b37cdb7f967bf23aebbadcf6a Mon Sep 17 00:00:00 2001 From: Josh Engebretson Date: Sat, 31 Oct 2015 07:39:10 -0700 Subject: [PATCH] Working on build cleanups --- Bin/.gitkeep | 0 Build/Scripts/Host.js | 2 + Build/Scripts/HostMac.js | 51 +++ BuildAtomic.sh | 2 +- Jakefile | 658 ----------------------------- Rakefile | 256 ----------- Source/AtomicEditor/CMakeLists.txt | 30 -- Source/AtomicJS/CMakeLists.txt | 4 - 8 files changed, 54 insertions(+), 949 deletions(-) delete mode 100644 Bin/.gitkeep create mode 100644 Build/Scripts/HostMac.js delete mode 100644 Jakefile delete mode 100644 Rakefile diff --git a/Bin/.gitkeep b/Bin/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/Build/Scripts/Host.js b/Build/Scripts/Host.js index 4d8c511870..301525a935 100644 --- a/Build/Scripts/Host.js +++ b/Build/Scripts/Host.js @@ -2,4 +2,6 @@ var os = require('os'); if (os.platform() == "win32") { module.exports = require("./HostWindows"); +} else if (os.platform() == "darwin") { + module.exports = require("./HostMac"); } diff --git a/Build/Scripts/HostMac.js b/Build/Scripts/HostMac.js new file mode 100644 index 0000000000..b961fc8d6d --- /dev/null +++ b/Build/Scripts/HostMac.js @@ -0,0 +1,51 @@ +var fs = require('fs-extra'); +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/Mac/"; +var atomicToolBinary = buildDir + "Source/AtomicTool/Debug/AtomicTool"; + +namespace('build', function() { + + task('atomic', { + async: true + }, function() { + + common.cleanCreateDir(buildDir); + + process.chdir(buildDir); + + var bindCmd = atomicToolBinary + " bind \"" + atomicRoot + "\" "; + + var cmds = [ + "cmake ../../../ -DATOMIC_DEV_BUILD=1 -G Xcode", + "xcodebuild -target AtomicTool -configuration Debug", + bindCmd + "Script/Packages/Atomic/ MACOSX", + bindCmd + "Script/Packages/AtomicPlayer/ MACOSX", + bindCmd + "Script/Packages/ToolCore/ MACOSX", + bindCmd + "Script/Packages/Editor/ MACOSX", + bindCmd + "Script/Packages/AtomicNET/ MACOSX", + atomicRoot + "Build/Mac/node/node " + atomicRoot + "Build/TypeScript/tsc.js -p " + atomicRoot + "./Script", + "cmake ../../../ -DATOMIC_DEV_BUILD=1 -G Xcode", + "xcodebuild -configuration Debug" + ] + + jake.exec(cmds, function() { + + fs.copySync(buildDir + "Source/AtomicEditor/Debug/AtomicEditor.app", artifactsRoot + "Bin/AtomicEditor.app"); + + complete(); + + console.log("AtomicEditor built to: " + artifactsRoot + "Bin/AtomicEditor.app"); + + }, { + printStdout: true + }); + + }); + +}); // end of build namespace diff --git a/BuildAtomic.sh b/BuildAtomic.sh index 7a46caa833..90cb49f34e 100755 --- a/BuildAtomic.sh +++ b/BuildAtomic.sh @@ -1,2 +1,2 @@ #!/bin/sh -./Build/Mac/node/node ./Build/node_modules/jake/bin/cli.js Jakefile package:macosx +./Build/Mac/node/node ./Build/node_modules/jake/bin/cli.js -f ./Build/Scripts/Bootstrap.js build:atomic diff --git a/Jakefile b/Jakefile deleted file mode 100644 index 7c94fba4fb..0000000000 --- a/Jakefile +++ /dev/null @@ -1,658 +0,0 @@ -// patch in our local node_modules -process.env.NODE_PATH = __dirname + "/Build/node_modules"; -require('module').Module._initPaths(); - -var fs = require('fs-extra'); -var path = require('path'); -var os = require('os'); - -var host = os.platform(); -var jakeRoot = __dirname; -var jenkinsBuild = process.env.ATOMIC_JENKINS_BUILD == 1; -var generateJSDoc = true; -var buildSHA = process.env.ATOMIC_BUILD_SHA; - -console.log("ATOMIC BUILD SHA is", buildSHA); - -var artifactsFolder = jakeRoot + "/Artifacts"; - -// cmake -var cmakeDevBuild = false; - -var includeDeployments = false;//jenkinsBuild; - -var deployments = { - osx: true, - android: true, - windows: true, - ios: true, - web: true -} - -// build folder -var windowsBuildFolder = artifactsFolder + "/Windows_Build"; -var macOSXBuildFolder = artifactsFolder + "/MacOSX_Build"; -var androidBuildFolder = artifactsFolder + "/Android_Build"; -var iosBuildFolder = artifactsFolder + "/IOS_Build"; -var iosDeployBuildFolder = artifactsFolder + "/ios-deploy"; -var webBuildFolder = artifactsFolder + "/Web_Build"; -var linuxBuildFolder = artifactsFolder + "/Linux_Build"; -var jsDocFolder = artifactsFolder + "/JSDoc"; -var atomicNETFolder = artifactsFolder + "/AtomicNET"; - -// binaries - -if (host == "darwin") { - var atomicToolBinary = macOSXBuildFolder + "/Source/AtomicTool/Release/AtomicTool" - var atomicEditorBinary = macOSXBuildFolder + "/Source/AtomicEditor/Release/AtomicEditor.app/Contents/MacOS/AtomicEditor" - var atomicPlayerBinary = macOSXBuildFolder + "/Source/AtomicPlayer/Application/Release/AtomicPlayer.app/Contents/MacOS/AtomicPlayer" -} else if (host == "win32") { - var atomicToolBinary = windowsBuildFolder + "/Source/AtomicTool/Release/AtomicTool.exe" - var atomicEditorBinary = windowsBuildFolder + "/Source/AtomicEditor/Release/AtomicEditor.exe" - var atomicPlayerBinary = windowsBuildFolder + "/Source/AtomicPlayer/Application/Release/AtomicPlayer.exe" -} - -// source files -var androidPlayerBinary = androidBuildFolder + "/Source/AtomicPlayer/Application/libAtomicPlayer.so"; -var iosPlayerBinary = iosBuildFolder + "/Source/AtomicPlayer/Application/Release-iphoneos/AtomicPlayer.app/AtomicPlayer" -var webPlayerBinary = webBuildFolder + "/Source/AtomicPlayer/Application/AtomicPlayer.js" -var webPlayerMemFile = webBuildFolder + "/Source/AtomicPlayer/Application/AtomicPlayer.html.mem" - -var allBuildFolders = [ - windowsBuildFolder, - macOSXBuildFolder, - androidBuildFolder, - iosBuildFolder, - iosDeployBuildFolder, - webBuildFolder, - linuxBuildFolder, - jsDocFolder, - atomicNETFolder -]; - -// packaging -var platformBinariesFolder = artifactsFolder + "/Platform_Binaries"; -var windowsPackageFolder = artifactsFolder + "/Windows_Package"; -var macOSXPackageFolder = artifactsFolder + "/MacOSX_Package"; -var distFolder = artifactsFolder + "/Dist"; - -var allPackageFolders = [ - windowsPackageFolder, - macOSXPackageFolder, - platformBinariesFolder, - distFolder -]; - -function getAtomicDevBuildDefine() { - - return "-DATOMIC_DEV_BUILD=" + (cmakeDevBuild ? "1" : "0"); - -} - -function testRemoveDir(path) { - - if (fs.existsSync(path)) { - jake.rmRf(path); - } - - if (fs.existsSync(path)) { - - throw "Unable to remove path: " + path; - - } -} - -namespace('clean', function() { - - task('all', { - async: true - }, function() { - - for (var i in allBuildFolders) { - testRemoveDir(allBuildFolders[i]); - } - - for (var i in allPackageFolders) { - testRemoveDir(allPackageFolders[i]); - } - - complete(); - - }); -}); - -namespace('build', function() { - - task('atomictool', { - async: true - }, function() { - - if (host == "darwin") { - - if (!fs.existsSync(macOSXBuildFolder)) { - jake.mkdirP(macOSXBuildFolder); - } - - var cmds = [ - 'cmake ../../ -G Xcode ' + getAtomicDevBuildDefine(), - 'xcodebuild -target AtomicTool -configuration Release' - ] - - process.chdir(macOSXBuildFolder); - - jake.exec(cmds, function() { - - fs.copySync(atomicToolBinary, platformBinariesFolder + "/MacOSX/" + path.basename(atomicToolBinary)); - console.log("Built MacOSX AtomicTool"); - complete(); - }, { - printStdout: true - }); - - } else { - - if (!fs.existsSync(windowsBuildFolder)) { - jake.mkdirP(windowsBuildFolder); - } - - process.chdir(windowsBuildFolder); - - jake.exec(jakeRoot + "/Build/Windows/CompileAtomicTool.bat", function() { - - fs.copySync(atomicToolBinary, platformBinariesFolder + "/Win32/" + path.basename(atomicToolBinary)); - console.log("Built Windows AtomicTool"); - complete(); - - }, { - printStdout: true - }); - - } - - }); // end build:atomictool - - var deps = []; - - if (includeDeployments) { - - if (host == 'darwin') { - - deps = ['atomictool']; - - if (deployments.ios) - deps.push("build:ios"); - - if (deployments.android) - deps.push("build:android"); - - if (deployments.web) - deps.push("build:web"); - - } - - } - - task('install_deployments', { - async: true - }, function() { - - console.log("Installing Deployments"); - - // deployment root for local dev builds - var deployRoot = jakeRoot + "/Data/AtomicEditor/Deployment"; - - if (host == "darwin") { - - if (deployments.osx) - fs.copySync(platformBinariesFolder + "/MacOSX/AtomicPlayer", deployRoot + "/MacOS/AtomicPlayer.app/Contents/MacOS/AtomicPlayer"); - - if (deployments.android) - fs.copySync(platformBinariesFolder + "/Android/libAtomicPlayer.so", deployRoot + "/Android/libs/armeabi-v7a/libAtomicPlayer.so"); - - if (deployments.ios) { - fs.copySync(artifactsFolder + "/ios-deploy/ios-deploy/ios-deploy", deployRoot + "/IOS/ios-deploy/ios-deploy"); - fs.copySync(platformBinariesFolder + "/IOS/AtomicPlayer", deployRoot + "/IOS/AtomicPlayer.app/AtomicPlayer"); - } - - if (deployments.web) { - fs.copySync(platformBinariesFolder + "/Web/AtomicPlayer.js", deployRoot + "/Web/AtomicPlayer.js"); - fs.copySync(platformBinariesFolder + "/Web/AtomicPlayer.html.mem", deployRoot + "/Web/AtomicPlayer.html.mem"); - } - - } else if (host == "win32") { - - if (deployments.windows) { - fs.copySync(platformBinariesFolder + "/Win32/AtomicPlayer.exe", deployRoot + "/Windows/x64/AtomicPlayer.exe"); - } - - } - - complete(); - - }); - - task('ios_deploy', { - async: true - }, function() { - - if (!fs.existsSync(iosDeployBuildFolder)) { - jake.mkdirP(iosDeployBuildFolder); - } - - process.chdir(iosDeployBuildFolder); - - if (!fs.existsSync(iosDeployBuildFolder + "/ios-deploy")) { - jake.exec("git clone https://github.com/AtomicGameEngine/ios-deploy && cd ios-deploy && make ios-deploy"); - } - - complete(); - - }); - - - task('macosx', deps, { - async: true - }, function() { - - if (!fs.existsSync(macOSXBuildFolder)) { - jake.mkdirP(macOSXBuildFolder); - } - - var cmds = [ - 'cmake ../../ -G Xcode ' + getAtomicDevBuildDefine(), - 'xcodebuild -configuration Release' - ] - - process.chdir(macOSXBuildFolder); - - jake.exec(cmds, function() { - fs.copySync(atomicEditorBinary, platformBinariesFolder + "/MacOSX/" + path.basename(atomicEditorBinary)); - fs.copySync(atomicPlayerBinary, platformBinariesFolder + "/MacOSX/" + path.basename(atomicPlayerBinary)); - - if (includeDeployments) { - jake.Task['build:install_deployments'].invoke(); - } - - console.log("Built MacOSX"); - complete(); - }, { - printStdout: true - }); - - }); // end build:macosx - - task('windows', { - async: true - }, function() { - - if (!fs.existsSync(windowsBuildFolder)) { - jake.mkdirP(windowsBuildFolder); - } - - process.chdir(windowsBuildFolder); - - jake.exec(jakeRoot + "/Build/Windows/Compile.bat", function() { - - fs.copySync(atomicEditorBinary, platformBinariesFolder + "/Win32/" + path.basename(atomicEditorBinary)); - fs.copySync(atomicPlayerBinary, platformBinariesFolder + "/Win32/" + path.basename(atomicPlayerBinary)); - - if (includeDeployments) { - jake.Task['build:install_deployments'].invoke(); - } - - complete(); - - }, { - printStdout: true - }); - - }); - - task('android', ['atomictool'], { - async: true - }, function() { - - if (!fs.existsSync(androidBuildFolder)) { - jake.mkdirP(androidBuildFolder); - } - - process.chdir(androidBuildFolder); - - var cmds = [ - atomicToolBinary + " bind " + jakeRoot + " Script/Packages/Atomic/ ANDROID", - atomicToolBinary + " bind " + jakeRoot + " Script/Packages/AtomicPlayer/ ANDROID" - ]; - - if (host == "darwin") { - - cmds.push("cmake -G \"Unix Makefiles\" -DCMAKE_TOOLCHAIN_FILE=" + jakeRoot + "/CMake/Toolchains/android.toolchain.cmake -DCMAKE_BUILD_TYPE=Release ../../"); - cmds.push("make -j4"); - - jake.exec(cmds, function() { - fs.copySync(androidPlayerBinary, platformBinariesFolder + "/Android/" + path.basename(androidPlayerBinary)); - console.log("Built Android Player"); - complete(); - }, { - printStdout: true - }); - } else { - - cmds.push(jakeRoot + "/Build/Windows/CompileAndroid.bat"); - - jake.exec(cmds, function() { - - fs.copySync(androidPlayerBinary, platformBinariesFolder + "/Android/" + path.basename(androidPlayerBinary)); - - // sneak this in here, need to sort deployments for local dev builds - var deployRoot = jakeRoot + "/Data/AtomicEditor/Deployment"; - fs.copySync(androidPlayerBinary, deployRoot + "/Android/libs/armeabi-v7a/libAtomicPlayer.so"); - - console.log("Built Android Player"); - complete(); - - }, { - printStdout: true - }); - - } - - }); - - task('ios', ['atomictool', 'ios_deploy'], { - async: true - }, function() { - - if (!fs.existsSync(iosBuildFolder)) { - jake.mkdirP(iosBuildFolder); - } - - process.chdir(iosBuildFolder); - - var cmds = [ - atomicToolBinary + " bind " + jakeRoot + " Script/Packages/Atomic/ IOS", - atomicToolBinary + " bind " + jakeRoot + " Script/Packages/AtomicPlayer/ IOS", - "cmake -DIOS=1 -G Xcode ../../" - ] - - if (jenkinsBuild) { - - cmds.push("security -v list-keychains -d system -s /Users/jenkins/Library/Keychains/codesign.keychain"); - cmds.push("security -v unlock-keychain /Users/jenkins/Library/Keychains/codesign.keychain"); - - } - - cmds.push("xcodebuild -configuration Release"); - - jake.exec(cmds, function() { - fs.copySync(iosPlayerBinary, platformBinariesFolder + "/IOS/" + path.basename(iosPlayerBinary)); - console.log("Built iOS Player"); - complete(); - }, { - printStdout: true - }); - - }); - - - task('web', ['atomictool'], { - async: true - }, function() { - - if (!fs.existsSync(webBuildFolder)) { - jake.mkdirP(webBuildFolder); - } - - process.chdir(webBuildFolder); - - var cmds = [ - atomicToolBinary + " bind " + jakeRoot + " Script/Packages/Atomic/ WEB", - atomicToolBinary + " bind " + jakeRoot + " Script/Packages/AtomicPlayer/ WEB", - "cmake -DEMSCRIPTEN=1 -DATOMIC_BUILD_2D=1 -DCMAKE_TOOLCHAIN_FILE=" + jakeRoot + "/CMake/Toolchains/emscripten.toolchain.cmake -DCMAKE_BUILD_TYPE=Release ../../", - "make -j4", - "cd ./Source/AtomicPlayer/Application && mv ./AtomicPlayer ./AtomicPlayer.bc && " + - // -s ERROR_ON_UNDEFINED_SYMBOLS=1 (disabled for pthread errors currently on incoming) - "emcc -O3 -s USE_PTHREADS=0 -s ASM_JS=1 -s VERBOSE=0 -s USE_SDL=2 -s TOTAL_MEMORY=134217728 -s AGGRESSIVE_VARIABLE_ELIMINATION=1 -s NO_EXIT_RUNTIME=1 ./AtomicPlayer.bc -o ./AtomicPlayer.html" - - ] - - jake.exec(cmds, function() { - fs.copySync(webPlayerBinary, platformBinariesFolder + "/Web/" + path.basename(webPlayerBinary)); - fs.copySync(webPlayerMemFile, platformBinariesFolder + "/Web/" + path.basename(webPlayerMemFile)); - console.log("Built Web Player"); - complete(); - }, { - printStdout: true - }); - - }); - - -}); // end build namespace - -namespace('package', function() { - - task('genjsdocs', { - async: true - }, function() { - - if (!jenkinsBuild || !generateJSDoc) { - complete(); - return; - } - - console.log("Generating JSDocs"); - - fs.copySync(jakeRoot + "/Docs/Readme.md", jsDocFolder + "/Readme.md"); - fs.copySync(jakeRoot + "/Docs/jsdoc.conf", jsDocFolder + "/jsdoc.conf"); - - cmds = ["cd " + jsDocFolder + " && npm install git+https://github.com/jsdoc3/jsdoc", - "cd " + jsDocFolder + " && git clone https://github.com/AtomicGameEngine/jaguarjs-jsdoc && cd jaguarjs-jsdoc && git checkout atomic_master", - "cd " + jsDocFolder + " && ./node_modules/.bin/jsdoc ./Atomic.js -t ./jaguarjs-jsdoc/ -c ./jsdoc.conf Readme.md", - ]; - - jake.exec(cmds, function() { - - complete(); - - }, { - printStdout: true - }); - - }); - - task('macosx', ['clean:all', 'build:macosx', 'package:genjsdocs'], function() { - - if (!fs.existsSync(distFolder)) { - jake.mkdirP(distFolder); - } - - jake.mkdirP(macOSXPackageFolder + "/AtomicEditor.app/Contents/Resources/"); - - var editorAppSourceFolder = macOSXBuildFolder + "/Source/AtomicEditor/Release/AtomicEditor.app"; - - fs.copySync(editorAppSourceFolder, macOSXPackageFolder + "/AtomicEditor.app"); - - // copy resources - - fs.copySync(jakeRoot + "/Resources/CoreData", macOSXPackageFolder + "/AtomicEditor.app/Contents/Resources/CoreData"); - fs.copySync(jakeRoot + "/Resources/EditorData", macOSXPackageFolder + "/AtomicEditor.app/Contents/Resources/EditorData"); - fs.copySync(jakeRoot + "/Resources/PlayerData", macOSXPackageFolder + "/AtomicEditor.app/Contents/Resources/PlayerData"); - - var toolDataDir = macOSXPackageFolder + "/AtomicEditor.app/Contents/Resources/ToolData/"; - - fs.copySync(jakeRoot + "/Data/AtomicEditor/", toolDataDir); - - if (jenkinsBuild) { - - console.log("Exporting AtomicExamples Repo (master) & Generating Dist"); - - if (generateJSDoc) { - - fs.copySync(jsDocFolder + "/out", toolDataDir + "Docs/JSDocs"); - - } - - cmds = ["git clone https://github.com/AtomicGameEngine/AtomicExamples " + toolDataDir + "AtomicExamples && rm -rf " + toolDataDir + "AtomicExamples/.git", - "cd " + macOSXPackageFolder + " && zip -r -X " + distFolder + "/AtomicEditor_MacOSX.zip ./AtomicEditor.app" - ]; - - jake.exec(cmds, function() {}); - } - - }); - - task('windows', ['clean:all', 'build:windows'], function() { - - if (!fs.existsSync(distFolder)) { - jake.mkdirP(distFolder); - } - - console.log("Packaging Windows Editor"); - - jake.mkdirP(windowsPackageFolder + "/Resources"); - - fs.copySync(windowsBuildFolder + "/Source/AtomicEditor/Release/AtomicEditor.exe", windowsPackageFolder + "/AtomicEditor.exe") - - // 64 bit build for packaging! - - fs.copySync(jakeRoot + "/Build/Windows/Binaries/x64/D3DCompiler_47.dll", windowsPackageFolder + "/D3DCompiler_47.dll") - - // copy resources - - fs.copySync(jakeRoot + "/Resources/CoreData", windowsPackageFolder + "/Resources/CoreData"); - fs.copySync(jakeRoot + "/Resources/EditorData", windowsPackageFolder + "/Resources/EditorData"); - fs.copySync(jakeRoot + "/Resources/PlayerData", windowsPackageFolder + "/Resources/PlayerData"); - fs.copySync(jakeRoot + "/Data/AtomicEditor/", windowsPackageFolder + "/Resources/ToolData"); - - // AtomicNET - // fs.copySync(jakeRoot + "/Submodules/CoreCLR/Windows/Release", windowsPackageFolder + "/Resources/AtomicNET/Windows/"); - // fs.copySync(jakeRoot + "/Artifacts/AtomicNET", windowsPackageFolder + "/Resources/AtomicNET/Windows/Atomic"); - - fs.copySync(jakeRoot + "/Build/Windows/Binaries/x86/D3DCompiler_47.dll", windowsPackageFolder + "/Resources/ToolData/Deployment/Windows/x86/D3DCompiler_47.dll"); - fs.copySync(jakeRoot + "/Build/Windows/Binaries/x64/D3DCompiler_47.dll", windowsPackageFolder + "/Resources/ToolData/Deployment/Windows/x64/D3DCompiler_47.dll"); - - if (jenkinsBuild) { - - var pfxFile = process.env.ATOMIC_PFX_FILE; - var pfxPW = process.env.ATOMIC_PFX_PW; - - var signCmd = "signtool.exe sign /f " + pfxFile; - signCmd += " /p " + pfxPW; - signCmd += " /t http://timestamp.verisign.com/scripts/timestamp.dll"; - signCmd += " /v " + windowsPackageFolder + "/AtomicEditor.exe"; - - var zipCmd = jakeRoot + "/Build/Windows/7z/7z.exe a -tzip " + distFolder + "/AtomicEditor_Windows.zip " + windowsPackageFolder; - - cmds = [signCmd, zipCmd]; - - jake.exec(cmds, function() {}); - - } - - }); - - task('create_windows_installer', [], function() { - - console.log("Unpacking Windows Editor"); - - var installerSourceFolder = distFolder + "/AtomicEditorInstallerSourceFiles"; - - if (!fs.existsSync(installerSourceFolder)) { - jake.mkdirP(installerSourceFolder); - } - - process.chdir(installerSourceFolder); - - var zipCmd = jakeRoot + "/Build/Windows/7z/7z.exe x " + jakeRoot + "/Artifacts/Windows_Package.zip" - - var cmds = [zipCmd]; - - jake.exec(cmds, function() { - - var nsisDefines = "/DATOMIC_ROOT=" + jakeRoot; - nsisDefines += " /DEDITOR_VERSION=1"; - - var makeNSISCmd = jakeRoot + "\\Build\\Windows\\CreateInstaller.bat"; - - makeNSISCmd += " " + nsisDefines + " " + jakeRoot + "/Build/Windows/Installer/AtomicEditor.nsi"; - - var pfxFile = process.env.ATOMIC_PFX_FILE; - var pfxPW = process.env.ATOMIC_PFX_PW; - - var signCmd = "signtool.exe sign /f " + pfxFile; - signCmd += " /p " + pfxPW; - signCmd += " /t http://timestamp.verisign.com/scripts/timestamp.dll"; - signCmd += " /v " + jakeRoot + "/Artifacts/Windows_Installer/AtomicEditorSetup.exe"; - - var cmds = [makeNSISCmd, signCmd]; - - console.log("Creating Windows Installer"); - - jake.exec(cmds, function() {}); - - }); - - }); - - // We have the windows and mac editors builds, now we need to merge them - task('merge_editor_data', [], function() { - - var mergeFolder = distFolder + "/EditorMerge"; - - if (!fs.existsSync(mergeFolder)) { - jake.mkdirP(mergeFolder); - } - - if (!fs.existsSync(mergeFolder + "/snapshots")) { - jake.mkdirP(mergeFolder + "/snapshots"); - } - - fs.copySync(distFolder + "/AtomicEditor_MacOSX.zip", mergeFolder + "/AtomicEditor_MacOSX.zip"); - fs.copySync(windowsPackageFolder + "/Artifacts/Dist/AtomicEditor_Windows.zip", mergeFolder + "/AtomicEditor_Windows.zip"); - - process.chdir(mergeFolder); - - cmds = ["unzip ./AtomicEditor_MacOSX.zip && unzip ./AtomicEditor_Windows.zip"] - - jake.exec(cmds, function() { - - var winRoot = mergeFolder + "/Windows_Package/Resources"; - var macRoot = mergeFolder + "/AtomicEditor.app/Contents/Resources"; - - var filenames = [ - "/ToolData/Deployment/Android/libs/armeabi-v7a/libAtomicPlayer.so", - "/ToolData/Deployment/MacOS/AtomicPlayer.app", - "/ToolData/Deployment/Web/AtomicPlayer.js", - "/ToolData/Deployment/Web/AtomicPlayer.html.mem", - "/ToolData/AtomicExamples", - "/ToolData/Docs", - ]; - - // Mac Editor -> Windows Editor - for (var i in filenames) { - fs.copySync(macRoot + filenames[i], winRoot + filenames[i]); - } - - // Windows Editor ->Mac Editor - filenames = ["/ToolData/Deployment/Windows/x86/D3DCompiler_47.dll", - "/ToolData/Deployment/Windows/x86/AtomicPlayer.exe", - ]; - - for (var i in filenames) { - fs.copySync(winRoot + filenames[i], macRoot + filenames[i]); - } - - zipcmds = [ - "zip -r -X ./snapshots/AtomicEditor_MacOSX_DevSnapshot_" + buildSHA + ".zip ./AtomicEditor.app", - "zip -r -X ./snapshots/AtomicEditor_Win32_DevSnapshot_" + buildSHA + ".zip ./Windows_Package", - "cp ./snapshots/*.zip /Users/jenge/Share/Temp/AtomicEditor_DevSnapshots/" - ] - - jake.exec(zipcmds, function() {}); - - }); - - }); - - -}); diff --git a/Rakefile b/Rakefile deleted file mode 100644 index f352ab0261..0000000000 --- a/Rakefile +++ /dev/null @@ -1,256 +0,0 @@ - -include RbConfig - -case CONFIG['host_os'] -when /mswin|windows|mingw32/i - $HOST_OS = "windows" -when /darwin/i - $HOST_OS = "darwin" -else - $HOST_OS = "linux" -end - -$RAKE_ROOT = File.dirname(__FILE__) - -ARTIFACTS_FOLDER = "#{$RAKE_ROOT}/Artifacts" - -$CMAKE_DEV_BUILD = "-DATOMIC_DEV_BUILD=1" - -CMAKE_WINDOWS_BUILD_FOLDER = "#{ARTIFACTS_FOLDER}/Windows_Build" -CMAKE_MACOSX_BUILD_FOLDER = "#{ARTIFACTS_FOLDER}/MacOSX_Build" -CMAKE_ANDROID_BUILD_FOLDER = "#{ARTIFACTS_FOLDER}/Android_Build" -CMAKE_IOS_BUILD_FOLDER = "#{ARTIFACTS_FOLDER}/IOS_Build" -CMAKE_WEB_BUILD_FOLDER = "#{ARTIFACTS_FOLDER}/Web_Build" -CMAKE_LINUX_BUILD_FOLDER = "#{ARTIFACTS_FOLDER}/Linux_Build" - -ATOMICTOOL_BIN_MACOSX = "#{CMAKE_MACOSX_BUILD_FOLDER}/Source/AtomicTool/Release/AtomicTool" - -PACKAGE_FOLDER_MACOSX = "#{ARTIFACTS_FOLDER}/MacOSX_Package" -PACKAGE_FOLDER_WINDOWS = "#{ARTIFACTS_FOLDER}/Windows_Package" - -namespace :build do - - task :macosx_atomictool do - - if !Dir.exists?("#{CMAKE_MACOSX_BUILD_FOLDER}") - FileUtils.mkdir_p(CMAKE_MACOSX_BUILD_FOLDER) - end - - Dir.chdir(CMAKE_MACOSX_BUILD_FOLDER) do - - sh "cmake ../../ -G Xcode -DCMAKE_BUILD_TYPE=Release" - sh "xcodebuild -target AtomicTool -configuration Release" - - end - - end - - task :windows do - - # remove existing build folder - if Dir.exists?("#{CMAKE_WINDOWS_BUILD_FOLDER}") - FileUtils.rm_rf("#{CMAKE_WINDOWS_BUILD_FOLDER}") - end - - # create build folder - if !Dir.exists?("#{CMAKE_WINDOWS_BUILD_FOLDER}") - FileUtils.mkdir_p(CMAKE_WINDOWS_BUILD_FOLDER) - end - - Dir.chdir(CMAKE_WINDOWS_BUILD_FOLDER) do - # ensure VS commandline tools are on the path - VSCOMNTOOLS = ENV['VS140COMNTOOLS'] - - sh "\"#{VSCOMNTOOLS}vsvars32.bat\"" - - sh "cmake ../../ #{$CMAKE_DEV_BUILD} -G \"Visual Studio 14 2015\"" - - # specify 32 bit - sh "msbuild /m Atomic.sln /p:Configuration=Release /p:Platform=Win32" - - end - - end - - task :macosx do - - if !Dir.exists?("#{CMAKE_MACOSX_BUILD_FOLDER}") - FileUtils.mkdir_p(CMAKE_MACOSX_BUILD_FOLDER) - end - - Dir.chdir(CMAKE_MACOSX_BUILD_FOLDER) do - - sh "cmake ../../ -G Xcode #{$CMAKE_DEV_BUILD}" - sh "xcodebuild -configuration Release" - - end - - # build the Atomic Editor - #Dir.chdir("#{$RAKE_ROOT}/Script/AtomicEditor") do - #sh "tsc" - #end - - - end - - task :linux do - - if !Dir.exists?("#{CMAKE_LINUX_BUILD_FOLDER}") - FileUtils.mkdir_p(CMAKE_LINUX_BUILD_FOLDER) - end - - Dir.chdir(CMAKE_LINUX_BUILD_FOLDER) do - - sh "cmake ../../ -DLINUX=1 -G \"Unix Makefiles\"" - sh "make -j2" - - end - - end - - - #IOS, dependent on macosx for JSBind - task :ios => "build:macosx_atomictool" do - - if !Dir.exists?("#{CMAKE_IOS_BUILD_FOLDER}") - FileUtils.mkdir_p(CMAKE_IOS_BUILD_FOLDER) - end - - Dir.chdir(CMAKE_IOS_BUILD_FOLDER) do - sh "#{ATOMICTOOL_BIN_MACOSX} bind #{$RAKE_ROOT} Script/Packages/Atomic/ IOS" - sh "#{ATOMICTOOL_BIN_MACOSX} bind #{$RAKE_ROOT} Script/Packages/AtomicPlayer/ IOS" - sh "cmake -DIOS=1 -DCMAKE_BUILD_TYPE=Release -G Xcode ../../" - # the -s option adds $KEYCHAIN to the search scope, while the -d option adds $KEYCHAIN to the system domain; both are needed - sh "security -v list-keychains -d system -s /Users/jenkins/Library/Keychains/codesign.keychain" - sh "security -v unlock-keychain /Users/jenkins/Library/Keychains/codesign.keychain" - sh "xcodebuild -configuration Release" - end - - end - - task :android => "build:macosx_atomictool" do - - if !Dir.exists?("#{CMAKE_ANDROID_BUILD_FOLDER}") - FileUtils.mkdir_p(CMAKE_ANDROID_BUILD_FOLDER) - end - - Dir.chdir(CMAKE_ANDROID_BUILD_FOLDER) do - - sh "#{ATOMICTOOL_BIN_MACOSX} bind #{$RAKE_ROOT} Script/Packages/Atomic/ ANDROID" - sh "#{ATOMICTOOL_BIN_MACOSX} bind #{$RAKE_ROOT} Script/Packages/AtomicPlayer/ ANDROID" - sh "cmake -DCMAKE_TOOLCHAIN_FILE=#{$RAKE_ROOT}/CMake/Toolchains/android.toolchain.cmake -DCMAKE_BUILD_TYPE=Release ../../" - sh "make -j4" - end - - end - - task :web => "build:macosx_atomictool" do - - if !Dir.exists?("#{CMAKE_WEB_BUILD_FOLDER}") - FileUtils.mkdir_p(CMAKE_WEB_BUILD_FOLDER) - end - - Dir.chdir(CMAKE_WEB_BUILD_FOLDER) do - sh "#{ATOMICTOOL_BIN_MACOSX} bind #{$RAKE_ROOT} Script/Packages/Atomic/ WEB" - sh "#{ATOMICTOOL_BIN_MACOSX} bind #{$RAKE_ROOT} Script/Packages/AtomicPlayer/ 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 -j4" - end - - # -s ERROR_ON_UNDEFINED_SYMBOLS=1 (disabled for pthread errors currently on incoming) - Dir.chdir("#{CMAKE_WEB_BUILD_FOLDER}/Source/AtomicPlayer/Application") do - sh "mv AtomicPlayer AtomicPlayer.bc" - sh "emcc -O3 -s USE_PTHREADS=0 -s ASM_JS=1 -s VERBOSE=0 -s USE_SDL=2 -s TOTAL_MEMORY=134217728 -s AGGRESSIVE_VARIABLE_ELIMINATION=1 -s NO_EXIT_RUNTIME=1 ./AtomicPlayer.bc -o ./AtomicPlayer.html" - end - - end - -end - -namespace :clean do - - task :macosx do - - folders = ["#{CMAKE_MACOSX_BUILD_FOLDER}", "#{PACKAGE_FOLDER_MACOSX}"] - - for index in 0 ... folders.size - - if Dir.exists?(folders[index]) - sh "rm -rf #{folders[index]}" - end - - if Dir.exists?(folders[index]) - abort("Unable to clean #{folders[index]}") - end - - end - - end - - - task :windows do - - folders = ["#{CMAKE_WINDOWS_BUILD_FOLDER}", "#{PACKAGE_FOLDER_WINDOWS}"] - - for index in 0 ... folders.size - - if Dir.exists?(folders[index]) - FileUtils.rmtree("#{folders[index]}") - end - - if Dir.exists?(folders[index]) - abort("Unable to clean #{folders[index]}") - end - - end - - end - - -end - - -namespace :package do - - $CMAKE_DEV_BUILD = "-DATOMIC_DEV_BUILD=0" - - task :macosx => ["clean:macosx", "build:macosx"] do - - FileUtils.mkdir_p("#{PACKAGE_FOLDER_MACOSX}") - - MAC_EDITOR_APP_FOLDER_SRC = "#{CMAKE_MACOSX_BUILD_FOLDER}/Source/AtomicEditor/Release/AtomicEditor.app" - - sh "cp -r #{MAC_EDITOR_APP_FOLDER_SRC} #{PACKAGE_FOLDER_MACOSX}" - - # copy resources - - sh "cp -r #{$RAKE_ROOT}/Resources/CoreData #{PACKAGE_FOLDER_MACOSX}/AtomicEditor.app/Contents/Resources/" - sh "cp -r #{$RAKE_ROOT}/Resources/EditorData #{PACKAGE_FOLDER_MACOSX}/AtomicEditor.app/Contents/Resources/" - sh "cp -r #{$RAKE_ROOT}/Resources/PlayerData #{PACKAGE_FOLDER_MACOSX}/AtomicEditor.app/Contents/Resources/" - sh "cp -r #{$RAKE_ROOT}/Script #{PACKAGE_FOLDER_MACOSX}/AtomicEditor.app/Contents/Resources/" - sh "cp -r #{$RAKE_ROOT}/Data/AtomicEditor/ProjectTemplates #{PACKAGE_FOLDER_MACOSX}/AtomicEditor.app/Contents/Resources/" - - end - - task :windows => ["clean:windows", "build:windows"] do - - FileUtils.mkdir_p("#{PACKAGE_FOLDER_WINDOWS}/Resources") - - FileUtils.cp("#{CMAKE_WINDOWS_BUILD_FOLDER}/Source/AtomicEditor/Release/AtomicEditor.exe", "#{PACKAGE_FOLDER_WINDOWS}/AtomicEditor.exe" ) - - #32 bit build for packaging! - - FileUtils.cp("#{$RAKE_ROOT}/Build/Windows/Binaries/x86/D3DCompiler_47.dll", "#{PACKAGE_FOLDER_WINDOWS}/D3DCompiler_47.dll" ) - - # copy resources - - FileUtils.cp_r("#{$RAKE_ROOT}/Resources/CoreData", "#{PACKAGE_FOLDER_WINDOWS}/Resources"); - FileUtils.cp_r("#{$RAKE_ROOT}/Resources/EditorData", "#{PACKAGE_FOLDER_WINDOWS}/Resources"); - FileUtils.cp_r("#{$RAKE_ROOT}/Resources/PlayerData", "#{PACKAGE_FOLDER_WINDOWS}/Resources"); - FileUtils.cp_r("#{$RAKE_ROOT}/Script", "#{PACKAGE_FOLDER_WINDOWS}/Resources"); - FileUtils.cp_r("#{$RAKE_ROOT}/Data/AtomicEditor/ProjectTemplates", "#{PACKAGE_FOLDER_WINDOWS}/Resources"); - - end - - -end diff --git a/Source/AtomicEditor/CMakeLists.txt b/Source/AtomicEditor/CMakeLists.txt index 86c7f18f58..5118a9f881 100644 --- a/Source/AtomicEditor/CMakeLists.txt +++ b/Source/AtomicEditor/CMakeLists.txt @@ -47,42 +47,12 @@ if (APPLE) target_link_libraries(AtomicEditor NETCore NETScript curl) - # compile the editor scripts - add_custom_command (TARGET AtomicEditor POST_BUILD - COMMAND "${CMAKE_SOURCE_DIR}/Build/Mac/node/node" "${CMAKE_SOURCE_DIR}/Build/TypeScript/tsc.js" "-p" "./Script" - WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}) - elseif(LINUX) target_link_libraries(AtomicEditor NETCore NETScript curl nativefiledialog ${GTK3_LIBRARIES}) - # check for nodejs install - # look for either 'node' or 'nodejs' ( debian uses both names ) - set(NODEJS_CMD node) - find_program( SYS_NODE ${NODEJS_CMD} PATHS /usr/bin/ /bin ENV PATH) - - if(NOT SYS_NODE) - set(NODEJS_CMD nodejs) - find_program( SYS_NODE ${NODEJS_CMD} PATHS /usr/bin/ /bin ENV PATH) - endif() - - if( NOT SYS_NODE) - message(SEND_WARNING " WARNING: Could not find Nodejs, editor's TypeScript will not be compiled!") - endif() - - if(SYS_NODE) - # compile the editor scripts - add_custom_command (TARGET AtomicEditor POST_BUILD - COMMAND ${NODEJS_CMD} "${CMAKE_SOURCE_DIR}/Build/TypeScript/tsc.js" "-p" "./Script" - WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}) - endif() else() target_link_libraries(AtomicEditor NETCore NETScript libcurl Iphlpapi Wldap32) - # compile the editor scripts - add_custom_command (TARGET AtomicEditor POST_BUILD - COMMAND "${CMAKE_SOURCE_DIR}/Build/Windows/node/node.exe" "${CMAKE_SOURCE_DIR}/Build/TypeScript/tsc.js" "-p" "./Script" - WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}) - # pre-Windows 8 can't count on D3DCompiler_47.dll being on system add_custom_command (TARGET AtomicEditor POST_BUILD COMMAND ${CMAKE_COMMAND} diff --git a/Source/AtomicJS/CMakeLists.txt b/Source/AtomicJS/CMakeLists.txt index 07bd0aba8b..bef1ef6121 100644 --- a/Source/AtomicJS/CMakeLists.txt +++ b/Source/AtomicJS/CMakeLists.txt @@ -20,7 +20,3 @@ file (GLOB JAVASCRIPT_BINDINGS_SOURCE ${CMAKE_SOURCE_DIR}/Build/Source/Generated set (SOURCE_FILES ${JAVASCRIPT_SOURCE} ${JAVASCRIPT_BINDINGS_SOURCE}) add_library(AtomicJS ${SOURCE_FILES}) - -add_custom_command (TARGET AtomicJS POST_BUILD -COMMAND ${CMAKE_COMMAND} -ARGS -E copy_if_different \"${CMAKE_SOURCE_DIR}/Script/JSPlugin/AtomicPlugin.h\" \"${CMAKE_SOURCE_DIR}/Bin/NativePluginSDK/AtomicPlugin.h\")