summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/DotNetOpenAuth.BuildTasks/ChangeProjectReferenceToAssemblyReference.cs56
-rw-r--r--src/DotNetOpenAuth.BuildTasks/CopyWithTokenSubstitution.cs12
-rw-r--r--src/DotNetOpenAuth.BuildTasks/DotNetOpenAuth.BuildTasks.sln9
-rw-r--r--src/DotNetOpenAuth.BuildTasks/FixupReferenceHintPaths.cs8
-rw-r--r--src/DotNetOpenAuth.BuildTasks/MergeProjectWithVSTemplate.cs185
-rw-r--r--src/DotNetOpenAuth.BuildTasks/Purge.cs9
-rw-r--r--src/DotNetOpenAuth/DotNetOpenAuth.csproj14
7 files changed, 164 insertions, 129 deletions
diff --git a/src/DotNetOpenAuth.BuildTasks/ChangeProjectReferenceToAssemblyReference.cs b/src/DotNetOpenAuth.BuildTasks/ChangeProjectReferenceToAssemblyReference.cs
index f940a72..503e168 100644
--- a/src/DotNetOpenAuth.BuildTasks/ChangeProjectReferenceToAssemblyReference.cs
+++ b/src/DotNetOpenAuth.BuildTasks/ChangeProjectReferenceToAssemblyReference.cs
@@ -1,47 +1,59 @@
-using System;
-using System.Linq;
-using System.IO;
-using System.Xml;
+namespace DotNetOpenAuth.BuildTasks {
+ using System;
+ using System.IO;
+ using System.Linq;
+ using System.Xml;
+ using Microsoft.Build.BuildEngine;
+ using Microsoft.Build.Framework;
+ using Microsoft.Build.Utilities;
-using Microsoft.Build.Framework;
-using Microsoft.Build.Utilities;
-using Microsoft.Build.BuildEngine;
-
-namespace DotNetOpenAuth.BuildTasks {
/// <summary>
/// Replaces ProjectReference items in a set of projects with Reference items.
/// </summary>
public class ChangeProjectReferenceToAssemblyReference : Task {
+ private const string msbuildNamespace = "http://schemas.microsoft.com/developer/msbuild/2003";
+
/// <summary>
/// The projects to alter.
/// </summary>
[Required]
public ITaskItem[] Projects { get; set; }
+
/// <summary>
- /// The project reference to remove.
+ /// The project references to remove.
/// </summary>
[Required]
- public string ProjectReference { get; set; }
+ public ITaskItem[] ProjectReferences { get; set; }
+
/// <summary>
- /// The assembly reference to add.
+ /// The assembly references to add.
/// </summary>
[Required]
- public string Reference { get; set; }
+ public ITaskItem[] References { get; set; }
- const string msbuildNamespace = "http://schemas.microsoft.com/developer/msbuild/2003";
public override bool Execute() {
- foreach (var project in Projects) {
- Log.LogMessage(MessageImportance.Normal, "Changing P2P references to assembly references in \"{0}\".", project.ItemSpec);
+ if (this.ProjectReferences.Length != this.References.Length) {
+ this.Log.LogError("ProjectReferences and References arrays do not have matching lengths.");
+ }
+ foreach (var project in Projects) {
Project doc = new Project();
doc.Load(project.ItemSpec);
-
- var projectReference = doc.EvaluatedItems.OfType<BuildItem>().Where(
- item => item.Name == "ProjectReference" && item.Include == ProjectReference).Single();
- doc.RemoveItem(projectReference);
- var newReference = doc.AddNewItem("Reference", Path.GetFileNameWithoutExtension(Reference), true);
- newReference.SetMetadata("HintPath", Reference);
+ var projectReferences = doc.EvaluatedItems.OfType<BuildItem>().Where(item => item.Name == "ProjectReference");
+ var matchingReferences = from reference in projectReferences
+ join refToRemove in this.ProjectReferences on reference.Include equals refToRemove.ItemSpec
+ let addIndex = Array.IndexOf(this.ProjectReferences, refToRemove)
+ select new { Remove = reference, Add = this.References[addIndex] };
+ foreach (var matchingReference in matchingReferences) {
+ this.Log.LogMessage("Removing project reference to \"{0}\" from \"{1}\".", matchingReference.Remove.Include, project.ItemSpec);
+ doc.RemoveItem(matchingReference.Remove);
+ if (matchingReference.Add.ItemSpec != "REMOVE") {
+ this.Log.LogMessage("Adding assembly reference to \"{0}\" to \"{1}\".", matchingReference.Add.ItemSpec, project.ItemSpec);
+ var newReference = doc.AddNewItem("Reference", Path.GetFileNameWithoutExtension(matchingReference.Add.ItemSpec), true);
+ newReference.SetMetadata("HintPath", matchingReference.Add.ItemSpec);
+ }
+ }
doc.Save(project.ItemSpec);
}
diff --git a/src/DotNetOpenAuth.BuildTasks/CopyWithTokenSubstitution.cs b/src/DotNetOpenAuth.BuildTasks/CopyWithTokenSubstitution.cs
index 38f3b50..5b097ab 100644
--- a/src/DotNetOpenAuth.BuildTasks/CopyWithTokenSubstitution.cs
+++ b/src/DotNetOpenAuth.BuildTasks/CopyWithTokenSubstitution.cs
@@ -56,7 +56,12 @@ namespace DotNetOpenAuth.BuildTasks {
for (int i = 0; i < this.SourceFiles.Length; i++) {
string sourcePath = this.SourceFiles[i].ItemSpec;
string destPath = this.DestinationFiles[i].ItemSpec;
- bool skipUnchangedFiles = bool.Parse(this.SourceFiles[i].GetMetadata("SkipUnchangedFiles"));
+ bool skipUnchangedFiles;
+ bool.TryParse(this.SourceFiles[i].GetMetadata("SkipUnchangedFiles"), out skipUnchangedFiles);
+
+ if (!Directory.Exists(Path.GetDirectoryName(destPath))) {
+ Directory.CreateDirectory(Path.GetDirectoryName(destPath));
+ }
if (string.IsNullOrEmpty(this.SourceFiles[i].GetMetadata("BeforeTokens"))) {
// this is just a standard copy without token substitution
@@ -65,7 +70,7 @@ namespace DotNetOpenAuth.BuildTasks {
continue;
}
- Log.LogMessage(MessageImportance.Normal, "Copying \"{0}\" -> \"{1}\"", sourcePath, destPath);
+ Log.LogMessage(MessageImportance.Normal, "Copying file from \"{0}\" to \"{1}\"", sourcePath, destPath);
File.Copy(sourcePath, destPath, true);
} else {
// We deliberably consider newer destination files to be up-to-date rather than
@@ -85,9 +90,6 @@ namespace DotNetOpenAuth.BuildTasks {
}
using (StreamReader sr = File.OpenText(sourcePath)) {
- if (!Directory.Exists(Path.GetDirectoryName(destPath))) {
- Directory.CreateDirectory(Path.GetDirectoryName(destPath));
- }
using (StreamWriter sw = File.CreateText(destPath)) {
StringBuilder line = new StringBuilder();
while (!sr.EndOfStream) {
diff --git a/src/DotNetOpenAuth.BuildTasks/DotNetOpenAuth.BuildTasks.sln b/src/DotNetOpenAuth.BuildTasks/DotNetOpenAuth.BuildTasks.sln
index 34a8e46..f3e3982 100644
--- a/src/DotNetOpenAuth.BuildTasks/DotNetOpenAuth.BuildTasks.sln
+++ b/src/DotNetOpenAuth.BuildTasks/DotNetOpenAuth.BuildTasks.sln
@@ -4,11 +4,20 @@ Microsoft Visual Studio Solution File, Format Version 11.00
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{ABBE14A3-0404-4123-9093-E598C3DD3E9B}"
ProjectSection(SolutionItems) = preProject
..\..\build.proj = ..\..\build.proj
+ ..\..\doc\doc.proj = ..\..\doc\doc.proj
+ ..\..\tools\DotNetOpenAuth.automated.props = ..\..\tools\DotNetOpenAuth.automated.props
+ ..\..\tools\DotNetOpenAuth.automated.targets = ..\..\tools\DotNetOpenAuth.automated.targets
..\..\lib\DotNetOpenAuth.BuildTasks.targets = ..\..\lib\DotNetOpenAuth.BuildTasks.targets
..\..\tools\DotNetOpenAuth.Common.Settings.targets = ..\..\tools\DotNetOpenAuth.Common.Settings.targets
..\..\tools\DotNetOpenAuth.props = ..\..\tools\DotNetOpenAuth.props
..\..\tools\DotNetOpenAuth.targets = ..\..\tools\DotNetOpenAuth.targets
..\..\tools\DotNetOpenAuth.Versioning.targets = ..\..\tools\DotNetOpenAuth.Versioning.targets
+ ..\..\tools\drop.proj = ..\..\tools\drop.proj
+ ..\..\projecttemplates\projecttemplates.proj = ..\..\projecttemplates\projecttemplates.proj
+ ..\..\samples\Samples.proj = ..\..\samples\Samples.proj
+ ..\..\samples\tools.proj = ..\..\samples\tools.proj
+ ..\..\vsi\vsi.proj = ..\..\vsi\vsi.proj
+ ..\..\vsix\vsix.proj = ..\..\vsix\vsix.proj
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DotNetOpenAuth.BuildTasks", "DotNetOpenAuth.BuildTasks.csproj", "{AC231A51-EF60-437C-A33F-AF8ADEB8EB74}"
diff --git a/src/DotNetOpenAuth.BuildTasks/FixupReferenceHintPaths.cs b/src/DotNetOpenAuth.BuildTasks/FixupReferenceHintPaths.cs
index 13a4b8f..babaab3 100644
--- a/src/DotNetOpenAuth.BuildTasks/FixupReferenceHintPaths.cs
+++ b/src/DotNetOpenAuth.BuildTasks/FixupReferenceHintPaths.cs
@@ -40,7 +40,13 @@ namespace DotNetOpenAuth.BuildTasks {
// Figure out what the assembly names are of the references that are available.
AssemblyName[] availableReferences = new AssemblyName[this.References.Length];
for (int i = 0; i < this.References.Length; i++) {
- availableReferences[i] = AssemblyName.GetAssemblyName(this.References[i].ItemSpec);
+ if (File.Exists(this.References[i].ItemSpec)) {
+ availableReferences[i] = AssemblyName.GetAssemblyName(this.References[i].ItemSpec);
+ } else {
+ availableReferences[i] = new AssemblyName(Path.GetFileNameWithoutExtension(this.References[i].ItemSpec)) {
+ CodeBase = this.References[i].GetMetadata("FullPath"),
+ };
+ }
}
foreach (var projectTaskItem in this.Projects) {
diff --git a/src/DotNetOpenAuth.BuildTasks/MergeProjectWithVSTemplate.cs b/src/DotNetOpenAuth.BuildTasks/MergeProjectWithVSTemplate.cs
index c24d634..601ff6f 100644
--- a/src/DotNetOpenAuth.BuildTasks/MergeProjectWithVSTemplate.cs
+++ b/src/DotNetOpenAuth.BuildTasks/MergeProjectWithVSTemplate.cs
@@ -8,6 +8,7 @@ namespace DotNetOpenAuth.BuildTasks {
using System;
using System.Collections.Generic;
using System.Diagnostics.Contracts;
+ using System.Globalization;
using System.IO;
using System.Linq;
using System.Text;
@@ -15,17 +16,16 @@ namespace DotNetOpenAuth.BuildTasks {
using Microsoft.Build.BuildEngine;
using Microsoft.Build.Framework;
using Microsoft.Build.Utilities;
- using System.Globalization;
public class MergeProjectWithVSTemplate : Task {
internal const string VSTemplateNamespace = "http://schemas.microsoft.com/developer/vstemplate/2005";
-
+
internal const string VsixNamespace = "http://schemas.microsoft.com/developer/vsx-schema/2010";
/// <summary>
/// A dictionary where the key is the project name and the value is the path contribution.
/// </summary>
- private Dictionary<string, string> vsixContributionToPath = new Dictionary<string,string>(StringComparer.OrdinalIgnoreCase);
+ private Dictionary<string, string> vsixContributionToPath = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);
[Required]
public string[] ProjectItemTypes { get; set; }
@@ -34,40 +34,42 @@ namespace DotNetOpenAuth.BuildTasks {
public string[] ReplaceParametersExtensions { get; set; }
[Required]
- public ITaskItem[] Templates { get; set; }
+ public ITaskItem[] SourceTemplates { get; set; }
- /// <summary>
- /// Gets or sets the path to the .vsixmanifest file that will be used to assist
- /// in calculating the actual full path of project items.
- /// </summary>
- /// <remarks>
- /// This property is required if <see cref="EnsureMaxPath"/> &gt; 0;
- /// </remarks>
- public ITaskItem VsixManifest { get; set; }
+ [Required]
+ public ITaskItem[] SourceProjects { get; set; }
+
+ [Required]
+ public ITaskItem[] DestinationTemplates { get; set; }
/// <summary>
/// Gets or sets the maximum length a project item's relative path should
/// be limited to, artificially renaming them as necessary.
/// </summary>
/// <value>Use 0 to disable the renaming feature.</value>
- public int EnsureMaxPath { get; set; }
+ public int MaximumRelativePathLength { get; set; }
/// <summary>
- /// Gets or sets the project items that had to be renamed to comply with maximum path length requirements.
+ /// Gets or sets the project item paths from the source project to copy to the destination location.
/// </summary>
- /// <remarks>
- /// The item name is the original full path. The ShortPath metadata contains the shortened full path.
- /// </remarks>
[Output]
- public ITaskItem[] MaxPathAdjustedPaths { get; set; }
+ public ITaskItem[] ProjectItems { get; set; }
/// <summary>
/// Executes this instance.
/// </summary>
public override bool Execute() {
- var shortenedItems = new List<ITaskItem>();
+ if (this.DestinationTemplates.Length != this.SourceTemplates.Length) {
+ this.Log.LogError("SourceTemplates array has length {0} while DestinationTemplates array has length {1}, but must equal.", this.SourceTemplates.Length, this.DestinationTemplates.Length);
+ }
+ if (this.SourceProjects.Length != this.SourceTemplates.Length) {
+ this.Log.LogError("SourceTemplates array has length {0} while SourceProjects array has length {1}, but must equal.", this.SourceTemplates.Length, this.SourceProjects.Length);
+ }
+
+ var projectItemsToCopy = new List<ITaskItem>();
- foreach(ITaskItem sourceTemplateTaskItem in this.Templates) {
+ for (int iTemplate = 0; iTemplate < this.SourceTemplates.Length; iTemplate++) {
+ ITaskItem sourceTemplateTaskItem = this.SourceTemplates[iTemplate];
var template = XElement.Load(sourceTemplateTaskItem.ItemSpec);
var templateContentElement = template.Element(XName.Get("TemplateContent", VSTemplateNamespace));
var projectElement = templateContentElement.Element(XName.Get("Project", VSTemplateNamespace));
@@ -76,20 +78,69 @@ namespace DotNetOpenAuth.BuildTasks {
continue;
}
- var projectPath = Path.Combine(Path.GetDirectoryName(sourceTemplateTaskItem.ItemSpec), projectElement.Attribute("File").Value);
+ var projectPath = this.SourceProjects[iTemplate].ItemSpec;
var projectDirectory = Path.GetDirectoryName(Path.Combine(Path.GetDirectoryName(sourceTemplateTaskItem.GetMetadata("FullPath")), projectElement.Attribute("File").Value));
Log.LogMessage("Merging project \"{0}\" with \"{1}\".", projectPath, sourceTemplateTaskItem.ItemSpec);
var sourceProject = new Project();
sourceProject.Load(projectPath);
+ var projectItems = sourceProject.EvaluatedItems.Cast<BuildItem>().Where(item => this.ProjectItemTypes.Contains(item.Name));
+
+ // Figure out where every project item is in source, and where it will go in the destination,
+ // taking into account a given maximum path length that may require that we shorten the path.
+ var sourceToDestinationProjectItemMap = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);
+ //var oversizedItemPaths = projectItems.Where(item => item.Include.Length > this.MaximumRelativePathLength);
+ foreach (var item in projectItems) {
+ var source = item.Include;
+ var dest = item.Include;
+
+ // if (this.MaximumRelativePathLength > 0) {
+ // if (item.Include.Length > this.MaximumRelativePathLength) {
+ // string leafName = Path.GetFileName(item.Include);
+ // int targetLeafLength = leafName.Length - (item.Include.Length - this.MaximumRelativePathLength);
+ // string shortenedFileName = CreateUniqueShortFileName(leafName, targetLeafLength);
+ // string shortenedRelativePath = Path.Combine(Path.GetDirectoryName(item.Include), shortenedFileName);
+ // if (shortenedRelativePath.Length <= this.MaximumRelativePathLength) {
+ // this.Log.LogMessage(
+ // "Renaming long project item '{0}' to '{1}' within project template to avoid MAX_PATH issues. The instantiated project will remain unchanged.",
+ // item.Include,
+ // shortenedRelativePath);
+ // projectItem.SetAttributeValue("TargetFileName", Path.GetFileName(item.Include));
+ // projectItem.Value = shortenedFileName;
+ // string originalFullPath = Path.Combine(projectDirectory, item.Include);
+ // string shortenedFullPath = Path.Combine(projectDirectory, shortenedRelativePath);
+ // if (File.Exists(shortenedFullPath)) {
+ // File.Delete(shortenedFullPath); // File.Move can't overwrite files
+ // }
+ // File.Move(originalFullPath, shortenedFullPath);
+
+ // // Document the change so the build system can account for it.
+ // TaskItem shortChange = new TaskItem(originalFullPath);
+ // shortChange.SetMetadata("ShortPath", shortenedFullPath);
+ // shortenedItems.Add(shortChange);
+ // } else {
+ // this.Log.LogError(
+ // "Project item '{0}' exceeds maximum allowable length {1} by {2} characters and it cannot be sufficiently shortened. Estimated full path is: '{3}'.",
+ // item.Include,
+ // this.MaximumRelativePathLength,
+ // item.Include.Length - this.MaximumRelativePathLength,
+ // item.Include);
+ // }
+ // }
+ //}
+
+ sourceToDestinationProjectItemMap[source] = dest;
+ }
// Collect the project items from the project that are appropriate
// to include in the .vstemplate file.
- var itemsByFolder = from item in sourceProject.EvaluatedItems.Cast<BuildItem>()
- where this.ProjectItemTypes.Contains(item.Name)
- orderby item.Include
- group item by Path.GetDirectoryName(item.Include);
+ var itemsByFolder = from item in projectItems
+ orderby item.Include
+ group item by Path.GetDirectoryName(item.Include);
+
foreach (var folder in itemsByFolder) {
- XElement parentNode = FindOrCreateParent(folder.Key, projectElement);
+ XElement parentNode = projectElement;
+ parentNode = FindOrCreateParent(folder.Key, projectElement);
+ //parentNode.SetAttributeValue("TargetFolderName", folder.Key);
foreach (var item in folder) {
bool replaceParameters = this.ReplaceParametersExtensions.Contains(Path.GetExtension(item.Include));
@@ -102,50 +153,21 @@ namespace DotNetOpenAuth.BuildTasks {
if (replaceParameters) {
projectItem.SetAttributeValue("ReplaceParameters", "true");
}
-
- if (this.EnsureMaxPath > 0) {
- string estimatedFullPath = EstimateFullPathInProjectCache(Path.GetFileNameWithoutExtension(sourceProject.FullFileName), item.Include);
- if (estimatedFullPath.Length > this.EnsureMaxPath) {
- string leafName = Path.GetFileName(item.Include);
- int targetLeafLength = leafName.Length - (estimatedFullPath.Length - this.EnsureMaxPath);
- string shortenedFileName = CreateUniqueShortFileName(leafName, targetLeafLength);
- string shortenedRelativePath = Path.Combine(Path.GetDirectoryName(item.Include), shortenedFileName);
- string shortenedEstimatedFullPath = EstimateFullPathInProjectCache(Path.GetFileNameWithoutExtension(sourceProject.FullFileName), shortenedRelativePath);
- if (shortenedEstimatedFullPath.Length <= this.EnsureMaxPath) {
- this.Log.LogMessage(
- "Renaming long project item '{0}' to '{1}' within project template to avoid MAX_PATH issues. The instantiated project will remain unchanged.",
- item.Include,
- shortenedRelativePath);
- projectItem.SetAttributeValue("TargetFileName", Path.GetFileName(item.Include));
- projectItem.Value = shortenedFileName;
- string originalFullPath = Path.Combine(projectDirectory, item.Include);
- string shortenedFullPath = Path.Combine(projectDirectory, shortenedRelativePath);
- if (File.Exists(shortenedFullPath)) {
- File.Delete(shortenedFullPath); // File.Move can't overwrite files
- }
- File.Move(originalFullPath, shortenedFullPath);
-
- // Document the change so the build system can account for it.
- TaskItem shortChange = new TaskItem(originalFullPath);
- shortChange.SetMetadata("ShortPath", shortenedFullPath);
- shortenedItems.Add(shortChange);
- } else {
- this.Log.LogError(
- "Project item '{0}' exceeds maximum allowable length {1} by {2} characters and it cannot be sufficiently shortened. Estimated full path is: '{3}'.",
- item.Include,
- this.EnsureMaxPath,
- estimatedFullPath.Length - this.EnsureMaxPath,
- estimatedFullPath);
- }
- }
- }
}
}
- template.Save(sourceTemplateTaskItem.ItemSpec);
+ template.Save(this.DestinationTemplates[iTemplate].ItemSpec);
+ foreach (var pair in sourceToDestinationProjectItemMap) {
+ TaskItem item = new TaskItem(Path.Combine(Path.GetDirectoryName(this.SourceTemplates[iTemplate].ItemSpec), pair.Key));
+ item.SetMetadata("SourceFullPath", Path.GetFullPath(Path.Combine(Path.GetDirectoryName(this.SourceTemplates[iTemplate].ItemSpec), pair.Key)));
+ item.SetMetadata("DestinationFullPath", Path.GetFullPath(Path.Combine(Path.GetDirectoryName(this.DestinationTemplates[iTemplate].ItemSpec), pair.Value)));
+ item.SetMetadata("RecursiveDir", Path.GetDirectoryName(this.SourceTemplates[iTemplate].ItemSpec));
+ projectItemsToCopy.Add(item);
+ }
}
- this.MaxPathAdjustedPaths = shortenedItems.ToArray();
+ this.ProjectItems = projectItemsToCopy.ToArray();
+
return !Log.HasLoggedErrors;
}
@@ -158,7 +180,7 @@ namespace DotNetOpenAuth.BuildTasks {
return fileName;
}
- string hashSuffix = Utilities.SuppressCharacters(fileName.GetHashCode().ToString("x"), Path.GetInvalidFileNameChars(), '_');
+ string hashSuffix = Utilities.SuppressCharacters(Math.Abs(fileName.GetHashCode() % 0xfff).ToString("x"), Path.GetInvalidFileNameChars(), '_');
string fileNameWithoutExtension = Path.GetFileNameWithoutExtension(fileName);
string extension = Path.GetExtension(fileName);
string hashSuffixWithExtension = hashSuffix + extension;
@@ -194,36 +216,5 @@ namespace DotNetOpenAuth.BuildTasks {
return parent;
}
-
- private string EstimateFullPathInProjectCache(string projectName, string itemRelativePath) {
- Contract.Requires<ArgumentException>(!string.IsNullOrEmpty(projectName));
- Contract.Requires<ArgumentException>(!string.IsNullOrEmpty(itemRelativePath));
-
- const string PathRoot = @"c:\documents and settings\usernameZZZ\AppData\Local\Microsoft\VisualStudio\10.0\Extensions\";
- string subPath;
- if (!vsixContributionToPath.TryGetValue(projectName, out subPath)) {
- if (this.VsixManifest == null) {
- this.Log.LogError("The task parameter VsixManifest is required but missing.");
- }
- var vsixDocument = XDocument.Load(this.VsixManifest.ItemSpec);
- XElement vsix = vsixDocument.Element(XName.Get("Vsix", VsixNamespace));
- XElement identifier = vsix.Element(XName.Get("Identifier", VsixNamespace));
- XElement content = vsix.Element(XName.Get("Content", VsixNamespace));
- string author = identifier.Element(XName.Get("Author", VsixNamespace)).Value;
- string name = identifier.Element(XName.Get("Name", VsixNamespace)).Value;
- string version = identifier.Element(XName.Get("Version", VsixNamespace)).Value;
- string pt = content.Element(XName.Get("ProjectTemplate", VsixNamespace)).Value;
- vsixContributionToPath[projectName] = subPath = string.Format(
- CultureInfo.InvariantCulture,
- @"{0}\{1}\{2}\~PC\{3}\CSharp\Web\{4}.zip\",
- author,
- name,
- version,
- pt,
- projectName
- );
- }
- return Path.Combine(PathRoot + subPath + Path.GetFileNameWithoutExtension(projectName), itemRelativePath);
- }
}
}
diff --git a/src/DotNetOpenAuth.BuildTasks/Purge.cs b/src/DotNetOpenAuth.BuildTasks/Purge.cs
index e19e485..cf1a214 100644
--- a/src/DotNetOpenAuth.BuildTasks/Purge.cs
+++ b/src/DotNetOpenAuth.BuildTasks/Purge.cs
@@ -7,12 +7,12 @@
namespace DotNetOpenAuth.BuildTasks {
using System;
using System.Collections.Generic;
+ using System.IO;
using System.Linq;
using System.Text;
- using Microsoft.Build.Utilities;
- using Microsoft.Build.Framework;
- using System.IO;
using System.Text.RegularExpressions;
+ using Microsoft.Build.Framework;
+ using Microsoft.Build.Utilities;
/// <summary>
/// Purges directory trees of all directories and files that are not on a whitelist.
@@ -40,6 +40,7 @@ namespace DotNetOpenAuth.BuildTasks {
/// <summary>
/// Gets or sets the files that should be NOT be purged.
/// </summary>
+ [Required]
public ITaskItem[] IntendedFiles { get; set; }
/// <summary>
@@ -82,7 +83,7 @@ namespace DotNetOpenAuth.BuildTasks {
}
private static string NormalizePath(string path) {
- return Regex.Replace(path, @"\\+", @"\");
+ return Path.GetFullPath(Regex.Replace(path, @"\\+", @"\"));
}
}
}
diff --git a/src/DotNetOpenAuth/DotNetOpenAuth.csproj b/src/DotNetOpenAuth/DotNetOpenAuth.csproj
index 3bfecae..9f29d4b 100644
--- a/src/DotNetOpenAuth/DotNetOpenAuth.csproj
+++ b/src/DotNetOpenAuth/DotNetOpenAuth.csproj
@@ -728,6 +728,20 @@ http://opensource.org/licenses/ms-pl.html
</BootstrapperPackage>
<Content Include="DotNetOpenAuth.ico" />
</ItemGroup>
+
+ <Target Name="BuildUnifiedProduct"
+ DependsOnTargets="Build"
+ Inputs="@(ILMergeInputAssemblies)"
+ Outputs="$(ILMergeOutputAssembly)">
+ <MakeDir Directories="$(ILMergeOutputAssemblyDirectory)" />
+ <ILMerge ExcludeFile="$(ProjectRoot)ILMergeInternalizeExceptions.txt"
+ InputAssemblies="@(ILMergeInputAssemblies)"
+ OutputFile="$(ILMergeOutputAssembly)"
+ KeyFile="$(PublicKeyFile)"
+ DelaySign="true"
+ />
+ </Target>
+
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="$(ProjectRoot)tools\DotNetOpenAuth.targets" />
</Project>