aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Prebuild/src/Core/Nodes/DataNode.cs
diff options
context:
space:
mode:
authorlbsa712009-02-19 12:48:38 +0000
committerlbsa712009-02-19 12:48:38 +0000
commitdd9640cda82bca8125289f292238ea6b447cc6e9 (patch)
tree5f558fa38e4c03b05eb5b91cc9db7ff2363c0b48 /Prebuild/src/Core/Nodes/DataNode.cs
parentreverted last revision, until we decide how to handle capturing IM's (diff)
downloadopensim-SC_OLD-dd9640cda82bca8125289f292238ea6b447cc6e9.zip
opensim-SC_OLD-dd9640cda82bca8125289f292238ea6b447cc6e9.tar.gz
opensim-SC_OLD-dd9640cda82bca8125289f292238ea6b447cc6e9.tar.bz2
opensim-SC_OLD-dd9640cda82bca8125289f292238ea6b447cc6e9.tar.xz
=== PREBUILD UPSTREAMS UPDATE : POTENTIAL BREAKAGE ===
* Applied upstreams changes to allow for auditing and debugging in our various environments. * This should, in theory, bring back 'multiple ref dirs'. * Temporarily Removed xmlns because prebuild-1.7 schema does not allow for multiple solutions per prebuild node (This will be a moot issue once the Prebuild node is moved out of prebuild.xml) * Autotools target: Various minor fixes * MonoDevelop Target : No changes. * Nant Target: Various minor fixes, support for net-3.5 and mono-2.0/3.5 targets * Sharpdevelop targets: No changes. * VS Targets: Refactored into using VSGenericTarget, and supports 2.0-3.5 * XCode Target: No changes. --- Regressions and outstanding issues --- * The Solution is assigned a random Guid - will lead to unnecessary reloads and loss of user settings. --- New features of Prebuild 2.0.4 --- * (Better) support for Web, WinForms and Database Projects and build actions * Conditional Framework Version compilation support (1.1, 2.0-3.5) * ArrayList -> List<>, ICollection -> IList (this means Prebuild can generate 1.1 solutions, but can't itself be built under 1.1 - how very meta) * Added <?include file="sub_prebuild.xml" ?> preprocessor directive.
Diffstat (limited to 'Prebuild/src/Core/Nodes/DataNode.cs')
-rw-r--r--Prebuild/src/Core/Nodes/DataNode.cs59
1 files changed, 47 insertions, 12 deletions
diff --git a/Prebuild/src/Core/Nodes/DataNode.cs b/Prebuild/src/Core/Nodes/DataNode.cs
index 60ed122..763e6c3 100644
--- a/Prebuild/src/Core/Nodes/DataNode.cs
+++ b/Prebuild/src/Core/Nodes/DataNode.cs
@@ -23,31 +23,24 @@ IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY O
23*/ 23*/
24#endregion 24#endregion
25 25
26#region CVS Information
27/*
28 * $Source$
29 * $Author: jendave $
30 * $Date: 2006-01-28 09:49:58 +0900 (Sat, 28 Jan 2006) $
31 * $Revision: 71 $
32 */
33#endregion
34
35using System; 26using System;
36using System.Xml; 27using System.Xml;
37 28
38using Prebuild.Core.Attributes; 29using Prebuild.Core.Attributes;
39using Prebuild.Core.Interfaces; 30using Prebuild.Core.Interfaces;
31using System.IO;
40 32
41namespace Prebuild.Core.Nodes 33namespace Prebuild.Core.Nodes
42{ 34{
43 /// <summary> 35 /// <summary>
44 /// 36 ///
45 /// </summary> 37 /// </summary>
46 public class DataNode : IDataNode 38 public abstract class DataNode : IDataNode
47 { 39 {
48 #region Fields 40 #region Fields
49 41
50 private IDataNode parent; 42 private IDataNode parent;
43 string[] m_WebTypes = new string[] { "aspx", "ascx", "master", "ashx", "asmx" };
51 44
52 #endregion 45 #endregion
53 46
@@ -68,7 +61,10 @@ namespace Prebuild.Core.Nodes
68 parent = value; 61 parent = value;
69 } 62 }
70 } 63 }
71 64 public string[] WebTypes
65 {
66 get { return m_WebTypes; }
67 }
72 /// <summary> 68 /// <summary>
73 /// Parses the specified node. 69 /// Parses the specified node.
74 /// </summary> 70 /// </summary>
@@ -76,7 +72,46 @@ namespace Prebuild.Core.Nodes
76 public virtual void Parse(XmlNode node) 72 public virtual void Parse(XmlNode node)
77 { 73 {
78 } 74 }
79 75 public BuildAction GetBuildActionByFileName(string fileName)
76 {
77 string extension = Path.GetExtension(fileName).ToLower();
78 foreach (string type in WebTypes)
79 {
80 if (extension == type)
81 return BuildAction.Content;
82 }
83 return BuildAction.Compile;
84 }
85 /// <summary>
86 /// Parses the file type to figure out what type it is
87 /// </summary>
88 /// <returns></returns>
89 public SubType GetSubTypeByFileName(string fileName)
90 {
91 string extension = System.IO.Path.GetExtension(fileName).ToLower();
92 string designer = String.Format(".designer{0}", extension);
93 string path = fileName.ToLower();
94 if (extension == ".resx")
95 {
96 return SubType.Designer;
97 }
98 else if (path.EndsWith(".settings"))
99 {
100 return SubType.Settings;
101 }
102 else
103 {
104
105 foreach (string type in WebTypes)
106 {
107 if (path.EndsWith(string.Format("{0}{1}", type, extension)))
108 {
109 return SubType.CodeBehind;
110 }
111 }
112 }
113 return SubType.Code;
114 }
80 #endregion 115 #endregion
81 } 116 }
82} 117}