summaryrefslogtreecommitdiffstats
path: root/src/DotNetOpenAuth.BuildTasks/ReSignDelaySignedAssemblies.cs
diff options
context:
space:
mode:
authorAndrew Arnott <andrewarnott@gmail.com>2010-10-24 15:56:48 -0700
committerAndrew Arnott <andrewarnott@gmail.com>2010-10-24 15:56:48 -0700
commit9dbb9aab73812202648c4e68d60261dd84d6c8e2 (patch)
tree5de139019a7b2f870f84c57cac36c0e489bd1e41 /src/DotNetOpenAuth.BuildTasks/ReSignDelaySignedAssemblies.cs
parent4b27c330fbfb3a260aa3bd6a9b1232ee3b53deb0 (diff)
parente7ce41355c38b3125729a62920231f274b7a2100 (diff)
downloadDotNetOpenAuth-origin/mono2.zip
DotNetOpenAuth-origin/mono2.tar.gz
DotNetOpenAuth-origin/mono2.tar.bz2
Merge branch 'v3.2' into mono2origin/mono2
Conflicts: src/DotNetOpenAuth/Messaging/HttpRequestInfo.cs
Diffstat (limited to 'src/DotNetOpenAuth.BuildTasks/ReSignDelaySignedAssemblies.cs')
-rw-r--r--src/DotNetOpenAuth.BuildTasks/ReSignDelaySignedAssemblies.cs56
1 files changed, 56 insertions, 0 deletions
diff --git a/src/DotNetOpenAuth.BuildTasks/ReSignDelaySignedAssemblies.cs b/src/DotNetOpenAuth.BuildTasks/ReSignDelaySignedAssemblies.cs
new file mode 100644
index 0000000..a0ba386
--- /dev/null
+++ b/src/DotNetOpenAuth.BuildTasks/ReSignDelaySignedAssemblies.cs
@@ -0,0 +1,56 @@
+//-----------------------------------------------------------------------
+// <copyright file="ReSignDelaySignedAssemblies.cs" company="Andrew Arnott">
+// Copyright (c) Andrew Arnott. All rights reserved.
+// </copyright>
+//-----------------------------------------------------------------------
+
+namespace DotNetOpenAuth.BuildTasks {
+ using System;
+ using Microsoft.Build.Framework;
+ using Microsoft.Build.Utilities;
+
+ public class ReSignDelaySignedAssemblies : SnToolTask {
+ /// <summary>
+ /// Gets or sets the key file to use for signing.
+ /// </summary>
+ public ITaskItem KeyFile { get; set; }
+
+ /// <summary>
+ /// Gets or sets the key container.
+ /// </summary>
+ public ITaskItem KeyContainer { get; set; }
+
+ /// <summary>
+ /// Gets or sets the assemblies to re-sign.
+ /// </summary>
+ public ITaskItem[] Assemblies { get; set; }
+
+ /// <summary>
+ /// Generates the command line commands.
+ /// </summary>
+ protected override string GenerateCommandLineCommands() {
+ ////if (this.Assemblies.Length != 1) {
+ //// throw new NotSupportedException("Exactly 1 assembly for signing is supported.");
+ ////}
+ CommandLineBuilder args = new CommandLineBuilder();
+ args.AppendSwitch("-q");
+
+ if (this.KeyFile != null) {
+ args.AppendSwitch("-R");
+ } else if (this.KeyContainer != null) {
+ args.AppendSwitch("-Rc");
+ } else {
+ throw new InvalidOperationException("Either KeyFile or KeyContainer must be set.");
+ }
+
+ args.AppendFileNameIfNotNull(this.Assemblies[0]);
+ if (this.KeyFile != null) {
+ args.AppendFileNameIfNotNull(this.KeyFile);
+ } else {
+ args.AppendFileNameIfNotNull(this.KeyContainer);
+ }
+
+ return args.ToString();
+ }
+ }
+}