Example #1
0
        private void WriteCombine(SolutionNode solution)
        {
            m_Kernel.Log.Write("Creating NAnt build files");
            foreach (ProjectNode project in solution.Projects)
            {
                if (m_Kernel.AllowProject(project.FilterGroups))
                {
                    m_Kernel.Log.Write("...Creating project: {0}", project.Name);
                    WriteProject(solution, project);
                }
            }

            m_Kernel.Log.Write("");
            string       combFile = Helper.MakeFilePath(solution.FullPath, solution.Name, "build");
            StreamWriter ss       = new StreamWriter(combFile);

            m_Kernel.CurrentWorkingDirectory.Push();
            Helper.SetCurrentDir(Path.GetDirectoryName(combFile));

            using (ss)
            {
                ss.WriteLine("<?xml version=\"1.0\" ?>");
                ss.WriteLine("<project name=\"{0}\" default=\"build\">", solution.Name);
                ss.WriteLine("    <echo message=\"Using '${nant.settings.currentframework}' Framework\"/>");
                ss.WriteLine();

                //ss.WriteLine("    <property name=\"dist.dir\" value=\"dist\" />");
                //ss.WriteLine("    <property name=\"source.dir\" value=\"source\" />");
                ss.WriteLine("    <property name=\"bin.dir\" value=\"bin\" />");
                ss.WriteLine("    <property name=\"obj.dir\" value=\"obj\" />");
                ss.WriteLine("    <property name=\"doc.dir\" value=\"doc\" />");
                ss.WriteLine("    <property name=\"project.main.dir\" value=\"${project::get-base-directory()}\" />");

                foreach (ConfigurationNode conf in solution.Configurations)
                {
                    // Set the project.config to a non-debug configuration
                    if (conf.Options["DebugInformation"].ToString().ToLower() != "true")
                    {
                        ss.WriteLine("    <property name=\"project.config\" value=\"{0}\" />", conf.Name);
                    }
                    ss.WriteLine();
                    ss.WriteLine("    <target name=\"{0}\" description=\"\">", conf.Name);
                    ss.WriteLine("        <property name=\"project.config\" value=\"{0}\" />", conf.Name);
                    ss.WriteLine("        <property name=\"build.debug\" value=\"{0}\" />", conf.Options["DebugInformation"].ToString().ToLower());
                    ss.WriteLine("    </target>");
                    ss.WriteLine();
                }

                ss.WriteLine("    <target name=\"net-1.1\" description=\"Sets framework to .NET 1.1\">");
                ss.WriteLine("        <property name=\"nant.settings.currentframework\" value=\"net-1.1\" />");
                ss.WriteLine("    </target>");
                ss.WriteLine();

                ss.WriteLine("    <target name=\"net-2.0\" description=\"Sets framework to .NET 2.0\">");
                ss.WriteLine("        <property name=\"nant.settings.currentframework\" value=\"net-2.0\" />");
                ss.WriteLine("    </target>");
                ss.WriteLine();

                ss.WriteLine("    <target name=\"mono-2.0\" description=\"Sets framework to mono 2.0\">");
                ss.WriteLine("        <property name=\"nant.settings.currentframework\" value=\"mono-2.0\" />");
                ss.WriteLine("    </target>");
                ss.WriteLine();

                ss.WriteLine("    <target name=\"mono-1.0\" description=\"Sets framework to mono 1.0\">");
                ss.WriteLine("        <property name=\"nant.settings.currentframework\" value=\"mono-1.0\" />");
                ss.WriteLine("    </target>");
                ss.WriteLine();

                ss.WriteLine("    <target name=\"init\" description=\"\">");
                ss.WriteLine("        <call target=\"${project.config}\" />");
                ss.WriteLine("        <property name=\"sys.os.platform\"");
                ss.WriteLine("                  value=\"${platform::get-name()}\"");
                ss.WriteLine("                  />");
                ss.WriteLine("        <echo message=\"Platform ${sys.os.platform}\" />");
                ss.WriteLine("        <property name=\"build.dir\" value=\"${project::get-base-directory()}/${bin.dir}\" />");
                ss.WriteLine("    </target>");
                ss.WriteLine();

                ss.WriteLine("    <target name=\"clean\" description=\"\">");
                ss.WriteLine("        <echo message=\"Deleting all builds from all configurations\" />");
                //ss.WriteLine("        <delete dir=\"${dist.dir}\" failonerror=\"false\" />");
                //ss.WriteLine("        <delete dir=\"${bin.dir}\" failonerror=\"false\" />");
                // This is really bad, hard coding names of files we don't want nant clobbering
                // Hack until prebuild supports some sort of exclusion property - Anonymous
                ss.WriteLine("        <delete failonerror=\"false\">");
                ss.WriteLine("            <fileset basedir=\"${bin.dir}\">");
                ss.WriteLine("                <include name=\"*\" />");
                ss.WriteLine("                <exclude name=\"Tao.OpenGl.dll\" />");
                ss.WriteLine("                <exclude name=\"GlacialList.dll\" />");
                ss.WriteLine("                <exclude name=\"libopenjpeg-dotnet-2.1.3.0-x86_64.so\" />");
                ss.WriteLine("                <exclude name=\"nunit.framework.dll\" />");
                ss.WriteLine("                <exclude name=\"ICSharpCode.SharpZipLib.dll\" />");
                ss.WriteLine("                <exclude name=\"Tao.OpenGl.dll.config\" />");
                ss.WriteLine("                <exclude name=\"openjpeg-libsl.dll\" />");
                ss.WriteLine("                <exclude name=\"Prebuild.exe\" />");
                ss.WriteLine("                <exclude name=\"libopenjpeg-dotnet-2.1.3.0.so\" />");
                ss.WriteLine("                <exclude name=\"log4net.dll\" />");
                ss.WriteLine("                <exclude name=\"libopenjpeg-dotnet-2.1.3.0.dylib\" />");
                ss.WriteLine("                <exclude name=\"Tao.Platform.Windows.dll\" />");
                ss.WriteLine("                <exclude name=\"SLImageUpload.exe.config\" />");
                ss.WriteLine("                <exclude name=\"OpenMetaverse.dll.config\" />");
                ss.WriteLine("                <exclude name=\"openjpeg-dotnet.dll\" />");
                ss.WriteLine("                <exclude name=\".svn\" />");
                ss.WriteLine("            </fileset>");
                ss.WriteLine("        </delete>");
                ss.WriteLine("        <delete dir=\"${obj.dir}\" failonerror=\"false\" />");
                foreach (ProjectNode project in solution.Projects)
                {
                    string path = Helper.MakePathRelativeTo(solution.FullPath, project.FullPath);
                    ss.Write("        <nant buildfile=\"{0}\"",
                             Helper.NormalizePath(Helper.MakeFilePath(path, project.Name + (project.Type == ProjectType.Library ? ".dll" : ".exe"), "build"), '/'));
                    ss.WriteLine(" target=\"clean\" />");
                }
                ss.WriteLine("    </target>");
                ss.WriteLine();

                ss.WriteLine("    <target name=\"build\" depends=\"init\" description=\"\">");

                foreach (ProjectNode project in solution.ProjectsTableOrder)
                {
                    string path = Helper.MakePathRelativeTo(solution.FullPath, project.FullPath);
                    ss.Write("        <nant buildfile=\"{0}\"",
                             Helper.NormalizePath(Helper.MakeFilePath(path, project.Name + (project.Type == ProjectType.Library ? ".dll" : ".exe"), "build"), '/'));
                    ss.WriteLine(" target=\"build\" />");
                }
                ss.WriteLine("    </target>");
                ss.WriteLine();

                ss.WriteLine("    <target name=\"build-release\" depends=\"Release, init, build\" description=\"Builds in Release mode\" />");
                ss.WriteLine();
                ss.WriteLine("    <target name=\"build-debug\" depends=\"Debug, init, build\" description=\"Builds in Debug mode\" />");
                ss.WriteLine();
                //ss.WriteLine("    <target name=\"package\" depends=\"clean, doc, copyfiles, zip\" description=\"Builds in Release mode\" />");
                ss.WriteLine("    <target name=\"package\" depends=\"clean, doc\" description=\"Builds all\" />");
                ss.WriteLine();

                ss.WriteLine("    <target name=\"doc\" depends=\"build-release\">");
                ss.WriteLine("        <echo message=\"Generating all documentation from all builds\" />");
                foreach (ProjectNode project in solution.Projects)
                {
                    string path = Helper.MakePathRelativeTo(solution.FullPath, project.FullPath);
                    ss.Write("        <nant buildfile=\"{0}\"",
                             Helper.NormalizePath(Helper.MakeFilePath(path, project.Name + (project.Type == ProjectType.Library ? ".dll" : ".exe"), "build"), '/'));
                    ss.WriteLine(" target=\"doc\" />");
                }
                ss.WriteLine("    </target>");
                ss.WriteLine();
                ss.WriteLine("</project>");
            }

            m_Kernel.CurrentWorkingDirectory.Pop();
        }
Example #2
0
        private void WriteCombine(SolutionNode solution)
        {
            m_Kernel.Log.Write("Creating MonoDevelop combine and project files");
            foreach (ProjectNode project in solution.Projects)
            {
                if (m_Kernel.AllowProject(project.FilterGroups))
                {
                    m_Kernel.Log.Write("...Creating project: {0}", project.Name);
                    WriteProject(solution, project);
                }
            }

            m_Kernel.Log.Write("");
            string       combFile = Helper.MakeFilePath(solution.FullPath, solution.Name, "mds");
            StreamWriter ss       = new StreamWriter(combFile);

            m_Kernel.CurrentWorkingDirectory.Push();
            Helper.SetCurrentDir(Path.GetDirectoryName(combFile));

            int count = 0;

            using (ss)
            {
                ss.WriteLine("<Combine name=\"{0}\" fileversion=\"2.0\" description=\"\">", solution.Name);

                count = 0;
                foreach (ConfigurationNode conf in solution.Configurations)
                {
                    if (count == 0)
                    {
                        ss.WriteLine("  <Configurations active=\"{0}\">", conf.Name);
                    }

                    ss.WriteLine("    <Configuration name=\"{0}\" ctype=\"CombineConfiguration\">", conf.Name);
                    foreach (ProjectNode project in solution.Projects)
                    {
                        ss.WriteLine("      <Entry configuration=\"{1}\" build=\"True\" name=\"{0}\" />", project.Name, conf.Name);
                    }
                    ss.WriteLine("    </Configuration>");

                    count++;
                }
                ss.WriteLine("  </Configurations>");

                count = 0;

                foreach (ProjectNode project in solution.Projects)
                {
                    if (count == 0)
                    {
                        ss.WriteLine("  <StartMode startupentry=\"{0}\" single=\"True\">", project.Name);
                    }

                    ss.WriteLine("    <Execute type=\"None\" entry=\"{0}\" />", project.Name);
                    count++;
                }
                ss.WriteLine("  </StartMode>");

                ss.WriteLine("  <Entries>");
                foreach (ProjectNode project in solution.Projects)
                {
                    string path = Helper.MakePathRelativeTo(solution.FullPath, project.FullPath);
                    ss.WriteLine("    <Entry filename=\"{0}\" />",
                                 Helper.MakeFilePath(path, project.Name, "mdp"));
                }
                ss.WriteLine("  </Entries>");

                ss.WriteLine("</Combine>");
            }

            m_Kernel.CurrentWorkingDirectory.Pop();
        }
Example #3
0
        private void WriteCombine(SolutionNode solution)
        {
            m_Kernel.Log.Write("Creating NAnt build files");
            foreach (ProjectNode project in solution.Projects)
            {
                if (m_Kernel.AllowProject(project.FilterGroups))
                {
                    m_Kernel.Log.Write("...Creating project: {0}", project.Name);
                    WriteProject(solution, project);
                }
            }

            m_Kernel.Log.Write("");
            string       combFile = Helper.MakeFilePath(solution.FullPath, solution.Name, "build");
            StreamWriter ss       = new StreamWriter(combFile);

            m_Kernel.CurrentWorkingDirectory.Push();
            Helper.SetCurrentDir(Path.GetDirectoryName(combFile));

            using (ss)
            {
                ss.WriteLine("<?xml version=\"1.0\" ?>");
                ss.WriteLine("<project name=\"{0}\" default=\"build\">", solution.Name);
                ss.WriteLine("	  <echo message=\"Using '${nant.settings.currentframework}' Framework\"/>");
                ss.WriteLine();

                //ss.WriteLine("	<property name=\"dist.dir\" value=\"dist\" />");
                //ss.WriteLine("	<property name=\"source.dir\" value=\"source\" />");
                ss.WriteLine("	  <property name=\"bin.dir\" value=\"bin\" />");
                ss.WriteLine("	  <property name=\"obj.dir\" value=\"obj\" />");
                ss.WriteLine("	  <property name=\"doc.dir\" value=\"doc\" />");
                ss.WriteLine("	  <property name=\"project.main.dir\" value=\"${project::get-base-directory()}\" />");

                // Use the active configuration, which is the first configuration name in the prebuild file.
                Dictionary <string, string> emittedConfigurations = new Dictionary <string, string>();

                ss.WriteLine("	  <property name=\"project.config\" value=\"{0}\" />", solution.ActiveConfig);
                ss.WriteLine();

                foreach (ConfigurationNode conf in solution.Configurations)
                {
                    // If the name isn't in the emitted configurations, we give a high level target to the
                    // platform specific on. This lets "Debug" point to "Debug-AnyCPU".
                    if (!emittedConfigurations.ContainsKey(conf.Name))
                    {
                        // Add it to the dictionary so we only emit one.
                        emittedConfigurations.Add(conf.Name, conf.Platform);

                        // Write out the target block.
                        ss.WriteLine("	  <target name=\"{0}\" description=\"{0}|{1}\" depends=\"{0}-{1}\">", conf.Name, conf.Platform);
                        ss.WriteLine("	  </target>");
                        ss.WriteLine();
                    }

                    // Write out the target for the configuration.
                    ss.WriteLine("	  <target name=\"{0}-{1}\" description=\"{0}|{1}\">", conf.Name, conf.Platform);
                    ss.WriteLine("		  <property name=\"project.config\" value=\"{0}\" />", conf.Name);
                    ss.WriteLine("		  <property name=\"build.debug\" value=\"{0}\" />", conf.Options["DebugInformation"].ToString().ToLower());
                    ss.WriteLine("\t\t  <property name=\"build.platform\" value=\"{0}\" />", conf.Platform);
                    ss.WriteLine("	  </target>");
                    ss.WriteLine();
                }

                ss.WriteLine("	  <target name=\"net-1.1\" description=\"Sets framework to .NET 1.1\">");
                ss.WriteLine("		  <property name=\"nant.settings.currentframework\" value=\"net-1.1\" />");
                ss.WriteLine("	  </target>");
                ss.WriteLine();

                ss.WriteLine("	  <target name=\"net-2.0\" description=\"Sets framework to .NET 2.0\">");
                ss.WriteLine("		  <property name=\"nant.settings.currentframework\" value=\"net-2.0\" />");
                ss.WriteLine("	  </target>");
                ss.WriteLine();

                ss.WriteLine("	  <target name=\"net-3.5\" description=\"Sets framework to .NET 3.5\">");
                ss.WriteLine("		  <property name=\"nant.settings.currentframework\" value=\"net-3.5\" />");
                ss.WriteLine("	  </target>");
                ss.WriteLine();

                ss.WriteLine("	  <target name=\"mono-1.0\" description=\"Sets framework to mono 1.0\">");
                ss.WriteLine("		  <property name=\"nant.settings.currentframework\" value=\"mono-1.0\" />");
                ss.WriteLine("	  </target>");
                ss.WriteLine();

                ss.WriteLine("	  <target name=\"mono-2.0\" description=\"Sets framework to mono 2.0\">");
                ss.WriteLine("		  <property name=\"nant.settings.currentframework\" value=\"mono-2.0\" />");
                ss.WriteLine("	  </target>");
                ss.WriteLine();

                ss.WriteLine("	  <target name=\"mono-3.5\" description=\"Sets framework to mono 3.5\">");
                ss.WriteLine("        <property name=\"nant.settings.currentframework\" value=\"mono-3.5\" />");
                ss.WriteLine("    </target>");
                ss.WriteLine();

                ss.WriteLine("    <target name=\"init\" description=\"\">");
                ss.WriteLine("        <call target=\"${project.config}\" />");
                ss.WriteLine("        <property name=\"sys.os.platform\"");
                ss.WriteLine("                  value=\"${platform::get-name()}\"");
                ss.WriteLine("                  />");
                ss.WriteLine("        <echo message=\"Platform ${sys.os.platform}\" />");
                ss.WriteLine("        <property name=\"build.dir\" value=\"${bin.dir}/${project.config}\" />");
                ss.WriteLine("    </target>");
                ss.WriteLine();


                // sdague - ok, this is an ugly hack, but what it lets
                // us do is native include of files into the nant
                // created files from all .nant/*include files.  This
                // lets us keep using prebuild, but allows for
                // extended nant targets to do build and the like.

                try
                {
                    Regex         re      = new Regex(".include$");
                    DirectoryInfo nantdir = new DirectoryInfo(".nant");
                    foreach (FileSystemInfo item in nantdir.GetFileSystemInfos())
                    {
                        if (item is DirectoryInfo)
                        {
                        }
                        else if (item is FileInfo)
                        {
                            if (re.Match(item.FullName) !=
                                System.Text.RegularExpressions.Match.Empty)
                            {
                                Console.WriteLine("Including file: " + item.FullName);

                                using (FileStream fs = new FileStream(item.FullName,
                                                                      FileMode.Open,
                                                                      FileAccess.Read,
                                                                      FileShare.None))
                                {
                                    using (StreamReader sr = new StreamReader(fs))
                                    {
                                        ss.WriteLine("<!-- included from {0} -->", (item).FullName);
                                        while (sr.Peek() != -1)
                                        {
                                            ss.WriteLine(sr.ReadLine());
                                        }
                                        ss.WriteLine();
                                    }
                                }
                            }
                        }
                    }
                }
                catch { }
                // ss.WriteLine("   <include buildfile=\".nant/local.include\" />");
                //                 ss.WriteLine("    <target name=\"zip\" description=\"\">");
                //                 ss.WriteLine("       <zip zipfile=\"{0}-{1}.zip\">", solution.Name, solution.Version);
                //                 ss.WriteLine("       <fileset basedir=\"${project::get-base-directory()}\">");

                //                 ss.WriteLine("       <include name=\"${project::get-base-directory()}/**/*.cs\" />");
                //                 // ss.WriteLine("       <include name=\"${project.main.dir}/**/*\" />");
                //                 ss.WriteLine("       </fileset>");
                //                 ss.WriteLine("       </zip>");
                //                 ss.WriteLine("        <echo message=\"Building zip target\" />");
                //                 ss.WriteLine("    </target>");
                ss.WriteLine();


                ss.WriteLine("    <target name=\"clean\" description=\"\">");
                ss.WriteLine("        <echo message=\"Deleting all builds from all configurations\" />");
                //ss.WriteLine("        <delete dir=\"${dist.dir}\" failonerror=\"false\" />");

                // justincc: FIXME FIXME FIXME - A temporary OpenSim hack to clean up files when "nant clean" is executed.
                // Should be replaced with extreme prejudice once anybody finds out if the CleanFiles stuff works or there is
                // another working mechanism for specifying this stuff
                ss.WriteLine("        <delete failonerror=\"false\">");
                ss.WriteLine("        <fileset basedir=\"${bin.dir}\">");
                ss.WriteLine("            <include name=\"OpenSim*.dll\"/>");
                ss.WriteLine("            <include name=\"OpenSim*.exe\"/>");
                ss.WriteLine("            <include name=\"ScriptEngines/*\"/>");
                ss.WriteLine("            <include name=\"Physics/*\"/>");
                ss.WriteLine("            <exclude name=\"OpenSim.32BitLaunch.exe\"/>");
                ss.WriteLine("            <exclude name=\"ScriptEngines/Default.lsl\"/>");
                ss.WriteLine("        </fileset>");
                ss.WriteLine("        </delete>");

                if (solution.Cleanup != null && solution.Cleanup.CleanFiles.Count > 0)
                {
                    foreach (CleanFilesNode cleanFile in solution.Cleanup.CleanFiles)
                    {
                        ss.WriteLine("        <delete failonerror=\"false\">");
                        ss.WriteLine("            <fileset basedir=\"${project::get-base-directory()}\">");
                        ss.WriteLine("                <include name=\"{0}/*\"/>", cleanFile.Pattern);
                        ss.WriteLine("                <include name=\"{0}\"/>", cleanFile.Pattern);
                        ss.WriteLine("            </fileset>");
                        ss.WriteLine("        </delete>");
                    }
                }

                ss.WriteLine("        <delete dir=\"${obj.dir}\" failonerror=\"false\" />");
                foreach (ProjectNode project in solution.Projects)
                {
                    string path = Helper.MakePathRelativeTo(solution.FullPath, project.FullPath);
                    ss.Write("        <nant buildfile=\"{0}\"",
                             Helper.NormalizePath(Helper.MakeFilePath(path, project.Name + GetProjectExtension(project), "build"), '/'));
                    ss.WriteLine(" target=\"clean\" />");
                }
                ss.WriteLine("    </target>");
                ss.WriteLine();

                ss.WriteLine("    <target name=\"build\" depends=\"init\" description=\"\">");

                foreach (ProjectNode project in solution.ProjectsTableOrder)
                {
                    string path = Helper.MakePathRelativeTo(solution.FullPath, project.FullPath);
                    ss.Write("        <nant buildfile=\"{0}\"",
                             Helper.NormalizePath(Helper.MakeFilePath(path, project.Name + GetProjectExtension(project), "build"), '/'));
                    ss.WriteLine(" target=\"build\" />");
                }
                ss.WriteLine("    </target>");
                ss.WriteLine();

                ss.WriteLine("    <target name=\"build-release\" depends=\"Release, init, build\" description=\"Builds in Release mode\" />");
                ss.WriteLine();
                ss.WriteLine("    <target name=\"build-debug\" depends=\"Debug, init, build\" description=\"Builds in Debug mode\" />");
                ss.WriteLine();
                //ss.WriteLine("    <target name=\"package\" depends=\"clean, doc, copyfiles, zip\" description=\"Builds in Release mode\" />");
                ss.WriteLine("    <target name=\"package\" depends=\"clean, doc\" description=\"Builds all\" />");
                ss.WriteLine();

                ss.WriteLine("    <target name=\"doc\" depends=\"build-release\">");
                ss.WriteLine("        <echo message=\"Generating all documentation from all builds\" />");
                foreach (ProjectNode project in solution.Projects)
                {
                    string path = Helper.MakePathRelativeTo(solution.FullPath, project.FullPath);
                    ss.Write("        <nant buildfile=\"{0}\"",
                             Helper.NormalizePath(Helper.MakeFilePath(path, project.Name + GetProjectExtension(project), "build"), '/'));
                    ss.WriteLine(" target=\"doc\" />");
                }
                ss.WriteLine("    </target>");
                ss.WriteLine();
                ss.WriteLine("</project>");
            }

            m_Kernel.CurrentWorkingDirectory.Pop();
        }
Example #4
0
        private void WriteCombine(SolutionNode solution)
        {
            m_Kernel.Log.Write("Creating NAnt build files");
            foreach (ProjectNode project in solution.Projects)
            {
                if (m_Kernel.AllowProject(project.FilterGroups))
                {
                    m_Kernel.Log.Write("...Creating project: {0}", project.Name);
                    WriteProject(solution, project);
                }
            }

            m_Kernel.Log.Write("");
            string       combFile = Helper.MakeFilePath(solution.FullPath, solution.Name, "build");
            StreamWriter ss       = new StreamWriter(combFile);

            m_Kernel.CurrentWorkingDirectory.Push();
            Helper.SetCurrentDir(Path.GetDirectoryName(combFile));

            using (ss)
            {
                ss.WriteLine("<?xml version=\"1.0\" ?>");
                ss.WriteLine("<project name=\"{0}\" default=\"build\">", solution.Name);
                ss.WriteLine("    <echo message=\"Using '${nant.settings.currentframework}' Framework\"/>");
                ss.WriteLine();

                //ss.WriteLine("    <property name=\"dist.dir\" value=\"dist\" />");
                //ss.WriteLine("    <property name=\"source.dir\" value=\"source\" />");
                ss.WriteLine("    <property name=\"bin.dir\" value=\"bin\" />");
                ss.WriteLine("    <property name=\"obj.dir\" value=\"obj\" />");
                ss.WriteLine("    <property name=\"doc.dir\" value=\"doc\" />");
                ss.WriteLine("    <property name=\"project.main.dir\" value=\"${project::get-base-directory()}\" />");

                foreach (ConfigurationNode conf in solution.Configurations)
                {
                    // Set the project.config to a non-debug configuration
                    if (conf.Options["DebugInformation"].ToString().ToLower() != "true")
                    {
                        ss.WriteLine("    <property name=\"project.config\" value=\"{0}\" />", conf.Name);
                    }
                    ss.WriteLine();
                    ss.WriteLine("    <target name=\"{0}\" description=\"\">", conf.Name);
                    ss.WriteLine("        <property name=\"project.config\" value=\"{0}\" />", conf.Name);
                    ss.WriteLine("        <property name=\"build.debug\" value=\"{0}\" />", conf.Options["DebugInformation"].ToString().ToLower());
                    ss.WriteLine("    </target>");
                    ss.WriteLine();
                }

                ss.WriteLine("    <target name=\"net-1.1\" description=\"Sets framework to .NET 1.1\">");
                ss.WriteLine("        <property name=\"nant.settings.currentframework\" value=\"net-1.1\" />");
                ss.WriteLine("    </target>");
                ss.WriteLine();

                ss.WriteLine("    <target name=\"net-2.0\" description=\"Sets framework to .NET 2.0\">");
                ss.WriteLine("        <property name=\"nant.settings.currentframework\" value=\"net-2.0\" />");
                ss.WriteLine("    </target>");
                ss.WriteLine();

                ss.WriteLine("    <target name=\"mono-2.0\" description=\"Sets framework to mono 2.0\">");
                ss.WriteLine("        <property name=\"nant.settings.currentframework\" value=\"mono-2.0\" />");
                ss.WriteLine("    </target>");
                ss.WriteLine();

                ss.WriteLine("    <target name=\"mono-1.0\" description=\"Sets framework to mono 1.0\">");
                ss.WriteLine("        <property name=\"nant.settings.currentframework\" value=\"mono-1.0\" />");
                ss.WriteLine("    </target>");
                ss.WriteLine();

                ss.WriteLine("    <target name=\"init\" description=\"\">");
                ss.WriteLine("        <call target=\"${project.config}\" />");
                ss.WriteLine("        <sysinfo />");
                ss.WriteLine("        <echo message=\"Platform ${sys.os.platform}\" />");
                ss.WriteLine("        <property name=\"build.dir\" value=\"${bin.dir}/${project.config}\" />");
                ss.WriteLine("    </target>");
                ss.WriteLine();

                ss.WriteLine("    <target name=\"clean\" description=\"\">");
                ss.WriteLine("        <echo message=\"Deleting all builds from all configurations\" />");
                //ss.WriteLine("        <delete dir=\"${dist.dir}\" failonerror=\"false\" />");
                ss.WriteLine("        <delete dir=\"${bin.dir}\" failonerror=\"false\" />");
                ss.WriteLine("        <delete dir=\"${obj.dir}\" failonerror=\"false\" />");
                foreach (ProjectNode project in solution.Projects)
                {
                    string path = Helper.MakePathRelativeTo(solution.FullPath, project.FullPath);
                    ss.Write("        <nant buildfile=\"{0}\"",
                             Helper.NormalizePath(Helper.MakeFilePath(path, project.Name + (project.Type == ProjectType.Library ? ".dll" : ".exe"), "build"), '/'));
                    ss.WriteLine(" target=\"clean\" />");
                }
                ss.WriteLine("    </target>");
                ss.WriteLine();

                ss.WriteLine("    <target name=\"build\" depends=\"init\" description=\"\">");

                foreach (ProjectNode project in solution.ProjectsTableOrder)
                {
                    string path = Helper.MakePathRelativeTo(solution.FullPath, project.FullPath);
                    ss.Write("        <nant buildfile=\"{0}\"",
                             Helper.NormalizePath(Helper.MakeFilePath(path, project.Name + (project.Type == ProjectType.Library ? ".dll" : ".exe"), "build"), '/'));
                    ss.WriteLine(" target=\"build\" />");
                }
                ss.WriteLine("    </target>");
                ss.WriteLine();

                ss.WriteLine("    <target name=\"build-release\" depends=\"Release, init, build\" description=\"Builds in Release mode\" />");
                ss.WriteLine();
                ss.WriteLine("    <target name=\"build-debug\" depends=\"Debug, init, build\" description=\"Builds in Debug mode\" />");
                ss.WriteLine();
                //ss.WriteLine("    <target name=\"package\" depends=\"clean, doc, copyfiles, zip\" description=\"Builds in Release mode\" />");
                ss.WriteLine("    <target name=\"package\" depends=\"clean, doc\" description=\"Builds all\" />");
                ss.WriteLine();

                ss.WriteLine("    <target name=\"doc\" depends=\"build-release\">");
                ss.WriteLine("        <echo message=\"Generating all documentation from all builds\" />");
                foreach (ProjectNode project in solution.Projects)
                {
                    string path = Helper.MakePathRelativeTo(solution.FullPath, project.FullPath);
                    ss.Write("        <nant buildfile=\"{0}\"",
                             Helper.NormalizePath(Helper.MakeFilePath(path, project.Name + (project.Type == ProjectType.Library ? ".dll" : ".exe"), "build"), '/'));
                    ss.WriteLine(" target=\"doc\" />");
                }
                ss.WriteLine("    </target>");
                ss.WriteLine();
                ss.WriteLine("</project>");
            }

            m_Kernel.CurrentWorkingDirectory.Pop();
        }
Example #5
0
        private void WriteSolution(SolutionNode solution)
        {
            m_Kernel.Log.Write("Creating Visual Studio {0} solution and project files", this.VersionName);

            foreach (ProjectNode project in solution.Projects)
            {
                if (m_Kernel.AllowProject(project.FilterGroups))
                {
                    m_Kernel.Log.Write("...Creating project: {0}", project.Name);
                    WriteProject(solution, project);
                }
            }

            m_Kernel.Log.Write("");
            string       solutionFile = Helper.MakeFilePath(solution.FullPath, solution.Name, "sln");
            StreamWriter ss           = new StreamWriter(solutionFile);

            m_Kernel.CurrentWorkingDirectory.Push();
            Helper.SetCurrentDir(Path.GetDirectoryName(solutionFile));

            using (ss)
            {
                ss.WriteLine("Microsoft Visual Studio Solution File, Format Version {0}", this.SolutionVersion);
                foreach (ProjectNode project in solution.Projects)
                {
                    if (!m_Tools.ContainsKey(project.Language))
                    {
                        throw new UnknownLanguageException("Unknown .NET language: " + project.Language);
                    }

                    ToolInfo toolInfo = (ToolInfo)m_Tools[project.Language];

                    string path = Helper.MakePathRelativeTo(solution.FullPath, project.FullPath);
                    ss.WriteLine("Project(\"{0}\") = \"{1}\", \"{2}\", \"{{{3}}}\"",
                                 toolInfo.Guid, project.Name, Helper.MakeFilePath(path, project.Name,
                                                                                  toolInfo.FileExtension), project.Guid.ToString().ToUpper());

                    ss.WriteLine("\tProjectSection(ProjectDependencies) = postProject");
                    ss.WriteLine("\tEndProjectSection");

                    ss.WriteLine("EndProject");
                }

                ss.WriteLine("Global");

                ss.WriteLine("\tGlobalSection(SolutionConfiguration) = preSolution");
                foreach (ConfigurationNode conf in solution.Configurations)
                {
                    ss.WriteLine("\t\t{0} = {0}", conf.Name);
                }
                ss.WriteLine("\tEndGlobalSection");

                ss.WriteLine("\tGlobalSection(ProjectDependencies) = postSolution");
                foreach (ProjectNode project in solution.Projects)
                {
                    for (int i = 0; i < project.References.Count; i++)
                    {
                        ReferenceNode refr = (ReferenceNode)project.References[i];
                        if (solution.ProjectsTable.ContainsKey(refr.Name))
                        {
                            ProjectNode refProject = (ProjectNode)solution.ProjectsTable[refr.Name];
                            ss.WriteLine("\t\t({{{0}}}).{1} = ({{{2}}})",
                                         project.Guid.ToString().ToUpper()
                                         , i,
                                         refProject.Guid.ToString().ToUpper()
                                         );
                        }
                    }
                }
                ss.WriteLine("\tEndGlobalSection");

                ss.WriteLine("\tGlobalSection(ProjectConfiguration) = postSolution");
                foreach (ProjectNode project in solution.Projects)
                {
                    foreach (ConfigurationNode conf in solution.Configurations)
                    {
                        ss.WriteLine("\t\t{{{0}}}.{1}.ActiveCfg = {1}|.NET",
                                     project.Guid.ToString().ToUpper(),
                                     conf.Name);

                        ss.WriteLine("\t\t{{{0}}}.{1}.Build.0 = {1}|.NET",
                                     project.Guid.ToString().ToUpper(),
                                     conf.Name);
                    }
                }
                ss.WriteLine("\tEndGlobalSection");

                if (solution.Files != null)
                {
                    ss.WriteLine("\tGlobalSection(SolutionItems) = postSolution");
                    foreach (string file in solution.Files)
                    {
                        ss.WriteLine("\t\t{0} = {0}", file);
                    }
                    ss.WriteLine("\tEndGlobalSection");
                }

                ss.WriteLine("\tGlobalSection(ExtensibilityGlobals) = postSolution");
                ss.WriteLine("\tEndGlobalSection");
                ss.WriteLine("\tGlobalSection(ExtensibilityAddIns) = postSolution");
                ss.WriteLine("\tEndGlobalSection");

                ss.WriteLine("EndGlobal");
            }

            m_Kernel.CurrentWorkingDirectory.Pop();
        }
Example #6
0
        private void WriteCombine(SolutionNode solution)
        {
            m_Kernel.Log.Write("Creating NAnt build files");
            foreach (ProjectNode project in solution.Projects)
            {
                if (m_Kernel.AllowProject(project.FilterGroups))
                {
                    m_Kernel.Log.Write("...Creating project: {0}", project.Name);
                    WriteProject(solution, project);
                }
            }

            m_Kernel.Log.Write("");
            string       combFile = Helper.MakeFilePath(solution.FullPath, solution.Name, "build");
            StreamWriter ss       = new StreamWriter(combFile);

            m_Kernel.CurrentWorkingDirectory.Push();
            Helper.SetCurrentDir(Path.GetDirectoryName(combFile));

            using (ss)
            {
                ss.WriteLine("<?xml version=\"1.0\" ?>");
                ss.WriteLine("<project name=\"{0}\" default=\"build\">", solution.Name);
                ss.WriteLine("	  <echo message=\"Using '${nant.settings.currentframework}' Framework\"/>");
                ss.WriteLine();

                //ss.WriteLine("	<property name=\"dist.dir\" value=\"dist\" />");
                //ss.WriteLine("	<property name=\"source.dir\" value=\"source\" />");
                ss.WriteLine("	  <property name=\"bin.dir\" value=\"bin\" />");
                ss.WriteLine("	  <property name=\"obj.dir\" value=\"obj\" />");
                ss.WriteLine("	  <property name=\"doc.dir\" value=\"doc\" />");
                ss.WriteLine("	  <property name=\"project.main.dir\" value=\"${project::get-base-directory()}\" />");

                // actually use active config out of prebuild.xml
                ss.WriteLine("    <property name=\"project.config\" value=\"{0}\" />", solution.ActiveConfig);

                foreach (ConfigurationNode conf in solution.Configurations)
                {
                    ss.WriteLine();
                    ss.WriteLine("	  <target name=\"{0}\" description=\"\">", conf.Name);
                    ss.WriteLine("		  <property name=\"project.config\" value=\"{0}\" />", conf.Name);
                    ss.WriteLine("		  <property name=\"build.debug\" value=\"{0}\" />", conf.Options["DebugInformation"].ToString().ToLower());
                    ss.WriteLine("	  </target>");
                    ss.WriteLine();
                }

                ss.WriteLine("	  <target name=\"net-1.1\" description=\"Sets framework to .NET 1.1\">");
                ss.WriteLine("		  <property name=\"nant.settings.currentframework\" value=\"net-1.1\" />");
                ss.WriteLine("	  </target>");
                ss.WriteLine();

                ss.WriteLine("	  <target name=\"net-2.0\" description=\"Sets framework to .NET 2.0\">");
                ss.WriteLine("		  <property name=\"nant.settings.currentframework\" value=\"net-2.0\" />");
                ss.WriteLine("	  </target>");
                ss.WriteLine();

                ss.WriteLine("	  <target name=\"net-3.5\" description=\"Sets framework to .NET 3.5\">");
                ss.WriteLine("		  <property name=\"nant.settings.currentframework\" value=\"net-3.5\" />");
                ss.WriteLine("	  </target>");
                ss.WriteLine();

                ss.WriteLine("	  <target name=\"mono-1.0\" description=\"Sets framework to mono 1.0\">");
                ss.WriteLine("		  <property name=\"nant.settings.currentframework\" value=\"mono-1.0\" />");
                ss.WriteLine("	  </target>");
                ss.WriteLine();

                ss.WriteLine("	  <target name=\"mono-2.0\" description=\"Sets framework to mono 2.0\">");
                ss.WriteLine("		  <property name=\"nant.settings.currentframework\" value=\"mono-2.0\" />");
                ss.WriteLine("	  </target>");
                ss.WriteLine();

                ss.WriteLine("	  <target name=\"mono-3.5\" description=\"Sets framework to mono 3.5\">");
                ss.WriteLine("        <property name=\"nant.settings.currentframework\" value=\"mono-3.5\" />");
                ss.WriteLine("    </target>");
                ss.WriteLine();

                ss.WriteLine("    <target name=\"init\" description=\"\">");
                ss.WriteLine("        <call target=\"${project.config}\" />");
                ss.WriteLine("        <property name=\"sys.os.platform\"");
                ss.WriteLine("                  value=\"${platform::get-name()}\"");
                ss.WriteLine("                  />");
                ss.WriteLine("        <echo message=\"Platform ${sys.os.platform}\" />");
                ss.WriteLine("        <property name=\"build.dir\" value=\"${bin.dir}/${project.config}\" />");
                ss.WriteLine("    </target>");
                ss.WriteLine();


                // sdague - ok, this is an ugly hack, but what it lets
                // us do is native include of files into the nant
                // created files from all .nant/*include files.  This
                // lets us keep using prebuild, but allows for
                // extended nant targets to do build and the like.

                try
                {
                    Regex         re      = new Regex(".include$");
                    DirectoryInfo nantdir = new DirectoryInfo(".nant");
                    foreach (FileSystemInfo item in nantdir.GetFileSystemInfos())
                    {
                        if (item is DirectoryInfo)
                        {
                        }
                        else if (item is FileInfo)
                        {
                            if (re.Match(((FileInfo)item).FullName) !=
                                System.Text.RegularExpressions.Match.Empty)
                            {
                                Console.WriteLine("Including file: " + ((FileInfo)item).FullName);

                                using (FileStream fs = new FileStream(((FileInfo)item).FullName,
                                                                      FileMode.Open,
                                                                      FileAccess.Read,
                                                                      FileShare.None))
                                {
                                    using (StreamReader sr = new StreamReader(fs))
                                    {
                                        ss.WriteLine("<!-- included from {0} -->", ((FileInfo)item).FullName);
                                        while (sr.Peek() != -1)
                                        {
                                            ss.WriteLine(sr.ReadLine());
                                        }
                                        ss.WriteLine();
                                    }
                                }
                            }
                        }
                    }
                }
                catch { }
                // ss.WriteLine("   <include buildfile=\".nant/local.include\" />");
                //                 ss.WriteLine("    <target name=\"zip\" description=\"\">");
                //                 ss.WriteLine("       <zip zipfile=\"{0}-{1}.zip\">", solution.Name, solution.Version);
                //                 ss.WriteLine("       <fileset basedir=\"${project::get-base-directory()}\">");

                //                 ss.WriteLine("       <include name=\"${project::get-base-directory()}/**/*.cs\" />");
                //                 // ss.WriteLine("       <include name=\"${project.main.dir}/**/*\" />");
                //                 ss.WriteLine("       </fileset>");
                //                 ss.WriteLine("       </zip>");
                //                 ss.WriteLine("        <echo message=\"Building zip target\" />");
                //                 ss.WriteLine("    </target>");
                ss.WriteLine();


                ss.WriteLine("    <target name=\"clean\" description=\"\">");
                ss.WriteLine("        <echo message=\"Deleting all builds from all configurations\" />");
                //ss.WriteLine("        <delete dir=\"${dist.dir}\" failonerror=\"false\" />");
                ss.WriteLine("        <delete failonerror=\"false\">");
                ss.WriteLine("        <fileset basedir=\"${bin.dir}\">");
                ss.WriteLine("            <include name=\"OpenSim*.dll\"/>");
                ss.WriteLine("            <include name=\"OpenSim*.exe\"/>");
                ss.WriteLine("            <include name=\"ScriptEngines/*\"/>");
                ss.WriteLine("            <include name=\"Physics/*\"/>");
                ss.WriteLine("            <exclude name=\"OpenSim.32BitLaunch.exe\"/>");
                ss.WriteLine("            <exclude name=\"ScriptEngines/Default.lsl\"/>");
                ss.WriteLine("        </fileset>");
                ss.WriteLine("        </delete>");
                ss.WriteLine("        <delete dir=\"${obj.dir}\" failonerror=\"false\" />");
                foreach (ProjectNode project in solution.Projects)
                {
                    string path = Helper.MakePathRelativeTo(solution.FullPath, project.FullPath);
                    ss.Write("        <nant buildfile=\"{0}\"",
                             Helper.NormalizePath(Helper.MakeFilePath(path, project.Name + GetProjectExtension(project), "build"), '/'));
                    ss.WriteLine(" target=\"clean\" />");
                }
                ss.WriteLine("    </target>");
                ss.WriteLine();

                ss.WriteLine("    <target name=\"build\" depends=\"init\" description=\"\">");

                foreach (ProjectNode project in solution.ProjectsTableOrder)
                {
                    string path = Helper.MakePathRelativeTo(solution.FullPath, project.FullPath);
                    ss.Write("        <nant buildfile=\"{0}\"",
                             Helper.NormalizePath(Helper.MakeFilePath(path, project.Name + GetProjectExtension(project), "build"), '/'));
                    ss.WriteLine(" target=\"build\" />");
                }
                ss.WriteLine("    </target>");
                ss.WriteLine();

                ss.WriteLine("    <target name=\"build-release\" depends=\"Release, init, build\" description=\"Builds in Release mode\" />");
                ss.WriteLine();
                ss.WriteLine("    <target name=\"build-debug\" depends=\"Debug, init, build\" description=\"Builds in Debug mode\" />");
                ss.WriteLine();
                //ss.WriteLine("    <target name=\"package\" depends=\"clean, doc, copyfiles, zip\" description=\"Builds in Release mode\" />");
                ss.WriteLine("    <target name=\"package\" depends=\"clean, doc\" description=\"Builds all\" />");
                ss.WriteLine();

                ss.WriteLine("    <target name=\"doc\" depends=\"build-release\">");
                ss.WriteLine("        <echo message=\"Generating all documentation from all builds\" />");
                foreach (ProjectNode project in solution.Projects)
                {
                    string path = Helper.MakePathRelativeTo(solution.FullPath, project.FullPath);
                    ss.Write("        <nant buildfile=\"{0}\"",
                             Helper.NormalizePath(Helper.MakeFilePath(path, project.Name + GetProjectExtension(project), "build"), '/'));
                    ss.WriteLine(" target=\"doc\" />");
                }
                ss.WriteLine("    </target>");
                ss.WriteLine();
                ss.WriteLine("</project>");
            }

            m_Kernel.CurrentWorkingDirectory.Pop();
        }
Example #7
0
        private void WriteCombine(SolutionNode solution)
        {
            /* TODO: These vars should be pulled from the prebuild.xml file */
            string releaseVersion  = "2.0.0";
            string assemblyVersion = "2.1.0.0";
            string description     =
                "Tao Framework " + solution.Name + " Binding For .NET";

            hasLibrary = false;
            m_Kernel.Log.Write("Creating Autotools make files");
            foreach (ProjectNode project in solution.Projects)
            {
                if (m_Kernel.AllowProject(project.FilterGroups))
                {
                    m_Kernel.Log.Write("...Creating makefile: {0}", project.Name);
                    WriteProject(solution, project);
                }
            }

            m_Kernel.Log.Write("");
            string       combFile = Helper.MakeFilePath(solution.FullPath, "Makefile", "am");
            StreamWriter ss       = new StreamWriter(combFile);

            ss.NewLine = "\n";

            m_Kernel.CurrentWorkingDirectory.Push();
            Helper.SetCurrentDir(Path.GetDirectoryName(combFile));

            using (ss)
            {
                foreach (ProjectNode project in solution.ProjectsTableOrder)
                {
                    if (project.Type == ProjectType.Library)
                    {
                        hasLibrary = true;
                        break;
                    }
                }

                if (hasLibrary)
                {
                    ss.Write("pkgconfig_in_files = ");
                    foreach (ProjectNode project in solution.ProjectsTableOrder)
                    {
                        if (project.Type == ProjectType.Library)
                        {
                            string combFilepc = Helper.MakeFilePath(solution.FullPath, project.Name, "pc.in");
                            ss.Write(" " + project.Name + ".pc.in ");
                            StreamWriter sspc = new StreamWriter(combFilepc);
                            sspc.NewLine = "\n";
                            using (sspc)
                            {
                                sspc.WriteLine("prefix=@prefix@");
                                sspc.WriteLine("exec_prefix=${prefix}");
                                sspc.WriteLine("libdir=${exec_prefix}/lib");
                                sspc.WriteLine();
                                sspc.WriteLine("Name: @PACKAGE_NAME@");
                                sspc.WriteLine("Description: @DESCRIPTION@");
                                sspc.WriteLine("Version: @ASSEMBLY_VERSION@");
                                sspc.WriteLine("Libs:  -r:${libdir}/mono/gac/@PACKAGE_NAME@/@ASSEMBLY_VERSION@__@PUBKEY@/@[email protected]");
                            }
                        }
                    }

                    ss.WriteLine();
                    ss.WriteLine("pkgconfigdir=$(prefix)/lib/pkgconfig");
                    ss.WriteLine("pkgconfig_DATA=$(pkgconfig_in_files:.pc.in=.pc)");
                }
                ss.WriteLine();
                foreach (ProjectNode project in solution.ProjectsTableOrder)
                {
                    string path = Helper.MakePathRelativeTo(solution.FullPath, project.FullPath);
                    ss.WriteLine("-include x {0}",
                                 Helper.NormalizePath(Helper.MakeFilePath(path, "Include", "am"), '/'));
                }
                ss.WriteLine();
                ss.WriteLine("all: \\");
                ss.Write("\t");
                foreach (ProjectNode project in solution.ProjectsTableOrder)
                {
                    string path = Helper.MakePathRelativeTo(solution.FullPath, project.FullPath);
                    ss.Write(Helper.AssemblyFullName(project.AssemblyName, project.Type) + " ");
                }
                ss.WriteLine();
                if (hasLibrary)
                {
                    ss.WriteLine("EXTRA_DIST = \\");
                    ss.WriteLine("\t$(pkgconfig_in_files)");
                }
                else
                {
                    ss.WriteLine("EXTRA_DIST = ");
                }
                ss.WriteLine();
                ss.WriteLine("DISTCLEANFILES = \\");
                ss.WriteLine("\tconfigure \\");
                ss.WriteLine("\tMakefile.in  \\");
                ss.WriteLine("\taclocal.m4");
            }
            combFile = Helper.MakeFilePath(solution.FullPath, "configure", "ac");
            StreamWriter ts = new StreamWriter(combFile);

            ts.NewLine = "\n";
            using (ts)
            {
                if (this.hasLibrary)
                {
                    foreach (ProjectNode project in solution.ProjectsTableOrder)
                    {
                        if (project.Type == ProjectType.Library)
                        {
                            ts.WriteLine("AC_INIT(" + project.Name + ".pc.in)");
                            break;
                        }
                    }
                }
                else
                {
                    ts.WriteLine("AC_INIT(Makefile.am)");
                }
                ts.WriteLine("AC_PREREQ(2.53)");
                ts.WriteLine("AC_CANONICAL_SYSTEM");

                ts.WriteLine("PACKAGE_NAME={0}", solution.Name);
                ts.WriteLine("PACKAGE_VERSION={0}", releaseVersion);
                ts.WriteLine("DESCRIPTION=\"{0}\"", description);
                ts.WriteLine("AC_SUBST(DESCRIPTION)");
                ts.WriteLine("AM_INIT_AUTOMAKE([$PACKAGE_NAME],[$PACKAGE_VERSION],[$DESCRIPTION])");

                ts.WriteLine("ASSEMBLY_VERSION={0}", assemblyVersion);
                ts.WriteLine("AC_SUBST(ASSEMBLY_VERSION)");

                ts.WriteLine("PUBKEY=`sn -t $PACKAGE_NAME.snk | grep 'Public Key Token' | awk -F: '{print $2}' | sed -e 's/^ //'`");
                ts.WriteLine("AC_SUBST(PUBKEY)");

                ts.WriteLine();
                ts.WriteLine("AM_MAINTAINER_MODE");
                ts.WriteLine();
                ts.WriteLine("dnl AC_PROG_INTLTOOL([0.25])");
                ts.WriteLine();
                ts.WriteLine("AC_PROG_INSTALL");
                ts.WriteLine();
                ts.WriteLine("MONO_REQUIRED_VERSION=1.1");
                ts.WriteLine();
                ts.WriteLine("AC_MSG_CHECKING([whether we're compiling from CVS])");
                ts.WriteLine("if test -f \"$srcdir/.cvs_version\" ; then");
                ts.WriteLine("        from_cvs=yes");
                ts.WriteLine("else");
                ts.WriteLine("  if test -f \"$srcdir/.svn\" ; then");
                ts.WriteLine("        from_cvs=yes");
                ts.WriteLine("  else");
                ts.WriteLine("        from_cvs=no");
                ts.WriteLine("  fi");
                ts.WriteLine("fi");
                ts.WriteLine();
                ts.WriteLine("AC_MSG_RESULT($from_cvs)");
                ts.WriteLine();
                ts.WriteLine("AC_PATH_PROG(MONO, mono)");
                ts.WriteLine("AC_PATH_PROG(GMCS, gmcs)");
                ts.WriteLine("AC_PATH_PROG(GACUTIL, gacutil)");
                ts.WriteLine();
                ts.WriteLine("AC_MSG_CHECKING([for mono])");
                ts.WriteLine("dnl if test \"x$MONO\" = \"x\" ; then");
                ts.WriteLine("dnl  AC_MSG_ERROR([Can't find \"mono\" in your PATH])");
                ts.WriteLine("dnl else");
                ts.WriteLine("  AC_MSG_RESULT([found])");
                ts.WriteLine("dnl fi");
                ts.WriteLine();
                ts.WriteLine("AC_MSG_CHECKING([for gmcs])");
                ts.WriteLine("dnl if test \"x$GMCS\" = \"x\" ; then");
                ts.WriteLine("dnl  AC_MSG_ERROR([Can't find \"gmcs\" in your PATH])");
                ts.WriteLine("dnl else");
                ts.WriteLine("  AC_MSG_RESULT([found])");
                ts.WriteLine("dnl fi");
                ts.WriteLine();
                //ts.WriteLine("AC_MSG_CHECKING([for gacutil])");
                //ts.WriteLine("if test \"x$GACUTIL\" = \"x\" ; then");
                //ts.WriteLine("  AC_MSG_ERROR([Can't find \"gacutil\" in your PATH])");
                //ts.WriteLine("else");
                //ts.WriteLine("  AC_MSG_RESULT([found])");
                //ts.WriteLine("fi");
                ts.WriteLine();
                ts.WriteLine("AC_SUBST(PATH)");
                ts.WriteLine("AC_SUBST(LD_LIBRARY_PATH)");
                ts.WriteLine();
                ts.WriteLine("dnl CSFLAGS=\"-debug -nowarn:1574\"");
                ts.WriteLine("CSFLAGS=\"\"");
                ts.WriteLine("AC_SUBST(CSFLAGS)");
                ts.WriteLine();
                //				ts.WriteLine("AC_MSG_CHECKING(--disable-sdl argument)");
                //				ts.WriteLine("AC_ARG_ENABLE(sdl,");
                //				ts.WriteLine("    [  --disable-sdl         Disable Sdl interface.],");
                //				ts.WriteLine("    [disable_sdl=$disableval],");
                //				ts.WriteLine("    [disable_sdl=\"no\"])");
                //				ts.WriteLine("AC_MSG_RESULT($disable_sdl)");
                //				ts.WriteLine("if test \"$disable_sdl\" = \"yes\"; then");
                //				ts.WriteLine("  AC_DEFINE(FEAT_SDL)");
                //				ts.WriteLine("fi");
                ts.WriteLine();
                ts.WriteLine("dnl Find pkg-config");
                ts.WriteLine("AC_PATH_PROG(PKGCONFIG, pkg-config, no)");
                ts.WriteLine("if test \"x$PKG_CONFIG\" = \"xno\"; then");
                ts.WriteLine("        AC_MSG_ERROR([You need to install pkg-config])");
                ts.WriteLine("fi");
                ts.WriteLine();
                ts.WriteLine("PKG_CHECK_MODULES(MONO_DEPENDENCY, mono >= $MONO_REQUIRED_VERSION, has_mono=true, has_mono=false)");
                ts.WriteLine("BUILD_DIR=\"bin\"");
                ts.WriteLine("AC_SUBST(BUILD_DIR)");
                ts.WriteLine("CONFIG=\"Release\"");
                ts.WriteLine("AC_SUBST(CONFIG)");
                ts.WriteLine();
                ts.WriteLine("if test \"x$has_mono\" = \"xtrue\"; then");
                ts.WriteLine("  AC_PATH_PROG(RUNTIME, mono, no)");
                ts.WriteLine("  AC_PATH_PROG(CSC, gmcs, no)");
                ts.WriteLine("  if test `uname -s` = \"Darwin\"; then");
                ts.WriteLine("        LIB_PREFIX=");
                ts.WriteLine("        LIB_SUFFIX=.dylib");
                ts.WriteLine("  else");
                ts.WriteLine("        LIB_PREFIX=.so");
                ts.WriteLine("        LIB_SUFFIX=");
                ts.WriteLine("  fi");
                ts.WriteLine("else");
                ts.WriteLine("  AC_PATH_PROG(CSC, csc.exe, no)");
                ts.WriteLine("  if test x$CSC = \"xno\"; then");
                ts.WriteLine("        AC_MSG_ERROR([You need to install either mono or .Net])");
                ts.WriteLine("  else");
                ts.WriteLine("    RUNTIME=");
                ts.WriteLine("    LIB_PREFIX=");
                ts.WriteLine("    LIB_SUFFIX=.dylib");
                ts.WriteLine("  fi");
                ts.WriteLine("fi");
                ts.WriteLine();
                ts.WriteLine("AC_SUBST(LIB_PREFIX)");
                ts.WriteLine("AC_SUBST(LIB_SUFFIX)");
                ts.WriteLine();
                ts.WriteLine("AC_SUBST(BASE_DEPENDENCIES_CFLAGS)");
                ts.WriteLine("AC_SUBST(BASE_DEPENDENCIES_LIBS)");
                ts.WriteLine();
                ts.WriteLine("dnl Find monodoc");
                ts.WriteLine("MONODOC_REQUIRED_VERSION=1.0");
                ts.WriteLine("AC_SUBST(MONODOC_REQUIRED_VERSION)");
                ts.WriteLine("PKG_CHECK_MODULES(MONODOC_DEPENDENCY, monodoc >= $MONODOC_REQUIRED_VERSION, enable_monodoc=yes, enable_monodoc=no)");
                ts.WriteLine();
                ts.WriteLine("if test \"x$enable_monodoc\" = \"xyes\"; then");
                ts.WriteLine("        AC_PATH_PROG(MONODOC, monodoc, no)");
                ts.WriteLine("        if test x$MONODOC = xno; then");
                ts.WriteLine("           enable_monodoc=no");
                ts.WriteLine("        fi");
                ts.WriteLine("else");
                ts.WriteLine("        MONODOC=");
                ts.WriteLine("fi");
                ts.WriteLine();
                ts.WriteLine("AC_SUBST(MONODOC)");
                ts.WriteLine("AM_CONDITIONAL(ENABLE_MONODOC, test \"x$enable_monodoc\" = \"xyes\")");
                ts.WriteLine();
                ts.WriteLine("AC_PATH_PROG(GACUTIL, gacutil, no)");
                ts.WriteLine("if test \"x$GACUTIL\" = \"xno\" ; then");
                ts.WriteLine("        AC_MSG_ERROR([No gacutil tool found])");
                ts.WriteLine("fi");
                ts.WriteLine();
                //				foreach(ProjectNode project in solution.ProjectsTableOrder)
                //				{
                //					if (project.Type == ProjectType.Library)
                //					{
                //					}
                //				}
                ts.WriteLine("GACUTIL_FLAGS='/package $(PACKAGE_NAME) /gacdir $(DESTDIR)$(prefix)'");
                ts.WriteLine("AC_SUBST(GACUTIL_FLAGS)");
                ts.WriteLine();
                ts.WriteLine("winbuild=no");
                ts.WriteLine("case \"$host\" in");
                ts.WriteLine("       *-*-mingw*|*-*-cygwin*)");
                ts.WriteLine("               winbuild=yes");
                ts.WriteLine("               ;;");
                ts.WriteLine("esac");
                ts.WriteLine("AM_CONDITIONAL(WINBUILD, test x$winbuild = xyes)");
                ts.WriteLine();
                //				ts.WriteLine("dnl Check for SDL");
                //				ts.WriteLine();
                //				ts.WriteLine("AC_PATH_PROG([SDL_CONFIG], [sdl-config])");
                //				ts.WriteLine("have_sdl=no");
                //				ts.WriteLine("if test -n \"${SDL_CONFIG}\"; then");
                //				ts.WriteLine("    have_sdl=yes");
                //				ts.WriteLine("    SDL_CFLAGS=`$SDL_CONFIG --cflags`");
                //				ts.WriteLine("    SDL_LIBS=`$SDL_CONFIG --libs`");
                //				ts.WriteLine("    #");
                //				ts.WriteLine("    # sdl-config sometimes emits an rpath flag pointing at its library");
                //				ts.WriteLine("    # installation directory.  We don't want this, as it prevents users from");
                //				ts.WriteLine("    # linking sdl-viewer against, for example, a locally compiled libGL when a");
                //				ts.WriteLine("    # version of the library also exists in SDL's library installation");
                //				ts.WriteLine("    # directory, typically /usr/lib.");
                //				ts.WriteLine("    #");
                //				ts.WriteLine("    SDL_LIBS=`echo $SDL_LIBS | sed 's/-Wl,-rpath,[[^ ]]* //'`");
                //				ts.WriteLine("fi");
                //				ts.WriteLine("AC_SUBST([SDL_CFLAGS])");
                //				ts.WriteLine("AC_SUBST([SDL_LIBS])");
                ts.WriteLine();
                ts.WriteLine("AC_OUTPUT([");
                ts.WriteLine("Makefile");
                // TODO: this does not work quite right.
                //ts.WriteLine("Properties/AssemblyInfo.cs");
                foreach (ProjectNode project in solution.ProjectsTableOrder)
                {
                    if (project.Type == ProjectType.Library)
                    {
                        ts.WriteLine(project.Name + ".pc");
                    }
                    //					string path = Helper.MakePathRelativeTo(solution.FullPath, project.FullPath);
                    //					ts.WriteLine(Helper.NormalizePath(Helper.MakeFilePath(path, "Include"),'/'));
                }
                ts.WriteLine("])");
                ts.WriteLine();
                ts.WriteLine("#po/Makefile.in");
                ts.WriteLine();
                ts.WriteLine("echo \"---\"");
                ts.WriteLine("echo \"Configuration summary\"");
                ts.WriteLine("echo \"\"");
                ts.WriteLine("echo \"   * Installation prefix: $prefix\"");
                ts.WriteLine("echo \"   * compiler:            $CSC\"");
                ts.WriteLine("echo \"   * Documentation:       $enable_monodoc ($MONODOC)\"");
                ts.WriteLine("echo \"   * Package Name:        $PACKAGE_NAME\"");
                ts.WriteLine("echo \"   * Version:             $PACKAGE_VERSION\"");
                ts.WriteLine("echo \"   * Public Key:          $PUBKEY\"");
                ts.WriteLine("echo \"\"");
                ts.WriteLine("echo \"---\"");
                ts.WriteLine();
            }

            ts.NewLine = "\n";
            foreach (ProjectNode project in solution.ProjectsTableOrder)
            {
                if (project.GenerateAssemblyInfoFile)
                {
                    GenerateAssemblyInfoFile(solution, combFile);
                }
            }
        }