예제 #1
0
        //////////////////////////////////////////////////////////////////////////
        /// <summary>
        /// Load NAnt script file in the controller.
        /// </summary>
        //////////////////////////////////////////////////////////////////////////

        public void LoadFile(string filename)
        {
            if (m_Filename != null)
            {
                m_NantTree = XmlTreeFactory.CreateXmlTree(filename, false);
            }
            else
            {
                m_NantTree = null;
            }
        }
예제 #2
0
        //////////////////////////////////////////////////////////////////////////
        /// <summary>
        /// Insert script tree from include file in a XmlTree.
        /// </summary>
        /// <param name="folder">Folder base of the includer file.</param>
        /// <param name="tree">XmlTree to be updated.</param>
        //////////////////////////////////////////////////////////////////////////

        private static void ParseIncludeFiles(string folder, XmlTree tree)
        {
            foreach (XmlNode include in tree.Includes)
            {
                // Path of included file
                string includedPath = "";

                try
                {
                    // Try to combine the folder base and include path
                    includedPath = Path.Combine(folder, include[AppConstants.NANT_XML_BUILDFILE]);
                }
                catch
                {
                }

                // Build tree from file
                XmlTree subTree = XmlTreeFactory.CreateXmlTree(includedPath.ToString(), true);

                // Add to the main tree
                tree.Root.Add(subTree.Root.Children);
            }
        }