You can subscribe to this list here.
| 2006 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
|
Nov
|
Dec
|
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2007 |
Jan
|
Feb
(9) |
Mar
(6) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: <jor...@us...> - 2007-03-08 13:16:13
|
Revision: 22
http://svn.sourceforge.net/captainhook/?rev=22&view=rev
Author: jordan-terrell
Date: 2007-03-08 05:16:07 -0800 (Thu, 08 Mar 2007)
Log Message:
-----------
Removing ApplicationHost - replaced by HookContext
Removed Paths:
-------------
trunk/Application/CaptainHook.Engine/ApplicationHost.cs
Deleted: trunk/Application/CaptainHook.Engine/ApplicationHost.cs
===================================================================
--- trunk/Application/CaptainHook.Engine/ApplicationHost.cs 2007-03-07 22:37:40 UTC (rev 21)
+++ trunk/Application/CaptainHook.Engine/ApplicationHost.cs 2007-03-08 13:16:07 UTC (rev 22)
@@ -1,206 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Configuration;
-using System.Net;
-using System.Net.Mail;
-using System.Text;
-using CaptainHook.Interfaces;
-
-namespace CaptainHook.Engine
-{
- public class ApplicationHost : IApplicationHost
- {
- PluginLoader pluginLoader;
-
- /// <summary>
- /// Constructor. Reads in the arguments.
- /// </summary>
- /// <param name="args"></param>
- public ApplicationHost(ISubversionTranslator translator, IOutputHandler output, PluginLoader pluginLoader)
- {
- if (translator == null)
- throw new ArgumentNullException("translator");
-
- if (output == null)
- throw new ArgumentNullException("output");
-
- if (pluginLoader == null)
- throw new ArgumentNullException("pluginLoader");
-
- this.subversionTranslator = translator;
- this.output = output;
- this.pluginLoader = pluginLoader;
- }
-
- public ISubversionTranslator SubversionTranslator
- {
- get { return subversionTranslator; }
- }
-
- /// <summary>
- /// Handles the hook event and returns whether or not
- /// Subversion should continue with the transaction.
- /// </summary>
- /// <remarks>
- /// If any hook votes to stop the transaction, the transaction will not
- /// continue, though the other hooks will have a chance to run.
- /// </remarks>
- /// <returns></returns>
- public bool HandleHookEvent(HookContext context)
- {
- bool continueTransaction = true;
-
- // TODO: Load Plugins
- ICollection<SubversionHook> hooks = null;// pluginLoader.LoadPlugins(context);
- foreach(SubversionHook hook in hooks)
- {
- try
- {
- // TODO: Handle hooks
- //hook.Initialize(this);
-
- //if (!hook.HandleHook(PrepareCommitInfo(this.arguments)))
- //{
- // output.Write(string.Format("The hook '{0}' votes to not continue the transaction.", hook.GetType().Name));
- // continueTransaction = false;
- //}
-
- }
- catch(Exception e)
- {
- output.WriteError("Error occurred while executing the hook {0}", e, hook.GetType().FullName);
- }
- }
-
- output.Write("Continuing Transaction?: " + continueTransaction);
-
- return continueTransaction;
- }
-
- ICommitInfo PrepareCommitInfo()
- {
- // TODO: Prepare Commit Info
- return null;
-
- //if (!String.IsNullOrEmpty(args.TransactionName))
- // return this.SubversionTranslator.GetCommitInformation(args.TransactionName);
-
- //if (!String.IsNullOrEmpty(args.PropertyName) && !String.IsNullOrEmpty(args.UserName))
- //{
- // ICommitInfo commitInfo = this.SubversionTranslator.GetCommitInformation(args.Revision);
- // return new PropertyChangeInfo(args.PropertyName, args.UserName, commitInfo.Author, commitInfo.DateStamp, commitInfo.LogMessageSize, commitInfo.LogMessage);
- //}
-
- //if (!String.IsNullOrEmpty(args.UserName))
- //{
- // return new PropertyChangeInfo(null, args.UserName, null, DateTime.MinValue, 0, null);
- //}
- //else
- //{
- // return this.SubversionTranslator.GetCommitInformation(args.Revision);
- //}
- }
-
- /// <summary>
- /// Sends an email.
- /// </summary>
- /// <param name="from"></param>
- /// <param name="to"></param>
- /// <param name="ccEmails"></param>
- /// <param name="bccEmails"></param>
- /// <param name="subject"></param>
- /// <param name="body"></param>
- public void SendEmail(MailMessage message)
- {
- if (message.From == null)
- throw new ArgumentNullException("A FROM: address is required.");
-
- if (message.To.Count == 0)
- throw new ArgumentOutOfRangeException("At least one TO: address is required.");
-
- SmtpClient smtp = new SmtpClient();
- smtp.Host = SmtpServerHost;
- smtp.Port = SmtpServerPort;
-
- if(!String.IsNullOrEmpty(SmtpServerUser))
- {
- output.WriteDebug("Setting credentials - UserName: " + this.SmtpServerUser);
- NetworkCredential basicAuthCredential = new NetworkCredential(this.SmtpServerUser, this.SmtpServerPassword);
- smtp.UseDefaultCredentials = false;
- smtp.Credentials = basicAuthCredential;
- }
-
- output.WriteDebug("Sending Email via Host '{0}:{1}", smtp.Host, smtp.Port);
- try
- {
- smtp.Send(message);
- }
- catch(SmtpException e)
- {
- output.WriteError("Error while sending email", e);
- }
- }
-
- void AddRange(MailAddressCollection destination, MailAddressCollection toBeAdded)
- {
- if (destination == null)
- throw new ArgumentNullException("destination", "Cannot add emails to a null MailAddressCollection.");
- if(toBeAdded == null)
- return;
- foreach (MailAddress toAddress in toBeAdded)
- {
- destination.Add(toAddress);
- }
- }
-
- private string SmtpServerHost
- {
- get
- {
- return ConfigurationManager.AppSettings["SmtpServerHost"];
- }
- }
-
- private int SmtpServerPort
- {
- get
- {
- if (String.IsNullOrEmpty(ConfigurationManager.AppSettings["SmtpServerPort"]))
- return 25;
- return int.Parse(ConfigurationManager.AppSettings["SmtpServerPort"]);
- }
- }
-
- private string SmtpServerUser
- {
- get
- {
- return ConfigurationManager.AppSettings["SmtpServerUser"];
- }
- }
-
- private string SmtpServerPassword
- {
- get
- {
- return ConfigurationManager.AppSettings["SmtpServerPassword"];
- }
- }
-
- ISubversionTranslator subversionTranslator;
-
- /// <summary>
- /// Used to write output. Probably to the Console, but
- /// you never know.
- /// </summary>
- public IOutputHandler Output
- {
- get
- {
- return output;
- }
- }
-
- IOutputHandler output;
- }
-}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jor...@us...> - 2007-03-07 22:37:44
|
Revision: 21
http://svn.sourceforge.net/captainhook/?rev=21&view=rev
Author: jordan-terrell
Date: 2007-03-07 14:37:40 -0800 (Wed, 07 Mar 2007)
Log Message:
-----------
Fixing solution file and master.build script - project listing incorrect
Modified Paths:
--------------
trunk/CaptainHook.sln
trunk/master.build
Modified: trunk/CaptainHook.sln
===================================================================
--- trunk/CaptainHook.sln 2007-03-07 22:26:45 UTC (rev 20)
+++ trunk/CaptainHook.sln 2007-03-07 22:37:40 UTC (rev 21)
@@ -5,10 +5,6 @@
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CaptainHook", "Application\CaptainHook\CaptainHook.csproj", "{9FFF68FF-A417-4C43-8A85-738EE398BB4E}"
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CaptainHook.Interfaces", "Application\CaptainHook.Interfaces\CaptainHook.Interfaces.csproj", "{4CE44566-B3FD-4D6F-8C90-3323C78A3405}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CaptainHook.SubversionWrapper", "Application\CaptainHook.SubversionWrapper\CaptainHook.SubversionWrapper.csproj", "{2A3379EC-DFDB-456E-95EB-DE84997D52D0}"
-EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CaptainHook.Plugins", "Application\CaptainHook.Plugins\CaptainHook.Plugins.csproj", "{E5A33AEE-BAFA-4AE1-9A2A-E91CAC5EC82D}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{0DA35A5A-70F9-4CC2-B6B0-D313C8E149C4}"
@@ -25,6 +21,8 @@
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Testing", "Testing", "{B8434F63-C6CA-4614-BCA8-5381119EBD8A}"
EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CaptainHook.Engine", "Application\CaptainHook.Engine\CaptainHook.Engine.csproj", "{0717F186-701E-47AE-B7D9-B577D2657386}"
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@@ -39,27 +37,22 @@
{9FFF68FF-A417-4C43-8A85-738EE398BB4E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{9FFF68FF-A417-4C43-8A85-738EE398BB4E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{9FFF68FF-A417-4C43-8A85-738EE398BB4E}.Release|Any CPU.Build.0 = Release|Any CPU
- {4CE44566-B3FD-4D6F-8C90-3323C78A3405}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {4CE44566-B3FD-4D6F-8C90-3323C78A3405}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {4CE44566-B3FD-4D6F-8C90-3323C78A3405}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {4CE44566-B3FD-4D6F-8C90-3323C78A3405}.Release|Any CPU.Build.0 = Release|Any CPU
- {2A3379EC-DFDB-456E-95EB-DE84997D52D0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {2A3379EC-DFDB-456E-95EB-DE84997D52D0}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {2A3379EC-DFDB-456E-95EB-DE84997D52D0}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {2A3379EC-DFDB-456E-95EB-DE84997D52D0}.Release|Any CPU.Build.0 = Release|Any CPU
{E5A33AEE-BAFA-4AE1-9A2A-E91CAC5EC82D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E5A33AEE-BAFA-4AE1-9A2A-E91CAC5EC82D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E5A33AEE-BAFA-4AE1-9A2A-E91CAC5EC82D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E5A33AEE-BAFA-4AE1-9A2A-E91CAC5EC82D}.Release|Any CPU.Build.0 = Release|Any CPU
+ {0717F186-701E-47AE-B7D9-B577D2657386}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {0717F186-701E-47AE-B7D9-B577D2657386}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {0717F186-701E-47AE-B7D9-B577D2657386}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {0717F186-701E-47AE-B7D9-B577D2657386}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
- {9FFF68FF-A417-4C43-8A85-738EE398BB4E} = {E139FF0C-19D2-48B8-9692-7FA949AC3A93}
- {2A3379EC-DFDB-456E-95EB-DE84997D52D0} = {E139FF0C-19D2-48B8-9692-7FA949AC3A93}
- {4CE44566-B3FD-4D6F-8C90-3323C78A3405} = {E139FF0C-19D2-48B8-9692-7FA949AC3A93}
- {E5A33AEE-BAFA-4AE1-9A2A-E91CAC5EC82D} = {E139FF0C-19D2-48B8-9692-7FA949AC3A93}
{4D504BB3-E67C-479A-B2C4-4A1420887D89} = {B8434F63-C6CA-4614-BCA8-5381119EBD8A}
+ {E5A33AEE-BAFA-4AE1-9A2A-E91CAC5EC82D} = {E139FF0C-19D2-48B8-9692-7FA949AC3A93}
+ {9FFF68FF-A417-4C43-8A85-738EE398BB4E} = {E139FF0C-19D2-48B8-9692-7FA949AC3A93}
+ {0717F186-701E-47AE-B7D9-B577D2657386} = {E139FF0C-19D2-48B8-9692-7FA949AC3A93}
EndGlobalSection
EndGlobal
Modified: trunk/master.build
===================================================================
--- trunk/master.build 2007-03-07 22:26:45 UTC (rev 20)
+++ trunk/master.build 2007-03-07 22:37:40 UTC (rev 21)
@@ -1,6 +1,6 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" DefaultTargets="CompleteBuild">
- <PropertyGroup>
- <Configuration>Debug</Configuration>
+ <PropertyGroup>
+ <Configuration>Debug</Configuration>
<ChildProjectBuildTargets>Build</ChildProjectBuildTargets>
<RootBuildPath>$(MSBuildProjectDirectory)\Build</RootBuildPath>
@@ -23,20 +23,18 @@
<Import Project="$(NCoverExplorerExtras)\NCoverExplorer.MSBuildTasks.targets" />
<ItemGroup>
- <ChildProjects Include="Application\CaptainHook.Interfaces\CaptainHook.Interfaces.csproj" />
- <ChildProjects Include="Application\CaptainHook.SubversionWrapper\CaptainHook.SubversionWrapper.csproj" />
- <ChildProjects Include="Application\CaptainHook\CaptainHook.csproj" />
-
+ <ChildProjects Include="Application\CaptainHook.Engine\CaptainHook.Engine.csproj" />
<ChildProjects Include="Application\CaptainHook.Plugins\CaptainHook.Plugins.csproj" />
-
<ChildProjects Include="Testing\CaptainHook.UnitTests\CaptainHook.UnitTests.csproj" />
+
+ <ChildProjects Include="Application\CaptainHook\CaptainHook.csproj" />
</ItemGroup>
<ItemGroup>
<TestAssemblies Include="CaptainHook.UnitTests.dll" />
-
+
+ <CoverageAssemblies Include="CaptainHook.Engine.dll" />
<CoverageAssemblies Include="CaptainHook.Interfaces.dll" />
- <CoverageAssemblies Include="CaptainHook.SubversionWrapper.dll" />
<CoverageAssemblies Include="CaptainHook.Plugins.dll" />
<!--ExcludeCoverageReporting Include="Assembly|Namespace|Class">
@@ -48,18 +46,18 @@
<MakeDir Directories="$(BinariesOutputPath); $(ArtifactsOutputPath)" />
<MSBuild Projects="@(ChildProjects)" Targets="$(ChildProjectBuildTargets)" Properties="OutputPath=$(BinariesOutputPath);Configuration=$(Configuration);TreatWarningsAsErrors=true;"/>
- </Target>
+ </Target>
- <Target Name="MasterClean">
- <MSBuild Projects="@(ChildProjects)" Targets="Clean" Properties="Configuration=$(Configuration)"/>
-
- <Delete Files="$(RootBuildPath)\**" />
-
- <RemoveDir Directories="$(RootBuildPath)" ContinueOnError="false" />
- <RemoveDir Directories="@(ChildProjects -> '%(RelativeDir)bin')" ContinueOnError="false" />
- <RemoveDir Directories="@(ChildProjects -> '%(RelativeDir)obj')" ContinueOnError="false" />
- </Target>
+ <Target Name="MasterClean">
+ <MSBuild Projects="@(ChildProjects)" Targets="Clean" Properties="Configuration=$(Configuration)"/>
+ <Delete Files="$(RootBuildPath)\**" />
+
+ <RemoveDir Directories="$(RootBuildPath)" ContinueOnError="false" />
+ <RemoveDir Directories="@(ChildProjects -> '%(RelativeDir)bin')" ContinueOnError="false" />
+ <RemoveDir Directories="@(ChildProjects -> '%(RelativeDir)obj')" ContinueOnError="false" />
+ </Target>
+
<Target Name="MasterUnitTest" DependsOnTargets="MasterBuild; CoreUnitTest" />
<Target Name="CoreUnitTest">
<NCover
@@ -83,7 +81,7 @@
XmlReportName="CodeCoverageSummary.xml"
HtmlReportName="CodeCoverageSummary.html"
ShowExcluded="False"
- SatisfactoryCoverage="55"
+ SatisfactoryCoverage="43"
FailMinimum="true"
CoverageFiles="$(ArtifactsOutputPath)\CodeCoverage.xml"
Exclusions="@(ExcludeCoverageReporting -> '<CoverageExclusion><ExclusionType>%(Identity)</ExclusionType><Pattern>%(FilterExpression)</Pattern><IsRegex>true</IsRegex></CoverageExclusion>', '')" />
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jor...@us...> - 2007-03-07 22:26:48
|
Revision: 20
http://svn.sourceforge.net/captainhook/?rev=20&view=rev
Author: jordan-terrell
Date: 2007-03-07 14:26:45 -0800 (Wed, 07 Mar 2007)
Log Message:
-----------
Deleted architecture change branch and tags
Removed Paths:
-------------
branches/TRY-ChangeArchitecture/
tags/POST-TRY-ChangeArchitecture/
tags/PRE-TRY-ChangeArchitecture/
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jor...@us...> - 2007-03-07 22:14:22
|
Revision: 19
http://svn.sourceforge.net/captainhook/?rev=19&view=rev
Author: jordan-terrell
Date: 2007-03-07 14:14:20 -0800 (Wed, 07 Mar 2007)
Log Message:
-----------
Merged component architecture changes into mainline (trunk)
Modified Paths:
--------------
trunk/Application/CaptainHook/CaptainHook.csproj
trunk/Application/CaptainHook/CommandLine/Arguments.cs
trunk/Application/CaptainHook/CommandLine/CommandLineSwitchAttribute.cs
trunk/Application/CaptainHook/CommandLine/Parser.cs
trunk/Application/CaptainHook/Program.cs
trunk/Application/CaptainHook.Plugins/CaptainHook.Plugins.csproj
trunk/Application/CaptainHook.Plugins/PostCommitEmailHook.cs
trunk/Application/CaptainHook.Plugins/RequireLogMessageHook.cs
trunk/Testing/CaptainHook.UnitTests/ArgumentsTests.cs
trunk/Testing/CaptainHook.UnitTests/CaptainHook.UnitTests.csproj
trunk/Testing/CaptainHook.UnitTests/HookHandlerApplicationTests.cs
trunk/Testing/CaptainHook.UnitTests/SubversionTests.cs
Added Paths:
-----------
trunk/Application/CaptainHook.Engine/
trunk/Application/CaptainHook.Engine/ApplicationHost.cs
trunk/Application/CaptainHook.Engine/CaptainHook.Engine.csproj
trunk/Application/CaptainHook.Engine/HookContext.cs
trunk/Application/CaptainHook.Engine/HookNameAttribute.cs
trunk/Application/CaptainHook.Engine/IHookContext.cs
trunk/Application/CaptainHook.Engine/PostCommitHook.cs
trunk/Application/CaptainHook.Engine/PostRevisionPropertyChangeHook.cs
trunk/Application/CaptainHook.Engine/PreCommitHook.cs
trunk/Application/CaptainHook.Engine/PreRevisionPropertyChangeHook.cs
trunk/Application/CaptainHook.Engine/Properties/
trunk/Application/CaptainHook.Engine/Properties/AssemblyInfo.cs
trunk/Application/CaptainHook.Engine/RepositoryInfo/
trunk/Application/CaptainHook.Engine/RepositoryInfo/CommitInfo.cs
trunk/Application/CaptainHook.Engine/RepositoryInfo/Difference.cs
trunk/Application/CaptainHook.Engine/RepositoryInfo/HistoryInfo.cs
trunk/Application/CaptainHook.Engine/RepositoryInfo/ICommitInfo.cs
trunk/Application/CaptainHook.Engine/RepositoryInfo/IDifference.cs
trunk/Application/CaptainHook.Engine/RepositoryInfo/IHistoryInfo.cs
trunk/Application/CaptainHook.Engine/RepositoryInfo/IPropertyChangeInfo.cs
trunk/Application/CaptainHook.Engine/RepositoryInfo/IRepositoryChange.cs
trunk/Application/CaptainHook.Engine/RepositoryInfo/IRevisionInfo.cs
trunk/Application/CaptainHook.Engine/RepositoryInfo/ITransactionInfo.cs
trunk/Application/CaptainHook.Engine/RepositoryInfo/PropertyChangeInfo.cs
trunk/Application/CaptainHook.Engine/RepositoryInfo/RepositoryChange.cs
trunk/Application/CaptainHook.Engine/RepositoryInfo/RevisionInfo.cs
trunk/Application/CaptainHook.Engine/RepositoryInfo/TransactionInfo.cs
trunk/Application/CaptainHook.Engine/Services/
trunk/Application/CaptainHook.Engine/Services/ConsoleOutputHandler.cs
trunk/Application/CaptainHook.Engine/Services/IOutputHandler.cs
trunk/Application/CaptainHook.Engine/Services/IPluginLoader.cs
trunk/Application/CaptainHook.Engine/Services/ISubversionRepository.cs
trunk/Application/CaptainHook.Engine/Services/ISubversionTranslator.cs
trunk/Application/CaptainHook.Engine/Services/PluginLoader.cs
trunk/Application/CaptainHook.Engine/Services/SubversionRepository.cs
trunk/Application/CaptainHook.Engine/Services/SubversionTranslator.cs
trunk/Application/CaptainHook.Engine/StartCommitHook.cs
trunk/Application/CaptainHook.Engine/SubversionHook.cs
Removed Paths:
-------------
trunk/Application/CaptainHook/ApplicationHost.cs
trunk/Application/CaptainHook/OutputHandler.cs
trunk/Application/CaptainHook/PluginLoader.cs
trunk/Application/CaptainHook/Settings.cs
trunk/Application/CaptainHook.Engine/ApplicationHost.cs
trunk/Application/CaptainHook.Engine/CaptainHook.Engine.csproj
trunk/Application/CaptainHook.Engine/HookContext.cs
trunk/Application/CaptainHook.Engine/HookNameAttribute.cs
trunk/Application/CaptainHook.Engine/IHookContext.cs
trunk/Application/CaptainHook.Engine/PostCommitHook.cs
trunk/Application/CaptainHook.Engine/PostRevisionPropertyChangeHook.cs
trunk/Application/CaptainHook.Engine/PreCommitHook.cs
trunk/Application/CaptainHook.Engine/PreRevisionPropertyChangeHook.cs
trunk/Application/CaptainHook.Engine/Properties/
trunk/Application/CaptainHook.Engine/Properties/AssemblyInfo.cs
trunk/Application/CaptainHook.Engine/RepositoryInfo/
trunk/Application/CaptainHook.Engine/RepositoryInfo/CommitInfo.cs
trunk/Application/CaptainHook.Engine/RepositoryInfo/Difference.cs
trunk/Application/CaptainHook.Engine/RepositoryInfo/HistoryInfo.cs
trunk/Application/CaptainHook.Engine/RepositoryInfo/ICommitInfo.cs
trunk/Application/CaptainHook.Engine/RepositoryInfo/IDifference.cs
trunk/Application/CaptainHook.Engine/RepositoryInfo/IHistoryInfo.cs
trunk/Application/CaptainHook.Engine/RepositoryInfo/IPropertyChangeInfo.cs
trunk/Application/CaptainHook.Engine/RepositoryInfo/IRepositoryChange.cs
trunk/Application/CaptainHook.Engine/RepositoryInfo/IRevisionInfo.cs
trunk/Application/CaptainHook.Engine/RepositoryInfo/ITransactionInfo.cs
trunk/Application/CaptainHook.Engine/RepositoryInfo/PropertyChangeInfo.cs
trunk/Application/CaptainHook.Engine/RepositoryInfo/RepositoryChange.cs
trunk/Application/CaptainHook.Engine/RepositoryInfo/RevisionInfo.cs
trunk/Application/CaptainHook.Engine/RepositoryInfo/TransactionInfo.cs
trunk/Application/CaptainHook.Engine/Services/
trunk/Application/CaptainHook.Engine/Services/ConsoleOutputHandler.cs
trunk/Application/CaptainHook.Engine/Services/IOutputHandler.cs
trunk/Application/CaptainHook.Engine/Services/IPluginLoader.cs
trunk/Application/CaptainHook.Engine/Services/ISubversionRepository.cs
trunk/Application/CaptainHook.Engine/Services/ISubversionTranslator.cs
trunk/Application/CaptainHook.Engine/Services/PluginLoader.cs
trunk/Application/CaptainHook.Engine/Services/SubversionRepository.cs
trunk/Application/CaptainHook.Engine/Services/SubversionTranslator.cs
trunk/Application/CaptainHook.Engine/StartCommitHook.cs
trunk/Application/CaptainHook.Engine/SubversionHook.cs
trunk/Application/CaptainHook.Interfaces/
trunk/Application/CaptainHook.SubversionWrapper/
Deleted: trunk/Application/CaptainHook/ApplicationHost.cs
===================================================================
--- trunk/Application/CaptainHook/ApplicationHost.cs 2007-03-07 22:10:57 UTC (rev 18)
+++ trunk/Application/CaptainHook/ApplicationHost.cs 2007-03-07 22:14:20 UTC (rev 19)
@@ -1,229 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Configuration;
-using System.Net;
-using System.Net.Mail;
-using System.Text;
-using CaptainHook.CommandLine;
-using CaptainHook.Subversion;
-using CaptainHook.Subversion.Hook;
-
-namespace CaptainHook
-{
- public class ApplicationHost : IApplicationHost
- {
- Arguments arguments;
- PluginLoader pluginLoader;
-
- /// <summary>
- /// Constructor. Reads in the arguments.
- /// </summary>
- /// <param name="args"></param>
- public ApplicationHost(Arguments args, IOutputHandler output, PluginLoader pluginLoader)
- {
- if (output == null)
- throw new ArgumentNullException("output", "OutputMessageHandler should not be null");
-
- if (pluginLoader == null)
- throw new ArgumentNullException("pluginLoader", "Without the plugin loader, how will we handle the hooks?");
-
- if (args == null)
- throw new ArgumentNullException("args", "Cannot instantiate with null arguments.");
-
- this.output = output;
- this.arguments = args;
-
- this.pluginLoader = pluginLoader;
- this.subversionApp = new SubversionTranslator(new SubversionRepository(this.Repository, args.SvnExePath, args.SvnLookExePath, output));
- }
-
- /// <summary>
- /// The path to the Subversion repository.
- /// </summary>
- public string Repository
- {
- get { return this.arguments.Repository; }
- }
-
- /// <summary>
- /// Handles the hook event and returns whether or not
- /// Subversion should continue with the transaction.
- /// </summary>
- /// <remarks>
- /// If any hook votes to stop the transaction, the transaction will not
- /// continue, though the other hooks will have a chance to run.
- /// </remarks>
- /// <returns></returns>
- public bool HandleHookEvent()
- {
- bool continueTransaction = true;
- ICollection<SubversionHook> hooks = pluginLoader.LoadPlugins(this.arguments.HookType);
- foreach(SubversionHook hook in hooks)
- {
- try
- {
- hook.Initialize(this);
-
- if (!hook.HandleHook(PrepareCommitInfo(this.arguments)))
- {
- output.Write(string.Format("The hook '{0}' votes to not continue the transaction.", hook.GetType().Name));
- continueTransaction = false;
- }
-
- }
- catch(Exception e)
- {
- output.WriteError("Error occurred while executing the hook {0}", e, hook.GetType().FullName);
- }
- }
-
- output.Write("Continuing Transaction?: " + continueTransaction);
-
- return continueTransaction;
- }
-
- ICommitInfo PrepareCommitInfo(Arguments args)
- {
- if (!String.IsNullOrEmpty(args.TransactionName))
- return this.SubversionApplication.GetCommitInformation(args.TransactionName);
-
- if (!String.IsNullOrEmpty(args.PropertyName) && !String.IsNullOrEmpty(args.UserName))
- {
- ICommitInfo commitInfo = this.SubversionApplication.GetCommitInformation(args.Revision);
- return new PropertyChangeInfo(args.PropertyName, args.UserName, commitInfo.Author, commitInfo.DateStamp, commitInfo.LogMessageSize, commitInfo.LogMessage);
- }
-
- if (!String.IsNullOrEmpty(args.UserName))
- {
- return new PropertyChangeInfo(null, args.UserName, null, DateTime.MinValue, 0, null);
- }
- else
- {
- return this.SubversionApplication.GetCommitInformation(args.Revision);
- }
- }
-
- /// <summary>
- /// Sends an email.
- /// </summary>
- /// <param name="from"></param>
- /// <param name="to"></param>
- /// <param name="ccEmails"></param>
- /// <param name="bccEmails"></param>
- /// <param name="subject"></param>
- /// <param name="body"></param>
- public void SendEmail(MailAddress from, MailAddressCollection to, MailAddressCollection ccEmails, MailAddressCollection bccEmails, string subject, string body)
- {
- if (from == null)
- throw new ArgumentNullException("A FROM: address is required.");
-
- if(to == null)
- throw new ArgumentNullException("At least one TO: address is required.");
-
- if(to.Count == 0)
- throw new ArgumentOutOfRangeException("At least one TO: address is required.");
-
- SmtpClient smtp = new SmtpClient();
- smtp.Host = SmtpServerHost;
- smtp.Port = SmtpServerPort;
-
- if(!String.IsNullOrEmpty(SmtpServerUser))
- {
- output.Write("Setting credentials - UserName: " + this.SmtpServerUser);
- NetworkCredential basicAuthCredential = new NetworkCredential(this.SmtpServerUser, this.SmtpServerPassword);
- smtp.UseDefaultCredentials = false;
- smtp.Credentials = basicAuthCredential;
- }
-
- MailMessage message = new MailMessage();
- output.Write("From: {0}", from.ToString());
- message.From = from;
- AddRange(message.To, to);
- AddRange(message.CC, ccEmails);
- AddRange(message.Bcc, bccEmails);
- message.Subject = subject;
- message.Body = body;
- message.BodyEncoding = Encoding.UTF8;
-
- output.Write("Sending Email via Host '{0}:{1}", smtp.Host, smtp.Port);
- try
- {
- smtp.Send(message);
- }
- catch(SmtpException e)
- {
- output.WriteError("Error while sending email", e);
- }
- }
-
- void AddRange(MailAddressCollection destination, MailAddressCollection toBeAdded)
- {
- if (destination == null)
- throw new ArgumentNullException("destination", "Cannot add emails to a null MailAddressCollection.");
- if(toBeAdded == null)
- return;
- foreach (MailAddress toAddress in toBeAdded)
- {
- destination.Add(toAddress);
- }
- }
-
- private string SmtpServerHost
- {
- get
- {
- return ConfigurationManager.AppSettings["SmtpServerHost"];
- }
- }
-
- private int SmtpServerPort
- {
- get
- {
- if (String.IsNullOrEmpty(ConfigurationManager.AppSettings["SmtpServerPort"]))
- return 25;
- return int.Parse(ConfigurationManager.AppSettings["SmtpServerPort"]);
- }
- }
-
- private string SmtpServerUser
- {
- get
- {
- return ConfigurationManager.AppSettings["SmtpServerUser"];
- }
- }
-
- private string SmtpServerPassword
- {
- get
- {
- return ConfigurationManager.AppSettings["SmtpServerPassword"];
- }
- }
-
- public ISubversionTranslator SubversionApplication
- {
- get
- {
- return this.subversionApp;
- }
- }
-
- ISubversionTranslator subversionApp;
-
- /// <summary>
- /// Used to write output. Probably to the Console, but
- /// you never know.
- /// </summary>
- public IOutputHandler Output
- {
- get
- {
- return output;
- }
- }
-
- IOutputHandler output;
- }
-}
Modified: trunk/Application/CaptainHook/CaptainHook.csproj
===================================================================
--- trunk/Application/CaptainHook/CaptainHook.csproj 2007-03-07 22:10:57 UTC (rev 18)
+++ trunk/Application/CaptainHook/CaptainHook.csproj 2007-03-07 22:14:20 UTC (rev 19)
@@ -40,12 +40,8 @@
<Compile Include="CommandLine\Arguments.cs" />
<Compile Include="CommandLine\CommandLineSwitchAttribute.cs" />
<Compile Include="CommandLine\Parser.cs" />
- <Compile Include="ApplicationHost.cs" />
- <Compile Include="OutputHandler.cs" />
- <Compile Include="PluginLoader.cs" />
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
- <Compile Include="Settings.cs" />
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
@@ -56,14 +52,10 @@
<None Include="SampleBatchFiles\post-commit.bat" />
</ItemGroup>
<ItemGroup>
- <ProjectReference Include="..\CaptainHook.Interfaces\CaptainHook.Interfaces.csproj">
- <Project>{4CE44566-B3FD-4D6F-8C90-3323C78A3405}</Project>
- <Name>CaptainHook.Interfaces</Name>
+ <ProjectReference Include="..\CaptainHook.Engine\CaptainHook.Engine.csproj">
+ <Project>{0717F186-701E-47AE-B7D9-B577D2657386}</Project>
+ <Name>CaptainHook.Engine</Name>
</ProjectReference>
- <ProjectReference Include="..\CaptainHook.SubversionWrapper\CaptainHook.SubversionWrapper.csproj">
- <Project>{2A3379EC-DFDB-456E-95EB-DE84997D52D0}</Project>
- <Name>CaptainHook.SubversionWrapper</Name>
- </ProjectReference>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Resources\Usage.txt" />
Modified: trunk/Application/CaptainHook/CommandLine/Arguments.cs
===================================================================
--- trunk/Application/CaptainHook/CommandLine/Arguments.cs 2007-03-07 22:10:57 UTC (rev 18)
+++ trunk/Application/CaptainHook/CommandLine/Arguments.cs 2007-03-07 22:14:20 UTC (rev 19)
@@ -5,8 +5,7 @@
using System.IO;
using System.Reflection;
using System.Text;
-using RJH.CommandLineHelper;
-using CaptainHook.Subversion.Hook;
+using CaptainHook.Engine;
namespace CaptainHook.CommandLine
{
@@ -270,6 +269,7 @@
errorMessages.Add(string.Format(message, args));
}
+ // TODO: Move usage into program.cs
/// <summary>
/// Prints out the usage for this applicaiton.
/// </summary>
Modified: trunk/Application/CaptainHook/CommandLine/CommandLineSwitchAttribute.cs
===================================================================
--- trunk/Application/CaptainHook/CommandLine/CommandLineSwitchAttribute.cs 2007-03-07 22:10:57 UTC (rev 18)
+++ trunk/Application/CaptainHook/CommandLine/CommandLineSwitchAttribute.cs 2007-03-07 22:14:20 UTC (rev 19)
@@ -14,7 +14,7 @@
using System;
-namespace RJH.CommandLineHelper
+namespace CaptainHook.CommandLine
{
/// <summary>Implements a basic command-line switch by taking the
/// switching name and the associated description.</summary>
Modified: trunk/Application/CaptainHook/CommandLine/Parser.cs
===================================================================
--- trunk/Application/CaptainHook/CommandLine/Parser.cs 2007-03-07 22:10:57 UTC (rev 18)
+++ trunk/Application/CaptainHook/CommandLine/Parser.cs 2007-03-07 22:14:20 UTC (rev 19)
@@ -15,7 +15,7 @@
using System;
using System.Text.RegularExpressions;
-namespace RJH.CommandLineHelper
+namespace CaptainHook.CommandLine
{
/// <summary>Implementation of a command-line parsing class. Is capable of
/// having switches registered with it directly or can examine a registered
Deleted: trunk/Application/CaptainHook/OutputHandler.cs
===================================================================
--- trunk/Application/CaptainHook/OutputHandler.cs 2007-03-07 22:10:57 UTC (rev 18)
+++ trunk/Application/CaptainHook/OutputHandler.cs 2007-03-07 22:14:20 UTC (rev 19)
@@ -1,119 +0,0 @@
-using System;
-
-namespace CaptainHook
-{
- /// <summary>
- /// Class used to encapsulate output messages. In this case,
- /// it just writes them to the Console.
- /// </summary>
- public class OutputHandler : IOutputHandler
- {
- public OutputHandler()
- {
- }
-
- public bool Debug
- {
- get { return this.debug; }
- set { this.debug = value; }
- }
-
- bool debug;
-
- public virtual void Write()
- {
- Console.WriteLine();
- }
-
- public void Write(string format)
- {
- Console.WriteLine(format);
- }
-
- public virtual void Write(string format, params object[] parameters)
- {
- Console.WriteLine(format, parameters);
- }
-
- public virtual void WriteDebug()
- {
- if(Debug)
- Console.WriteLine();
- }
-
- public void WriteDebug(string message)
- {
- if(Debug)
- Console.WriteLine("DEBUG: " + message);
- }
-
- public virtual void WriteDebug(string format, params object[] parameters)
- {
- if(Debug)
- Console.WriteLine("DEBUG: " + format, parameters);
- }
-
- /// <summary>
- /// Writes an error message to the standard error stream. This
- /// will show up as the error message if a commit is denied
- /// in the subversion client.
- /// </summary>
- /// <param name="format"></param>
- /// <param name="exc"></param>
- /// <param name="parameters"></param>
- public virtual void WriteError(string format, Exception exc, params object[] parameters)
- {
- Console.Error.WriteLine("DOH! "+ format, parameters);
- WriteException(exc);
- }
-
- void WriteException(Exception exception)
- {
- Console.Error.WriteLine("EXCEPTION: " + exception.GetType().FullName);
- Console.Error.WriteLine("MESSAGE: " + exception.Message);
- Console.Error.WriteLine("STACK TRACE");
- Console.Error.WriteLine(exception.StackTrace);
- if (exception.InnerException != null)
- {
- Console.Error.WriteLine("----------------------");
- Console.Error.WriteLine("INNER EXCEPTION");
- WriteException(exception.InnerException);
-
- }
- }
-
- /// <summary>
- /// Writes an error message to the standard error stream. This
- /// will show up as the error message if a commit is denied
- /// in the subversion client.
- /// </summary>
- /// <param name="format"></param>
- /// <param name="parameters"></param>
- public virtual void WriteError(string format, params object[] parameters)
- {
- Console.Error.WriteLine("WHOOPS! " + format, parameters);
- }
-
- /// <summary>
- /// Writes an error message to the standard error stream. This
- /// will show up as the error message if a commit is denied
- /// in the subversion client.
- /// </summary>
- /// <param name="message"></param>
- public void WriteError(string message)
- {
- Console.Error.WriteLine("WHOOPS! " + message);
- }
-
- /// <summary>
- /// Writes an error message to the standard error stream. This
- /// will show up as the error message if a commit is denied
- /// in the subversion client.
- /// </summary>
- /// <param name="message"></param>
- public virtual void WriteHelp(string message)
- {
- Console.WriteLine(message);
- }
- }
-}
Deleted: trunk/Application/CaptainHook/PluginLoader.cs
===================================================================
--- trunk/Application/CaptainHook/PluginLoader.cs 2007-03-07 22:10:57 UTC (rev 18)
+++ trunk/Application/CaptainHook/PluginLoader.cs 2007-03-07 22:14:20 UTC (rev 19)
@@ -1,75 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Collections.ObjectModel;
-using System.IO;
-using System.Reflection;
-using CaptainHook;
-using CaptainHook.Subversion.Hook;
-
-namespace CaptainHook
-{
- /// <summary>
- /// this is an exceedingly simple plugin loader.
- /// </summary>
- public class PluginLoader
- {
- IOutputHandler output;
-
- /// <summary>
- /// Constructs an instance of the plugin loader.
- /// </summary>
- /// <param name="output"></param>
- public PluginLoader(IOutputHandler output)
- {
- this.output = output;
- }
-
- /// <summary>
- /// Returns a collection of plugins matching the specified type.
- /// </summary>
- /// <param name="pluginType"></param>
- /// <returns></returns>
- public ICollection<SubversionHook> LoadPlugins(Type pluginType)
- {
- ICollection<SubversionHook> hooks = new Collection<SubversionHook>();
- //Look in plugin directory.
- string pluginDirectoryPath = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), Settings.PluginFolder);
- string[] dlls = Directory.GetFiles(pluginDirectoryPath, "*.dll");
-
- output.WriteDebug("{0} Dlls found", dlls.Length);
-
- foreach(string assemblyFilePath in dlls)
- {
- output.WriteDebug("Loading assembly '{0}'", assemblyFilePath);
-
- Assembly assembly = Assembly.LoadFrom(assemblyFilePath);
- if(assembly == null)
- continue;
-
- Type[] types = assembly.GetTypes();
- foreach(Type type in types)
- {
- output.WriteDebug("Checking if type '{0}' implements '{1}'", type.Name, pluginType.Name);
- if (pluginType.IsAssignableFrom(type))
- {
- output.WriteDebug("Type '{0}' DOES implement {1}", type.FullName, pluginType.Name);
-
- ConstructorInfo ctor = type.GetConstructor(Type.EmptyTypes);
- SubversionHook hook = (SubversionHook)ctor.Invoke(null);
- if(hook == null)
- continue;
-
- hooks.Add(hook);
- }
- else
- {
- output.WriteDebug("type '{0}' does not implement {1}.", type.FullName, pluginType.FullName);
- }
- }
- }
-
- output.Write("Found and Loaded {0} hooks.", hooks.Count);
- return hooks;
- }
- }
-}
Modified: trunk/Application/CaptainHook/Program.cs
===================================================================
--- trunk/Application/CaptainHook/Program.cs 2007-03-07 22:10:57 UTC (rev 18)
+++ trunk/Application/CaptainHook/Program.cs 2007-03-07 22:14:20 UTC (rev 19)
@@ -1,5 +1,7 @@
using System;
using CaptainHook.CommandLine;
+using CaptainHook.Engine;
+using CaptainHook.Engine.Services;
namespace CaptainHook
{
@@ -7,21 +9,24 @@
{
public static int Main(string[] args)
{
- IOutputHandler output = null;
+ IHookContext context = null;
+ System.Diagnostics.Debugger.Break();
+
try
{
- //TODO: Perhaps we should ask the plugins if they have any command line arguments.
Arguments arguments = new Arguments(args);
- output = new OutputHandler();
- output.Debug = arguments.Debug;
if (arguments.Complete)
{
- ApplicationHost app = new ApplicationHost(arguments, output, new PluginLoader(output));
- if (app.HandleHookEvent())
- return 0;
- else
- return 1;
+ context = BuildContext(arguments);
+
+ bool continueTransaction = true;
+ continueTransaction = context.HandleHookEvent(arguments.HookType, arguments.UserName, arguments.TransactionName, arguments.Revision, arguments.PropertyName);
+
+ if (continueTransaction)
+ return 0;
+ else
+ return 1;
}
if(arguments.ErrorMessages.Count > 0)
@@ -31,20 +36,22 @@
{
errorMessage += error + Environment.NewLine;
}
- output.WriteError(errorMessage);
- output.Write();
+
+ context.Output.WriteError(errorMessage);
+ context.Output.Write();
}
if(arguments.ShowHelp)
{
- output.WriteHelp(arguments.Usage);
+ context.Output.WriteHelp(arguments.Usage);
}
+
}
catch(Exception exc)
{
- if(output != null)
+ if (context != null)
{
- output.WriteError("Unhandled exception occurred.", exc);
+ context.Output.WriteError("Unhandled exception occurred.", exc);
}
else
{
@@ -55,5 +62,42 @@
return 0;
}
+
+ private static IHookContext BuildContext(Arguments arguments)
+ {
+ IOutputHandler outputHandler = GetOutputHandler(arguments);
+ ISubversionRepository repository = GetSubversionRepository(arguments);
+ ISubversionTranslator translator = GetSubversionTranslator(arguments);
+ IPluginLoader pluginLoader = GetPluginLoader(arguments);
+
+ HookContext context = new HookContext();
+ context.Add(outputHandler);
+ context.Add(repository);
+ context.Add(translator);
+ context.Add(pluginLoader);
+
+ return context;
+
+ }
+
+ private static IPluginLoader GetPluginLoader(Arguments arguments)
+ {
+ return new PluginLoader();
+ }
+
+ private static ISubversionTranslator GetSubversionTranslator(Arguments arguments)
+ {
+ return new SubversionTranslator();
+ }
+
+ private static ISubversionRepository GetSubversionRepository(Arguments arguments)
+ {
+ return new SubversionRepository(arguments.Repository, arguments.SvnExePath, arguments.SvnLookExePath);
+ }
+
+ private static IOutputHandler GetOutputHandler(Arguments arguments)
+ {
+ return new ConsoleOutputHandler(arguments.Debug);
+ }
}
}
Deleted: trunk/Application/CaptainHook/Settings.cs
===================================================================
--- trunk/Application/CaptainHook/Settings.cs 2007-03-07 22:10:57 UTC (rev 18)
+++ trunk/Application/CaptainHook/Settings.cs 2007-03-07 22:14:20 UTC (rev 19)
@@ -1,17 +0,0 @@
-using System;
-using System.Configuration;
-
-namespace CaptainHook
-{
- internal static class Settings
- {
- /// <summary>
- /// The subfolder of the application exe where the
- /// plugins are placed.
- /// </summary>
- internal static string PluginFolder
- {
- get { return ConfigurationManager.AppSettings["PluginFolder"]; }
- }
- }
-}
Copied: trunk/Application/CaptainHook.Engine (from rev 18, tags/POST-TRY-ChangeArchitecture/Application/CaptainHook.Engine)
Deleted: trunk/Application/CaptainHook.Engine/ApplicationHost.cs
===================================================================
--- tags/POST-TRY-ChangeArchitecture/Application/CaptainHook.Engine/ApplicationHost.cs 2007-03-07 22:10:57 UTC (rev 18)
+++ trunk/Application/CaptainHook.Engine/ApplicationHost.cs 2007-03-07 22:14:20 UTC (rev 19)
@@ -1,206 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Configuration;
-using System.Net;
-using System.Net.Mail;
-using System.Text;
-using CaptainHook.Interfaces;
-
-namespace CaptainHook.Engine
-{
- public class ApplicationHost : IApplicationHost
- {
- PluginLoader pluginLoader;
-
- /// <summary>
- /// Constructor. Reads in the arguments.
- /// </summary>
- /// <param name="args"></param>
- public ApplicationHost(ISubversionTranslator translator, IOutputHandler output, PluginLoader pluginLoader)
- {
- if (translator == null)
- throw new ArgumentNullException("translator");
-
- if (output == null)
- throw new ArgumentNullException("output");
-
- if (pluginLoader == null)
- throw new ArgumentNullException("pluginLoader");
-
- this.subversionTranslator = translator;
- this.output = output;
- this.pluginLoader = pluginLoader;
- }
-
- public ISubversionTranslator SubversionTranslator
- {
- get { return subversionTranslator; }
- }
-
- /// <summary>
- /// Handles the hook event and returns whether or not
- /// Subversion should continue with the transaction.
- /// </summary>
- /// <remarks>
- /// If any hook votes to stop the transaction, the transaction will not
- /// continue, though the other hooks will have a chance to run.
- /// </remarks>
- /// <returns></returns>
- public bool HandleHookEvent(HookContext context)
- {
- bool continueTransaction = true;
-
- // TODO: Load Plugins
- ICollection<SubversionHook> hooks = null;// pluginLoader.LoadPlugins(context);
- foreach(SubversionHook hook in hooks)
- {
- try
- {
- // TODO: Handle hooks
- //hook.Initialize(this);
-
- //if (!hook.HandleHook(PrepareCommitInfo(this.arguments)))
- //{
- // output.Write(string.Format("The hook '{0}' votes to not continue the transaction.", hook.GetType().Name));
- // continueTransaction = false;
- //}
-
- }
- catch(Exception e)
- {
- output.WriteError("Error occurred while executing the hook {0}", e, hook.GetType().FullName);
- }
- }
-
- output.Write("Continuing Transaction?: " + continueTransaction);
-
- return continueTransaction;
- }
-
- ICommitInfo PrepareCommitInfo()
- {
- // TODO: Prepare Commit Info
- return null;
-
- //if (!String.IsNullOrEmpty(args.TransactionName))
- // return this.SubversionTranslator.GetCommitInformation(args.TransactionName);
-
- //if (!String.IsNullOrEmpty(args.PropertyName) && !String.IsNullOrEmpty(args.UserName))
- //{
- // ICommitInfo commitInfo = this.SubversionTranslator.GetCommitInformation(args.Revision);
- // return new PropertyChangeInfo(args.PropertyName, args.UserName, commitInfo.Author, commitInfo.DateStamp, commitInfo.LogMessageSize, commitInfo.LogMessage);
- //}
-
- //if (!String.IsNullOrEmpty(args.UserName))
- //{
- // return new PropertyChangeInfo(null, args.UserName, null, DateTime.MinValue, 0, null);
- //}
- //else
- //{
- // return this.SubversionTranslator.GetCommitInformation(args.Revision);
- //}
- }
-
- /// <summary>
- /// Sends an email.
- /// </summary>
- /// <param name="from"></param>
- /// <param name="to"></param>
- /// <param name="ccEmails"></param>
- /// <param name="bccEmails"></param>
- /// <param name="subject"></param>
- /// <param name="body"></param>
- public void SendEmail(MailMessage message)
- {
- if (message.From == null)
- throw new ArgumentNullException("A FROM: address is required.");
-
- if (message.To.Count == 0)
- throw new ArgumentOutOfRangeException("At least one TO: address is required.");
-
- SmtpClient smtp = new SmtpClient();
- smtp.Host = SmtpServerHost;
- smtp.Port = SmtpServerPort;
-
- if(!String.IsNullOrEmpty(SmtpServerUser))
- {
- output.WriteDebug("Setting credentials - UserName: " + this.SmtpServerUser);
- NetworkCredential basicAuthCredential = new NetworkCredential(this.SmtpServerUser, this.SmtpServerPassword);
- smtp.UseDefaultCredentials = false;
- smtp.Credentials = basicAuthCredential;
- }
-
- output.WriteDebug("Sending Email via Host '{0}:{1}", smtp.Host, smtp.Port);
- try
- {
- smtp.Send(message);
- }
- catch(SmtpException e)
- {
- output.WriteError("Error while sending email", e);
- }
- }
-
- void AddRange(MailAddressCollection destination, MailAddressCollection toBeAdded)
- {
- if (destination == null)
- throw new ArgumentNullException("destination", "Cannot add emails to a null MailAddressCollection.");
- if(toBeAdded == null)
- return;
- foreach (MailAddress toAddress in toBeAdded)
- {
- destination.Add(toAddress);
- }
- }
-
- private string SmtpServerHost
- {
- get
- {
- return ConfigurationManager.AppSettings["SmtpServerHost"];
- }
- }
-
- private int SmtpServerPort
- {
- get
- {
- if (String.IsNullOrEmpty(ConfigurationManager.AppSettings["SmtpServerPort"]))
- return 25;
- return int.Parse(ConfigurationManager.AppSettings["SmtpServerPort"]);
- }
- }
-
- private string SmtpServerUser
- {
- get
- {
- return ConfigurationManager.AppSettings["SmtpServerUser"];
- }
- }
-
- private string SmtpServerPassword
- {
- get
- {
- return ConfigurationManager.AppSettings["SmtpServerPassword"];
- }
- }
-
- ISubversionTranslator subversionTranslator;
-
- /// <summary>
- /// Used to write output. Probably to the Console, but
- /// you never know.
- /// </summary>
- public IOutputHandler Output
- {
- get
- {
- return output;
- }
- }
-
- IOutputHandler output;
- }
-}
Copied: trunk/Application/CaptainHook.Engine/ApplicationHost.cs (from rev 18, tags/POST-TRY-ChangeArchitecture/Application/CaptainHook.Engine/ApplicationHost.cs)
===================================================================
--- trunk/Application/CaptainHook.Engine/ApplicationHost.cs (rev 0)
+++ trunk/Application/CaptainHook.Engine/ApplicationHost.cs 2007-03-07 22:14:20 UTC (rev 19)
@@ -0,0 +1,206 @@
+using System;
+using System.Collections.Generic;
+using System.Configuration;
+using System.Net;
+using System.Net.Mail;
+using System.Text;
+using CaptainHook.Interfaces;
+
+namespace CaptainHook.Engine
+{
+ public class ApplicationHost : IApplicationHost
+ {
+ PluginLoader pluginLoader;
+
+ /// <summary>
+ /// Constructor. Reads in the arguments.
+ /// </summary>
+ /// <param name="args"></param>
+ public ApplicationHost(ISubversionTranslator translator, IOutputHandler output, PluginLoader pluginLoader)
+ {
+ if (translator == null)
+ throw new ArgumentNullException("translator");
+
+ if (output == null)
+ throw new ArgumentNullException("output");
+
+ if (pluginLoader == null)
+ throw new ArgumentNullException("pluginLoader");
+
+ this.subversionTranslator = translator;
+ this.output = output;
+ this.pluginLoader = pluginLoader;
+ }
+
+ public ISubversionTranslator SubversionTranslator
+ {
+ get { return subversionTranslator; }
+ }
+
+ /// <summary>
+ /// Handles the hook event and returns whether or not
+ /// Subversion should continue with the transaction.
+ /// </summary>
+ /// <remarks>
+ /// If any hook votes to stop the transaction, the transaction will not
+ /// continue, though the other hooks will have a chance to run.
+ /// </remarks>
+ /// <returns></returns>
+ public bool HandleHookEvent(HookContext context)
+ {
+ bool continueTransaction = true;
+
+ // TODO: Load Plugins
+ ICollection<SubversionHook> hooks = null;// pluginLoader.LoadPlugins(context);
+ foreach(SubversionHook hook in hooks)
+ {
+ try
+ {
+ // TODO: Handle hooks
+ //hook.Initialize(this);
+
+ //if (!hook.HandleHook(PrepareCommitInfo(this.arguments)))
+ //{
+ // output.Write(string.Format("The hook '{0}' votes to not continue the transaction.", hook.GetType().Name));
+ // continueTransaction = false;
+ //}
+
+ }
+ catch(Exception e)
+ {
+ output.WriteError("Error occurred while executing the hook {0}", e, hook.GetType().FullName);
+ }
+ }
+
+ output.Write("Continuing Transaction?: " + continueTransaction);
+
+ return continueTransaction;
+ }
+
+ ICommitInfo PrepareCommitInfo()
+ {
+ // TODO: Prepare Commit Info
+ return null;
+
+ //if (!String.IsNullOrEmpty(args.TransactionName))
+ // return this.SubversionTranslator.GetCommitInformation(args.TransactionName);
+
+ //if (!String.IsNullOrEmpty(args.PropertyName) && !String.IsNullOrEmpty(args.UserName))
+ //{
+ // ICommitInfo commitInfo = this.SubversionTranslator.GetCommitInformation(args.Revision);
+ // return new PropertyChangeInfo(args.PropertyName, args.UserName, commitInfo.Author, commitInfo.DateStamp, commitInfo.LogMessageSize, commitInfo.LogMessage);
+ //}
+
+ //if (!String.IsNullOrEmpty(args.UserName))
+ //{
+ // return new PropertyChangeInfo(null, args.UserName, null, DateTime.MinValue, 0, null);
+ //}
+ //else
+ //{
+ // return this.SubversionTranslator.GetCommitInformation(args.Revision);
+ //}
+ }
+
+ /// <summary>
+ /// Sends an email.
+ /// </summary>
+ /// <param name="from"></param>
+ /// <param name="to"></param>
+ /// <param name="ccEmails"></param>
+ /// <param name="bccEmails"></param>
+ /// <param name="subject"></param>
+ /// <param name="body"></param>
+ public void SendEmail(MailMessage message)
+ {
+ if (message.From == null)
+ throw new ArgumentNullException("A FROM: address is required.");
+
+ if (message.To.Count == 0)
+ throw new ArgumentOutOfRangeException("At least one TO: address is required.");
+
+ SmtpClient smtp = new SmtpClient();
+ smtp.Host = SmtpServerHost;
+ smtp.Port = SmtpServerPort;
+
+ if(!String.IsNullOrEmpty(SmtpServerUser))
+ {
+ output.WriteDebug("Setting credentials - UserName: " + this.SmtpServerUser);
+ NetworkCredential basicAuthCredential = new NetworkCredential(this.SmtpServerUser, this.SmtpServerPassword);
+ smtp.UseDefaultCredentials = false;
+ smtp.Credentials = basicAuthCredential;
+ }
+
+ output.WriteDebug("Sending Email via Host '{0}:{1}", smtp.Host, smtp.Port);
+ try
+ {
+ smtp.Send(message);
+ }
+ catch(SmtpException e)
+ {
+ output.WriteError("Error while sending email", e);
+ }
+ }
+
+ void AddRange(MailAddressCollection destination, MailAddressCollection toBeAdded)
+ {
+ if (destination == null)
+ throw new ArgumentNullException("destination", "Cannot add emails to a null MailAddressCollection.");
+ if(toBeAdded == null)
+ return;
+ foreach (MailAddress toAddress in toBeAdded)
+ {
+ destination.Add(toAddress);
+ }
+ }
+
+ private string SmtpServerHost
+ {
+ get
+ {
+ return ConfigurationManager.AppSettings["SmtpServerHost"];
+ }
+ }
+
+ private int SmtpServerPort
+ {
+ get
+ {
+ if (String.IsNullOrEmpty(ConfigurationManager.AppSettings["SmtpServerPort"]))
+ return 25;
+ return int.Parse(ConfigurationManager.AppSettings["SmtpServerPort"]);
+ }
+ }
+
+ private string SmtpServerUser
+ {
+ get
+ {
+ return ConfigurationManager.AppSettings["SmtpServerUser"];
+ }
+ }
+
+ private string SmtpServerPassword
+ {
+ get
+ {
+ return ConfigurationManager.AppSettings["SmtpServerPassword"];
+ }
+ }
+
+ ISubversionTranslator subversionTranslator;
+
+ /// <summary>
+ /// Used to write output. Probably to the Console, but
+ /// you never know.
+ /// </summary>
+ public IOutputHandler Output
+ {
+ get
+ {
+ return output;
+ }
+ }
+
+ IOutputHandler output;
+ }
+}
Deleted: trunk/Application/CaptainHook.Engine/CaptainHook.Engine.csproj
===================================================================
--- tags/POST-TRY-ChangeArchitecture/Application/CaptainHook.Engine/CaptainHook.Engine.csproj 2007-03-07 22:10:57 UTC (rev 18)
+++ trunk/Application/CaptainHook.Engine/CaptainHook.Engine.csproj 2007-03-07 22:14:20 UTC (rev 19)
@@ -1,87 +0,0 @@
-<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <PropertyGroup>
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <ProductVersion>8.0.50727</ProductVersion>
- <SchemaVersion>2.0</SchemaVersion>
- <ProjectGuid>{0717F186-701E-47AE-B7D9-B577D2657386}</ProjectGuid>
- <OutputType>Library</OutputType>
- <AppDesignerFolder>Properties</AppDesignerFolder>
- <RootNamespace>CaptainHook.Engine</RootNamespace>
- <AssemblyName>CaptainHook.Engine</AssemblyName>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
- <DebugSymbols>true</DebugSymbols>
- <DebugType>full</DebugType>
- <Optimize>false</Optimize>
- <OutputPath>bin\Debug\</OutputPath>
- <DefineConstants>DEBUG;TRACE</DefineConstants>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- <TreatWarningsAsErrors>true</TreatWarningsAsErrors>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
- <DebugType>pdbonly</DebugType>
- <Optimize>true</Optimize>
- <OutputPath>bin\Release\</OutputPath>
- <DefineConstants>TRACE</DefineConstants>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- </PropertyGroup>
- <ItemGroup>
- <Reference Include="System" />
- <Reference Include="System.configuration" />
- <Reference Include="System.Data" />
- <Reference Include="System.Xml" />
- </ItemGroup>
- <ItemGroup>
- <Compile Include="IHookContext.cs" />
- <Compile Include="Services\ConsoleOutputHandler.cs">
- <SubType>Component</SubType>
- </Compile>
- <Compile Include="HookContext.cs" />
- <Compile Include="HookNameAttribute.cs" />
- <Compile Include="RepositoryInfo\CommitInfo.cs" />
- <Compile Include="RepositoryInfo\Difference.cs" />
- <Compile Include="RepositoryInfo\HistoryInfo.cs" />
- <Compile Include="RepositoryInfo\PropertyChangeInfo.cs" />
- <Compile Include="RepositoryInfo\RepositoryChange.cs" />
- <Compile Include="RepositoryInfo\RevisionInfo.cs" />
- <Compile Include="RepositoryInfo\TransactionInfo.cs" />
- <Compile Include="RepositoryInfo\ICommitInfo.cs" />
- <Compile Include="RepositoryInfo\IDifference.cs" />
- <Compile Include="RepositoryInfo\IHistoryInfo.cs" />
- <Compile Include="Services\IOutputHandler.cs" />
- <Compile Include="Services\IPluginLoader.cs" />
- <Compile Include="RepositoryInfo\IPropertyChangeInfo.cs" />
- <Compile Include="RepositoryInfo\IRepositoryChange.cs" />
- <Compile Include="RepositoryInfo\IRevisionInfo.cs" />
- <Compile Include="Services\ISubversionRepository.cs" />
- <Compile Include="Services\ISubversionTranslator.cs" />
- <Compile Include="RepositoryInfo\ITransactionInfo.cs" />
- <Compile Include="PostCommitHook.cs" />
- <Compile Include="PostRevisionPropertyChangeHook.cs" />
- <Compile Include="PreCommitHook.cs" />
- <Compile Include="PreRevisionPropertyChangeHook.cs" />
- <Compile Include="Properties\AssemblyInfo.cs" />
- <Compile Include="Services\PluginLoader.cs">
- <SubType>Component</SubType>
- </Compile>
- <Compile Include="Services\SubversionRepository.cs">
- <SubType>Component</SubType>
- </Compile>
- <Compile Include="Services\SubversionTranslator.cs">
- <SubType>Component</SubType>
- </Compile>
- <Compile Include="StartCommitHook.cs" />
- <Compile Include="SubversionHook.cs" />
- </ItemGroup>
- <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
- <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
- Other similar extension points exist, see Microsoft.Common.targets.
- <Target Name="BeforeBuild">
- </Target>
- <Target Name="AfterBuild">
- </Target>
- -->
-</Project>
\ No newline at end of file
Copied: trunk/Application/CaptainHook.Engine/CaptainHook.Engine.csproj (from rev 18, tags/POST-TRY-ChangeArchitecture/Application/CaptainHook.Engine/CaptainHook.Engine.csproj)
===================================================================
--- trunk/Application/CaptainHook.Engine/CaptainHook.Engine.csproj (rev 0)
+++ trunk/Application/CaptainHook.Engine/CaptainHook.Engine.csproj 2007-03-07 22:14:20 UTC (rev 19)
@@ -0,0 +1,87 @@
+<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <ProductVersion>8.0.50727</ProductVersion>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{0717F186-701E-47AE-B7D9-B577D2657386}</ProjectGuid>
+ <OutputType>Library</OutputType>
+ <AppDesignerFolder>Properties</AppDesignerFolder>
+ <RootNamespace>CaptainHook.Engine</RootNamespace>
+ <AssemblyName>CaptainHook.Engine</AssemblyName>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ <DebugSymbols>true</DebugSymbols>
+ <DebugType>full</DebugType>
+ <Optimize>false</Optimize>
+ <OutputPath>bin\Debug\</OutputPath>
+ <DefineConstants>DEBUG;TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ <TreatWarningsAsErrors>true</TreatWarningsAsErrors>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+ <DebugType>pdbonly</DebugType>
+ <Optimize>true</Optimize>
+ <OutputPath>bin\Release\</OutputPath>
+ <DefineConstants>TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <ItemGroup>
+ <Reference Include="System" />
+ <Reference Include="System.configuration" />
+ <Reference Include="System.Data" />
+ <Reference Include="System.Xml" />
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="IHookContext.cs" />
+ <Compile Include="Services\ConsoleOutputHandler.cs">
+ <SubType>Component</SubType>
+ </Compile>
+ <Compile Include="HookContext.cs" />
+ <Compile Include="HookNameAttribute.cs" />
+ <Compile Include="RepositoryInfo\CommitInfo.cs" />
+ <Compile Include="RepositoryInfo\Difference.cs" />
+ <Compile Include="RepositoryInfo\HistoryInfo.cs" />
+ <Compile Include="RepositoryInfo\PropertyChangeInfo.cs" />
+ <Compile Include="RepositoryInfo\RepositoryChange.cs" />
+ <Compile Include="RepositoryInfo\RevisionInfo.cs" />
+ <Compile Include="RepositoryInfo\TransactionInfo.cs" />
+ <Compile Include="RepositoryInfo\ICommitInfo.cs" />
+ <Compile Include="RepositoryInfo\IDifference.cs" />
+ <Compile Include="RepositoryInfo\IHistoryInfo.cs" />
+ <Compile Include="Services\IOutputHandler.cs" />
+ <Compile Include="Services\IPluginLoader.cs" />
+ <Compile Include="RepositoryInfo\IPropertyChangeInfo.cs" />
+ <Compile Include="RepositoryInfo\IRepositoryChange.cs" />
+ <Compile Include="RepositoryInfo\IRevisionInfo.cs" />
+ <Compile Include="Services\ISubversionRepository.cs" />
+ <Compile Include="Services\ISubversionTranslator.cs" />
+ <Compile Include="RepositoryInfo\ITransactionInfo.cs" />
+ <Compile Include="PostCommitHook.cs" />
+ <Compile Include="PostRevisionPropertyChangeHook.cs" />
+ <Compile Include="PreCommitHook.cs" />
+ <Compile Include="PreRevisionPropertyChangeHook.cs" />
+ <Compile Include="Properties\AssemblyInfo.cs" />
+ <Compile Include="Services\PluginLoader.cs">
+ <SubType>Component</SubType>
+ </Compile>
+ <Compile Include="Services\SubversionRepository.cs">
+ <SubType>Component</SubType>
+ </Compile>
+ <Compile Include="Services\SubversionTranslator.cs">
+ <SubType>Component</SubType>
+ </Compile>
+ <Compile Include="StartCommitHook.cs" />
+ <Compile Include="SubversionHook.cs" />
+ </ItemGroup>
+ <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
+ <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
+ Other similar extension points exist, see Microsoft.Common.targets.
+ <Target Name="BeforeBuild">
+ </Target>
+ <Target Name="AfterBuild">
+ </Target>
+ -->
+</Project>
\ No newline at end of file
Deleted: trunk/Application/CaptainHook.Engine/HookContext.cs
===================================================================
--- tags/POST-TRY-ChangeArchitecture/Application/CaptainHook.Engine/HookContext.cs 2007-03-07 22:10:57 UTC (rev 18)
+++ trunk/Application/CaptainHook.Engine/HookContext.cs 2007-03-07 22:14:20 UTC (rev 19)
@@ -1,96 +0,0 @@
-using System;
-using System.ComponentModel;
-using System.ComponentModel.Design;
-using System.Collections.Generic;
-using System.Text;
-
-using CaptainHook.Engine.Services;
-using CaptainHook.Engine.RepositoryInfo;
-
-namespace CaptainHook.Engine
-{
- public class HookContext : Container, IHookContext
- {
- private IServiceContainer _ServiceContainer = null;
-
- public HookContext()
- {
- _ServiceContainer = new ServiceContainer();
- _ServiceContainer.AddService(typeof(IServiceContainer), _ServiceContainer);
- }
-
- protected override object GetService(Type serviceType)
- {
- object service = base.GetService(serviceType);
-
- if (service == null)
- service = _ServiceContainer.GetService(serviceType);
-
- return service;
- }
-
- public bool HandleHookEvent(Type hookType, string userName, string transactionName, int revision, string propertyName)
- {
- bool continueTransaction = true;
- ICollection<SubversionHook> hooks = PluginLoader.LoadPlugins(hookType);
- foreach (SubversionHook hook in hooks)
- {
- try
- {
- hook.Initialize(this);
-
- if (!hook.HandleHook(PrepareCommitInfo(userName, transactionName, revision, propertyName)))
- {
- Output.Write(string.Format("The hook '{0}' votes to not continue the transaction.", hook.GetType().Name));
- continueTransaction = false;
- }
-
- }
- catch (Exception e)
- {
- Output.WriteError("Error occurred while executing the hook {0}", e, hook.GetType().FullName);
- }
- }
-
- Output.Write("Continuing Transaction?: " + continueTransaction);
-
- return continueTransaction;
- }
-
- ICommitInfo PrepareCommitInfo(string userName, string transactionName, int revision, string propertyName)
- {
- if (!String.IsNullOrEmpty(transactionName))
- return Translator.GetCommitInformation(transactionName);
-
- if (!String.IsNullOrEmpty(propertyName) && !String.IsNullOrEmpty(userName))
- {
- ICommitInfo commitInfo = Translator.GetCommitInformation(revision);
- return new PropertyChangeInfo(propertyName, userName, commitInfo.Author, commitInfo.DateStamp, commitInfo.LogMessageSize, commitInfo.LogMessage);
- }
-
- if (!String.IsNullOrEmpty(userName))
- {
- return new PropertyChangeInfo(null, userName, null, DateTime.MinValue, 0, null);
- }
- else
- {
- return Translator.GetCommitInformation(revision);
- }
- }
-
- public IOutputHandler Output
- {
- get { return GetService(typeof(IOutputHandler)) as IOutputHandler; }
- }
-
- public ISubversionTranslator Translator
- {
- get { return GetService(typeof(ISubversionTranslator)) as ISubversionTranslator; }
- }
-
- protected IPluginLoader PluginLoader
- {
- get { return GetService(typeof(IPluginLoader)) as IPluginLoader; }
- }
- }
-}
Copied: trunk/Application/CaptainHook.Engine/HookContext.cs (from rev 18, tags/POST-TRY-ChangeArchitecture/Application/CaptainHook.Engine/HookContext.cs)
===================================================================
--- trunk/Application/CaptainHook.Engine/HookContext.cs (rev 0)
+++ trunk/Application/CaptainHook.Engine/HookContext.cs 2007-03-07 22:14:20 UTC (rev 19)
@@ -0,0 +1,96 @@
+using System;
+using System.ComponentModel;
+using System.ComponentModel.Design;
+using System.Collections.Generic;
+using System.Text;
+
+using CaptainHook.Engine.Services;
+using CaptainHook.Engine.RepositoryInfo;
+
+namespace CaptainHook.Engine
+{
+ public class HookContext : Container, IHookContext
+ {
+ private IServiceContainer _ServiceContainer = null;
+
+ public HookContext()
+ {
+ _ServiceContainer = new ServiceContainer();
+ _ServiceContainer.AddService(typeof(IServiceContainer), _ServiceContainer);
+ }
+
+ protected override object GetService(Type serviceType)
+ {
+ object service = base.GetService(serviceType);
+
+ if (service == null)
+ service = _ServiceContainer.GetService(serviceType);
+
+ return service;
+ }
+
+ public bool HandleHookEvent(Type hookType, string userName, string transactionName, int revision, string propertyName)
+ {
+ bool continueTransaction = true;
+ ICollection<SubversionHook> hooks = PluginLoader.LoadPlugins(hookType);
+ foreach (SubversionHook hook in hooks)
+ {
+ try
+ {
+ hook.Initialize(this);
+
+ if (!hook.HandleHook(PrepareCommitInfo(userName, transactionName, revision, propertyName)))
+ {
+ Output.Write(string.Format("The hook '{0}' votes to not continue the transaction.", hook.GetType().Name));
+ continueTransaction = false;
+ }
+
+ }
+ catch (Exception e)
+ {
+ Output.WriteError("Error occurred while executing the hook {0}", e, hook.GetType().FullName);
+ }
+ }
+
+ Output.Write("Continuing Transaction?: " + continueTransaction);
+
+ return continueTransaction;
+ }
+
+ ICommitInfo PrepareCommitInfo(string userName, string transactionName, int revision, string propertyName)
+ {
+ if (!String.IsNullOrEmpty(transactionName))
+ return Translator.GetCommitInformation(transactionName);
+
+ if (!String.IsNullOrEmpty(propertyName) && !String.IsNullOrEmpty(userName))
+ {
+ ICommitInfo commitInfo = Translator.GetCommitInformation(revision);
+ return new PropertyChangeInfo(propertyName, userName, commitInfo.Author, commitInfo.DateStamp, commitInfo.LogMessageSize, commitInfo.LogMessage);
+ }
+
+ if (!String.IsNullOrEmpty(userName))
+ {
+ return new PropertyChangeInfo(null, userName, null, DateTime.MinValue, 0, null);
+ }
+ else
+ {
+ return Translator.GetCommitInformation(revision);
+ }
+ }
+
+ public IOutputHandler Output
+ {
+ get { return GetService(typeof(IOutputHandler)) as IOutputHandler; }
+ }
+
+ public ISubversionTranslator Translator
+ {
+ get { return GetService(typeof(ISubversionTranslator)) as ISubversionTranslator; }
+ }
+
+ protected IPluginLoader PluginLoader
+ {
+ get { return GetService(typeof(IPluginLoader)) as IPluginLoader; }
+ }
+ }
+}
Deleted: trunk/Application/CaptainHook.Engine/HookNameAttribute.cs
===================================================================
--- tags/POST-TRY-ChangeArchitecture/Application/CaptainHook.Engine/HookNameAttribute.cs 2007-03-07 22:10:57 UTC (rev 18)
+++ trunk/Application/CaptainHook.Engine/HookNameAttribute.cs 2007-03-07 22:14:20 UTC (rev 19)
@@ -1,56 +0,0 @@
-using System;
-
-namespace CaptainHook.Engine
-{
- /// <summary>
- /// Attribute applied to the base hook classes in order to
- /// map the hooks to the Subversion hook name. For example,
- /// the <see cref="PostCommitHook" /> class implements the
- /// <em>post-commit</em> hook.
- /// </summary>
- [AttributeUsage(AttributeTargets.Class)]
- public class HookNameAttribute : Attribute
- {
- /// <summary>
- /// Constructs an instance of this attribute.
- /// </summary>
- /// <param name="name">The hook name.</param>
- public HookNameAttribute(string name)
- {
- this.name = name;
- }
-
- /// <summary>
- /// Constructs an instance of this attribute.
- /// </summary>
- /// <param name="name">The hook name.</param>
- /// <param name="description">What the hook does.</param>
- public HookNameAttribute(string name, string description)
- {
- this.name = name;
- this.description = description;
- }
-
- /// <summary>
- /// Gets or sets the name of the hook.
- /// </summary>
- public string Name
- {
- get { return this.name; }
- set { this.name = value; }
- }
-
- string name;
-
- /// <summary>
- /// Description of the hook's purpose.
- /// </summary>
- public string Description
- {
- get { return this.description; }
- set { this.description = value; }
- }
-
- string description;
- }
-}
Copied: trunk/Application/CaptainHook.Engine/HookNameAttribute.cs (from rev 18, tags/POST-TRY-ChangeArchitecture/Application/CaptainHook.Engine/HookNameAttribute.cs)
===================================================================
--- trunk/Application/CaptainHook.Engine/HookNameAttribute.cs (rev 0)
+++ trunk/Application/CaptainHook.Engine/HookNameAttribute.cs 2007-03-07 22:14:20 UTC (rev 19)
@@ -0,0 +1,56 @@
+using System;
+
+namespace CaptainHook.Engine
+{
+ /// <summary>
+ /// Attribute applied to the base hook classes in order to
+ /// map the hooks to the Subversion hook name. For example,
+ /// the <see cref="PostCommitHook" /> class implements the
+ /// <em>post-commit</em> hook.
+ /// </summary>
+ [AttributeUsage(AttributeTargets.Class)]
+ public class HookNameAttribute : Attribute
+ {
+ /// <summary>
+ /// Constructs an instance of this attribute.
+ /// </summary>
+ /// <param name="name">The hook name.</param>
+ public HookNameAttribute(string name)
+ {
+ this.name = name;
+ }
+
+ /// <summary>
+ /// Constructs an instance of this attribute.
+ /// </summary>
+ /// <param name="name">The hook name.</param>
+ /// <param name="description">What the hook does.</param>
+ public HookNameAttribute(string name, string description)
+ {
+ this.name = name;
+ this.description = description;
+ }
+
+ /// <summary>
+ /// Gets or sets the name of the hook.
+ /// </summary>
+ public string Name
+ {
+ get { return this.name; }
+ set { this.name = value; }
+ }
+
+ string name;
+
+ /// <summary>
+ /// Description of the hook's purpose.
+ /// </summary>
+ public string Description
+ {
+ get { return this.description; }
+ set { this.description = value; }
+ }
+
+ string description;
+ }
+}
Deleted: trunk/Application/CaptainHook.Engine/IHookContext.cs
===================================================================
--- tags/POST-TRY-ChangeArchitecture/Application/CaptainHook.Engine/IHookContext.cs 2007-03-07 22:10:57 UTC (rev 18)
+++ trunk/Application/CaptainHook.Engine/IHookContext.cs 2007-03-07 22:14:20 UTC (rev 19)
@@ -1,15 +0,0 @@
-using System;
-using System.ComponentModel;
-
-using CaptainHook.Engine.Services;
-
-namespace CaptainHook.Engine
-{
- public interface IHookContext : IContainer
- {
- bool HandleHookEvent(Type hookType, string userName, string transactionName, int revision, string propertyName);
-
- IOutputHandler Output { get; }
- ISubversionTranslator Translator { get; }
- }
-}
Copied: trunk/Application/CaptainHook.Engine/IHookContext.cs (from rev 18, tags/POST-TRY-ChangeArchitecture/Application/CaptainHook.E...
[truncated message content] |
|
From: <jor...@us...> - 2007-03-07 22:11:06
|
Revision: 18
http://svn.sourceforge.net/captainhook/?rev=18&view=rev
Author: jordan-terrell
Date: 2007-03-07 14:10:57 -0800 (Wed, 07 Mar 2007)
Log Message:
-----------
made a copy
Added Paths:
-----------
tags/POST-TRY-ChangeArchitecture/
Copied: tags/POST-TRY-ChangeArchitecture (from rev 17, branches/TRY-ChangeArchitecture)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jor...@us...> - 2007-03-07 21:58:55
|
Revision: 17
http://svn.sourceforge.net/captainhook/?rev=17&view=rev
Author: jordan-terrell
Date: 2007-03-07 13:58:51 -0800 (Wed, 07 Mar 2007)
Log Message:
-----------
Component architecture is now in place - using System.ComponentModel
Unit tests have been reworked to support component architecture
Modified Paths:
--------------
branches/TRY-ChangeArchitecture/Application/CaptainHook/CaptainHook.csproj
branches/TRY-ChangeArchitecture/Application/CaptainHook/Program.cs
branches/TRY-ChangeArchitecture/Application/CaptainHook.Engine/CaptainHook.Engine.csproj
branches/TRY-ChangeArchitecture/Application/CaptainHook.Engine/HookContext.cs
branches/TRY-ChangeArchitecture/Application/CaptainHook.Engine/Services/ConsoleOutputHandler.cs
branches/TRY-ChangeArchitecture/Application/CaptainHook.Engine/Services/IOutputHandler.cs
branches/TRY-ChangeArchitecture/Application/CaptainHook.Engine/Services/IPluginLoader.cs
branches/TRY-ChangeArchitecture/Application/CaptainHook.Engine/Services/ISubversionRepository.cs
branches/TRY-ChangeArchitecture/Application/CaptainHook.Engine/Services/ISubversionTranslator.cs
branches/TRY-ChangeArchitecture/Application/CaptainHook.Engine/Services/SubversionRepository.cs
branches/TRY-ChangeArchitecture/Application/CaptainHook.Engine/Services/SubversionTranslator.cs
branches/TRY-ChangeArchitecture/Application/CaptainHook.Plugins/PostCommitEmailHook.cs
branches/TRY-ChangeArchitecture/Testing/CaptainHook.UnitTests/CaptainHook.UnitTests.csproj
branches/TRY-ChangeArchitecture/Testing/CaptainHook.UnitTests/HookHandlerApplicationTests.cs
branches/TRY-ChangeArchitecture/Testing/CaptainHook.UnitTests/SubversionTests.cs
branches/TRY-ChangeArchitecture/master.build
Added Paths:
-----------
branches/TRY-ChangeArchitecture/Application/CaptainHook.Engine/IHookContext.cs
branches/TRY-ChangeArchitecture/Application/CaptainHook.Engine/Services/PluginLoader.cs
Removed Paths:
-------------
branches/TRY-ChangeArchitecture/Application/CaptainHook/Settings.cs
branches/TRY-ChangeArchitecture/Application/CaptainHook.Engine/PluginLoader.cs
branches/TRY-ChangeArchitecture/Application/CaptainHook.Engine/Services/IHookContext.cs
Modified: branches/TRY-ChangeArchitecture/Application/CaptainHook/CaptainHook.csproj
===================================================================
--- branches/TRY-ChangeArchitecture/Application/CaptainHook/CaptainHook.csproj 2007-02-23 21:20:38 UTC (rev 16)
+++ branches/TRY-ChangeArchitecture/Application/CaptainHook/CaptainHook.csproj 2007-03-07 21:58:51 UTC (rev 17)
@@ -42,7 +42,6 @@
<Compile Include="CommandLine\Parser.cs" />
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
- <Compile Include="Settings.cs" />
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
Modified: branches/TRY-ChangeArchitecture/Application/CaptainHook/Program.cs
===================================================================
--- branches/TRY-ChangeArchitecture/Application/CaptainHook/Program.cs 2007-02-23 21:20:38 UTC (rev 16)
+++ branches/TRY-ChangeArchitecture/Application/CaptainHook/Program.cs 2007-03-07 21:58:51 UTC (rev 17)
@@ -10,21 +10,23 @@
public static int Main(string[] args)
{
IHookContext context = null;
+ System.Diagnostics.Debugger.Break();
try
{
Arguments arguments = new Arguments(args);
-
if (arguments.Complete)
{
- IOutputHandler outputHandler = GetOutputHandler(arguments);
- ISubversionTranslator translator = GetSubversionTranslator(arguments);
- IPluginLoader pluginLoader = GetPluginLoader(arguments);
+ context = BuildContext(arguments);
- context = BuildContext(outputHandler, translator, pluginLoader);
+ bool continueTransaction = true;
+ continueTransaction = context.HandleHookEvent(arguments.HookType, arguments.UserName, arguments.TransactionName, arguments.Revision, arguments.PropertyName);
- // TODO: Invoke Hook Plugins
+ if (continueTransaction)
+ return 0;
+ else
+ return 1;
}
if(arguments.ErrorMessages.Count > 0)
@@ -61,21 +63,38 @@
return 0;
}
- private static IHookContext BuildContext(IOutputHandler outputHandler, ISubversionTranslator translator, IPluginLoader pluginLoader)
+ private static IHookContext BuildContext(Arguments arguments)
{
- return new HookContext(outputHandler, translator, pluginLoader);
+ IOutputHandler outputHandler = GetOutputHandler(arguments);
+ ISubversionRepository repository = GetSubversionRepository(arguments);
+ ISubversionTranslator translator = GetSubversionTranslator(arguments);
+ IPluginLoader pluginLoader = GetPluginLoader(arguments);
+
+ HookContext context = new HookContext();
+ context.Add(outputHandler);
+ context.Add(repository);
+ context.Add(translator);
+ context.Add(pluginLoader);
+
+ return context;
+
}
private static IPluginLoader GetPluginLoader(Arguments arguments)
{
- return null;
+ return new PluginLoader();
}
private static ISubversionTranslator GetSubversionTranslator(Arguments arguments)
{
- return null;
+ return new SubversionTranslator();
}
+ private static ISubversionRepository GetSubversionRepository(Arguments arguments)
+ {
+ return new SubversionRepository(arguments.Repository, arguments.SvnExePath, arguments.SvnLookExePath);
+ }
+
private static IOutputHandler GetOutputHandler(Arguments arguments)
{
return new ConsoleOutputHandler(arguments.Debug);
Deleted: branches/TRY-ChangeArchitecture/Application/CaptainHook/Settings.cs
===================================================================
--- branches/TRY-ChangeArchitecture/Application/CaptainHook/Settings.cs 2007-02-23 21:20:38 UTC (rev 16)
+++ branches/TRY-ChangeArchitecture/Application/CaptainHook/Settings.cs 2007-03-07 21:58:51 UTC (rev 17)
@@ -1,17 +0,0 @@
-using System;
-using System.Configuration;
-
-namespace CaptainHook
-{
- internal static class Settings
- {
- /// <summary>
- /// The subfolder of the application exe where the
- /// plugins are placed.
- /// </summary>
- internal static string PluginFolder
- {
- get { return ConfigurationManager.AppSettings["PluginFolder"]; }
- }
- }
-}
Modified: branches/TRY-ChangeArchitecture/Application/CaptainHook.Engine/CaptainHook.Engine.csproj
===================================================================
--- branches/TRY-ChangeArchitecture/Application/CaptainHook.Engine/CaptainHook.Engine.csproj 2007-02-23 21:20:38 UTC (rev 16)
+++ branches/TRY-ChangeArchitecture/Application/CaptainHook.Engine/CaptainHook.Engine.csproj 2007-03-07 21:58:51 UTC (rev 17)
@@ -35,7 +35,10 @@
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
- <Compile Include="Services\ConsoleOutputHandler.cs" />
+ <Compile Include="IHookContext.cs" />
+ <Compile Include="Services\ConsoleOutputHandler.cs">
+ <SubType>Component</SubType>
+ </Compile>
<Compile Include="HookContext.cs" />
<Compile Include="HookNameAttribute.cs" />
<Compile Include="RepositoryInfo\CommitInfo.cs" />
@@ -48,7 +51,6 @@
<Compile Include="RepositoryInfo\ICommitInfo.cs" />
<Compile Include="RepositoryInfo\IDifference.cs" />
<Compile Include="RepositoryInfo\IHistoryInfo.cs" />
- <Compile Include="Services\IHookContext.cs" />
<Compile Include="Services\IOutputHandler.cs" />
<Compile Include="Services\IPluginLoader.cs" />
<Compile Include="RepositoryInfo\IPropertyChangeInfo.cs" />
@@ -57,14 +59,20 @@
<Compile Include="Services\ISubversionRepository.cs" />
<Compile Include="Services\ISubversionTranslator.cs" />
<Compile Include="RepositoryInfo\ITransactionInfo.cs" />
- <Compile Include="PluginLoader.cs" />
<Compile Include="PostCommitHook.cs" />
<Compile Include="PostRevisionPropertyChangeHook.cs" />
<Compile Include="PreCommitHook.cs" />
<Compile Include="PreRevisionPropertyChangeHook.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
- <Compile Include="Services\SubversionRepository.cs" />
- <Compile Include="Services\SubversionTranslator.cs" />
+ <Compile Include="Services\PluginLoader.cs">
+ <SubType>Component</SubType>
+ </Compile>
+ <Compile Include="Services\SubversionRepository.cs">
+ <SubType>Component</SubType>
+ </Compile>
+ <Compile Include="Services\SubversionTranslator.cs">
+ <SubType>Component</SubType>
+ </Compile>
<Compile Include="StartCommitHook.cs" />
<Compile Include="SubversionHook.cs" />
</ItemGroup>
Modified: branches/TRY-ChangeArchitecture/Application/CaptainHook.Engine/HookContext.cs
===================================================================
--- branches/TRY-ChangeArchitecture/Application/CaptainHook.Engine/HookContext.cs 2007-02-23 21:20:38 UTC (rev 16)
+++ branches/TRY-ChangeArchitecture/Application/CaptainHook.Engine/HookContext.cs 2007-03-07 21:58:51 UTC (rev 17)
@@ -1,45 +1,96 @@
using System;
+using System.ComponentModel;
+using System.ComponentModel.Design;
using System.Collections.Generic;
using System.Text;
using CaptainHook.Engine.Services;
+using CaptainHook.Engine.RepositoryInfo;
namespace CaptainHook.Engine
{
- public class HookContext : IHookContext
+ public class HookContext : Container, IHookContext
{
- private IOutputHandler _OutputHandler = null;
- private ISubversionTranslator _Translator = null;
- private IPluginLoader _PluginLoader = null;
+ private IServiceContainer _ServiceContainer = null;
- public HookContext(ISubversionTranslator translator, IPluginLoader pluginLoader) : this(new ConsoleOutputHandler(false), translator, pluginLoader)
+ public HookContext()
{
+ _ServiceContainer = new ServiceContainer();
+ _ServiceContainer.AddService(typeof(IServiceContainer), _ServiceContainer);
}
- public HookContext(IOutputHandler outputHandler, ISubversionTranslator translator, IPluginLoader pluginLoader)
+ protected override object GetService(Type serviceType)
{
- if (outputHandler == null)
- throw new ArgumentNullException("outputHandler");
+ object service = base.GetService(serviceType);
- if (translator == null)
- throw new ArgumentNullException("translator");
+ if (service == null)
+ service = _ServiceContainer.GetService(serviceType);
- if (pluginLoader == null)
- throw new ArgumentNullException("pluginLoader");
+ return service;
+ }
- _OutputHandler = outputHandler;
- _Translator = translator;
- _PluginLoader = pluginLoader;
+ public bool HandleHookEvent(Type hookType, string userName, string transactionName, int revision, string propertyName)
+ {
+ bool continueTransaction = true;
+ ICollection<SubversionHook> hooks = PluginLoader.LoadPlugins(hookType);
+ foreach (SubversionHook hook in hooks)
+ {
+ try
+ {
+ hook.Initialize(this);
+
+ if (!hook.HandleHook(PrepareCommitInfo(userName, transactionName, revision, propertyName)))
+ {
+ Output.Write(string.Format("The hook '{0}' votes to not continue the transaction.", hook.GetType().Name));
+ continueTransaction = false;
+ }
+
+ }
+ catch (Exception e)
+ {
+ Output.WriteError("Error occurred while executing the hook {0}", e, hook.GetType().FullName);
+ }
+ }
+
+ Output.Write("Continuing Transaction?: " + continueTransaction);
+
+ return continueTransaction;
}
+ ICommitInfo PrepareCommitInfo(string userName, string transactionName, int revision, string propertyName)
+ {
+ if (!String.IsNullOrEmpty(transactionName))
+ return Translator.GetCommitInformation(transactionName);
+
+ if (!String.IsNullOrEmpty(propertyName) && !String.IsNullOrEmpty(userName))
+ {
+ ICommitInfo commitInfo = Translator.GetCommitInformation(revision);
+ return new PropertyChangeInfo(propertyName, userName, commitInfo.Author, commitInfo.DateStamp, commitInfo.LogMessageSize, commitInfo.LogMessage);
+ }
+
+ if (!String.IsNullOrEmpty(userName))
+ {
+ return new PropertyChangeInfo(null, userName, null, DateTime.MinValue, 0, null);
+ }
+ else
+ {
+ return Translator.GetCommitInformation(revision);
+ }
+ }
+
public IOutputHandler Output
{
- get { return _OutputHandler; }
+ get { return GetService(typeof(IOutputHandler)) as IOutputHandler; }
}
public ISubversionTranslator Translator
{
- get { return _Translator; }
+ get { return GetService(typeof(ISubversionTranslator)) as ISubversionTranslator; }
}
+
+ protected IPluginLoader PluginLoader
+ {
+ get { return GetService(typeof(IPluginLoader)) as IPluginLoader; }
+ }
}
}
Copied: branches/TRY-ChangeArchitecture/Application/CaptainHook.Engine/IHookContext.cs (from rev 16, branches/TRY-ChangeArchitecture/Application/CaptainHook.Engine/Services/IHookContext.cs)
===================================================================
--- branches/TRY-ChangeArchitecture/Application/CaptainHook.Engine/IHookContext.cs (rev 0)
+++ branches/TRY-ChangeArchitecture/Application/CaptainHook.Engine/IHookContext.cs 2007-03-07 21:58:51 UTC (rev 17)
@@ -0,0 +1,15 @@
+using System;
+using System.ComponentModel;
+
+using CaptainHook.Engine.Services;
+
+namespace CaptainHook.Engine
+{
+ public interface IHookContext : IContainer
+ {
+ bool HandleHookEvent(Type hookType, string userName, string transactionName, int revision, string propertyName);
+
+ IOutputHandler Output { get; }
+ ISubversionTranslator Translator { get; }
+ }
+}
Deleted: branches/TRY-ChangeArchitecture/Application/CaptainHook.Engine/PluginLoader.cs
===================================================================
--- branches/TRY-ChangeArchitecture/Application/CaptainHook.Engine/PluginLoader.cs 2007-02-23 21:20:38 UTC (rev 16)
+++ branches/TRY-ChangeArchitecture/Application/CaptainHook.Engine/PluginLoader.cs 2007-03-07 21:58:51 UTC (rev 17)
@@ -1,75 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Collections.ObjectModel;
-using System.IO;
-using System.Reflection;
-
-using CaptainHook.Engine.Services;
-
-namespace CaptainHook.Engine
-{
- /// <summary>
- /// this is an exceedingly simple plugin loader.
- /// </summary>
- public class PluginLoader
- {
- IOutputHandler output;
-
- /// <summary>
- /// Constructs an instance of the plugin loader.
- /// </summary>
- /// <param name="output"></param>
- public PluginLoader(IOutputHandler output)
- {
- this.output = output;
- }
-
- /// <summary>
- /// Returns a collection of plugins matching the specified type.
- /// </summary>
- /// <param name="pluginType"></param>
- /// <returns></returns>
- public ICollection<SubversionHook> LoadPlugins(Type pluginType)
- {
- ICollection<SubversionHook> hooks = new Collection<SubversionHook>();
- //Look in plugin directory.
- string pluginDirectoryPath = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "" /* Fix Plugin Loader */);
- string[] dlls = Directory.GetFiles(pluginDirectoryPath, "*.dll");
-
- output.WriteDebug("{0} Dlls found", dlls.Length);
-
- foreach(string assemblyFilePath in dlls)
- {
- output.WriteDebug("Loading assembly '{0}'", assemblyFilePath);
-
- Assembly assembly = Assembly.LoadFrom(assemblyFilePath);
- if(assembly == null)
- continue;
-
- Type[] types = assembly.GetTypes();
- foreach(Type type in types)
- {
- output.WriteDebug("Checking if type '{0}' implements '{1}'", type.Name, pluginType.Name);
- if (pluginType.IsAssignableFrom(type))
- {
- output.WriteDebug("Type '{0}' DOES implement {1}", type.FullName, pluginType.Name);
-
- ConstructorInfo ctor = type.GetConstructor(Type.EmptyTypes);
- SubversionHook hook = (SubversionHook)ctor.Invoke(null);
- if(hook == null)
- continue;
-
- hooks.Add(hook);
- }
- else
- {
- output.WriteDebug("type '{0}' does not implement {1}.", type.FullName, pluginType.FullName);
- }
- }
- }
-
- output.Write("Found and Loaded {0} hooks.", hooks.Count);
- return hooks;
- }
- }
-}
Modified: branches/TRY-ChangeArchitecture/Application/CaptainHook.Engine/Services/ConsoleOutputHandler.cs
===================================================================
--- branches/TRY-ChangeArchitecture/Application/CaptainHook.Engine/Services/ConsoleOutputHandler.cs 2007-02-23 21:20:38 UTC (rev 16)
+++ branches/TRY-ChangeArchitecture/Application/CaptainHook.Engine/Services/ConsoleOutputHandler.cs 2007-03-07 21:58:51 UTC (rev 17)
@@ -1,14 +1,14 @@
using System;
+using System.ComponentModel;
+using System.ComponentModel.Design;
-
-
namespace CaptainHook.Engine.Services
{
/// <summary>
/// Class used to encapsulate output messages. In this case,
/// it just writes them to the Console.
/// </summary>
- public class ConsoleOutputHandler : IOutputHandler
+ public class ConsoleOutputHandler : Component, IOutputHandler
{
bool debug = false;
@@ -17,6 +17,18 @@
this.debug = debug;
}
+ public override ISite Site
+ {
+ set
+ {
+ base.Site = value;
+
+ IServiceContainer container = (IServiceContainer)GetService(typeof(IServiceContainer));
+ container.AddService(typeof(IOutputHandler), this);
+ }
+ }
+
+
public virtual void Write()
{
Console.WriteLine();
Deleted: branches/TRY-ChangeArchitecture/Application/CaptainHook.Engine/Services/IHookContext.cs
===================================================================
--- branches/TRY-ChangeArchitecture/Application/CaptainHook.Engine/Services/IHookContext.cs 2007-02-23 21:20:38 UTC (rev 16)
+++ branches/TRY-ChangeArchitecture/Application/CaptainHook.Engine/Services/IHookContext.cs 2007-03-07 21:58:51 UTC (rev 17)
@@ -1,10 +0,0 @@
-using System;
-
-namespace CaptainHook.Engine.Services
-{
- public interface IHookContext
- {
- IOutputHandler Output { get; }
- ISubversionTranslator Translator { get; }
- }
-}
Modified: branches/TRY-ChangeArchitecture/Application/CaptainHook.Engine/Services/IOutputHandler.cs
===================================================================
--- branches/TRY-ChangeArchitecture/Application/CaptainHook.Engine/Services/IOutputHandler.cs 2007-02-23 21:20:38 UTC (rev 16)
+++ branches/TRY-ChangeArchitecture/Application/CaptainHook.Engine/Services/IOutputHandler.cs 2007-03-07 21:58:51 UTC (rev 17)
@@ -1,11 +1,12 @@
using System;
+using System.ComponentModel;
namespace CaptainHook.Engine.Services
{
/// <summary>
/// Interface used to encapsulate output messages.
/// </summary>
- public interface IOutputHandler
+ public interface IOutputHandler : IComponent
{
void Write();
void Write(string format);
Modified: branches/TRY-ChangeArchitecture/Application/CaptainHook.Engine/Services/IPluginLoader.cs
===================================================================
--- branches/TRY-ChangeArchitecture/Application/CaptainHook.Engine/Services/IPluginLoader.cs 2007-02-23 21:20:38 UTC (rev 16)
+++ branches/TRY-ChangeArchitecture/Application/CaptainHook.Engine/Services/IPluginLoader.cs 2007-03-07 21:58:51 UTC (rev 17)
@@ -1,10 +1,12 @@
using System;
using System.Collections.Generic;
using System.Text;
+using System.ComponentModel;
namespace CaptainHook.Engine.Services
{
- public interface IPluginLoader
+ public interface IPluginLoader : IComponent
{
+ ICollection<SubversionHook> LoadPlugins(Type pluginType);
}
}
Modified: branches/TRY-ChangeArchitecture/Application/CaptainHook.Engine/Services/ISubversionRepository.cs
===================================================================
--- branches/TRY-ChangeArchitecture/Application/CaptainHook.Engine/Services/ISubversionRepository.cs 2007-02-23 21:20:38 UTC (rev 16)
+++ branches/TRY-ChangeArchitecture/Application/CaptainHook.Engine/Services/ISubversionRepository.cs 2007-03-07 21:58:51 UTC (rev 17)
@@ -1,8 +1,9 @@
using System;
+using System.ComponentModel;
namespace CaptainHook.Engine.Services
{
- public interface ISubversionRepository
+ public interface ISubversionRepository : IComponent
{
/// <summary>
/// The path to the SVN repository.
Modified: branches/TRY-ChangeArchitecture/Application/CaptainHook.Engine/Services/ISubversionTranslator.cs
===================================================================
--- branches/TRY-ChangeArchitecture/Application/CaptainHook.Engine/Services/ISubversionTranslator.cs 2007-02-23 21:20:38 UTC (rev 16)
+++ branches/TRY-ChangeArchitecture/Application/CaptainHook.Engine/Services/ISubversionTranslator.cs 2007-03-07 21:58:51 UTC (rev 17)
@@ -1,5 +1,7 @@
using System;
+using System.ComponentModel;
using System.Collections.Generic;
+
using CaptainHook.Engine.RepositoryInfo;
namespace CaptainHook.Engine.Services
@@ -8,7 +10,7 @@
/// Acts as a translator between the application code and
/// the Subversion command line interface.
/// </summary>
- public interface ISubversionTranslator
+ public interface ISubversionTranslator : IComponent
{
/// <summary>
/// Calls a command to get information about a specific revision
Copied: branches/TRY-ChangeArchitecture/Application/CaptainHook.Engine/Services/PluginLoader.cs (from rev 16, branches/TRY-ChangeArchitecture/Application/CaptainHook.Engine/PluginLoader.cs)
===================================================================
--- branches/TRY-ChangeArchitecture/Application/CaptainHook.Engine/Services/PluginLoader.cs (rev 0)
+++ branches/TRY-ChangeArchitecture/Application/CaptainHook.Engine/Services/PluginLoader.cs 2007-03-07 21:58:51 UTC (rev 17)
@@ -0,0 +1,89 @@
+using System;
+using System.ComponentModel;
+using System.ComponentModel.Design;
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+using System.IO;
+using System.Reflection;
+using System.Configuration;
+
+namespace CaptainHook.Engine.Services
+{
+ /// <summary>
+ /// this is an exceedingly simple plugin loader.
+ /// </summary>
+ public class PluginLoader : Component, IPluginLoader
+ {
+ /// <summary>
+ /// Constructs an instance of the plugin loader.
+ /// </summary>
+ /// <param name="output"></param>
+ public PluginLoader()
+ {
+ }
+
+ public override ISite Site
+ {
+ set
+ {
+ base.Site = value;
+
+ IServiceContainer container = (IServiceContainer) GetService(typeof(IServiceContainer));
+ container.AddService(typeof(IPluginLoader), this);
+ }
+ }
+
+ /// <summary>
+ /// Returns a collection of plugins matching the specified type.
+ /// </summary>
+ /// <param name="pluginType"></param>
+ /// <returns></returns>
+ public ICollection<SubversionHook> LoadPlugins(Type pluginType)
+ {
+ ICollection<SubversionHook> hooks = new Collection<SubversionHook>();
+ //Look in plugin directory.
+ string pluginDirectoryPath = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), ConfigurationManager.AppSettings["PluginFolder"]);
+ string[] dlls = Directory.GetFiles(pluginDirectoryPath, "*.dll");
+
+ Output.WriteDebug("{0} Dlls found", dlls.Length);
+
+ foreach(string assemblyFilePath in dlls)
+ {
+ Output.WriteDebug("Loading assembly '{0}'", assemblyFilePath);
+
+ Assembly assembly = Assembly.LoadFrom(assemblyFilePath);
+ if(assembly == null)
+ continue;
+
+ Type[] types = assembly.GetTypes();
+ foreach(Type type in types)
+ {
+ Output.WriteDebug("Checking if type '{0}' implements '{1}'", type.Name, pluginType.Name);
+ if (pluginType.IsAssignableFrom(type))
+ {
+ Output.WriteDebug("Type '{0}' DOES implement {1}", type.FullName, pluginType.Name);
+
+ ConstructorInfo ctor = type.GetConstructor(Type.EmptyTypes);
+ SubversionHook hook = (SubversionHook)ctor.Invoke(null);
+ if(hook == null)
+ continue;
+
+ hooks.Add(hook);
+ }
+ else
+ {
+ Output.WriteDebug("type '{0}' does not implement {1}.", type.FullName, pluginType.FullName);
+ }
+ }
+ }
+
+ Output.Write("Found and Loaded {0} hooks.", hooks.Count);
+ return hooks;
+ }
+
+ protected IOutputHandler Output
+ {
+ get { return GetService(typeof(IOutputHandler)) as IOutputHandler; }
+ }
+ }
+}
Modified: branches/TRY-ChangeArchitecture/Application/CaptainHook.Engine/Services/SubversionRepository.cs
===================================================================
--- branches/TRY-ChangeArchitecture/Application/CaptainHook.Engine/Services/SubversionRepository.cs 2007-02-23 21:20:38 UTC (rev 16)
+++ branches/TRY-ChangeArchitecture/Application/CaptainHook.Engine/Services/SubversionRepository.cs 2007-03-07 21:58:51 UTC (rev 17)
@@ -1,5 +1,7 @@
using System;
using System.Diagnostics;
+using System.ComponentModel;
+using System.ComponentModel.Design;
namespace CaptainHook.Engine.Services
@@ -9,24 +11,34 @@
/// This class allows making straight command line calls to
/// svn.exe, the subversion command line.
/// </summary>
- public class SubversionRepository : ISubversionRepository
+ public class SubversionRepository : Component, ISubversionRepository
{
string svnExePath;
string svnLookExePath;
- IOutputHandler output;
/// <summary>
/// Constructs an instance of this class.
/// </summary>
/// <param name="repositoryPath"></param>
- public SubversionRepository(string repositoryPath, string svnExePath, string svnLookExePath, IOutputHandler output)
+ public SubversionRepository(string repositoryPath, string svnExePath, string svnLookExePath)
{
this.repositoryPath = repositoryPath;
this.svnExePath = svnExePath;
this.svnLookExePath = svnLookExePath;
- this.output = output;
}
+ public override ISite Site
+ {
+ set
+ {
+ base.Site = value;
+
+ IServiceContainer container = (IServiceContainer)GetService(typeof(IServiceContainer));
+ container.AddService(typeof(ISubversionRepository), this);
+ }
+ }
+
+
/// <summary>
/// The path to the SVN repository.
/// </summary>
@@ -77,7 +89,7 @@
{
ProcessStartInfo startInfo = new ProcessStartInfo(command, arguments);
- this.output.WriteDebug("Attempting to run command '{0} {1}'", command, arguments);
+ Output.WriteDebug("Attempting to run command '{0} {1}'", command, arguments);
startInfo.RedirectStandardError = true;
startInfo.RedirectStandardOutput = true;
@@ -88,7 +100,7 @@
string result = process.StandardOutput.ReadToEnd();
process.WaitForExit();
- this.output.WriteDebug(result);
+ Output.WriteDebug(result);
return result;
}
@@ -101,5 +113,10 @@
string result = ExecuteCommand(svnExePath, String.Join(" ", args));
return ParseOutputIntoLines(result);
}
+
+ protected IOutputHandler Output
+ {
+ get { return GetService(typeof(IOutputHandler)) as IOutputHandler; }
+ }
}
}
Modified: branches/TRY-ChangeArchitecture/Application/CaptainHook.Engine/Services/SubversionTranslator.cs
===================================================================
--- branches/TRY-ChangeArchitecture/Application/CaptainHook.Engine/Services/SubversionTranslator.cs 2007-02-23 21:20:38 UTC (rev 16)
+++ branches/TRY-ChangeArchitecture/Application/CaptainHook.Engine/Services/SubversionTranslator.cs 2007-03-07 21:58:51 UTC (rev 17)
@@ -1,7 +1,10 @@
using System;
+using System.ComponentModel;
+using System.ComponentModel.Design;
using System.Collections.Generic;
using System.Globalization;
using System.Text.RegularExpressions;
+
using CaptainHook.Engine.RepositoryInfo;
@@ -12,19 +15,29 @@
/// Acts as a translator between the application code and
/// the Subversion command line interface.
/// </summary>
- public class SubversionTranslator : ISubversionTranslator
+ public class SubversionTranslator : Component, ISubversionTranslator
{
- ISubversionRepository repository;
static IDictionary<string, ItemStatus> changeStatuses = LoadChangeStatusCodes();
/// <summary>
/// Constructs an instance of this class.
/// </summary>
/// <param name="repository">An interface that represents raw command line calls to subversion.</param>
- public SubversionTranslator(ISubversionRepository repository)
+ public SubversionTranslator()
{
- this.repository = repository;
}
+
+ public override ISite Site
+ {
+ set
+ {
+ base.Site = value;
+
+ IServiceContainer container = (IServiceContainer)GetService(typeof(IServiceContainer));
+ container.AddService(typeof(ISubversionTranslator), this);
+ }
+ }
+
/// <summary>
/// Calls a command to get information about a specific revision
@@ -34,7 +47,7 @@
/// <returns></returns>
public IRevisionInfo GetCommitInformation(int revision)
{
- string[] output = this.repository.SvnLook("info", revision);
+ string[] output = Repository.SvnLook("info", revision);
return GetCommitInfo<IRevisionInfo>(output, revision, null);
}
@@ -46,7 +59,7 @@
/// <returns></returns>
public IRevisionInfo GetCommitInformation()
{
- string[] output = this.repository.SvnLook("info");
+ string[] output = Repository.SvnLook("info");
return GetCommitInfo<IRevisionInfo>(output, GetYoungestRevisionNumber(), null);
}
@@ -62,7 +75,7 @@
if (transaction == null)
throw new ArgumentNullException("Cannot specify a null transaction");
- string[] output = this.repository.SvnLook("info", "-t", transaction);
+ string[] output = Repository.SvnLook("info", "-t", transaction);
return GetCommitInfo<ITransactionInfo>(output, 0, transaction);
}
@@ -104,7 +117,7 @@
/// <returns></returns>
public int GetYoungestRevisionNumber()
{
- string[] result = this.repository.SvnLook("youngest");
+ string[] result = Repository.SvnLook("youngest");
if (result.Length != 1)
throw new InvalidOperationException("svnlook youngest should only return one line, the current revision number.");
@@ -118,7 +131,7 @@
/// <returns></returns>
public string[] GetChangedDirectories()
{
- return this.repository.SvnLook("dirs-changed");
+ return Repository.SvnLook("dirs-changed");
}
/// <summary>
@@ -129,7 +142,7 @@
/// <returns></returns>
public string[] GetChangedDirectories(int revision)
{
- return this.repository.SvnLook("dirs-changed", revision);
+ return Repository.SvnLook("dirs-changed", revision);
}
/// <summary>
@@ -140,7 +153,7 @@
/// <returns></returns>
public string[] GetChangedDirectories(string transaction)
{
- return this.repository.SvnLook("dirs-changed", "-t", transaction);
+ return Repository.SvnLook("dirs-changed", "-t", transaction);
}
@@ -151,7 +164,7 @@
/// <returns></returns>
public IList<IRepositoryChange> GetChanges(int revision)
{
- string[] output = this.repository.SvnLook("changed", revision);
+ string[] output = Repository.SvnLook("changed", revision);
return GetRepositoryChangeCollectionFromSvnLookOutput(output);
}
@@ -162,7 +175,7 @@
/// <returns></returns>
public IList<IRepositoryChange> GetChanges(string transaction)
{
- string[] output = this.repository.SvnLook("changed", "-t", transaction);
+ string[] output = Repository.SvnLook("changed", "-t", transaction);
return GetRepositoryChangeCollectionFromSvnLookOutput(output);
}
@@ -172,7 +185,7 @@
/// <returns></returns>
public IList<IRepositoryChange> GetChanges()
{
- string[] output = this.repository.SvnLook("changed");
+ string[] output = Repository.SvnLook("changed");
return GetRepositoryChangeCollectionFromSvnLookOutput(output);
}
@@ -224,12 +237,12 @@
if (option == GetHistoryOption.ShowId)
{
- output = this.repository.SvnLook("history", repository.RepositoryPath, path, revisionArg, "--show-ids");
+ output = Repository.SvnLook("history", Repository.RepositoryPath, path, revisionArg, "--show-ids");
return GetHistoryInfoWithIdFromOutput(output);
}
else
{
- output = this.repository.SvnLook("history", repository.RepositoryPath, path, revisionArg);
+ output = Repository.SvnLook("history", Repository.RepositoryPath, path, revisionArg);
return GetHistoryInfoFromOutput(output);
}
}
@@ -291,7 +304,7 @@
/// <returns></returns>
public IList<IDifference> GetDifferences(int revision)
{
- string[] output = this.repository.SvnLook("diff", revision, "--no-diff-deleted");
+ string[] output = Repository.SvnLook("diff", revision, "--no-diff-deleted");
return GetDifferencesFromOutput(output);
}
@@ -304,7 +317,7 @@
/// <returns></returns>
public IList<IDifference> GetDifferences(string transaction)
{
- string[] output = this.repository.SvnLook("diff", "-t", transaction, "--no-diff-deleted");
+ string[] output = Repository.SvnLook("diff", "-t", transaction, "--no-diff-deleted");
return GetDifferencesFromOutput(output);
}
@@ -316,7 +329,7 @@
/// <returns></returns>
public IList<IDifference> GetDifferences()
{
- string[] output = this.repository.SvnLook("diff", "--no-diff-deleted");
+ string[] output = Repository.SvnLook("diff", "--no-diff-deleted");
return GetDifferencesFromOutput(output);
}
@@ -358,11 +371,8 @@
/// </summary>
public ISubversionRepository Repository
{
- get
- {
- return this.repository;
- }
- }
+ get { return GetService(typeof(ISubversionRepository)) as ISubversionRepository; }
+ }
private static IDictionary<string, ItemStatus> LoadChangeStatusCodes()
{
Modified: branches/TRY-ChangeArchitecture/Application/CaptainHook.Plugins/PostCommitEmailHook.cs
===================================================================
--- branches/TRY-ChangeArchitecture/Application/CaptainHook.Plugins/PostCommitEmailHook.cs 2007-02-23 21:20:38 UTC (rev 16)
+++ branches/TRY-ChangeArchitecture/Application/CaptainHook.Plugins/PostCommitEmailHook.cs 2007-03-07 21:58:51 UTC (rev 17)
@@ -19,7 +19,7 @@
/// <param name="commitInfo"></param>
protected override bool HandleHookEvent(IRevisionInfo commitInfo)
{
- //Gather info:
+ //Gather info;
//MailAddressCollection emails = ReadEmailsFromFile();
//string[] changedDirectories = this.HostApplication.SubversionTranslator.GetChangedDirectories(commitInfo.Revision);
Modified: branches/TRY-ChangeArchitecture/Testing/CaptainHook.UnitTests/CaptainHook.UnitTests.csproj
===================================================================
--- branches/TRY-ChangeArchitecture/Testing/CaptainHook.UnitTests/CaptainHook.UnitTests.csproj 2007-02-23 21:20:38 UTC (rev 16)
+++ branches/TRY-ChangeArchitecture/Testing/CaptainHook.UnitTests/CaptainHook.UnitTests.csproj 2007-03-07 21:58:51 UTC (rev 17)
@@ -54,6 +54,7 @@
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\External\Assemblies\Rhino.Mocks.dll</HintPath>
</Reference>
+ <Reference Include="System" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Modified: branches/TRY-ChangeArchitecture/Testing/CaptainHook.UnitTests/HookHandlerApplicationTests.cs
===================================================================
--- branches/TRY-ChangeArchitecture/Testing/CaptainHook.UnitTests/HookHandlerApplicationTests.cs 2007-02-23 21:20:38 UTC (rev 16)
+++ branches/TRY-ChangeArchitecture/Testing/CaptainHook.UnitTests/HookHandlerApplicationTests.cs 2007-03-07 21:58:51 UTC (rev 17)
@@ -6,43 +6,13 @@
using CaptainHook.Engine;
using MbUnit.Framework;
+using CaptainHook.Engine.Services;
namespace CaptainHook.UnitTests
{
[TestFixture]
public class HookHandlerApplicationTests
{
- [Test]
- [Ignore("TODO: remove/reimplement test after refactoring")]
- [ExpectedArgumentNullException]
- public void ConstructorNullArgumentsThrowsException()
- {
- //IOutputHandler output = new ConsoleOutputHandler();
- //PluginLoader loader = new PluginLoader(output);
- //new ApplicationHost(null, output, loader);
- }
-
- [Test]
- [Ignore("TODO: remove/reimplement test after refactoring")]
- [ExpectedArgumentNullException]
- public void ConstructorNullOutputThrowsException()
- {
- //IOutputHandler output = new ConsoleOutputHandler();
- //PluginLoader loader = new PluginLoader(output);
- //Arguments args = new Arguments(new string[] { });
- //new ApplicationHost(args, null, loader);
- }
-
- [Test]
- [Ignore("TODO: remove/reimplement test after refactoring")]
- [ExpectedArgumentNullException]
- public void ConstructorNullPluginLoaderThrowsException()
- {
- //IOutputHandler output = new ConsoleOutputHandler();
- //Arguments args = new Arguments(new string[] {});
- //new ApplicationHost(args, output, null);
- }
-
[Test]
public void GetHookNameArgumentTypesReturnsCorrectDictionary()
{
Modified: branches/TRY-ChangeArchitecture/Testing/CaptainHook.UnitTests/SubversionTests.cs
===================================================================
--- branches/TRY-ChangeArchitecture/Testing/CaptainHook.UnitTests/SubversionTests.cs 2007-02-23 21:20:38 UTC (rev 16)
+++ branches/TRY-ChangeArchitecture/Testing/CaptainHook.UnitTests/SubversionTests.cs 2007-03-07 21:58:51 UTC (rev 17)
@@ -4,212 +4,285 @@
using Rhino.Mocks;
using CaptainHook.Engine.Services;
using CaptainHook.Engine.RepositoryInfo;
+using CaptainHook.Engine;
+using System.ComponentModel.Design;
+using System.ComponentModel;
namespace CaptainHook.UnitTests
{
[TestFixture]
public class SubversionTests
{
- [Test]
- public void CanParseSvnLookInfo()
- {
- string[] svnOut = new string[]
- {
- "sally"
- , "2003-02-22 17:44:49 -0600 (Sat, 22 Feb 2003)"
- , "15"
- , "Rearrange lunch."
- };
+ private IHookContext _Context = null;
+ private MockRepository _Mocks = null;
- MockRepository mocks = new MockRepository();
- ISubversionRepository repository = (ISubversionRepository)mocks.CreateMock(typeof(ISubversionRepository));
- SetupResult.For(repository.SvnLook("info", 1)).Return(svnOut);
- mocks.ReplayAll(); //Done setting up expectations and results
+ [SetUp]
+ public void CreateHookContextAndComponents()
+ {
+ _Mocks = new MockRepository();
- SubversionTranslator translator = new SubversionTranslator(repository);
- IRevisionInfo info = translator.GetCommitInformation(1);
- Assert.AreEqual(1, info.Revision);
- Assert.AreEqual("sally", info.Author);
- Assert.AreEqual(15, info.LogMessageSize);
- Assert.AreEqual("Rearrange lunch.", info.LogMessage);
- mocks.VerifyAll(); //Not necessary because no expectations
- }
+ _Context = new HookContext();
+ _Context.Add(new ConsoleOutputHandler(true));
+ }
- [Test]
- public void CanParseSvnLookInfoWithoutRevisionArgument()
- {
- string[] svnOut = new string[]
- {
- "sally"
- , "2003-02-22 17:44:49 -0600 (Sat, 22 Feb 2003)"
- , "21"
- , "Rearranging my lunch."
- };
+ private void ReplayAll()
+ {
+ _Mocks.ReplayAll();
+ }
- MockRepository mocks = new MockRepository();
- ISubversionRepository repository = (ISubversionRepository)mocks.CreateMock(typeof(ISubversionRepository));
- SetupResult.For(repository.SvnLook("youngest")).Return(new string[] { "1975" });
- SetupResult.For(repository.SvnLook("info")).Return(svnOut);
- mocks.ReplayAll();
+ private void VerifyAll()
+ {
+ _Mocks.VerifyAll();
+ }
- SubversionTranslator translator = new SubversionTranslator(repository);
- IRevisionInfo info = translator.GetCommitInformation();
- Assert.AreEqual(1975, info.Revision);
- Assert.AreEqual("sally", info.Author);
- Assert.AreEqual(21, info.LogMessageSize);
- Assert.AreEqual("Rearranging my lunch.", info.LogMessage);
- }
+ private T CreateMockedComponent<T>() where T : IComponent
+ {
+ T component = _Mocks.CreateMock<T>();
- [Test]
- public void CanParseSvnLookYoungest()
- {
- string[] svnOut = new string[]
- {
- "1975"
- };
+ Expect.Call(component.Site).Return(null);
- MockRepository mocks = new MockRepository();
- ISubversionRepository repository = (ISubversionRepository)mocks.CreateMock(typeof(ISubversionRepository));
- SetupResult.For(repository.SvnLook("youngest")).Return(svnOut);
- mocks.ReplayAll();
+ component.Site = null;
+ LastCall.IgnoreArguments().Do((Action<ISite>) delegate(ISite site)
+ {
+ IServiceContainer serviceContainer = (IServiceContainer) site.GetService(typeof(IServiceContainer));
+ serviceContainer.AddService(typeof(T), component);
+ });
- SubversionTranslator translator = new SubversionTranslator(repository);
- int revision = translator.GetYoungestRevisionNumber();
- Assert.AreEqual(1975, revision);
- }
+ return component;
+ }
- [Test]
- public void CanParseSvnLookChange()
- {
- string[] svnOut = new string[]
- {
- "U trunk/SubtextSolution/Subtext.Web/Web.config"
- ,"U trunk/SubtextSolution/Subtext.Web.Controls/AssemblyInfo.cs"
- ,"D trunk/SubtextSolution/Subtext.Web.Controls/BadFile.cs"
- ,"A trunk/SubtextSolution/Subtext.Web.Controls/GoodFile.cs"
- ,"_U trunk/SubtextSolution/Subtext.Web.Controls/PropChange.resx"
- ,"UU trunk/SubtextSolution/Subtext.Web.Controls/PropContentChange.resx"
- };
+ [Test]
+ public void CanParseSvnLookInfo()
+ {
+ string[] svnOut = new string[]
+ {
+ "sally"
+ , "2003-02-22 17:44:49 -0600 (Sat, 22 Feb 2003)"
+ , "15"
+ , "Rearrange lunch."
+ };
- MockRepository mocks = new MockRepository();
- ISubversionRepository repository = (ISubversionRepository)mocks.CreateMock(typeof(ISubversionRepository));
- SetupResult.For(repository.SvnLook("changed")).Return(svnOut);
- mocks.ReplayAll();
+ ISubversionRepository repository = CreateMockedComponent<ISubversionRepository>();
+ SetupResult.For(repository.SvnLook("info", 1)).Return(svnOut);
- SubversionTranslator translator = new SubversionTranslator(repository);
- IList<IRepositoryChange> changes = translator.GetChanges();
- Assert.AreEqual(6, changes.Count);
- Assert.AreEqual(ItemStatus.FileContentsChanged, changes[0].Status);
- Assert.AreEqual(ItemStatus.FileContentsChanged, changes[1].Status);
- Assert.AreEqual(ItemStatus.ItemDeletedFromRepository, changes[2].Status);
- Assert.AreEqual(ItemStatus.ItemAddedToRepository, changes[3].Status);
- Assert.AreEqual(ItemStatus.PropertiesOfItemChanged, changes[4].Status);
- Assert.AreEqual(ItemStatus.FileContentsAndPropertiesChanged, changes[5].Status);
+ ReplayAll();
- Assert.AreEqual("trunk/SubtextSolution/Subtext.Web/Web.config", changes[0].ItemPath);
- Assert.AreEqual("trunk/SubtextSolution/Subtext.Web.Controls/AssemblyInfo.cs", changes[1].ItemPath);
- Assert.AreEqual("trunk/SubtextSolution/Subtext.Web.Controls/BadFile.cs", changes[2].ItemPath);
- Assert.AreEqual("trunk/SubtextSolution/Subtext.Web.Controls/GoodFile.cs", changes[3].ItemPath);
- Assert.AreEqual("trunk/SubtextSolution/Subtext.Web.Controls/PropChange.resx", changes[4].ItemPath);
- Assert.AreEqual("trunk/SubtextSolution/Subtext.Web.Controls/PropContentChange.resx", changes[5].ItemPath);
- }
+ SubversionTranslator translator = new SubversionTranslator();
+ _Context.Add(repository);
+ _Context.Add(translator);
- [Test]
- public void CanParseSvnDiff()
- {
- string[] svnOut = new string[]
- {
- "Added: trunk/vendors/deli/soda.txt"
- ,"=============================================================================="
- ,""
- ,"Modified: trunk/vendors/deli/sandwich.txt"
- ,"=============================================================================="
- ,"--- trunk/vendors/deli/sandwich.txt (original)"
- ,"+++ trunk/vendors/deli/sandwich.txt 2003-02-22 17:45:04.000000000 -0600"
- ,"@@ -0,0 +1 @@"
- ,"+Don't forget the mayo!"
- ,""
- ,"Modified: trunk/vendors/deli/file.css"
- ,"=============================================================================="
- ,"body {"
- ,"- color: white;"
- ,"+ color: blue;"
- ,""
- ," background-color: green;"
- ,""
- ,"Modified: trunk/vendors/deli/logo.jpg"
- ,"=============================================================================="
- ,"(Binary files differ)"
- ,""
- ,"Deleted: trunk/vendors/deli/chips.txt"
- ,"=============================================================================="
- ,""
- ,"Deleted: trunk/vendors/deli/pickle.txt"
- ,"=============================================================================="
- };
+ IRevisionInfo info = translator.GetCommitInformation(1);
+ Assert.AreEqual(1, info.Revision);
+ Assert.AreEqual("sally", info.Author);
+ Assert.AreEqual(15, info.LogMessageSize);
+ Assert.AreEqual("Rearrange lunch.", info.LogMessage);
- MockRepository mocks = new MockRepository();
- ISubversionRepository repository = (ISubversionRepository)mocks.CreateMock(typeof(ISubversionRepository));
- SetupResult.For(repository.SvnLook("diff")).Return(svnOut).IgnoreArguments();
- mocks.ReplayAll();
+ VerifyAll();
+ }
- SubversionTranslator translator = new SubversionTranslator(repository);
- IList<IDifference> changes = translator.GetDifferences();
- Assert.AreEqual(6, changes.Count);
-
- Assert.AreEqual(string.Empty, changes[0].DifferenceText);
- Assert.AreEqual("--- trunk/vendors/deli/sandwich.txt (original)" + Environment.NewLine + "+++ trunk/vendors/deli/sandwich.txt 2003-02-22 17:45:04.000000000 -0600" + Environment.NewLine + "@@ -0,0 +1 @@" + Environment.NewLine + "+Don't forget the mayo!", changes[1].DifferenceText);
- Assert.AreEqual("(Binary files differ)", changes[3].DifferenceText);
- Assert.AreEqual(string.Empty, changes[4].DifferenceText);
- Assert.AreEqual(string.Empty, changes[5].DifferenceText);
-
- Assert.AreEqual("Added", changes[0].ChangeType);
- Assert.AreEqual("Modified", changes[1].ChangeType);
- Assert.AreEqual("Modified", changes[2].ChangeType);
- Assert.AreEqual("Modified", changes[3].ChangeType);
- Assert.AreEqual("Deleted", changes[4].ChangeType);
- Assert.AreEqual("Deleted", changes[5].ChangeType);
+ [Test]
+ public void CanParseSvnLookInfoWithoutRevisionArgument()
+ {
+ string[] svnOut = new string[]
+ {
+ "sally"
+ , "2003-02-22 17:44:49 -0600 (Sat, 22 Feb 2003)"
+ , "21"
+ , "Rearranging my lunch."
+ };
- Assert.AreEqual("trunk/vendors/deli/soda.txt", changes[0].ItemPath);
- Assert.AreEqual("trunk/vendors/deli/sandwich.txt", changes[1].ItemPath);
- Assert.AreEqual("trunk/vendors/deli/file.css", changes[2].ItemPath);
- Assert.AreEqual("trunk/vendors/deli/logo.jpg", changes[3].ItemPath);
- Assert.AreEqual("trunk/vendors/deli/chips.txt", changes[4].ItemPath);
- Assert.AreEqual("trunk/vendors/deli/pickle.txt", changes[5].ItemPath);
- }
+ ISubversionRepository repository = CreateMockedComponent<ISubversionRepository>();
- [Test]
- public void CanParseSvnDiffEndingWithDiffContent()
- {
- string[] svnOut = new string[]
- {
- "Modified: trunk/vendors/deli/sandwich.txt"
- ,"=============================================================================="
- ,"--- trunk/vendors/deli/sandwich.txt (original)"
- ,"+++ trunk/vendors/deli/sandwich.txt 2003-02-22 17:45:04.000000000 -0600"
- ,"@@ -0,0 +1 @@"
- ,"+Don't forget the mayo!"
- };
+ SetupResult.For(repository.SvnLook("youngest")).Return(new string[] { "1975" });
+ SetupResult.For(repository.SvnLook("info")).Return(svnOut);
+
+ ReplayAll();
- MockRepository mocks = new MockRepository();
- ISubversionRepository repository = (ISubversionRepository)mocks.CreateMock(typeof(ISubversionRepository));
- SetupResult.For(repository.SvnLook("diff")).Return(svnOut).IgnoreArguments();
- mocks.ReplayAll();
+ SubversionTranslator translator = new SubversionTranslator();
+ _Context.Add(repository);
+ _Context.Add(translator);
- SubversionTranslator translator = new SubversionTranslator(repository);
- IList<IDifference> changes = translator.GetDifferences();
- Assert.AreEqual(1, changes.Count);
+ IRevisionInfo info = translator.GetCommitInformation();
+
+ Assert.AreEqual(1975, info.Revision);
+ Assert.AreEqual("sally", info.Author);
+ Assert.AreEqual(21, info.LogMessageSize);
+ Assert.AreEqual("Rearranging my lunch.", info.LogMessage);
- Assert.AreEqual("--- trunk/vendors/deli/sandwich.txt (original)" + Environment.NewLine + "+++ trunk/vendors/deli/sandwich.txt 2003-02-22 17:45:04.000000000 -0600" + Environment.NewLine + "@@ -0,0 +1 @@" + Environment.NewLine + "+Don't forget the mayo!", changes[0].DifferenceText);
- Assert.AreEqual("Modified", changes[0].ChangeType);
- Assert.AreEqual("trunk/vendors/deli/sandwich.txt", changes[0].ItemPath);
- }
+ VerifyAll();
+ }
[Test]
+ public void CanParseSvnLookYoungest()
+ {
+ string[] svnOut = new string[]
+ {
+ "1975"
+ };
+
+ ISubversionRepository repository = CreateMockedComponent<ISubversionRepository>();
+ SetupResult.For(repository.SvnLook("youngest")).Return(svnOut);
+
+ ReplayAll();
+
+ SubversionTranslator translator = new SubversionTranslator();
+ _Context.Add(repository);
+ _Context.Add(translator);
+
+ int revision = translator.GetYoungestRevisionNumber();
+ Assert.AreEqual(1975, revision);
+
+ VerifyAll();
+ }
+
+ [Test]
+ public void CanParseSvnLookChange()
+ {
+ string[] svnOut = new string[]
+ {
+ "U trunk/SubtextSolution/Subtext.Web/Web.config"
+ ,"U trunk/SubtextSolution/Subtext.Web.Controls/AssemblyInfo.cs"
+ ,"D trunk/SubtextSolution/Subtext.Web.Controls/BadFile.cs"
+ ,"A trunk/SubtextSolution/Subtext.Web.Controls/GoodFile.cs"
+ ,"_U trunk/SubtextSolution/Subtext.Web.Controls/PropChange.resx"
+ ,"UU trunk/SubtextSolution/Subtext.Web.Controls/PropContentChange.resx"
+ };
+
+ ISubversionRepository repository = CreateMockedComponent<ISubversionRepository>();
+ SetupResult.For(repository.SvnLook("changed")).Return(svnOut);
+
+ ReplayAll();
+
+ SubversionTranslator translator = new SubversionTranslator();
+ _Context.Add(repository);
+ _Context.Add(translator);
+
+ IList<IRepositoryChange> changes = translator.GetChanges();
+ Assert.AreEqual(6, changes.Count);
+ Assert.AreEqual(ItemStatus.FileContentsChanged, changes[0].Status);
+ Assert.AreEqual(ItemStatus.FileContentsChanged, changes[1].Status);
+ Assert.AreEqual(ItemStatus.ItemDeletedFromRepository, changes[2].Status);
+ Assert.AreEqual(ItemStatus.ItemAddedToRepository, changes[3].Status);
+ Assert.AreEqual(ItemStatus.PropertiesOfItemChanged, changes[4].Status);
+ Assert.AreEqual(ItemStatus.FileContentsAndPropertiesChanged, changes[5].Status);
+
+ Assert.AreEqual("trunk/SubtextSolution/Subtext.Web/Web.config", changes[0].ItemPath);
+ Assert.AreEqual("trunk/SubtextSolution/Subtext.Web.Controls/AssemblyInfo.cs", changes[1].ItemPath);
+ Assert.AreEqual("trunk/SubtextSolution/Subtext.Web.Controls/BadFile.cs", changes[2].ItemPath);
+ Assert.AreEqual("trunk/SubtextSolution/Subtext.Web.Controls/GoodFile.cs", changes[3].ItemPath);
+ Assert.AreEqual("trunk/SubtextSolution/Subtext.Web.Controls/PropChange.resx", changes[4].ItemPath);
+ Assert.AreEqual("trunk/SubtextSolution/Subtext.Web.Controls/PropContentChange.resx", changes[5].ItemPath);
+
+ VerifyAll();
+ }
+
+ [Test]
+ public void CanParseSvnDiff()
+ {
+ string[] svnOut = new string[]
+ {
+ "Added: trunk/vendors/deli/soda.txt"
+ ,"=============================================================================="
+ ,""
+ ,"Modified: trunk/vendors/deli/sandwich.txt"
+ ,"=============================================================================="
+ ,"--- trunk/vendors/deli/sandwich.txt (original)"
+ ,"+++ trunk/vendors/deli/sandwich.txt 2003-02-22 17:45:04.000000000 -0600"
+ ,"@@ -0,0 +1 @@"
+ ,"+Don't forget the mayo!"
+ ,""
+ ,"Modified: trunk/vendors/deli/file.css"
+ ,"=============================================================================="
+ ,"body {"
+ ,"- color: white;"
+ ,"+ color: blue;"
+ ,""
+ ," background-color: green;"
+ ,""
+ ,"Modified: trunk/vendors/deli/logo.jpg"
+ ,"=============================================================================="
+ ,"(Binary files differ)"
+ ,""
+ ,"Deleted: trunk/vendors/deli/chips.txt"
+ ,"=============================================================================="
+ ,""
+ ,"Deleted: trunk/vendors/deli/pickle.txt"
+ ,"=============================================================================="
+ };
+
+
+ ISubversionRepository repository = CreateMockedComponent<ISubversionRepository>();
+ SetupResult.For(repository.SvnLook("diff")).Return(svnOut).IgnoreArguments();
+
+ ReplayAll();
+
+ SubversionTranslator translator = new SubversionTranslator();
+ _Context.Add(repository);
+ _Context.Add(translator);
+
+ IList<IDifference> changes = translator.GetDifferences();
+ Assert.AreEqual(6, changes.Count);
+
+ Assert.AreEqual(string.Empty, changes[0].DifferenceText);
+ Assert.AreEqual("--- trunk/vendors/deli/sandwich.txt (original)" + Environment.NewLine + "+++ trunk/vendors/deli/sandwich.txt 2003-02-22 17:45:04.000000000 -0600" + Environment.NewLine + "@@ -0,0 +1 @@" + Environment.NewLine + "+Don't forget the mayo!", changes[1].DifferenceText);
+ Assert.AreEqual("(Binary files differ)", changes[3].DifferenceText);
+ Assert.AreEqual(string.Empty, changes[4].DifferenceText);
+ Assert.AreEqual(string.Empty, changes[5].DifferenceText);
+
+ Assert.AreEqual("Added", changes[0].ChangeType);
+ Assert.AreEqual("Modified", changes[1].ChangeType);
+ Assert.AreEqual("Modified", changes[2].ChangeType);
+ Assert.AreEqual("Modified", changes[3].ChangeType);
+ Assert.AreEqual("Deleted", changes[4].ChangeType);
+ Assert.AreEqual("Deleted", changes[5].ChangeType);
+
+ Assert.AreEqual("trunk/vendors/deli/soda.txt", changes[0].ItemPath);
+ Assert.AreEqual("trunk/vendors/deli/sandwich.txt", changes[1].ItemPath);
+ Assert.AreEqual("trunk/vendors/deli/file.css", changes[2].ItemPath);
+ Assert.AreEqual("trunk/vendors/deli/logo.jpg", changes[3].ItemPath);
+ Assert.AreEqual("trunk/vendors/deli/chips.txt", changes[4].ItemPath);
+ Assert.AreEqual("trunk/vendors/deli/pickle.txt", changes[5].ItemPath);
+
+ VerifyAll();
+ }
+
+ [Test]
+ public void CanParseSvnDiffEndingWithDiffContent()
+ {
+ string[] svnOut = new string[]
+ {
+ "Modified: trunk/vendors/deli/sandwich.txt"
+ ,"=============================================================================="
+ ,"--- trunk/vendors/deli/sandwich.txt (original)"
+ ,"+++ trunk/vendors/deli/sandwich.txt 2003-02-22 17:45:04.000000000 -0600"
+ ,"@@ -0,0 +1 @@"
+ ,"+Don't forget the mayo!"
+ };
+
+ ISubversionRepository repository = CreateMockedComponent<ISubversionRepository>();
+ SetupResult.For(repository.SvnLook("diff")).Return(svnOut).IgnoreArguments();
+
+ ReplayAll();
+
+ SubversionTranslator translator = new SubversionTranslator();
+ _Context.Add(repository);
+ _Context.Add(translator);
+
+ IList<IDifference> changes = translator.GetDifferences();
+ Assert.AreEqual(1, changes.Count);
+
+ Assert.AreEqual("--- trunk/vendors/deli/sandwich.txt (original)" + Environment.NewLine + "+++ trunk/vendors/deli/sandwich.txt 2003-02-22 17:45:04.000000000 -0600" + Environment.NewLine + "@@ -0,0 +1 @@" + Environment.NewLine + "+Don't forget the mayo!", changes[0].DifferenceText);
+ Assert.AreEqual("Modified", changes[0].ChangeType);
+ Assert.AreEqual("trunk/vendors/deli/sandwich.txt", changes[0].ItemPath);
+
+ VerifyAll();
+ }
+
+ [Test]
public void CanParseSvnHistory()
{
string[] svnOut = new string[]
- {
+ {
"REVISION PATH <ID>"
,"-------- ---------"
," 19 /tags/1.0"
@@ -226,27 +299,32 @@
," 4 /trunk"
," 2 /trunk"
," 1 /trunk"
- };
+ };
- MockRepository mocks = new MockRepository();
- ISubversionRepository repository = (ISubversionRepository)mocks.CreateMock(typeof(ISubversionRepository));
+ ...
[truncated message content] |
|
From: <jor...@us...> - 2007-02-23 21:20:46
|
Revision: 16
http://svn.sourceforge.net/captainhook/?rev=16&view=rev
Author: jordan-terrell
Date: 2007-02-23 13:20:38 -0800 (Fri, 23 Feb 2007)
Log Message:
-----------
Laying out logical architecture
(non-functional revision)
Modified Paths:
--------------
branches/TRY-ChangeArchitecture/Application/CaptainHook/CaptainHook.csproj
branches/TRY-ChangeArchitecture/Application/CaptainHook/CommandLine/Arguments.cs
branches/TRY-ChangeArchitecture/Application/CaptainHook/CommandLine/CommandLineSwitchAttribute.cs
branches/TRY-ChangeArchitecture/Application/CaptainHook/CommandLine/Parser.cs
branches/TRY-ChangeArchitecture/Application/CaptainHook/Program.cs
branches/TRY-ChangeArchitecture/Application/CaptainHook.Plugins/CaptainHook.Plugins.csproj
branches/TRY-ChangeArchitecture/Application/CaptainHook.Plugins/PostCommitEmailHook.cs
branches/TRY-ChangeArchitecture/Application/CaptainHook.Plugins/RequireLogMessageHook.cs
branches/TRY-ChangeArchitecture/CaptainHook.sln
branches/TRY-ChangeArchitecture/Testing/CaptainHook.UnitTests/ArgumentsTests.cs
branches/TRY-ChangeArchitecture/Testing/CaptainHook.UnitTests/CaptainHook.UnitTests.csproj
branches/TRY-ChangeArchitecture/Testing/CaptainHook.UnitTests/HookHandlerApplicationTests.cs
branches/TRY-ChangeArchitecture/Testing/CaptainHook.UnitTests/SubversionTests.cs
branches/TRY-ChangeArchitecture/master.build
Added Paths:
-----------
branches/TRY-ChangeArchitecture/Application/CaptainHook.Engine/
branches/TRY-ChangeArchitecture/Application/CaptainHook.Engine/ApplicationHost.cs
branches/TRY-ChangeArchitecture/Application/CaptainHook.Engine/CaptainHook.Engine.csproj
branches/TRY-ChangeArchitecture/Application/CaptainHook.Engine/HookContext.cs
branches/TRY-ChangeArchitecture/Application/CaptainHook.Engine/HookNameAttribute.cs
branches/TRY-ChangeArchitecture/Application/CaptainHook.Engine/PluginLoader.cs
branches/TRY-ChangeArchitecture/Application/CaptainHook.Engine/PostCommitHook.cs
branches/TRY-ChangeArchitecture/Application/CaptainHook.Engine/PostRevisionPropertyChangeHook.cs
branches/TRY-ChangeArchitecture/Application/CaptainHook.Engine/PreCommitHook.cs
branches/TRY-ChangeArchitecture/Application/CaptainHook.Engine/PreRevisionPropertyChangeHook.cs
branches/TRY-ChangeArchitecture/Application/CaptainHook.Engine/Properties/
branches/TRY-ChangeArchitecture/Application/CaptainHook.Engine/Properties/AssemblyInfo.cs
branches/TRY-ChangeArchitecture/Application/CaptainHook.Engine/RepositoryInfo/
branches/TRY-ChangeArchitecture/Application/CaptainHook.Engine/RepositoryInfo/CommitInfo.cs
branches/TRY-ChangeArchitecture/Application/CaptainHook.Engine/RepositoryInfo/Difference.cs
branches/TRY-ChangeArchitecture/Application/CaptainHook.Engine/RepositoryInfo/HistoryInfo.cs
branches/TRY-ChangeArchitecture/Application/CaptainHook.Engine/RepositoryInfo/ICommitInfo.cs
branches/TRY-ChangeArchitecture/Application/CaptainHook.Engine/RepositoryInfo/IDifference.cs
branches/TRY-ChangeArchitecture/Application/CaptainHook.Engine/RepositoryInfo/IHistoryInfo.cs
branches/TRY-ChangeArchitecture/Application/CaptainHook.Engine/RepositoryInfo/IPropertyChangeInfo.cs
branches/TRY-ChangeArchitecture/Application/CaptainHook.Engine/RepositoryInfo/IRepositoryChange.cs
branches/TRY-ChangeArchitecture/Application/CaptainHook.Engine/RepositoryInfo/IRevisionInfo.cs
branches/TRY-ChangeArchitecture/Application/CaptainHook.Engine/RepositoryInfo/ITransactionInfo.cs
branches/TRY-ChangeArchitecture/Application/CaptainHook.Engine/RepositoryInfo/PropertyChangeInfo.cs
branches/TRY-ChangeArchitecture/Application/CaptainHook.Engine/RepositoryInfo/RepositoryChange.cs
branches/TRY-ChangeArchitecture/Application/CaptainHook.Engine/RepositoryInfo/RevisionInfo.cs
branches/TRY-ChangeArchitecture/Application/CaptainHook.Engine/RepositoryInfo/TransactionInfo.cs
branches/TRY-ChangeArchitecture/Application/CaptainHook.Engine/Services/
branches/TRY-ChangeArchitecture/Application/CaptainHook.Engine/Services/ConsoleOutputHandler.cs
branches/TRY-ChangeArchitecture/Application/CaptainHook.Engine/Services/IHookContext.cs
branches/TRY-ChangeArchitecture/Application/CaptainHook.Engine/Services/IOutputHandler.cs
branches/TRY-ChangeArchitecture/Application/CaptainHook.Engine/Services/IPluginLoader.cs
branches/TRY-ChangeArchitecture/Application/CaptainHook.Engine/Services/ISubversionRepository.cs
branches/TRY-ChangeArchitecture/Application/CaptainHook.Engine/Services/ISubversionTranslator.cs
branches/TRY-ChangeArchitecture/Application/CaptainHook.Engine/Services/SubversionRepository.cs
branches/TRY-ChangeArchitecture/Application/CaptainHook.Engine/Services/SubversionTranslator.cs
branches/TRY-ChangeArchitecture/Application/CaptainHook.Engine/StartCommitHook.cs
branches/TRY-ChangeArchitecture/Application/CaptainHook.Engine/SubversionHook.cs
Removed Paths:
-------------
branches/TRY-ChangeArchitecture/Application/CaptainHook/ApplicationHost.cs
branches/TRY-ChangeArchitecture/Application/CaptainHook/OutputHandler.cs
branches/TRY-ChangeArchitecture/Application/CaptainHook/PluginLoader.cs
branches/TRY-ChangeArchitecture/Application/CaptainHook.Interfaces/
branches/TRY-ChangeArchitecture/Application/CaptainHook.SubversionWrapper/
Deleted: branches/TRY-ChangeArchitecture/Application/CaptainHook/ApplicationHost.cs
===================================================================
--- branches/TRY-ChangeArchitecture/Application/CaptainHook/ApplicationHost.cs 2007-02-23 20:43:28 UTC (rev 15)
+++ branches/TRY-ChangeArchitecture/Application/CaptainHook/ApplicationHost.cs 2007-02-23 21:20:38 UTC (rev 16)
@@ -1,229 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Configuration;
-using System.Net;
-using System.Net.Mail;
-using System.Text;
-using CaptainHook.CommandLine;
-using CaptainHook.Subversion;
-using CaptainHook.Subversion.Hook;
-
-namespace CaptainHook
-{
- public class ApplicationHost : IApplicationHost
- {
- Arguments arguments;
- PluginLoader pluginLoader;
-
- /// <summary>
- /// Constructor. Reads in the arguments.
- /// </summary>
- /// <param name="args"></param>
- public ApplicationHost(Arguments args, IOutputHandler output, PluginLoader pluginLoader)
- {
- if (output == null)
- throw new ArgumentNullException("output", "OutputMessageHandler should not be null");
-
- if (pluginLoader == null)
- throw new ArgumentNullException("pluginLoader", "Without the plugin loader, how will we handle the hooks?");
-
- if (args == null)
- throw new ArgumentNullException("args", "Cannot instantiate with null arguments.");
-
- this.output = output;
- this.arguments = args;
-
- this.pluginLoader = pluginLoader;
- this.subversionApp = new SubversionTranslator(new SubversionRepository(this.Repository, args.SvnExePath, args.SvnLookExePath, output));
- }
-
- /// <summary>
- /// The path to the Subversion repository.
- /// </summary>
- public string Repository
- {
- get { return this.arguments.Repository; }
- }
-
- /// <summary>
- /// Handles the hook event and returns whether or not
- /// Subversion should continue with the transaction.
- /// </summary>
- /// <remarks>
- /// If any hook votes to stop the transaction, the transaction will not
- /// continue, though the other hooks will have a chance to run.
- /// </remarks>
- /// <returns></returns>
- public bool HandleHookEvent()
- {
- bool continueTransaction = true;
- ICollection<SubversionHook> hooks = pluginLoader.LoadPlugins(this.arguments.HookType);
- foreach(SubversionHook hook in hooks)
- {
- try
- {
- hook.Initialize(this);
-
- if (!hook.HandleHook(PrepareCommitInfo(this.arguments)))
- {
- output.Write(string.Format("The hook '{0}' votes to not continue the transaction.", hook.GetType().Name));
- continueTransaction = false;
- }
-
- }
- catch(Exception e)
- {
- output.WriteError("Error occurred while executing the hook {0}", e, hook.GetType().FullName);
- }
- }
-
- output.Write("Continuing Transaction?: " + continueTransaction);
-
- return continueTransaction;
- }
-
- ICommitInfo PrepareCommitInfo(Arguments args)
- {
- if (!String.IsNullOrEmpty(args.TransactionName))
- return this.SubversionApplication.GetCommitInformation(args.TransactionName);
-
- if (!String.IsNullOrEmpty(args.PropertyName) && !String.IsNullOrEmpty(args.UserName))
- {
- ICommitInfo commitInfo = this.SubversionApplication.GetCommitInformation(args.Revision);
- return new PropertyChangeInfo(args.PropertyName, args.UserName, commitInfo.Author, commitInfo.DateStamp, commitInfo.LogMessageSize, commitInfo.LogMessage);
- }
-
- if (!String.IsNullOrEmpty(args.UserName))
- {
- return new PropertyChangeInfo(null, args.UserName, null, DateTime.MinValue, 0, null);
- }
- else
- {
- return this.SubversionApplication.GetCommitInformation(args.Revision);
- }
- }
-
- /// <summary>
- /// Sends an email.
- /// </summary>
- /// <param name="from"></param>
- /// <param name="to"></param>
- /// <param name="ccEmails"></param>
- /// <param name="bccEmails"></param>
- /// <param name="subject"></param>
- /// <param name="body"></param>
- public void SendEmail(MailAddress from, MailAddressCollection to, MailAddressCollection ccEmails, MailAddressCollection bccEmails, string subject, string body)
- {
- if (from == null)
- throw new ArgumentNullException("A FROM: address is required.");
-
- if(to == null)
- throw new ArgumentNullException("At least one TO: address is required.");
-
- if(to.Count == 0)
- throw new ArgumentOutOfRangeException("At least one TO: address is required.");
-
- SmtpClient smtp = new SmtpClient();
- smtp.Host = SmtpServerHost;
- smtp.Port = SmtpServerPort;
-
- if(!String.IsNullOrEmpty(SmtpServerUser))
- {
- output.Write("Setting credentials - UserName: " + this.SmtpServerUser);
- NetworkCredential basicAuthCredential = new NetworkCredential(this.SmtpServerUser, this.SmtpServerPassword);
- smtp.UseDefaultCredentials = false;
- smtp.Credentials = basicAuthCredential;
- }
-
- MailMessage message = new MailMessage();
- output.Write("From: {0}", from.ToString());
- message.From = from;
- AddRange(message.To, to);
- AddRange(message.CC, ccEmails);
- AddRange(message.Bcc, bccEmails);
- message.Subject = subject;
- message.Body = body;
- message.BodyEncoding = Encoding.UTF8;
-
- output.Write("Sending Email via Host '{0}:{1}", smtp.Host, smtp.Port);
- try
- {
- smtp.Send(message);
- }
- catch(SmtpException e)
- {
- output.WriteError("Error while sending email", e);
- }
- }
-
- void AddRange(MailAddressCollection destination, MailAddressCollection toBeAdded)
- {
- if (destination == null)
- throw new ArgumentNullException("destination", "Cannot add emails to a null MailAddressCollection.");
- if(toBeAdded == null)
- return;
- foreach (MailAddress toAddress in toBeAdded)
- {
- destination.Add(toAddress);
- }
- }
-
- private string SmtpServerHost
- {
- get
- {
- return ConfigurationManager.AppSettings["SmtpServerHost"];
- }
- }
-
- private int SmtpServerPort
- {
- get
- {
- if (String.IsNullOrEmpty(ConfigurationManager.AppSettings["SmtpServerPort"]))
- return 25;
- return int.Parse(ConfigurationManager.AppSettings["SmtpServerPort"]);
- }
- }
-
- private string SmtpServerUser
- {
- get
- {
- return ConfigurationManager.AppSettings["SmtpServerUser"];
- }
- }
-
- private string SmtpServerPassword
- {
- get
- {
- return ConfigurationManager.AppSettings["SmtpServerPassword"];
- }
- }
-
- public ISubversionTranslator SubversionApplication
- {
- get
- {
- return this.subversionApp;
- }
- }
-
- ISubversionTranslator subversionApp;
-
- /// <summary>
- /// Used to write output. Probably to the Console, but
- /// you never know.
- /// </summary>
- public IOutputHandler Output
- {
- get
- {
- return output;
- }
- }
-
- IOutputHandler output;
- }
-}
Modified: branches/TRY-ChangeArchitecture/Application/CaptainHook/CaptainHook.csproj
===================================================================
--- branches/TRY-ChangeArchitecture/Application/CaptainHook/CaptainHook.csproj 2007-02-23 20:43:28 UTC (rev 15)
+++ branches/TRY-ChangeArchitecture/Application/CaptainHook/CaptainHook.csproj 2007-02-23 21:20:38 UTC (rev 16)
@@ -40,9 +40,6 @@
<Compile Include="CommandLine\Arguments.cs" />
<Compile Include="CommandLine\CommandLineSwitchAttribute.cs" />
<Compile Include="CommandLine\Parser.cs" />
- <Compile Include="ApplicationHost.cs" />
- <Compile Include="OutputHandler.cs" />
- <Compile Include="PluginLoader.cs" />
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Settings.cs" />
@@ -56,14 +53,10 @@
<None Include="SampleBatchFiles\post-commit.bat" />
</ItemGroup>
<ItemGroup>
- <ProjectReference Include="..\CaptainHook.Interfaces\CaptainHook.Interfaces.csproj">
- <Project>{4CE44566-B3FD-4D6F-8C90-3323C78A3405}</Project>
- <Name>CaptainHook.Interfaces</Name>
+ <ProjectReference Include="..\CaptainHook.Engine\CaptainHook.Engine.csproj">
+ <Project>{0717F186-701E-47AE-B7D9-B577D2657386}</Project>
+ <Name>CaptainHook.Engine</Name>
</ProjectReference>
- <ProjectReference Include="..\CaptainHook.SubversionWrapper\CaptainHook.SubversionWrapper.csproj">
- <Project>{2A3379EC-DFDB-456E-95EB-DE84997D52D0}</Project>
- <Name>CaptainHook.SubversionWrapper</Name>
- </ProjectReference>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Resources\Usage.txt" />
Modified: branches/TRY-ChangeArchitecture/Application/CaptainHook/CommandLine/Arguments.cs
===================================================================
--- branches/TRY-ChangeArchitecture/Application/CaptainHook/CommandLine/Arguments.cs 2007-02-23 20:43:28 UTC (rev 15)
+++ branches/TRY-ChangeArchitecture/Application/CaptainHook/CommandLine/Arguments.cs 2007-02-23 21:20:38 UTC (rev 16)
@@ -5,8 +5,7 @@
using System.IO;
using System.Reflection;
using System.Text;
-using RJH.CommandLineHelper;
-using CaptainHook.Subversion.Hook;
+using CaptainHook.Engine;
namespace CaptainHook.CommandLine
{
@@ -270,6 +269,7 @@
errorMessages.Add(string.Format(message, args));
}
+ // TODO: Move usage into program.cs
/// <summary>
/// Prints out the usage for this applicaiton.
/// </summary>
Modified: branches/TRY-ChangeArchitecture/Application/CaptainHook/CommandLine/CommandLineSwitchAttribute.cs
===================================================================
--- branches/TRY-ChangeArchitecture/Application/CaptainHook/CommandLine/CommandLineSwitchAttribute.cs 2007-02-23 20:43:28 UTC (rev 15)
+++ branches/TRY-ChangeArchitecture/Application/CaptainHook/CommandLine/CommandLineSwitchAttribute.cs 2007-02-23 21:20:38 UTC (rev 16)
@@ -14,7 +14,7 @@
using System;
-namespace RJH.CommandLineHelper
+namespace CaptainHook.CommandLine
{
/// <summary>Implements a basic command-line switch by taking the
/// switching name and the associated description.</summary>
Modified: branches/TRY-ChangeArchitecture/Application/CaptainHook/CommandLine/Parser.cs
===================================================================
--- branches/TRY-ChangeArchitecture/Application/CaptainHook/CommandLine/Parser.cs 2007-02-23 20:43:28 UTC (rev 15)
+++ branches/TRY-ChangeArchitecture/Application/CaptainHook/CommandLine/Parser.cs 2007-02-23 21:20:38 UTC (rev 16)
@@ -15,7 +15,7 @@
using System;
using System.Text.RegularExpressions;
-namespace RJH.CommandLineHelper
+namespace CaptainHook.CommandLine
{
/// <summary>Implementation of a command-line parsing class. Is capable of
/// having switches registered with it directly or can examine a registered
Deleted: branches/TRY-ChangeArchitecture/Application/CaptainHook/OutputHandler.cs
===================================================================
--- branches/TRY-ChangeArchitecture/Application/CaptainHook/OutputHandler.cs 2007-02-23 20:43:28 UTC (rev 15)
+++ branches/TRY-ChangeArchitecture/Application/CaptainHook/OutputHandler.cs 2007-02-23 21:20:38 UTC (rev 16)
@@ -1,119 +0,0 @@
-using System;
-
-namespace CaptainHook
-{
- /// <summary>
- /// Class used to encapsulate output messages. In this case,
- /// it just writes them to the Console.
- /// </summary>
- public class OutputHandler : IOutputHandler
- {
- public OutputHandler()
- {
- }
-
- public bool Debug
- {
- get { return this.debug; }
- set { this.debug = value; }
- }
-
- bool debug;
-
- public virtual void Write()
- {
- Console.WriteLine();
- }
-
- public void Write(string format)
- {
- Console.WriteLine(format);
- }
-
- public virtual void Write(string format, params object[] parameters)
- {
- Console.WriteLine(format, parameters);
- }
-
- public virtual void WriteDebug()
- {
- if(Debug)
- Console.WriteLine();
- }
-
- public void WriteDebug(string message)
- {
- if(Debug)
- Console.WriteLine("DEBUG: " + message);
- }
-
- public virtual void WriteDebug(string format, params object[] parameters)
- {
- if(Debug)
- Console.WriteLine("DEBUG: " + format, parameters);
- }
-
- /// <summary>
- /// Writes an error message to the standard error stream. This
- /// will show up as the error message if a commit is denied
- /// in the subversion client.
- /// </summary>
- /// <param name="format"></param>
- /// <param name="exc"></param>
- /// <param name="parameters"></param>
- public virtual void WriteError(string format, Exception exc, params object[] parameters)
- {
- Console.Error.WriteLine("DOH! "+ format, parameters);
- WriteException(exc);
- }
-
- void WriteException(Exception exception)
- {
- Console.Error.WriteLine("EXCEPTION: " + exception.GetType().FullName);
- Console.Error.WriteLine("MESSAGE: " + exception.Message);
- Console.Error.WriteLine("STACK TRACE");
- Console.Error.WriteLine(exception.StackTrace);
- if (exception.InnerException != null)
- {
- Console.Error.WriteLine("----------------------");
- Console.Error.WriteLine("INNER EXCEPTION");
- WriteException(exception.InnerException);
-
- }
- }
-
- /// <summary>
- /// Writes an error message to the standard error stream. This
- /// will show up as the error message if a commit is denied
- /// in the subversion client.
- /// </summary>
- /// <param name="format"></param>
- /// <param name="parameters"></param>
- public virtual void WriteError(string format, params object[] parameters)
- {
- Console.Error.WriteLine("WHOOPS! " + format, parameters);
- }
-
- /// <summary>
- /// Writes an error message to the standard error stream. This
- /// will show up as the error message if a commit is denied
- /// in the subversion client.
- /// </summary>
- /// <param name="message"></param>
- public void WriteError(string message)
- {
- Console.Error.WriteLine("WHOOPS! " + message);
- }
-
- /// <summary>
- /// Writes an error message to the standard error stream. This
- /// will show up as the error message if a commit is denied
- /// in the subversion client.
- /// </summary>
- /// <param name="message"></param>
- public virtual void WriteHelp(string message)
- {
- Console.WriteLine(message);
- }
- }
-}
Deleted: branches/TRY-ChangeArchitecture/Application/CaptainHook/PluginLoader.cs
===================================================================
--- branches/TRY-ChangeArchitecture/Application/CaptainHook/PluginLoader.cs 2007-02-23 20:43:28 UTC (rev 15)
+++ branches/TRY-ChangeArchitecture/Application/CaptainHook/PluginLoader.cs 2007-02-23 21:20:38 UTC (rev 16)
@@ -1,75 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Collections.ObjectModel;
-using System.IO;
-using System.Reflection;
-using CaptainHook;
-using CaptainHook.Subversion.Hook;
-
-namespace CaptainHook
-{
- /// <summary>
- /// this is an exceedingly simple plugin loader.
- /// </summary>
- public class PluginLoader
- {
- IOutputHandler output;
-
- /// <summary>
- /// Constructs an instance of the plugin loader.
- /// </summary>
- /// <param name="output"></param>
- public PluginLoader(IOutputHandler output)
- {
- this.output = output;
- }
-
- /// <summary>
- /// Returns a collection of plugins matching the specified type.
- /// </summary>
- /// <param name="pluginType"></param>
- /// <returns></returns>
- public ICollection<SubversionHook> LoadPlugins(Type pluginType)
- {
- ICollection<SubversionHook> hooks = new Collection<SubversionHook>();
- //Look in plugin directory.
- string pluginDirectoryPath = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), Settings.PluginFolder);
- string[] dlls = Directory.GetFiles(pluginDirectoryPath, "*.dll");
-
- output.WriteDebug("{0} Dlls found", dlls.Length);
-
- foreach(string assemblyFilePath in dlls)
- {
- output.WriteDebug("Loading assembly '{0}'", assemblyFilePath);
-
- Assembly assembly = Assembly.LoadFrom(assemblyFilePath);
- if(assembly == null)
- continue;
-
- Type[] types = assembly.GetTypes();
- foreach(Type type in types)
- {
- output.WriteDebug("Checking if type '{0}' implements '{1}'", type.Name, pluginType.Name);
- if (pluginType.IsAssignableFrom(type))
- {
- output.WriteDebug("Type '{0}' DOES implement {1}", type.FullName, pluginType.Name);
-
- ConstructorInfo ctor = type.GetConstructor(Type.EmptyTypes);
- SubversionHook hook = (SubversionHook)ctor.Invoke(null);
- if(hook == null)
- continue;
-
- hooks.Add(hook);
- }
- else
- {
- output.WriteDebug("type '{0}' does not implement {1}.", type.FullName, pluginType.FullName);
- }
- }
- }
-
- output.Write("Found and Loaded {0} hooks.", hooks.Count);
- return hooks;
- }
- }
-}
Modified: branches/TRY-ChangeArchitecture/Application/CaptainHook/Program.cs
===================================================================
--- branches/TRY-ChangeArchitecture/Application/CaptainHook/Program.cs 2007-02-23 20:43:28 UTC (rev 15)
+++ branches/TRY-ChangeArchitecture/Application/CaptainHook/Program.cs 2007-02-23 21:20:38 UTC (rev 16)
@@ -1,5 +1,7 @@
using System;
using CaptainHook.CommandLine;
+using CaptainHook.Engine;
+using CaptainHook.Engine.Services;
namespace CaptainHook
{
@@ -7,21 +9,22 @@
{
public static int Main(string[] args)
{
- IOutputHandler output = null;
+ IHookContext context = null;
+
try
{
- //TODO: Perhaps we should ask the plugins if they have any command line arguments.
Arguments arguments = new Arguments(args);
- output = new OutputHandler();
- output.Debug = arguments.Debug;
+
if (arguments.Complete)
{
- ApplicationHost app = new ApplicationHost(arguments, output, new PluginLoader(output));
- if (app.HandleHookEvent())
- return 0;
- else
- return 1;
+ IOutputHandler outputHandler = GetOutputHandler(arguments);
+ ISubversionTranslator translator = GetSubversionTranslator(arguments);
+ IPluginLoader pluginLoader = GetPluginLoader(arguments);
+
+ context = BuildContext(outputHandler, translator, pluginLoader);
+
+ // TODO: Invoke Hook Plugins
}
if(arguments.ErrorMessages.Count > 0)
@@ -31,20 +34,22 @@
{
errorMessage += error + Environment.NewLine;
}
- output.WriteError(errorMessage);
- output.Write();
+
+ context.Output.WriteError(errorMessage);
+ context.Output.Write();
}
if(arguments.ShowHelp)
{
- output.WriteHelp(arguments.Usage);
+ context.Output.WriteHelp(arguments.Usage);
}
+
}
catch(Exception exc)
{
- if(output != null)
+ if (context != null)
{
- output.WriteError("Unhandled exception occurred.", exc);
+ context.Output.WriteError("Unhandled exception occurred.", exc);
}
else
{
@@ -55,5 +60,25 @@
return 0;
}
+
+ private static IHookContext BuildContext(IOutputHandler outputHandler, ISubversionTranslator translator, IPluginLoader pluginLoader)
+ {
+ return new HookContext(outputHandler, translator, pluginLoader);
+ }
+
+ private static IPluginLoader GetPluginLoader(Arguments arguments)
+ {
+ return null;
+ }
+
+ private static ISubversionTranslator GetSubversionTranslator(Arguments arguments)
+ {
+ return null;
+ }
+
+ private static IOutputHandler GetOutputHandler(Arguments arguments)
+ {
+ return new ConsoleOutputHandler(arguments.Debug);
+ }
}
}
Added: branches/TRY-ChangeArchitecture/Application/CaptainHook.Engine/ApplicationHost.cs
===================================================================
--- branches/TRY-ChangeArchitecture/Application/CaptainHook.Engine/ApplicationHost.cs (rev 0)
+++ branches/TRY-ChangeArchitecture/Application/CaptainHook.Engine/ApplicationHost.cs 2007-02-23 21:20:38 UTC (rev 16)
@@ -0,0 +1,206 @@
+using System;
+using System.Collections.Generic;
+using System.Configuration;
+using System.Net;
+using System.Net.Mail;
+using System.Text;
+using CaptainHook.Interfaces;
+
+namespace CaptainHook.Engine
+{
+ public class ApplicationHost : IApplicationHost
+ {
+ PluginLoader pluginLoader;
+
+ /// <summary>
+ /// Constructor. Reads in the arguments.
+ /// </summary>
+ /// <param name="args"></param>
+ public ApplicationHost(ISubversionTranslator translator, IOutputHandler output, PluginLoader pluginLoader)
+ {
+ if (translator == null)
+ throw new ArgumentNullException("translator");
+
+ if (output == null)
+ throw new ArgumentNullException("output");
+
+ if (pluginLoader == null)
+ throw new ArgumentNullException("pluginLoader");
+
+ this.subversionTranslator = translator;
+ this.output = output;
+ this.pluginLoader = pluginLoader;
+ }
+
+ public ISubversionTranslator SubversionTranslator
+ {
+ get { return subversionTranslator; }
+ }
+
+ /// <summary>
+ /// Handles the hook event and returns whether or not
+ /// Subversion should continue with the transaction.
+ /// </summary>
+ /// <remarks>
+ /// If any hook votes to stop the transaction, the transaction will not
+ /// continue, though the other hooks will have a chance to run.
+ /// </remarks>
+ /// <returns></returns>
+ public bool HandleHookEvent(HookContext context)
+ {
+ bool continueTransaction = true;
+
+ // TODO: Load Plugins
+ ICollection<SubversionHook> hooks = null;// pluginLoader.LoadPlugins(context);
+ foreach(SubversionHook hook in hooks)
+ {
+ try
+ {
+ // TODO: Handle hooks
+ //hook.Initialize(this);
+
+ //if (!hook.HandleHook(PrepareCommitInfo(this.arguments)))
+ //{
+ // output.Write(string.Format("The hook '{0}' votes to not continue the transaction.", hook.GetType().Name));
+ // continueTransaction = false;
+ //}
+
+ }
+ catch(Exception e)
+ {
+ output.WriteError("Error occurred while executing the hook {0}", e, hook.GetType().FullName);
+ }
+ }
+
+ output.Write("Continuing Transaction?: " + continueTransaction);
+
+ return continueTransaction;
+ }
+
+ ICommitInfo PrepareCommitInfo()
+ {
+ // TODO: Prepare Commit Info
+ return null;
+
+ //if (!String.IsNullOrEmpty(args.TransactionName))
+ // return this.SubversionTranslator.GetCommitInformation(args.TransactionName);
+
+ //if (!String.IsNullOrEmpty(args.PropertyName) && !String.IsNullOrEmpty(args.UserName))
+ //{
+ // ICommitInfo commitInfo = this.SubversionTranslator.GetCommitInformation(args.Revision);
+ // return new PropertyChangeInfo(args.PropertyName, args.UserName, commitInfo.Author, commitInfo.DateStamp, commitInfo.LogMessageSize, commitInfo.LogMessage);
+ //}
+
+ //if (!String.IsNullOrEmpty(args.UserName))
+ //{
+ // return new PropertyChangeInfo(null, args.UserName, null, DateTime.MinValue, 0, null);
+ //}
+ //else
+ //{
+ // return this.SubversionTranslator.GetCommitInformation(args.Revision);
+ //}
+ }
+
+ /// <summary>
+ /// Sends an email.
+ /// </summary>
+ /// <param name="from"></param>
+ /// <param name="to"></param>
+ /// <param name="ccEmails"></param>
+ /// <param name="bccEmails"></param>
+ /// <param name="subject"></param>
+ /// <param name="body"></param>
+ public void SendEmail(MailMessage message)
+ {
+ if (message.From == null)
+ throw new ArgumentNullException("A FROM: address is required.");
+
+ if (message.To.Count == 0)
+ throw new ArgumentOutOfRangeException("At least one TO: address is required.");
+
+ SmtpClient smtp = new SmtpClient();
+ smtp.Host = SmtpServerHost;
+ smtp.Port = SmtpServerPort;
+
+ if(!String.IsNullOrEmpty(SmtpServerUser))
+ {
+ output.WriteDebug("Setting credentials - UserName: " + this.SmtpServerUser);
+ NetworkCredential basicAuthCredential = new NetworkCredential(this.SmtpServerUser, this.SmtpServerPassword);
+ smtp.UseDefaultCredentials = false;
+ smtp.Credentials = basicAuthCredential;
+ }
+
+ output.WriteDebug("Sending Email via Host '{0}:{1}", smtp.Host, smtp.Port);
+ try
+ {
+ smtp.Send(message);
+ }
+ catch(SmtpException e)
+ {
+ output.WriteError("Error while sending email", e);
+ }
+ }
+
+ void AddRange(MailAddressCollection destination, MailAddressCollection toBeAdded)
+ {
+ if (destination == null)
+ throw new ArgumentNullException("destination", "Cannot add emails to a null MailAddressCollection.");
+ if(toBeAdded == null)
+ return;
+ foreach (MailAddress toAddress in toBeAdded)
+ {
+ destination.Add(toAddress);
+ }
+ }
+
+ private string SmtpServerHost
+ {
+ get
+ {
+ return ConfigurationManager.AppSettings["SmtpServerHost"];
+ }
+ }
+
+ private int SmtpServerPort
+ {
+ get
+ {
+ if (String.IsNullOrEmpty(ConfigurationManager.AppSettings["SmtpServerPort"]))
+ return 25;
+ return int.Parse(ConfigurationManager.AppSettings["SmtpServerPort"]);
+ }
+ }
+
+ private string SmtpServerUser
+ {
+ get
+ {
+ return ConfigurationManager.AppSettings["SmtpServerUser"];
+ }
+ }
+
+ private string SmtpServerPassword
+ {
+ get
+ {
+ return ConfigurationManager.AppSettings["SmtpServerPassword"];
+ }
+ }
+
+ ISubversionTranslator subversionTranslator;
+
+ /// <summary>
+ /// Used to write output. Probably to the Console, but
+ /// you never know.
+ /// </summary>
+ public IOutputHandler Output
+ {
+ get
+ {
+ return output;
+ }
+ }
+
+ IOutputHandler output;
+ }
+}
Added: branches/TRY-ChangeArchitecture/Application/CaptainHook.Engine/CaptainHook.Engine.csproj
===================================================================
--- branches/TRY-ChangeArchitecture/Application/CaptainHook.Engine/CaptainHook.Engine.csproj (rev 0)
+++ branches/TRY-ChangeArchitecture/Application/CaptainHook.Engine/CaptainHook.Engine.csproj 2007-02-23 21:20:38 UTC (rev 16)
@@ -0,0 +1,79 @@
+<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <ProductVersion>8.0.50727</ProductVersion>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{0717F186-701E-47AE-B7D9-B577D2657386}</ProjectGuid>
+ <OutputType>Library</OutputType>
+ <AppDesignerFolder>Properties</AppDesignerFolder>
+ <RootNamespace>CaptainHook.Engine</RootNamespace>
+ <AssemblyName>CaptainHook.Engine</AssemblyName>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ <DebugSymbols>true</DebugSymbols>
+ <DebugType>full</DebugType>
+ <Optimize>false</Optimize>
+ <OutputPath>bin\Debug\</OutputPath>
+ <DefineConstants>DEBUG;TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ <TreatWarningsAsErrors>true</TreatWarningsAsErrors>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+ <DebugType>pdbonly</DebugType>
+ <Optimize>true</Optimize>
+ <OutputPath>bin\Release\</OutputPath>
+ <DefineConstants>TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <ItemGroup>
+ <Reference Include="System" />
+ <Reference Include="System.configuration" />
+ <Reference Include="System.Data" />
+ <Reference Include="System.Xml" />
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="Services\ConsoleOutputHandler.cs" />
+ <Compile Include="HookContext.cs" />
+ <Compile Include="HookNameAttribute.cs" />
+ <Compile Include="RepositoryInfo\CommitInfo.cs" />
+ <Compile Include="RepositoryInfo\Difference.cs" />
+ <Compile Include="RepositoryInfo\HistoryInfo.cs" />
+ <Compile Include="RepositoryInfo\PropertyChangeInfo.cs" />
+ <Compile Include="RepositoryInfo\RepositoryChange.cs" />
+ <Compile Include="RepositoryInfo\RevisionInfo.cs" />
+ <Compile Include="RepositoryInfo\TransactionInfo.cs" />
+ <Compile Include="RepositoryInfo\ICommitInfo.cs" />
+ <Compile Include="RepositoryInfo\IDifference.cs" />
+ <Compile Include="RepositoryInfo\IHistoryInfo.cs" />
+ <Compile Include="Services\IHookContext.cs" />
+ <Compile Include="Services\IOutputHandler.cs" />
+ <Compile Include="Services\IPluginLoader.cs" />
+ <Compile Include="RepositoryInfo\IPropertyChangeInfo.cs" />
+ <Compile Include="RepositoryInfo\IRepositoryChange.cs" />
+ <Compile Include="RepositoryInfo\IRevisionInfo.cs" />
+ <Compile Include="Services\ISubversionRepository.cs" />
+ <Compile Include="Services\ISubversionTranslator.cs" />
+ <Compile Include="RepositoryInfo\ITransactionInfo.cs" />
+ <Compile Include="PluginLoader.cs" />
+ <Compile Include="PostCommitHook.cs" />
+ <Compile Include="PostRevisionPropertyChangeHook.cs" />
+ <Compile Include="PreCommitHook.cs" />
+ <Compile Include="PreRevisionPropertyChangeHook.cs" />
+ <Compile Include="Properties\AssemblyInfo.cs" />
+ <Compile Include="Services\SubversionRepository.cs" />
+ <Compile Include="Services\SubversionTranslator.cs" />
+ <Compile Include="StartCommitHook.cs" />
+ <Compile Include="SubversionHook.cs" />
+ </ItemGroup>
+ <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
+ <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
+ Other similar extension points exist, see Microsoft.Common.targets.
+ <Target Name="BeforeBuild">
+ </Target>
+ <Target Name="AfterBuild">
+ </Target>
+ -->
+</Project>
\ No newline at end of file
Added: branches/TRY-ChangeArchitecture/Application/CaptainHook.Engine/HookContext.cs
===================================================================
--- branches/TRY-ChangeArchitecture/Application/CaptainHook.Engine/HookContext.cs (rev 0)
+++ branches/TRY-ChangeArchitecture/Application/CaptainHook.Engine/HookContext.cs 2007-02-23 21:20:38 UTC (rev 16)
@@ -0,0 +1,45 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+using CaptainHook.Engine.Services;
+
+namespace CaptainHook.Engine
+{
+ public class HookContext : IHookContext
+ {
+ private IOutputHandler _OutputHandler = null;
+ private ISubversionTranslator _Translator = null;
+ private IPluginLoader _PluginLoader = null;
+
+ public HookContext(ISubversionTranslator translator, IPluginLoader pluginLoader) : this(new ConsoleOutputHandler(false), translator, pluginLoader)
+ {
+ }
+
+ public HookContext(IOutputHandler outputHandler, ISubversionTranslator translator, IPluginLoader pluginLoader)
+ {
+ if (outputHandler == null)
+ throw new ArgumentNullException("outputHandler");
+
+ if (translator == null)
+ throw new ArgumentNullException("translator");
+
+ if (pluginLoader == null)
+ throw new ArgumentNullException("pluginLoader");
+
+ _OutputHandler = outputHandler;
+ _Translator = translator;
+ _PluginLoader = pluginLoader;
+ }
+
+ public IOutputHandler Output
+ {
+ get { return _OutputHandler; }
+ }
+
+ public ISubversionTranslator Translator
+ {
+ get { return _Translator; }
+ }
+ }
+}
Added: branches/TRY-ChangeArchitecture/Application/CaptainHook.Engine/HookNameAttribute.cs
===================================================================
--- branches/TRY-ChangeArchitecture/Application/CaptainHook.Engine/HookNameAttribute.cs (rev 0)
+++ branches/TRY-ChangeArchitecture/Application/CaptainHook.Engine/HookNameAttribute.cs 2007-02-23 21:20:38 UTC (rev 16)
@@ -0,0 +1,56 @@
+using System;
+
+namespace CaptainHook.Engine
+{
+ /// <summary>
+ /// Attribute applied to the base hook classes in order to
+ /// map the hooks to the Subversion hook name. For example,
+ /// the <see cref="PostCommitHook" /> class implements the
+ /// <em>post-commit</em> hook.
+ /// </summary>
+ [AttributeUsage(AttributeTargets.Class)]
+ public class HookNameAttribute : Attribute
+ {
+ /// <summary>
+ /// Constructs an instance of this attribute.
+ /// </summary>
+ /// <param name="name">The hook name.</param>
+ public HookNameAttribute(string name)
+ {
+ this.name = name;
+ }
+
+ /// <summary>
+ /// Constructs an instance of this attribute.
+ /// </summary>
+ /// <param name="name">The hook name.</param>
+ /// <param name="description">What the hook does.</param>
+ public HookNameAttribute(string name, string description)
+ {
+ this.name = name;
+ this.description = description;
+ }
+
+ /// <summary>
+ /// Gets or sets the name of the hook.
+ /// </summary>
+ public string Name
+ {
+ get { return this.name; }
+ set { this.name = value; }
+ }
+
+ string name;
+
+ /// <summary>
+ /// Description of the hook's purpose.
+ /// </summary>
+ public string Description
+ {
+ get { return this.description; }
+ set { this.description = value; }
+ }
+
+ string description;
+ }
+}
Added: branches/TRY-ChangeArchitecture/Application/CaptainHook.Engine/PluginLoader.cs
===================================================================
--- branches/TRY-ChangeArchitecture/Application/CaptainHook.Engine/PluginLoader.cs (rev 0)
+++ branches/TRY-ChangeArchitecture/Application/CaptainHook.Engine/PluginLoader.cs 2007-02-23 21:20:38 UTC (rev 16)
@@ -0,0 +1,75 @@
+using System;
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+using System.IO;
+using System.Reflection;
+
+using CaptainHook.Engine.Services;
+
+namespace CaptainHook.Engine
+{
+ /// <summary>
+ /// this is an exceedingly simple plugin loader.
+ /// </summary>
+ public class PluginLoader
+ {
+ IOutputHandler output;
+
+ /// <summary>
+ /// Constructs an instance of the plugin loader.
+ /// </summary>
+ /// <param name="output"></param>
+ public PluginLoader(IOutputHandler output)
+ {
+ this.output = output;
+ }
+
+ /// <summary>
+ /// Returns a collection of plugins matching the specified type.
+ /// </summary>
+ /// <param name="pluginType"></param>
+ /// <returns></returns>
+ public ICollection<SubversionHook> LoadPlugins(Type pluginType)
+ {
+ ICollection<SubversionHook> hooks = new Collection<SubversionHook>();
+ //Look in plugin directory.
+ string pluginDirectoryPath = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "" /* Fix Plugin Loader */);
+ string[] dlls = Directory.GetFiles(pluginDirectoryPath, "*.dll");
+
+ output.WriteDebug("{0} Dlls found", dlls.Length);
+
+ foreach(string assemblyFilePath in dlls)
+ {
+ output.WriteDebug("Loading assembly '{0}'", assemblyFilePath);
+
+ Assembly assembly = Assembly.LoadFrom(assemblyFilePath);
+ if(assembly == null)
+ continue;
+
+ Type[] types = assembly.GetTypes();
+ foreach(Type type in types)
+ {
+ output.WriteDebug("Checking if type '{0}' implements '{1}'", type.Name, pluginType.Name);
+ if (pluginType.IsAssignableFrom(type))
+ {
+ output.WriteDebug("Type '{0}' DOES implement {1}", type.FullName, pluginType.Name);
+
+ ConstructorInfo ctor = type.GetConstructor(Type.EmptyTypes);
+ SubversionHook hook = (SubversionHook)ctor.Invoke(null);
+ if(hook == null)
+ continue;
+
+ hooks.Add(hook);
+ }
+ else
+ {
+ output.WriteDebug("type '{0}' does not implement {1}.", type.FullName, pluginType.FullName);
+ }
+ }
+ }
+
+ output.Write("Found and Loaded {0} hooks.", hooks.Count);
+ return hooks;
+ }
+ }
+}
Added: branches/TRY-ChangeArchitecture/Application/CaptainHook.Engine/PostCommitHook.cs
===================================================================
--- branches/TRY-ChangeArchitecture/Application/CaptainHook.Engine/PostCommitHook.cs (rev 0)
+++ branches/TRY-ChangeArchitecture/Application/CaptainHook.Engine/PostCommitHook.cs 2007-02-23 21:20:38 UTC (rev 16)
@@ -0,0 +1,30 @@
+using System;
+
+using CaptainHook.Engine.RepositoryInfo;
+
+namespace CaptainHook.Engine
+{
+ /// <summary>
+ /// The post-commit hook runs after the transaction has been committed.
+ /// By Implementing this class, a plugin can be used for sending emails, or backing up a repository.
+ /// </summary>
+ [HookNameAttribute("post-commit", "Runs after the transaction has been committed.")]
+ public abstract class PostCommitHook : SubversionHook
+ {
+ /// <summary>
+ /// Method overridden by specific hooks to perform hook specific handling.
+ /// </summary>
+ /// <param name="info"></param>
+ protected internal override bool HandleHookEvent(ICommitInfo info)
+ {
+ return HandleHookEvent(info as IRevisionInfo);
+ }
+
+ /// <summary>
+ /// Handles a hook event in which the revision information is available.
+ /// </summary>
+ /// <param name="commit"></param>
+ /// <returns></returns>
+ protected abstract bool HandleHookEvent(IRevisionInfo commit);
+ }
+}
Added: branches/TRY-ChangeArchitecture/Application/CaptainHook.Engine/PostRevisionPropertyChangeHook.cs
===================================================================
--- branches/TRY-ChangeArchitecture/Application/CaptainHook.Engine/PostRevisionPropertyChangeHook.cs (rev 0)
+++ branches/TRY-ChangeArchitecture/Application/CaptainHook.Engine/PostRevisionPropertyChangeHook.cs 2007-02-23 21:20:38 UTC (rev 16)
@@ -0,0 +1,30 @@
+using System;
+
+using CaptainHook.Engine.RepositoryInfo;
+
+namespace CaptainHook.Engine
+{
+ /// <summary>
+ /// The post-revprop-change hook runs before a revision property change.
+ /// By Implementing this class, a plugin can email or backup these changes.
+ /// </summary>
+ [HookNameAttribute("post-revprop-change", "Runs after a revision property change.")]
+ public abstract class PostRevisionPropertyChangeHook : SubversionHook
+ {
+ /// <summary>
+ /// Method overridden by specific hooks to perform hook specific handling.
+ /// </summary>
+ /// <param name="info"></param>
+ protected internal override bool HandleHookEvent(ICommitInfo info)
+ {
+ return HandleHookEvent(info as IPropertyChangeInfo);
+ }
+
+ /// <summary>
+ /// Handles a hook event in which the revision information is available.
+ /// </summary>
+ /// <param name="commit"></param>
+ /// <returns></returns>
+ protected abstract bool HandleHookEvent(IPropertyChangeInfo commit);
+ }
+}
Added: branches/TRY-ChangeArchitecture/Application/CaptainHook.Engine/PreCommitHook.cs
===================================================================
--- branches/TRY-ChangeArchitecture/Application/CaptainHook.Engine/PreCommitHook.cs (rev 0)
+++ branches/TRY-ChangeArchitecture/Application/CaptainHook.Engine/PreCommitHook.cs 2007-02-23 21:20:38 UTC (rev 16)
@@ -0,0 +1,30 @@
+using System;
+using CaptainHook.Engine.RepositoryInfo;
+
+namespace CaptainHook.Engine
+{
+ /// <summary>
+ /// The pre-commit hook run at the end of the transaction, but before commit.
+ /// By Implementing this class, a plugin can validate things such as a non-zero
+ /// length log message.
+ /// </summary>
+ [HookNameAttribute("pre-commit", "Runs at the end of the transaction, but before commit.")]
+ public abstract class PreCommitHook : SubversionHook
+ {
+ /// <summary>
+ /// Method overridden by specific hooks to perform hook specific handling.
+ /// </summary>
+ /// <param name="info"></param>
+ protected internal override bool HandleHookEvent(ICommitInfo info)
+ {
+ return HandleHookEvent(info as ITransactionInfo);
+ }
+
+ /// <summary>
+ /// Handles a hook event in which the transaction information is available.
+ /// </summary>
+ /// <param name="commit"></param>
+ /// <returns></returns>
+ protected abstract bool HandleHookEvent(ITransactionInfo commit);
+ }
+}
Added: branches/TRY-ChangeArchitecture/Application/CaptainHook.Engine/PreRevisionPropertyChangeHook.cs
===================================================================
--- branches/TRY-ChangeArchitecture/Application/CaptainHook.Engine/PreRevisionPropertyChangeHook.cs (rev 0)
+++ branches/TRY-ChangeArchitecture/Application/CaptainHook.Engine/PreRevisionPropertyChangeHook.cs 2007-02-23 21:20:38 UTC (rev 16)
@@ -0,0 +1,32 @@
+using System;
+using CaptainHook.Engine.RepositoryInfo;
+
+namespace CaptainHook.Engine
+{
+ /// <summary>
+ /// The pre-revprop-change hook runs before a revision property change.
+ /// By Implementing this class, a plugin can check permissions.
+ /// </summary>
+ [HookNameAttribute("pre-revprop-change", "Runs before a revision property change.")]
+ public abstract class PreRevisionPropertyChangeHook : SubversionHook
+ {
+ /// <summary>
+ /// Method overridden by specific hooks to perform hook specific handling.
+ /// </summary>
+ /// <param name="info"></param>
+ protected internal override bool HandleHookEvent(ICommitInfo info)
+ {
+ //TODO: Test.
+ string propertyValue = Console.In.ReadToEnd();
+ return HandleHookEvent(info as IPropertyChangeInfo, propertyValue);
+ }
+
+ /// <summary>
+ /// Handles a hook event in which the transaction information is available.
+ /// </summary>
+ /// <param name="commit"></param>
+ /// <param name="value">The property avlue</param>
+ /// <returns></returns>
+ protected abstract bool HandleHookEvent(IPropertyChangeInfo commit, string value);
+ }
+}
Added: branches/TRY-ChangeArchitecture/Application/CaptainHook.Engine/Properties/AssemblyInfo.cs
===================================================================
--- branches/TRY-ChangeArchitecture/Application/CaptainHook.Engine/Properties/AssemblyInfo.cs (rev 0)
+++ branches/TRY-ChangeArchitecture/Application/CaptainHook.Engine/Properties/AssemblyInfo.cs 2007-02-23 21:20:38 UTC (rev 16)
@@ -0,0 +1,35 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("CaptainHook.Engine")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("CaptainHook.Engine")]
+[assembly: AssemblyCopyright("Copyright © 2007")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("0505cf0c-b7ed-4109-b63a-0ae09d37b28b")]
+
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+// You can specify all the values or you can default the Revision and Build Numbers
+// by using the '*' as shown below:
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
Added: branches/TRY-ChangeArchitecture/Application/CaptainHook.Engine/RepositoryInfo/CommitInfo.cs
===================================================================
--- branches/TRY-ChangeArchitecture/Application/CaptainHook.Engine/RepositoryInfo/CommitInfo.cs (rev 0)
+++ branches/TRY-ChangeArchitecture/Application/CaptainHook.Engine/RepositoryInfo/CommitInfo.cs 2007-02-23 21:20:38 UTC (rev 16)
@@ -0,0 +1,68 @@
+using System;
+
+
+
+namespace CaptainHook.Engine.RepositoryInfo
+{
+ /// <summary>
+ /// Contains information about a commit. Either a commit in process (aka <see cref="ITransactionInfo" />
+ /// or a completed commit (aka <see cref="IRevisionInfo" />)
+ /// </summary>
+ public abstract class CommitInfo : ICommitInfo
+ {
+ /// <summary>
+ /// Constructs an instance of this revision.
+ /// </summary>
+ /// <param name="author"></param>
+ /// <param name="datestamp"></param>
+ /// <param name="logMessageSize"></param>
+ /// <param name="logMessage"></param>
+ public CommitInfo(string author, DateTime datestamp, int logMessageSize, string logMessage)
+ {
+ this.author = author;
+ this.dateStamp = datestamp;
+ this.logMessageSize = logMessageSize;
+ this.logMessage = logMessage;
+ }
+
+ /// <summary>
+ /// The username of the author of the revision.
+ /// </summary>
+ public string Author
+ {
+ get { return this.author; }
+ }
+
+ string author;
+
+ /// <summary>
+ /// The date the revision was made.
+ /// </summary>
+ public DateTime DateStamp
+ {
+ get { return this.dateStamp; }
+ }
+
+ DateTime dateStamp;
+
+ /// <summary>
+ /// Size of the log message for the revision.
+ /// </summary>
+ public int LogMessageSize
+ {
+ get { return this.logMessageSize; }
+ }
+
+ int logMessageSize;
+
+ /// <summary>
+ /// The log message.
+ /// </summary>
+ public string LogMessage
+ {
+ get { return this.logMessage; }
+ }
+
+ string logMessage;
+ }
+}
Added: branches/TRY-ChangeArchitecture/Application/CaptainHook.Engine/RepositoryInfo/Difference.cs
===================================================================
--- branches/TRY-ChangeArchitecture/Application/CaptainHook.Engine/RepositoryInfo/Difference.cs (rev 0)
+++ branches/TRY-ChangeArchitecture/Application/CaptainHook.Engine/RepositoryInfo/Difference.cs 2007-02-23 21:20:38 UTC (rev 16)
@@ -0,0 +1,64 @@
+using System;
+
+
+
+namespace CaptainHook.Engine.RepositoryInfo
+{
+ public struct Difference : IDifference
+ {
+ /// <summary>
+ /// Constructs an instance of this type.
+ /// </summary>
+ /// <param name="changeType"></param>
+ /// <param name="itemPath"></param>
+ /// <param name="difference"></param>
+ public Difference(string changeType, string itemPath, string difference)
+ {
+ this.changeType = changeType;
+ this.itemPath = itemPath;
+ this.differenceText = difference;
+ }
+
+ private string differenceText;
+ private string itemPath;
+ private string changeType;
+
+ /// <summary>
+ /// The type of change, such as "Deleted", "Modified", "Added".
+ /// </summary>
+ public string ChangeType
+ {
+ get { return this.changeType; }
+ }
+
+ /// <summary>
+ /// The repository path to the changed file.
+ /// </summary>
+ public string ItemPath
+ {
+ get { return this.itemPath; }
+ }
+
+ /// <summary>
+ /// The text describing the difference.
+ /// </summary>
+ public string DifferenceText
+ {
+ get { return this.differenceText; }
+ }
+
+ /// <summary>
+ /// Prints out the full difference text as received from
+ /// the source control repository.
+ /// </summary>
+ /// <returns></returns>
+ public override string ToString()
+ {
+ string format = "{0}: {1}" + Environment.NewLine +
+ "==============================================================================" + Environment.NewLine +
+ "{2}";
+
+ return string.Format(format, this.changeType, this.itemPath, this.differenceText);
+ }
+ }
+}
Added: branches/TRY-ChangeArchitecture/Application/CaptainHook.Engine/RepositoryInfo/HistoryInfo.cs
===================================================================
--- branches/TRY-ChangeArchitecture/Application/CaptainHook.Engine/RepositoryInfo/HistoryInfo.cs (rev 0)
+++ branches/TRY-ChangeArchitecture/Application/CaptainHook.Engine/RepositoryInfo/HistoryInfo.cs 2007-02-23 21:20:38 UTC (rev 16)
@@ -0,0 +1,35 @@
+using System;
+
+
+
+namespace CaptainHook.Engine.RepositoryInfo
+{
+ public struct HistoryInfo : IHistoryInfo
+ {
+ public HistoryInfo(int revision, string path, string historyId)
+ {
+ this.revision = revision;
+ this.path = path;
+ this.historyId = historyId;
+ }
+
+ int revision;
+ string path;
+ string historyId;
+
+ public int Revision
+ {
+ get { return revision; }
+ }
+
+ public string Path
+ {
+ get { return path; }
+ }
+
+ public string HistoryId
+ {
+ get { return historyId; }
+ }
+ }
+}
Added: branches/TRY-ChangeArchitecture/Application/CaptainHook.Engine/RepositoryInfo/ICommitInfo.cs
===================================================================
--- branches/TRY-ChangeArchitecture/Application/CaptainHook.Engine/RepositoryInfo/ICommitInfo.cs (rev 0)
+++ branches/TRY-ChangeArchitecture/Application/CaptainHook.Engine/RepositoryInfo/ICommitInfo.cs 2007-02-23 21:20:38 UTC (rev 16)
@@ -0,0 +1,31 @@
+using System;
+
+namespace CaptainHook.Engine.RepositoryInfo
+{
+ /// <summary>
+ /// Encapsulates information about a particular commit. Either a
+ /// commit in-process or a recently committed commit.
+ /// </summary>
+ public interface ICommitInfo
+ {
+ /// <summary>
+ /// The username of the author of the revision.
+ /// </summary>
+ string Author {get;}
+
+ /// <summary>
+ /// The date the revision was made.
+ /// </summary>
+ DateTime DateStamp {get;}
+
+ /// <summary>
+ /// Size of the log message for the revision.
+ /// </summary>
+ int LogMessageSize {get;}
+
+ /// <summary>
+ /// The log message.
+ /// </summary>
+ string LogMessage {get;}
+ }
+}
Added: branches/TRY-ChangeArchitecture/Application/CaptainHook.Engine/RepositoryInfo/IDifference.cs
===================================================================
--- branches/TRY-ChangeArchitecture/Application/CaptainHook.Engine/RepositoryInfo/IDifference.cs (rev 0)
+++ branches/TRY-ChangeArchitecture/Application/CaptainHook.Engine/RepositoryInfo/IDifference.cs 2007-02-23 21:20:38 UTC (rev 16)
@@ -0,0 +1,22 @@
+using System;
+
+namespace CaptainHook.Engine.RepositoryInfo
+{
+ public interface IDifference
+ {
+ /// <summary>
+ /// The type of change, such as "Deleted", "Modified", "Added".
+ /// </summary>
+ string ChangeType { get;}
+
+ /// <summary>
+ /// The repository path to the changed file.
+ /// </summary>
+ string ItemPath { get;}
+
+ /// <summary>
+ /// The text describing the difference.
+ /// </summary>
+ string DifferenceText { get;}
+ }
+}
Added: branches/TRY-ChangeArchitecture/Application/CaptainHook.Engine/RepositoryInfo/IHistoryInfo.cs
===================================================================
--- branches/TRY-ChangeArchitecture/Application/CaptainHook.Engine/RepositoryInfo/IHistoryInfo.cs (rev 0)
+++ branches/TRY-ChangeArchitecture/Application/CaptainHook.Engine/RepositoryInfo/IHistoryInfo.cs 2007-02-23 21:20:38 UTC (rev 16)
@@ -0,0 +1,36 @@
+using System;
+
+namespace CaptainHook.Engine.RepositoryInfo
+{
+ /// <summary>
+ /// Encapsulates information about a history entry.
+ /// </summary>
+ public interface IHistoryInfo
+ {
+ /// <summary>
+ /// Revision number.
+ /// </summary>
+ int Revision { get;}
+
+ /// <summary>
+ /// The path of the history entry.
+ /// </summary>
+ string Path { get;}
+
+ /// <summary>
+ /// The ID of the history entry.
+ /// </summary>
+ string HistoryId { get;}
+ }
+
+ /// <summary>
+ /// Options when retrieving history.
+ /// </summary>
+ public enum GetHistoryOption
+ {
+ None = 0,
+
+ ShowId = 1
+ }
+
+}
Added: branches/TRY-ChangeArchitecture/Application/CaptainHook.Engine/RepositoryInfo/IPropertyChangeInfo.cs
===================================================================
--- branches/TRY-ChangeArchitecture/Application/CaptainHook.Engine/RepositoryInfo/IPropertyChangeInfo.cs (rev 0)
+++ branches/TRY-ChangeArchitecture/Application/CaptainHook.Engine/RepositoryInfo/IPropertyChangeInfo.cs 2007-02-23 21:20:38 UTC (rev 16)
@@ -0,0 +1,20 @@
+using System;
+
+namespace CaptainHook.Engine.RepositoryInfo
+{
+ /// <summary>
+ /// Contains information about a property change commit.
+ /// </summary>
+ public interface IPropertyChangeInfo : ICommitInfo
+ {
+ /// <summary>
+ /// The username of the person making the change.
+ /// </summary>
+ string UserName { get;}
+
+ /// <summary>
+ /// The name of the property being changed.
+ /// </summary>
+ string PropertyName { get; }
+ }
+}
Added: branches/TRY-ChangeArchitecture/Application/CaptainHook.Engine/RepositoryInfo/IRepositoryChange.cs
===================================================================
--- branches/TRY-ChangeArchitecture/Application/CaptainHook.Engine/RepositoryInfo/IRepositoryChange.cs (rev 0)
+++ branches/TRY-ChangeArchitecture/Application/CaptainHook.Engine/RepositoryInfo/IRepositoryChange.cs 2007-02-23 21:20:38 UTC (rev 16)
@@ -0,0 +1,72 @@
+using System;
+
+namespace CaptainHook.Engine.RepositoryInfo
+{
+ /// <summary>
+ /// Information about a specific change within the repository.
+ /// </summary>
+ public interface IRepositoryChange
+ {
+ /// <summary>
+ /// Status of the changed item.
+ /// </summary>
+ ItemStatus Status { get;}
+
+ /// <summary>
+ /// Repository path to the changed item.
+ /// </summary>
+ string ItemPath { get; }
+ }
+
+ /// <summary>
+ /// The status of an item in the repository (file, directory).
+ /// </summary>
+ public enum ItemStatus
+ {
+ None = 0,
+
+ [StatusCode("A ", "Added")]
+ ItemAddedToRepository = 1,
+
+ [StatusCode("D ", "Deleted")]
+ ItemDeletedFromRepository = 2,
+
+ [StatusCode("U ", "Contents Changed")]
+ FileContentsChanged = 3,
+
+ [StatusCode("_U", "Property Changed")]
+ PropertiesOfItemChanged = 4,
+
+ [StatusCode("UU", "Contents and Properties Changed")]
+ FileContentsAndPropertiesChanged = 5,
+ }
+
+ [AttributeUsage(AttributeTargets.Field)]
+ public class StatusCodeAttribute : Attribute
+ {
+ public StatusCodeAttribute(string code) : this(code, string.Empty)
+ {
+ }
+
+ public StatusCodeAttribute(string code, string description)
+ {
+ this.code = code;
+ this.description = description;
+ }
+
+ public string Code
+ {
+ get { return this.code; }
+ }
+
+ string code;
+
+ public string Description
+ {
+ get { return this.description; }
+ }
+
+ string de...
[truncated message content] |
|
From: <jor...@us...> - 2007-02-23 20:43:33
|
Revision: 15
http://svn.sourceforge.net/captainhook/?rev=15&view=rev
Author: jordan-terrell
Date: 2007-02-23 12:43:28 -0800 (Fri, 23 Feb 2007)
Log Message:
-----------
Creating TRY Branch: Changing Logical Architecture
Added Paths:
-----------
tags/PRE-TRY-ChangeArchitecture/
Copied: tags/PRE-TRY-ChangeArchitecture (from rev 14, branches/TRY-ChangeArchitecture)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jor...@us...> - 2007-02-23 20:41:46
|
Revision: 14
http://svn.sourceforge.net/captainhook/?rev=14&view=rev
Author: jordan-terrell
Date: 2007-02-23 12:41:31 -0800 (Fri, 23 Feb 2007)
Log Message:
-----------
Creating TRY Branch: Changing Logical Architecture
Added Paths:
-----------
branches/TRY-ChangeArchitecture/
Copied: branches/TRY-ChangeArchitecture (from rev 13, trunk)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jor...@us...> - 2007-02-23 16:24:02
|
Revision: 13
http://svn.sourceforge.net/captainhook/?rev=13&view=rev
Author: jordan-terrell
Date: 2007-02-23 08:23:59 -0800 (Fri, 23 Feb 2007)
Log Message:
-----------
Adding all child projects to master.build so that the MasterClean target cleans all compilation output
Modified Paths:
--------------
trunk/master.build
Modified: trunk/master.build
===================================================================
--- trunk/master.build 2007-02-23 03:02:08 UTC (rev 12)
+++ trunk/master.build 2007-02-23 16:23:59 UTC (rev 13)
@@ -23,8 +23,12 @@
<Import Project="$(NCoverExplorerExtras)\NCoverExplorer.MSBuildTasks.targets" />
<ItemGroup>
+ <ChildProjects Include="Application\CaptainHook.Interfaces\CaptainHook.Interfaces.csproj" />
+ <ChildProjects Include="Application\CaptainHook.SubversionWrapper\CaptainHook.SubversionWrapper.csproj" />
<ChildProjects Include="Application\CaptainHook\CaptainHook.csproj" />
+
<ChildProjects Include="Application\CaptainHook.Plugins\CaptainHook.Plugins.csproj" />
+
<ChildProjects Include="Testing\CaptainHook.UnitTests\CaptainHook.UnitTests.csproj" />
</ItemGroup>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jor...@us...> - 2007-02-23 03:02:10
|
Revision: 12
http://svn.sourceforge.net/captainhook/?rev=12&view=rev
Author: jordan-terrell
Date: 2007-02-22 19:02:08 -0800 (Thu, 22 Feb 2007)
Log Message:
-----------
Setup "Application" and "Testing" solution folders
Modified Paths:
--------------
trunk/CaptainHook.sln
trunk/Testing/CaptainHook.UnitTests/CaptainHook.UnitTests.csproj
trunk/master.build
Added Paths:
-----------
trunk/Application/
trunk/Application/CaptainHook/
trunk/Application/CaptainHook.Interfaces/
trunk/Application/CaptainHook.Plugins/
trunk/Application/CaptainHook.SubversionWrapper/
trunk/Testing/
trunk/Testing/CaptainHook.UnitTests/
Removed Paths:
-------------
trunk/CaptainHook/
trunk/CaptainHook.Interfaces/
trunk/CaptainHook.Plugins/
trunk/CaptainHook.SubversionWrapper/
trunk/CaptainHook.UnitTests/
Copied: trunk/Application/CaptainHook (from rev 11, trunk/CaptainHook)
Copied: trunk/Application/CaptainHook.Interfaces (from rev 11, trunk/CaptainHook.Interfaces)
Copied: trunk/Application/CaptainHook.Plugins (from rev 11, trunk/CaptainHook.Plugins)
Copied: trunk/Application/CaptainHook.SubversionWrapper (from rev 11, trunk/CaptainHook.SubversionWrapper)
Modified: trunk/CaptainHook.sln
===================================================================
--- trunk/CaptainHook.sln 2007-02-23 02:31:20 UTC (rev 11)
+++ trunk/CaptainHook.sln 2007-02-23 03:02:08 UTC (rev 12)
@@ -1,15 +1,15 @@
Microsoft Visual Studio Solution File, Format Version 9.00
# Visual Studio 2005
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CaptainHook.UnitTests", "CaptainHook.UnitTests\CaptainHook.UnitTests.csproj", "{4D504BB3-E67C-479A-B2C4-4A1420887D89}"
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CaptainHook.UnitTests", "Testing\CaptainHook.UnitTests\CaptainHook.UnitTests.csproj", "{4D504BB3-E67C-479A-B2C4-4A1420887D89}"
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CaptainHook", "CaptainHook\CaptainHook.csproj", "{9FFF68FF-A417-4C43-8A85-738EE398BB4E}"
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CaptainHook", "Application\CaptainHook\CaptainHook.csproj", "{9FFF68FF-A417-4C43-8A85-738EE398BB4E}"
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CaptainHook.Interfaces", "CaptainHook.Interfaces\CaptainHook.Interfaces.csproj", "{4CE44566-B3FD-4D6F-8C90-3323C78A3405}"
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CaptainHook.Interfaces", "Application\CaptainHook.Interfaces\CaptainHook.Interfaces.csproj", "{4CE44566-B3FD-4D6F-8C90-3323C78A3405}"
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CaptainHook.SubversionWrapper", "CaptainHook.SubversionWrapper\CaptainHook.SubversionWrapper.csproj", "{2A3379EC-DFDB-456E-95EB-DE84997D52D0}"
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CaptainHook.SubversionWrapper", "Application\CaptainHook.SubversionWrapper\CaptainHook.SubversionWrapper.csproj", "{2A3379EC-DFDB-456E-95EB-DE84997D52D0}"
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CaptainHook.Plugins", "CaptainHook.Plugins\CaptainHook.Plugins.csproj", "{E5A33AEE-BAFA-4AE1-9A2A-E91CAC5EC82D}"
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CaptainHook.Plugins", "Application\CaptainHook.Plugins\CaptainHook.Plugins.csproj", "{E5A33AEE-BAFA-4AE1-9A2A-E91CAC5EC82D}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{0DA35A5A-70F9-4CC2-B6B0-D313C8E149C4}"
ProjectSection(SolutionItems) = preProject
@@ -21,6 +21,10 @@
testwithcoveragevalidation.bat = testwithcoveragevalidation.bat
EndProjectSection
EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Application", "Application", "{E139FF0C-19D2-48B8-9692-7FA949AC3A93}"
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Testing", "Testing", "{B8434F63-C6CA-4614-BCA8-5381119EBD8A}"
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@@ -51,4 +55,11 @@
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
+ GlobalSection(NestedProjects) = preSolution
+ {9FFF68FF-A417-4C43-8A85-738EE398BB4E} = {E139FF0C-19D2-48B8-9692-7FA949AC3A93}
+ {2A3379EC-DFDB-456E-95EB-DE84997D52D0} = {E139FF0C-19D2-48B8-9692-7FA949AC3A93}
+ {4CE44566-B3FD-4D6F-8C90-3323C78A3405} = {E139FF0C-19D2-48B8-9692-7FA949AC3A93}
+ {E5A33AEE-BAFA-4AE1-9A2A-E91CAC5EC82D} = {E139FF0C-19D2-48B8-9692-7FA949AC3A93}
+ {4D504BB3-E67C-479A-B2C4-4A1420887D89} = {B8434F63-C6CA-4614-BCA8-5381119EBD8A}
+ EndGlobalSection
EndGlobal
Copied: trunk/Testing/CaptainHook.UnitTests (from rev 11, trunk/CaptainHook.UnitTests)
Modified: trunk/Testing/CaptainHook.UnitTests/CaptainHook.UnitTests.csproj
===================================================================
--- trunk/CaptainHook.UnitTests/CaptainHook.UnitTests.csproj 2007-02-23 02:31:20 UTC (rev 11)
+++ trunk/Testing/CaptainHook.UnitTests/CaptainHook.UnitTests.csproj 2007-02-23 03:02:08 UTC (rev 12)
@@ -36,15 +36,15 @@
<Compile Include="SubversionTests.cs" />
</ItemGroup>
<ItemGroup>
- <ProjectReference Include="..\CaptainHook.Interfaces\CaptainHook.Interfaces.csproj">
+ <ProjectReference Include="..\..\Application\CaptainHook.Interfaces\CaptainHook.Interfaces.csproj">
<Project>{4CE44566-B3FD-4D6F-8C90-3323C78A3405}</Project>
<Name>CaptainHook.Interfaces</Name>
</ProjectReference>
- <ProjectReference Include="..\CaptainHook.SubversionWrapper\CaptainHook.SubversionWrapper.csproj">
+ <ProjectReference Include="..\..\Application\CaptainHook.SubversionWrapper\CaptainHook.SubversionWrapper.csproj">
<Project>{2A3379EC-DFDB-456E-95EB-DE84997D52D0}</Project>
<Name>CaptainHook.SubversionWrapper</Name>
</ProjectReference>
- <ProjectReference Include="..\CaptainHook\CaptainHook.csproj">
+ <ProjectReference Include="..\..\Application\CaptainHook\CaptainHook.csproj">
<Project>{9FFF68FF-A417-4C43-8A85-738EE398BB4E}</Project>
<Name>CaptainHook</Name>
</ProjectReference>
@@ -52,11 +52,11 @@
<ItemGroup>
<Reference Include="MbUnit.Framework, Version=1.0.2531.41788, Culture=neutral, PublicKeyToken=5e72ecd30bc408d5">
<SpecificVersion>False</SpecificVersion>
- <HintPath>..\External\Tools\MBUnit\MbUnit.Framework.dll</HintPath>
+ <HintPath>..\..\External\Tools\MBUnit\MbUnit.Framework.dll</HintPath>
</Reference>
<Reference Include="Rhino.Mocks, Version=2.8.7.11026, Culture=neutral, PublicKeyToken=0b3305902db7183f, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
- <HintPath>..\External\Assemblies\Rhino.Mocks.dll</HintPath>
+ <HintPath>..\..\External\Assemblies\Rhino.Mocks.dll</HintPath>
</Reference>
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
Modified: trunk/master.build
===================================================================
--- trunk/master.build 2007-02-23 02:31:20 UTC (rev 11)
+++ trunk/master.build 2007-02-23 03:02:08 UTC (rev 12)
@@ -23,9 +23,9 @@
<Import Project="$(NCoverExplorerExtras)\NCoverExplorer.MSBuildTasks.targets" />
<ItemGroup>
- <ChildProjects Include="CaptainHook\CaptainHook.csproj" />
- <ChildProjects Include="CaptainHook.Plugins\CaptainHook.Plugins.csproj" />
- <ChildProjects Include="CaptainHook.UnitTests\CaptainHook.UnitTests.csproj" />
+ <ChildProjects Include="Application\CaptainHook\CaptainHook.csproj" />
+ <ChildProjects Include="Application\CaptainHook.Plugins\CaptainHook.Plugins.csproj" />
+ <ChildProjects Include="Testing\CaptainHook.UnitTests\CaptainHook.UnitTests.csproj" />
</ItemGroup>
<ItemGroup>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jor...@us...> - 2007-02-23 02:31:23
|
Revision: 11
http://svn.sourceforge.net/captainhook/?rev=11&view=rev
Author: jordan-terrell
Date: 2007-02-22 18:31:20 -0800 (Thu, 22 Feb 2007)
Log Message:
-----------
Renamed "Velocit.Hook.Plugins" to "CaptainHook.Plugins"
Renamed "UnitTests" to "CaptainHook.UnitTests"
Renamed "CaptainHookExe" to "CaptainHook"
Renamed "CaptainHookSolution" to "CaptainHook"
Modified Paths:
--------------
trunk/master.build
Added Paths:
-----------
trunk/CaptainHook/
trunk/CaptainHook/App.config
trunk/CaptainHook/ApplicationHost.cs
trunk/CaptainHook/CaptainHook.csproj
trunk/CaptainHook/CommandLine/
trunk/CaptainHook/OutputHandler.cs
trunk/CaptainHook/PluginLoader.cs
trunk/CaptainHook/Program.cs
trunk/CaptainHook/Properties/
trunk/CaptainHook/Resources/
trunk/CaptainHook/SampleBatchFiles/
trunk/CaptainHook/Settings.cs
trunk/CaptainHook.Plugins/
trunk/CaptainHook.Plugins/CaptainHook.Plugins.csproj
trunk/CaptainHook.Plugins/PostCommitEmailHook.cs
trunk/CaptainHook.Plugins/Properties/
trunk/CaptainHook.Plugins/RequireLogMessageHook.cs
trunk/CaptainHook.Plugins/Resources/
trunk/CaptainHook.UnitTests/
trunk/CaptainHook.UnitTests/ArgumentsTests.cs
trunk/CaptainHook.UnitTests/CaptainHook.UnitTests.csproj
trunk/CaptainHook.UnitTests/HookHandlerApplicationTests.cs
trunk/CaptainHook.UnitTests/Properties/
trunk/CaptainHook.UnitTests/SubversionTests.cs
trunk/CaptainHook.sln
Removed Paths:
-------------
trunk/CaptainHook/App.config
trunk/CaptainHook/ApplicationHost.cs
trunk/CaptainHook/CaptainHook.csproj
trunk/CaptainHook/CommandLine/
trunk/CaptainHook/OutputHandler.cs
trunk/CaptainHook/PluginLoader.cs
trunk/CaptainHook/Program.cs
trunk/CaptainHook/Properties/
trunk/CaptainHook/Resources/
trunk/CaptainHook/SampleBatchFiles/
trunk/CaptainHook/Settings.cs
trunk/CaptainHook.Plugins/PostCommitEmailHook.cs
trunk/CaptainHook.Plugins/Properties/
trunk/CaptainHook.Plugins/RequireLogMessageHook.cs
trunk/CaptainHook.Plugins/Resources/
trunk/CaptainHook.Plugins/Velocit.Hook.Plugins.csproj
trunk/CaptainHook.UnitTests/ArgumentsTests.cs
trunk/CaptainHook.UnitTests/ExternalDependencies/
trunk/CaptainHook.UnitTests/HookHandlerApplicationTests.cs
trunk/CaptainHook.UnitTests/Properties/
trunk/CaptainHook.UnitTests/SubversionTests.cs
trunk/CaptainHook.UnitTests/UnitTests.csproj
trunk/CaptainHookExe/
trunk/CaptainHookSolution.sln
trunk/UnitTests/
trunk/Velocit.Hook.Plugins/
Copied: trunk/CaptainHook (from rev 9, trunk/CaptainHookExe)
Deleted: trunk/CaptainHook/App.config
===================================================================
--- trunk/CaptainHookExe/App.config 2007-02-23 01:25:56 UTC (rev 9)
+++ trunk/CaptainHook/App.config 2007-02-23 02:31:20 UTC (rev 11)
@@ -1,15 +0,0 @@
-<?xml version="1.0" encoding="utf-8" ?>
-<configuration>
- <appSettings>
- <add key="SmtpServerHost" value="smtp.1and1.com"/>
- <add key="SmtpServerPort" value="25"/>
- <add key="SmtpServerUser" value="m37821520-automated"/>
- <add key="SmtpServerPassword" value="aut0m@ted!!!"/>
-
- <add key="PluginFolder" value="plugins" />
-
- <!-- These can be specified by the command line flags -->
- <add key="SvnExePath" value="svn.exe" />
- <add key="SvnLookExePath" value="svnlook.exe" />
- </appSettings>
-</configuration>
\ No newline at end of file
Copied: trunk/CaptainHook/App.config (from rev 10, trunk/CaptainHookExe/App.config)
===================================================================
--- trunk/CaptainHook/App.config (rev 0)
+++ trunk/CaptainHook/App.config 2007-02-23 02:31:20 UTC (rev 11)
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<configuration>
+ <appSettings>
+ <add key="SmtpServerHost" value="smtp.1and1.com"/>
+ <add key="SmtpServerPort" value="25"/>
+ <add key="SmtpServerUser" value="m37821520-automated"/>
+ <add key="SmtpServerPassword" value="aut0m@ted!!!"/>
+
+ <add key="PluginFolder" value="plugins" />
+
+ <!-- These can be specified by the command line flags -->
+ <add key="SvnExePath" value="svn.exe" />
+ <add key="SvnLookExePath" value="svnlook.exe" />
+ </appSettings>
+</configuration>
\ No newline at end of file
Deleted: trunk/CaptainHook/ApplicationHost.cs
===================================================================
--- trunk/CaptainHookExe/ApplicationHost.cs 2007-02-23 01:25:56 UTC (rev 9)
+++ trunk/CaptainHook/ApplicationHost.cs 2007-02-23 02:31:20 UTC (rev 11)
@@ -1,229 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Configuration;
-using System.Net;
-using System.Net.Mail;
-using System.Text;
-using CaptainHook.CommandLine;
-using CaptainHook.Subversion;
-using CaptainHook.Subversion.Hook;
-
-namespace CaptainHook
-{
- public class ApplicationHost : IApplicationHost
- {
- Arguments arguments;
- PluginLoader pluginLoader;
-
- /// <summary>
- /// Constructor. Reads in the arguments.
- /// </summary>
- /// <param name="args"></param>
- public ApplicationHost(Arguments args, IOutputHandler output, PluginLoader pluginLoader)
- {
- if (output == null)
- throw new ArgumentNullException("output", "OutputMessageHandler should not be null");
-
- if (pluginLoader == null)
- throw new ArgumentNullException("pluginLoader", "Without the plugin loader, how will we handle the hooks?");
-
- if (args == null)
- throw new ArgumentNullException("args", "Cannot instantiate with null arguments.");
-
- this.output = output;
- this.arguments = args;
-
- this.pluginLoader = pluginLoader;
- this.subversionApp = new SubversionTranslator(new SubversionRepository(this.Repository, args.SvnExePath, args.SvnLookExePath, output));
- }
-
- /// <summary>
- /// The path to the Subversion repository.
- /// </summary>
- public string Repository
- {
- get { return this.arguments.Repository; }
- }
-
- /// <summary>
- /// Handles the hook event and returns whether or not
- /// Subversion should continue with the transaction.
- /// </summary>
- /// <remarks>
- /// If any hook votes to stop the transaction, the transaction will not
- /// continue, though the other hooks will have a chance to run.
- /// </remarks>
- /// <returns></returns>
- public bool HandleHookEvent()
- {
- bool continueTransaction = true;
- ICollection<SubversionHook> hooks = pluginLoader.LoadPlugins(this.arguments.HookType);
- foreach(SubversionHook hook in hooks)
- {
- try
- {
- hook.Initialize(this);
-
- if (!hook.HandleHook(PrepareCommitInfo(this.arguments)))
- {
- output.Write(string.Format("The hook '{0}' votes to not continue the transaction.", hook.GetType().Name));
- continueTransaction = false;
- }
-
- }
- catch(Exception e)
- {
- output.WriteError("Error occurred while executing the hook {0}", e, hook.GetType().FullName);
- }
- }
-
- output.Write("Continuing Transaction?: " + continueTransaction);
-
- return continueTransaction;
- }
-
- ICommitInfo PrepareCommitInfo(Arguments args)
- {
- if (!String.IsNullOrEmpty(args.TransactionName))
- return this.SubversionApplication.GetCommitInformation(args.TransactionName);
-
- if (!String.IsNullOrEmpty(args.PropertyName) && !String.IsNullOrEmpty(args.UserName))
- {
- ICommitInfo commitInfo = this.SubversionApplication.GetCommitInformation(args.Revision);
- return new PropertyChangeInfo(args.PropertyName, args.UserName, commitInfo.Author, commitInfo.DateStamp, commitInfo.LogMessageSize, commitInfo.LogMessage);
- }
-
- if (!String.IsNullOrEmpty(args.UserName))
- {
- return new PropertyChangeInfo(null, args.UserName, null, DateTime.MinValue, 0, null);
- }
- else
- {
- return this.SubversionApplication.GetCommitInformation(args.Revision);
- }
- }
-
- /// <summary>
- /// Sends an email.
- /// </summary>
- /// <param name="from"></param>
- /// <param name="to"></param>
- /// <param name="ccEmails"></param>
- /// <param name="bccEmails"></param>
- /// <param name="subject"></param>
- /// <param name="body"></param>
- public void SendEmail(MailAddress from, MailAddressCollection to, MailAddressCollection ccEmails, MailAddressCollection bccEmails, string subject, string body)
- {
- if (from == null)
- throw new ArgumentNullException("A FROM: address is required.");
-
- if(to == null)
- throw new ArgumentNullException("At least one TO: address is required.");
-
- if(to.Count == 0)
- throw new ArgumentOutOfRangeException("At least one TO: address is required.");
-
- SmtpClient smtp = new SmtpClient();
- smtp.Host = SmtpServerHost;
- smtp.Port = SmtpServerPort;
-
- if(!String.IsNullOrEmpty(SmtpServerUser))
- {
- output.Write("Setting credentials - UserName: " + this.SmtpServerUser);
- NetworkCredential basicAuthCredential = new NetworkCredential(this.SmtpServerUser, this.SmtpServerPassword);
- smtp.UseDefaultCredentials = false;
- smtp.Credentials = basicAuthCredential;
- }
-
- MailMessage message = new MailMessage();
- output.Write("From: {0}", from.ToString());
- message.From = from;
- AddRange(message.To, to);
- AddRange(message.CC, ccEmails);
- AddRange(message.Bcc, bccEmails);
- message.Subject = subject;
- message.Body = body;
- message.BodyEncoding = Encoding.UTF8;
-
- output.Write("Sending Email via Host '{0}:{1}", smtp.Host, smtp.Port);
- try
- {
- smtp.Send(message);
- }
- catch(SmtpException e)
- {
- output.WriteError("Error while sending email", e);
- }
- }
-
- void AddRange(MailAddressCollection destination, MailAddressCollection toBeAdded)
- {
- if (destination == null)
- throw new ArgumentNullException("destination", "Cannot add emails to a null MailAddressCollection.");
- if(toBeAdded == null)
- return;
- foreach (MailAddress toAddress in toBeAdded)
- {
- destination.Add(toAddress);
- }
- }
-
- private string SmtpServerHost
- {
- get
- {
- return ConfigurationManager.AppSettings["SmtpServerHost"];
- }
- }
-
- private int SmtpServerPort
- {
- get
- {
- if (String.IsNullOrEmpty(ConfigurationManager.AppSettings["SmtpServerPort"]))
- return 25;
- return int.Parse(ConfigurationManager.AppSettings["SmtpServerPort"]);
- }
- }
-
- private string SmtpServerUser
- {
- get
- {
- return ConfigurationManager.AppSettings["SmtpServerUser"];
- }
- }
-
- private string SmtpServerPassword
- {
- get
- {
- return ConfigurationManager.AppSettings["SmtpServerPassword"];
- }
- }
-
- public ISubversionTranslator SubversionApplication
- {
- get
- {
- return this.subversionApp;
- }
- }
-
- ISubversionTranslator subversionApp;
-
- /// <summary>
- /// Used to write output. Probably to the Console, but
- /// you never know.
- /// </summary>
- public IOutputHandler Output
- {
- get
- {
- return output;
- }
- }
-
- IOutputHandler output;
- }
-}
Copied: trunk/CaptainHook/ApplicationHost.cs (from rev 10, trunk/CaptainHookExe/ApplicationHost.cs)
===================================================================
--- trunk/CaptainHook/ApplicationHost.cs (rev 0)
+++ trunk/CaptainHook/ApplicationHost.cs 2007-02-23 02:31:20 UTC (rev 11)
@@ -0,0 +1,229 @@
+using System;
+using System.Collections.Generic;
+using System.Configuration;
+using System.Net;
+using System.Net.Mail;
+using System.Text;
+using CaptainHook.CommandLine;
+using CaptainHook.Subversion;
+using CaptainHook.Subversion.Hook;
+
+namespace CaptainHook
+{
+ public class ApplicationHost : IApplicationHost
+ {
+ Arguments arguments;
+ PluginLoader pluginLoader;
+
+ /// <summary>
+ /// Constructor. Reads in the arguments.
+ /// </summary>
+ /// <param name="args"></param>
+ public ApplicationHost(Arguments args, IOutputHandler output, PluginLoader pluginLoader)
+ {
+ if (output == null)
+ throw new ArgumentNullException("output", "OutputMessageHandler should not be null");
+
+ if (pluginLoader == null)
+ throw new ArgumentNullException("pluginLoader", "Without the plugin loader, how will we handle the hooks?");
+
+ if (args == null)
+ throw new ArgumentNullException("args", "Cannot instantiate with null arguments.");
+
+ this.output = output;
+ this.arguments = args;
+
+ this.pluginLoader = pluginLoader;
+ this.subversionApp = new SubversionTranslator(new SubversionRepository(this.Repository, args.SvnExePath, args.SvnLookExePath, output));
+ }
+
+ /// <summary>
+ /// The path to the Subversion repository.
+ /// </summary>
+ public string Repository
+ {
+ get { return this.arguments.Repository; }
+ }
+
+ /// <summary>
+ /// Handles the hook event and returns whether or not
+ /// Subversion should continue with the transaction.
+ /// </summary>
+ /// <remarks>
+ /// If any hook votes to stop the transaction, the transaction will not
+ /// continue, though the other hooks will have a chance to run.
+ /// </remarks>
+ /// <returns></returns>
+ public bool HandleHookEvent()
+ {
+ bool continueTransaction = true;
+ ICollection<SubversionHook> hooks = pluginLoader.LoadPlugins(this.arguments.HookType);
+ foreach(SubversionHook hook in hooks)
+ {
+ try
+ {
+ hook.Initialize(this);
+
+ if (!hook.HandleHook(PrepareCommitInfo(this.arguments)))
+ {
+ output.Write(string.Format("The hook '{0}' votes to not continue the transaction.", hook.GetType().Name));
+ continueTransaction = false;
+ }
+
+ }
+ catch(Exception e)
+ {
+ output.WriteError("Error occurred while executing the hook {0}", e, hook.GetType().FullName);
+ }
+ }
+
+ output.Write("Continuing Transaction?: " + continueTransaction);
+
+ return continueTransaction;
+ }
+
+ ICommitInfo PrepareCommitInfo(Arguments args)
+ {
+ if (!String.IsNullOrEmpty(args.TransactionName))
+ return this.SubversionApplication.GetCommitInformation(args.TransactionName);
+
+ if (!String.IsNullOrEmpty(args.PropertyName) && !String.IsNullOrEmpty(args.UserName))
+ {
+ ICommitInfo commitInfo = this.SubversionApplication.GetCommitInformation(args.Revision);
+ return new PropertyChangeInfo(args.PropertyName, args.UserName, commitInfo.Author, commitInfo.DateStamp, commitInfo.LogMessageSize, commitInfo.LogMessage);
+ }
+
+ if (!String.IsNullOrEmpty(args.UserName))
+ {
+ return new PropertyChangeInfo(null, args.UserName, null, DateTime.MinValue, 0, null);
+ }
+ else
+ {
+ return this.SubversionApplication.GetCommitInformation(args.Revision);
+ }
+ }
+
+ /// <summary>
+ /// Sends an email.
+ /// </summary>
+ /// <param name="from"></param>
+ /// <param name="to"></param>
+ /// <param name="ccEmails"></param>
+ /// <param name="bccEmails"></param>
+ /// <param name="subject"></param>
+ /// <param name="body"></param>
+ public void SendEmail(MailAddress from, MailAddressCollection to, MailAddressCollection ccEmails, MailAddressCollection bccEmails, string subject, string body)
+ {
+ if (from == null)
+ throw new ArgumentNullException("A FROM: address is required.");
+
+ if(to == null)
+ throw new ArgumentNullException("At least one TO: address is required.");
+
+ if(to.Count == 0)
+ throw new ArgumentOutOfRangeException("At least one TO: address is required.");
+
+ SmtpClient smtp = new SmtpClient();
+ smtp.Host = SmtpServerHost;
+ smtp.Port = SmtpServerPort;
+
+ if(!String.IsNullOrEmpty(SmtpServerUser))
+ {
+ output.Write("Setting credentials - UserName: " + this.SmtpServerUser);
+ NetworkCredential basicAuthCredential = new NetworkCredential(this.SmtpServerUser, this.SmtpServerPassword);
+ smtp.UseDefaultCredentials = false;
+ smtp.Credentials = basicAuthCredential;
+ }
+
+ MailMessage message = new MailMessage();
+ output.Write("From: {0}", from.ToString());
+ message.From = from;
+ AddRange(message.To, to);
+ AddRange(message.CC, ccEmails);
+ AddRange(message.Bcc, bccEmails);
+ message.Subject = subject;
+ message.Body = body;
+ message.BodyEncoding = Encoding.UTF8;
+
+ output.Write("Sending Email via Host '{0}:{1}", smtp.Host, smtp.Port);
+ try
+ {
+ smtp.Send(message);
+ }
+ catch(SmtpException e)
+ {
+ output.WriteError("Error while sending email", e);
+ }
+ }
+
+ void AddRange(MailAddressCollection destination, MailAddressCollection toBeAdded)
+ {
+ if (destination == null)
+ throw new ArgumentNullException("destination", "Cannot add emails to a null MailAddressCollection.");
+ if(toBeAdded == null)
+ return;
+ foreach (MailAddress toAddress in toBeAdded)
+ {
+ destination.Add(toAddress);
+ }
+ }
+
+ private string SmtpServerHost
+ {
+ get
+ {
+ return ConfigurationManager.AppSettings["SmtpServerHost"];
+ }
+ }
+
+ private int SmtpServerPort
+ {
+ get
+ {
+ if (String.IsNullOrEmpty(ConfigurationManager.AppSettings["SmtpServerPort"]))
+ return 25;
+ return int.Parse(ConfigurationManager.AppSettings["SmtpServerPort"]);
+ }
+ }
+
+ private string SmtpServerUser
+ {
+ get
+ {
+ return ConfigurationManager.AppSettings["SmtpServerUser"];
+ }
+ }
+
+ private string SmtpServerPassword
+ {
+ get
+ {
+ return ConfigurationManager.AppSettings["SmtpServerPassword"];
+ }
+ }
+
+ public ISubversionTranslator SubversionApplication
+ {
+ get
+ {
+ return this.subversionApp;
+ }
+ }
+
+ ISubversionTranslator subversionApp;
+
+ /// <summary>
+ /// Used to write output. Probably to the Console, but
+ /// you never know.
+ /// </summary>
+ public IOutputHandler Output
+ {
+ get
+ {
+ return output;
+ }
+ }
+
+ IOutputHandler output;
+ }
+}
Deleted: trunk/CaptainHook/CaptainHook.csproj
===================================================================
--- trunk/CaptainHookExe/CaptainHook.csproj 2007-02-23 01:25:56 UTC (rev 9)
+++ trunk/CaptainHook/CaptainHook.csproj 2007-02-23 02:31:20 UTC (rev 11)
@@ -1,79 +0,0 @@
-<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <PropertyGroup>
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <ProductVersion>8.0.50727</ProductVersion>
- <SchemaVersion>2.0</SchemaVersion>
- <ProjectGuid>{9FFF68FF-A417-4C43-8A85-738EE398BB4E}</ProjectGuid>
- <OutputType>Exe</OutputType>
- <AppDesignerFolder>Properties</AppDesignerFolder>
- <RootNamespace>CaptainHook</RootNamespace>
- <AssemblyName>CaptainHook</AssemblyName>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
- <DebugSymbols>true</DebugSymbols>
- <DebugType>full</DebugType>
- <Optimize>false</Optimize>
- <OutputPath>bin\Debug\</OutputPath>
- <DefineConstants>DEBUG;TRACE</DefineConstants>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- <PlatformTarget>AnyCPU</PlatformTarget>
- <TreatWarningsAsErrors>true</TreatWarningsAsErrors>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
- <DebugType>pdbonly</DebugType>
- <Optimize>true</Optimize>
- <OutputPath>bin\Release\</OutputPath>
- <DefineConstants>TRACE</DefineConstants>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- <PlatformTarget>AnyCPU</PlatformTarget>
- </PropertyGroup>
- <ItemGroup>
- <Reference Include="System" />
- <Reference Include="System.configuration" />
- <Reference Include="System.Data" />
- <Reference Include="System.Xml" />
- </ItemGroup>
- <ItemGroup>
- <Compile Include="CommandLine\Arguments.cs" />
- <Compile Include="CommandLine\CommandLineSwitchAttribute.cs" />
- <Compile Include="CommandLine\Parser.cs" />
- <Compile Include="ApplicationHost.cs" />
- <Compile Include="OutputHandler.cs" />
- <Compile Include="PluginLoader.cs" />
- <Compile Include="Program.cs" />
- <Compile Include="Properties\AssemblyInfo.cs" />
- <Compile Include="Settings.cs" />
- </ItemGroup>
- <ItemGroup>
- <None Include="App.config" />
- <None Include="SampleBatchFiles\post-revprop-change.bat" />
- <None Include="SampleBatchFiles\pre-revprop-change.bat" />
- <None Include="SampleBatchFiles\start-commit.bat" />
- <None Include="SampleBatchFiles\pre-commit.bat" />
- <None Include="SampleBatchFiles\post-commit.bat" />
- </ItemGroup>
- <ItemGroup>
- <ProjectReference Include="..\CaptainHook.Interfaces\CaptainHook.Interfaces.csproj">
- <Project>{4CE44566-B3FD-4D6F-8C90-3323C78A3405}</Project>
- <Name>CaptainHook.Interfaces</Name>
- </ProjectReference>
- <ProjectReference Include="..\CaptainHook.SubversionWrapper\CaptainHook.SubversionWrapper.csproj">
- <Project>{2A3379EC-DFDB-456E-95EB-DE84997D52D0}</Project>
- <Name>CaptainHook.SubversionWrapper</Name>
- </ProjectReference>
- </ItemGroup>
- <ItemGroup>
- <EmbeddedResource Include="Resources\Usage.txt" />
- </ItemGroup>
- <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
- <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
- Other similar extension points exist, see Microsoft.Common.targets.
- <Target Name="BeforeBuild">
- </Target>
- <Target Name="AfterBuild">
- </Target>
- -->
-</Project>
\ No newline at end of file
Copied: trunk/CaptainHook/CaptainHook.csproj (from rev 10, trunk/CaptainHookExe/CaptainHook.csproj)
===================================================================
--- trunk/CaptainHook/CaptainHook.csproj (rev 0)
+++ trunk/CaptainHook/CaptainHook.csproj 2007-02-23 02:31:20 UTC (rev 11)
@@ -0,0 +1,79 @@
+<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <ProductVersion>8.0.50727</ProductVersion>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{9FFF68FF-A417-4C43-8A85-738EE398BB4E}</ProjectGuid>
+ <OutputType>Exe</OutputType>
+ <AppDesignerFolder>Properties</AppDesignerFolder>
+ <RootNamespace>CaptainHook</RootNamespace>
+ <AssemblyName>CaptainHook</AssemblyName>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ <DebugSymbols>true</DebugSymbols>
+ <DebugType>full</DebugType>
+ <Optimize>false</Optimize>
+ <OutputPath>bin\Debug\</OutputPath>
+ <DefineConstants>DEBUG;TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ <PlatformTarget>AnyCPU</PlatformTarget>
+ <TreatWarningsAsErrors>true</TreatWarningsAsErrors>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+ <DebugType>pdbonly</DebugType>
+ <Optimize>true</Optimize>
+ <OutputPath>bin\Release\</OutputPath>
+ <DefineConstants>TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ <PlatformTarget>AnyCPU</PlatformTarget>
+ </PropertyGroup>
+ <ItemGroup>
+ <Reference Include="System" />
+ <Reference Include="System.configuration" />
+ <Reference Include="System.Data" />
+ <Reference Include="System.Xml" />
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="CommandLine\Arguments.cs" />
+ <Compile Include="CommandLine\CommandLineSwitchAttribute.cs" />
+ <Compile Include="CommandLine\Parser.cs" />
+ <Compile Include="ApplicationHost.cs" />
+ <Compile Include="OutputHandler.cs" />
+ <Compile Include="PluginLoader.cs" />
+ <Compile Include="Program.cs" />
+ <Compile Include="Properties\AssemblyInfo.cs" />
+ <Compile Include="Settings.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="App.config" />
+ <None Include="SampleBatchFiles\post-revprop-change.bat" />
+ <None Include="SampleBatchFiles\pre-revprop-change.bat" />
+ <None Include="SampleBatchFiles\start-commit.bat" />
+ <None Include="SampleBatchFiles\pre-commit.bat" />
+ <None Include="SampleBatchFiles\post-commit.bat" />
+ </ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\CaptainHook.Interfaces\CaptainHook.Interfaces.csproj">
+ <Project>{4CE44566-B3FD-4D6F-8C90-3323C78A3405}</Project>
+ <Name>CaptainHook.Interfaces</Name>
+ </ProjectReference>
+ <ProjectReference Include="..\CaptainHook.SubversionWrapper\CaptainHook.SubversionWrapper.csproj">
+ <Project>{2A3379EC-DFDB-456E-95EB-DE84997D52D0}</Project>
+ <Name>CaptainHook.SubversionWrapper</Name>
+ </ProjectReference>
+ </ItemGroup>
+ <ItemGroup>
+ <EmbeddedResource Include="Resources\Usage.txt" />
+ </ItemGroup>
+ <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
+ <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
+ Other similar extension points exist, see Microsoft.Common.targets.
+ <Target Name="BeforeBuild">
+ </Target>
+ <Target Name="AfterBuild">
+ </Target>
+ -->
+</Project>
\ No newline at end of file
Copied: trunk/CaptainHook/CommandLine (from rev 10, trunk/CaptainHookExe/CommandLine)
Deleted: trunk/CaptainHook/OutputHandler.cs
===================================================================
--- trunk/CaptainHookExe/OutputHandler.cs 2007-02-23 01:25:56 UTC (rev 9)
+++ trunk/CaptainHook/OutputHandler.cs 2007-02-23 02:31:20 UTC (rev 11)
@@ -1,119 +0,0 @@
-using System;
-
-namespace CaptainHook
-{
- /// <summary>
- /// Class used to encapsulate output messages. In this case,
- /// it just writes them to the Console.
- /// </summary>
- public class OutputHandler : IOutputHandler
- {
- public OutputHandler()
- {
- }
-
- public bool Debug
- {
- get { return this.debug; }
- set { this.debug = value; }
- }
-
- bool debug;
-
- public virtual void Write()
- {
- Console.WriteLine();
- }
-
- public void Write(string format)
- {
- Console.WriteLine(format);
- }
-
- public virtual void Write(string format, params object[] parameters)
- {
- Console.WriteLine(format, parameters);
- }
-
- public virtual void WriteDebug()
- {
- if(Debug)
- Console.WriteLine();
- }
-
- public void WriteDebug(string message)
- {
- if(Debug)
- Console.WriteLine("DEBUG: " + message);
- }
-
- public virtual void WriteDebug(string format, params object[] parameters)
- {
- if(Debug)
- Console.WriteLine("DEBUG: " + format, parameters);
- }
-
- /// <summary>
- /// Writes an error message to the standard error stream. This
- /// will show up as the error message if a commit is denied
- /// in the subversion client.
- /// </summary>
- /// <param name="format"></param>
- /// <param name="exc"></param>
- /// <param name="parameters"></param>
- public virtual void WriteError(string format, Exception exc, params object[] parameters)
- {
- Console.Error.WriteLine("DOH! "+ format, parameters);
- WriteException(exc);
- }
-
- void WriteException(Exception exception)
- {
- Console.Error.WriteLine("EXCEPTION: " + exception.GetType().FullName);
- Console.Error.WriteLine("MESSAGE: " + exception.Message);
- Console.Error.WriteLine("STACK TRACE");
- Console.Error.WriteLine(exception.StackTrace);
- if (exception.InnerException != null)
- {
- Console.Error.WriteLine("----------------------");
- Console.Error.WriteLine("INNER EXCEPTION");
- WriteException(exception.InnerException);
-
- }
- }
-
- /// <summary>
- /// Writes an error message to the standard error stream. This
- /// will show up as the error message if a commit is denied
- /// in the subversion client.
- /// </summary>
- /// <param name="format"></param>
- /// <param name="parameters"></param>
- public virtual void WriteError(string format, params object[] parameters)
- {
- Console.Error.WriteLine("WHOOPS! " + format, parameters);
- }
-
- /// <summary>
- /// Writes an error message to the standard error stream. This
- /// will show up as the error message if a commit is denied
- /// in the subversion client.
- /// </summary>
- /// <param name="message"></param>
- public void WriteError(string message)
- {
- Console.Error.WriteLine("WHOOPS! " + message);
- }
-
- /// <summary>
- /// Writes an error message to the standard error stream. This
- /// will show up as the error message if a commit is denied
- /// in the subversion client.
- /// </summary>
- /// <param name="message"></param>
- public virtual void WriteHelp(string message)
- {
- Console.WriteLine(message);
- }
- }
-}
Copied: trunk/CaptainHook/OutputHandler.cs (from rev 10, trunk/CaptainHookExe/OutputHandler.cs)
===================================================================
--- trunk/CaptainHook/OutputHandler.cs (rev 0)
+++ trunk/CaptainHook/OutputHandler.cs 2007-02-23 02:31:20 UTC (rev 11)
@@ -0,0 +1,119 @@
+using System;
+
+namespace CaptainHook
+{
+ /// <summary>
+ /// Class used to encapsulate output messages. In this case,
+ /// it just writes them to the Console.
+ /// </summary>
+ public class OutputHandler : IOutputHandler
+ {
+ public OutputHandler()
+ {
+ }
+
+ public bool Debug
+ {
+ get { return this.debug; }
+ set { this.debug = value; }
+ }
+
+ bool debug;
+
+ public virtual void Write()
+ {
+ Console.WriteLine();
+ }
+
+ public void Write(string format)
+ {
+ Console.WriteLine(format);
+ }
+
+ public virtual void Write(string format, params object[] parameters)
+ {
+ Console.WriteLine(format, parameters);
+ }
+
+ public virtual void WriteDebug()
+ {
+ if(Debug)
+ Console.WriteLine();
+ }
+
+ public void WriteDebug(string message)
+ {
+ if(Debug)
+ Console.WriteLine("DEBUG: " + message);
+ }
+
+ public virtual void WriteDebug(string format, params object[] parameters)
+ {
+ if(Debug)
+ Console.WriteLine("DEBUG: " + format, parameters);
+ }
+
+ /// <summary>
+ /// Writes an error message to the standard error stream. This
+ /// will show up as the error message if a commit is denied
+ /// in the subversion client.
+ /// </summary>
+ /// <param name="format"></param>
+ /// <param name="exc"></param>
+ /// <param name="parameters"></param>
+ public virtual void WriteError(string format, Exception exc, params object[] parameters)
+ {
+ Console.Error.WriteLine("DOH! "+ format, parameters);
+ WriteException(exc);
+ }
+
+ void WriteException(Exception exception)
+ {
+ Console.Error.WriteLine("EXCEPTION: " + exception.GetType().FullName);
+ Console.Error.WriteLine("MESSAGE: " + exception.Message);
+ Console.Error.WriteLine("STACK TRACE");
+ Console.Error.WriteLine(exception.StackTrace);
+ if (exception.InnerException != null)
+ {
+ Console.Error.WriteLine("----------------------");
+ Console.Error.WriteLine("INNER EXCEPTION");
+ WriteException(exception.InnerException);
+
+ }
+ }
+
+ /// <summary>
+ /// Writes an error message to the standard error stream. This
+ /// will show up as the error message if a commit is denied
+ /// in the subversion client.
+ /// </summary>
+ /// <param name="format"></param>
+ /// <param name="parameters"></param>
+ public virtual void WriteError(string format, params object[] parameters)
+ {
+ Console.Error.WriteLine("WHOOPS! " + format, parameters);
+ }
+
+ /// <summary>
+ /// Writes an error message to the standard error stream. This
+ /// will show up as the error message if a commit is denied
+ /// in the subversion client.
+ /// </summary>
+ /// <param name="message"></param>
+ public void WriteError(string message)
+ {
+ Console.Error.WriteLine("WHOOPS! " + message);
+ }
+
+ /// <summary>
+ /// Writes an error message to the standard error stream. This
+ /// will show up as the error message if a commit is denied
+ /// in the subversion client.
+ /// </summary>
+ /// <param name="message"></param>
+ public virtual void WriteHelp(string message)
+ {
+ Console.WriteLine(message);
+ }
+ }
+}
Deleted: trunk/CaptainHook/PluginLoader.cs
===================================================================
--- trunk/CaptainHookExe/PluginLoader.cs 2007-02-23 01:25:56 UTC (rev 9)
+++ trunk/CaptainHook/PluginLoader.cs 2007-02-23 02:31:20 UTC (rev 11)
@@ -1,75 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Collections.ObjectModel;
-using System.IO;
-using System.Reflection;
-using CaptainHook;
-using CaptainHook.Subversion.Hook;
-
-namespace CaptainHook
-{
- /// <summary>
- /// this is an exceedingly simple plugin loader.
- /// </summary>
- public class PluginLoader
- {
- IOutputHandler output;
-
- /// <summary>
- /// Constructs an instance of the plugin loader.
- /// </summary>
- /// <param name="output"></param>
- public PluginLoader(IOutputHandler output)
- {
- this.output = output;
- }
-
- /// <summary>
- /// Returns a collection of plugins matching the specified type.
- /// </summary>
- /// <param name="pluginType"></param>
- /// <returns></returns>
- public ICollection<SubversionHook> LoadPlugins(Type pluginType)
- {
- ICollection<SubversionHook> hooks = new Collection<SubversionHook>();
- //Look in plugin directory.
- string pluginDirectoryPath = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), Settings.PluginFolder);
- string[] dlls = Directory.GetFiles(pluginDirectoryPath, "*.dll");
-
- output.WriteDebug("{0} Dlls found", dlls.Length);
-
- foreach(string assemblyFilePath in dlls)
- {
- output.WriteDebug("Loading assembly '{0}'", assemblyFilePath);
-
- Assembly assembly = Assembly.LoadFrom(assemblyFilePath);
- if(assembly == null)
- continue;
-
- Type[] types = assembly.GetTypes();
- foreach(Type type in types)
- {
- output.WriteDebug("Checking if type '{0}' implements '{1}'", type.Name, pluginType.Name);
- if (pluginType.IsAssignableFrom(type))
- {
- output.WriteDebug("Type '{0}' DOES implement {1}", type.FullName, pluginType.Name);
-
- ConstructorInfo ctor = type.GetConstructor(Type.EmptyTypes);
- SubversionHook hook = (SubversionHook)ctor.Invoke(null);
- if(hook == null)
- continue;
-
- hooks.Add(hook);
- }
- else
- {
- output.WriteDebug("type '{0}' does not implement {1}.", type.FullName, pluginType.FullName);
- }
- }
- }
-
- output.Write("Found and Loaded {0} hooks.", hooks.Count);
- return hooks;
- }
- }
-}
Copied: trunk/CaptainHook/PluginLoader.cs (from rev 10, trunk/CaptainHookExe/PluginLoader.cs)
===================================================================
--- trunk/CaptainHook/PluginLoader.cs (rev 0)
+++ trunk/CaptainHook/PluginLoader.cs 2007-02-23 02:31:20 UTC (rev 11)
@@ -0,0 +1,75 @@
+using System;
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+using System.IO;
+using System.Reflection;
+using CaptainHook;
+using CaptainHook.Subversion.Hook;
+
+namespace CaptainHook
+{
+ /// <summary>
+ /// this is an exceedingly simple plugin loader.
+ /// </summary>
+ public class PluginLoader
+ {
+ IOutputHandler output;
+
+ /// <summary>
+ /// Constructs an instance of the plugin loader.
+ /// </summary>
+ /// <param name="output"></param>
+ public PluginLoader(IOutputHandler output)
+ {
+ this.output = output;
+ }
+
+ /// <summary>
+ /// Returns a collection of plugins matching the specified type.
+ /// </summary>
+ /// <param name="pluginType"></param>
+ /// <returns></returns>
+ public ICollection<SubversionHook> LoadPlugins(Type pluginType)
+ {
+ ICollection<SubversionHook> hooks = new Collection<SubversionHook>();
+ //Look in plugin directory.
+ string pluginDirectoryPath = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), Settings.PluginFolder);
+ string[] dlls = Directory.GetFiles(pluginDirectoryPath, "*.dll");
+
+ output.WriteDebug("{0} Dlls found", dlls.Length);
+
+ foreach(string assemblyFilePath in dlls)
+ {
+ output.WriteDebug("Loading assembly '{0}'", assemblyFilePath);
+
+ Assembly assembly = Assembly.LoadFrom(assemblyFilePath);
+ if(assembly == null)
+ continue;
+
+ Type[] types = assembly.GetTypes();
+ foreach(Type type in types)
+ {
+ output.WriteDebug("Checking if type '{0}' implements '{1}'", type.Name, pluginType.Name);
+ if (pluginType.IsAssignableFrom(type))
+ {
+ output.WriteDebug("Type '{0}' DOES implement {1}", type.FullName, pluginType.Name);
+
+ ConstructorInfo ctor = type.GetConstructor(Type.EmptyTypes);
+ SubversionHook hook = (SubversionHook)ctor.Invoke(null);
+ if(hook == null)
+ continue;
+
+ hooks.Add(hook);
+ }
+ else
+ {
+ output.WriteDebug("type '{0}' does not implement {1}.", type.FullName, pluginType.FullName);
+ }
+ }
+ }
+
+ output.Write("Found and Loaded {0} hooks.", hooks.Count);
+ return hooks;
+ }
+ }
+}
Deleted: trunk/CaptainHook/Program.cs
===================================================================
--- trunk/CaptainHookExe/Program.cs 2007-02-23 01:25:56 UTC (rev 9)
+++ trunk/CaptainHook/Program.cs 2007-02-23 02:31:20 UTC (rev 11)
@@ -1,59 +0,0 @@
-using System;
-using CaptainHook.CommandLine;
-
-namespace CaptainHook
-{
- public class Program
- {
- public static int Main(string[] args)
- {
- IOutputHandler output = null;
- try
- {
- //TODO: Perhaps we should ask the plugins if they have any command line arguments.
- Arguments arguments = new Arguments(args);
- output = new OutputHandler();
- output.Debug = arguments.Debug;
-
- if (arguments.Complete)
- {
- ApplicationHost app = new ApplicationHost(arguments, output, new PluginLoader(output));
- if (app.HandleHookEvent())
- return 0;
- else
- return 1;
- }
-
- if(arguments.ErrorMessages.Count > 0)
- {
- string errorMessage = string.Empty;
- foreach (string error in arguments.ErrorMessages)
- {
- errorMessage += error + Environment.NewLine;
- }
- output.WriteError(errorMessage);
- output.Write();
- }
-
- if(arguments.ShowHelp)
- {
- output.WriteHelp(arguments.Usage);
- }
- }
- catch(Exception exc)
- {
- if(output != null)
- {
- output.WriteError("Unhandled exception occurred.", exc);
- }
- else
- {
- Console.Error.WriteLine("Unhandled exception occurred." + exc.Message);
- Console.WriteLine("Unhandled exception occurred." + exc.Message);
- }
- }
-
- return 0;
- }
- }
-}
Copied: trunk/CaptainHook/Program.cs (from rev 10, trunk/CaptainHookExe/Program.cs)
===================================================================
--- trunk/CaptainHook/Program.cs (rev 0)
+++ trunk/CaptainHook/Program.cs 2007-02-23 02:31:20 UTC (rev 11)
@@ -0,0 +1,59 @@
+using System;
+using CaptainHook.CommandLine;
+
+namespace CaptainHook
+{
+ public class Program
+ {
+ public static int Main(string[] args)
+ {
+ IOutputHandler output = null;
+ try
+ {
+ //TODO: Perhaps we should ask the plugins if they have any command line arguments.
+ Arguments arguments = new Arguments(args);
+ output = new OutputHandler();
+ output.Debug = arguments.Debug;
+
+ if (arguments.Complete)
+ {
+ ApplicationHost app = new ApplicationHost(arguments, output, new PluginLoader(output));
+ if (app.HandleHookEvent())
+ return 0;
+ else
+ return 1;
+ }
+
+ if(arguments.ErrorMessages.Count > 0)
+ {
+ string errorMessage = string.Empty;
+ foreach (string error in arguments.ErrorMessages)
+ {
+ errorMessage += error + Environment.NewLine;
+ }
+ output.WriteError(errorMessage);
+ output.Write();
+ }
+
+ if(arguments.ShowHelp)
+ {
+ output.WriteHelp(arguments.Usage);
+ }
+ }
+ catch(Exception exc)
+ {
+ if(output != null)
+ {
+ output.WriteError("Unhandled exception occurred.", exc);
+ }
+ else
+ {
+ Console.Error.WriteLine("Unhandled exception occurred." + exc.Message);
+ Console.WriteLine("Unhandled exception occurred." + exc.Message);
+ }
+ }
+
+ return 0;
+ }
+ }
+}
Copied: trunk/CaptainHook/Properties (from rev 10, trunk/CaptainHookExe/Properties)
Copied: trunk/CaptainHook/Resources (from rev 10, trunk/CaptainHookExe/Resources)
Copied: trunk/CaptainHook/SampleBatchFiles (from rev 10, trunk/CaptainHookExe/SampleBatchFiles)
Deleted: trunk/CaptainHook/Settings.cs
===================================================================
--- trunk/CaptainHookExe/Settings.cs 2007-02-23 01:25:56 UTC (rev 9)
+++ trunk/CaptainHook/Settings.cs 2007-02-23 02:31:20 UTC (rev 11)
@@ -1,17 +0,0 @@
-using System;
-using System.Configuration;
-
-namespace CaptainHook
-{
- internal static class Settings
- {
- /// <summary>
- /// The subfolder of the application exe where the
- /// plugins are placed.
- /// </summary>
- internal static string PluginFolder
- {
- get { return ConfigurationManager.AppSettings["PluginFolder"]; }
- }
- }
-}
Copied: trunk/CaptainHook/Settings.cs (from rev 10, trunk/CaptainHookExe/Settings.cs)
===================================================================
--- trunk/CaptainHook/Settings.cs (rev 0)
+++ trunk/CaptainHook/Settings.cs 2007-02-23 02:31:20 UTC (rev 11)
@@ -0,0 +1,17 @@
+using System;
+using System.Configuration;
+
+namespace CaptainHook
+{
+ internal static class Settings
+ {
+ /// <summary>
+ /// The subfolder of the application exe where the
+ /// plugins are placed.
+ /// </summary>
+ internal static string PluginFolder
+ {
+ get { return ConfigurationManager.AppSettings["PluginFolder"]; }
+ }
+ }
+}
Copied: trunk/CaptainHook.Plugins (from rev 9, trunk/Velocit.Hook.Plugins)
Added: trunk/CaptainHook.Plugins/CaptainHook.Plugins.csproj
===================================================================
--- trunk/CaptainHook.Plugins/CaptainHook.Plugins.csproj (rev 0)
+++ trunk/CaptainHook.Plugins/CaptainHook.Plugins.csproj 2007-02-23 02:31:20 UTC (rev 11)
@@ -0,0 +1,63 @@
+<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <ProductVersion>8.0.50727</ProductVersion>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{E5A33AEE-BAFA-4AE1-9A2A-E91CAC5EC82D}</ProjectGuid>
+ <OutputType>Library</OutputType>
+ <AppDesignerFolder>Properties</AppDesignerFolder>
+ <RootNamespace>CaptainHook.Plugins</RootNamespace>
+ <AssemblyName>CaptainHook.Plugins</AssemblyName>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ <DebugSymbols>true</DebugSymbols>
+ <DebugType>full</DebugType>
+ <Optimize>false</Optimize>
+ <OutputPath>bin\debug\</OutputPath>
+ <DefineConstants>DEBUG;TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ <TreatWarningsAsErrors>true</TreatWarningsAsErrors>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+ <DebugType>pdbonly</DebugType>
+ <Optimize>true</Optimize>
+ <OutputPath>bin\Release\</OutputPath>
+ <DefineConstants>TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <ItemGroup>
+ <Reference Include="System" />
+ <Reference Include="System.configuration" />
+ <Reference Include="System.Data" />
+ <Reference Include="System.Xml" />
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="PostCommitEmailHook.cs" />
+ <Compile Include="RequireLogMessageHook.cs" />
+ <Compile Include="Properties\AssemblyInfo.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\CaptainHook.Interfaces\CaptainHook.Interfaces.csproj">
+ <Project>{4CE44566-B3FD-4D6F-8C90-3323C78A3405}</Project>
+ <Name>CaptainHook.Interfaces</Name>
+ </ProjectReference>
+ </ItemGroup>
+ <ItemGroup>
+ <EmbeddedResource Include="Resources\MessageFormat.txt" />
+ </ItemGroup>
+ <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
+ <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
+ Other similar extension points exist, see Microsoft.Common.targets.
+ <Target Name="BeforeBuild">
+ </Target>
+ <Target Name="AfterBuild">
+ </Target>
+ -->
+ <PropertyGroup>
+ <PostBuildEvent>
+ </PostBuildEvent>
+ </PropertyGroup>
+</Project>
\ No newline at end of file
Deleted: trunk/CaptainHook.Plugins/PostCommitEmailHook.cs
===================================================================
--- trunk/Velocit.Hook.Plugins/PostCommitEmailHook.cs 2007-02-23 01:25:56 UTC (rev 9)
+++ trunk/CaptainHook.Plugins/PostCommitEmailHook.cs 2007-02-23 02:31:20 UTC (rev 11)
@@ -1,106 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Configuration;
-using System.IO;
-using System.Net.Mail;
-using System.Reflection;
-using System.Text;
-using CaptainHook.Subversion;
-using CaptainHook.Subversion.Hook;
-
-namespace Velocit.Hook.Plugins
-{
- public class PostCommitEmailHook : PostCommitHook
- {
- /// <summary>
- /// Handles the post commit hook by sending out an email.
- /// </summary>
- /// <param name="commitInfo"></param>
- protected override bool HandleHookEvent(IRevisionInfo commitInfo)
- {
- //Gather info:
- MailAddressCollection emails = ReadEmailsFromFile();
-
- string[] changedDirectories = this.HostApplication.SubversionApplication.GetChangedDirectories(commitInfo.Revision);
- string modifiedPaths = string.Empty;
- if(changedDirectories != null && changedDirectories.Length > 0)
- {
- modifiedPaths = String.Join(Environment.NewLine, changedDirectories);
- }
-
- // Get Diffs.
- IList<IDifference> diffs = this.HostApplication.SubversionApplication.GetDifferences(commitInfo.Revision);
- StringBuilder builder = new StringBuilder();
- foreach (IDifference diff in diffs)
- {
- builder.AppendLine(diff.ToString());
- builder.AppendLine();
- }
-
- string message = String.Format(GetMessageFormatString(), commitInfo.Revision, commitInfo.Author, commitInfo.DateStamp, commitInfo.LogMessage, modifiedPaths, builder.ToString());
- string subject = String.Format("{0} revision: {1} {2}", HostApplication.Repository, commitInfo.Revision, modifiedPaths[0]);
-
- string fromEmail = ConfigurationManager.AppSettings["CommitEmailFrom"];
- if (String.IsNullOrEmpty(fromEmail))
- fromEmail = "You...@ex...";
-
- HostApplication.SendEmail(new MailAddress(fromEmail), emails, null, null, subject, message);
-
- return true; //PostCommit hooks ignore this anyways.
- }
-
- MailAddressCollection ReadEmailsFromFile()
- {
- MailAddressCollection emails = new MailAddressCollection();
- string emailListFile = ConfigurationManager.AppSettings["CommitEmailListFile"];
- if (emailListFile == null)
- emailListFile = "emails.lst"; //defaults to the one used by commit-email-win.pl
- using(StreamReader reader = new StreamReader(emailListFile))
- {
- while(!reader.EndOfStream)
- {
- string line = reader.ReadLine();
- line = line.Trim(' ', '\t');
- if(line.Length > 0 && line.IndexOf("@") > 0) //TODO: Better email validation.
- emails.Add(line);
- }
- }
- return emails;
-
- }
-
- // It's embedded in this assembly. Wheee!
- string GetMessageFormatString()
- {
- return UnpackEmbeddedResource("Velocit.Hook.Plugins.Resources.MessageFormat.txt", Encoding.UTF8);
- }
-
- /// <summary>
- /// Unpacks an embedded resource into a Stream.
- /// </summary>
- /// <remarks>Omit the UnitTests.Subtext.Resources. part of the
- /// resource name.</remarks>
- /// <param name="resourceName">Name of the resource.</param>
- static Stream UnpackEmbeddedResource(string resourceName)
- {
- Assembly assembly = Assembly.GetExecutingAssembly();
- return assembly.GetManifestResourceStream(resourceName);
- }
-
- /// <summary>
- /// Unpacks an embedded resource as a string.
- /// </summary>
- /// <remarks>Omit the UnitTests.Subtext.Resources. part of the
- /// resource name.</remarks>
- /// <param name="resourceName"></param>
- /// <param name="encoding">The path to write the file as.</param>
- static string UnpackEmbeddedResource(string resourceName, Encoding encoding)
- {
- Stream stream = UnpackEmbeddedResource(resourceName);
- using (StreamReader reader = new StreamReader(stream, encoding))
- {
- return reader.ReadToEnd();
- }
- }
- }
-}
Copied: trunk/CaptainHook.Plugins/PostCommitEmailHook.cs (from rev 10, trunk/Velocit.Hook.Plugins/PostCommitEmailHook.cs)
===================================================================
--- trunk/CaptainHook.Plugins/PostCommitEmailHook.cs (rev 0)
+++ trunk/CaptainHook.Plugins/PostCommitEmailHook.cs 2007-02-23 02:31:20 UTC (rev 11)
@@ -0,0 +1,106 @@
+using System;
+using System.Collections.Generic;
+using System.Configuration;
+using System.IO;
+using System.Net.Mail;
+using System.Reflection;
+using System.Text;
+using CaptainHook.Subversion;
+using CaptainHook.Subversion.Hook;
+
+namespace CaptainHook.Plugins
+{
+ public class PostCommitEmailHook : PostCommitHook
+ {
+ /// <summary>
+ /// Handles the post commit hook by sending out an email.
+ /// </summary>
+ /// <param name="commitInfo"></param>
+ protected override bool HandleHookEvent(IRevisionInfo commitInfo)
+ {
+ //Gather info:
+ MailAddressCollection emails = ReadEmailsFromFile();
+
+ string[] changedDirectories = this.HostApplication.SubversionApplication.GetChangedDirectories(commitInfo.Revision);
+ string modifiedPaths = string.Empty;
+ if(changedDirectories != null && changedDirectories.Length > 0)
+ {
+ modifiedPaths = String.Join(Environment.NewLine, changedDirectories);
+ }
+
+ // Get Diffs.
+ IList<IDifference> diffs = this.HostApplication.SubversionApplication.GetDifferences(commitInfo.Revision);
+ StringBuilder builder = new StringBuilder();
+ foreach (IDifference diff in diffs)
+ {
+ builder.AppendLine(diff.ToString());
+ builder.AppendLine();
+ }
+
+ string message = String.Format(GetMessageFormatString(), commitInfo.Revision, commitInfo.Author, commitInfo.DateStamp, commitInfo.LogMessage, modifiedPaths, builder.ToString());
+ string subject = String.Format("{0} revision: {1} {2}", HostApplication.Repository, commitInfo.Revision, modifiedPaths[0]);
+
+ string fromEmail = ConfigurationManager.AppSettings["CommitEmailFrom"];
+ if (String.IsNullOrEmpty(fromEmail))
+ fromEmail = "You...@ex...";
+
+ HostApplication.SendEmail(new MailAddress(fromEmail), emails, null, null, subject, message);
+
+ return true; //PostCommit hooks ignore this anyways.
+ }
+
+ MailAddressCollection ReadEmailsFromFile()
+ {
+ MailAddressCollection emails = new MailAddressCollection();
+ string emailListFile = ConfigurationManager.AppSettings["CommitEmailListFile"];
+ if (emailListFile == null)
+ emailListFile = "emails.lst"; //defaults to the one used by commit-email-win.pl
+ using(StreamReader reader = new StreamReader(emailListFile))
+ {
+ while(!reader.EndOfStream)
+ {
+ string line = reader.ReadLine();
+ line = line.Trim(' ', '\t');
+ if(line.Length > 0 && line.IndexOf("@") > 0) //TODO: Better email validation.
+ emails.Add(line);
+ }
+ }
+ return emails;
+
+ }
+
+ // It's embedded in this assembly. Wheee!
+ string GetMessageFormatString()
+ {
+ return UnpackEmbeddedResource("Velocit.Hook.Plugins.Resources.MessageFormat.txt", Encoding.UTF8);
+ }
+
+ /// <summary>
+ /// Unpacks an embedded resource into a Stream.
+ /// </summary>
+ /// <remarks>Omit the UnitTests.Subtext.Resources. part of the
+ /// resource name.</remarks>
+ /// <param name="resourceName">Name of the resource.</param>
+ static Stream UnpackEmbeddedResource(string resourceName)
+ {
+ Assembly assembly = Assembly.GetExecutingAssembly();
+ return assembly.GetManifestResourceStream(resourceName);
+ }
+
+ /// <summary>
+ /// Unpacks an embedded resource as a string.
+ /// </summary>
+ /// <remarks>Omit the UnitTests.Subtext.Resources. part of the
+ /// resource name.</remarks>
+ /// <param name="resourceName"></param>
+ /// <param name="encoding">The path to write the file as.</param>
+ static string UnpackEmbeddedResource(string resourceName, Encoding encoding)
+ {
+ Stream stream = UnpackEmbeddedResource(resourceName);
+ using (StreamReader reader = new StreamReader(stream, encoding))
+ {
+ return reader.ReadToEnd();
+ }
+ }
+ }
+}
Copied: trunk/CaptainHook.Plugins/Properties (from rev 10, trunk/Velocit.Hook.Plugins/Properties)
Deleted: trunk/CaptainHook.Plugins/RequireLogMessageHook.cs
===================================================================
--- trunk/Velocit.Hook.Plugins/RequireLogMessageHook.cs 2007-02-23 01:25:56 UTC (rev 9)
+++ trunk/CaptainHook.Plugins/RequireLogMessageHook.cs 2007-02-23 02:31:20 UTC (rev 11)
@@ -1,27 +0,0 @@
-using System;
-using CaptainHook.Subversion;
-using CaptainHook.Subversion.Hook;
-
-namespace Velocit.Hook.Plugins
-{
- /// <summary>
- /// Checks to make sure that the log message is not empty.
- /// Consider adding App.config setting for this.
- /// </summary>
- public class RequireLogMessageHook : PreCommitHook
- {
- /// <summary>
- /// Method overridden by specific hooks to perform hook specific handling.
- /// </summary>
- /// <param name="commit"></param>
- protected override bool HandleHookEvent(ITransactionInfo commit)
- {
- bool result = (commit.LogMessageSize != 0);
- if (!result)
- {
- this.HostApplication.Output.WriteError("Log Message is required.");
- }
- return result;
- }
- }
-}
Copied: trunk/CaptainHook.Plugins/RequireLogMessageHook.cs (from rev 10, trunk/Velocit.Hook.Plugins/RequireLogMessageHook.cs)
===================================================================
--- trunk/CaptainHook.Plugins/RequireLogMessageHook.cs (rev 0)
+++ trunk/CaptainHook.Plugins/RequireLogMessageHook.cs 2007-02-23 02:31:20 UTC (rev 11)
@@ -0,0 +1,27 @@
+using System;
+using CaptainHook.Subversion;
+using CaptainHook.Subversion.Hook;
+
+namespace CaptainHook.Plugins
+{
+ /// <summary>
+ /// Checks to make sure that the log message is not empty.
+ /// Consider adding App.config setting for this.
+ /// </summary>
+ public class RequireLogMessageHook : PreCommitHook
+ {
+ /// <summary>
+ /// Method overridden by specific hooks to perform hook specific handling.
+ /// </summary>
+ /// <param name="commit"></param>
+ protected override bool HandleHookEvent(ITransactionInfo commit)
+ {
+ bool result = (commit.LogMessageSize != 0);
+ if (!result)
+ {
+ this.HostApplication.Output.WriteError("Log Message is required.");
+ }
+ return result;
+ }
+ }
+}
Copied: trunk/CaptainHook.Plugins/Resources (from rev 10, trunk/Velocit.Hook.Plugins/Resources)
Deleted: trunk/CaptainHook.Plugins/Velocit.Hook.Plugins.csproj
===================================================================
--- trunk/Velocit.Hook.Plugins/Velocit.Hook.Plugins.csproj 2007-02-23 01:25:56 UTC (rev 9)
+++ trunk/CaptainHook.Plugins/Velocit.Hook.Plugins.csproj 2007-02-23 02:31:20 UTC (rev 11)
@@ -1,63 +0,0 @@
-<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <PropertyGroup>
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <ProductVersion>8.0.50727</ProductVersion>
- <SchemaVersion>2.0</SchemaVersion>
- <ProjectGuid>{E5A33AEE-BAFA-4AE1-9A2A-E91CAC5EC82D}</ProjectGuid>
- <OutputType>Library</OutputType>
- <AppDesignerFolder>Properties</AppDesignerFolder>
- <RootNamespace>Velocit.Hook.Plugins</RootNamespace>
- <AssemblyName>Velocit.Hook.Plugins</AssemblyName>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
- <DebugSymbols>true</DebugSymbols>
- <DebugType>full</DebugType>
- <Optimize>false</Optimize>
- <OutputPath>bin\debug\</OutputPath>
- <DefineConstants>DEBUG;TRACE</DefineConstants>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- <TreatWarningsAsErrors>true</TreatWarningsAsErrors>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
- <DebugType>pdbonly</DebugType>
- <Optimize>true</Optimize>
- <OutputPath>bin\Release\</OutputPath>
- <DefineConstants>TRACE</DefineConstants>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- </PropertyGroup>
- <ItemGroup>
- <Reference Include="System" />
- <Reference Include="System.configuration" />
- <Reference Include="System.Data" />
- <Reference Include="System.Xml" />
- </ItemGroup>
- <ItemGroup>
- <Compile Include="PostCommitEmailHook.cs" />
- <Compile Include="RequireLogMessageHook.cs" />
- <Compile Include="Properties\AssemblyInfo.cs" />
- </ItemGroup>
- <ItemGroup>
- <ProjectReference Include="..\CaptainHook.Interfaces\CaptainHook.Interfaces.csproj">
- <Project>{4CE44566-B3FD-4D6F-8C90-3323C78A3405}</Project>
- <Name>CaptainHook.Interfaces</Name>
- </ProjectReference>
- </ItemGroup>
- <ItemGroup>
- <EmbeddedResource Include="Resources\MessageFormat.txt" />
- </ItemGroup>
- <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
- <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
- Other similar extension points exist, see Microsoft.Common.targets.
- <Target Name="BeforeBuild">
- </Target>
- <Target Name="AfterBuild">
- </Target>
- -->
- <PropertyGroup>
- <PostBuildEvent>
- </PostBuildEvent>
- </PropertyGroup>
-</Project>
\ No newline at end of file
Copied: trunk/CaptainHook.UnitTests (from rev 9, trunk/UnitTests)
Deleted: trunk/CaptainHook.UnitTests/ArgumentsTests.cs
===================================================================
--- trunk/UnitTests/ArgumentsTests.cs 2007-02-23 01:25:56 UTC (rev 9)
+++ trunk/CaptainHook.UnitTests/ArgumentsTests.cs 2007-02-23 02:31:20 UTC (rev 11)
@@ -1,38 +0,0 @@
-using System;
-using CaptainHook.CommandLine;
-using MbUnit.Framework;
-using CaptainHook.Subversion.Hook;
-
-namespace UnitTests
-{
- [TestFixture]
- public class ArgumentsTests
- {
- [RowTest]
- [Row(null, false, true, 0)]
- [Row(new string[] {}, false, true, 0)]
- [Row(new string[1] {"help"}, false, true, 0)]
- [Row(new string[1] { "invalid-hook-type" }, false, false, 1)]
- [Row(new string[1] { "post-commit" }, false, false, 1)]
- [Row(new string[2] { "post-commit", @"c:\svn" }, true, false, 0)]
- public void ArgumentValidationTests(string[] args, bool expectedComplete, bool expectedShowHelp, int errorMessageCount)
- {
- Arguments arguments = new Arguments(args);
- Assert.AreEqual(expectedComplete, arguments.Complete, "The arguments validity is not what we expected.");
- Assert.AreEqual(expectedShowHelp, arguments.ShowHelp, "Whether or not to ShowHelp is wrong.");
- }
-
- [RowTest]
- [Row(new string[1] { "start-commit" }, typeof(StartCommitHook))]
- [Row(new string[1] { "pre-commit" }, typeof(PreCommitHook))]
- [Row(new string[1] { "post-commit" }, typeof(PostCommitHook))]
- [Row(new string[1] { "pre-revprop-change" }, typeof(PreRevisionPropertyChangeHook))]
- [Row(new string[1] { "post-revprop-change" }, typeof(PostRevisionPropertyChangeHook))]
- [Row(new string[1] { "unknown" }, null)]
- public void ArgumentReadsHookTypeProperly(string[] args, Type expectedHookType)
- {
- Arguments arguments = new Arguments(args);
- Assert.AreEqual(expectedHookType, arguments.HookType);
- }
- }
-}
Copied: trunk/CaptainHook.UnitTests/ArgumentsTests.cs (from rev 10, trunk/UnitTests/ArgumentsTests.cs)
===================================================================
--- trunk/C...
[truncated message content] |
|
From: <jor...@us...> - 2007-02-23 01:58:18
|
Revision: 10
http://svn.sourceforge.net/captainhook/?rev=10&view=rev
Author: jordan-terrell
Date: 2007-02-22 17:58:07 -0800 (Thu, 22 Feb 2007)
Log Message:
-----------
Unit tests can be run from test.bat
Added code coverage reporting using NCover w/ validation
---Outputs report to Build\Artifacts folder
Renamed build.bat to compileOnly.bat
All external tools & assemblies have been moved to External folder
Modified Paths:
--------------
trunk/CaptainHookSolution.sln
trunk/UnitTests/UnitTests.csproj
trunk/master.build
Added Paths:
-----------
trunk/External/Assemblies/
trunk/External/Assemblies/Rhino.Mocks.dll
trunk/External/Assemblies/Rhino.Mocks.xml
trunk/External/Tools/MBUnit/
trunk/External/Tools/MBUnit/MbUnit.AddIn.dll
trunk/External/Tools/MBUnit/MbUnit.Cons.exe
trunk/External/Tools/MBUnit/MbUnit.Cons.exe.config
trunk/External/Tools/MBUnit/MbUnit.Framework.1.1.dll
trunk/External/Tools/MBUnit/MbUnit.Framework.dll
trunk/External/Tools/MBUnit/MbUnit.GUI.exe
trunk/External/Tools/MBUnit/MbUnit.GUI.exe.config
trunk/External/Tools/MBUnit/MbUnit.MSBuild.Tasks.dll
trunk/External/Tools/MBUnit/MbUnit.Tasks.dll
trunk/External/Tools/MBUnit/MbUnit.Tests.1.1.dll
trunk/External/Tools/MBUnit/NAnt.Core.dll
trunk/External/Tools/MBUnit/NGraphviz.Helpers.dll
trunk/External/Tools/MBUnit/NGraphviz.Layout.dll
trunk/External/Tools/MBUnit/NGraphviz.dll
trunk/External/Tools/MBUnit/QuickGraph.Algorithms.Graphviz.dll
trunk/External/Tools/MBUnit/QuickGraph.Algorithms.dll
trunk/External/Tools/MBUnit/QuickGraph.dll
trunk/External/Tools/MBUnit/Refly.dll
trunk/External/Tools/MBUnit/TestDriven.Framework.dll
trunk/External/Tools/MBUnit/TestFu.dll
trunk/External/Tools/MBUnit/XsdTidy.exe
trunk/External/Tools/MBUnit/log4net.dll
trunk/External/Tools/NCover/
trunk/External/Tools/NCover/CoverLib.dll
trunk/External/Tools/NCover/Coverage.xsl
trunk/External/Tools/NCover/MSVCP80.dll
trunk/External/Tools/NCover/MSVCR80.dll
trunk/External/Tools/NCover/NCover.Console.exe
trunk/External/Tools/NCover/NCover.Console.exe.config
trunk/External/Tools/NCover/NCover.Framework.dll
trunk/External/Tools/NCover/NCoverFAQ.html
trunk/External/Tools/NCover/VC80CRT.MAN
trunk/External/Tools/NCoverExplorer/
trunk/External/Tools/NCoverExplorer/CommandBars.dll
trunk/External/Tools/NCoverExplorer/ConsoleConfig.xsd
trunk/External/Tools/NCoverExplorer/ConsoleExample.config
trunk/External/Tools/NCoverExplorer/CoverageReport.xsl
trunk/External/Tools/NCoverExplorer/ICSharpCode.TextEditor.dll
trunk/External/Tools/NCoverExplorer/NCoverExplorer.Console.exe
trunk/External/Tools/NCoverExplorer/NCoverExplorer.Core.dll
trunk/External/Tools/NCoverExplorer/NCoverExplorer.NCoverRunner.dll
trunk/External/Tools/NCoverExplorer/NCoverExplorer.exe
trunk/External/Tools/NCoverExplorer/NCoverExplorer.exe.config
trunk/External/Tools/NCoverExplorer/NCoverExplorerFAQ.html
trunk/External/Tools/NCoverExplorer/NCoverExplorerReleaseNotes.html
trunk/External/Tools/NCoverExplorer/license.txt
trunk/External/Tools/NCoverExplorerExtras/
trunk/External/Tools/NCoverExplorerExtras/NCoverExplorer.MSBuildTasks.dll
trunk/External/Tools/NCoverExplorerExtras/NCoverExplorer.MSBuildTasks.targets
trunk/External/Tools/NCoverExplorerExtras/NCoverExplorer.MSBuildTasks.xml
trunk/compileOnly.bat
trunk/test.bat
trunk/testwithcoveragevalidation.bat
Removed Paths:
-------------
trunk/UnitTests/ExternalDependencies/
trunk/build.bat
Modified: trunk/CaptainHookSolution.sln
===================================================================
--- trunk/CaptainHookSolution.sln 2007-02-23 01:25:56 UTC (rev 9)
+++ trunk/CaptainHookSolution.sln 2007-02-23 01:58:07 UTC (rev 10)
@@ -13,10 +13,12 @@
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{0DA35A5A-70F9-4CC2-B6B0-D313C8E149C4}"
ProjectSection(SolutionItems) = preProject
- build.bat = build.bat
clean.bat = clean.bat
+ compileOnly.bat = compileOnly.bat
completeBuild.bat = completeBuild.bat
master.build = master.build
+ test.bat = test.bat
+ testwithcoveragevalidation.bat = testwithcoveragevalidation.bat
EndProjectSection
EndProject
Global
Added: trunk/External/Assemblies/Rhino.Mocks.dll
===================================================================
(Binary files differ)
Property changes on: trunk/External/Assemblies/Rhino.Mocks.dll
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/External/Assemblies/Rhino.Mocks.xml
===================================================================
--- trunk/External/Assemblies/Rhino.Mocks.xml (rev 0)
+++ trunk/External/Assemblies/Rhino.Mocks.xml 2007-02-23 01:58:07 UTC (rev 10)
@@ -0,0 +1,2957 @@
+<?xml version="1.0"?>
+<doc>
+ <assembly>
+ <name>Rhino.Mocks.Partial</name>
+ </assembly>
+ <members>
+ <member name="T:Rhino.Mocks.Constraints.AbstractConstraint">
+ <summary>
+ Interface for constraints
+ </summary>
+ </member>
+ <member name="M:Rhino.Mocks.Constraints.AbstractConstraint.Eval(System.Object)">
+ <summary>
+ determains if the object pass the constraints
+ </summary>
+ </member>
+ <member name="M:Rhino.Mocks.Constraints.AbstractConstraint.op_BitwiseAnd(Rhino.Mocks.Constraints.AbstractConstraint,Rhino.Mocks.Constraints.AbstractConstraint)">
+ <summary>
+ And operator for constraints
+ </summary>
+ </member>
+ <member name="M:Rhino.Mocks.Constraints.AbstractConstraint.op_LogicalNot(Rhino.Mocks.Constraints.AbstractConstraint)">
+ <summary>
+ Not operator for constraints
+ </summary>
+ </member>
+ <member name="M:Rhino.Mocks.Constraints.AbstractConstraint.op_BitwiseOr(Rhino.Mocks.Constraints.AbstractConstraint,Rhino.Mocks.Constraints.AbstractConstraint)">
+ <summary>
+ Or operator for constraints
+ </summary>
+ </member>
+ <member name="P:Rhino.Mocks.Constraints.AbstractConstraint.Message">
+ <summary>
+ Gets the message for this constraint
+ </summary>
+ <value></value>
+ </member>
+ <member name="T:Rhino.Mocks.Constraints.PropertyIs">
+ <summary>
+ Constrain that the property has a specified value
+ </summary>
+ </member>
+ <member name="T:Rhino.Mocks.Constraints.PropertyConstraint">
+ <summary>
+ Constrain that the property matches another constraint.
+ </summary>
+ </member>
+ <member name="M:Rhino.Mocks.Constraints.PropertyConstraint.#ctor(System.String,Rhino.Mocks.Constraints.AbstractConstraint)">
+ <summary>
+ Creates a new <see cref="T:Rhino.Mocks.Constraints.PropertyConstraint"/> instance.
+ </summary>
+ <param name="propertyName">Name of the property.</param>
+ <param name="constraint">Constraint to place on the property value.</param>
+ </member>
+ <member name="M:Rhino.Mocks.Constraints.PropertyConstraint.#ctor(System.Type,System.String,Rhino.Mocks.Constraints.AbstractConstraint)">
+ <summary>
+ Creates a new <see cref="T:Rhino.Mocks.Constraints.PropertyConstraint"/> instance, specifying a disambiguating
+ <paramref name="declaringType"/> for the property.
+ </summary>
+ <param name="declaringType">The type that declares the property, used to disambiguate between properties.</param>
+ <param name="propertyName">Name of the property.</param>
+ <param name="constraint">Constraint to place on the property value.</param>
+ </member>
+ <member name="M:Rhino.Mocks.Constraints.PropertyConstraint.Eval(System.Object)">
+ <summary>
+ Determines if the object passes the constraint.
+ </summary>
+ </member>
+ <member name="P:Rhino.Mocks.Constraints.PropertyConstraint.Message">
+ <summary>
+ Gets the message for this constraint
+ </summary>
+ <value></value>
+ </member>
+ <member name="M:Rhino.Mocks.Constraints.PropertyIs.#ctor(System.String,System.Object)">
+ <summary>
+ Creates a new <see cref="T:Rhino.Mocks.Constraints.PropertyIs"/> instance.
+ </summary>
+ <param name="propertyName">Name of the property.</param>
+ <param name="expectedValue">Expected value.</param>
+ </member>
+ <member name="M:Rhino.Mocks.Constraints.PropertyIs.#ctor(System.Type,System.String,System.Object)">
+ <summary>
+ Creates a new <see cref="T:Rhino.Mocks.Constraints.PropertyIs"/> instance, specifying a disambiguating
+ <paramref name="declaringType"/> for the property.
+ </summary>
+ <param name="declaringType">The type that declares the property, used to disambiguate between properties.</param>
+ <param name="propertyName">Name of the property.</param>
+ <param name="expectedValue">Expected value.</param>
+ </member>
+ <member name="T:Rhino.Mocks.Constraints.TypeOf">
+ <summary>
+ Constrain that the parameter must be of the specified type
+ </summary>
+ </member>
+ <member name="M:Rhino.Mocks.Constraints.TypeOf.#ctor(System.Type)">
+ <summary>
+ Creates a new <see cref="T:Rhino.Mocks.Constraints.TypeOf"/> instance.
+ </summary>
+ <param name="type">Type.</param>
+ </member>
+ <member name="M:Rhino.Mocks.Constraints.TypeOf.Eval(System.Object)">
+ <summary>
+ determains if the object pass the constraints
+ </summary>
+ </member>
+ <member name="P:Rhino.Mocks.Constraints.TypeOf.Message">
+ <summary>
+ Gets the message for this constraint
+ </summary>
+ <value></value>
+ </member>
+ <member name="T:Rhino.Mocks.Constraints.Same">
+ <summary>
+ Constraint that determines whether an object is the same object as another.
+ </summary>
+ </member>
+ <member name="M:Rhino.Mocks.Constraints.Same.#ctor(System.Object)">
+ <summary>
+ Creates a new <see cref="T:Rhino.Mocks.Constraints.Equal"/> instance.
+ </summary>
+ <param name="obj">Obj.</param>
+ </member>
+ <member name="M:Rhino.Mocks.Constraints.Same.Eval(System.Object)">
+ <summary>
+ Determines if the object passes the constraints.
+ </summary>
+ </member>
+ <member name="P:Rhino.Mocks.Constraints.Same.Message">
+ <summary>
+ Gets the message for this constraint.
+ </summary>
+ </member>
+ <member name="T:Rhino.Mocks.Constraints.CollectionEqual">
+ <summary>
+ Constrain that the list contains the same items as the parameter list
+ </summary>
+ </member>
+ <member name="M:Rhino.Mocks.Constraints.CollectionEqual.#ctor(System.Collections.ICollection)">
+ <summary>
+ Creates a new <see cref="T:Rhino.Mocks.Constraints.CollectionEqual"/> instance.
+ </summary>
+ <param name="collection">In list.</param>
+ </member>
+ <member name="M:Rhino.Mocks.Constraints.CollectionEqual.Eval(System.Object)">
+ <summary>
+ determains if the object pass the constraints
+ </summary>
+ </member>
+ <member name="P:Rhino.Mocks.Constraints.CollectionEqual.Message">
+ <summary>
+ Gets the message for this constraint
+ </summary>
+ <value></value>
+ </member>
+ <member name="T:Rhino.Mocks.Constraints.OneOf">
+ <summary>
+ Constrain that the parameter is one of the items in the list
+ </summary>
+ </member>
+ <member name="M:Rhino.Mocks.Constraints.OneOf.#ctor(System.Collections.ICollection)">
+ <summary>
+ Creates a new <see cref="T:Rhino.Mocks.Constraints.OneOf"/> instance.
+ </summary>
+ <param name="collection">In list.</param>
+ </member>
+ <member name="M:Rhino.Mocks.Constraints.OneOf.Eval(System.Object)">
+ <summary>
+ determains if the object pass the constraints
+ </summary>
+ </member>
+ <member name="P:Rhino.Mocks.Constraints.OneOf.Message">
+ <summary>
+ Gets the message for this constraint
+ </summary>
+ <value></value>
+ </member>
+ <member name="T:Rhino.Mocks.Constraints.IsIn">
+ <summary>
+ Constrain that the object is inside the parameter list
+ </summary>
+ </member>
+ <member name="M:Rhino.Mocks.Constraints.IsIn.#ctor(System.Object)">
+ <summary>
+ Creates a new <see cref="T:Rhino.Mocks.Constraints.IsIn"/> instance.
+ </summary>
+ <param name="inList">In list.</param>
+ </member>
+ <member name="M:Rhino.Mocks.Constraints.IsIn.Eval(System.Object)">
+ <summary>
+ determains if the object pass the constraints
+ </summary>
+ </member>
+ <member name="P:Rhino.Mocks.Constraints.IsIn.Message">
+ <summary>
+ Gets the message for this constraint
+ </summary>
+ <value></value>
+ </member>
+ <member name="T:Rhino.Mocks.Constraints.Or">
+ <summary>
+ Combines two constraints, constraint pass if either is fine.
+ </summary>
+ </member>
+ <member name="M:Rhino.Mocks.Constraints.Or.#ctor(Rhino.Mocks.Constraints.AbstractConstraint,Rhino.Mocks.Constraints.AbstractConstraint)">
+ <summary>
+ Creates a new <see cref="T:Rhino.Mocks.Constraints.And"/> instance.
+ </summary>
+ <param name="c1">C1.</param>
+ <param name="c2">C2.</param>
+ </member>
+ <member name="M:Rhino.Mocks.Constraints.Or.Eval(System.Object)">
+ <summary>
+ determains if the object pass the constraints
+ </summary>
+ </member>
+ <member name="P:Rhino.Mocks.Constraints.Or.Message">
+ <summary>
+ Gets the message for this constraint
+ </summary>
+ <value></value>
+ </member>
+ <member name="T:Rhino.Mocks.Constraints.Not">
+ <summary>
+ Negate a constraint
+ </summary>
+ </member>
+ <member name="M:Rhino.Mocks.Constraints.Not.#ctor(Rhino.Mocks.Constraints.AbstractConstraint)">
+ <summary>
+ Creates a new <see cref="T:Rhino.Mocks.Constraints.And"/> instance.
+ </summary>
+ <param name="c1">C1.</param>
+ </member>
+ <member name="M:Rhino.Mocks.Constraints.Not.Eval(System.Object)">
+ <summary>
+ determains if the object pass the constraints
+ </summary>
+ </member>
+ <member name="P:Rhino.Mocks.Constraints.Not.Message">
+ <summary>
+ Gets the message for this constraint
+ </summary>
+ <value></value>
+ </member>
+ <member name="T:Rhino.Mocks.Constraints.And">
+ <summary>
+ Combines two constraints
+ </summary>
+ <remarks></remarks>
+ </member>
+ <member name="M:Rhino.Mocks.Constraints.And.#ctor(Rhino.Mocks.Constraints.AbstractConstraint,Rhino.Mocks.Constraints.AbstractConstraint)">
+ <summary>
+ Creates a new <see cref="T:Rhino.Mocks.Constraints.And"/> instance.
+ </summary>
+ <param name="c1">C1.</param>
+ <param name="c2">C2.</param>
+ </member>
+ <member name="M:Rhino.Mocks.Constraints.And.Eval(System.Object)">
+ <summary>
+ determains if the object pass the constraints
+ </summary>
+ </member>
+ <member name="P:Rhino.Mocks.Constraints.And.Message">
+ <summary>
+ Gets the message for this constraint
+ </summary>
+ <value></value>
+ </member>
+ <member name="T:Rhino.Mocks.Constraints.Like">
+ <summary>
+ Constrain the argument to validate according to regex pattern
+ </summary>
+ </member>
+ <member name="M:Rhino.Mocks.Constraints.Like.#ctor(System.String)">
+ <summary>
+ Creates a new <see cref="T:Rhino.Mocks.Constraints.Like"/> instance.
+ </summary>
+ <param name="pattern">Pattern.</param>
+ </member>
+ <member name="M:Rhino.Mocks.Constraints.Like.Eval(System.Object)">
+ <summary>
+ determains if the object pass the constraints
+ </summary>
+ </member>
+ <member name="P:Rhino.Mocks.Constraints.Like.Message">
+ <summary>
+ Gets the message for this constraint
+ </summary>
+ <value></value>
+ </member>
+ <member name="T:Rhino.Mocks.Constraints.Contains">
+ <summary>
+ Constraint that evaluate whatever an argument contains the specified string.
+ </summary>
+ </member>
+ <member name="M:Rhino.Mocks.Constraints.Contains.#ctor(System.String)">
+ <summary>
+ Creates a new <see cref="T:Rhino.Mocks.Constraints.Contains"/> instance.
+ </summary>
+ <param name="innerString">Inner string.</param>
+ </member>
+ <member name="M:Rhino.Mocks.Constraints.Contains.Eval(System.Object)">
+ <summary>
+ determains if the object pass the constraints
+ </summary>
+ </member>
+ <member name="P:Rhino.Mocks.Constraints.Contains.Message">
+ <summary>
+ Gets the message for this constraint
+ </summary>
+ <value></value>
+ </member>
+ <member name="T:Rhino.Mocks.Constraints.EndsWith">
+ <summary>
+ Constraint that evaluate whatever an argument ends with the specified string
+ </summary>
+ </member>
+ <member name="M:Rhino.Mocks.Constraints.EndsWith.#ctor(System.String)">
+ <summary>
+ Creates a new <see cref="T:Rhino.Mocks.Constraints.EndsWith"/> instance.
+ </summary>
+ <param name="end">End.</param>
+ </member>
+ <member name="M:Rhino.Mocks.Constraints.EndsWith.Eval(System.Object)">
+ <summary>
+ determains if the object pass the constraints
+ </summary>
+ </member>
+ <member name="P:Rhino.Mocks.Constraints.EndsWith.Message">
+ <summary>
+ Gets the message for this constraint
+ </summary>
+ <value></value>
+ </member>
+ <member name="T:Rhino.Mocks.Constraints.StartsWith">
+ <summary>
+ Constraint that evaluate whatever an argument start with the specified string
+ </summary>
+ </member>
+ <member name="M:Rhino.Mocks.Constraints.StartsWith.#ctor(System.String)">
+ <summary>
+ Creates a new <see cref="T:Rhino.Mocks.Constraints.StartsWith"/> instance.
+ </summary>
+ <param name="start">Start.</param>
+ </member>
+ <member name="M:Rhino.Mocks.Constraints.StartsWith.Eval(System.Object)">
+ <summary>
+ determains if the object pass the constraints
+ </summary>
+ </member>
+ <member name="P:Rhino.Mocks.Constraints.StartsWith.Message">
+ <summary>
+ Gets the message for this constraint
+ </summary>
+ <value></value>
+ </member>
+ <member name="T:Rhino.Mocks.Constraints.Equal">
+ <summary>
+ Constraint that evaluate whatever an object equals another
+ </summary>
+ </member>
+ <member name="M:Rhino.Mocks.Constraints.Equal.#ctor(System.Object)">
+ <summary>
+ Creates a new <see cref="T:Rhino.Mocks.Constraints.Equal"/> instance.
+ </summary>
+ <param name="obj">Obj.</param>
+ </member>
+ <member name="M:Rhino.Mocks.Constraints.Equal.Eval(System.Object)">
+ <summary>
+ determains if the object pass the constraints
+ </summary>
+ </member>
+ <member name="P:Rhino.Mocks.Constraints.Equal.Message">
+ <summary>
+ Gets the message for this constraint
+ </summary>
+ <value></value>
+ </member>
+ <member name="T:Rhino.Mocks.Constraints.Anything">
+ <summary>
+ Constraint that always returns true
+ </summary>
+ </member>
+ <member name="M:Rhino.Mocks.Constraints.Anything.Eval(System.Object)">
+ <summary>
+ determains if the object pass the constraints
+ </summary>
+ </member>
+ <member name="P:Rhino.Mocks.Constraints.Anything.Message">
+ <summary>
+ Gets the message for this constraint
+ </summary>
+ <value></value>
+ </member>
+ <member name="T:Rhino.Mocks.Constraints.ComparingConstraint">
+ <summary>
+ Constraint that evaluate whatever a comparable is greater than another
+ </summary>
+ </member>
+ <member name="M:Rhino.Mocks.Constraints.ComparingConstraint.#ctor(System.IComparable,System.Boolean,System.Boolean)">
+ <summary>
+ Creates a new <see cref="T:Rhino.Mocks.Constraints.ComparingConstraint"/> instance.
+ </summary>
+ </member>
+ <member name="M:Rhino.Mocks.Constraints.ComparingConstraint.Eval(System.Object)">
+ <summary>
+ determains if the object pass the constraints
+ </summary>
+ </member>
+ <member name="P:Rhino.Mocks.Constraints.ComparingConstraint.Message">
+ <summary>
+ Gets the message for this constraint
+ </summary>
+ <value></value>
+ </member>
+ <member name="T:Rhino.Mocks.Is">
+ <summary>
+ Central location for constraints
+ </summary>
+ </member>
+ <member name="M:Rhino.Mocks.Is.GreaterThan(System.IComparable)">
+ <summary>
+ Evaluate a greater than constraint for <see cref="T:System.IComparable"/>.
+ </summary>
+ <param name="objToCompare">The object the parameter should be greater than</param>
+ </member>
+ <member name="M:Rhino.Mocks.Is.LessThan(System.IComparable)">
+ <summary>
+ Evaluate a less than constraint for <see cref="T:System.IComparable"/>.
+ </summary>
+ <param name="objToCompare">The object the parameter should be less than</param>
+ </member>
+ <member name="M:Rhino.Mocks.Is.LessThanOrEqual(System.IComparable)">
+ <summary>
+ Evaluate a less than or equal constraint for <see cref="T:System.IComparable"/>.
+ </summary>
+ <param name="objToCompare">The object the parameter should be less than or equal to</param>
+ </member>
+ <member name="M:Rhino.Mocks.Is.GreaterThanOrEqual(System.IComparable)">
+ <summary>
+ Evaluate a greater than or equal constraint for <see cref="T:System.IComparable"/>.
+ </summary>
+ <param name="objToCompare">The object the parameter should be greater than or equal to</param>
+ </member>
+ <member name="M:Rhino.Mocks.Is.Equal(System.Object)">
+ <summary>
+ Evaluate an equal constraint for <see cref="T:System.IComparable"/>.
+ </summary>
+ <param name="obj">The object the parameter should equal to</param>
+ </member>
+ <member name="M:Rhino.Mocks.Is.NotEqual(System.Object)">
+ <summary>
+ Evaluate a not equal constraint for <see cref="T:System.IComparable"/>.
+ </summary>
+ <param name="obj">The object the parameter should not equal to</param>
+ </member>
+ <member name="M:Rhino.Mocks.Is.Same(System.Object)">
+ <summary>
+ Evaluate a same as constraint.
+ </summary>
+ <param name="obj">The object the parameter should the same as.</param>
+ </member>
+ <member name="M:Rhino.Mocks.Is.NotSame(System.Object)">
+ <summary>
+ Evaluate a not same as constraint.
+ </summary>
+ <param name="obj">The object the parameter should not be the same as.</param>
+ </member>
+ <member name="M:Rhino.Mocks.Is.Anything">
+ <summary>
+ A constraints that accept anything
+ </summary>
+ <returns></returns>
+ </member>
+ <member name="M:Rhino.Mocks.Is.Null">
+ <summary>
+ A constraint that accept only nulls
+ </summary>
+ <returns></returns>
+ </member>
+ <member name="M:Rhino.Mocks.Is.NotNull">
+ <summary>
+ A constraint that accept only non null values
+ </summary>
+ <returns></returns>
+ </member>
+ <member name="M:Rhino.Mocks.Is.TypeOf(System.Type)">
+ <summary>
+ A constraint that accept only value of the specified type
+ </summary>
+ </member>
+ <member name="M:Rhino.Mocks.Is.TypeOf``1">
+ <summary>
+ A constraint that accept only value of the specified type
+ </summary>
+ </member>
+ <member name="T:Rhino.Mocks.List">
+ <summary>
+ Central location for constraints about lists and collections
+ </summary>
+ </member>
+ <member name="M:Rhino.Mocks.List.IsIn(System.Object)">
+ <summary>
+ Determines whether the specified obj is in the paramter.
+ The parameter must be IEnumerable.
+ </summary>
+ <param name="obj">Obj.</param>
+ <returns></returns>
+ </member>
+ <member name="M:Rhino.Mocks.List.OneOf(System.Collections.ICollection)">
+ <summary>
+ Determains whatever the parameter is in the collection.
+ </summary>
+ </member>
+ <member name="M:Rhino.Mocks.List.Equal(System.Collections.ICollection)">
+ <summary>
+ Determains that the parameter collection is identical to the specified collection
+ </summary>
+ </member>
+ <member name="T:Rhino.Mocks.Property">
+ <summary>
+ Central location for constraints for object's properties
+ </summary>
+ </member>
+ <member name="M:Rhino.Mocks.Property.Value(System.String,System.Object)">
+ <summary>
+ Constrains the parameter to have property with the specified value
+ </summary>
+ <param name="propertyName">Name of the property.</param>
+ <param name="expectedValue">Expected value.</param>
+ <returns></returns>
+ </member>
+ <member name="M:Rhino.Mocks.Property.Value(System.Type,System.String,System.Object)">
+ <summary>
+ Constrains the parameter to have property with the specified value.
+ </summary>
+ <param name="declaringType">The type that declares the property, used to disambiguate between properties.</param>
+ <param name="propertyName">Name of the property.</param>
+ <param name="expectedValue">Expected value.</param>
+ <returns></returns>
+ </member>
+ <member name="M:Rhino.Mocks.Property.ValueConstraint(System.String,Rhino.Mocks.Constraints.AbstractConstraint)">
+ <summary>
+ Constrains the parameter to have a property satisfying a specified constraint.
+ </summary>
+ <param name="propertyName">Name of the property.</param>
+ <param name="propertyConstraint">Constraint for the property.</param>
+ </member>
+ <member name="M:Rhino.Mocks.Property.ValueConstraint(System.Type,System.String,Rhino.Mocks.Constraints.AbstractConstraint)">
+ <summary>
+ Constrains the parameter to have a property satisfying a specified constraint.
+ </summary>
+ <param name="declaringType">The type that declares the property, used to disambiguate between properties.</param>
+ <param name="propertyName">Name of the property.</param>
+ <param name="propertyConstraint">Constraint for the property.</param>
+ </member>
+ <member name="M:Rhino.Mocks.Property.IsNull(System.String)">
+ <summary>
+ Determines whether the parameter has the specified property and that it is null.
+ </summary>
+ <param name="propertyName">Name of the property.</param>
+ <returns></returns>
+ </member>
+ <member name="M:Rhino.Mocks.Property.IsNull(System.Type,System.String)">
+ <summary>
+ Determines whether the parameter has the specified property and that it is null.
+ </summary>
+ <param name="declaringType">The type that declares the property, used to disambiguate between properties.</param>
+ <param name="propertyName">Name of the property.</param>
+ <returns></returns>
+ </member>
+ <member name="M:Rhino.Mocks.Property.IsNotNull(System.String)">
+ <summary>
+ Determines whether the parameter has the specified property and that it is not null.
+ </summary>
+ <param name="propertyName">Name of the property.</param>
+ <returns></returns>
+ </member>
+ <member name="M:Rhino.Mocks.Property.IsNotNull(System.Type,System.String)">
+ <summary>
+ Determines whether the parameter has the specified property and that it is not null.
+ </summary>
+ <param name="declaringType">The type that declares the property, used to disambiguate between properties.</param>
+ <param name="propertyName">Name of the property.</param>
+ <returns></returns>
+ </member>
+ <member name="T:Rhino.Mocks.Text">
+ <summary>
+ Central location for all text related constraints
+ </summary>
+ </member>
+ <member name="M:Rhino.Mocks.Text.StartsWith(System.String)">
+ <summary>
+ Constrain the argument to starts with the specified string
+ </summary>
+ </member>
+ <member name="M:Rhino.Mocks.Text.EndsWith(System.String)">
+ <summary>
+ Constrain the argument to end with the specified string
+ </summary>
+ </member>
+ <member name="M:Rhino.Mocks.Text.Contains(System.String)">
+ <summary>
+ Constrain the argument to contain the specified string
+ </summary>
+ </member>
+ <member name="M:Rhino.Mocks.Text.Like(System.String)">
+ <summary>
+ Constrain the argument to validate according to regex pattern
+ </summary>
+ </member>
+ <member name="T:Rhino.Mocks.Exceptions.ExpectationViolationException">
+ <summary>
+ An expectaton violation was detected.
+ </summary>
+ </member>
+ <member name="M:Rhino.Mocks.Exceptions.ExpectationViolationException.#ctor(System.String)">
+ <summary>
+ Creates a new <see cref="T:Rhino.Mocks.Exceptions.ExpectationViolationException"/> instance.
+ </summary>
+ <param name="message">Message.</param>
+ </member>
+ <member name="M:Rhino.Mocks.Exceptions.ExpectationViolationException.#ctor(System.Runtime.Serialization.SerializationInfo,System.Runtime.Serialization.StreamingContext)">
+ <summary>
+ Serialization constructor
+ </summary>
+ </member>
+ <member name="T:Rhino.Mocks.Exceptions.ObjectNotMockFromThisRepositoryException">
+ <summary>
+ Signals that an object was call on a mock repostiroy which doesn't
+ belong to this mock repository or not a mock
+ </summary>
+ </member>
+ <member name="M:Rhino.Mocks.Exceptions.ObjectNotMockFromThisRepositoryException.#ctor(System.String)">
+ <summary>
+ Creates a new <see cref="T:Rhino.Mocks.Exceptions.ObjectNotMockFromThisRepositoryException"/> instance.
+ </summary>
+ <param name="message">Message.</param>
+ </member>
+ <member name="M:Rhino.Mocks.Exceptions.ObjectNotMockFromThisRepositoryException.#ctor(System.Runtime.Serialization.SerializationInfo,System.Runtime.Serialization.StreamingContext)">
+ <summary>
+ Serialization constructor
+ </summary>
+ </member>
+ <member name="T:Rhino.Mocks.Expectations.AbstractExpectation">
+ <summary>
+ Abstract class that holds common information for
+ expectations.
+ </summary>
+ </member>
+ <member name="T:Rhino.Mocks.Interfaces.IExpectation">
+ <summary>
+ Interface to validate that a method call is correct.
+ </summary>
+ </member>
+ <member name="M:Rhino.Mocks.Interfaces.IExpectation.IsExpected(System.Object[])">
+ <summary>
+ Validate the arguments for the method.
+ This method can be called numerous times, so be careful about side effects
+ </summary>
+ <param name="args">The arguments with which the method was called</param>
+ </member>
+ <member name="M:Rhino.Mocks.Interfaces.IExpectation.AddActualCall">
+ <summary>
+ Add an actual method call to this expectation
+ </summary>
+ </member>
+ <member name="M:Rhino.Mocks.Interfaces.IExpectation.ReturnOrThrow(System.Object[])">
+ <summary>
+ Returns the return value or throw the exception and setup any output / ref parameters
+ that has been set.
+ </summary>
+ </member>
+ <member name="P:Rhino.Mocks.Interfaces.IExpectation.ErrorMessage">
+ <summary>
+ Gets the error message.
+ </summary>
+ <value></value>
+ </member>
+ <member name="P:Rhino.Mocks.Interfaces.IExpectation.Expected">
+ <summary>
+ Range of expected calls
+ </summary>
+ </member>
+ <member name="P:Rhino.Mocks.Interfaces.IExpectation.ActualCalls">
+ <summary>
+ Number of call actually made for this method
+ </summary>
+ </member>
+ <member name="P:Rhino.Mocks.Interfaces.IExpectation.CanAcceptCalls">
+ <summary>
+ If this expectation is still waiting for calls.
+ </summary>
+ </member>
+ <member name="P:Rhino.Mocks.Interfaces.IExpectation.ReturnValue">
+ <summary>
+ The return value for a method matching this expectation
+ </summary>
+ </member>
+ <member name="P:Rhino.Mocks.Interfaces.IExpectation.ExceptionToThrow">
+ <summary>
+ Gets or sets the exception to throw on a method matching this expectation.
+ </summary>
+ </member>
+ <member name="P:Rhino.Mocks.Interfaces.IExpectation.ActionsSatisfied">
+ <summary>
+ Gets a value indicating whether this instance's action is staisfied.
+ A staisfied instance means that there are no more requirements from
+ this method. A method with non void return value must register either
+ a return value or an exception to throw.
+ </summary>
+ </member>
+ <member name="P:Rhino.Mocks.Interfaces.IExpectation.Method">
+ <summary>
+ Gets the method this expectation is for.
+ </summary>
+ </member>
+ <member name="P:Rhino.Mocks.Interfaces.IExpectation.RepeatableOption">
+ <summary>
+ Gets or sets what special condtions there are for this method
+ repeating.
+ </summary>
+ </member>
+ <member name="P:Rhino.Mocks.Interfaces.IExpectation.ExpectationSatisfied">
+ <summary>
+ Gets a value indicating whether this expectation was satisfied
+ </summary>
+ </member>
+ <member name="P:Rhino.Mocks.Interfaces.IExpectation.HasReturnValue">
+ <summary>
+ Specify whatever this expectation has a return value set
+ You can't check ReturnValue for this because a valid return value include null.
+ </summary>
+ </member>
+ <member name="P:Rhino.Mocks.Interfaces.IExpectation.ActionToExecute">
+ <summary>
+ An action to execute when the method is matched.
+ </summary>
+ </member>
+ <member name="P:Rhino.Mocks.Interfaces.IExpectation.OutRefParams">
+ <summary>
+ Set the out / ref parameters for the method call.
+ The indexing is zero based and ignores any non out/ref parameter.
+ It is possible not to pass all the parameters. This method can be called only once.
+ </summary>
+ </member>
+ <member name="F:Rhino.Mocks.Expectations.AbstractExpectation.actualCalls">
+ <summary>
+ Number of actuall calls made that passed this expectation
+ </summary>
+ </member>
+ <member name="F:Rhino.Mocks.Expectations.AbstractExpectation.expected">
+ <summary>
+ Range of expected calls that should pass this expectation.
+ </summary>
+ </member>
+ <member name="F:Rhino.Mocks.Expectations.AbstractExpectation.returnValue">
+ <summary>
+ The return value for a method matching this expectation
+ </summary>
+ </member>
+ <member name="F:Rhino.Mocks.Expectations.AbstractExpectation.exceptionToThrow">
+ <summary>
+ The exception to throw on a method matching this expectation.
+ </summary>
+ </member>
+ <member name="F:Rhino.Mocks.Expectations.AbstractExpectation.method">
+ <summary>
+ The method this expectation is for.
+ </summary>
+ </member>
+ <member name="F:Rhino.Mocks.Expectations.AbstractExpectation.returnValueSet">
+ <summary>
+ The return value for this method was set
+ </summary>
+ </member>
+ <member name="F:Rhino.Mocks.Expectations.AbstractExpectation.repeatableOption">
+ <summary>
+ Whether this method will repeat
+ unlimited number of times.
+ </summary>
+ </member>
+ <member name="F:Rhino.Mocks.Expectations.AbstractExpectation.actionToExecute">
+ <summary>
+ A delegate that will be run when the
+ expectation is matched.
+ </summary>
+ </member>
+ <member name="F:Rhino.Mocks.Expectations.AbstractExpectation.matchingArgs">
+ <summary>
+ The arguments that matched this expectation.
+ </summary>
+ </member>
+ <member name="M:Rhino.Mocks.Expectations.AbstractExpectation.GetHashCode">
+ <summary>
+ Get the hash code
+ </summary>
+ </member>
+ <member name="M:Rhino.Mocks.Expectations.AbstractExpectation.AddActualCall">
+ <summary>
+ Add an actual method call to this expectation
+ </summary>
+ </member>
+ <member name="M:Rhino.Mocks.Expectations.AbstractExpectation.ReturnOrThrow(System.Object[])">
+ <summary>
+ Returns the return value or throw the exception and setup output / ref parameters
+ </summary>
+ </member>
+ <member name="M:Rhino.Mocks.Expectations.AbstractExpectation.IsExpected(System.Object[])">
+ <summary>
+ Validate the arguments for the method on the child methods
+ </summary>
+ <param name="args">The arguments with which the method was called</param>
+ </member>
+ <member name="M:Rhino.Mocks.Expectations.AbstractExpectation.#ctor(System.Reflection.MethodInfo)">
+ <summary>
+ Creates a new <see cref="T:Rhino.Mocks.Expectations.AbstractExpectation"/> instance.
+ </summary>
+ <param name="method">Method.</param>
+ </member>
+ <member name="M:Rhino.Mocks.Expectations.AbstractExpectation.#ctor(Rhino.Mocks.Interfaces.IExpectation)">
+ <summary>
+ Creates a new <see cref="T:Rhino.Mocks.Expectations.AbstractExpectation"/> instance.
+ </summary>
+ <param name="expectation">Expectation.</param>
+ </member>
+ <member name="M:Rhino.Mocks.Expectations.AbstractExpectation.DoIsExpected(System.Object[])">
+ <summary>
+ Validate the arguments for the method on the child methods
+ </summary>
+ <param name="args">The arguments with which the method was called</param>
+ </member>
+ <member name="M:Rhino.Mocks.Expectations.AbstractExpectation.Equals(System.Object)">
+ <summary>
+ Determines if this object equal to obj
+ </summary>
+ </member>
+ <member name="M:Rhino.Mocks.Expectations.AbstractExpectation.CreateErrorMessage(System.Reflection.MethodInfo,System.Object[])">
+ <summary>
+ The error message for these arguments
+ </summary>
+ </member>
+ <member name="M:Rhino.Mocks.Expectations.AbstractExpectation.AssertDelegateArgumentsMatchMethod(System.Delegate)">
+ <summary>
+ Asserts that the delegate has the same parameters as the expectation's method call
+ </summary>
+ </member>
+ <member name="P:Rhino.Mocks.Expectations.AbstractExpectation.OutRefParams">
+ <summary>
+ Setter for the outpur / ref parameters for this expecataion.
+ Can only be set once.
+ </summary>
+ </member>
+ <member name="P:Rhino.Mocks.Expectations.AbstractExpectation.HasReturnValue">
+ <summary>
+ Specify whatever this expectation has a return value set
+ You can't check ReturnValue for this because a valid return value include null.
+ </summary>
+ </member>
+ <member name="P:Rhino.Mocks.Expectations.AbstractExpectation.Method">
+ <summary>
+ Gets the method this expectation is for.
+ </summary>
+ </member>
+ <member name="P:Rhino.Mocks.Expectations.AbstractExpectation.RepeatableOption">
+ <summary>
+ Gets or sets what special condtions there are for this method
+ </summary>
+ </member>
+ <member name="P:Rhino.Mocks.Expectations.AbstractExpectation.Expected">
+ <summary>
+ Range of expected calls
+ </summary>
+ </member>
+ <member name="P:Rhino.Mocks.Expectations.AbstractExpectation.ActualCalls">
+ <summary>
+ Number of call actually made for this method
+ </summary>
+ </member>
+ <member name="P:Rhino.Mocks.Expectations.AbstractExpectation.CanAcceptCalls">
+ <summary>
+ If this expectation is still waiting for calls.
+ </summary>
+ </member>
+ <member name="P:Rhino.Mocks.Expectations.AbstractExpectation.ExpectationSatisfied">
+ <summary>
+ Gets a value indicating whether this expectation was satisfied
+ </summary>
+ </member>
+ <member name="P:Rhino.Mocks.Expectations.AbstractExpectation.ReturnValue">
+ <summary>
+ The return value for a method matching this expectation
+ </summary>
+ </member>
+ <member name="P:Rhino.Mocks.Expectations.AbstractExpectation.ActionToExecute">
+ <summary>
+ An action to execute when the method is matched.
+ </summary>
+ </member>
+ <member name="P:Rhino.Mocks.Expectations.AbstractExpectation.ExceptionToThrow">
+ <summary>
+ Gets or sets the exception to throw on a method matching this expectation.
+ </summary>
+ </member>
+ <member name="P:Rhino.Mocks.Expectations.AbstractExpectation.ActionsSatisfied">
+ <summary>
+ Gets a value indicating whether this instance's action is staisfied.
+ A staisfied instance means that there are no more requirements from
+ this method. A method with non void return value must register either
+ a return value or an exception to throw or an action to execute.
+ </summary>
+ </member>
+ <member name="P:Rhino.Mocks.Expectations.AbstractExpectation.ErrorMessage">
+ <summary>
+ Gets the error message.
+ </summary>
+ <value></value>
+ </member>
+ <member name="T:Rhino.Mocks.Expectations.AnyArgsExpectation">
+ <summary>
+ Expectation that matchs any arguments for the method.
+ </summary>
+ </member>
+ <member name="M:Rhino.Mocks.Expectations.AnyArgsExpectation.#ctor(System.Reflection.MethodInfo)">
+ <summary>
+ Creates a new <see cref="T:Rhino.Mocks.Expectations.AnyArgsExpectation"/> instance.
+ </summary>
+ <param name="method">Method.</param>
+ </member>
+ <member name="M:Rhino.Mocks.Expectations.AnyArgsExpectation.#ctor(Rhino.Mocks.Interfaces.IExpectation)">
+ <summary>
+ Creates a new <see cref="T:Rhino.Mocks.Expectations.AnyArgsExpectation"/> instance.
+ </summary>
+ <param name="expectation">Expectation.</param>
+ </member>
+ <member name="M:Rhino.Mocks.Expectations.AnyArgsExpectation.DoIsExpected(System.Object[])">
+ <summary>
+ Validate the arguments for the method.
+ </summary>
+ <param name="args">The arguments with which the method was called</param>
+ </member>
+ <member name="M:Rhino.Mocks.Expectations.AnyArgsExpectation.Equals(System.Object)">
+ <summary>
+ Determines if the object equal to expectation
+ </summary>
+ </member>
+ <member name="M:Rhino.Mocks.Expectations.AnyArgsExpectation.GetHashCode">
+ <summary>
+ Get the hash code
+ </summary>
+ </member>
+ <member name="P:Rhino.Mocks.Expectations.AnyArgsExpectation.ErrorMessage">
+ <summary>
+ Gets the error message.
+ </summary>
+ <value></value>
+ </member>
+ <member name="T:Rhino.Mocks.Expectations.ArgsEqualExpectation">
+ <summary>
+ Summary description for ArgsEqualExpectation.
+ </summary>
+ </member>
+ <member name="M:Rhino.Mocks.Expectations.ArgsEqualExpectation.#ctor(System.Reflection.MethodInfo,System.Object[])">
+ <summary>
+ Creates a new <see cref="T:Rhino.Mocks.Expectations.ArgsEqualExpectation"/> instance.
+ </summary>
+ <param name="expectedArgs">Expected args.</param>
+ <param name="method">method this expectation is for</param>
+ </member>
+ <member name="M:Rhino.Mocks.Expectations.ArgsEqualExpectation.DoIsExpected(System.Object[])">
+ <summary>
+ Validate the arguments for the method.
+ </summary>
+ <param name="args">The arguments with which the method was called</param>
+ </member>
+ <member name="M:Rhino.Mocks.Expectations.ArgsEqualExpectation.Equals(System.Object)">
+ <summary>
+ Determines if the object equal to expectation
+ </summary>
+ </member>
+ <member name="M:Rhino.Mocks.Expectations.ArgsEqualExpectation.GetHashCode">
+ <summary>
+ Get the hash code
+ </summary>
+ </member>
+ <member name="P:Rhino.Mocks.Expectations.ArgsEqualExpectation.ErrorMessage">
+ <summary>
+ Gets the error message.
+ </summary>
+ <value></value>
+ </member>
+ <member name="P:Rhino.Mocks.Expectations.ArgsEqualExpectation.ExpectedArgs">
+ <summary>
+ Get the expected args.
+ </summary>
+ </member>
+ <member name="T:Rhino.Mocks.Expectations.CallbackExpectation">
+ <summary>
+ Call a specified callback to verify the expectation
+ </summary>
+ </member>
+ <member name="M:Rhino.Mocks.Expectations.CallbackExpectation.#ctor(Rhino.Mocks.Interfaces.IExpectation,System.Delegate)">
+ <summary>
+ Creates a new <see cref="T:Rhino.Mocks.Expectations.CallbackExpectation"/> instance.
+ </summary>
+ <param name="expectation">Expectation.</param>
+ <param name="callback">Callback.</param>
+ </member>
+ <member name="M:Rhino.Mocks.Expectations.CallbackExpectation.#ctor(System.Reflection.MethodInfo,System.Delegate)">
+ <summary>
+ Creates a new <see cref="T:Rhino.Mocks.Expectations.CallbackExpectation"/> instance.
+ </summary>
+ <param name="method">Method.</param>
+ <param name="callback">Callback.</param>
+ </member>
+ <member name="M:Rhino.Mocks.Expectations.CallbackExpectation.DoIsExpected(System.Object[])">
+ <summary>
+ Validate the arguments for the method on the child methods
+ </summary>
+ <param name="args">The arguments with which the method was called</param>
+ </member>
+ <member name="M:Rhino.Mocks.Expectations.CallbackExpectation.Equals(System.Object)">
+ <summary>
+ Determines if the object equal to expectation
+ </summary>
+ </member>
+ <member name="M:Rhino.Mocks.Expectations.CallbackExpectation.GetHashCode">
+ <summary>
+ Get the hash code
+ </summary>
+ </member>
+ <member name="P:Rhino.Mocks.Expectations.CallbackExpectation.ErrorMessage">
+ <summary>
+ Gets the error message.
+ </summary>
+ <value></value>
+ </member>
+ <member name="T:Rhino.Mocks.Expectations.ConstraintsExpectation">
+ <summary>
+ Expect the method's arguments to match the contraints
+ </summary>
+ </member>
+ <member name="M:Rhino.Mocks.Expectations.ConstraintsExpectation.#ctor(System.Reflection.MethodInfo,Rhino.Mocks.Constraints.AbstractConstraint[])">
+ <summary>
+ Creates a new <see cref="T:Rhino.Mocks.Expectations.ConstraintsExpectation"/> instance.
+ </summary>
+ <param name="method">Method.</param>
+ <param name="constraints">Constraints.</param>
+ </member>
+ <member name="M:Rhino.Mocks.Expectations.ConstraintsExpectation.#ctor(Rhino.Mocks.Interfaces.IExpectation,Rhino.Mocks.Constraints.AbstractConstraint[])">
+ <summary>
+ Creates a new <see cref="T:Rhino.Mocks.Expectations.ConstraintsExpectation"/> instance.
+ </summary>
+ <param name="expectation">Expectation.</param>
+ <param name="constraints">Constraints.</param>
+ </member>
+ <member name="M:Rhino.Mocks.Expectations.ConstraintsExpectation.DoIsExpected(System.Object[])">
+ <summary>
+ Validate the arguments for the method.
+ </summary>
+ <param name="args">The arguments with which the method was called</param>
+ </member>
+ <member name="M:Rhino.Mocks.Expectations.ConstraintsExpectation.Equals(System.Object)">
+ <summary>
+ Determines if the object equal to expectation
+ </summary>
+ </member>
+ <member name="M:Rhino.Mocks.Expectations.ConstraintsExpectation.GetHashCode">
+ <summary>
+ Get the hash code
+ </summary>
+ </member>
+ <member name="P:Rhino.Mocks.Expectations.ConstraintsExpectation.ErrorMessage">
+ <summary>
+ Gets the error message.
+ </summary>
+ <value></value>
+ </member>
+ <member name="T:Rhino.Mocks.Generated.ExpectationsList">
+ <summary>
+ ExpectationsList
+ </summary>
+ </member>
+ <member name="T:Rhino.Mocks.Generated.ProxyMethodExpectationsDictionary">
+ <summary>
+ Dictionary
+ </summary>
+ </member>
+ <member name="T:Rhino.Mocks.Generated.ProxyStateDictionary">
+ <summary>
+ Dictionary class
+ </summary>
+ </member>
+ <member name="M:Rhino.Mocks.Generated.ProxyStateDictionary.#ctor">
+ <summary>
+ Create a new instance of <c>ProxyStateDictionary</c>
+ </summary>
+ </member>
+ <member name="T:Rhino.Mocks.Impl.CreateMethodExpectation">
+ <summary>
+ Allows to call a method and immediatly get it's options.
+ </summary>
+ </member>
+ <member name="T:Rhino.Mocks.Interfaces.ICreateMethodExpectation">
+ <summary>
+ Interface to allows to call a method and immediatly get it's options.
+ </summary>
+ </member>
+ <member name="M:Rhino.Mocks.Interfaces.ICreateMethodExpectation.Call(System.Object)">
+ <summary>
+ Get the method options for the call
+ </summary>
+ <param name="ignored">The method call should go here, the return value is ignored</param>
+ </member>
+ <member name="M:Rhino.Mocks.Impl.CreateMethodExpectation.#ctor(Rhino.Mocks.Interfaces.IMockedObject,System.Object)">
+ <summary>
+ Creates a new <see cref="T:Rhino.Mocks.Impl.CreateMethodExpectation"/> instance.
+ </summary>
+ </member>
+ <member name="M:Rhino.Mocks.Impl.CreateMethodExpectation.Call(System.Object)">
+ <summary>
+ Get the method options for the call
+ </summary>
+ <param name="ignored">The method call should go here, the return value is ignored</param>
+ </member>
+ <member name="T:Rhino.Mocks.Impl.CreateMethodExpectationForSetupResult">
+ <summary>
+ Allows to call a method and immediatly get it's options.
+ Set the expected number for the call to Any()
+ </summary>
+ </member>
+ <member name="M:Rhino.Mocks.Impl.CreateMethodExpectationForSetupResult.#ctor(Rhino.Mocks.Interfaces.IMockedObject,System.Object)">
+ <summary>
+ Creates a new <see cref="T:Rhino.Mocks.Impl.CreateMethodExpectationForSetupResult"/> instance.
+ </summary>
+ <param name="mockedObject">Proxy.</param>
+ <param name="mockedInstance">Mocked instance.</param>
+ </member>
+ <member name="M:Rhino.Mocks.Impl.CreateMethodExpectationForSetupResult.Call(System.Object)">
+ <summary>
+ Get the method options for the call
+ </summary>
+ <param name="ignored">The method call should go here, the return value is ignored</param>
+ </member>
+ <member name="T:Rhino.Mocks.Impl.DelegateTargetInterfaceCreator">
+ <summary>
+ This class is reponsible for taking a delegate and creating a wrapper
+ interface around it, so it can be mocked.
+ </summary>
+ </member>
+ <member name="F:Rhino.Mocks.Impl.DelegateTargetInterfaceCreator.moduleScope">
+ <summary>
+ The scope for all the delegate interfaces create by this mock repositroy.
+ </summary>
+ </member>
+ <member name="M:Rhino.Mocks.Impl.DelegateTargetInterfaceCreator.GetDelegateTargetInterface(System.Type)">
+ <summary>
+ Gets a type with an "Invoke" method suitable for use as a target of the
+ specified delegate type.
+ </summary>
+ <param name="delegateType"></param>
+ <returns></returns>
+ </member>
+ <member name="T:Rhino.Mocks.Impl.EventRaiser">
+ <summary>
+ Raise events for all subscribers for an event
+ </summary>
+ </member>
+ <member name="T:Rhino.Mocks.Interfaces.IEventRaiser">
+ <summary>
+ Raise events for all subscribers for an event
+ </summary>
+ </member>
+ <member name="M:Rhino.Mocks.Interfaces.IEventRaiser.Raise(System.Object[])">
+ <summary>
+ Raise the event
+ </summary>
+ </member>
+ <member name="M:Rhino.Mocks.Impl.EventRaiser.#ctor(Rhino.Mocks.Interfaces.IMockedObject,System.String)">
+ <summary>
+ Creates a new instance of <c>EventRaiser</c>
+ </summary>
+ </member>
+ <member name="M:Rhino.Mocks.Impl.EventRaiser.Raise(System.Object[])">
+ <summary>
+ Raise the event
+ </summary>
+ </member>
+ <member name="T:Rhino.Mocks.Impl.MethodOptions">
+ <summary>
+ Allows to define what would happen when a method
+ is called.
+ </summary>
+ </member>
+ <member name="T:Rhino.Mocks.Interfaces.IMethodOptions">
+ <summary>
+ Allows to define what would happen when a method
+ is called.
+ </summary>
+ </member>
+ <member name="M:Rhino.Mocks.Interfaces.IMethodOptions.Return(System.Object)">
+ <summary>
+ Set the return value for the method.
+ </summary>
+ <param name="objToReturn">The object the method will return</param>
+ <returns>IRepeat that defines how many times the method will return this value</returns>
+ </member>
+ <member name="M:Rhino.Mocks.Interfaces.IMethodOptions.Throw(System.Exception)">
+ <summary>
+ Throws the specified exception when the method is called.
+ </summary>
+ <param name="exception">Exception to throw</param>
+ </member>
+ <member name="M:Rhino.Mocks.Interfaces.IMethodOptions.IgnoreArguments">
+ <summary>
+ Ignores the arguments for this method. Any argument will be matched
+ againt this method.
+ </summary>
+ </member>
+ <member name="M:Rhino.Mocks.Interfaces.IMethodOptions.Constraints(Rhino.Mocks.Constraints.AbstractConstraint[])">
+ <summary>
+ Add constraints for the method's arguments.
+ </summary>
+ </member>
+ <member name="M:Rhino.Mocks.Interfaces.IMethodOptions.Callback(System.Delegate)">
+ <summary>
+ Set a callback method for the last call
+ </summary>
+ </member>
+ <member name="M:Rhino.Mocks.Interfaces.IMethodOptions.Do(Syste...
[truncated message content] |
|
From: <jor...@us...> - 2007-02-23 01:25:59
|
Revision: 9
http://svn.sourceforge.net/captainhook/?rev=9&view=rev
Author: jordan-terrell
Date: 2007-02-22 17:25:56 -0800 (Thu, 22 Feb 2007)
Log Message:
-----------
Turned on "Treat Warnings as Errors" for all projects
Added MSBuild build script (master.build)
---completeBuild.bat, build.bat, clean.bat can be used to execute targets in build script
Modified Paths:
--------------
trunk/CaptainHook.Interfaces/CaptainHook.Interfaces.csproj
trunk/CaptainHook.SubversionWrapper/CaptainHook.SubversionWrapper.csproj
trunk/CaptainHookExe/CaptainHook.csproj
trunk/CaptainHookSolution.sln
trunk/UnitTests/UnitTests.csproj
trunk/Velocit.Hook.Plugins/Velocit.Hook.Plugins.csproj
Added Paths:
-----------
trunk/External/
trunk/External/Tools/
trunk/External/Tools/MSBuildCommunityTasks/
trunk/External/Tools/MSBuildCommunityTasks/ICSharpCode.SharpZipLib.dll
trunk/External/Tools/MSBuildCommunityTasks/MSBuild.Community.Tasks.Targets
trunk/External/Tools/MSBuildCommunityTasks/MSBuild.Community.Tasks.chm
trunk/External/Tools/MSBuildCommunityTasks/MSBuild.Community.Tasks.dll
trunk/External/Tools/MSBuildCommunityTasks/MSBuild.Community.Tasks.xml
trunk/External/Tools/MSBuildCommunityTasks/MSBuild.Community.Tasks.xsd
trunk/build.bat
trunk/clean.bat
trunk/completeBuild.bat
trunk/master.build
Modified: trunk/CaptainHook.Interfaces/CaptainHook.Interfaces.csproj
===================================================================
--- trunk/CaptainHook.Interfaces/CaptainHook.Interfaces.csproj 2007-02-22 23:02:37 UTC (rev 8)
+++ trunk/CaptainHook.Interfaces/CaptainHook.Interfaces.csproj 2007-02-23 01:25:56 UTC (rev 9)
@@ -18,6 +18,7 @@
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
+ <TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
Modified: trunk/CaptainHook.SubversionWrapper/CaptainHook.SubversionWrapper.csproj
===================================================================
--- trunk/CaptainHook.SubversionWrapper/CaptainHook.SubversionWrapper.csproj 2007-02-22 23:02:37 UTC (rev 8)
+++ trunk/CaptainHook.SubversionWrapper/CaptainHook.SubversionWrapper.csproj 2007-02-23 01:25:56 UTC (rev 9)
@@ -19,6 +19,7 @@
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<UseVSHostingProcess>true</UseVSHostingProcess>
+ <TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
Modified: trunk/CaptainHookExe/CaptainHook.csproj
===================================================================
--- trunk/CaptainHookExe/CaptainHook.csproj 2007-02-22 23:02:37 UTC (rev 8)
+++ trunk/CaptainHookExe/CaptainHook.csproj 2007-02-23 01:25:56 UTC (rev 9)
@@ -19,6 +19,7 @@
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<PlatformTarget>AnyCPU</PlatformTarget>
+ <TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
Modified: trunk/CaptainHookSolution.sln
===================================================================
--- trunk/CaptainHookSolution.sln 2007-02-22 23:02:37 UTC (rev 8)
+++ trunk/CaptainHookSolution.sln 2007-02-23 01:25:56 UTC (rev 9)
@@ -11,6 +11,14 @@
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Velocit.Hook.Plugins", "Velocit.Hook.Plugins\Velocit.Hook.Plugins.csproj", "{E5A33AEE-BAFA-4AE1-9A2A-E91CAC5EC82D}"
EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{0DA35A5A-70F9-4CC2-B6B0-D313C8E149C4}"
+ ProjectSection(SolutionItems) = preProject
+ build.bat = build.bat
+ clean.bat = clean.bat
+ completeBuild.bat = completeBuild.bat
+ master.build = master.build
+ EndProjectSection
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Added: trunk/External/Tools/MSBuildCommunityTasks/ICSharpCode.SharpZipLib.dll
===================================================================
(Binary files differ)
Property changes on: trunk/External/Tools/MSBuildCommunityTasks/ICSharpCode.SharpZipLib.dll
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/External/Tools/MSBuildCommunityTasks/MSBuild.Community.Tasks.Targets
===================================================================
--- trunk/External/Tools/MSBuildCommunityTasks/MSBuild.Community.Tasks.Targets (rev 0)
+++ trunk/External/Tools/MSBuildCommunityTasks/MSBuild.Community.Tasks.Targets 2007-02-23 01:25:56 UTC (rev 9)
@@ -0,0 +1,73 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <!-- $Id: MSBuild.Community.Tasks.Targets 139 2006-03-26 13:34:13Z cmumford $ -->
+
+ <PropertyGroup>
+ <MSBuildCommunityTasksPath Condition="'$(MSBuildCommunityTasksPath)' == ''">$(MSBuildExtensionsPath)\MSBuildCommunityTasks</MSBuildCommunityTasksPath>
+ <MSBuildCommunityTasksLib>$(MSBuildCommunityTasksPath)\MSBuild.Community.Tasks.dll</MSBuildCommunityTasksLib>
+ </PropertyGroup>
+
+ <UsingTask AssemblyFile="$(MSBuildCommunityTasksLib)" TaskName="MSBuild.Community.Tasks.AssemblyInfo" />
+ <UsingTask AssemblyFile="$(MSBuildCommunityTasksLib)" TaskName="MSBuild.Community.Tasks.Attrib" />
+ <UsingTask AssemblyFile="$(MSBuildCommunityTasksLib)" TaskName="MSBuild.Community.Tasks.ExecuteSQL" />
+ <UsingTask AssemblyFile="$(MSBuildCommunityTasksLib)" TaskName="MSBuild.Community.Tasks.FileUpdate" />
+ <UsingTask AssemblyFile="$(MSBuildCommunityTasksLib)" TaskName="MSBuild.Community.Tasks.FtpUpload" />
+ <UsingTask AssemblyFile="$(MSBuildCommunityTasksLib)" TaskName="MSBuild.Community.Tasks.FxCop" />
+ <UsingTask AssemblyFile="$(MSBuildCommunityTasksLib)" TaskName="MSBuild.Community.Tasks.ILMerge" />
+ <UsingTask AssemblyFile="$(MSBuildCommunityTasksLib)" TaskName="MSBuild.Community.Tasks.Mail" />
+ <UsingTask AssemblyFile="$(MSBuildCommunityTasksLib)" TaskName="MSBuild.Community.Tasks.Move" />
+
+ <UsingTask AssemblyFile="$(MSBuildCommunityTasksLib)" TaskName="MSBuild.Community.Tasks.Math.Add" />
+ <UsingTask AssemblyFile="$(MSBuildCommunityTasksLib)" TaskName="MSBuild.Community.Tasks.Math.Divide" />
+ <UsingTask AssemblyFile="$(MSBuildCommunityTasksLib)" TaskName="MSBuild.Community.Tasks.Math.Multiple" />
+ <UsingTask AssemblyFile="$(MSBuildCommunityTasksLib)" TaskName="MSBuild.Community.Tasks.Math.Subtract" />
+
+ <UsingTask AssemblyFile="$(MSBuildCommunityTasksLib)" TaskName="MSBuild.Community.Tasks.NDoc" />
+ <UsingTask AssemblyFile="$(MSBuildCommunityTasksLib)" TaskName="MSBuild.Community.Tasks.NUnit" />
+ <UsingTask AssemblyFile="$(MSBuildCommunityTasksLib)" TaskName="MSBuild.Community.Tasks.RegistryRead" />
+ <UsingTask AssemblyFile="$(MSBuildCommunityTasksLib)" TaskName="MSBuild.Community.Tasks.RegistryWrite" />
+ <UsingTask AssemblyFile="$(MSBuildCommunityTasksLib)" TaskName="MSBuild.Community.Tasks.Script" />
+ <UsingTask AssemblyFile="$(MSBuildCommunityTasksLib)" TaskName="MSBuild.Community.Tasks.ServiceController" />
+ <UsingTask AssemblyFile="$(MSBuildCommunityTasksLib)" TaskName="MSBuild.Community.Tasks.ServiceQuery" />
+ <UsingTask AssemblyFile="$(MSBuildCommunityTasksLib)" TaskName="MSBuild.Community.Tasks.Sleep" />
+
+ <UsingTask AssemblyFile="$(MSBuildCommunityTasksLib)" TaskName="MSBuild.Community.Tasks.Schema.TaskSchema" />
+
+ <UsingTask AssemblyFile="$(MSBuildCommunityTasksLib)" TaskName="MSBuild.Community.Tasks.SourceSafe.VssAdd" />
+ <UsingTask AssemblyFile="$(MSBuildCommunityTasksLib)" TaskName="MSBuild.Community.Tasks.SourceSafe.VssCheckin" />
+ <UsingTask AssemblyFile="$(MSBuildCommunityTasksLib)" TaskName="MSBuild.Community.Tasks.SourceSafe.VssCheckout" />
+ <UsingTask AssemblyFile="$(MSBuildCommunityTasksLib)" TaskName="MSBuild.Community.Tasks.SourceSafe.VssClean" />
+ <UsingTask AssemblyFile="$(MSBuildCommunityTasksLib)" TaskName="MSBuild.Community.Tasks.SourceSafe.VssDiff" />
+ <UsingTask AssemblyFile="$(MSBuildCommunityTasksLib)" TaskName="MSBuild.Community.Tasks.SourceSafe.VssGet" />
+ <UsingTask AssemblyFile="$(MSBuildCommunityTasksLib)" TaskName="MSBuild.Community.Tasks.SourceSafe.VssHistory" />
+ <UsingTask AssemblyFile="$(MSBuildCommunityTasksLib)" TaskName="MSBuild.Community.Tasks.SourceSafe.VssLabel" />
+ <UsingTask AssemblyFile="$(MSBuildCommunityTasksLib)" TaskName="MSBuild.Community.Tasks.SourceSafe.VssUndoCheckout" />
+
+ <UsingTask AssemblyFile="$(MSBuildCommunityTasksLib)" TaskName="MSBuild.Community.Tasks.Subversion.SvnCheckout" />
+ <UsingTask AssemblyFile="$(MSBuildCommunityTasksLib)" TaskName="MSBuild.Community.Tasks.Subversion.SvnClient" />
+ <UsingTask AssemblyFile="$(MSBuildCommunityTasksLib)" TaskName="MSBuild.Community.Tasks.Subversion.SvnCommit" />
+ <UsingTask AssemblyFile="$(MSBuildCommunityTasksLib)" TaskName="MSBuild.Community.Tasks.Subversion.SvnExport" />
+ <UsingTask AssemblyFile="$(MSBuildCommunityTasksLib)" TaskName="MSBuild.Community.Tasks.Subversion.SvnInfo" />
+ <UsingTask AssemblyFile="$(MSBuildCommunityTasksLib)" TaskName="MSBuild.Community.Tasks.Subversion.SvnUpdate" />
+ <UsingTask AssemblyFile="$(MSBuildCommunityTasksLib)" TaskName="MSBuild.Community.Tasks.Subversion.SvnVersion" />
+
+ <UsingTask AssemblyFile="$(MSBuildCommunityTasksLib)" TaskName="MSBuild.Community.Tasks.Time" />
+ <UsingTask AssemblyFile="$(MSBuildCommunityTasksLib)" TaskName="MSBuild.Community.Tasks.Unzip" />
+ <UsingTask AssemblyFile="$(MSBuildCommunityTasksLib)" TaskName="MSBuild.Community.Tasks.Version" />
+ <UsingTask AssemblyFile="$(MSBuildCommunityTasksLib)" TaskName="MSBuild.Community.Tasks.WebDownload" />
+ <UsingTask AssemblyFile="$(MSBuildCommunityTasksLib)" TaskName="MSBuild.Community.Tasks.XmlRead" />
+ <UsingTask AssemblyFile="$(MSBuildCommunityTasksLib)" TaskName="MSBuild.Community.Tasks.XmlUpdate" />
+ <UsingTask AssemblyFile="$(MSBuildCommunityTasksLib)" TaskName="MSBuild.Community.Tasks.Xslt" />
+ <UsingTask AssemblyFile="$(MSBuildCommunityTasksLib)" TaskName="MSBuild.Community.Tasks.Zip" />
+
+ <ItemGroup>
+ <FxCopRuleAssemblies Include="UsageRules.dll"/>
+ <FxCopRuleAssemblies Include="SecurityRules.dll"/>
+ <FxCopRuleAssemblies Include="PortabilityRules.dll"/>
+ <FxCopRuleAssemblies Include="PerformanceRules.dll"/>
+ <FxCopRuleAssemblies Include="MobilityRules.dll"/>
+ <FxCopRuleAssemblies Include="InteroperabilityRules.dll"/>
+ <FxCopRuleAssemblies Include="GlobalizationRules.dll"/>
+ <FxCopRuleAssemblies Include="DesignRules.dll"/>
+ </ItemGroup>
+</Project>
Added: trunk/External/Tools/MSBuildCommunityTasks/MSBuild.Community.Tasks.chm
===================================================================
(Binary files differ)
Property changes on: trunk/External/Tools/MSBuildCommunityTasks/MSBuild.Community.Tasks.chm
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/External/Tools/MSBuildCommunityTasks/MSBuild.Community.Tasks.dll
===================================================================
(Binary files differ)
Property changes on: trunk/External/Tools/MSBuildCommunityTasks/MSBuild.Community.Tasks.dll
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/External/Tools/MSBuildCommunityTasks/MSBuild.Community.Tasks.xml
===================================================================
--- trunk/External/Tools/MSBuildCommunityTasks/MSBuild.Community.Tasks.xml (rev 0)
+++ trunk/External/Tools/MSBuildCommunityTasks/MSBuild.Community.Tasks.xml 2007-02-23 01:25:56 UTC (rev 9)
@@ -0,0 +1,4752 @@
+<?xml version="1.0"?>
+<doc>
+ <assembly>
+ <name>MSBuild.Community.Tasks</name>
+ </assembly>
+ <members>
+ <member name="T:MSBuild.Community.Tasks.AssemblyInfo">
+ <summary>
+ Generates an AssemblyInfo files
+ </summary>
+ <example>
+ <para>Generates a common version file.</para>
+ <code><![CDATA[
+ <AssemblyInfo CodeLanguage="CS"
+ OutputFile="VersionInfo.cs"
+ AssemblyVersion="1.0.0.0"
+ AssemblyFileVersion="1.0.0.0" />
+ ]]></code>
+ <para>Generates a complete version file.</para>
+ <code><![CDATA[
+ <AssemblyInfo CodeLanguage="CS"
+ OutputFile="$(MSBuildProjectDirectory)\Test\GlobalInfo.cs"
+ AssemblyTitle="AssemblyInfoTask"
+ AssemblyDescription="AssemblyInfo Description"
+ AssemblyConfiguration=""
+ AssemblyCompany="Company Name, LLC"
+ AssemblyProduct="AssemblyInfoTask"
+ AssemblyCopyright="Copyright (c) Company Name, LLC 2006"
+ AssemblyTrademark=""
+ ComVisible="false"
+ CLSCompliant="true"
+ Guid="d038566a-1937-478a-b5c5-b79c4afb253d"
+ AssemblyVersion="1.0.0.0"
+ AssemblyFileVersion="1.0.0.0" />
+ ]]></code>
+ </example>
+ </member>
+ <member name="F:MSBuild.Community.Tasks.AssemblyInfo.DEFAULT_OUTPUT_FILE">
+ <summary>
+ The default value of <see cref="P:MSBuild.Community.Tasks.AssemblyInfo.OutputFile"/>.
+ The value is <c>"AssemblyInfo.cs"</c>.
+ </summary>
+ </member>
+ <member name="M:MSBuild.Community.Tasks.AssemblyInfo.#ctor">
+ <summary>
+ Initializes a new instance of the <see cref="T:AssemblyInfo"/> class.
+ </summary>
+ </member>
+ <member name="M:MSBuild.Community.Tasks.AssemblyInfo.Execute">
+ <summary>
+ When overridden in a derived class, executes the task.
+ </summary>
+ <returns>
+ true if the task successfully executed; otherwise, false.
+ </returns>
+ </member>
+ <member name="P:MSBuild.Community.Tasks.AssemblyInfo.CodeLanguage">
+ <summary>
+ Gets or sets the code language.
+ </summary>
+ <value>The code language.</value>
+ </member>
+ <member name="P:MSBuild.Community.Tasks.AssemblyInfo.ComVisible">
+ <summary>
+ Gets or sets a value indicating whether [COMVisible].
+ </summary>
+ <value><c>true</c> if [COMVisible]; otherwise, <c>false</c>.</value>
+ </member>
+ <member name="P:MSBuild.Community.Tasks.AssemblyInfo.CLSCompliant">
+ <summary>
+ Gets or sets a value indicating whether [CLSCompliant].
+ </summary>
+ <value><c>true</c> if [CLSCompliant]; otherwise, <c>false</c>.</value>
+ </member>
+ <member name="P:MSBuild.Community.Tasks.AssemblyInfo.Guid">
+ <summary>
+ Gets or sets the GUID.
+ </summary>
+ <value>The GUID.</value>
+ </member>
+ <member name="P:MSBuild.Community.Tasks.AssemblyInfo.AssemblyTitle">
+ <summary>
+ Gets or sets the assembly title.
+ </summary>
+ <value>The assembly title.</value>
+ </member>
+ <member name="P:MSBuild.Community.Tasks.AssemblyInfo.AssemblyDescription">
+ <summary>
+ Gets or sets the assembly description.
+ </summary>
+ <value>The assembly description.</value>
+ </member>
+ <member name="P:MSBuild.Community.Tasks.AssemblyInfo.AssemblyConfiguration">
+ <summary>
+ Gets or sets the assembly configuration.
+ </summary>
+ <value>The assembly configuration.</value>
+ </member>
+ <member name="P:MSBuild.Community.Tasks.AssemblyInfo.AssemblyCompany">
+ <summary>
+ Gets or sets the assembly company.
+ </summary>
+ <value>The assembly company.</value>
+ </member>
+ <member name="P:MSBuild.Community.Tasks.AssemblyInfo.AssemblyProduct">
+ <summary>
+ Gets or sets the assembly product.
+ </summary>
+ <value>The assembly product.</value>
+ </member>
+ <member name="P:MSBuild.Community.Tasks.AssemblyInfo.AssemblyCopyright">
+ <summary>
+ Gets or sets the assembly copyright.
+ </summary>
+ <value>The assembly copyright.</value>
+ </member>
+ <member name="P:MSBuild.Community.Tasks.AssemblyInfo.AssemblyTrademark">
+ <summary>
+ Gets or sets the assembly trademark.
+ </summary>
+ <value>The assembly trademark.</value>
+ </member>
+ <member name="P:MSBuild.Community.Tasks.AssemblyInfo.AssemblyCulture">
+ <summary>
+ Gets or sets the assembly culture.
+ </summary>
+ <value>The assembly culture.</value>
+ </member>
+ <member name="P:MSBuild.Community.Tasks.AssemblyInfo.AssemblyVersion">
+ <summary>
+ Gets or sets the assembly version.
+ </summary>
+ <value>The assembly version.</value>
+ </member>
+ <member name="P:MSBuild.Community.Tasks.AssemblyInfo.AssemblyFileVersion">
+ <summary>
+ Gets or sets the assembly file version.
+ </summary>
+ <value>The assembly file version.</value>
+ </member>
+ <member name="P:MSBuild.Community.Tasks.AssemblyInfo.AssemblyKeyFile">
+ <summary>
+ Gets or sets the assembly key file.
+ </summary>
+ </member>
+ <member name="P:MSBuild.Community.Tasks.AssemblyInfo.AssemblyKeyName">
+ <summary>
+ Gets or sets the assembly key name.
+ </summary>
+ </member>
+ <member name="P:MSBuild.Community.Tasks.AssemblyInfo.AssemblyDelaySign">
+ <summary>
+ Gets or sets the assembly delay sign value.
+ </summary>
+ </member>
+ <member name="P:MSBuild.Community.Tasks.AssemblyInfo.OutputFile">
+ <summary>
+ Gets or sets the output file.
+ </summary>
+ <value>The output file.</value>
+ </member>
+ <member name="T:MSBuild.Community.Tasks.Attrib">
+ <summary>
+ Changes the attributes of files and/or directories
+ </summary>
+ <example>
+ <para>Make file Readonly, Hidden and System.</para>
+ <code><![CDATA[
+ <Attrib Files="Test\version.txt"
+ ReadOnly="true" Hidden="true" System="true"/>
+ ]]></code>
+ <para>Clear Hidden and System attributes.</para>
+ <code><![CDATA[
+ <Attrib Files="Test\version.txt"
+ Hidden="false" System="false"/>
+ ]]></code>
+ <para>Make file Normal.</para>
+ <code><![CDATA[
+ <Attrib Files="Test\version.txt"
+ Normal="true"/>
+ ]]></code>
+ </example>
+ </member>
+ <member name="M:MSBuild.Community.Tasks.Attrib.Execute">
+ <summary>
+ Executes the task.
+ </summary>
+ <returns><see langword="true"/> if the task ran successfully;
+ otherwise <see langword="false"/>.</returns>
+ </member>
+ <member name="P:MSBuild.Community.Tasks.Attrib.Files">
+ <summary>
+ Gets or sets the list of files to change attributes on.
+ </summary>
+ <value>The files to change attributes on.</value>
+ </member>
+ <member name="P:MSBuild.Community.Tasks.Attrib.Directories">
+ <summary>
+ Gets or sets the list of directories to change attributes on.
+ </summary>
+ <value>The directories to change attributes on.</value>
+ </member>
+ <member name="P:MSBuild.Community.Tasks.Attrib.Archive">
+ <summary>
+ Gets or sets file's archive status.
+ </summary>
+ <value><c>true</c> if archive; otherwise, <c>false</c>.</value>
+ </member>
+ <member name="P:MSBuild.Community.Tasks.Attrib.Compressed">
+ <summary>
+ Gets or sets a value indicating file is compressed.
+ </summary>
+ <value><c>true</c> if compressed; otherwise, <c>false</c>.</value>
+ </member>
+ <member name="P:MSBuild.Community.Tasks.Attrib.Encrypted">
+ <summary>
+ Gets or sets a value indicating file is encrypted.
+ </summary>
+ <value><c>true</c> if encrypted; otherwise, <c>false</c>.</value>
+ </member>
+ <member name="P:MSBuild.Community.Tasks.Attrib.Hidden">
+ <summary>
+ Gets or sets a value indicating file is hidden, and thus is not included in an ordinary directory listing.
+ </summary>
+ <value><c>true</c> if hidden; otherwise, <c>false</c>.</value>
+ </member>
+ <member name="P:MSBuild.Community.Tasks.Attrib.Normal">
+ <summary>
+ Gets or sets a value indicating file is normal and has no other attributes set.
+ </summary>
+ <value><c>true</c> if normal; otherwise, <c>false</c>.</value>
+ </member>
+ <member name="P:MSBuild.Community.Tasks.Attrib.ReadOnly">
+ <summary>
+ Gets or sets a value indicating file is read-only.
+ </summary>
+ <value><c>true</c> if read-only; otherwise, <c>false</c>.</value>
+ </member>
+ <member name="P:MSBuild.Community.Tasks.Attrib.System">
+ <summary>
+ Gets or sets a value indicating file is a system file.
+ </summary>
+ <value><c>true</c> if system; otherwise, <c>false</c>.</value>
+ </member>
+ <member name="T:MSBuild.Community.Tasks.ILMerge">
+ <summary>
+ A wrapper for the ILMerge tool.
+ </summary>
+ <remarks>
+ <para>
+ The ILMerge tool itself must be installed separately.
+ It is available <a href="http://research.microsoft.com/~mbarnett/ILMerge.aspx">here</a>.
+ </para>
+ <para>
+ The command line options "/wildcards" and "/lib" of ILMerge is not supported,
+ because MSBuild is in charge of expanding wildcards for item groups.
+ </para>
+ </remarks>
+ <example>
+ This example merges two assemblies A.dll and B.dll into one:
+ <code><![CDATA[
+ <PropertyGroup>
+ <outputFile>$(testDir)\ilmergetest.dll</outputFile>
+ <keyFile>$(testDir)\keypair.snk</keyFile>
+ <excludeFile>$(testDir)\ExcludeTypes.txt</excludeFile>
+ <logFile>$(testDir)\ilmergetest.log</logFile>
+ </PropertyGroup>
+
+ <ItemGroup>
+ <inputAssemblies Include="$(testDir)\A.dll" />
+ <inputAssemblies Include="$(testDir)\B.dll" />
+
+ <allowDuplicates Include="ClassAB" />
+ </ItemGroup>
+
+ <Target Name="merge" >
+ <ILMerge InputAssemblies="@(inputAssemblies)"
+ AllowDuplicateTypes="@(allowDuplicates)"
+ ExcludeFile="$(excludeFile)"
+ OutputFile="$(outputFile)" LogFile="$(logFile)"
+ DebugInfo="true" XmlDocumentation="true"
+ KeyFile="$(keyFile)" DelaySign="true" />
+ </Target>]]></code>
+ </example>
+ </member>
+ <member name="M:MSBuild.Community.Tasks.ILMerge.GenerateFullPathToTool">
+ <summary>
+ Gets the standard installation path of ILMerge.exe.
+ </summary>
+ <remarks>
+ If ILMerge is not installed at its standard installation path,
+ provide its location to <see cref="P:Microsoft.Build.Utilities.ToolTask.ToolPath"/>.
+ </remarks>
+ <returns>Returns [ProgramFiles]\Microsoft\ILMerge.exe.</returns>
+ </member>
+ <member name="M:MSBuild.Community.Tasks.ILMerge.GenerateCommandLineCommands">
+ <summary>
+ Returns a string value containing the command line arguments
+ to pass directly to the executable file.
+ </summary>
+ <returns>
+ Returns a string value containing the command line arguments
+ to pass directly to the executable file.
+ </returns>
+ </member>
+ <member name="P:MSBuild.Community.Tasks.ILMerge.AllowDuplicateTypes">
+ <summary>
+ Gets or sets the names of public types
+ to be renamed when they are duplicates.
+ </summary>
+ <remarks>
+ <para>Set to an empty item group to allow all public types to be renamed.</para>
+ <para>Don't provide this parameter if no duplicates of public types are allowed.</para>
+ <para>Corresponds to command line option "/allowDup".</para>
+ <para>The default value is <c>null</c>.</para>
+ </remarks>
+ </member>
+ <member name="P:MSBuild.Community.Tasks.ILMerge.AllowZeroPeKind">
+ <summary>
+ Gets or sets the flag to treat an assembly
+ with a zero PeKind flag
+ (this is the value of the field listed as .corflags in the Manifest)
+ as if it was ILonly.
+ </summary>
+ <remarks>
+ <para>Corresponds to command line option "/zeroPeKind".</para>
+ <para>The default value is <c>false</c>.</para>
+ </remarks>
+ </member>
+ <member name="P:MSBuild.Community.Tasks.ILMerge.AttributeFile">
+ <summary>
+ Gets or sets the attribute assembly
+ from whre to get all of the assembly-level attributes
+ such as Culture, Version, etc.
+ It will also be used to get the Win32 Resources from.
+ </summary>
+ <remarks>
+ <para>This property is mutually exclusive with <see cref="P:MSBuild.Community.Tasks.ILMerge.CopyAttributes"/>.</para>
+ <para>
+ When not specified, then the Win32 Resources from the primary assembly
+ are copied over into the target assembly.
+ </para>
+ <para>Corresponds to command line option "/attr".</para>
+ <para>The default value is <c>null</c>.</para>
+ </remarks>
+ </member>
+ <member name="P:MSBuild.Community.Tasks.ILMerge.Closed">
+ <summary>
+ Gets or sets the flag to indicate
+ whether to augment the list of input assemblies
+ to its "transitive closure".
+ </summary>
+ <remarks>
+ <para>
+ An assembly is considered part of the transitive closure if it is referenced,
+ either directly or indirectly,
+ from one of the originally specified input assemblies
+ and it has an external reference to one of the input assemblies,
+ or one of the assemblies that has such a reference.
+ </para>
+ <para>Corresponds to command line option "/closed".</para>
+ <para>The default value is <c>false</c>.</para>
+ </remarks>
+ </member>
+ <member name="P:MSBuild.Community.Tasks.ILMerge.CopyAttributes">
+ <summary>
+ Gets or sets the flag to indicate
+ whether to copy the assembly level attributes
+ of each input assembly over into the target assembly.
+ </summary>
+ <remarks>
+ <para>
+ Any duplicate attribute overwrites a previously copied attribute.
+ The input assemblies are processed in the order they are specified.
+ </para>
+ <para>This parameter is mutually exclusive with <see cref="P:MSBuild.Community.Tasks.ILMerge.AttributeFile"/>.</para>
+ <para>Corresponds to command line option "/copyattrs".</para>
+ <para>The default value is <c>false</c>.</para>
+ </remarks>
+ </member>
+ <member name="P:MSBuild.Community.Tasks.ILMerge.DebugInfo">
+ <summary>
+ Gets or sets the flag to indicate
+ whether to preserve any .pdb files
+ that are found for the input assemblies
+ into a .pdb file for the target assembly.
+ </summary>
+ <remarks>
+ <para>Corresponds to command line option "/ndebug".</para>
+ <para>The default value is <c>true</c>.</para>
+ </remarks>
+ </member>
+ <member name="P:MSBuild.Community.Tasks.ILMerge.DelaySign">
+ <summary>
+ Gets or sets the flag to indicate
+ whether the target assembly will be delay signed.
+ </summary>
+ <remarks>
+ <para>This property can be set only in conjunction with <see cref="P:MSBuild.Community.Tasks.ILMerge.KeyFile"/>.</para>
+ <para>Corresponds to command line option "/delaysign".</para>
+ <para>The default value is <c>false</c>.</para>
+ </remarks>
+ </member>
+ <member name="P:MSBuild.Community.Tasks.ILMerge.ExcludeFile">
+ <summary>
+ Gets or sets the file
+ that will be used to identify types
+ that are not to have their visibility modified.
+ </summary>
+ <remarks>
+ <para>
+ If an empty item group is provided,
+ then all types in any assembly other than the primary assembly are made non-public.
+ </para>
+ <para>Omit this parameter to prevent ILMerge from modifying the visibility of any types.</para>
+ <para>
+ The contents of the file should be one <see cref="T:System.Text.RegularExpressions.Regex"/> per line.
+ The regular expressions are matched against each type's full name,
+ e.g., <c>System.Collections.IList</c>.
+ If the match fails, it is tried again with the assembly name (surrounded by square brackets)
+ prepended to the type name.
+ Thus, the pattern <c>\[A\].*</c> excludes all types in assembly <c>A</c> from being made non-public.
+ The pattern <c>N.T</c> will match all types named <c>T</c> in the namespace named <c>N</c>
+ no matter what assembly they are defined in.
+ </para>
+ <para>Corresponds to command line option "/internalize".</para>
+ <para>The default value is <c>null</c>.</para>
+ </remarks>
+ </member>
+ <member name="P:MSBuild.Community.Tasks.ILMerge.InputAssemblies">
+ <summary>
+ Gets or sets the input assemblies to merge.
+ </summary>
+ </member>
+ <member name="P:MSBuild.Community.Tasks.ILMerge.KeyFile">
+ <summary>
+ Gets or sets the .snk file
+ to sign the target assembly.
+ </summary>
+ <remarks>
+ <para>Can be used with <see cref="P:MSBuild.Community.Tasks.ILMerge.DelaySign"/>.</para>
+ <para>Corresponds to command line option "/keyfile".</para>
+ <para>The default value is <c>null</c>.</para>
+ </remarks>
+ </member>
+ <member name="P:MSBuild.Community.Tasks.ILMerge.LogFile">
+ <summary>
+ Gets or sets a log file
+ to write log messages to.
+ </summary>
+ <remarks>
+ <para>
+ If an empty item group is provided,
+ then log messages are writte to <see cref="P:System.Console.Out"/>.
+ </para>
+ <para>Corresponds to command line option "/log".</para>
+ <para>The default value is <c>null</c>.</para>
+ </remarks>
+ </member>
+ <member name="P:MSBuild.Community.Tasks.ILMerge.OutputFile">
+ <summary>
+ Gets or sets the target assembly.
+ </summary>
+ <remarks>
+ <para>Corresponds to command line option "/out".</para>
+ </remarks>
+ </member>
+ <member name="P:MSBuild.Community.Tasks.ILMerge.PublicKeyTokens">
+ <summary>
+ Gets or sets the flag to indicate
+ whether external assembly references in the manifest
+ of the target assembly will use public keys (<c>false</c>)
+ or public key tokens (<c>true</c>).
+ </summary>
+ <remarks>
+ <para>Corresponds to command line option "/publickeytokens".</para>
+ <para>The default value is <c>false</c>.</para>
+ </remarks>
+ </member>
+ <member name="P:MSBuild.Community.Tasks.ILMerge.TargetPlatformVersion">
+ <summary>
+ Gets or sets the .NET framework version for the target assembly.
+ </summary>
+ <remarks>
+ <para>Valid values are "v1", "v1.1", "v2".</para>
+ <para>Corresponds to the first part of command line option "/targetplatform".</para>
+ <para>The default value is <c>null</c>.</para>
+ </remarks>
+ </member>
+ <member name="P:MSBuild.Community.Tasks.ILMerge.TargetPlatformDirectory">
+ <summary>
+ Gets or sets the directory in which <c>mscorlib.dll</c> is to be found.
+ </summary>
+ <remarks>
+ <para>Can only be used in conjunction with <see cref="P:MSBuild.Community.Tasks.ILMerge.TargetPlatformVersion"/>.</para>
+ <para>Corresponds to the second part of command line option "/targetplatform".</para>
+ <para>The default value is <c>null</c>.</para>
+ </remarks>
+ </member>
+ <member name="P:MSBuild.Community.Tasks.ILMerge.TargetKind">
+ <summary>
+ Gets or sets the indicator
+ whether the target assembly is created as a library (<c>Dll</c>),
+ a console application (<c>Exe</c>) or as a Windows application (<c>WinExe</c>).
+ </summary>
+ <remarks>
+ <para>Corresponds to command line option "/target".</para>
+ <para>The default value is the same kind as that of the primary assembly.</para>
+ </remarks>
+ </member>
+ <member name="P:MSBuild.Community.Tasks.ILMerge.Version">
+ <summary>
+ Gets or sets the version number of the target assembly.
+ </summary>
+ <remarks>
+ <para>The parameter should look like <c>6.2.1.3</c>.</para>
+ <para>Corresponds to command line option "/ver".</para>
+ <para>The default value is null.</para>
+ </remarks>
+ </member>
+ <member name="P:MSBuild.Community.Tasks.ILMerge.XmlDocumentation">
+ <summary>
+ Gets or sets the flag to indicate
+ whether to merge XML documentation files
+ into one for the target assembly.
+ </summary>
+ <remarks>
+ <para>Corresponds to command line option "/xmldocs".</para>
+ <para>The default value is <c>false</c>.</para>
+ </remarks>
+ </member>
+ <member name="P:MSBuild.Community.Tasks.ILMerge.ToolName">
+ <summary>
+ Gets the name of the executable file to run.
+ </summary>
+ </member>
+ <member name="T:MSBuild.Community.Tasks.Schema.TaskListAssemblyFormatType">
+ <summary>
+ Different ways to specify the assembly in a UsingTask element.
+ </summary>
+ </member>
+ <member name="F:MSBuild.Community.Tasks.Schema.TaskListAssemblyFormatType.AssemblyFileName">
+ <summary>
+ Assembly file name (Default): <UsingTask AssemblyFile="foo.dll" />
+ </summary>
+ </member>
+ <member name="F:MSBuild.Community.Tasks.Schema.TaskListAssemblyFormatType.AssemblyFileFullPath">
+ <summary>
+ Assembly location: <UsingTask AssemblyName="foo" />
+ </summary>
+ </member>
+ <member name="F:MSBuild.Community.Tasks.Schema.TaskListAssemblyFormatType.AssemblyName">
+ <summary>
+ Assembly Name: <UsingTask AssemblyFile="bin\debug\foo.dll" />
+ </summary>
+ </member>
+ <member name="F:MSBuild.Community.Tasks.Schema.TaskListAssemblyFormatType.AssemblyFullName">
+ <summary>
+ Assembly fully qualified name: <UsingTask AssemblyName="foo.dll,version ...." />
+ </summary>
+ </member>
+ <member name="T:MSBuild.Community.Tasks.Schema.TaskSchema">
+ <summary>
+ A Task that generates a XSD schema of the tasks in an assembly.
+ </summary>
+ <example>
+ <para>Creates schema for MSBuild Community Task project</para>
+ <code><![CDATA[
+ <TaskSchema Assemblies="Build\MSBuild.Community.Tasks.dll"
+ OutputPath="Build"
+ CreateTaskList="true"
+ IgnoreMsBuildSchema="true"
+ Includes="Microsoft.Build.Commontypes.xsd"/>
+ ]]></code>
+ </example>
+ </member>
+ <member name="M:MSBuild.Community.Tasks.Schema.TaskSchema.Execute">
+ <summary>
+ When overridden in a derived class, executes the task.
+ </summary>
+ <returns>
+ true if the task successfully executed; otherwise, false.
+ </returns>
+ </member>
+ <member name="P:MSBuild.Community.Tasks.Schema.TaskSchema.Assemblies">
+ <summary>
+ Gets or sets the list of <see cref="T:System.Reflection.Assembly"/> path to analyse.
+ </summary>
+ </member>
+ <member name="P:MSBuild.Community.Tasks.Schema.TaskSchema.OutputPath">
+ <summary>
+ Gets or sets the output path for the generated files.
+ </summary>
+ </member>
+ <member name="P:MSBuild.Community.Tasks.Schema.TaskSchema.Schemas">
+ <summary>
+ Gets the list of path to the generated XSD schema.
+ </summary>
+ </member>
+ <member name="P:MSBuild.Community.Tasks.Schema.TaskSchema.CreateTaskList">
+ <summary>
+ Gets or sets a value indicating if the task list (using UsingTask)
+ has to be genereted.
+ </summary>
+ </member>
+ <member name="P:MSBuild.Community.Tasks.Schema.TaskSchema.TaskListAssemblyFormat">
+ <summary>
+ Gets or sets a value indicating how the assembly is specified in the
+ UsingTask element.
+ </summary>
+ <enum cref="T:MSBuild.Community.Tasks.Schema.TaskListAssemblyFormatType"/>
+ </member>
+ <member name="P:MSBuild.Community.Tasks.Schema.TaskSchema.IgnoreDocumentation">
+ <summary>
+ Gets or sets a value indicating wheter documentation should be ignored
+ even if available (Default is false).
+ </summary>
+ </member>
+ <member name="P:MSBuild.Community.Tasks.Schema.TaskSchema.TaskLists">
+ <summary>
+ Gets the path to the task list if it was generated.
+ </summary>
+ </member>
+ <member name="P:MSBuild.Community.Tasks.Schema.TaskSchema.IgnoreMsBuildSchema">
+ <summary>
+ Gets or sets a value indicating if the
+ MsBuild schema inclusing should be ignored
+ </summary>
+ </member>
+ <member name="P:MSBuild.Community.Tasks.Schema.TaskSchema.Includes">
+ <summary>
+ Gets or sets a list of included schemas
+ </summary>
+ </member>
+ <member name="T:MSBuild.Community.Tasks.Subversion.NodeKind">
+ <summary>
+ The kind of Subversion node. The names match the text output
+ by "svn info".
+ </summary>
+ </member>
+ <member name="F:MSBuild.Community.Tasks.Subversion.NodeKind.file">
+ <summary>
+ Node is a file
+ </summary>
+ </member>
+ <member name="F:MSBuild.Community.Tasks.Subversion.NodeKind.directory">
+ <summary>
+ Node is a directory
+ </summary>
+ </member>
+ <member name="F:MSBuild.Community.Tasks.Subversion.NodeKind.unknown">
+ <summary>
+ Unknown node type
+ </summary>
+ </member>
+ <member name="T:MSBuild.Community.Tasks.Subversion.Schedule">
+ <summary>
+ The Subversion schedule type.
+ </summary>
+ </member>
+ <member name="F:MSBuild.Community.Tasks.Subversion.Schedule.normal">
+ <summary>
+ Normal schedule
+ </summary>
+ </member>
+ <member name="F:MSBuild.Community.Tasks.Subversion.Schedule.unknown">
+ <summary>
+ Unknown schedule.
+ </summary>
+ </member>
+ <member name="T:MSBuild.Community.Tasks.Subversion.SvnInfo">
+ <summary>
+ Run the "svn info" command and parse the output
+ </summary>
+ <example>
+ This example will determine the Subversion repository root for the.
+ current directory and print it out.
+ <code><![CDATA[
+ <Target Name="printinfo">
+ <SvnInfo LocalPath=".">
+ <Output TaskParameter="RepositoryRoot" PropertyName="root" />
+ </SvnInfo>
+ <Message Text="root: $(root)" />
+ </Target>
+ ]]></code>
+ </example>
+ </member>
+ <member name="T:MSBuild.Community.Tasks.Subversion.SvnClient">
+ <summary>
+ Subversion client base class
+ </summary>
+ </member>
+ <member name="M:MSBuild.Community.Tasks.Subversion.SvnClient.#ctor">
+ <summary>
+ Initializes a new instance of the <see cref="T:SvnClient"/> class.
+ </summary>
+ </member>
+ <member name="M:MSBuild.Community.Tasks.Subversion.SvnClient.GenerateSvnCommand">
+ <summary>
+ Generates the SVN command.
+ </summary>
+ <returns></returns>
+ </member>
+ <member name="M:MSBuild.Community.Tasks.Subversion.SvnClient.GenerateSvnArguments">
+ <summary>
+ Generates the SVN arguments.
+ </summary>
+ <returns></returns>
+ </member>
+ <member name="M:MSBuild.Community.Tasks.Subversion.SvnClient.GenerateCommandLineCommands">
+ <summary>
+ Returns a string value containing the command line arguments to pass directly to the executable file.
+ </summary>
+ <returns>
+ A string value containing the command line arguments to pass directly to the executable file.
+ </returns>
+ </member>
+ <member name="M:MSBuild.Community.Tasks.Subversion.SvnClient.ValidateParameters">
+ <summary>
+ Indicates whether all task paratmeters are valid.
+ </summary>
+ <returns>
+ true if all task parameters are valid; otherwise, false.
+ </returns>
+ </member>
+ <member name="M:MSBuild.Community.Tasks.Subversion.SvnClient.LogEventsFromTextOutput(System.String,Microsoft.Build.Framework.MessageImportance)">
+ <summary>
+ Logs the events from text output.
+ </summary>
+ <param name="singleLine">The single line.</param>
+ <param name="messageImportance">The message importance.</param>
+ </member>
+ <member name="M:MSBuild.Community.Tasks.Subversion.SvnClient.GenerateFullPathToTool">
+ <summary>
+ Returns the fully qualified path to the executable file.
+ </summary>
+ <returns>
+ The fully qualified path to the executable file.
+ </returns>
+ </member>
+ <member name="M:MSBuild.Community.Tasks.Subversion.SvnClient.LogToolCommand(System.String)">
+ <summary>
+ Logs the starting point of the run to all registered loggers.
+ </summary>
+ <param name="message">A descriptive message to provide loggers, usually the command line and switches.</param>
+ </member>
+ <member name="P:MSBuild.Community.Tasks.Subversion.SvnClient.Command">
+ <summary>
+ Gets or sets the command.
+ </summary>
+ <value>The command.</value>
+ </member>
+ <member name="P:MSBuild.Community.Tasks.Subversion.SvnClient.Arguments">
+ <summary>
+ Gets or sets the arguments.
+ </summary>
+ <value>The arguments.</value>
+ </member>
+ <member name="P:MSBuild.Community.Tasks.Subversion.SvnClient.Username">
+ <summary>
+ Gets or sets the username.
+ </summary>
+ <value>The username.</value>
+ </member>
+ <member name="P:MSBuild.Community.Tasks.Subversion.SvnClient.Password">
+ <summary>
+ Gets or sets the password.
+ </summary>
+ <value>The password.</value>
+ </member>
+ <member name="P:MSBuild.Community.Tasks.Subversion.SvnClient.Verbose">
+ <summary>
+ Gets or sets the verbose.
+ </summary>
+ <value>The verbose.</value>
+ </member>
+ <member name="P:MSBuild.Community.Tasks.Subversion.SvnClient.Force">
+ <summary>
+ Gets or sets the force.
+ </summary>
+ <value>The force.</value>
+ </member>
+ <member name="P:MSBuild.Community.Tasks.Subversion.SvnClient.Message">
+ <summary>
+ Gets or sets the message.
+ </summary>
+ <value>The message.</value>
+ </member>
+ <member name="P:MSBuild.Community.Tasks.Subversion.SvnClient.RepositoryPath">
+ <summary>
+ Gets or sets the repository path.
+ </summary>
+ <value>The repository path.</value>
+ </member>
+ <member name="P:MSBuild.Community.Tasks.Subversion.SvnClient.LocalPath">
+ <summary>
+ Gets or sets the local path.
+ </summary>
+ <value>The local path.</value>
+ </member>
+ <member name="P:MSBuild.Community.Tasks.Subversion.SvnClient.Targets">
+ <summary>
+ Gets or sets the targets.
+ </summary>
+ <value>The targets.</value>
+ </member>
+ <member name="P:MSBuild.Community.Tasks.Subversion.SvnClient.Revision">
+ <summary>
+ Gets or sets the revision.
+ </summary>
+ <value>The revision.</value>
+ </member>
+ <member name="P:MSBuild.Community.Tasks.Subversion.SvnClient.CommandSwitchs">
+ <summary>
+ Gets or sets the command switchs.
+ </summary>
+ <value>The command switchs.</value>
+ </member>
+ <member name="P:MSBuild.Community.Tasks.Subversion.SvnClient.StandardOutputLoggingImportance">
+ <summary>
+ Gets the <see cref="T:Microsoft.Build.Framework.MessageImportance"></see> with which to log errors.
+ </summary>
+ <value></value>
+ <returns>The <see cref="T:Microsoft.Build.Framework.MessageImportance"></see> with which to log errors.</returns>
+ </member>
+ <member name="P:MSBuild.Community.Tasks.Subversion.SvnClient.ToolName">
+ <summary>
+ Gets the name of the executable file to run.
+ </summary>
+ <value></value>
+ <returns>The name of the executable file to run.</returns>
+ </member>
+ <member name="M:MSBuild.Community.Tasks.Subversion.SvnInfo.#ctor">
+ <summary>
+ Initializes a new instance of the <see cref="T:SvnInfo"/> class.
+ </summary>
+ </member>
+ <member name="M:MSBuild.Community.Tasks.Subversion.SvnInfo.ResetMemberVariables">
+ <summary>
+ Reset all instance variables to their default (unset) state.
+ </summary>
+ </member>
+ <member name="M:MSBuild.Community.Tasks.Subversion.SvnInfo.ValidateParameters">
+ <summary>
+ Indicates whether all task paratmeters are valid.
+ </summary>
+ <returns>
+ true if all task parameters are valid; otherwise, false.
+ </returns>
+ </member>
+ <member name="M:MSBuild.Community.Tasks.Subversion.SvnInfo.Execute">
+ <summary>
+ Execute the task.
+ </summary>
+ <returns>true if execution is successful, false if not.</returns>
+ </member>
+ <member name="M:MSBuild.Community.Tasks.Subversion.SvnInfo.ExtractKeyValuePair(System.String,System.String@,System.String@)">
+ <summary>
+ "svn.exe info" prints out key/value pairs separated by a colon.
+ </summary>
+ <param name="strLine">A line of text printed out by svn.exe</param>
+ <param name="strKey">The key string. empty if no key/value found.</param>
+ <param name="strValue">The value string. empty of no key/value found.</param>
+ <returns>true if a key/value pair found. false if not</returns>
+ </member>
+ <member name="M:MSBuild.Community.Tasks.Subversion.SvnInfo.ParseSvnDate(System.String)">
+ <summary>
+ Parse a subversion date/time value. They print out a date that
+ looks like this "2006-02-09 14:36:05 -0600 (Thu, 09 Feb 2006)" which
+ isn't directly parsable by the DateTime class.
+ </summary>
+ <param name="datetime"></param>
+ <returns></returns>
+ </member>
+ <member name="M:MSBuild.Community.Tasks.Subversion.SvnInfo.LogEventsFromTextOutput(System.String,Microsoft.Build.Framework.MessageImportance)">
+ <summary>
+ Parse the text output from the command and log the lines.
+ </summary>
+ <param name="singleLine">One line of text output from the tool being run.</param>
+ <param name="messageImportance">The message importance.</param>
+ </member>
+ <member name="P:MSBuild.Community.Tasks.Subversion.SvnInfo.RepositoryRoot">
+ <summary>
+ Return the repository root or null if not set by Subversion.
+ </summary>
+ </member>
+ <member name="P:MSBuild.Community.Tasks.Subversion.SvnInfo.RepositoryUuid">
+ <summary>
+ Return the repository UUID value from Subversion.
+ </summary>
+ </member>
+ <member name="P:MSBuild.Community.Tasks.Subversion.SvnInfo.NodeKind">
+ <summary>
+ The Subversion node kind.
+ </summary>
+ <enum cref="T:MSBuild.Community.Tasks.Subversion.NodeKind"/>
+ </member>
+ <member name="P:MSBuild.Community.Tasks.Subversion.SvnInfo.LastChangedAuthor">
+ <summary>
+ The author who last changed this node.
+ </summary>
+ </member>
+ <member name="P:MSBuild.Community.Tasks.Subversion.SvnInfo.LastChangedRevision">
+ <summary>
+ The last changed revision number.
+ </summary>
+ </member>
+ <member name="P:MSBuild.Community.Tasks.Subversion.SvnInfo.LastChangedDate">
+ <summary>
+ The date this node was last changed.
+ </summary>
+ </member>
+ <member name="P:MSBuild.Community.Tasks.Subversion.SvnInfo.Schedule">
+ <summary>
+ The Subversion schedule type.
+ </summary>
+ <enum cref="T:MSBuild.Community.Tasks.Subversion.Schedule"/>
+ </member>
+ <member name="T:MSBuild.Community.Tasks.Time">
+ <summary>
+ Gets the current date and time.
+ </summary>
+ <remarks>
+ See
+ <a href="ms-help://MS.VSCC.v80/MS.MSDN.v80/MS.NETDEVFX.v20.en/cpref8/html/T_System_Globalization_DateTimeFormatInfo.htm">
+ DateTimeFormatInfo</a>
+ for the syntax of the format string.
+ </remarks>
+ <example>Using the Time task to get the Month, Day,
+ Year, Hour, Minute, and Second:
+ <code><![CDATA[
+ <Time>
+ <Output TaskParameter="Month" PropertyName="Month" />
+ <Output TaskParameter="Day" PropertyName="Day" />
+ <Output TaskParameter="Year" PropertyName="Year" />
+ <Output TaskParameter="Hour" PropertyName="Hour" />
+ <Output TaskParameter="Minute" PropertyName="Minute" />
+ <Output TaskParameter="Second" PropertyName="Second" />
+ </Time>
+ <Message Text="Current Date and Time: $(Month)/$(Day)/$(Year) $(Hour):$(Minute):$(Second)" />]]></code>
+ Set property "BuildDate" to the current date and time:
+ <code><![CDATA[
+ <Time Format="yyyyMMddHHmmss">
+ <Output TaskParameter="FormattedTime" PropertyName="buildDate" />
+ </Time>]]></code>
+ </example>
+ </member>
+ <member name="M:MSBuild.Community.Tasks.Time.Execute">
+ <summary>
+ When overridden in a derived class, executes the task.
+ </summary>
+ <returns>
+ True if the task successfully executed; otherwise, false.
+ </returns>
+ </member>
+ <member name="P:MSBuild.Community.Tasks.Time.Format">
+ <summary>
+ Gets or sets the format string
+ for output parameter <see cref="P:MSBuild.Community.Tasks.Time.FormattedTime"/>.
+ </summary>
+ <remarks>
+ See
+ <a href="ms-help://MS.VSCC.v80/MS.MSDN.v80/MS.NETDEVFX.v20.en/cpref8/html/T_System_Globalization_DateTimeFormatInfo.htm">
+ DateTimeFormatInfo</a>
+ for the syntax of the format string.
+ </remarks>
+ </member>
+ <member name="P:MSBuild.Community.Tasks.Time.Month">
+ <summary>
+ Gets the month component of the date represented by this instance.
+ </summary>
+ </member>
+ <member name="P:MSBuild.Community.Tasks.Time.Day">
+ <summary>
+ Gets the day of the month represented by this instance.
+ </summary>
+ </member>
+ <member name="P:MSBuild.Community.Tasks.Time.Year">
+ <summary>
+ Gets the year component of the date represented by this instance.
+ </summary>
+ </member>
+ <member name="P:MSBuild.Community.Tasks.Time.Hour">
+ <summary>
+ Gets the hour component of the date represented by this instance.
+ </summary>
+ </member>
+ <member name="P:MSBuild.Community.Tasks.Time.Minute">
+ <summary>
+ Gets the minute component of the date represented by this instance.
+ </summary>
+ </member>
+ <member name="P:MSBuild.Community.Tasks.Time.Second">
+ <summary>
+ Gets the seconds component of the date represented by this instance.
+ </summary>
+ </member>
+ <member name="P:MSBuild.Community.Tasks.Time.Millisecond">
+ <summary>
+ Gets the milliseconds component of the date represented by this instance.
+ </summary>
+ </member>
+ <member name="P:MSBuild.Community.Tasks.Time.Ticks">
+ <summary>
+ Gets the number of ticks that represent the date and time of this instance.
+ </summary>
+ </member>
+ <member name="P:MSBuild.Community.Tasks.Time.Kind">
+ <summary>
+ Gets or sets a value that indicates whether the time represented by this instance is based
+ on local time, Coordinated Universal Time (UTC), or neither.
+ </summary>
+ <remarks>
+ Possible values are:
+ <list type="ul">
+ <item>Local (default)</item>,
+ <item>Utc</item>,
+ <item>Unspecified</item>
+ </list>
+ </remarks>
+ <enum cref="T:System.DateTimeKind"/>
+ </member>
+ <member name="P:MSBuild.Community.Tasks.Time.TimeOfDay">
+ <summary>
+ Gets the time of day for this instance.
+ </summary>
+ </member>
+ <member name="P:MSBuild.Community.Tasks.Time.DayOfYear">
+ <summary>
+ Gets the day of the year represented by this instance.
+ </summary>
+ </member>
+ <member name="P:MSBuild.Community.Tasks.Time.DayOfWeek">
+ <summary>
+ Gets the day of the week represented by this instance.
+ </summary>
+ </member>
+ <member name="P:MSBuild.Community.Tasks.Time.FormattedTime">
+ <summary>
+ Gets the value of this instance to its equivalent string representation.
+ If input parameter <see cref="P:MSBuild.Community.Tasks.Time.Format"/> is provided,
+ the value is formatted according to it.
+ </summary>
+ </member>
+ <member name="P:MSBuild.Community.Tasks.Time.ShortDate">
+ <summary>
+ Gets the value of this instance to its equivalent short date string representation.
+ </summary>
+ </member>
+ <member name="P:MSBuild.Community.Tasks.Time.LongDate">
+ <summary>
+ Gets the value of this instance to its equivalent long date string representation.
+ </summary>
+ </member>
+ <member name="P:MSBuild.Community.Tasks.Time.ShortTime">
+ <summary>
+ Gets the value of this instance to its equivalent short time string representation.
+ </summary>
+ </member>
+ <member name="P:MSBuild.Community.Tasks.Time.LongTime">
+ <summary>
+ Gets the value of this instance to its equivalent long time string representation.
+ </summary>
+ </member>
+ <member name="P:MSBuild.Community.Tasks.Time.DateTimeValue">
+ <summary>
+ Gets the internal time value.
+ </summary>
+ </member>
+ <member name="T:MSBuild.Community.Tasks.Xslt">
+ <summary>
+ A task to merge and transform
+ a set of xml files.
+ </summary>
+ <remarks>
+ <p>
+ The xml files of parameter <see cref="P:MSBuild.Community.Tasks.Xslt.Inputs"/>
+ are merged into one xml document,
+ wrapped with a root tag <see cref="P:MSBuild.Community.Tasks.Xslt.RootTag"/>
+ (defaults to <see cref="F:MSBuild.Community.Tasks.Xslt.DEFAULT_ROOT_TAG"/>).
+ </p>
+ <p>
+ If only one input file is provided,
+ merging and wrapping can be omitted
+ by setting <see cref="P:MSBuild.Community.Tasks.Xslt.RootTag"/> to an empty string....
[truncated message content] |
|
From: <jor...@us...> - 2007-02-22 23:02:40
|
Revision: 8
http://svn.sourceforge.net/captainhook/?rev=8&view=rev
Author: jordan-terrell
Date: 2007-02-22 15:02:37 -0800 (Thu, 22 Feb 2007)
Log Message:
-----------
Modified SubversionTranslator to not add an extra new line at the end of the log entry
(all unit tests pass)
Modified Paths:
--------------
trunk/CaptainHook.SubversionWrapper/SubversionTranslator.cs
Modified: trunk/CaptainHook.SubversionWrapper/SubversionTranslator.cs
===================================================================
--- trunk/CaptainHook.SubversionWrapper/SubversionTranslator.cs 2006-09-26 11:53:26 UTC (rev 7)
+++ trunk/CaptainHook.SubversionWrapper/SubversionTranslator.cs 2007-02-22 23:02:37 UTC (rev 8)
@@ -78,7 +78,14 @@
{
if(output[i].Length > 0)
{
- logMessage += output[i] + Environment.NewLine;
+ if (i < (output.Length - 1)) // not the last line
+ {
+ logMessage += output[i] + Environment.NewLine;
+ }
+ else // is the last line of log entry
+ {
+ logMessage += output[i];
+ }
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ro...@us...> - 2006-09-26 11:53:36
|
Revision: 7
http://svn.sourceforge.net/captainhook/?rev=7&view=rev
Author: rojepp
Date: 2006-09-26 04:53:26 -0700 (Tue, 26 Sep 2006)
Log Message:
-----------
Fix bugid: 1554803, Only the first line of the log entry would be included.
Modified Paths:
--------------
trunk/CaptainHook.SubversionWrapper/SubversionTranslator.cs
Modified: trunk/CaptainHook.SubversionWrapper/SubversionTranslator.cs
===================================================================
--- trunk/CaptainHook.SubversionWrapper/SubversionTranslator.cs 2006-07-31 18:30:15 UTC (rev 6)
+++ trunk/CaptainHook.SubversionWrapper/SubversionTranslator.cs 2006-09-26 11:53:26 UTC (rev 7)
@@ -67,14 +67,25 @@
{
string datePortion = output[1];
//Unfortunately, the subversion date format doesn't match anything .NET
- //handlesby default. So we have to hack the date here.
+ //handles by default. So we have to hack the date here.
datePortion = datePortion.Substring(0, 19);
DateTime dateStamp = DateTime.ParseExact(datePortion, "yyyy-MM-dd HH:mm:ss", CultureInfo.InvariantCulture);
+ //Fix bugid: 1554803
+ //Only the first line of the log entry would be included.
+ string logMessage = "";
+ for(int i = 3; i < output.Length; i++)
+ {
+ if(output[i].Length > 0)
+ {
+ logMessage += output[i] + Environment.NewLine;
+ }
+ }
+
if (String.IsNullOrEmpty(transaction))
- return new RevisionInfo(revision, output[0], dateStamp, int.Parse(output[2]), output[3]) as T;
+ return new RevisionInfo(revision, output[0], dateStamp, int.Parse(output[2]), logMessage) as T;
else
- return new TransactionInfo(transaction, output[0], dateStamp, int.Parse(output[2]), output[3]) as T;
+ return new TransactionInfo(transaction, output[0], dateStamp, int.Parse(output[2]), logMessage) as T;
}
/// <summary>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|