예제 #1
0
        /// <summary>
        /// Writes compiler_${ShortName}.props and compiler_$(ShortName}_compat.h
        /// </summary>
        public void WriteToFile(AbsoluteCrosspath solutionDir)
        {
            if (Skip)
            {
                return;
            }

            AbsoluteCrosspath compilerDir = RelativeCrosspath.FromString(PropsFileName).Absolutized(AbsoluteCrosspath.GetCurrentDirectory()).ToContainingDirectory();

            Directory.CreateDirectory(compilerDir.ToString());

            foreach (CompilerInstance compilerInstance in Instances)
            {
                compilerInstance.WriteToFile(solutionDir);
            }

            XmlDocument doc = new XmlDocument();

            doc.AppendChild(doc.CreateXmlDeclaration("1.0", "utf-8", null));

            XmlElement projectNode = doc.CreateElement("Project");

            projectNode.SetAttribute("DefaultTargets", "Build");
            projectNode.SetAttribute("ToolsVersion", "Current");
            projectNode.SetAttribute("xmlns", "http://schemas.microsoft.com/developer/msbuild/2003");

            XmlElement projectImportProps = doc.CreateElement("Import");

            projectImportProps.SetAttribute("Project", @"$(SolutionDir)\Solution.props");
            projectNode.AppendChild(projectImportProps);

            XmlElement projectPropertyGroupCompiler = doc.CreateElement("PropertyGroup");
            XmlElement projectCompilerExeName       = doc.CreateElement("RemoteCCompileToolExe");

            projectCompilerExeName.InnerText = ExePath.ToString();
            projectPropertyGroupCompiler.AppendChild(projectCompilerExeName);
            XmlElement projectCompilerCppExeName = doc.CreateElement("RemoteCppCompileToolExe");

            projectCompilerCppExeName.InnerText = ExePath.ToString();
            projectPropertyGroupCompiler.AppendChild(projectCompilerCppExeName);

            projectNode.AppendChild(projectPropertyGroupCompiler);

            doc.AppendChild(projectNode);
            doc.Save(PropsFileName);
        }
예제 #2
0
 public override String ToString()
 {
     return(ExePath.ToString());
 }