BuildIOS.js 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. var fs = require('fs-extra');
  2. var path = require("path");
  3. var host = require("./Host");
  4. var os = require('os');
  5. var atomicRoot = host.atomicRoot;
  6. var buildDir = host.artifactsRoot + "Build/IOS/";
  7. namespace('build', function() {
  8. task('ios_native', {
  9. async: true
  10. }, function() {
  11. var options = host.options;
  12. var cleanBuild = options["noclean"] ? false : true;
  13. var debug = options["debug"] ? true : false;
  14. var NETNativeSrcDir = buildDir + "Source/AtomicNET/NETNative/" + (debug ? "Debug" : "Release") + "-iphoneos/";
  15. var NETNativeDestDir = host.artifactsRoot + "AtomicNET/" + (debug ? "Debug" : "Release") + "/Native/iOS/";
  16. host.setupDirs(cleanBuild, [buildDir, NETNativeDestDir]);
  17. process.chdir(buildDir);
  18. var cmds = [];
  19. cmds.push("cmake -DIOS=1 -DATOMIC_DEV_BUILD=0 -G Xcode ../../../");
  20. cmds.push("xcodebuild -configuration " + (debug ? "Debug" : "Release") + " -parallelizeTargets -jobs 4");
  21. //cmds.push("cd \"" + NETNativeSrcDir + "\" && install_name_tool -id @rpath/AtomicNETNative.framework/AtomicNETNative AtomicNETNative.framework/AtomicNETNative");
  22. //cmds.push("cd \"" + NETNativeSrcDir + "\" && codesign --deep --force --verify --sign \"iPhone Developer\" ./AtomicNETNative.framework/");
  23. cmds.push("cd \"" + NETNativeSrcDir + "\" && zip -r AtomicNETNative.framework.zip AtomicNETNative.framework");
  24. jake.exec(cmds, function() {
  25. fs.copySync(NETNativeSrcDir + "AtomicNETNative.framework", NETNativeDestDir + "AtomicNETNative.framework");
  26. fs.copySync(NETNativeSrcDir + "AtomicNETNative.framework.zip", NETNativeDestDir + "AtomicNETNative.framework.zip");
  27. complete();
  28. }, {
  29. printStdout: true,
  30. printStderr: true
  31. });
  32. });
  33. }); // end of build namespace