MCPcopy Create free account
hub / github.com/Moddable-OpenSource/moddable / generate

Method generate

tools/mcconfig.js:707–824  ·  view source on GitHub ↗
(tool)

Source from the content-addressed store, hash-verified

705 this.resources.push(parts);
706 }
707 generate(tool) {
708 this.resources = [];
709 this.sources = [];
710
711 this.id = 1;
712 this.addSource(tool.moddablePath + "/../moddableprojects/xs/platforms/ios_xs.c");
713 var names = tool.enumerateDirectory(tool.xsPath + "/sources");
714 var c = names.length;
715 for (var i = 0; i < c; i++) {
716 var name = names[i];
717 if (name.endsWith(".c") && (name != "xsDefaults.c") && (name != "xspcre.c"))
718 this.addSource(tool.xsPath + "/sources/" + name);
719 }
720 for (var result of tool.cFiles) {
721 this.addSource(result.source);
722 }
723 this.addSource(tool.tmpPath + "/mc.xs.c");
724
725 for (var result of tool.dataFiles) {
726 let target = result.target;
727 if (target.indexOf("/") < 0)
728 this.addResource(tool.dataPath + "/" + target);
729 }
730 for (var result of tool.dataFolders) {
731 this.addResource(tool.dataPath + "/" + result, true);
732 }
733 for (var result of tool.resourcesFiles) {
734 let target = result.target;
735 if (target.indexOf("/") < 0)
736 this.addResource(tool.resourcesPath + "/" + target, result.source);
737 }
738 for (var result of tool.resourcesFolders) {
739 this.addResource(tool.resourcesPath + "/" + result, true);
740 }
741 for (var result of tool.stringFiles) {
742 let target = result.target;
743 this.addResource(tool.resourcesPath + "/" + target);
744 }
745 if (tool.stringFiles.length)
746 this.addResource(tool.resourcesPath + "/" + tool.localsName + ".mhi");
747
748 this.addResource(tool.mainPath + "/ios/Assets.xcassets", true);
749
750 var path = tool.moddablePath + "/../moddableprojects/modules/piu/PC/ios/support/Xcode.txt";
751 var template = tool.readFileString(path);
752
753 template = template.replace(/#DEVELOPMENT_TEAM#/g, tool.environment.DEVELOPMENT_TEAM);
754 template = template.replace(/#INFOPLIST_FILE#/g, tool.mainPath + "/ios/info.plist");
755 template = template.replace(/#NAME#/g, tool.environment.NAME);
756 template = template.replace(/#ORGANIZATIONNAME#/g, tool.environment.ORGANIZATION);
757 template = template.replace(/#PRODUCT_BUNDLE_IDENTIFIER#/g, tool.environment.DOT_SIGNATURE);
758 template = template.replace(/#IPHONEOS_DEPLOYMENT_TARGET#/g, tool.environment.IPHONEOS_DEPLOYMENT_TARGET || "8.0");
759 template = template.replace(/#PUSH_ENABLED#/g, tool.environment.PUSH_ENABLED || "0");
760 if (tool.environment.PUSH_ENABLED == "1" && tool.environment.CODE_SIGN_ENTITLEMENTS) {
761 template = template.replace(/#CODE_SIGN_ENTITLEMENTS#/g, "CODE_SIGN_ENTITLEMENTS = " + tool.mainPath + "/ios/" + tool.environment.CODE_SIGN_ENTITLEMENTS + ";");
762 }
763 else {
764 template = template.replace(/#CODE_SIGN_ENTITLEMENTS#/g, "");

Callers

nothing calls this directly

Calls 12

addSourceMethod · 0.95
addResourceMethod · 0.95
generatePBXBuildFileMethod · 0.95
generatePBXGroupMethod · 0.95
generatePBXBuildPhaseMethod · 0.95
replaceMethod · 0.80
closeMethod · 0.65
lineMethod · 0.45

Tested by

no test coverage detected