diff --git a/Source/GlobalAssemblyInfo.cs b/Source/GlobalAssemblyInfo.cs index 765a0ed9..f49fb032 100644 --- a/Source/GlobalAssemblyInfo.cs +++ b/Source/GlobalAssemblyInfo.cs @@ -14,34 +14,36 @@ using System.Runtime.CompilerServices; using System.Runtime.InteropServices; -[assembly: AssemblyCompany("https://github.com/loresoft/msbuildtasks/")] +[assembly: AssemblyCompany("https://github.com/ramonsmits/msbuildtasks")] [assembly: AssemblyProduct("MSBuild.Community.Tasks")] -[assembly: AssemblyCopyright("Copyright © 2012 MSBuild Community Tasks Project")] -[assembly: AssemblyConfiguration("Commit 8663c5c")] +[assembly: AssemblyCopyright("Copyright © 2013 MSBuild Community Tasks Project")] +[assembly: AssemblyConfiguration("dev")] [assembly: ComVisible(false)] [assembly: CLSCompliant(false)] [assembly: AssemblyVersion("1.4.0.0")] -[assembly: AssemblyFileVersion("1.4.0.0")] -[assembly: AssemblyInformationalVersion("1.4.0.0")] - - - -internal sealed partial class ThisAssembly { - - internal const string AssemblyCompany = "https://github.com/loresoft/msbuildtasks/"; - - internal const string AssemblyProduct = "MSBuild.Community.Tasks"; - - internal const string AssemblyCopyright = "Copyright © 2012 MSBuild Community Tasks Project"; - - internal const string AssemblyConfiguration = "Commit 8663c5c"; - - internal const string AssemblyVersion = "1.4.0.0"; - - internal const string AssemblyFileVersion = "1.4.0.0"; - - internal const string AssemblyInformationalVersion = "1.4.0.0"; - - private ThisAssembly() { - } +[assembly: AssemblyFileVersion("1.4.0")] +[assembly: AssemblyInformationalVersion("1.4.0;dev")] + + + +internal sealed partial class ThisAssembly +{ + + internal const string AssemblyCompany = "https://github.com/ramonsmits/msbuildtasks/"; + + internal const string AssemblyProduct = "MSBuild.Community.Tasks"; + + internal const string AssemblyCopyright = "Copyright © 2013 MSBuild Community Tasks Project"; + + internal const string AssemblyConfiguration = "dev"; + + internal const string AssemblyVersion = "1.4.0.0"; + + internal const string AssemblyFileVersion = "1.4.0"; + + internal const string AssemblyInformationalVersion = "1.4.0;dev"; + + private ThisAssembly() + { + } } diff --git a/Source/MSBuild.Community.Tasks/JavaScript/CssCompress.cs b/Source/MSBuild.Community.Tasks/JavaScript/CssCompress.cs deleted file mode 100644 index b13d7e53..00000000 --- a/Source/MSBuild.Community.Tasks/JavaScript/CssCompress.cs +++ /dev/null @@ -1,227 +0,0 @@ -#region Copyright © 2005 Paul Welter. All rights reserved. -/* -Copyright © 2005 Paul Welter. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -3. The name of the author may not be used to endorse or promote products - derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR -IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -#endregion - -using System; -using System.Collections; -using System.Collections.Generic; -using System.Text; -using System.IO; -using Microsoft.Build.Utilities; -using Microsoft.Build.Framework; -using MSBuild.Community.Tasks.Properties; -using System.Text.RegularExpressions; - - - -namespace MSBuild.Community.Tasks.JavaScript -{ - /// - /// MSBuild task to minimize the size of a css file. - /// - public class CssCompress : Task - { - #region Properties - // Properties - private ITaskItem[] compressedFiles; - - /// - /// Gets the items that were successfully compressed. - /// - /// The compressed files. - [Output] - public ITaskItem[] CompressedFiles - { - get { return this.compressedFiles; } - } - - private ITaskItem[] destinationFiles; - - /// - /// Gets or sets the list of files to compressed the source files to. - /// - /// - /// This list is expected to be a one-to-one mapping with the - /// list specified in the SourceFiles parameter. That is, the - /// first file specified in SourceFiles will be compressed to the - /// first location specified in DestinationFiles, and so forth. - /// - /// The destination files. - [Output] - public ITaskItem[] DestinationFiles - { - get { return this.destinationFiles; } - set { this.destinationFiles = value; } - } - - private ITaskItem destinationFolder; - - /// - /// Gets or sets the directory to which you want to compress the files. - /// - /// The destination folder. - public ITaskItem DestinationFolder - { - get { return this.destinationFolder; } - set { this.destinationFolder = value; } - } - - private ITaskItem[] sourceFiles; - - /// - /// Gets or sets the source files to compress. - /// - /// The source files to compress. - [Required] - public ITaskItem[] SourceFiles - { - get { return this.sourceFiles; } - set { this.sourceFiles = value; } - } - #endregion - - /// - /// When overridden in a derived class, executes the task. - /// - /// - /// true if the task successfully executed; otherwise, false. - /// - public override bool Execute() - { - bool result = true; - if ((this.sourceFiles == null) || (this.sourceFiles.Length == 0)) - { - this.destinationFiles = new TaskItem[0]; - this.compressedFiles = new TaskItem[0]; - return true; - } - if ((this.destinationFiles == null) && (this.destinationFolder == null)) - { - Log.LogError("No destination specified for compression. Please supply either '{0}' or '{1}'.", "DestinationFiles", "DestinationDirectory"); - return false; - } - if ((this.destinationFiles != null) && (this.destinationFolder != null)) - { - Log.LogError(Resources.ExactlyOneTypeOfDestination, "DestinationFiles", "DestinationDirectory"); - return false; - } - if ((this.destinationFiles != null) && (this.destinationFiles.Length != this.sourceFiles.Length)) - { - Log.LogError(Resources.TwoVectorsMustHaveSameLength, - this.destinationFiles.Length, - this.sourceFiles.Length, - "DestinationFiles", - "SourceFiles"); - return false; - } - - // create destination array - if (this.destinationFiles == null) - { - this.destinationFiles = new ITaskItem[this.sourceFiles.Length]; - for (int x = 0; x < this.sourceFiles.Length; x++) - { - string newPath; - try - { - newPath = Path.Combine(this.destinationFolder.ItemSpec, Path.GetFileName(this.sourceFiles[x].ItemSpec)); - } - catch (ArgumentException ex) - { - this.destinationFiles = new ITaskItem[0]; - Log.LogError(Resources.MoveError, - this.sourceFiles[x].ItemSpec, - this.destinationFolder.ItemSpec, - ex.Message); - return false; - } - this.destinationFiles[x] = new TaskItem(newPath); - this.sourceFiles[x].CopyMetadataTo(this.destinationFiles[x]); - } - } - - ArrayList compressedList = new ArrayList(); - for (int x = 0; x < this.sourceFiles.Length; x++) - { - string sourceFile = this.sourceFiles[x].ItemSpec; - string destinationFile = this.destinationFiles[x].ItemSpec; - try - { - if (Directory.Exists(destinationFile)) - { - Log.LogError(Resources.TaskDestinationIsDirectory, sourceFile, destinationFile); - return false; - } - if (Directory.Exists(sourceFile)) - { - Log.LogError(Resources.TaskSourceIsDirectory, sourceFile, "CssCompress"); - return false; - } - - string buffer = File.ReadAllText(sourceFile); - buffer = Compress(buffer); - File.WriteAllText(destinationFile, buffer); - - this.sourceFiles[x].CopyMetadataTo(this.destinationFiles[x]); - compressedList.Add(this.destinationFiles[x]); - - } - catch (Exception ex) - { - Log.LogError(Resources.MoveError, - sourceFile, - destinationFile, - ex.Message); - result = false; - } - } - this.compressedFiles = (ITaskItem[])compressedList.ToArray(typeof(ITaskItem)); - return result; - - } - - private string Compress(string source) - { - string body = source; - - body = body.Replace(" ", string.Empty); - body = body.Replace(Environment.NewLine, string.Empty); - body = body.Replace("\t", string.Empty); - body = body.Replace(" {", "{"); - body = body.Replace(" :", ":"); - body = body.Replace(": ", ":"); - body = body.Replace(", ", ","); - body = body.Replace("; ", ";"); - body = body.Replace(";}", "}"); - body = Regex.Replace(body, @"/\*[^\*]*\*+([^/\*]*\*+)*/", "$1"); - body = Regex.Replace(body, @"(?<=[>])\s{2,}(?=[<])|(?<=[>])\s{2,}(?= )|(?<=&ndsp;)\s{2,}(?=[<])", string.Empty); - - return body; - } - } -} diff --git a/Source/MSBuild.Community.Tasks/JavaScript/CssCompressor.cs b/Source/MSBuild.Community.Tasks/JavaScript/CssCompressor.cs deleted file mode 100644 index 28359b2e..00000000 --- a/Source/MSBuild.Community.Tasks/JavaScript/CssCompressor.cs +++ /dev/null @@ -1,143 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; -using System.IO; - -namespace MSBuild.Community.Tasks.JavaScript -{ - /// - /// Work in progress ... - /// - /// - /// Based on http://iceyboard.no-ip.org/projects/css_compressor - /// - internal sealed class CssCompressor - { - public static string Compress(string source) - { - StringWriter writer = new StringWriter(); - StringReader reader = new StringReader(source); - Compress(reader, writer); - return writer.ToString(); - } - - public static void Compress(TextReader reader, TextWriter writer) - { - if (reader == null) - throw new ArgumentNullException("reader"); - - if (writer == null) - throw new ArgumentNullException("writer"); - - } - - private string cssContent; - - public CssCompressor(string css) - { - cssContent = css; - } - - public string Compress() - { - // temporarily change semicolons in web links - cssContent = cssContent.Replace("://", "[!semi-colon!]//"); - // remove html and css comments - RemoveComments(); - // trim whitespace from the start and end - cssContent = cssContent.Trim(); - } - - private void RemoveComments() - { - cssContent = cssContent.Replace("", string.Empty); - - cssContent = cssContent.Replace("://", "[!semi-colon!]//"); - - } - - private void Rgb2Hex() - { - } - - private void LongColorToHex() - { - - } - - private void LongHexToColor() - { - - } - - private void RemoveZeroMeasurements() - { - - } - - private void SortCss() - { - - } - - private void FontWeightTextToNumbers() - { - - } - - private void ParseRules() - { - - } - - private void RemoveSpace() - { - - } - - private void CombineIdenticalSelectors() - { - - } - - private void RemoveOverwrittenProperties() - { - - } - - private void CombinePropsList() - { - - } - - private void CombineProps() - { - - } - - private void ReduceProp() - { - - } - - private void ShortHex() - { - - } - private void CompressPaddingAndMargins() - { - - } - private void RemoveEmptyRules() - { - - } - - private void CombineIdenticalRules() - { - - } - - } -} diff --git a/Source/MSBuild.Community.Tasks/MSBuild.Community.Tasks.Targets b/Source/MSBuild.Community.Tasks/MSBuild.Community.Tasks.Targets index f12e834d..7405143c 100644 --- a/Source/MSBuild.Community.Tasks/MSBuild.Community.Tasks.Targets +++ b/Source/MSBuild.Community.Tasks/MSBuild.Community.Tasks.Targets @@ -1,149 +1,253 @@ - - - - $(MSBuildExtensionsPath)\MSBuildCommunityTasks - $([MSBUILD]::Unescape($(MSBuildCommunityTasksPath)\MSBuild.Community.Tasks.dll)) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + $(MSBuildExtensionsPath)\MSBuildCommunityTasks + $([MSBUILD]::Unescape($(MSBuildCommunityTasksPath)\MSBuild.Community.Tasks.dll)) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Source/MSBuild.Community.Tasks/MSBuild.Community.Tasks.csproj b/Source/MSBuild.Community.Tasks/MSBuild.Community.Tasks.csproj index 62da75fe..72625e07 100644 --- a/Source/MSBuild.Community.Tasks/MSBuild.Community.Tasks.csproj +++ b/Source/MSBuild.Community.Tasks/MSBuild.Community.Tasks.csproj @@ -169,8 +169,20 @@ + + + + + + + + + + + + diff --git a/Source/MSBuild.Community.Tasks/Mks/MksAdd.cs b/Source/MSBuild.Community.Tasks/Mks/MksAdd.cs deleted file mode 100644 index cc2f6af6..00000000 --- a/Source/MSBuild.Community.Tasks/Mks/MksAdd.cs +++ /dev/null @@ -1,317 +0,0 @@ -#region Copyright © 2006 Doug Ramirez. All rights reserved. -/* - Copyright © 2006 Doug Ramirez. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -3. The name of the author may not be used to endorse or promote products - derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR -IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -#endregion - -using System; -using System.IO; -using System.Text; -using Microsoft.Build.Framework; -using Microsoft.Build.Utilities; - -namespace MSBuild.Community.Tasks.Mks -{ - /*---------------------------------------------------------------------------------------------------------------*/ - /// - /// Custom MSBuild task that calls the MKS Add command. - /// - /// Add one or more nonmember files located in a sandbox directory to a project. - /// - /// - /// - /// ]]> - /// - /*---------------------------------------------------------------------------------------------------------------*/ - public class MksAdd : ToolTask - { - #region Constants - const string COMMAND = "add"; - #endregion Constants - - #region Private Member Variables - private string _cpid; - private bool _createSubprojects; - private string _description; - private string _directory; - private string _exclude; - private string _include; - private string _nonMembers; - private string _onExistingArchive; - private bool _recurse; - #endregion Private Member Variables - - #region Contructors - /*---------------------------------------------------------------------------------------------------------------*/ - /// - /// Contructor that initializes ToolTask properties. - /// - /*---------------------------------------------------------------------------------------------------------------*/ - public MksAdd() - { - // Set the path to the MKS CLI executable - ToolPath = @"C:\Program Files\MKS\IntegrityClient\bin"; - } - #endregion Constructors - - #region Protected Properties - /*---------------------------------------------------------------------------------------------------------------*/ - /// - /// The name of the program for the MKS CLI executable. - /// - /*---------------------------------------------------------------------------------------------------------------*/ - protected override string ToolName - { - get { return "si.exe"; } - } - #endregion Protected Properties - - #region Public Properties - /*---------------------------------------------------------------------------------------------------------------*/ - /// - /// Returns the text for the MKS Add CLI command. - /// - /*---------------------------------------------------------------------------------------------------------------*/ - public string CommandText - { - get { return GenerateFullPathToTool() + " " + GenerateCommandLineCommands(); } - } - - /*---------------------------------------------------------------------------------------------------------------*/ - /// - /// The name of the identifying change package that is notified of this action. - /// - /*---------------------------------------------------------------------------------------------------------------*/ - [Required] - public string Cpid - { - get { return _cpid; } - set { _cpid = value; } - } - - /*---------------------------------------------------------------------------------------------------------------*/ - /// - /// Control whether to create subprojects for each subdirectory encountered when adding members. - /// - /*---------------------------------------------------------------------------------------------------------------*/ - [Required] - public bool CreateSubprojects - { - get { return _createSubprojects; } - set { _createSubprojects = value; } - } - - /*---------------------------------------------------------------------------------------------------------------*/ - /// - /// The description of the changes associated with the members to Add. - /// - /*---------------------------------------------------------------------------------------------------------------*/ - [Required] - public string Description - { - get { return _description; } - set { _description = value; } - } - - /*---------------------------------------------------------------------------------------------------------------*/ - /// - /// The directory for Add to be executed in. Any files and members in the selection are treated as being - /// relative to that directory. - /// - /*---------------------------------------------------------------------------------------------------------------*/ - [Required] - public string Directory - { - get { return _directory; } - set { _directory = value; } - } - - /*---------------------------------------------------------------------------------------------------------------*/ - /// - /// Specify one or more files to exclude when adding members. - /// - /*---------------------------------------------------------------------------------------------------------------*/ - public string Exclude - { - get { return _exclude; } - set { _exclude = value; } - } - - /*---------------------------------------------------------------------------------------------------------------*/ - /// - /// Specify one or more files to include when adding members. - /// - /*---------------------------------------------------------------------------------------------------------------*/ - public string Include - { - get { return _include; } - set { _include = value; } - } - - /*---------------------------------------------------------------------------------------------------------------*/ - /// - /// Identifies a specific file to add to your sandbox; use spaces to specify more than one. - /// - /*---------------------------------------------------------------------------------------------------------------*/ - [Required] - public string NonMembers - { - get { return _nonMembers; } - set { _nonMembers = value; } - } - - /*---------------------------------------------------------------------------------------------------------------*/ - /// - /// Control whether to allow sharing of this member's history between projects, or to create a new archive if - /// there is already an existing archive for the member. - /// - /*---------------------------------------------------------------------------------------------------------------*/ - [Required] - public string OnExistingArchive - { - get { return _onExistingArchive; } - set { _onExistingArchive = value; } - } - - /*---------------------------------------------------------------------------------------------------------------*/ - /// - /// Specificy whether to recursively add any subprojects and members. - /// - /*---------------------------------------------------------------------------------------------------------------*/ - [Required] - public bool Recurse - { - get { return _recurse; } - set { _recurse = value; } - } - #endregion Public Properties - - #region Protected Methods - /*---------------------------------------------------------------------------------------------------------------*/ - /// - /// Returns a string value containing the command line arguments to pass directly to the executable file. - /// - /// - /// A string value containing the command line arguments to pass directly to the executable file. - /// - /*---------------------------------------------------------------------------------------------------------------*/ - protected override string GenerateCommandLineCommands() - { - try - { - StringBuilder stringBuilder = new StringBuilder(); - - // Ensure that each string praram has a value. - if (string.IsNullOrEmpty(_cpid) - || string.IsNullOrEmpty(_description) - || string.IsNullOrEmpty(_directory) - || string.IsNullOrEmpty(_nonMembers) - || string.IsNullOrEmpty(_onExistingArchive)) - { - throw new ArgumentNullException(); - } - - // Build the CLI command to execute an MKS Add - stringBuilder.AppendFormat(COMMAND); - stringBuilder.AppendFormat(" --cpid={0}", _cpid); - stringBuilder.AppendFormat(" --description={0}", _description); - stringBuilder.AppendFormat(" --cwd={0}", _directory); - stringBuilder.AppendFormat(" --onExistingArchive={0}", _onExistingArchive); - - if (!string.IsNullOrEmpty(_exclude)) - { - stringBuilder.AppendFormat(" --exclude={0}", _exclude); - } - - if (!string.IsNullOrEmpty(_include)) - { - stringBuilder.AppendFormat(" --include={0}", _include); - } - - if (_createSubprojects) - { - stringBuilder.AppendFormat(" --createSubprojects"); - } - else - { - stringBuilder.AppendFormat(" --nocreateSubprojects"); - } - - if (_recurse) - { - stringBuilder.AppendFormat(" --recurse"); - } - else - { - stringBuilder.AppendFormat(" --norecurse"); - } - - stringBuilder.AppendFormat(" {0}", _nonMembers); - - return stringBuilder.ToString(); - } - catch (Exception ex) - { - Log.LogErrorFromException(ex); - return null; - } - } - #endregion Protected Methods - - #region Public Methods - /*---------------------------------------------------------------------------------------------------------------*/ - /// - /// Returns the fully qualified path to the executable file. - /// - /// - /// The fully qualified path to the executable file. - /// - /*---------------------------------------------------------------------------------------------------------------*/ - protected override string GenerateFullPathToTool() - { - try - { - return Path.Combine(ToolPath, ToolName); - } - catch (Exception ex) - { - Log.LogErrorFromException(ex); - return null; - } - } - #endregion Public Methods - } -} diff --git a/Source/MSBuild.Community.Tasks/Mks/MksCheckin.cs b/Source/MSBuild.Community.Tasks/Mks/MksCheckin.cs deleted file mode 100644 index 2a3d1166..00000000 --- a/Source/MSBuild.Community.Tasks/Mks/MksCheckin.cs +++ /dev/null @@ -1,265 +0,0 @@ -#region Copyright © 2006 Doug Ramirez. All rights reserved. -/* - Copyright © 2006 Doug Ramirez. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -3. The name of the author may not be used to endorse or promote products - derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR -IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -#endregion - -using System; -using System.IO; -using System.Text; -using Microsoft.Build.Framework; -using Microsoft.Build.Utilities; - -namespace MSBuild.Community.Tasks.Mks -{ - /*---------------------------------------------------------------------------------------------------------------*/ - /// - /// Custom MSBuild task that calls the MKS Checkin command. - /// - /// Checks in and saves changes to sandbox members. - /// - /// - /// - /// ]]> - /// - /*---------------------------------------------------------------------------------------------------------------*/ - public class MksCheckin : ToolTask - { - #region Constants - const string COMMAND = "ci"; - #endregion Constants - - #region Private Member Variables - private string _checkinUnchanged; - private string _cpid; - private string _directory; - private string _description; - private bool _forceConfirm; - private bool _recurse; - #endregion Private Member Variables - - #region Contructors - /*---------------------------------------------------------------------------------------------------------------*/ - /// - /// Contructor that initializes ToolTask properties. - /// - /*---------------------------------------------------------------------------------------------------------------*/ - public MksCheckin() - { - // Set the path to the MKS CLI executable - ToolPath = @"C:\Program Files\MKS\IntegrityClient\bin"; - } - #endregion Constructors - - #region Protected Properties - /*---------------------------------------------------------------------------------------------------------------*/ - /// - /// The name of the program for the MKS CLI executable. - /// - /*---------------------------------------------------------------------------------------------------------------*/ - protected override string ToolName - { - get { return "si.exe"; } - } - #endregion Protected Properties - - #region Public Properties - /*---------------------------------------------------------------------------------------------------------------*/ - /// - /// Control whether to force the checkin so that the new revision is checked in even if it is not different - /// from the preceding one. - /// - /*---------------------------------------------------------------------------------------------------------------*/ - [Required] - public string CheckinUnchanged - { - get { return _checkinUnchanged; } - set { _checkinUnchanged = value; } - } - - /*---------------------------------------------------------------------------------------------------------------*/ - /// - /// Returns the text for the MKS Checkin CLI command. - /// - /*---------------------------------------------------------------------------------------------------------------*/ - public string CommandText - { - get { return GenerateFullPathToTool() + " " + GenerateCommandLineCommands(); } - } - - /*---------------------------------------------------------------------------------------------------------------*/ - /// - /// The name of the identifying change package that is notified of this action. - /// - /*---------------------------------------------------------------------------------------------------------------*/ - [Required] - public string Cpid - { - get { return _cpid; } - set { _cpid = value; } - } - - /*---------------------------------------------------------------------------------------------------------------*/ - /// - /// The description of the changes associated with the members to Checkin. - /// - /*---------------------------------------------------------------------------------------------------------------*/ - [Required] - public string Description - { - get { return _description; } - set { _description = value; } - } - - /*---------------------------------------------------------------------------------------------------------------*/ - /// - /// The directory for Checkin to be executed in. Any files and members in the selection are treated as being - /// relative to that directory. - /// - /*---------------------------------------------------------------------------------------------------------------*/ - [Required] - public string Directory - { - get { return _directory; } - set { _directory = value; } - } - - /*---------------------------------------------------------------------------------------------------------------*/ - /// - /// Control the responses of either "yes" or "no" to all prompts. - /// - /*---------------------------------------------------------------------------------------------------------------*/ - [Required] - public bool ForceConfirm - { - get { return _forceConfirm; } - set { _forceConfirm = value; } - } - - /*---------------------------------------------------------------------------------------------------------------*/ - /// - /// Specificy whether to recursively checkin any subprojects. - /// - /*---------------------------------------------------------------------------------------------------------------*/ - [Required] - public bool Recurse - { - get { return _recurse; } - set { _recurse = value; } - } - #endregion Public Properties - - #region Protected Methods - /*---------------------------------------------------------------------------------------------------------------*/ - /// - /// Returns a string value containing the command line arguments to pass directly to the executable file. - /// - /// - /// A string value containing the command line arguments to pass directly to the executable file. - /// - /*---------------------------------------------------------------------------------------------------------------*/ - protected override string GenerateCommandLineCommands() - { - try - { - StringBuilder stringBuilder = new StringBuilder(); - - // Ensure that each string praram has a value. - if (string.IsNullOrEmpty(_checkinUnchanged) - || string.IsNullOrEmpty(_cpid) - || string.IsNullOrEmpty(_description) - || string.IsNullOrEmpty(_directory)) - { - throw new ArgumentNullException(); - } - - // Build the CLI command to execute an MKS Checkin - stringBuilder.AppendFormat(COMMAND); - stringBuilder.AppendFormat(" --{0}", _checkinUnchanged); - stringBuilder.AppendFormat(" --cpid={0}", _cpid); - stringBuilder.AppendFormat(" --description={0}", _description); - stringBuilder.AppendFormat(" --cwd={0}", _directory); - - if (_forceConfirm) - { - stringBuilder.AppendFormat(" --forceConfirm=yes"); - } - else - { - stringBuilder.AppendFormat(" --forceConfirm=no"); - } - - if (_recurse) - { - stringBuilder.AppendFormat(" --recurse"); - } - else - { - stringBuilder.AppendFormat(" --norecurse"); - } - - return stringBuilder.ToString(); - } - catch (Exception ex) - { - Log.LogErrorFromException(ex); - return null; - } - } - #endregion Protected Methods - - #region Public Methods - /*---------------------------------------------------------------------------------------------------------------*/ - /// - /// Returns the fully qualified path to the executable file. - /// - /// - /// The fully qualified path to the executable file. - /// - /*---------------------------------------------------------------------------------------------------------------*/ - protected override string GenerateFullPathToTool() - { - try - { - return Path.Combine(ToolPath, ToolName); - } - catch (Exception ex) - { - Log.LogErrorFromException(ex); - return null; - } - } - #endregion Public Methods - } -} diff --git a/Source/MSBuild.Community.Tasks/Mks/MksCheckpoint.cs b/Source/MSBuild.Community.Tasks/Mks/MksCheckpoint.cs deleted file mode 100644 index f929add5..00000000 --- a/Source/MSBuild.Community.Tasks/Mks/MksCheckpoint.cs +++ /dev/null @@ -1,198 +0,0 @@ -#region Copyright © 2006 Doug Ramirez. All rights reserved. -/* - Copyright © 2006 Doug Ramirez. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -3. The name of the author may not be used to endorse or promote products - derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR -IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -#endregion - -using System; -using System.IO; -using System.Text; -using Microsoft.Build.Framework; -using Microsoft.Build.Utilities; - -namespace MSBuild.Community.Tasks.Mks -{ - /*---------------------------------------------------------------------------------------------------------------*/ - /// - /// Custom MSBuild task that calls the MKS Checkpoint command. - /// - /*---------------------------------------------------------------------------------------------------------------*/ - public class MksCheckpoint : ToolTask - { - #region Constants - const string COMMAND = "checkpoint"; - #endregion Constants - - #region Private Member Variables - private string _description; - private string _directory; - private bool _forceConfirm; - #endregion Private Member Variables - - #region Contructors - /*---------------------------------------------------------------------------------------------------------------*/ - /// - /// Contructor that initializes ToolTask properties. - /// - /*---------------------------------------------------------------------------------------------------------------*/ - public MksCheckpoint() - { - // Set the path to the MKS CLI executable - ToolPath = @"C:\Program Files\MKS\IntegrityClient\bin"; - } - #endregion Constructors - - #region Protected Properties - /*---------------------------------------------------------------------------------------------------------------*/ - /// - /// The name of the program for the MKS CLI executable. - /// - /*---------------------------------------------------------------------------------------------------------------*/ - protected override string ToolName - { - get { return "si.exe"; } - } - #endregion Protected Properties - - #region Public Properties - /*---------------------------------------------------------------------------------------------------------------*/ - /// - /// Returns the text for the MKS Checkpoint CLI command. - /// - /*---------------------------------------------------------------------------------------------------------------*/ - public string CommandText - { - get { return GenerateFullPathToTool() + " " + GenerateCommandLineCommands(); } - } - - /*---------------------------------------------------------------------------------------------------------------*/ - /// - /// The description of the changes associated with the project to Checkpoint. - /// - /*---------------------------------------------------------------------------------------------------------------*/ - [Required] - public string Description - { - get { return _description; } - set { _description = value; } - } - - /*---------------------------------------------------------------------------------------------------------------*/ - /// - /// The directory for the Checkpoint to be executed in. Any files and members in the selection are treated - /// as being relative to that directory. - /// - /*---------------------------------------------------------------------------------------------------------------*/ - [Required] - public string Directory - { - get { return _directory; } - set { _directory = value; } - } - - /*---------------------------------------------------------------------------------------------------------------*/ - /// - /// Control the responses of either "yes" or "no" to all prompts. - /// - /*---------------------------------------------------------------------------------------------------------------*/ - [Required] - public bool ForceConfirm - { - get { return _forceConfirm; } - set { _forceConfirm = value; } - } - #endregion Public Properties - - #region Protected Methods - /*---------------------------------------------------------------------------------------------------------------*/ - /// - /// Returns a string value containing the command line arguments to pass directly to the executable file. - /// - /// - /// A string value containing the command line arguments to pass directly to the executable file. - /// - /*---------------------------------------------------------------------------------------------------------------*/ - protected override string GenerateCommandLineCommands() - { - try - { - StringBuilder stringBuilder = new StringBuilder(); - - // Ensure that each string praram has a value. - if (string.IsNullOrEmpty(_description) - || string.IsNullOrEmpty(_directory)) - { - throw new ArgumentNullException(); - } - - // Build the CLI command to execute an MKS Checkpoint - stringBuilder.AppendFormat(COMMAND); - stringBuilder.AppendFormat(" --description={0}", _description); - stringBuilder.AppendFormat(" --cwd={0}", _directory); - - if (_forceConfirm) - { - stringBuilder.AppendFormat(" --forceConfirm=yes"); - } - else - { - stringBuilder.AppendFormat(" --forceConfirm=no"); - } - - return stringBuilder.ToString(); - } - catch (Exception ex) - { - Log.LogErrorFromException(ex); - return null; - } - } - #endregion Protected Methods - - #region Public Methods - /*---------------------------------------------------------------------------------------------------------------*/ - /// - /// Returns the fully qualified path to the executable file. - /// - /// - /// The fully qualified path to the executable file. - /// - /*---------------------------------------------------------------------------------------------------------------*/ - protected override string GenerateFullPathToTool() - { - try - { - return Path.Combine(ToolPath, ToolName); - } - catch (Exception ex) - { - Log.LogErrorFromException(ex); - return null; - } - } - #endregion Public Methods - } -} diff --git a/Source/MSBuild.Community.Tasks/Mks/MksCreateSandbox.cs b/Source/MSBuild.Community.Tasks/Mks/MksCreateSandbox.cs deleted file mode 100644 index 1213519c..00000000 --- a/Source/MSBuild.Community.Tasks/Mks/MksCreateSandbox.cs +++ /dev/null @@ -1,234 +0,0 @@ -#region Copyright © 2006 Doug Ramirez. All rights reserved. -/* - Copyright © 2006 Doug Ramirez. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -3. The name of the author may not be used to endorse or promote products - derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR -IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -#endregion - -using System; -using System.IO; -using System.Text; -using Microsoft.Build.Framework; -using Microsoft.Build.Utilities; - - -namespace MSBuild.Community.Tasks.Mks -{ - /*---------------------------------------------------------------------------------------------------------------*/ - /// - /// Custom MSBuild task that calls the MKS Create Sandbox command. - /// - /// Creates a new sandbox on the client machine in a specified directory. - /// - /// - /// - /// ]]> - /// - /*---------------------------------------------------------------------------------------------------------------*/ - public class MksCreateSandbox : ToolTask - { - #region Constants - const string COMMAND = "createsandbox"; - #endregion Constants - - #region Private Member Variables - private string _directory; - private bool _populate; - private string _project; - private bool _recurse; - #endregion Private Member Variables - - #region Contructors - /*---------------------------------------------------------------------------------------------------------------*/ - /// - /// Contructor that initializes ToolTask properties. - /// - /*---------------------------------------------------------------------------------------------------------------*/ - public MksCreateSandbox() - { - // Set the path to the MKS CLI executable - ToolPath = @"C:\Program Files\MKS\IntegrityClient\bin"; - } - #endregion Constructors - - #region Protected Properties - /*---------------------------------------------------------------------------------------------------------------*/ - /// - /// The name of the program for the MKS CLI executable. - /// - /*---------------------------------------------------------------------------------------------------------------*/ - protected override string ToolName - { - get { return "si.exe"; } - } - #endregion Protected Properties - - #region Public Properties - /*---------------------------------------------------------------------------------------------------------------*/ - /// - /// Returns the text for the MKS Create Sandbox CLI command. - /// - /*---------------------------------------------------------------------------------------------------------------*/ - public string CommandText - { - get { return GenerateFullPathToTool() + " " + GenerateCommandLineCommands(); } - } - - /*---------------------------------------------------------------------------------------------------------------*/ - /// - /// Identify a location on the MKS Source Integrity client system for the new sandbox. Use spaces to identify - /// more than one directory. - /// - /*---------------------------------------------------------------------------------------------------------------*/ - [Required] - public string Directory - { - get { return _directory; } - set { _directory = value; } - } - - /*---------------------------------------------------------------------------------------------------------------*/ - /// - /// Control whether to populate the sandbox with read-only working files for all members. - /// - /*---------------------------------------------------------------------------------------------------------------*/ - [Required] - public bool Populate - { - get { return _populate; } - set { _populate = value; } - } - - /*---------------------------------------------------------------------------------------------------------------*/ - /// - /// Specifies the location of a project. - /// - /*---------------------------------------------------------------------------------------------------------------*/ - [Required] - public string Project - { - get { return _project; } - set { _project = value; } - } - - /*---------------------------------------------------------------------------------------------------------------*/ - /// - /// Specificy whether to recursively create sanboxes for any subprojects. - /// - /*---------------------------------------------------------------------------------------------------------------*/ - [Required] - public bool Recurse - { - get { return _recurse; } - set { _recurse = value; } - } - #endregion Public Properties - - #region Protected Methods - /*---------------------------------------------------------------------------------------------------------------*/ - /// - /// Returns a string value containing the command line arguments to pass directly to the executable file. - /// - /// - /// A string value containing the command line arguments to pass directly to the executable file. - /// - /*---------------------------------------------------------------------------------------------------------------*/ - protected override string GenerateCommandLineCommands() - { - try - { - StringBuilder stringBuilder = new StringBuilder(); - - // Ensure that each string praram has a value. - if (string.IsNullOrEmpty(_directory) - || string.IsNullOrEmpty(_project)) - { - throw new ArgumentNullException(); - } - - // Build the CLI command to execute an MKS Create Sandbox - stringBuilder.AppendFormat(COMMAND); - - if (_populate) - { - stringBuilder.AppendFormat(" --populate"); - } - else - { - stringBuilder.AppendFormat(" --nopopulate"); - } - - if (_recurse) - { - stringBuilder.AppendFormat(" --recurse"); - } - else - { - stringBuilder.AppendFormat(" --norecurse"); - } - - stringBuilder.AppendFormat(" --project=" + _project); - stringBuilder.AppendFormat(" " + _directory); - - return stringBuilder.ToString(); - } - catch (Exception ex) - { - Log.LogErrorFromException(ex); - return null; - } - } - #endregion Protected Methods - - #region Public Methods - /*---------------------------------------------------------------------------------------------------------------*/ - /// - /// Returns the fully qualified path to the executable file. - /// - /// - /// The fully qualified path to the executable file. - /// - /*---------------------------------------------------------------------------------------------------------------*/ - protected override string GenerateFullPathToTool() - { - try - { - return Path.Combine(ToolPath, ToolName); - } - catch (Exception ex) - { - Log.LogErrorFromException(ex); - return null; - } - } - #endregion Public Methods - } -} diff --git a/Source/MSBuild.Community.Tasks/Mks/MksDopSandbox.cs b/Source/MSBuild.Community.Tasks/Mks/MksDopSandbox.cs deleted file mode 100644 index 12ca7427..00000000 --- a/Source/MSBuild.Community.Tasks/Mks/MksDopSandbox.cs +++ /dev/null @@ -1,228 +0,0 @@ -#region Copyright © 2006 Doug Ramirez. All rights reserved. -/* - Copyright © 2006 Doug Ramirez. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -3. The name of the author may not be used to endorse or promote products - derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR -IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -#endregion - -using System; -using System.IO; -using System.Text; -using Microsoft.Build.Framework; -using Microsoft.Build.Utilities; - -namespace MSBuild.Community.Tasks.Mks -{ - /*---------------------------------------------------------------------------------------------------------------*/ - /// - /// Custom MSBuild task that calls the MKS Drop Sandbox command. - /// - /// Unregisters a sandbox from the Integrity Client. - /// - /// - /// - /// ]]> - /// - /*---------------------------------------------------------------------------------------------------------------*/ - public class MksDropSandbox : ToolTask - { - #region Constants - const string COMMAND = "dropsandbox"; - #endregion Constants - - #region Private Member Variables - private string _delete; - private string _directory; - private bool _forceConfirm; - private string _sandbox; - #endregion Private Member Variables - - #region Contructors - /*---------------------------------------------------------------------------------------------------------------*/ - /// - /// Contructor that initializes ToolTask properties. - /// - /*---------------------------------------------------------------------------------------------------------------*/ - public MksDropSandbox() - { - // Set the path to the MKS CLI executable - ToolPath = @"C:\Program Files\MKS\IntegrityClient\bin"; - } - #endregion Constructors - - #region Protected Properties - /*---------------------------------------------------------------------------------------------------------------*/ - /// - /// The name of the program for the MKS CLI executable. - /// - /*---------------------------------------------------------------------------------------------------------------*/ - protected override string ToolName - { - get { return "si.exe"; } - } - #endregion Protected Properties - - #region Public Properties - /*---------------------------------------------------------------------------------------------------------------*/ - /// - /// Returns the text for the MKS Create Sandbox CLI command. - /// - /*---------------------------------------------------------------------------------------------------------------*/ - public string CommandText - { - get { return GenerateFullPathToTool() + " " + GenerateCommandLineCommands(); } - } - - /*---------------------------------------------------------------------------------------------------------------*/ - /// - /// Identify a location on the MKS Source Integrity client system to drop the sandbox. Use spaces to identify - /// more than one directory. - /// - /*---------------------------------------------------------------------------------------------------------------*/ - [Required] - public string Delete - { - get { return _delete; } - set { _delete = value; } - } - - /*---------------------------------------------------------------------------------------------------------------*/ - /// - /// Identify a location on the MKS Source Integrity client system to drop the sandbox. Use spaces to identify - /// more than one directory. - /// - /*---------------------------------------------------------------------------------------------------------------*/ - [Required] - public string Directory - { - get { return _directory; } - set { _directory = value; } - } - - /*---------------------------------------------------------------------------------------------------------------*/ - /// - /// Control the responses of either "yes" or "no" to all prompts. - /// - /*---------------------------------------------------------------------------------------------------------------*/ - [Required] - public bool ForceConfirm - { - get { return _forceConfirm; } - set { _forceConfirm = value; } - } - - /*---------------------------------------------------------------------------------------------------------------*/ - /// - /// Identify a location on the MKS Source Integrity client system to drop the sandbox. Use spaces to identify - /// more than one directory. - /// - /*---------------------------------------------------------------------------------------------------------------*/ - [Required] - public string Sandbox - { - get { return _sandbox; } - set { _sandbox = value; } - } - #endregion Public Properties - - #region Protected Methods - /*---------------------------------------------------------------------------------------------------------------*/ - /// - /// Returns a string value containing the command line arguments to pass directly to the executable file. - /// - /// - /// A string value containing the command line arguments to pass directly to the executable file. - /// - /*---------------------------------------------------------------------------------------------------------------*/ - protected override string GenerateCommandLineCommands() - { - try - { - StringBuilder stringBuilder = new StringBuilder(); - - // Ensure that each string praram has a value. - if (string.IsNullOrEmpty(_delete) - || string.IsNullOrEmpty(_directory) - || string.IsNullOrEmpty(_sandbox)) - { - throw new ArgumentNullException(); - } - - // Build the CLI command to execute an MKS Drop Sandbox - stringBuilder.AppendFormat(COMMAND); - - if (_forceConfirm) - { - stringBuilder.AppendFormat(" --forceConfirm=yes"); - } - else - { - stringBuilder.AppendFormat(" --forceConfirm=no"); - } - - stringBuilder.AppendFormat(" --delete=" + _delete); - stringBuilder.AppendFormat(" --cwd=" + _directory); - stringBuilder.AppendFormat(" " + _sandbox); - - return stringBuilder.ToString(); - } - catch (Exception ex) - { - Log.LogErrorFromException(ex); - return null; - } - } - #endregion Protected Methods - - #region Public Methods - /*---------------------------------------------------------------------------------------------------------------*/ - /// - /// Returns the fully qualified path to the executable file. - /// - /// - /// The fully qualified path to the executable file. - /// - /*---------------------------------------------------------------------------------------------------------------*/ - protected override string GenerateFullPathToTool() - { - try - { - return Path.Combine(ToolPath, ToolName); - } - catch (Exception ex) - { - Log.LogErrorFromException(ex); - return null; - } - } - #endregion Public Methods - } -} diff --git a/Source/MSBuild.Community.Tasks/Mks/MksDrop.cs b/Source/MSBuild.Community.Tasks/Mks/MksDrop.cs deleted file mode 100644 index af48fe93..00000000 --- a/Source/MSBuild.Community.Tasks/Mks/MksDrop.cs +++ /dev/null @@ -1,266 +0,0 @@ -#region Copyright © 2006 Doug Ramirez. All rights reserved. -/* - Copyright © 2006 Doug Ramirez. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -3. The name of the author may not be used to endorse or promote products - derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR -IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -#endregion - -using System; -using System.IO; -using System.Text; -using Microsoft.Build.Framework; -using Microsoft.Build.Utilities; - -namespace MSBuild.Community.Tasks.Mks -{ - /*---------------------------------------------------------------------------------------------------------------*/ - /// - /// Custom MSBuild task that calls the MKS Drop command. - /// - /// Drops specified members and subprojects from a project. - /// - /// - /// - /// ]]> - /// - /*---------------------------------------------------------------------------------------------------------------*/ - public class MksDrop : ToolTask - { - #region Constants - const string COMMAND = "drop"; - #endregion Constants - - #region Private Member Variables - private string _cpid; - private bool _delete; - private string _directory; - private bool _forceConfirm; - private string _members; - private string _sandbox; - #endregion Private Member Variables - - #region Contructors - /*---------------------------------------------------------------------------------------------------------------*/ - /// - /// Contructor that initializes ToolTask properties. - /// - /*---------------------------------------------------------------------------------------------------------------*/ - public MksDrop() - { - // Set the path to the MKS CLI executable - ToolPath = @"C:\Program Files\MKS\IntegrityClient\bin"; - } - #endregion Constructors - - #region Protected Properties - /*---------------------------------------------------------------------------------------------------------------*/ - /// - /// The name of the program for the MKS CLI executable. - /// - /*---------------------------------------------------------------------------------------------------------------*/ - protected override string ToolName - { - get { return "si.exe"; } - } - #endregion Protected Properties - - #region Public Properties - /*---------------------------------------------------------------------------------------------------------------*/ - /// - /// Returns the text for the MKS Drop CLI command. - /// - /*---------------------------------------------------------------------------------------------------------------*/ - public string CommandText - { - get { return GenerateFullPathToTool() + " " + GenerateCommandLineCommands(); } - } - - /*---------------------------------------------------------------------------------------------------------------*/ - /// - /// The name of the identifying change package that is notified of this action. - /// - /*---------------------------------------------------------------------------------------------------------------*/ - [Required] - public string Cpid - { - get { return _cpid; } - set { _cpid = value; } - } - - /*---------------------------------------------------------------------------------------------------------------*/ - /// - /// Control whether the working file should be deleted immediately from your sandbox. - /// - /*---------------------------------------------------------------------------------------------------------------*/ - [Required] - public bool Delete - { - get { return _delete; } - set { _delete = value; } - } - - /*---------------------------------------------------------------------------------------------------------------*/ - /// - /// The directory for Drop to be executed in. Any files and members in the selection are treated as being - /// relative to that directory. - /// - /*---------------------------------------------------------------------------------------------------------------*/ - [Required] - public string Directory - { - get { return _directory; } - set { _directory = value; } - } - - /*---------------------------------------------------------------------------------------------------------------*/ - /// - /// Control the responses of either "yes" or "no" to all prompts. - /// - /*---------------------------------------------------------------------------------------------------------------*/ - [Required] - public bool ForceConfirm - { - get { return _forceConfirm; } - set { _forceConfirm = value; } - } - - /*---------------------------------------------------------------------------------------------------------------*/ - /// - /// Identifies a specific member or subproject; use spaces to specify more than one. - /// - /*---------------------------------------------------------------------------------------------------------------*/ - [Required] - public string Members - { - get { return _members; } - set { _members = value; } - } - - /*---------------------------------------------------------------------------------------------------------------*/ - /// - /// Specifies the location of a sandbox. - /// - /*---------------------------------------------------------------------------------------------------------------*/ - [Required] - public string Sandbox - { - get { return _sandbox; } - set { _sandbox = value; } - } - #endregion Public Properties - - #region Protected Methods - /*---------------------------------------------------------------------------------------------------------------*/ - /// - /// Returns a string value containing the command line arguments to pass directly to the executable file. - /// - /// - /// A string value containing the command line arguments to pass directly to the executable file. - /// - /*---------------------------------------------------------------------------------------------------------------*/ - protected override string GenerateCommandLineCommands() - { - try - { - StringBuilder stringBuilder = new StringBuilder(); - - // Ensure that each string praram has a value. - if (string.IsNullOrEmpty(_cpid) - || string.IsNullOrEmpty(_directory) - || string.IsNullOrEmpty(_members) - || string.IsNullOrEmpty(_sandbox)) - { - throw new ArgumentNullException(); - } - - // Build the CLI command to execute an MKS Drop - stringBuilder.AppendFormat(COMMAND); - stringBuilder.AppendFormat(" --cpid={0}", _cpid); - stringBuilder.AppendFormat(" --cwd={0}", _directory); - stringBuilder.AppendFormat(" --sandbox={0}", _sandbox); - - - if (_delete) - { - stringBuilder.AppendFormat(" --delete"); - } - else - { - stringBuilder.AppendFormat(" --nodelete"); - } - - if (_forceConfirm) - { - stringBuilder.AppendFormat(" --forceConfirm=yes"); - } - else - { - stringBuilder.AppendFormat(" --forceConfirm=no"); - } - - stringBuilder.AppendFormat(" {0}", _members); - - return stringBuilder.ToString(); - } - catch (Exception ex) - { - Log.LogErrorFromException(ex); - return null; - } - } - #endregion Protected Methods - - #region Public Methods - /*---------------------------------------------------------------------------------------------------------------*/ - /// - /// Returns the fully qualified path to the executable file. - /// - /// - /// The fully qualified path to the executable file. - /// - /*---------------------------------------------------------------------------------------------------------------*/ - protected override string GenerateFullPathToTool() - { - try - { - return Path.Combine(ToolPath, ToolName); - } - catch (Exception ex) - { - Log.LogErrorFromException(ex); - return null; - } - } - #endregion Public Methods - } -} diff --git a/Source/MSBuild.Community.Tasks/Mks/MksLock.cs b/Source/MSBuild.Community.Tasks/Mks/MksLock.cs deleted file mode 100644 index bc5a4d4f..00000000 --- a/Source/MSBuild.Community.Tasks/Mks/MksLock.cs +++ /dev/null @@ -1,267 +0,0 @@ -#region Copyright © 2006 Doug Ramirez. All rights reserved. -/* - Copyright © 2006 Doug Ramirez. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -3. The name of the author may not be used to endorse or promote products - derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR -IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -#endregion - -using System; -using System.IO; -using System.Text; -using Microsoft.Build.Framework; -using Microsoft.Build.Utilities; - -namespace MSBuild.Community.Tasks.Mks -{ - /*---------------------------------------------------------------------------------------------------------------*/ - /// - /// Custom MSBuild task that calls the MKS Lock command. - /// - /// Locks one or more project members. - /// - /// - /// - /// ]]> - /// - /*---------------------------------------------------------------------------------------------------------------*/ - public class MksLock : ToolTask - { - #region Constants - const string COMMAND = "lock"; - #endregion Constants - - #region Private Member Variables - private string _cpid; - private string _directory; - private string _filter; - private bool _forceConfirm; - private string _project; - private bool _recurse; - #endregion Private Member Variables - - #region Contructors - /*---------------------------------------------------------------------------------------------------------------*/ - /// - /// Contructor that initializes ToolTask properties. - /// - /*---------------------------------------------------------------------------------------------------------------*/ - public MksLock() - { - // Set the path to the MKS CLI executable - ToolPath = @"C:\Program Files\MKS\IntegrityClient\bin"; - } - #endregion Constructors - - #region Protected Properties - /*---------------------------------------------------------------------------------------------------------------*/ - /// - /// The name of the program for the MKS CLI executable. - /// - /*---------------------------------------------------------------------------------------------------------------*/ - protected override string ToolName - { - get { return "si.exe"; } - } - #endregion Protected Properties - - #region Public Properties - /*---------------------------------------------------------------------------------------------------------------*/ - /// - /// Returns the text for the MKS Lock CLI command. - /// - /*---------------------------------------------------------------------------------------------------------------*/ - public string CommandText - { - get { return GenerateFullPathToTool() + " " + GenerateCommandLineCommands(); } - } - - /*---------------------------------------------------------------------------------------------------------------*/ - /// - /// The name of the identifying change package that is notified of this action. - /// - /*---------------------------------------------------------------------------------------------------------------*/ - [Required] - public string Cpid - { - get { return _cpid; } - set { _cpid = value; } - } - - /*---------------------------------------------------------------------------------------------------------------*/ - /// - /// The directory for Lock to be executed in. Any files and members in the selection are treated as being - /// relative to that directory. - /// - /*---------------------------------------------------------------------------------------------------------------*/ - [Required] - public string Directory - { - get { return _directory; } - set { _directory = value; } - } - - /*---------------------------------------------------------------------------------------------------------------*/ - /// - /// The filteroption to define a list of members to Lock. - /// - /*---------------------------------------------------------------------------------------------------------------*/ - public string Filter - { - get { return _filter; } - set { _filter = value; } - } - - /*---------------------------------------------------------------------------------------------------------------*/ - /// - /// Control the responses of either "yes" or "no" to all prompts. - /// - /*---------------------------------------------------------------------------------------------------------------*/ - [Required] - public bool ForceConfirm - { - get { return _forceConfirm; } - set { _forceConfirm = value; } - } - - /*---------------------------------------------------------------------------------------------------------------*/ - /// - /// Identify specific project members to lock; use spaces to specify more than one member. If no members are - /// specified then the lock applies to all project members. - /// - /*---------------------------------------------------------------------------------------------------------------*/ - public string Project - { - get { return _project; } - set { _project = value; } - } - - /*---------------------------------------------------------------------------------------------------------------*/ - /// - /// Specificy whether to recursively lock any subprojects. - /// - /*---------------------------------------------------------------------------------------------------------------*/ - [Required] - public bool Recurse - { - get { return _recurse; } - set { _recurse = value; } - } - #endregion Public Properties - - #region Protected Methods - /*---------------------------------------------------------------------------------------------------------------*/ - /// - /// Returns a string value containing the command line arguments to pass directly to the executable file. - /// - /// - /// A string value containing the command line arguments to pass directly to the executable file. - /// - /*---------------------------------------------------------------------------------------------------------------*/ - protected override string GenerateCommandLineCommands() - { - try - { - StringBuilder stringBuilder = new StringBuilder(); - - // Ensure that each string praram has a value. - if (string.IsNullOrEmpty(_cpid) - || string.IsNullOrEmpty(_directory)) - { - throw new ArgumentNullException(); - } - - // Build the CLI command to execute an MKS Lock - stringBuilder.AppendFormat(COMMAND); - stringBuilder.AppendFormat(" --cpid={0}", _cpid); - stringBuilder.AppendFormat(" --cwd={0}", _directory); - - if (!string.IsNullOrEmpty(_filter)) - { - stringBuilder.AppendFormat(" --filter={0}", _filter); - } - - if (_forceConfirm) - { - stringBuilder.AppendFormat(" --forceConfirm=yes"); - } - else - { - stringBuilder.AppendFormat(" --forceConfirm=no"); - } - - if (_recurse) - { - stringBuilder.AppendFormat(" --recurse"); - } - else - { - stringBuilder.AppendFormat(" --norecurse"); - } - - if (!string.IsNullOrEmpty(_project)) - { - stringBuilder.AppendFormat(" --project={0}", _project); - } - - return stringBuilder.ToString(); - } - catch (Exception ex) - { - Log.LogErrorFromException(ex); - return null; - } - } - #endregion Protected Methods - - #region Public Methods - /*---------------------------------------------------------------------------------------------------------------*/ - /// - /// Returns the fully qualified path to the executable file. - /// - /// - /// The fully qualified path to the executable file. - /// - /*---------------------------------------------------------------------------------------------------------------*/ - protected override string GenerateFullPathToTool() - { - try - { - return Path.Combine(ToolPath, ToolName); - } - catch (Exception ex) - { - Log.LogErrorFromException(ex); - return null; - } - } - #endregion Public Methods - } -} diff --git a/Source/MSBuild.Community.Tasks/Mks/MksMakeWritable.cs b/Source/MSBuild.Community.Tasks/Mks/MksMakeWritable.cs deleted file mode 100644 index 218ef586..00000000 --- a/Source/MSBuild.Community.Tasks/Mks/MksMakeWritable.cs +++ /dev/null @@ -1,183 +0,0 @@ -#region Copyright © 2006 Doug Ramirez. All rights reserved. -/* - Copyright © 2006 Doug Ramirez. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -3. The name of the author may not be used to endorse or promote products - derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR -IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -#endregion - -using System; -using System.IO; -using System.Text; -using Microsoft.Build.Framework; -using Microsoft.Build.Utilities; - -namespace MSBuild.Community.Tasks.Mks -{ - /*---------------------------------------------------------------------------------------------------------------*/ - /// - /// Custom MSBuild task that calls the MKS Make Writable command. - /// - /*---------------------------------------------------------------------------------------------------------------*/ - public class MksMakeWritable : ToolTask - { - #region Constants - const string COMMAND = "makewritable"; - #endregion Constants - - #region Private Member Variables - private string _directory; - private bool _forceConfirm; - #endregion Private Member Variables - - #region Contructors - /*---------------------------------------------------------------------------------------------------------------*/ - /// - /// Contructor that initializes ToolTask properties. - /// - /*---------------------------------------------------------------------------------------------------------------*/ - public MksMakeWritable() - { - // Set the path to the MKS CLI executable - ToolPath = @"C:\Program Files\MKS\IntegrityClient\bin"; - } - #endregion Constructors - - #region Protected Properties - /*---------------------------------------------------------------------------------------------------------------*/ - /// - /// The name of the program for the MKS CLI executable. - /// - /*---------------------------------------------------------------------------------------------------------------*/ - protected override string ToolName - { - get { return "si.exe"; } - } - #endregion Protected Properties - - #region Public Properties - /*---------------------------------------------------------------------------------------------------------------*/ - /// - /// Returns the text for the MKS Make Writable CLI command. - /// - /*---------------------------------------------------------------------------------------------------------------*/ - public string CommandText - { - get { return GenerateFullPathToTool() + " " + GenerateCommandLineCommands(); } - } - - /*---------------------------------------------------------------------------------------------------------------*/ - /// - /// The directory for Resync to be executed in. Any files and members in the selection are treated as being - /// relative to that directory. - /// - /*---------------------------------------------------------------------------------------------------------------*/ - [Required] - public string Directory - { - get { return _directory; } - set { _directory = value; } - } - - /*---------------------------------------------------------------------------------------------------------------*/ - /// - /// Control the responses of either "yes" or "no" to all prompts. - /// - /*---------------------------------------------------------------------------------------------------------------*/ - [Required] - public bool ForceConfirm - { - get { return _forceConfirm; } - set { _forceConfirm = value; } - } - #endregion Public Properties - - #region Protected Methods - /*---------------------------------------------------------------------------------------------------------------*/ - /// - /// Returns a string value containing the command line arguments to pass directly to the executable file. - /// - /// - /// A string value containing the command line arguments to pass directly to the executable file. - /// - /*---------------------------------------------------------------------------------------------------------------*/ - protected override string GenerateCommandLineCommands() - { - try - { - StringBuilder stringBuilder = new StringBuilder(); - - // Ensure that each string praram has a value. - if (string.IsNullOrEmpty(_directory)) - { - throw new ArgumentNullException(); - } - - // Build the CLI command to execute an MKS Make Writable - stringBuilder.AppendFormat(COMMAND); - stringBuilder.AppendFormat(" --cwd={0}", _directory); - - if (_forceConfirm) - { - stringBuilder.AppendFormat(" --forceConfirm=yes"); - } - else - { - stringBuilder.AppendFormat(" --forceConfirm=no"); - } - - return stringBuilder.ToString(); - } - catch (Exception ex) - { - Log.LogErrorFromException(ex); - return null; - } - } - #endregion Protected Methods - - #region Public Methods - /*---------------------------------------------------------------------------------------------------------------*/ - /// - /// Returns the fully qualified path to the executable file. - /// - /// - /// The fully qualified path to the executable file. - /// - /*---------------------------------------------------------------------------------------------------------------*/ - protected override string GenerateFullPathToTool() - { - try - { - return Path.Combine(ToolPath, ToolName); - } - catch (Exception ex) - { - Log.LogErrorFromException(ex); - return null; - } - } - #endregion Public Methods - } -} diff --git a/Source/MSBuild.Community.Tasks/Mks/MksResync.cs b/Source/MSBuild.Community.Tasks/Mks/MksResync.cs deleted file mode 100644 index 1f701e0f..00000000 --- a/Source/MSBuild.Community.Tasks/Mks/MksResync.cs +++ /dev/null @@ -1,237 +0,0 @@ -#region Copyright © 2006 Doug Ramirez. All rights reserved. -/* - Copyright © 2006 Doug Ramirez. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -3. The name of the author may not be used to endorse or promote products - derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR -IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -#endregion - -using System; -using System.IO; -using System.Text; -using Microsoft.Build.Framework; -using Microsoft.Build.Utilities; - -namespace MSBuild.Community.Tasks.Mks -{ - /*---------------------------------------------------------------------------------------------------------------*/ - /// - /// Custom MSBuild task that calls the MKS Resync command. - /// - /// Compares the contents of project members with their corresponding working files in the sandbox and - /// replaces the working file with an exact copy of the member revision, if differences are detected or if no - /// working file exists. - /// - /// - /// - /// ]]> - /// - /*---------------------------------------------------------------------------------------------------------------*/ - public class MksResync : ToolTask - { - #region Constants - const string COMMAND = "resync"; - #endregion Constants - - #region Private Member Variables - private string _directory; - private string _filter; - private bool _forceConfirm; - private bool _recurse; - #endregion Private Member Variables - - #region Contructors - /*---------------------------------------------------------------------------------------------------------------*/ - /// - /// Contructor that initializes ToolTask properties. - /// - /*---------------------------------------------------------------------------------------------------------------*/ - public MksResync() - { - // Set the path to the MKS CLI executable - ToolPath = @"C:\Program Files\MKS\IntegrityClient\bin"; - } - #endregion Constructors - - #region Protected Properties - /*---------------------------------------------------------------------------------------------------------------*/ - /// - /// The name of the program for the MKS CLI executable. - /// - /*---------------------------------------------------------------------------------------------------------------*/ - protected override string ToolName - { - get { return "si.exe"; } - } - #endregion Protected Properties - - #region Public Properties - /*---------------------------------------------------------------------------------------------------------------*/ - /// - /// Returns the text for the MKS Resync CLI command. - /// - /*---------------------------------------------------------------------------------------------------------------*/ - public string CommandText - { - get { return GenerateFullPathToTool() + " " + GenerateCommandLineCommands(); } - } - - /*---------------------------------------------------------------------------------------------------------------*/ - /// - /// The directory for Resync to be executed in. Any files and members in the selection are treated as being - /// relative to that directory. - /// - /*---------------------------------------------------------------------------------------------------------------*/ - [Required] - public string Directory - { - get { return _directory; } - set { _directory = value; } - } - - /*---------------------------------------------------------------------------------------------------------------*/ - /// - /// The filteroption to define a list of members to Resync. - /// - /*---------------------------------------------------------------------------------------------------------------*/ - [Required] - public string Filter - { - get { return _filter; } - set { _filter = value; } - } - - /*---------------------------------------------------------------------------------------------------------------*/ - /// - /// Control the responses of either "yes" or "no" to all prompts. - /// - /*---------------------------------------------------------------------------------------------------------------*/ - [Required] - public bool ForceConfirm - { - get { return _forceConfirm; } - set { _forceConfirm = value; } - } - - /*---------------------------------------------------------------------------------------------------------------*/ - /// - /// Specificy whether to recursively lock any subprojects. - /// - /*---------------------------------------------------------------------------------------------------------------*/ - [Required] - public bool Recurse - { - get { return _recurse; } - set { _recurse = value; } - } - #endregion Public Properties - - #region Protected Methods - /*---------------------------------------------------------------------------------------------------------------*/ - /// - /// Returns a string value containing the command line arguments to pass directly to the executable file. - /// - /// - /// A string value containing the command line arguments to pass directly to the executable file. - /// - /*---------------------------------------------------------------------------------------------------------------*/ - protected override string GenerateCommandLineCommands() - { - try - { - StringBuilder stringBuilder = new StringBuilder(); - - // Ensure that each string praram has a value. - if (string.IsNullOrEmpty(_directory)) - { - throw new ArgumentNullException(); - } - - // Build the CLI command to execute an MKS Lock - stringBuilder.AppendFormat(COMMAND); - stringBuilder.AppendFormat(" --cwd={0}", _directory); - - if (_forceConfirm) - { - stringBuilder.AppendFormat(" --forceConfirm=yes"); - } - else - { - stringBuilder.AppendFormat(" --forceConfirm=no"); - } - - if (!string.IsNullOrEmpty(_filter)) - { - stringBuilder.AppendFormat(" --filter={0}", _filter); - } - - if (_recurse) - { - stringBuilder.AppendFormat(" --recurse"); - } - else - { - stringBuilder.AppendFormat(" --norecurse"); - } - - return stringBuilder.ToString(); - } - catch (Exception ex) - { - Log.LogErrorFromException(ex); - return null; - } - } - #endregion Protected Methods - - #region Public Methods - /*---------------------------------------------------------------------------------------------------------------*/ - /// - /// Returns the fully qualified path to the executable file. - /// - /// - /// The fully qualified path to the executable file. - /// - /*---------------------------------------------------------------------------------------------------------------*/ - protected override string GenerateFullPathToTool() - { - try - { - return Path.Combine(ToolPath, ToolName); - } - catch (Exception ex) - { - Log.LogErrorFromException(ex); - return null; - } - } - #endregion Public Methods - } -} diff --git a/Source/MSBuild.Community.Tasks/Mks/MksUnlock.cs b/Source/MSBuild.Community.Tasks/Mks/MksUnlock.cs deleted file mode 100644 index 2bdfac6b..00000000 --- a/Source/MSBuild.Community.Tasks/Mks/MksUnlock.cs +++ /dev/null @@ -1,233 +0,0 @@ -#region Copyright © 2006 Doug Ramirez. All rights reserved. -/* - Copyright © 2006 Doug Ramirez. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -3. The name of the author may not be used to endorse or promote products - derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR -IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -#endregion - -using System; -using System.IO; -using System.Text; -using Microsoft.Build.Framework; -using Microsoft.Build.Utilities; - -namespace MSBuild.Community.Tasks.Mks -{ - /*---------------------------------------------------------------------------------------------------------------*/ - /// - /// Custom MSBuild task that calls the MKS Unlock command. - /// - /// Unlocks a member. - /// - /// - /// - /// ]]> - /// - /*---------------------------------------------------------------------------------------------------------------*/ - public class MksUnlock : ToolTask - { - #region Constants - const string COMMAND = "unlock"; - #endregion Constants - - #region Private Member Variables - private string _directory; - private string _filter; - private bool _forceConfirm; - private bool _recurse; - #endregion Private Member Variables - - #region Contructors - /*---------------------------------------------------------------------------------------------------------------*/ - /// - /// Contructor that initializes ToolTask properties. - /// - /*---------------------------------------------------------------------------------------------------------------*/ - public MksUnlock() - { - // Set the path to the MKS CLI executable - ToolPath = @"C:\Program Files\MKS\IntegrityClient\bin"; - } - #endregion Constructors - - #region Protected Properties - /*---------------------------------------------------------------------------------------------------------------*/ - /// - /// The name of the program for the MKS CLI executable. - /// - /*---------------------------------------------------------------------------------------------------------------*/ - protected override string ToolName - { - get { return "si.exe"; } - } - #endregion Protected Properties - - #region Public Properties - /*---------------------------------------------------------------------------------------------------------------*/ - /// - /// Returns the text for the MKS Unlock CLI command. - /// - /*---------------------------------------------------------------------------------------------------------------*/ - public string CommandText - { - get { return GenerateFullPathToTool() + " " + GenerateCommandLineCommands(); } - } - - /*---------------------------------------------------------------------------------------------------------------*/ - /// - /// The directory for Unlock to be executed in. Any files and members in the selection are treated as being - /// relative to that directory. - /// - /*---------------------------------------------------------------------------------------------------------------*/ - [Required] - public string Directory - { - get { return _directory; } - set { _directory = value; } - } - - /*---------------------------------------------------------------------------------------------------------------*/ - /// - /// The filteroption to define a list of members to Unlock. - /// - /*---------------------------------------------------------------------------------------------------------------*/ - public string Filter - { - get { return _filter; } - set { _filter = value; } - } - - /*---------------------------------------------------------------------------------------------------------------*/ - /// - /// Control the responses of either "yes" or "no" to all prompts. - /// - /*---------------------------------------------------------------------------------------------------------------*/ - [Required] - public bool ForceConfirm - { - get { return _forceConfirm; } - set { _forceConfirm = value; } - } - - /*---------------------------------------------------------------------------------------------------------------*/ - /// - /// Specificy whether to recursively unlock any subprojects. - /// - /*---------------------------------------------------------------------------------------------------------------*/ - [Required] - public bool Recurse - { - get { return _recurse; } - set { _recurse = value; } - } - #endregion Public Properties - - #region Protected Methods - /*---------------------------------------------------------------------------------------------------------------*/ - /// - /// Returns a string value containing the command line arguments to pass directly to the executable file. - /// - /// - /// A string value containing the command line arguments to pass directly to the executable file. - /// - /*---------------------------------------------------------------------------------------------------------------*/ - protected override string GenerateCommandLineCommands() - { - try - { - StringBuilder stringBuilder = new StringBuilder(); - - // Ensure that each string praram has a value. - if (string.IsNullOrEmpty(_directory)) - { - throw new ArgumentNullException(); - } - - // Build the CLI command to execute an MKS Unlock - stringBuilder.AppendFormat(COMMAND); - stringBuilder.AppendFormat(" --cwd={0}", _directory); - - if (!string.IsNullOrEmpty(_filter)) - { - stringBuilder.AppendFormat(" --filter={0}", _filter); - } - - if (_forceConfirm) - { - stringBuilder.AppendFormat(" --forceConfirm=yes"); - } - else - { - stringBuilder.AppendFormat(" --forceConfirm=no"); - } - - if (_recurse) - { - stringBuilder.AppendFormat(" --recurse"); - } - else - { - stringBuilder.AppendFormat(" --norecurse"); - } - - return stringBuilder.ToString(); - } - catch (Exception ex) - { - Log.LogErrorFromException(ex); - return null; - } - } - #endregion Protected Methods - - #region Public Methods - /*---------------------------------------------------------------------------------------------------------------*/ - /// - /// Returns the fully qualified path to the executable file. - /// - /// - /// The fully qualified path to the executable file. - /// - /*---------------------------------------------------------------------------------------------------------------*/ - protected override string GenerateFullPathToTool() - { - try - { - return Path.Combine(ToolPath, ToolName); - } - catch (Exception ex) - { - Log.LogErrorFromException(ex); - return null; - } - } - #endregion Public Methods - } -} diff --git a/Source/MSBuild.Community.Tasks/SourceSafe/VssAdd.cs b/Source/MSBuild.Community.Tasks/SourceSafe/VssAdd.cs deleted file mode 100644 index a42a14d3..00000000 --- a/Source/MSBuild.Community.Tasks/SourceSafe/VssAdd.cs +++ /dev/null @@ -1,97 +0,0 @@ -#region Copyright © 2005 Paul Welter. All rights reserved. -/* -Copyright © 2005 Paul Welter. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -3. The name of the author may not be used to endorse or promote products - derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR -IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -#endregion - -using System; -using System.Collections.Generic; -using System.Text; -using Microsoft.Build.Utilities; -using Microsoft.Build.Framework; - - - -namespace MSBuild.Community.Tasks.SourceSafe -{ - /// - /// Task that adds files to a Visual SourceSafe database. - /// - public class VssAdd : VssBase - { - private string _comment = string.Empty; - private ITaskItem[] _files; - - /// - /// List of files that should be added to SourceSafe. - /// - [Required] - public ITaskItem[] Files - { - get { return _files; } - set { _files = value; } - } - - /// - /// The comment to be applied to the newly added file. - /// - public string Comment - { - get { return _comment; } - set { _comment = value; } - } - - /// - /// Executes the task. - /// - /// if the task ran successfully; - /// otherwise . - public override bool Execute() - { - try - { - ConnectToDatabase(); - - foreach (ITaskItem item in Files) - { - Item.Add(item.ItemSpec, Comment, 0); - Log.LogMessage( - MessageImportance.Normal, - "Added {0} to {1}", - item.ItemSpec, - Path - ); - } - return true; - } - catch (Exception e) - { - LogErrorFromException(e); - return false; - } - } - } -} diff --git a/Source/MSBuild.Community.Tasks/SourceSafe/VssBase.cs b/Source/MSBuild.Community.Tasks/SourceSafe/VssBase.cs deleted file mode 100644 index 6ebedaeb..00000000 --- a/Source/MSBuild.Community.Tasks/SourceSafe/VssBase.cs +++ /dev/null @@ -1,160 +0,0 @@ -#region Copyright © 2005 Paul Welter. All rights reserved. -/* -Copyright © 2005 Paul Welter. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -3. The name of the author may not be used to endorse or promote products - derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR -IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -#endregion - -using System; -using System.Collections.Generic; -using System.IO; -using System.Text; -using Microsoft.Build.Utilities; -using Microsoft.Build.Framework; -using Microsoft.VisualStudio.SourceSafe.Interop; - - - -namespace MSBuild.Community.Tasks.SourceSafe -{ - /// - /// Base class for all of the Visual SourceSafe tasks. - /// - public abstract class VssBase : Task - { - private VSSDatabase _database; - private IVSSItem _item; - private string _databasePath; - private string _path; - private string _password = string.Empty; - private string _userName = string.Empty; - private string _version; - - /// - /// The path to the folder that contains the srcsafe.ini file. - /// - [Required] - public string DatabasePath - { - get { return _databasePath; } - set { _databasePath = value; } - } - - /// - /// The Visual SourceSafe project or file to perform the action - /// on (starts with "$/"). - /// - [Required] - public string Path - { - get { return _path; } - set { _path = value; } - } - - /// - /// The name of the user accessing the SourceSafe database. - /// - [Required] - public string UserName - { - get { return _userName; } - set { _userName = value; } - } - - /// - /// A version of the to reference. - /// - public string Version - { - get { return _version; } - set { _version = value; } - } - - /// - /// The password to use to log in to SourceSafe. - /// - public string Password - { - get { return _password; } - set { _password = value; } - } - - /// - /// Represents the VSS Database - /// - protected VSSDatabase Database - { - get { return _database; } - set { _database = value; } - } - - /// - /// Represents the VSS item selected (file or project). - /// - protected IVSSItem Item - { - get { return _item; } - set { _item = value; } - } - - /// - /// Attempts to connect to the SourceSafe Database and - /// load the specified item, or version of the item, if specified. - /// - protected void ConnectToDatabase() - { - _database = new VSSDatabase(); - _database.Open(new FileInfo(DatabasePath).FullName, UserName, Password); - - _item = _database.get_VSSItem(Path, false); - if (Version != null) - { - _item = _item.get_Version(Version); - } - } - - /// - /// Reserved. - /// - /// Reserved. - public override bool Execute() - { - throw new InvalidOperationException("You cannot execute this task directly."); - } - - /// - /// Logs an exception using the MSBuild logging framework. - /// - /// The to log. - protected void LogErrorFromException(Exception e) - { -#if DEBUG - Log.LogErrorFromException(e, true); -#else - Log.LogErrorFromException(e); -#endif - } - } -} diff --git a/Source/MSBuild.Community.Tasks/SourceSafe/VssCheckin.cs b/Source/MSBuild.Community.Tasks/SourceSafe/VssCheckin.cs deleted file mode 100644 index 5ebb9e3a..00000000 --- a/Source/MSBuild.Community.Tasks/SourceSafe/VssCheckin.cs +++ /dev/null @@ -1,118 +0,0 @@ -#region Copyright © 2005 Paul Welter. All rights reserved. -/* -Copyright © 2005 Paul Welter. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -3. The name of the author may not be used to endorse or promote products - derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR -IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -#endregion - -using System; -using System.Collections.Generic; -using System.IO; -using System.Text; -using Microsoft.Build.Utilities; -using Microsoft.Build.Framework; -using Microsoft.VisualStudio.SourceSafe.Interop; - - - -namespace MSBuild.Community.Tasks.SourceSafe -{ - /// - /// Task that executes a checkin against a VSS Database. - /// - /// - /// - /// - /// ]]> - /// - public class VssCheckin : VssRecursiveBase - { - private string _comment = string.Empty; - private string _localPath; - private bool _writable = false; - - /// - /// The path to the local working directory. - /// - [Required] - public string LocalPath - { - get { return _localPath; } - set { _localPath = value; } - } - - /// - /// Determines whether to leave the file(s) as writable once the - /// checkin is complete. The default is . - /// - public bool Writable - { - get { return _writable; } - set { _writable = value; } - } - - /// - /// The checkin comment. - /// - public string Comment - { - get { return _comment; } - set { _comment = value; } - } - - /// - /// Executes the task. - /// - /// if the task ran successfully; - /// otherwise . - public override bool Execute() - { - try - { - FileInfo localPath = new FileInfo(_localPath); - ConnectToDatabase(); - - int flags = (Recursive ? Convert.ToInt32(RecursiveFlag) : 0) | - (Writable ? Convert.ToInt32(VSSFlags.VSSFLAG_USERRONO) : Convert.ToInt32(VSSFlags.VSSFLAG_USERROYES)); - - Item.Checkin(Comment, localPath.FullName, flags); - - Log.LogMessage(MessageImportance.Normal, "Checked in '{0}'.", Path); - return true; - } - catch (Exception e) - { - LogErrorFromException(e); - return false; - } - } - } -} diff --git a/Source/MSBuild.Community.Tasks/SourceSafe/VssCheckout.cs b/Source/MSBuild.Community.Tasks/SourceSafe/VssCheckout.cs deleted file mode 100644 index c0352fda..00000000 --- a/Source/MSBuild.Community.Tasks/SourceSafe/VssCheckout.cs +++ /dev/null @@ -1,183 +0,0 @@ -#region Copyright © 2005 Paul Welter. All rights reserved. -/* -Copyright © 2005 Paul Welter. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -3. The name of the author may not be used to endorse or promote products - derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR -IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -#endregion - -using System; -using System.Collections.Generic; -using System.IO; -using System.Text; -using System.Text.RegularExpressions; -using Microsoft.Build.Utilities; -using Microsoft.Build.Framework; -using Microsoft.VisualStudio.SourceSafe.Interop; - - - -namespace MSBuild.Community.Tasks.SourceSafe -{ - /// - /// Task that executes a checkout of files or projects - /// against a Visual SourceSafe database. - /// - /// - /// - /// - /// ]]> - /// - public class VssCheckout : VssRecursiveBase - { - private string _localPath; - private bool _writable = false; - - /// - /// The path to the local working directory. - /// - [Required] - public string LocalPath - { - get { return _localPath; } - set { _localPath = value; } - } - - /// - /// Determines whether files will be writable once retrieved from - /// the repository. The default is . - /// - public bool Writable - { - get { return _writable; } - set { _writable = value; } - } - - /// - /// Executes the task. - /// - /// if the task ran successfully; - /// otherwise . - public override bool Execute() - { - try - { - string searchPattern = ""; - if (Path.Contains("*")) - { - // If the path has a wildcard character (*), we use the last part (or the search pattern part) - // of the path to selectively checkout files based on wildcard search using regular expression. - // In order to achieve this we strip out the search pattern part of the path, if the path has - // a wildcard character in it, and use it for the pattern in our regular expression search, but - // only if search pattern part contains a wildcard character. - // Example: $/Project/AssemblyInfo.* - Path = Path.TrimEnd(new char[] { '/' }); - searchPattern = Path.Substring(Path.LastIndexOf('/') + 1); - searchPattern = searchPattern.Replace(".", "\\.").Replace("*", ".*"); - if (searchPattern.Contains("*")) - { - // The search pattern part of the path is valid, so we'll remove the search pattern from - // the path. This way our starting point will be a project and not a file. - Path = Path.Substring(0, Path.LastIndexOf('/')); - } - else - { - // The wildcard is not in the search pattern part of the path but elsewhere, so we'll - // try to checkout the provided path as-is. - searchPattern = ""; - } - } - - ConnectToDatabase(); - - int flags = (Recursive ? Convert.ToInt32(RecursiveFlag) : 0) | - (Writable ? Convert.ToInt32(VSSFlags.VSSFLAG_USERRONO) : Convert.ToInt32(VSSFlags.VSSFLAG_USERROYES)); - - Checkout(Item, new FileInfo(_localPath), flags, searchPattern); - - Log.LogMessage(MessageImportance.Normal, "Checked out '{0}'.", Path); - return true; - } - catch (Exception e) - { - LogErrorFromException(e); - return false; - } - } - - private void Checkout(IVSSItem checkoutItem, FileInfo localPath, int flags, string pattern) - { - //TODO: timestamp stuff - - switch (checkoutItem.Type) - { - case (int)VSSItemType.VSSITEM_PROJECT: - // Item is a project. - if (string.IsNullOrEmpty(pattern)) - { - // In the absence of a pattern, we'll checkout the entire project. - checkoutItem.Checkout("", localPath.FullName, flags); - } - else - { - // If a pattern is provided, we process all subitems in the project. - foreach (IVSSItem subItem in checkoutItem.get_Items(false)) - { - switch (subItem.Type) - { - case (int)VSSItemType.VSSITEM_PROJECT: - // Subitem is a project. - if (Recursive) - { - // We'll recursively checkout matching files in this project. - Checkout(subItem, new FileInfo(System.IO.Path.Combine(localPath.FullName, subItem.Name)), flags, pattern); - } - break; - case (int)VSSItemType.VSSITEM_FILE: - // Subitem is a file. - if (Regex.IsMatch(subItem.Name, pattern)) - { - // We'll checkout this file since it matches the search pattern. - Checkout(subItem, localPath, flags, ""); - } - break; - } - } - } - break; - case (int)VSSItemType.VSSITEM_FILE: - // Item is a file. - string filePath = System.IO.Path.Combine(localPath.FullName, checkoutItem.Name); - checkoutItem.Checkout("", filePath, flags); - break; - } - } - } -} diff --git a/Source/MSBuild.Community.Tasks/SourceSafe/VssClean.cs b/Source/MSBuild.Community.Tasks/SourceSafe/VssClean.cs deleted file mode 100644 index 47279774..00000000 --- a/Source/MSBuild.Community.Tasks/SourceSafe/VssClean.cs +++ /dev/null @@ -1,30 +0,0 @@ - - -using System; -using System.Collections.Generic; -using System.Text; -using Microsoft.Build.Utilities; - -namespace MSBuild.Community.Tasks.SourceSafe -{ - /// - /// Task that can strip the source control information from a - /// Visual Studio Solution and subprojects. - /// - /// This task is useful if you keep an archive of the - /// source tree at each build milestone, because it's irritating to have - /// to remove source control binding manually once you've copied a - /// version of the code from your archive. - public class VssClean : Task - { - /// - /// Executes the task. - /// - /// if the task ran successfully; - /// otherwise . - public override bool Execute() - { - throw new NotImplementedException(); - } - } -} diff --git a/Source/MSBuild.Community.Tasks/SourceSafe/VssDiff.cs b/Source/MSBuild.Community.Tasks/SourceSafe/VssDiff.cs deleted file mode 100644 index a42a6352..00000000 --- a/Source/MSBuild.Community.Tasks/SourceSafe/VssDiff.cs +++ /dev/null @@ -1,212 +0,0 @@ -#region Copyright © 2005 Paul Welter. All rights reserved. -/* -Copyright © 2005 Paul Welter. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -3. The name of the author may not be used to endorse or promote products - derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR -IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -#endregion - - - -using System; -using System.Collections.Generic; -using System.Text; -using System.Xml; -using Microsoft.Build.Framework; -using Microsoft.Build.Utilities; -using Microsoft.VisualStudio.SourceSafe.Interop; - -namespace MSBuild.Community.Tasks.SourceSafe -{ - /// - /// Task that records differences between the latest version - /// of all the items in a Visual SourceSafe project and another version or label - /// to a file. - /// - /// - /// Generates a file containing all of the differences between the - /// current version and the label "Test Label" - /// ]]> - /// - public class VssDiff : VssBase - { - private string _label; - private string _outputFile; - private XmlDocument _outputDoc; - - /// - /// The value of the label to compare to. - /// - [Required] - public string Label - { - get { return _label; } - set { _label = value; } - } - - /// - /// The name of the file to send the output to. - /// - [Required] - public string OutputFile - { - get { return _outputFile; } - set { _outputFile = value; } - } - - /// - /// Executes the task. - /// - /// if the task ran successfully; - /// otherwise . - public override bool Execute() - { - try - { - ConnectToDatabase(); - - Log.LogMessage(MessageImportance.Normal, "Examining: " + this.Path); - - //Setup the XmlOutput File - _outputDoc = new XmlDocument(); - XmlElement root = _outputDoc.CreateElement("vssdiff"); - XmlAttribute attrib = _outputDoc.CreateAttribute("label"); - attrib.Value = _label; - root.Attributes.Append(attrib); - attrib = _outputDoc.CreateAttribute("generated"); - attrib.Value = System.DateTime.Now.ToString(); - root.Attributes.Append(attrib); - attrib = _outputDoc.CreateAttribute("project"); - attrib.Value = this.Path; - root.Attributes.Append(attrib); - - _outputDoc.AppendChild(root); - - //Start the recursive search - ProjectDiff(this.Path); - _outputDoc.Save(_outputFile); - - Log.LogMessage(MessageImportance.Normal, "Diff file {0} generated", OutputFile); - return true; - } - catch (Exception e) - { - LogErrorFromException(e); - return false; - } - } - - private void ItemDiff(IVSSItem ssItem) - { - Log.LogMessage(MessageImportance.Low, "Processing item " + ssItem.Name); - - bool addVersion = true; - int labeledVersion = 0; - foreach (IVSSVersion version in ssItem.get_Versions(0)) - { - // VSS returns the versions in descending order, meaning the - // most recent versions appear first. - string action = version.Action; - - // We found our version so stop adding versions to our list - if (action.StartsWith("Labeled '" + _label + "'")) - { - labeledVersion = version.VersionNumber; - addVersion = false; - //This is a bit annoying, it would be more efficient to break - //out of the loop here but VSS throws an exception !%?! - //http://tinyurl.com/nmct - //break; - } - if (addVersion == true) - { - // Only add versions that have been added,created or checked in. Ignore label actions. - if ((action.StartsWith("Add")) || (action.StartsWith("Create")) || (action.StartsWith("Check"))) - { - Log.LogMessage(MessageImportance.Low, "Adding: " + version.VSSItem.Name); - - // Build our XML Element with hopefully useful information. - XmlElement node = _outputDoc.CreateElement("item"); - XmlAttribute attrib = _outputDoc.CreateAttribute("name"); - attrib.Value = version.VSSItem.Name; - node.Attributes.Append(attrib); - - attrib = _outputDoc.CreateAttribute("path"); - attrib.Value = version.VSSItem.Spec; - node.Attributes.Append(attrib); - - attrib = _outputDoc.CreateAttribute("action"); - attrib.Value = action; - node.Attributes.Append(attrib); - - attrib = _outputDoc.CreateAttribute("date"); - attrib.Value = version.Date.ToString(); - node.Attributes.Append(attrib); - - attrib = _outputDoc.CreateAttribute("version"); - attrib.Value = version.VersionNumber.ToString(); - node.Attributes.Append(attrib); - - attrib = _outputDoc.CreateAttribute("user"); - attrib.Value = version.Username; - node.Attributes.Append(attrib); - - attrib = _outputDoc.CreateAttribute("comment"); - attrib.Value = version.Comment; - node.Attributes.Append(attrib); - - _outputDoc.ChildNodes.Item(0).AppendChild(node); - } - } - } - } - - private void ProjectDiff(string project) - { - // Recursively loop through our vss projects - Log.LogMessage(MessageImportance.Low, "Processing project " + project); - IVSSItem ssProj = this.Database.get_VSSItem(project, false); - IVSSItems ssSubItems = ssProj.get_Items(false); - - foreach (IVSSItem subItem in ssSubItems) - { - if (subItem.Type == 0) - { - //Type=0 is a Project - ProjectDiff(project + "/" + subItem.Name); - } - else - { - ItemDiff(subItem); - } - } - } - } -} diff --git a/Source/MSBuild.Community.Tasks/SourceSafe/VssGet.cs b/Source/MSBuild.Community.Tasks/SourceSafe/VssGet.cs deleted file mode 100644 index 3494e3a1..00000000 --- a/Source/MSBuild.Community.Tasks/SourceSafe/VssGet.cs +++ /dev/null @@ -1,135 +0,0 @@ -#region Copyright © 2005 Paul Welter. All rights reserved. -/* -Copyright © 2005 Paul Welter. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -3. The name of the author may not be used to endorse or promote products - derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR -IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -#endregion - -using System; -using System.Collections.Generic; -using System.IO; -using System.Text; -using Microsoft.Build.Utilities; -using Microsoft.Build.Framework; -using Microsoft.VisualStudio.SourceSafe.Interop; - - - -namespace MSBuild.Community.Tasks.SourceSafe -{ - /// - /// Task that retireves an item or project from a Visual SourceSafe database. - /// - /// - /// Get the latest version (recursive) of a file from a VSS database and place - /// in the specified local folder. - /// - /// - public class VssGet : VssRecursiveBase - { - private string _localPath; - private bool _replace = false; - private bool _writable = false; - - /// - /// The path to the local working directory. - /// - [Required] - public string LocalPath - { - get { return _localPath; } - set { _localPath = value; } - } - - /// - /// Determines whether to replace writable files. - /// The default is . - /// - public bool Replace - { - get { return _replace; } - set { _replace = value; } - } - - /// - /// Determines whether files will be writable once retrieved from - /// the repository. The default is . - /// - public bool Writable - { - get { return _writable; } - set { _writable = value; } - } - - /// - /// Runs the task using the specified parameters. - /// - /// if the task ran successfully; - /// otherwise . - public override bool Execute() - { - try - { - FileInfo localPath = new FileInfo(_localPath); - ConnectToDatabase(); - Log.LogMessage(MessageImportance.Normal, "Getting '{0}' to '{1}'", Path, localPath.FullName); - - //TODO: figure the flags out.... - int flags = (Recursive ? Convert.ToInt32(RecursiveFlag) : 0) | - (Writable ? Convert.ToInt32(VSSFlags.VSSFLAG_USERRONO) : Convert.ToInt32(VSSFlags.VSSFLAG_USERROYES)) | - (Replace ? Convert.ToInt32(VSSFlags.VSSFLAG_REPREPLACE) : 0); - //TODO: timestamp stuff.... - - string localPathValue; - - switch (Item.Type) - { - case (int) VSSItemType.VSSITEM_PROJECT : - localPathValue = localPath.FullName; - Item.Get(ref localPathValue, flags); - break; - case (int) VSSItemType.VSSITEM_FILE : - localPathValue = System.IO.Path.Combine(localPath.FullName, Item.Name); - Item.Get(ref localPathValue, flags); - break; - } - - return true; - } - catch (Exception e) - { - LogErrorFromException(e); - return false; - } - } - } -} diff --git a/Source/MSBuild.Community.Tasks/SourceSafe/VssHistory.cs b/Source/MSBuild.Community.Tasks/SourceSafe/VssHistory.cs deleted file mode 100644 index a4282057..00000000 --- a/Source/MSBuild.Community.Tasks/SourceSafe/VssHistory.cs +++ /dev/null @@ -1,373 +0,0 @@ -#region Copyright © 2005 Paul Welter. All rights reserved. -/* -Copyright © 2005 Paul Welter. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -3. The name of the author may not be used to endorse or promote products - derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR -IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -#endregion - -using System; -using System.Collections.Generic; -using System.Globalization; -using System.Text; -using Microsoft.Build.Utilities; -using Microsoft.Build.Framework; -using System.Xml; -using Microsoft.VisualStudio.SourceSafe.Interop; - - - -namespace MSBuild.Community.Tasks.SourceSafe -{ - #region Documentation - /// - /// Generates an XML file containing details of all changes made - /// to a Visual SourceSafe project or file between specified labels or dates. - /// - /// - /// Generates a file containing details of all the changes made to the $/Test - /// project by a user called joe.bloggs - /// - /// ]]> - /// - /// - /// Generates a file containing details of all the changes made between the - /// labels Build1 and Build2 in the $/Test project. - /// - /// ]]> - /// - /// - /// Generates a file containing details of all the changes made between the - /// 1st December 2005 and 10th December 2005in the $/Test project. - /// - /// ]]> - /// - #endregion - public class VssHistory : VssRecursiveBase - { - private string _toLabel; - private string _fromLabel; - private DateTime _toDate; - private DateTime _fromDate; - private string _outputFile; - private string _user; - private XmlDocument _outputDoc; - - /// - /// The label to start comparing to. - /// - public string ToLabel - { - get { return _toLabel; } - set { _toLabel = value; } - } - - /// - /// The label to compare up to. - /// - public string FromLabel - { - get { return _fromLabel; } - set { _fromLabel = value; } - } - - /// - /// The Start Date for the history. - /// - public DateTime ToDate - { - get { return _toDate; } - set { _toDate = value; } - } - - /// - /// The End Date for the history. - /// - public DateTime FromDate - { - get { return _fromDate; } - set { _fromDate = value; } - } - - /// - /// The name and path of the XML output file. - /// - [Required] - public string OutputFile - { - get { return _outputFile; } - set { _outputFile = value; } - } - - /// - /// The name of the user whose changes should be listed in - /// the history. - /// - public string User - { - get { return _user; } - set { _user = value; } - } - - private int VersionFlags - { - get - { - return Recursive ? (int)VSSFlags.VSSFLAG_RECURSYES : (int)VSSFlags.VSSFLAG_RECURSNO; - } - } - - /// - /// Executes the task. - /// - /// if the task ran successfully; - /// otherwise . - public override bool Execute() - { - try - { - ConnectToDatabase(); - Log.LogMessage(MessageImportance.Normal, "Examining {0}...", this.Path); - - //Setup the XmlOutput File - _outputDoc = new XmlDocument(); - XmlElement root = _outputDoc.CreateElement("VssHistory"); - XmlAttribute attrib = _outputDoc.CreateAttribute("FromLabel"); - attrib.Value = _fromLabel; - root.Attributes.Append(attrib); - - attrib = _outputDoc.CreateAttribute("ToLabel"); - attrib.Value = _toLabel; - root.Attributes.Append(attrib); - - attrib = _outputDoc.CreateAttribute("FromDate"); - if (FromDate != DateTime.MinValue) - { - attrib.Value = XmlConvert.ToString(FromDate, XmlDateTimeSerializationMode.Utc); - } - root.Attributes.Append(attrib); - - attrib = _outputDoc.CreateAttribute("ToDate"); - if (ToDate != DateTime.MinValue) - { - attrib.Value = XmlConvert.ToString(ToDate, XmlDateTimeSerializationMode.Utc); - } - root.Attributes.Append(attrib); - - attrib = _outputDoc.CreateAttribute("Path"); - attrib.Value = this.Path; - root.Attributes.Append(attrib); - - attrib = _outputDoc.CreateAttribute("Recursive"); - attrib.Value = XmlConvert.ToString(this.Recursive); - root.Attributes.Append(attrib); - - attrib = _outputDoc.CreateAttribute("User"); - attrib.Value = this.User; - root.Attributes.Append(attrib); - - attrib = _outputDoc.CreateAttribute("Generated"); - attrib.Value = XmlConvert.ToString(DateTime.Now, XmlDateTimeSerializationMode.Utc); - root.Attributes.Append(attrib); - - _outputDoc.AppendChild(root); - - ItemDiff(Item); - - _outputDoc.Save(OutputFile); - - Log.LogMessage(MessageImportance.Normal, "Generated diff file: {0}", OutputFile); - - return true; - } - catch (Exception e) - { - LogErrorFromException(e); - return false; - } - } - - private void ItemDiff(IVSSItem ssItem) - { - Log.LogMessage(MessageImportance.Normal, "History of {0}...", ssItem.Name); - - if (FromLabel != null || ToLabel != null) - { - DiffByLabel(ssItem); - } - else - { - DiffByDate(ssItem); - } - } - - private void DiffByDate(IVSSItem ssItem) - { - bool startLogging = false; - bool stopLogging = false; - - string user = User != null ? User.ToLower(CultureInfo.InvariantCulture) : null; - - foreach (IVSSVersion version in ssItem.get_Versions(VersionFlags)) - { - // VSS returns the versions in descending order, meaning the - // most recent versions appear first. - if (ToDate == DateTime.MinValue || version.Date <= ToDate) - { - startLogging = true; - } - if (FromDate != DateTime.MinValue && FromDate > version.Date) - { - stopLogging = true; - } - if (startLogging && !stopLogging) - { - // if user was specified, then skip changes that were not - // performed by that user - if (user != null && version.Username.ToLower(CultureInfo.InvariantCulture) != user) - { - continue; - } - - LogChange(version); - } - } - } - - private void DiffByLabel(IVSSItem ssItem) - { - bool startLogging = false; - bool stopLogging = false; - - string user = User != null ? User.ToLower(CultureInfo.InvariantCulture) : null; - - foreach (IVSSVersion version in ssItem.get_Versions(VersionFlags)) - { - // VSS returns the versions in descending order, meaning the - // most recent versions appear first. - if (ToLabel == null || version.Action.StartsWith(string.Format("Labeled '{0}'", ToLabel))) - { - startLogging = true; - } - if (FromLabel != null && version.Action.StartsWith(string.Format("Labeled '{0}'", FromLabel))) - { - stopLogging = true; - } - if (startLogging && !stopLogging) - { - // if user was specified, then skip changes that were not - // performed by that user - if (user != null && version.Username.ToLower(CultureInfo.InvariantCulture) != user) - { - continue; - } - - LogChange(version); - } - } - } - - private void LogChange(IVSSVersion version) - { - const int FILE_OR_PROJECT_DOES_NOT_EXIST = -2147166577; - - XmlElement node; - XmlAttribute attrib; - - try - { - node = _outputDoc.CreateElement("Entry"); - attrib = _outputDoc.CreateAttribute("Name"); - attrib.Value = version.VSSItem.Name; - node.Attributes.Append(attrib); - - attrib = _outputDoc.CreateAttribute("Path"); - attrib.Value = version.VSSItem.Spec; - node.Attributes.Append(attrib); - } - catch (System.Runtime.InteropServices.COMException ex) - { - if (ex.ErrorCode != FILE_OR_PROJECT_DOES_NOT_EXIST) - { - throw; - } - - return; - } - - attrib = _outputDoc.CreateAttribute("Action"); - attrib.Value = version.Action; - node.Attributes.Append(attrib); - - attrib = _outputDoc.CreateAttribute("Date"); - attrib.Value = XmlConvert.ToString(version.Date, XmlDateTimeSerializationMode.Utc); - node.Attributes.Append(attrib); - - attrib = _outputDoc.CreateAttribute("Version"); - attrib.Value = XmlConvert.ToString(version.VersionNumber); - node.Attributes.Append(attrib); - - attrib = _outputDoc.CreateAttribute("User"); - attrib.Value = version.Username; - node.Attributes.Append(attrib); - - attrib = _outputDoc.CreateAttribute("Comment"); - attrib.Value = version.Comment; - node.Attributes.Append(attrib); - - attrib = _outputDoc.CreateAttribute("Label"); - attrib.Value = version.Label; - node.Attributes.Append(attrib); - - attrib = _outputDoc.CreateAttribute("LabelComment"); - attrib.Value = version.LabelComment; - node.Attributes.Append(attrib); - - _outputDoc.ChildNodes.Item(0).AppendChild(node); - } - } -} diff --git a/Source/MSBuild.Community.Tasks/SourceSafe/VssLabel.cs b/Source/MSBuild.Community.Tasks/SourceSafe/VssLabel.cs deleted file mode 100644 index 2f680e52..00000000 --- a/Source/MSBuild.Community.Tasks/SourceSafe/VssLabel.cs +++ /dev/null @@ -1,90 +0,0 @@ -#region Copyright © 2005 Paul Welter. All rights reserved. -/* -Copyright © 2005 Paul Welter. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -3. The name of the author may not be used to endorse or promote products - derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR -IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -#endregion - -using System; -using System.Collections.Generic; -using System.IO; -using System.Text; -using Microsoft.Build.Utilities; -using Microsoft.Build.Framework; -using Microsoft.VisualStudio.SourceSafe.Interop; - - - -namespace MSBuild.Community.Tasks.SourceSafe -{ - /// - /// Task that applies a label to a Visual SourceSafe item. - /// - public class VssLabel : VssRecursiveBase - { - string _label; - string _comment; - - /// - /// The text of the label. - /// - [Required] - public string Label - { - get { return _label; } - set { _label = value; } - } - - /// - /// An optional comment. - /// - public string Comment - { - get { return _comment; } - set { _comment = value; } - } - - /// - /// Executes the task. - /// - /// if the task ran successfully; - /// otherwise . - public override bool Execute() - { - try - { - ConnectToDatabase(); - Item.Label(Label, Comment); - Log.LogMessage(MessageImportance.Normal, "Applied label '{0}' to '{1}'", Label, Path); - return true; - } - catch (Exception e) - { - LogErrorFromException(e); - return false; - } - } - } -} diff --git a/Source/MSBuild.Community.Tasks/SourceSafe/VssRecursiveBase.cs b/Source/MSBuild.Community.Tasks/SourceSafe/VssRecursiveBase.cs deleted file mode 100644 index 738c51f8..00000000 --- a/Source/MSBuild.Community.Tasks/SourceSafe/VssRecursiveBase.cs +++ /dev/null @@ -1,39 +0,0 @@ - - -using System; -using System.Collections.Generic; -using System.Text; -using Microsoft.VisualStudio.SourceSafe.Interop; - -namespace MSBuild.Community.Tasks.SourceSafe -{ - /// - /// Base class for VSS tasks that can act recursively. - /// - public abstract class VssRecursiveBase : VssBase - { - internal const VSSFlags RecursiveFlag = VSSFlags.VSSFLAG_RECURSYES | - VSSFlags.VSSFLAG_FORCEDIRNO; - - private bool _recursive = true; - - /// - /// Determines whether to perform the SourceSafe operation - /// recursively. The default is . - /// - public bool Recursive - { - get { return _recursive; } - set { _recursive = value; } - } - - /// - /// Reserved. - /// - /// Reserved. - public override bool Execute() - { - throw new InvalidOperationException("You cannot execute this task directly."); - } - } -} diff --git a/Source/MSBuild.Community.Tasks/SourceSafe/VssUndoCheckout.cs b/Source/MSBuild.Community.Tasks/SourceSafe/VssUndoCheckout.cs deleted file mode 100644 index 7588b1b0..00000000 --- a/Source/MSBuild.Community.Tasks/SourceSafe/VssUndoCheckout.cs +++ /dev/null @@ -1,97 +0,0 @@ -#region Copyright © 2005 Paul Welter. All rights reserved. -/* -Copyright © 2005 Paul Welter. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -3. The name of the author may not be used to endorse or promote products - derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR -IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -#endregion - - - -using System; -using System.Collections.Generic; -using System.IO; -using System.Text; -using Microsoft.Build.Utilities; -using Microsoft.Build.Framework; -using Microsoft.VisualStudio.SourceSafe.Interop; - -namespace MSBuild.Community.Tasks.SourceSafe -{ - /// - /// Task that undoes a checkout of files or projects - /// against a Visual SourceSafe database. - /// - /// - /// - /// - /// ]]> - /// - public class VssUndoCheckout : VssRecursiveBase - { - private string _localPath; - - /// - /// The path to the local working directory. - /// - [Required] - public string LocalPath - { - get { return _localPath; } - set { _localPath = value; } - } - - /// - /// Executes the task. - /// - /// if the task ran successfully; - /// otherwise . - public override bool Execute() - { - try - { - FileInfo localPath = new FileInfo(_localPath); - ConnectToDatabase(); - - int flags = (Recursive ? Convert.ToInt32(RecursiveFlag) : 0); - - Item.UndoCheckout(localPath.FullName, flags); - - Log.LogMessage(MessageImportance.Normal, "Undo of checkout completed for '{0}'.", Path); - return true; - } - catch (Exception e) - { - LogErrorFromException(e); - return false; - } - } - } -} diff --git a/Source/MSBuild.Community.Tasks/Tfs/TeamFoundationServer.cs b/Source/MSBuild.Community.Tasks/Tfs/TeamFoundationServer.cs index 38285b37..be478bfa 100644 --- a/Source/MSBuild.Community.Tasks/Tfs/TeamFoundationServer.cs +++ b/Source/MSBuild.Community.Tasks/Tfs/TeamFoundationServer.cs @@ -1,99 +1,129 @@ - -using System; +using System.Collections; +using System.IO; using System.Net; using System.Reflection; -using System.IO; -using System.Collections; -using MSBuild.Community.Tasks.Tfs.Proxies; namespace MSBuild.Community.Tasks.Tfs { - /// - /// Handles all communication with the Team Foundation Server - /// - internal class TeamFoundationServer : IServer - { - Assembly clientAssembly; - Assembly versionControlClientAssembly; - - /// - /// Creates an instace of the TeamFoundationServer class - /// - /// The local file path containing the TFS libraries. null if TFS is in the GAC. - public TeamFoundationServer(string clientLocation) - { - if (clientLocation == null) - { - try - { - clientAssembly = - Assembly.Load( - "Microsoft.TeamFoundation.Client, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"); - versionControlClientAssembly = - Assembly.Load( - "Microsoft.TeamFoundation.VersionControl.Client, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"); - } - catch {} - - if (clientAssembly == null) - { - clientAssembly = - Assembly.Load( - "Microsoft.TeamFoundation.Client, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"); - versionControlClientAssembly = - Assembly.Load( - "Microsoft.TeamFoundation.VersionControl.Client, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"); - } - } - else - { - string clientFilePath = Path.Combine(clientLocation, "Microsoft.TeamFoundation.Client.dll"); - string versionControlClientFilePath = Path.Combine(clientLocation, "Microsoft.TeamFoundation.VersionControl.Client.dll"); - - clientAssembly = Assembly.LoadFrom(clientFilePath); - versionControlClientAssembly = Assembly.LoadFrom(versionControlClientFilePath); - } - } - - - - /// - /// Retrieves the latest changeset ID associated with a path - /// - /// A path on the local filesystem - /// Credentials used to authenticate against the serer - /// - public int GetLatestChangesetId(string localPath, ICredentials credentials) - { - int latestChangesetId = 0; - string server; - - Workstation workstation = new Workstation(versionControlClientAssembly); - WorkspaceInfo workspaceInfo = workstation.GetLocalWorkspaceInfo(localPath); - server = workspaceInfo.ServerUri.ToString(); - VersionControlServer sourceControl = new VersionControlServer(clientAssembly, versionControlClientAssembly, server, credentials); - - Workspace workspace = sourceControl.GetWorkspace(localPath); - WorkspaceVersionSpec workspaceVersionSpec = new WorkspaceVersionSpec(versionControlClientAssembly, workspace); - - VersionSpec versionSpec = new VersionSpec(versionControlClientAssembly); - RecursionType recursionType = new RecursionType(versionControlClientAssembly); - - IEnumerable history = sourceControl.QueryHistory(localPath, versionSpec.Latest, recursionType.Full, workspaceVersionSpec); - - IEnumerator historyEnumerator = history.GetEnumerator(); - Changeset latestChangeset = new Changeset(versionControlClientAssembly); - if (historyEnumerator.MoveNext()) - { - latestChangeset = new Changeset(versionControlClientAssembly, historyEnumerator.Current); - } - - if (latestChangeset.Instance != null) - { - latestChangesetId = latestChangeset.ChangesetId; - } - return latestChangesetId; - } - - } + using Proxies; + + /// + /// Handles all communication with the Team Foundation Server + /// + internal class TeamFoundationServer : IServer + { + readonly Assembly clientAssembly; + readonly Assembly versionControlClientAssembly; + + /// + /// Creates an instace of the TeamFoundationServer class + /// + /// The local file path containing the TFS libraries. null if TFS is in the GAC. + public TeamFoundationServer(string clientLocation) + { + if (clientLocation == null) + { + try + { + clientAssembly = + Assembly.Load( + "Microsoft.TeamFoundation.Client, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"); + versionControlClientAssembly = + Assembly.Load( + "Microsoft.TeamFoundation.VersionControl.Client, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"); + } + catch { } + + try + { + if (clientAssembly == null) + { + clientAssembly = + Assembly.Load( + "Microsoft.TeamFoundation.Client, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"); + versionControlClientAssembly = + Assembly.Load( + "Microsoft.TeamFoundation.VersionControl.Client, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"); + } + } + catch + { + } + try + { + if (clientAssembly == null) + { + clientAssembly = + Assembly.Load( + "Microsoft.TeamFoundation.Client, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"); + versionControlClientAssembly = + Assembly.Load( + "Microsoft.TeamFoundation.VersionControl.Client, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"); + } + } + catch + { + } + + if (clientAssembly == null) + { + clientAssembly = + Assembly.Load( + "Microsoft.TeamFoundation.Client, Version=11.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"); + versionControlClientAssembly = + Assembly.Load( + "Microsoft.TeamFoundation.VersionControl.Client, Version=11.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"); + } + } + else + { + string clientFilePath = Path.Combine(clientLocation, "Microsoft.TeamFoundation.Client.dll"); + string versionControlClientFilePath = Path.Combine(clientLocation, "Microsoft.TeamFoundation.VersionControl.Client.dll"); + + clientAssembly = Assembly.LoadFrom(clientFilePath); + versionControlClientAssembly = Assembly.LoadFrom(versionControlClientFilePath); + } + } + + + + /// + /// Retrieves the latest changeset ID associated with a path + /// + /// A path on the local filesystem + /// Credentials used to authenticate against the serer + /// + public int GetLatestChangesetId(string localPath, ICredentials credentials) + { + int latestChangesetId = 0; + string server; + + Workstation workstation = new Workstation(versionControlClientAssembly); + WorkspaceInfo workspaceInfo = workstation.GetLocalWorkspaceInfo(localPath); + server = workspaceInfo.ServerUri.ToString(); + VersionControlServer sourceControl = new VersionControlServer(clientAssembly, versionControlClientAssembly, server, credentials); + + Workspace workspace = sourceControl.GetWorkspace(localPath); + WorkspaceVersionSpec workspaceVersionSpec = new WorkspaceVersionSpec(versionControlClientAssembly, workspace); + + VersionSpec versionSpec = new VersionSpec(versionControlClientAssembly); + RecursionType recursionType = new RecursionType(versionControlClientAssembly); + + IEnumerable history = sourceControl.QueryHistory(localPath, versionSpec.Latest, recursionType.Full, workspaceVersionSpec); + + IEnumerator historyEnumerator = history.GetEnumerator(); + Changeset latestChangeset = new Changeset(versionControlClientAssembly); + if (historyEnumerator.MoveNext()) + { + latestChangeset = new Changeset(versionControlClientAssembly, historyEnumerator.Current); + } + + if (latestChangeset.Instance != null) + { + latestChangesetId = latestChangeset.ChangesetId; + } + return latestChangesetId; + } + + } } diff --git a/Source/MSBuild.Community.Tasks/Vault/VaultAddFile.cs b/Source/MSBuild.Community.Tasks/Vault/VaultAddFile.cs deleted file mode 100644 index 14b663b8..00000000 --- a/Source/MSBuild.Community.Tasks/Vault/VaultAddFile.cs +++ /dev/null @@ -1,188 +0,0 @@ - -// Copyright © 2006 Douglas Rohm - -using System; -using System.IO; -using Microsoft.Build.Framework; -using VaultClientNetLib; -using VaultClientOperationsLib; - -namespace MSBuild.Community.Tasks.Vault -{ - /// - /// Adds a file or folder from the local disk to a Vault repository. - /// - /// - /// - /// - /// - /// - /// - /// - /// ]]> - /// - public class VaultAddFile : VaultBase - { - #region Fields - - private string _repository = ""; - private ITaskItem[] _addFileSet; - private string _repositoryPath = ""; - private string _comment = ""; - private VaultClientFolder Folder = null; - private ChangeSetItemColl _changeSetCollection = new ChangeSetItemColl(); - - #endregion - - #region Properties - - /// - /// The name of the Vault repository to be used. - /// - [Required] - public string Repository - { - get { return _repository; } - set { _repository = value; } - } - - /// - /// The file(s) to add to the specified repository. - /// - public ITaskItem[] AddFileSet - { - get { return _addFileSet; } - set { _addFileSet = value; } - } - - /// - /// Comment to attach to the files and/or folders being added. - /// - public string Comment - { - get { return _comment; } - set { _comment = value; } - } - - /// - /// Root path in the repository where the file(s) will be added. - /// - [Required] - public string Path - { - get { return _repositoryPath; } - set { _repositoryPath = value; } - } - - #endregion - - /// - /// Executes the task. - /// - /// if the task ran successfully; - /// otherwise . - public override bool Execute() - { - AccessLevel = VaultConnection.AccessLevelType.Admin; - bool bSuccess = true; - - try - { - Login(); - - try - { - if (SelectRepository(Repository)) - { - FindFolder(); - - foreach (ITaskItem item in _addFileSet) - { - AddFileToCollection(item.ItemSpec); - } - - if (ClientInstance.Commit(_changeSetCollection)) - { - Log.LogMessage(MessageImportance.Normal, Properties.Resources.VaultAddFileCommitSucceeded); - } - else - { - throw new Exception(Properties.Resources.VaultAddFileCommitFailed); - } - } - else - { - Log.LogMessage(MessageImportance.High, string.Format(Properties.Resources.VaultRepositorySelectionFailure, Repository)); - bSuccess = false; - } - } - catch (Exception ex) - { - Log.LogErrorFromException(ex); - bSuccess = false; - } - } - catch (Exception ex) - { - Log.LogErrorFromException(ex); - bSuccess = false; - } - finally - { - Logout(); - } - - return bSuccess; - } - - - #region Private Helper Methods - - /// - /// Add a file to the change set collection. - /// - /// Full path and filename of the file to add. - /// Exception - private void AddFileToCollection(string fileName) - { - string repositoryPath = Folder.FullPath + "/" + System.IO.Path.GetFileName(fileName); - - if (File.Exists(fileName)) - { - ChangeSetItem_AddFile changeSetItem = new ChangeSetItem_AddFile(DateTime.Now, Comment, String.Empty, fileName, repositoryPath); - _changeSetCollection.Add(changeSetItem); - Log.LogMessage(MessageImportance.Normal, string.Format(Properties.Resources.VaultFileAddedToChangeSet, fileName)); - } - else if (Directory.Exists(fileName)) - { - ChangeSetItem_AddFolder changeSetItem = new ChangeSetItem_AddFolder(DateTime.Now, Comment, String.Empty, fileName, repositoryPath); - _changeSetCollection.Add(changeSetItem); - Log.LogMessage(MessageImportance.Normal, string.Format(Properties.Resources.VaultFolderAddedToChangeSet, fileName)); - } - else - { - throw new Exception(Properties.Resources.VaultAddFilesException); - } - } - - /// - /// Attempts to locate the Vault folder using the directory path specified. - /// - /// Exception - private void FindFolder() - { - Path = VaultLib.RepositoryPath.NormalizeFolder(Path); - Folder = ClientInstance.TreeCache.Repository.Root.FindFolderRecursive(Path); - - if (Folder == null) - { - throw new Exception(Properties.Resources.VaultPathValidationException); - } - } - - #endregion - } -} diff --git a/Source/MSBuild.Community.Tasks/Vault/VaultBase.cs b/Source/MSBuild.Community.Tasks/Vault/VaultBase.cs deleted file mode 100644 index 06436026..00000000 --- a/Source/MSBuild.Community.Tasks/Vault/VaultBase.cs +++ /dev/null @@ -1,282 +0,0 @@ - -// Copyright © 2006 Douglas Rohm - -using System; -using System.Globalization; -using Microsoft.Build.Framework; -using Microsoft.Build.Utilities; -using VaultClientNetLib; -using VaultClientOperationsLib; -using VaultLib; -using Resources=MSBuild.Community.Tasks.Properties.Resources; - -namespace MSBuild.Community.Tasks.Vault -{ - /// - /// Vault base abstract class. - /// - public abstract class VaultBase : Task - { - - #region Fields - - // Basic connection variables required for most activities. - private string _username = string.Empty; - private string _password = string.Empty; - private string _url = string.Empty; - private string _workingFolder = string.Empty; - private int _version = 0; - - private ClientInstance _clientInstance = new ClientInstance(); - private VaultConnection.AccessLevelType _accessLevel = VaultConnection.AccessLevelType.Client; - private VaultRepositoryInfo _currentRepository = new VaultRepositoryInfo(); - - #endregion - - #region Properties - - /// - /// Accessor for the current access level: Admin or Client. - /// - public VaultConnection.AccessLevelType AccessLevel - { - get { return _accessLevel; } - set { _accessLevel = value; } - } - - /// - /// Url where the Vault installation is. Required. - /// - /// http://localhost - [Required] - public string Url - { - get { return _url; } - set { _url = value; } - } - - /// - /// The user name to use when logging into Vault. - /// - [Required] - public string Username - { - get { return _username; } - set { _username = value; } - } - - /// - /// The password to use in conjunction with the specified - /// username to log in to the Vault installation. - /// - public string Password - { - get { return _password; } - set { _password = value; } - } - - /// - /// Accessor for _clientInstance. - /// - public ClientInstance ClientInstance - { - get { return _clientInstance; } - set { _clientInstance = value; } - } - - /// - /// The working folder for the file or folder in the repository. - /// - public string WorkingFolder - { - get { return _workingFolder; } - set { _workingFolder = value; } - } - - /// - /// Gets or sets the version number for the file or folder. - /// - [Output] - public int Version - { - get { return _version; } - set { _version = value; } - } - - #endregion - - #region Protected Methods - - /// - /// This function logs into the Vault server and chooses the appropriate repository. It checks - /// for a valid username, password, and successful login to the server. - /// - /// Exception - public void Login() - { - if (Url.Length != 0 && Username.Length != 0) - { - ClientInstance.Init(_accessLevel); - - //Fixed Case to match properly. - if (Url.ToLower().EndsWith("/vaultservice") == false) - { - Url += "/VaultService"; - } - if (Url.ToLower().StartsWith("http://") == false && Url.ToLower().StartsWith("https://") == false) - { - Url = "http://" + Url; - } - - ClientInstance.Login(Url, Username, Password); - -#if VAULT_3_5 - ClientInstance.EventEngine.addListener(this, typeof(StatusMessageEvent)); -#else - ClientInstance.StatusChanged += new StatusChangedEventHandler(StatusChangedHandler); -#endif - - if (ClientInstance.ConnectionStateType != ConnectionStateType.Connected) - { - throw new Exception(Resources.VaultLoginFailed); - } - } - else - { - if (Url.Length == 0) - { - throw new Exception(Resources.VaultIncorrectParameters + " " + Resources.VaultUrlRequired); - } - if (Username.Length == 0) - { - throw new Exception(Resources.VaultIncorrectParameters + " " + Resources.VaultUsernameRequired); - } - } - } - - /// - /// Used to logout from the Vault Server. - /// - public void Logout() - { - if (ClientInstance != null) - { - ClientInstance.Logout(); - } - } - - /// - /// This function chooses the active repository on the server. - /// - /// Name of the repository to select. - /// True if the repository selection succeeded, false otherwise. - public bool SelectRepository(string repositoryName) - { - if (ClientInstance.ConnectionStateType != ConnectionStateType.Connected) - { - return false; - } - - VaultRepositoryInfo[] vaultRepositories = null; - ClientInstance.ListRepositories(ref vaultRepositories); - - foreach (VaultRepositoryInfo vaultRepositoryInfo in vaultRepositories) - { - //Beter way to ignore case. - if (string.Compare(vaultRepositoryInfo.RepName, repositoryName, true, CultureInfo.CurrentCulture) == 0) - { - _currentRepository = vaultRepositoryInfo; - ClientInstance.SetActiveRepositoryID(_currentRepository.RepID, Username, _currentRepository.UniqueRepID, true, true); - - return true; - } - } - - return false; - } - - /// - /// Helper function used to simplify many of the tasks. It simply checks to see if the supplied - /// string is a valid Vault folder or not. - /// - /// Name of the folder you wish to check for the existence of. - /// True if a folder exists, false otherwise. - public bool IsVaultFolder(string folderName) - { - VaultClientFolder vaultClientFolder; - - string normalizedPath = RepositoryPath.NormalizeFolder(folderName); - if (ClientInstance.TreeCache != null) - { - vaultClientFolder = ClientInstance.TreeCache.Repository.Root.FindFolderRecursive(normalizedPath); - } - else - { - throw new Exception(Resources.VaultTreeCacheFailure); - } - if (vaultClientFolder == null) - { - return false; - } - else - { - return true; - } - } - - /// - /// Help function used to simplify many of the tasks. It simply checks to see if the supplied - /// string is a valid Vault file or not. - /// - /// Name of the file you wish to check for the existence of. - /// True if the file exists, false otherwise. - public bool IsVaultFile(string fileName) - { - VaultClientFile vaultClientFile; - - string normalizedPath = RepositoryPath.NormalizeFolder(fileName); - vaultClientFile = ClientInstance.TreeCache.Repository.Root.FindFileRecursive(normalizedPath); - - if (vaultClientFile == null) - { - return false; - } - else - { - return true; - } - } - - /// - /// This function is used to interact with the logging facility of NAnt. - /// - /// String to be passed to NAnt. - public void VaultLog(string logData) - { - Log.LogMessage(MessageImportance.Normal, logData); - } - - /// - /// This function is used to interact with the logging facility of NAnt. - /// - /// String to be passed to NAnt. - public void VaultLogVerbose(string logData) - { - Log.LogMessage(MessageImportance.Normal, logData); - } - -#if VAULT_3_5 - private void HandleEvent(StatusMessageEvent e) - { - Log.LogMessage(MessageImportance.Normal, "Vault: " + e.Message); - } -#else - private void StatusChangedHandler(object sender, string message) - { - Log.LogMessage(MessageImportance.Normal, "Vault: " + message); - } -#endif - - #endregion - } -} diff --git a/Source/MSBuild.Community.Tasks/Vault/VaultCheckin.cs b/Source/MSBuild.Community.Tasks/Vault/VaultCheckin.cs deleted file mode 100644 index 97bda50d..00000000 --- a/Source/MSBuild.Community.Tasks/Vault/VaultCheckin.cs +++ /dev/null @@ -1,284 +0,0 @@ - -// Copyright © 2006 Douglas Rohm - -using System; -using System.IO; -using Microsoft.Build.Framework; -using VaultClientNetLib; -using VaultClientOperationsLib; -using VaultLib; - -namespace MSBuild.Community.Tasks.Vault -{ - /// - /// Task that checks a file into the repository. - /// - /// - /// - /// - /// - /// - /// - /// - /// ]]> - /// - public class VaultCheckin : VaultBase - { - #region Fields - - private string _repository = ""; - private string _comment = ""; - private string _fileName = ""; - private string _diskFile = ""; - - #endregion - - #region Properties - - /// - /// The Vault repository to be used. - /// - [Required] - public string Repository - { - get { return _repository; } - set { _repository = value; } - } - - /// - /// The file to check in from the specified repository. - /// - [Required] - public string Path - { - get { return _fileName; } - set { _fileName = value; } - } - - /// - /// The path to a file on disk which will be checked in to the repository. This is for - /// use when you don't want to maintain a working folder for changes. - /// - public string DiskFile - { - get { return _diskFile; } - set { _diskFile = value; } - } - - /// - /// Comment to attach to the files and/or folders being checked in. - /// - public string Comment - { - get { return _comment; } - set { _comment = value; } - } - - #endregion - - /// - /// Executes the task. - /// - /// if the task ran successfully; - /// otherwise . - public override bool Execute() - { - AccessLevel = VaultConnection.AccessLevelType.Client; - bool bSuccess = true; - - try - { - Login(); - - try - { - if (SelectRepository(Repository)) - { - Checkin(Path); - } - else - { - Log.LogMessage(MessageImportance.High, string.Format(Properties.Resources.VaultRepositorySelectionFailure, Repository)); - bSuccess = false; - } - } - catch (Exception ex) - { - Log.LogErrorFromException(ex); - bSuccess = false; - } - } - catch (Exception ex) - { - Log.LogErrorFromException(ex); - bSuccess = false; - } - finally - { - Logout(); - } - - return bSuccess; - } - - #region Private Helper Methods - - /// - /// Checks the specified file or folder into the repository. - /// - /// Exception - private void Checkin(string fileName) - { - string normalizedPath = RepositoryPath.NormalizeFolder(fileName); - - if (IsVaultFolder(normalizedPath)) - { - VaultClientFolder vaultClientFolder = ClientInstance.TreeCache.Repository.Root.FindFolderRecursive(normalizedPath); - - if (!String.IsNullOrEmpty(WorkingFolder)) - { - ClientInstance.TreeCache.SetWorkingFolder(vaultClientFolder.FullPath, WorkingFolder); - } - - ClientInstance.Refresh(); - ChangeSetItemColl changeSet; - BuildChangeSetOfCheckedOutFiles(vaultClientFolder, out changeSet); - - if (!ClientInstance.Commit(changeSet)) - { - string errMsg = VaultConnection.GetSoapExceptionMessage(changeSet[0].Request.Response.Status); - throw new Exception(string.Format(Properties.Resources.VaultCheckinFolderException, normalizedPath, errMsg)); - } - else - { - Version = Convert.ToInt32(vaultClientFolder.Version); - Log.LogMessage(MessageImportance.Normal, string.Format(Properties.Resources.VaultCheckinSuccessful), vaultClientFolder.Name); - } - } - else if (IsVaultFile(normalizedPath)) - { - string previousWorkingFolder = ""; - string repositoryFolderPath = ""; - string tmpdiskPath = System.IO.Path.Combine(System.IO.Path.GetTempPath(), string.Format("msbuild_checkinfor_{0}", System.IO.Path.GetFileName(normalizedPath))); - - VaultClientFile vaultClientFile = ClientInstance.TreeCache.Repository.Root.FindFileRecursive(normalizedPath); - - if (!String.IsNullOrEmpty(WorkingFolder)) - { - ClientInstance.TreeCache.SetWorkingFolder(vaultClientFile.Parent.FullPath, WorkingFolder); - } - - string diskFilename = System.IO.Path.Combine(ClientInstance.GetWorkingFolder(vaultClientFile).GetLocalFolderPath(), - normalizedPath.Substring(normalizedPath.LastIndexOf(VaultDefine.PathSeparator) + 1)); - bool bChangeWorkingFolder = false; - - if (!Misc.stringIsBlank(_diskFile) && _diskFile != diskFilename) - { - bChangeWorkingFolder = true; - if (!File.Exists(_diskFile)) - { - throw new Exception(string.Format(Properties.Resources.VaultDiskFileDoesNotExist, _diskFile)); - } - - // They've specified a different disk file (no working folder) - repositoryFolderPath = vaultClientFile.Parent.FullPath; - previousWorkingFolder = ClientInstance.TreeCache.GetWorkingFolder(repositoryFolderPath); - - if (Directory.Exists(tmpdiskPath) == false) - { - Directory.CreateDirectory(tmpdiskPath); - } - - // Set a different working folder to avoid interference with the real working folder - ClientInstance.TreeCache.SetWorkingFolder(repositoryFolderPath, tmpdiskPath); - diskFilename = System.IO.Path.Combine(tmpdiskPath, vaultClientFile.Name); - Log.LogMessage(MessageImportance.Normal, string.Format(Properties.Resources.VaultSetNewWorkingFolder, repositoryFolderPath, tmpdiskPath, previousWorkingFolder)); - - ClientInstance.CheckOut(vaultClientFile, 2, "Temp checkout for MSBuild Vault task."); - ClientInstance.Get(vaultClientFile, true, MakeWritableType.MakeAllFilesWritable, SetFileTimeType.Current, MergeType.OverwriteWorkingCopy, null); - if (File.Exists(diskFilename)) - { - File.SetAttributes(diskFilename, FileAttributes.Normal); - File.Delete(diskFilename); - } - File.Copy(_diskFile, diskFilename); - ClientInstance.Refresh(); - } - - try - { - ChangeSetItemColl requestedChange = new ChangeSetItemColl(); - requestedChange.Add(new ChangeSetItem_Modified(DateTime.Now, _comment, "", vaultClientFile.ID, vaultClientFile.ObjVerID, - diskFilename, normalizedPath, false, vaultClientFile.EOL)); - - if (!ClientInstance.Commit(requestedChange)) - { - string errMsg = VaultConnection.GetSoapExceptionMessage(requestedChange[0].Request.Response.Status); - throw new Exception(string.Format(Properties.Resources.VaultCheckinFileException, normalizedPath, errMsg)); - } - else - { - Version = Convert.ToInt32(vaultClientFile.Version); - Log.LogMessage(MessageImportance.Normal, string.Format(Properties.Resources.VaultCheckinSuccessful, vaultClientFile.Name)); - } - } - finally - { - if (bChangeWorkingFolder) - { - if (Misc.stringIsBlank(previousWorkingFolder)) - { - Log.LogMessage(MessageImportance.Normal, string.Format(Properties.Resources.VaultWorkingFolderCleared, repositoryFolderPath)); - ClientInstance.TreeCache.RemoveWorkingFolder(repositoryFolderPath); - } - else - { - Log.LogMessage(MessageImportance.Normal, string.Format(Properties.Resources.VaultWorkingFolderRestored, repositoryFolderPath, previousWorkingFolder)); - ClientInstance.TreeCache.SetWorkingFolder(repositoryFolderPath, previousWorkingFolder); - } - } - if (Directory.Exists(tmpdiskPath)) - { - Misc.DeleteDirectoryRecursivelyIncludingReadOnly(tmpdiskPath); - } - } - } - else - { - throw new Exception(string.Format(Properties.Resources.VaultCheckinFileNotFoundException, normalizedPath)); - } - } - - private void BuildChangeSetOfCheckedOutFiles(VaultClientFolder folder, out ChangeSetItemColl changeSet) - { - if (ClientInstance.WorkingFolderOptions.RequireCheckOutBeforeCheckIn == false) - { - // Do a scan to update the change set list - ClientInstance.UpdateKnownChanges_All(false); - } - - // The new list of change set items - changeSet = new ChangeSetItemColl(); - - // Get the internal change set - ChangeSetItemColl csic = ClientInstance.InternalChangeSet_GetItems(true); - if ((csic != null) && (csic.Count > 0)) - { - // From the full change list, build a new list including only those in the requested folder - foreach (ChangeSetItem internalChange in csic) - { - if (internalChange.DisplayRepositoryPath.IndexOf(folder.FullPath) == 0) - { - changeSet.Add(internalChange); - } - } - } - } - - #endregion - } -} diff --git a/Source/MSBuild.Community.Tasks/Vault/VaultCheckout.cs b/Source/MSBuild.Community.Tasks/Vault/VaultCheckout.cs deleted file mode 100644 index 193f498b..00000000 --- a/Source/MSBuild.Community.Tasks/Vault/VaultCheckout.cs +++ /dev/null @@ -1,166 +0,0 @@ - -// Copyright © 2006 Douglas Rohm - -using System; -using Microsoft.Build.Framework; -using VaultClientNetLib; -using VaultClientOperationsLib; -using VaultLib; - -namespace MSBuild.Community.Tasks.Vault -{ - /// - /// Task that checks a file out of the repository. - /// - /// - /// - /// - /// - /// - /// - /// - /// ]]> - /// - public class VaultCheckout : VaultBase - { - #region Fields - - private string _repository = ""; - private string _comment = ""; - private string _fileName = ""; - - #endregion - - #region Properties - - /// - /// The Vault repository to be used. - /// - [Required] - public string Repository - { - get { return _repository; } - set { _repository = value; } - } - - /// - /// The file to check out from the specified repository. - /// - [Required] - public string Path - { - get { return _fileName; } - set { _fileName = value; } - } - - /// - /// Comment to attach to the files and/or folders being checked out. - /// - public string Comment - { - get { return _comment; } - set { _comment = value; } - } - - #endregion - - /// - /// Executes the task. - /// - /// if the task ran successfully; - /// otherwise . - public override bool Execute() - { - AccessLevel = VaultConnection.AccessLevelType.Client; - bool bSuccess = true; - - try - { - Login(); - - try - { - if (SelectRepository(Repository)) - { - Checkout(Path); - } - else - { - Log.LogMessage(MessageImportance.High, string.Format(Properties.Resources.VaultRepositorySelectionFailure, Repository)); - bSuccess = false; - } - } - catch (Exception ex) - { - Log.LogErrorFromException(ex); - bSuccess = false; - } - } - catch (Exception ex) - { - Log.LogErrorFromException(ex); - bSuccess = false; - } - finally - { - Logout(); - } - - return bSuccess; - } - - #region Private Helper Methods - - /// - /// Retrieves the specified file. - /// - /// Exception - private void Checkout(string fileName) - { - string normalizedPath = RepositoryPath.NormalizeFolder(fileName); - - if (IsVaultFolder(normalizedPath)) - { - VaultClientFolder vaultClientFolder = ClientInstance.TreeCache.Repository.Root.FindFolderRecursive(normalizedPath); - - if (!String.IsNullOrEmpty(WorkingFolder)) - { - ClientInstance.TreeCache.SetWorkingFolder(vaultClientFolder.FullPath, WorkingFolder); - } - - ClientInstance.CheckOut(vaultClientFolder, true, VaultCheckOutType.CheckOut, Comment); - ClientInstance.Get(vaultClientFolder, true, true, MakeWritableType.MakeAllFilesWritable, SetFileTimeType.Current, MergeType.OverwriteWorkingCopy, null); - - Version = Convert.ToInt32(vaultClientFolder.Version); - Log.LogMessage(MessageImportance.Normal, string.Format(Properties.Resources.VaultCheckoutSuccessful), vaultClientFolder.Name); - } - - if (IsVaultFile(normalizedPath)) - { - VaultClientFile vaultClientFile = ClientInstance.TreeCache.Repository.Root.FindFileRecursive(normalizedPath); - - if (!String.IsNullOrEmpty(WorkingFolder)) - { - ClientInstance.TreeCache.SetWorkingFolder(vaultClientFile.Parent.FullPath, WorkingFolder); - } - - ClientInstance.CheckOut(vaultClientFile, VaultCheckOutType.CheckOut, Comment); - ClientInstance.Get(vaultClientFile, true, MakeWritableType.MakeAllFilesWritable, SetFileTimeType.Current, MergeType.OverwriteWorkingCopy, null); - - Version = Convert.ToInt32(vaultClientFile.Version); - Log.LogMessage(MessageImportance.Normal, string.Format(Properties.Resources.VaultCheckoutSuccessful, vaultClientFile.Name)); - } - - if (IsVaultFolder(normalizedPath) == false && IsVaultFile(normalizedPath) == false) - { - throw new Exception(string.Format(Properties.Resources.VaultResourceNotFound, normalizedPath)); - } - } - - #endregion - } -} diff --git a/Source/MSBuild.Community.Tasks/Vault/VaultGetFile.cs b/Source/MSBuild.Community.Tasks/Vault/VaultGetFile.cs deleted file mode 100644 index 8c28eba0..00000000 --- a/Source/MSBuild.Community.Tasks/Vault/VaultGetFile.cs +++ /dev/null @@ -1,164 +0,0 @@ - -// Copyright © 2006 Douglas Rohm - -using System; -using Microsoft.Build.Framework; -using VaultClientNetLib; -using VaultClientOperationsLib; - -namespace MSBuild.Community.Tasks.Vault -{ - /// - /// Task that gets a file from the repository. - /// - /// - /// - /// - /// - /// - /// - /// - /// ]]> - /// - public class VaultGetFile : VaultBase - { - #region Fields - - private string _repository = ""; - private string _destination = ""; - private string _fileName = ""; - - #endregion - - #region Properties - - /// - /// Path to store retrieved files if no working folder is set. - /// - public string Destination - { - get { return _destination; } - set { _destination = value; } - } - - /// - /// The Vault repository to be used. - /// - [Required] - public string Repository - { - get { return _repository; } - set { _repository = value; } - } - - /// - /// The file to retrieve from the specified repository. - /// - [Required] - public string Path - { - get { return _fileName; } - set { _fileName = value; } - } - - #endregion - - /// - /// Executes the task. - /// - /// if the task ran successfully; - /// otherwise . - public override bool Execute() - { - AccessLevel = VaultConnection.AccessLevelType.Client; - bool bSuccess = true; - - try - { - Login(); - - try - { - if (SelectRepository(Repository)) - { - GetFile(Path); - } - else - { - Log.LogMessage(MessageImportance.High, string.Format(Properties.Resources.VaultRepositorySelectionFailure, Repository)); - bSuccess = false; - } - } - catch (Exception ex) - { - Log.LogErrorFromException(ex); - bSuccess = false; - } - } - catch (Exception ex) - { - Log.LogErrorFromException(ex); - bSuccess = false; - } - finally - { - Logout(); - } - - return bSuccess; - } - - - #region Private Helper Methods - - /// - /// Retrieves the specified file. - /// - /// Exception - private void GetFile(string fileName) - { - if (IsVaultFolder(fileName)) - { - VaultClientFolder vaultClientFolder = ClientInstance.TreeCache.Repository.Root.FindFolderRecursive(fileName); - - if (Destination.Length == 0) - { - if (!String.IsNullOrEmpty(WorkingFolder)) - { - ClientInstance.TreeCache.SetWorkingFolder(vaultClientFolder.FullPath, WorkingFolder); - } - - ClientInstance.Get(vaultClientFolder, true, true, MakeWritableType.MakeAllFilesWritable, SetFileTimeType.Current, MergeType.OverwriteWorkingCopy, null); - } - else - { - ClientInstance.GetToNonWorkingFolder(vaultClientFolder, true, true, true, MakeWritableType.MakeAllFilesWritable, SetFileTimeType.Current, Destination, null); - } - } - - if (IsVaultFile(fileName)) - { - VaultClientFile vaultClientFile = ClientInstance.TreeCache.Repository.Root.FindFileRecursive(fileName); - - if (Destination.Length == 0) - { - if (!String.IsNullOrEmpty(WorkingFolder)) - { - ClientInstance.TreeCache.SetWorkingFolder(vaultClientFile.Parent.FullPath, WorkingFolder); - } - - ClientInstance.Get(vaultClientFile, true, MakeWritableType.MakeAllFilesWritable, SetFileTimeType.Current, MergeType.OverwriteWorkingCopy, null); - } - else - { - ClientInstance.GetToNonWorkingFolder(vaultClientFile, true, true, MakeWritableType.MakeAllFilesWritable, SetFileTimeType.Current, vaultClientFile.Parent.FullPath, Destination, null); - } - } - } - - #endregion - } -} diff --git a/Source/MSBuild.Community.Tasks/Vault/VaultUndoCheckout.cs b/Source/MSBuild.Community.Tasks/Vault/VaultUndoCheckout.cs deleted file mode 100644 index 83d99727..00000000 --- a/Source/MSBuild.Community.Tasks/Vault/VaultUndoCheckout.cs +++ /dev/null @@ -1,150 +0,0 @@ - -// Copyright © 2006 Douglas Rohm - -using System; -using Microsoft.Build.Framework; -using VaultClientNetLib; -using VaultClientOperationsLib; -using VaultLib; - -namespace MSBuild.Community.Tasks.Vault -{ - /// - /// Task that undo's a checkout of a file from the repository. - /// - /// - /// - /// - /// - /// - /// - /// - /// ]]> - /// - public class VaultUndoCheckout : VaultBase - { - #region Fields - - private string _repository = ""; - private string _fileName = ""; - - #endregion - - #region Properties - - /// - /// The Vault repository to be used. - /// - [Required] - public string Repository - { - get { return _repository; } - set { _repository = value; } - } - - /// - /// The file to undo checkout. - /// - [Required] - public string Path - { - get { return _fileName; } - set { _fileName = value; } - } - - #endregion - - /// - /// Executes the task. - /// - /// if the task ran successfully; - /// otherwise . - public override bool Execute() - { - AccessLevel = VaultConnection.AccessLevelType.Client; - bool bSuccess = true; - - try - { - Login(); - - try - { - if (SelectRepository(Repository)) - { - UndoCheckout(Path); - } - else - { - Log.LogMessage(MessageImportance.High, string.Format(Properties.Resources.VaultRepositorySelectionFailure, Repository)); - bSuccess = false; - } - } - catch (Exception ex) - { - Log.LogErrorFromException(ex); - bSuccess = false; - } - } - catch (Exception ex) - { - Log.LogErrorFromException(ex); - bSuccess = false; - } - finally - { - Logout(); - } - - return bSuccess; - } - - #region Private Helper Methods - - /// - /// Undo checkout on the specified file. - /// - /// Exception - private void UndoCheckout(string fileName) - { - string normalizedPath = RepositoryPath.NormalizeFolder(fileName); - - if (IsVaultFolder(normalizedPath)) - { - VaultClientFolder vaultClientFolder = ClientInstance.TreeCache.Repository.Root.FindFolderRecursive(normalizedPath); - - if (!String.IsNullOrEmpty(WorkingFolder)) - { - ClientInstance.TreeCache.SetWorkingFolder(vaultClientFolder.FullPath, WorkingFolder); - } - - ClientInstance.UndoCheckOut(vaultClientFolder, true, LocalCopyType.Replace); - Log.LogMessage(MessageImportance.Normal, string.Format(Properties.Resources.VaultUndoCheckoutSuccessful, vaultClientFolder.Name)); - } - - if (IsVaultFile(normalizedPath)) - { - VaultClientFile vaultClientFile = ClientInstance.TreeCache.Repository.Root.FindFileRecursive(normalizedPath); - - if (!String.IsNullOrEmpty(WorkingFolder)) - { - ClientInstance.TreeCache.SetWorkingFolder(vaultClientFile.Parent.FullPath, WorkingFolder); - } - - ClientInstance.UndoCheckOut(vaultClientFile, LocalCopyType.Replace); - Log.LogMessage(MessageImportance.Normal, string.Format(Properties.Resources.VaultUndoCheckoutSuccessful, vaultClientFile.Name)); - } - - if (IsVaultFolder(normalizedPath) == false && IsVaultFile(normalizedPath) == false) - { - throw new Exception(string.Format(Properties.Resources.VaultResourceNotFound, normalizedPath)); - } - } - - #endregion - } -}