diff options
Diffstat (limited to 'Prebuild/src/Core/Nodes/FilesNode.cs')
-rw-r--r-- | Prebuild/src/Core/Nodes/FilesNode.cs | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/Prebuild/src/Core/Nodes/FilesNode.cs b/Prebuild/src/Core/Nodes/FilesNode.cs index 23a716c..16658f3 100644 --- a/Prebuild/src/Core/Nodes/FilesNode.cs +++ b/Prebuild/src/Core/Nodes/FilesNode.cs | |||
@@ -25,6 +25,7 @@ IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY O | |||
25 | 25 | ||
26 | using System; | 26 | using System; |
27 | using System.Collections.Generic; | 27 | using System.Collections.Generic; |
28 | using System.Collections.Specialized; | ||
28 | using System.Xml; | 29 | using System.Xml; |
29 | 30 | ||
30 | using Prebuild.Core.Attributes; | 31 | using Prebuild.Core.Attributes; |
@@ -49,6 +50,8 @@ namespace Prebuild.Core.Nodes | |||
49 | private readonly Dictionary<string, bool> m_Links = new Dictionary<string, bool>(); | 50 | private readonly Dictionary<string, bool> m_Links = new Dictionary<string, bool>(); |
50 | private readonly Dictionary<string, string> m_LinkPaths = new Dictionary<string, string>(); | 51 | private readonly Dictionary<string, string> m_LinkPaths = new Dictionary<string, string>(); |
51 | private readonly Dictionary<string, bool> m_PreservePaths = new Dictionary<string, bool>(); | 52 | private readonly Dictionary<string, bool> m_PreservePaths = new Dictionary<string, bool>(); |
53 | private readonly Dictionary<string, string> m_DestinationPath = new Dictionary<string, string>(); | ||
54 | private readonly NameValueCollection m_CopyFiles = new NameValueCollection(); | ||
52 | 55 | ||
53 | #endregion | 56 | #endregion |
54 | 57 | ||
@@ -62,6 +65,16 @@ namespace Prebuild.Core.Nodes | |||
62 | } | 65 | } |
63 | } | 66 | } |
64 | 67 | ||
68 | public string[] Destinations | ||
69 | { | ||
70 | get { return m_CopyFiles.AllKeys; } | ||
71 | } | ||
72 | |||
73 | public int CopyFiles | ||
74 | { | ||
75 | get { return m_CopyFiles.Count; } | ||
76 | } | ||
77 | |||
65 | #endregion | 78 | #endregion |
66 | 79 | ||
67 | #region Public Methods | 80 | #region Public Methods |
@@ -76,6 +89,20 @@ namespace Prebuild.Core.Nodes | |||
76 | return m_BuildActions[file]; | 89 | return m_BuildActions[file]; |
77 | } | 90 | } |
78 | 91 | ||
92 | public string GetDestinationPath(string file) | ||
93 | { | ||
94 | if( !m_DestinationPath.ContainsKey(file)) | ||
95 | { | ||
96 | return null; | ||
97 | } | ||
98 | return m_DestinationPath[file]; | ||
99 | } | ||
100 | |||
101 | public string[] SourceFiles(string dest) | ||
102 | { | ||
103 | return m_CopyFiles.GetValues(dest); | ||
104 | } | ||
105 | |||
79 | public CopyToOutput GetCopyToOutput(string file) | 106 | public CopyToOutput GetCopyToOutput(string file) |
80 | { | 107 | { |
81 | if (!m_CopyToOutputs.ContainsKey(file)) | 108 | if (!m_CopyToOutputs.ContainsKey(file)) |
@@ -178,6 +205,13 @@ namespace Prebuild.Core.Nodes | |||
178 | m_BuildActions[file] = GetBuildActionByFileName(file); | 205 | m_BuildActions[file] = GetBuildActionByFileName(file); |
179 | else | 206 | else |
180 | m_BuildActions[file] = matchNode.BuildAction.Value; | 207 | m_BuildActions[file] = matchNode.BuildAction.Value; |
208 | |||
209 | if (matchNode.BuildAction == BuildAction.Copy) | ||
210 | { | ||
211 | m_CopyFiles.Add(matchNode.DestinationPath, file); | ||
212 | m_DestinationPath[file] = matchNode.DestinationPath; | ||
213 | } | ||
214 | |||
181 | m_SubTypes[file] = matchNode.SubType == null ? GetSubTypeByFileName(file) : matchNode.SubType.Value; | 215 | m_SubTypes[file] = matchNode.SubType == null ? GetSubTypeByFileName(file) : matchNode.SubType.Value; |
182 | m_ResourceNames[ file ] = matchNode.ResourceName; | 216 | m_ResourceNames[ file ] = matchNode.ResourceName; |
183 | m_PreservePaths[ file ] = matchNode.PreservePath; | 217 | m_PreservePaths[ file ] = matchNode.PreservePath; |