From f36fe45fa7468dd6e785d523c5df38666140135f Mon Sep 17 00:00:00 2001 From: BlueWall Date: Sun, 25 Dec 2011 00:04:42 -0500 Subject: Add Copy task to Prebuild.exe (vsxxxx targets) --- Prebuild/src/Core/Nodes/FilesNode.cs | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) (limited to 'Prebuild/src/Core/Nodes/FilesNode.cs') 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 using System; using System.Collections.Generic; +using System.Collections.Specialized; using System.Xml; using Prebuild.Core.Attributes; @@ -49,6 +50,8 @@ namespace Prebuild.Core.Nodes private readonly Dictionary m_Links = new Dictionary(); private readonly Dictionary m_LinkPaths = new Dictionary(); private readonly Dictionary m_PreservePaths = new Dictionary(); + private readonly Dictionary m_DestinationPath = new Dictionary(); + private readonly NameValueCollection m_CopyFiles = new NameValueCollection(); #endregion @@ -62,6 +65,16 @@ namespace Prebuild.Core.Nodes } } + public string[] Destinations + { + get { return m_CopyFiles.AllKeys; } + } + + public int CopyFiles + { + get { return m_CopyFiles.Count; } + } + #endregion #region Public Methods @@ -76,6 +89,20 @@ namespace Prebuild.Core.Nodes return m_BuildActions[file]; } + public string GetDestinationPath(string file) + { + if( !m_DestinationPath.ContainsKey(file)) + { + return null; + } + return m_DestinationPath[file]; + } + + public string[] SourceFiles(string dest) + { + return m_CopyFiles.GetValues(dest); + } + public CopyToOutput GetCopyToOutput(string file) { if (!m_CopyToOutputs.ContainsKey(file)) @@ -178,6 +205,13 @@ namespace Prebuild.Core.Nodes m_BuildActions[file] = GetBuildActionByFileName(file); else m_BuildActions[file] = matchNode.BuildAction.Value; + + if (matchNode.BuildAction == BuildAction.Copy) + { + m_CopyFiles.Add(matchNode.DestinationPath, file); + m_DestinationPath[file] = matchNode.DestinationPath; + } + m_SubTypes[file] = matchNode.SubType == null ? GetSubTypeByFileName(file) : matchNode.SubType.Value; m_ResourceNames[ file ] = matchNode.ResourceName; m_PreservePaths[ file ] = matchNode.PreservePath; -- cgit v1.1