private void SetPathConfiguration(XmlDocument document, string nodeName, PathConfiguration pc) { XmlNode original = document.DocumentElement.SelectSingleNode("Configuration").SelectSingleNode(nodeName); XmlNode temp = original; temp.Attributes["Location"].Value = Uplift.Common.FileSystemUtil.MakePathUnix(pc.Location); if (pc.SkipPackageStructureSpecified) { if (temp.Attributes["SkipPackageStructure"] == null) { temp.Attributes.Append(document.CreateAttribute("SkipPackageStructure")); } temp.Attributes["SkipPackageStructure"].Value = pc.SkipPackageStructure.ToString().ToLower(); } else { temp.Attributes.RemoveNamedItem("SkipPackageStructure"); } document.DocumentElement.SelectSingleNode("Configuration").ReplaceChild(original, temp); }
public PathConfiguration GetDestinationFor(InstallSpec spec) { PathConfiguration PH; var specType = spec.Type; switch (specType) { case (InstallSpecType.Base): PH = Configuration.BaseInstallPath; break; case (InstallSpecType.Docs): PH = Configuration.DocsPath; break; case (InstallSpecType.EditorPlugin): PH = new PathConfiguration() { Location = Configuration.EditorPluginPath.Location, SkipPackageStructure = true // Plugins always skip package structure. }; break; case (InstallSpecType.Examples): PH = Configuration.ExamplesPath; break; case (InstallSpecType.Gizmo): PH = Configuration.GizmoPath; break; case (InstallSpecType.Media): PH = Configuration.MediaPath; break; case (InstallSpecType.Plugin): PH = new PathConfiguration() { Location = Configuration.PluginPath.Location, SkipPackageStructure = true // Plugins always skip package structure. }; // Platform as string string platformAsString; switch (spec.Platform) { case (PlatformType.All): // It means, that we just need to point to "Plugins" folder. platformAsString = ""; break; case (PlatformType.iOS): platformAsString = "ios"; break; default: platformAsString = "UNKNOWN"; break; } PH.Location = Path.Combine(PH.Location, platformAsString); break; default: PH = Configuration.BaseInstallPath; break; } return(PH); }