BuildIOS.js 2.1 KB

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