Exemplo n.º 1
0
 public InstallerIntegrityTester(string buildType, ReportSystem report)
 {
     _buildType = buildType;
     _report    = report;
 }
        /// <summary>
        /// Given an MSBuild Target node and associated XmlNamespaceManager, returns a list of VS project parser
        /// objects, one for each VS project specified in the Target. (There is unlikely to be more than one in any instance.)
        /// </summary>
        /// <param name="targetNode">MSBuild Target node</param>
        /// <param name="xmlnsManager">XML Namespace Manager needed to parse targetNode</param>
        /// <param name="projRootPath">Path to root FW folder</param>
        /// <param name="report">Enables error reports to be logged</param>
        /// <returns>List of VS project parsers if any specified in the target, or else null</returns>
        public static List<IBuildSystemParser> GetProjectParsers(XmlElement targetNode, XmlNamespaceManager xmlnsManager, string projRootPath, ReportSystem report)
        {
            var parsers = new List<IBuildSystemParser>();

            var msBuildNodes = targetNode.SelectNodes("msbuild:MSBuild", xmlnsManager);
            if (msBuildNodes == null)
                return parsers;

            foreach (XmlElement msBuildNode in msBuildNodes)
            {
                var projectPath = msBuildNode.GetAttribute("Projects").Replace("$(fwrt)", projRootPath);
                // Was crashing with C:\fwrepo\fw\Lib\src\icu\source\allinone\allinone.sln
                if (projectPath.EndsWith(".sln"))
                    continue;
                try
                {
                    parsers.Add(GetProjectParser(projectPath));
                }
                catch (MissingAssemblyInfoException ex)
                {
                    report.AddSeriousIssue("Error: " + ex.Message);
                }
            }

            return parsers;
        }
 public InstallerIntegrityTester(string buildType, ReportSystem report)
 {
     _buildType = buildType;
     _report = report;
 }
        /// <summary>
        /// Given an MSBuild Target node and associated XmlNamespaceManager, returns a list of VS project parser
        /// objects, one for each VS project specified in the Target. (There is unlikely to be more than one in any instance.)
        /// </summary>
        /// <param name="targetNode">MSBuild Target node</param>
        /// <param name="xmlnsManager">XML Namespace Manager needed to parse targetNode</param>
        /// <param name="projRootPath">Path to root FW folder</param>
        /// <param name="report">Enables error reports to be logged</param>
        /// <returns>List of VS project parsers if any specified in the target, or else null</returns>
        public static List <IBuildSystemParser> GetProjectParsers(XmlElement targetNode, XmlNamespaceManager xmlnsManager, string projRootPath, ReportSystem report)
        {
            var parsers = new List <IBuildSystemParser>();

            var msBuildNodes = targetNode.SelectNodes("msbuild:MSBuild", xmlnsManager);

            if (msBuildNodes == null)
            {
                return(parsers);
            }

            foreach (XmlElement msBuildNode in msBuildNodes)
            {
                var projectPath = msBuildNode.GetAttribute("Projects").Replace("$(fwrt)", projRootPath);
                // Was crashing with C:\fwrepo\fw\Lib\src\icu\source\allinone\allinone.sln
                if (projectPath.EndsWith(".sln"))
                {
                    continue;
                }
                try
                {
                    parsers.Add(GetProjectParser(projectPath));
                }
                catch (MissingAssemblyInfoException ex)
                {
                    report.AddSeriousIssue("Error: " + ex.Message);
                }
            }

            return(parsers);
        }