protected void WriteProjectAttributeListProperty(string prop, TextWriter sw, GUIDToCommentMap comments) { foreach (string line in m_AttributeLines) { sw.WriteLine(line); } }
public static string Write(string guid, GUIDToCommentMap comments) { string comment = comments[guid]; if (comment == null) return guid; return String.Format("{0} /* {1} */", guid, comment); }
public void Write(TextWriter sw, GUIDToCommentMap comments) { sw.WriteLine("\t\t\t\t{"); sw.WriteLine("\t\t\t\t\tProductGroup = {0};", CommentedGUID.Write(@group, comments)); sw.WriteLine("\t\t\t\t\tProjectRef = {0};", CommentedGUID.Write(projectRef, comments)); sw.WriteLine("\t\t\t\t}"); }
public override void WriteToSection(TextWriter sw, GUIDToCommentMap comments) { sw.WriteLine( "\t\t{0} = {{isa = PBXBuildFile; fileRef = {1}; {2}}};", CommentedGUID.Write(guid, comments), CommentedGUID.Write(fileRef, comments), postfix); }
public override void WriteSection(TextWriter sw, GUIDToCommentMap comments) { sw.WriteLine(); foreach (string s in text) { sw.WriteLine(s); } }
protected void WriteBuildPropertiesListProperty(string prop, TextWriter sw, GUIDToCommentMap comments) { sw.WriteLine("\t\t\tbuildSettings = {"); foreach (BuildConfigEntry e in entry.Values) { e.Write(sw, comments); } sw.WriteLine("\t\t\t};"); }
public static string Write(string guid, GUIDToCommentMap comments) { string comment = comments[guid]; if (comment == null) { return(guid); } return(String.Format("{0} /* {1} */", guid, comment)); }
protected void WriteCommentedGuidListProperty(string prop, TextWriter sw, GUIDToCommentMap comments) { sw.WriteLine("\t\t\t{0} = (", prop); var list = m_ListProperties[prop]; foreach (string v in list) { sw.WriteLine("\t\t\t\t{0},", CommentedGUID.Write(v, comments)); } sw.WriteLine("\t\t\t);"); }
public override void WriteSection(TextWriter sw, GUIDToCommentMap comments) { if (entry.Count == 0) { return; // do not write empty sections } sw.WriteLine(); sw.WriteLine("/* Begin {0} section */", m_Name); foreach (T obj in entry.Values) { obj.WriteToSection(sw, comments); } sw.WriteLine("/* End {0} section */", m_Name); }
protected void WriteProjectReferenceListProperty(string prop, TextWriter sw, GUIDToCommentMap comments) { if (projectReferences.Count == 0) { return; } sw.WriteLine("\t\t\tprojectReferences = ("); foreach (var projRef in projectReferences) { projRef.Write(sw, comments); } sw.WriteLine("\t\t\t);"); }
public string WriteToString() { GUIDToCommentMap comments1 = this.BuildCommentMap(); PropertyCommentChecker checker1 = new PropertyCommentChecker(); GUIDToCommentMap comments2 = new GUIDToCommentMap(); StringBuilder sb1 = new StringBuilder(); if (this.m_ObjectVersion != null) { sb1.AppendFormat("objectVersion = {0};\n\t", (object)this.m_ObjectVersion); } sb1.Append("objects = {"); foreach (string key in this.m_SectionOrder) { if (this.m_Section.ContainsKey(key)) { this.m_Section[key].WriteSection(sb1, comments1); } else if (this.m_UnknownSections.ContainsKey(key)) { this.m_UnknownSections[key].WriteSection(sb1, comments1); } } foreach (KeyValuePair <string, PBXElement> keyValuePair in (IEnumerable <KeyValuePair <string, PBXElement> >) this.m_UnknownObjects.values) { Serializer.WriteDictKeyValue(sb1, keyValuePair.Key, keyValuePair.Value, 2, false, checker1, comments2); } sb1.Append("\n\t};"); StringBuilder stringBuilder = new StringBuilder(); stringBuilder.Append("// !$*UTF8*$!\n"); StringBuilder sb2 = stringBuilder; PBXElementDict el = this.m_RootElements; int indent = 0; int num = 0; string[] strArray = new string[1]; int index = 0; string str = "rootObject/*"; strArray[index] = str; PropertyCommentChecker checker2 = new PropertyCommentChecker((IEnumerable <string>)strArray); GUIDToCommentMap comments3 = comments1; Serializer.WriteDict(sb2, el, indent, num != 0, checker2, comments3); stringBuilder.Append("\n"); return(stringBuilder.ToString().Replace("objects = OBJMARKER;", sb1.ToString())); }
public void Write(TextWriter sw, GUIDToCommentMap comments) { if (val.Count == 0) { return; } else if (val.Count == 1) { sw.WriteLine(String.Format("\t\t\t\t{0} = {1};", PBXStream.QuoteStringIfNeeded(name), PBXStream.QuoteStringIfNeeded(val[0]))); } else { sw.WriteLine(String.Format("\t\t\t\t{0} = (", PBXStream.QuoteStringIfNeeded(name))); foreach (string s in val) sw.WriteLine(String.Format("\t\t\t\t\t{0},", PBXStream.QuoteStringIfNeeded(s))); sw.WriteLine("\t\t\t\t);"); } }
public void Write(TextWriter sw, GUIDToCommentMap comments) { if (val.Count == 0) { } else if (val.Count == 1) { sw.WriteLine("\t\t\t\t{0} = {1};", PBXStream.QuoteStringIfNeeded(name), PBXStream.QuoteStringIfNeeded(val[0])); } else { sw.WriteLine("\t\t\t\t{0} = (", PBXStream.QuoteStringIfNeeded(name)); foreach (string s in val) { sw.WriteLine("\t\t\t\t\t{0},", PBXStream.QuoteStringIfNeeded(s)); } sw.WriteLine("\t\t\t\t);"); } }
public string WriteToString() { var commentMap = BuildCommentMap(); var emptyChecker = new PropertyCommentChecker(); var emptyCommentMap = new GUIDToCommentMap(); // since we need to add custom comments, the serialization is much more complex StringBuilder objectsSb = new StringBuilder(); if (m_ObjectVersion != null) // objectVersion comes right before objects { objectsSb.AppendFormat("objectVersion = {0};\n\t", m_ObjectVersion); } objectsSb.Append("objects = {"); foreach (string sectionName in m_SectionOrder) { if (m_Section.ContainsKey(sectionName)) { m_Section[sectionName].WriteSection(objectsSb, commentMap); } else if (m_UnknownSections.ContainsKey(sectionName)) { m_UnknownSections[sectionName].WriteSection(objectsSb, commentMap); } } foreach (var kv in m_UnknownObjects.values) { Serializer.WriteDictKeyValue(objectsSb, kv.Key, kv.Value, 2, false, emptyChecker, emptyCommentMap); } objectsSb.Append("\n\t};"); StringBuilder contentSb = new StringBuilder(); contentSb.Append("// !$*UTF8*$!\n"); Serializer.WriteDict(contentSb, m_RootElements, 0, false, new PropertyCommentChecker(new string[] { "rootObject/*" }), commentMap); contentSb.Append("\n"); string content = contentSb.ToString(); content = content.Replace("objects = OBJMARKER;", objectsSb.ToString()); return(content); }
public override void WriteToSection(TextWriter sw, GUIDToCommentMap comments) { // TODO: the implementation works but is not elegant var processedProperties = new HashSet <string>(); var allProps = new List <string>(); allProps.AddRange(GetPropertyNames()); allProps.Sort(); sw.WriteLine("\t\t{0} = {{", CommentedGUID.Write(guid, comments)); WritePropertyWrapper("isa", processedProperties, sw, comments); // always the first foreach (var prop in allProps) { WritePropertyWrapper(prop, processedProperties, sw, comments); } foreach (var line in m_BadLines) { sw.WriteLine(line); } sw.WriteLine("\t\t};"); }
private void BuildCommentMapForBuildFiles(GUIDToCommentMap comments, List <string> guids, string sectName) { foreach (string str in guids) { PBXBuildFileData data = this.BuildFilesGet(str); if (data != null) { PBXFileReferenceData data2 = this.FileRefsGet(data.fileRef); if (data2 != null) { comments.Add(str, $"{data2.name} in {sectName}"); } else { PBXReferenceProxyData data3 = this.references[data.fileRef]; if (data3 != null) { comments.Add(str, $"{data3.path} in {sectName}"); } } } } }
private void BuildCommentMapForBuildFiles(GUIDToCommentMap comments, List <string> guids, string sectName) { foreach (var guid in guids) { var buildFile = BuildFilesGet(guid); if (buildFile != null) { var fileRef = FileRefsGet(buildFile.fileRef); if (fileRef != null) { comments.Add(guid, String.Format("{0} in {1}", fileRef.name, sectName)); } else { var reference = references[buildFile.fileRef]; if (reference != null) { comments.Add(guid, String.Format("{0} in {1}", reference.path, sectName)); } } } } }
void BuildCommentMapForBuildFiles(GUIDToCommentMap comments, IEnumerable <string> guids, string sectName) { foreach (var guid in guids) { var buildFile = buildFiles[guid]; if (buildFile != null) { var fileRef = fileRefs[buildFile.fileRef]; if (fileRef != null) { comments.Add(guid, String.Format("{0} in {1}", fileRef.name, sectName)); } else { var reference = references[buildFile.fileRef]; if (reference != null) { comments.Add(guid, String.Format("{0} in {1}", reference.path, sectName)); } } } } }
private void BuildCommentMapForBuildFiles(GUIDToCommentMap comments, List <string> guids, string sectName) { foreach (string guid in guids) { PBXBuildFileData pbxBuildFileData = this.BuildFilesGet(guid); if (pbxBuildFileData != null) { PBXFileReferenceData fileReferenceData = this.FileRefsGet(pbxBuildFileData.fileRef); if (fileReferenceData != null) { comments.Add(guid, string.Format("{0} in {1}", (object)fileReferenceData.name, (object)sectName)); } else { PBXReferenceProxyData referenceProxyData = this.references[pbxBuildFileData.fileRef]; if (referenceProxyData != null) { comments.Add(guid, string.Format("{0} in {1}", (object)referenceProxyData.path, (object)sectName)); } } } } }
protected void WriteCommentedGuidListProperty(string prop, TextWriter sw, GUIDToCommentMap comments) { List<string> list = m_ListProperties[prop]; bool sortCommentedGuidLists = false; if (sortCommentedGuidLists) { // useful in large projects as Xcode does not sort directory contents by default var sorted = new List<KeyValuePair<string, string>>(); foreach (string v in list) sorted.Add(new KeyValuePair<string, string>(comments[v], v)); sorted.Sort((a, b) => { if (a.Key != null && b.Key != null) return String.Compare(a.Key, b.Key, false); else return 0; }); list.Clear(); foreach (var kv in sorted) list.Add(kv.Value); } sw.WriteLine("\t\t\t{0} = (", prop); foreach (string v in list) sw.WriteLine("\t\t\t\t{0},", CommentedGUID.Write(v, comments)); sw.WriteLine("\t\t\t);"); }
protected override void WriteProperty(PropertyType propType, string prop, TextWriter sw, GUIDToCommentMap comments) { if (propType == PropertyType.Regular) WriteRegularProperty(prop, sw); else if (propType == PropertyType.CommentedGuid) WriteCommentedGuidProperty(prop, sw, comments); else if (propType == PropertyType.BuildPropertiesList) WriteBuildPropertiesListProperty(prop, sw, comments); }
protected virtual void WriteProperty(PropertyType propType, string prop, TextWriter sw, GUIDToCommentMap comments) { if (propType == PropertyType.Regular) { WriteRegularProperty(prop, sw); } else if (propType == PropertyType.CommentedGuid) { WriteCommentedGuidProperty(prop, sw, comments); } }
protected override void WriteProperty(PropertyType propType, string prop, TextWriter sw, GUIDToCommentMap comments) { if (propType == PropertyType.Regular) WriteRegularProperty(prop, sw); else if (propType == PropertyType.CommentedGuid) WriteCommentedGuidProperty(prop, sw, comments); else if (propType == PropertyType.RegularList) WriteRegularListProperty(prop, sw); else if (propType == PropertyType.CommentedGuidList) WriteCommentedGuidListProperty(prop, sw, comments); else if (propType == PropertyType.ProjectAttributeList) WriteProjectAttributeListProperty(prop, sw, comments); else if (propType == PropertyType.ProjectReferenceList) WriteProjectReferenceListProperty(prop, sw, comments); }
protected void WriteProjectAttributeListProperty(string prop, TextWriter sw, GUIDToCommentMap comments) { foreach (string line in m_AttributeLines) sw.WriteLine(line); }
public abstract void WriteToSection(TextWriter sw, GUIDToCommentMap comments);
public override void WriteToSection(TextWriter sw, GUIDToCommentMap comments) { // TODO: the implementation works but is not elegant var processedProperties = new HashSet<string>(); var allProps = new List<string>(); allProps.AddRange(GetPropertyNames()); allProps.Sort(); sw.WriteLine(String.Format("\t\t{0} = {{", CommentedGUID.Write(guid, comments))); WritePropertyWrapper("isa", processedProperties, sw, comments); // always the first foreach (var prop in allProps) WritePropertyWrapper(prop, processedProperties, sw, comments); foreach (var line in m_BadLines) sw.WriteLine(line); sw.WriteLine("\t\t};"); }
GUIDToCommentMap BuildCommentMap() { var comments = new GUIDToCommentMap(); // buildFiles are handled below // filerefs are handled below foreach (var e in groups.entry.Values) { comments.Add(e.guid, e.name); } foreach (var e in containerItems.entry.Values) { comments.Add(e.guid, "PBXContainerItemProxy"); } foreach (var e in references.entry.Values) { comments.Add(e.guid, e.path); } foreach (var e in sources.entry.Values) { comments.Add(e.guid, "Sources"); BuildCommentMapForBuildFiles(comments, e.file, "Sources"); } foreach (var e in resources.entry.Values) { comments.Add(e.guid, "Resources"); BuildCommentMapForBuildFiles(comments, e.file, "Resources"); } foreach (var e in frameworks.entry.Values) { comments.Add(e.guid, "Frameworks"); BuildCommentMapForBuildFiles(comments, e.file, "Frameworks"); } foreach (var e in copyFiles.entry.Values) { string sectName = e.name ?? "CopyFiles"; comments.Add(e.guid, sectName); BuildCommentMapForBuildFiles(comments, e.file, sectName); } foreach (var e in shellScripts.entry.Values) { comments.Add(e.guid, "ShellScript"); } foreach (var e in targetDependencies.entry.Values) { comments.Add(e.guid, "PBXTargetDependency"); } foreach (var e in nativeTargets.entry.Values) { comments.Add(e.guid, e.name); comments.Add(e.buildConfigList, String.Format("Build configuration list for PBXNativeTarget \"{0}\"", e.name)); } foreach (var e in variantGroups.entry.Values) { comments.Add(e.guid, e.name); } foreach (var e in buildConfigs.entry.Values) { comments.Add(e.guid, e.name); } foreach (var e in project.entry.Values) { comments.Add(e.guid, "Project object"); comments.Add(e.buildConfigList, "Build configuration list for PBXProject \"Unity-iPhone\""); // FIXME: project name is hardcoded } foreach (var e in fileRefs.entry.Values) { comments.Add(e.guid, e.name); } return(comments); }
public override void WriteToSection(TextWriter sw, GUIDToCommentMap comments) { sw.WriteLine("\t\t{0} = {1};", CommentedGUID.Write(guid, comments), text); }
protected override void WriteProperty(PropertyType propType, string prop, TextWriter sw, GUIDToCommentMap comments) { if (propType == PropertyType.Regular) { WriteRegularProperty(prop, sw); } else if (propType == PropertyType.CommentedGuid) { WriteCommentedGuidProperty(prop, sw, comments); } else if (propType == PropertyType.BuildPropertiesList) { WriteBuildPropertiesListProperty(prop, sw, comments); } }
private GUIDToCommentMap BuildCommentMap() { GUIDToCommentMap comments = new GUIDToCommentMap(); foreach (PBXGroupData data in this.groups.GetObjects()) { comments.Add(data.guid, data.name); } foreach (PBXContainerItemProxyData data2 in this.containerItems.GetObjects()) { comments.Add(data2.guid, "PBXContainerItemProxy"); } foreach (PBXReferenceProxyData data3 in this.references.GetObjects()) { comments.Add(data3.guid, data3.path); } foreach (PBXSourcesBuildPhaseData data4 in this.sources.GetObjects()) { comments.Add(data4.guid, "Sources"); this.BuildCommentMapForBuildFiles(comments, (List <string>)data4.files, "Sources"); } foreach (PBXResourcesBuildPhaseData data5 in this.resources.GetObjects()) { comments.Add(data5.guid, "Resources"); this.BuildCommentMapForBuildFiles(comments, (List <string>)data5.files, "Resources"); } foreach (PBXFrameworksBuildPhaseData data6 in this.frameworks.GetObjects()) { comments.Add(data6.guid, "Frameworks"); this.BuildCommentMapForBuildFiles(comments, (List <string>)data6.files, "Frameworks"); } foreach (PBXCopyFilesBuildPhaseData data7 in this.copyFiles.GetObjects()) { string name = data7.name; if (name == null) { name = "CopyFiles"; } comments.Add(data7.guid, name); this.BuildCommentMapForBuildFiles(comments, (List <string>)data7.files, name); } foreach (PBXShellScriptBuildPhaseData data8 in this.shellScripts.GetObjects()) { comments.Add(data8.guid, "ShellScript"); } foreach (PBXTargetDependencyData data9 in this.targetDependencies.GetObjects()) { comments.Add(data9.guid, "PBXTargetDependency"); } foreach (PBXNativeTargetData data10 in this.nativeTargets.GetObjects()) { comments.Add(data10.guid, data10.name); comments.Add(data10.buildConfigList, $"Build configuration list for PBXNativeTarget " { data10.name } ""); } foreach (PBXVariantGroupData data11 in this.variantGroups.GetObjects()) { comments.Add(data11.guid, data11.name); } foreach (XCBuildConfigurationData data12 in this.buildConfigs.GetObjects()) { comments.Add(data12.guid, data12.name); } foreach (PBXProjectObjectData data13 in this.project.GetObjects()) { comments.Add(data13.guid, "Project object"); comments.Add(data13.buildConfigList, "Build configuration list for PBXProject \"Unity-iPhone\""); } foreach (PBXFileReferenceData data14 in this.fileRefs.GetObjects()) { comments.Add(data14.guid, data14.name); } if (this.m_RootElements.Contains("rootObject") && (this.m_RootElements["rootObject"] is PBXElementString)) { comments.Add(this.m_RootElements["rootObject"].AsString(), "Project object"); } return(comments); }
private GUIDToCommentMap BuildCommentMap() { GUIDToCommentMap comments = new GUIDToCommentMap(); foreach (PBXGroupData pbxGroupData in this.groups.GetObjects()) { comments.Add(pbxGroupData.guid, pbxGroupData.name); } foreach (PBXContainerItemProxyData containerItemProxyData in this.containerItems.GetObjects()) { comments.Add(containerItemProxyData.guid, "PBXContainerItemProxy"); } foreach (PBXReferenceProxyData referenceProxyData in this.references.GetObjects()) { comments.Add(referenceProxyData.guid, referenceProxyData.path); } foreach (PBXSourcesBuildPhaseData sourcesBuildPhaseData in this.sources.GetObjects()) { comments.Add(sourcesBuildPhaseData.guid, "Sources"); this.BuildCommentMapForBuildFiles(comments, (List <string>)sourcesBuildPhaseData.files, "Sources"); } foreach (PBXHeadersBuildPhaseData headersBuildPhaseData in this.headers.GetObjects()) { comments.Add(headersBuildPhaseData.guid, "Headers"); this.BuildCommentMapForBuildFiles(comments, (List <string>)headersBuildPhaseData.files, "Headers"); } foreach (PBXResourcesBuildPhaseData resourcesBuildPhaseData in this.resources.GetObjects()) { comments.Add(resourcesBuildPhaseData.guid, "Resources"); this.BuildCommentMapForBuildFiles(comments, (List <string>)resourcesBuildPhaseData.files, "Resources"); } foreach (PBXFrameworksBuildPhaseData frameworksBuildPhaseData in this.frameworks.GetObjects()) { comments.Add(frameworksBuildPhaseData.guid, "Frameworks"); this.BuildCommentMapForBuildFiles(comments, (List <string>)frameworksBuildPhaseData.files, "Frameworks"); } foreach (PBXCopyFilesBuildPhaseData filesBuildPhaseData in this.copyFiles.GetObjects()) { string str = filesBuildPhaseData.name ?? "CopyFiles"; comments.Add(filesBuildPhaseData.guid, str); this.BuildCommentMapForBuildFiles(comments, (List <string>)filesBuildPhaseData.files, str); } foreach (PBXShellScriptBuildPhaseData scriptBuildPhaseData in this.shellScripts.GetObjects()) { comments.Add(scriptBuildPhaseData.guid, "ShellScript"); } foreach (PBXTargetDependencyData targetDependencyData in this.targetDependencies.GetObjects()) { comments.Add(targetDependencyData.guid, "PBXTargetDependency"); } foreach (PBXNativeTargetData nativeTargetData in this.nativeTargets.GetObjects()) { comments.Add(nativeTargetData.guid, nativeTargetData.name); comments.Add(nativeTargetData.buildConfigList, string.Format("Build configuration list for PBXNativeTarget \"{0}\"", (object)nativeTargetData.name)); } foreach (PBXVariantGroupData variantGroupData in this.variantGroups.GetObjects()) { comments.Add(variantGroupData.guid, variantGroupData.name); } foreach (XCBuildConfigurationData configurationData in this.buildConfigs.GetObjects()) { comments.Add(configurationData.guid, configurationData.name); } foreach (PBXProjectObjectData projectObjectData in this.project.GetObjects()) { comments.Add(projectObjectData.guid, "Project object"); comments.Add(projectObjectData.buildConfigList, "Build configuration list for PBXProject \"Unity-iPhone\""); } foreach (PBXFileReferenceData fileReferenceData in this.fileRefs.GetObjects()) { comments.Add(fileReferenceData.guid, fileReferenceData.name); } if (this.m_RootElements.Contains("rootObject") && this.m_RootElements["rootObject"] is PBXElementString) { comments.Add(this.m_RootElements["rootObject"].AsString(), "Project object"); } return(comments); }
protected override void WriteProperty(PropertyType propType, string prop, TextWriter sw, GUIDToCommentMap comments) { if (propType == PropertyType.Regular) { WriteRegularProperty(prop, sw); } else if (propType == PropertyType.CommentedGuid) { WriteCommentedGuidProperty(prop, sw, comments); } else if (propType == PropertyType.RegularList) { WriteRegularListProperty(prop, sw); } else if (propType == PropertyType.CommentedGuidList) { WriteCommentedGuidListProperty(prop, sw, comments); } else if (propType == PropertyType.ProjectAttributeList) { WriteProjectAttributeListProperty(prop, sw, comments); } else if (propType == PropertyType.ProjectReferenceList) { WriteProjectReferenceListProperty(prop, sw, comments); } }
public override void WriteToSection(TextWriter sw, GUIDToCommentMap comments) { sw.WriteLine(String.Format("\t\t{0} = {{isa = PBXBuildFile; fileRef = {1}; {2}}};", CommentedGUID.Write(guid, comments), CommentedGUID.Write(fileRef, comments), postfix)); }
protected virtual void WriteProperty(PropertyType propType, string prop, TextWriter sw, GUIDToCommentMap comments) { if (propType == PropertyType.Regular) WriteRegularProperty(prop, sw); else if (propType == PropertyType.CommentedGuid) WriteCommentedGuidProperty(prop, sw, comments); }
public override void WriteToSection(TextWriter sw, GUIDToCommentMap comments) { sw.WriteLine(String.Format("\t\t{0} = {1};", CommentedGUID.Write(guid, comments), text)); }
private void WritePropertyWrapper(string prop, HashSet<string> processed, TextWriter sw, GUIDToCommentMap comments) { if (processed.Contains(prop)) return; if (!knownProperties.ContainsKey(prop)) return; WriteProperty(knownProperties[prop], prop, sw, comments); processed.Add(prop); }
protected void WriteCommentedGuidProperty(string prop, TextWriter sw, GUIDToCommentMap comments) { sw.WriteLine("\t\t\t{0} = {1};", prop, CommentedGUID.Write(m_Properties[prop], comments)); }
void WritePropertyWrapper(string prop, HashSet <string> processed, TextWriter sw, GUIDToCommentMap comments) { if (processed.Contains(prop)) { return; } if (!knownProperties.ContainsKey(prop)) { return; } WriteProperty(knownProperties[prop], prop, sw, comments); processed.Add(prop); }
private GUIDToCommentMap BuildCommentMap() { GUIDToCommentMap comments = new GUIDToCommentMap(); // buildFiles are handled below // filerefs are handled below foreach (var e in groups.entry.Values) comments.Add(e.guid, e.name); foreach (var e in containerItems.entry.Values) comments.Add(e.guid, "PBXContainerItemProxy"); foreach (var e in references.entry.Values) comments.Add(e.guid, e.path); foreach (var e in sources.entry.Values) { comments.Add(e.guid, "Sources"); BuildCommentMapForBuildFiles(comments, e.file, "Sources"); } foreach (var e in resources.entry.Values) { comments.Add(e.guid, "Resources"); BuildCommentMapForBuildFiles(comments, e.file, "Resources"); } foreach (var e in frameworks.entry.Values) { comments.Add(e.guid, "Frameworks"); BuildCommentMapForBuildFiles(comments, e.file, "Frameworks"); } foreach (var e in copyFiles.entry.Values) { string sectName = e.name; if (sectName == null) sectName = "CopyFiles"; comments.Add(e.guid, sectName); BuildCommentMapForBuildFiles(comments, e.file, sectName); } foreach (var e in shellScripts.entry.Values) comments.Add(e.guid, "ShellScript"); foreach (var e in targetDependencies.entry.Values) comments.Add(e.guid, "PBXTargetDependency"); foreach (var e in nativeTargets.entry.Values) { comments.Add(e.guid, e.name); comments.Add(e.buildConfigList, String.Format("Build configuration list for PBXNativeTarget \"{0}\"", e.name)); } foreach (var e in variantGroups.entry.Values) comments.Add(e.guid, e.name); foreach (var e in buildConfigs.entry.Values) comments.Add(e.guid, e.name); foreach (var e in project.entry.Values) { comments.Add(e.guid, "Project object"); comments.Add(e.buildConfigList, "Build configuration list for PBXProject \"Unity-iPhone\""); // FIXME: project name is hardcoded } foreach (var e in fileRefs.entry.Values) comments.Add(e.guid, e.name); return comments; }
private GUIDToCommentMap BuildCommentMap() { GUIDToCommentMap comments = new GUIDToCommentMap(); // buildFiles are handled below // filerefs are handled below foreach (var e in groups.GetObjects()) { comments.Add(e.guid, e.name); } foreach (var e in containerItems.GetObjects()) { comments.Add(e.guid, "PBXContainerItemProxy"); } foreach (var e in references.GetObjects()) { comments.Add(e.guid, e.path); } foreach (var e in sources.GetObjects()) { comments.Add(e.guid, "Sources"); BuildCommentMapForBuildFiles(comments, e.files, "Sources"); } foreach (var e in resources.GetObjects()) { comments.Add(e.guid, "Resources"); BuildCommentMapForBuildFiles(comments, e.files, "Resources"); } foreach (var e in frameworks.GetObjects()) { comments.Add(e.guid, "Frameworks"); BuildCommentMapForBuildFiles(comments, e.files, "Frameworks"); } foreach (var e in copyFiles.GetObjects()) { string sectName = e.name; if (sectName == null) { sectName = "CopyFiles"; } comments.Add(e.guid, sectName); BuildCommentMapForBuildFiles(comments, e.files, sectName); } foreach (var e in shellScripts.GetObjects()) { comments.Add(e.guid, "ShellScript"); } foreach (var e in targetDependencies.GetObjects()) { comments.Add(e.guid, "PBXTargetDependency"); } foreach (var e in nativeTargets.GetObjects()) { comments.Add(e.guid, e.name); comments.Add(e.buildConfigList, String.Format("Build configuration list for PBXNativeTarget \"{0}\"", e.name)); } foreach (var e in variantGroups.GetObjects()) { comments.Add(e.guid, e.name); } foreach (var e in buildConfigs.GetObjects()) { comments.Add(e.guid, e.name); } foreach (var e in project.GetObjects()) { comments.Add(e.guid, "Project object"); comments.Add(e.buildConfigList, "Build configuration list for PBXProject \"Unity-iPhone\""); // FIXME: project name is hardcoded } foreach (var e in fileRefs.GetObjects()) { comments.Add(e.guid, e.name); } if (m_RootElements.Contains("rootObject") && m_RootElements["rootObject"] is PBXElementString) { comments.Add(m_RootElements["rootObject"].AsString(), "Project object"); } return(comments); }
public abstract void WriteToSection(TextWriter sw, GUIDToCommentMap comments);
private void BuildCommentMapForBuildFiles(GUIDToCommentMap comments, List<string> guids, string sectName) { foreach (var guid in guids) { var buildFile = buildFiles[guid]; if (buildFile != null) { var fileRef = fileRefs[buildFile.fileRef]; if (fileRef != null) comments.Add(guid, String.Format("{0} in {1}", fileRef.name, sectName)); else { var reference = references[buildFile.fileRef]; if (reference != null) comments.Add(guid, String.Format("{0} in {1}", reference.path, sectName)); } } } }
protected void WriteProjectReferenceListProperty(string prop, TextWriter sw, GUIDToCommentMap comments) { if (projectReferences.Count == 0) return; sw.WriteLine("\t\t\tprojectReferences = ("); foreach (var projRef in projectReferences) { projRef.Write(sw, comments); } sw.WriteLine("\t\t\t);"); }
public void Write(TextWriter sw, GUIDToCommentMap comments) { sw.WriteLine("\t\t\t\t{"); sw.WriteLine(String.Format("\t\t\t\t\tProductGroup = {0};", CommentedGUID.Write(group, comments))); sw.WriteLine(String.Format("\t\t\t\t\tProjectRef = {0};", CommentedGUID.Write(projectRef, comments))); sw.WriteLine("\t\t\t\t},"); }
protected void WriteBuildPropertiesListProperty(string prop, TextWriter sw, GUIDToCommentMap comments) { sw.WriteLine("\t\t\tbuildSettings = {"); foreach(BuildConfigEntry e in entry.Values) e.Write(sw, comments); sw.WriteLine("\t\t\t};"); }
protected void WriteCommentedGuidProperty(string prop, TextWriter sw, GUIDToCommentMap comments) { sw.WriteLine("\t\t\t{0} = {1};", prop, CommentedGUID.Write(m_Properties[prop], comments)); }