From 7015ec7fba23c2ef8ed54565767676fde10e55d9 Mon Sep 17 00:00:00 2001 From: Alexander Powolozki Date: Tue, 16 Jun 2015 11:51:38 +0200 Subject: [PATCH 01/10] - Buildeploy.targets: creation of nuget packages not only by providing a nuspec file but also by providing a csproj file. --- Buildeploy.targets | 823 +++++++++++++++++++++++---------------------- 1 file changed, 421 insertions(+), 402 deletions(-) diff --git a/Buildeploy.targets b/Buildeploy.targets index 1d0333e..93b20b9 100644 --- a/Buildeploy.targets +++ b/Buildeploy.targets @@ -1,408 +1,427 @@  - - .\ - $(MSBuildThisFileDirectory)\buildeploy.dll - Release - + + .\ + $(MSBuildThisFileDirectory)\buildeploy.dll + Release + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - $(MSBuildProjectDirectory)\bin\%(Configuration.Identity)\ - $(CompileOutputFolder) - - - - - - - - - - - - - - $(MSBuildProjectDirectory)\bin\$(RedistConfiguration)\ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - $(VersionRedistRoot)\Packages - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - $(VersionRedistRoot)\Packages - - - - - - - - - - - - - - - Temp - $(TempRedistRoot)\Client - $(TempRedistRoot)\Server - $(TempRedistRoot)\Localization - $(TempRedistRoot)\Compiledsite - - - - - - - - - - $(OutputRoot)\$(RedistConfiguration)\ - $(CustomRedistRoot) - - - - - - - - *.* - $(VersionPrefix) - - - - - - - - - - - - - - - - $(DefaultVersionRedistRoot) - $(RedistRoot)\$(BuildDefinition)\$(Version) - - - - - - - - - - $(VS120COMNTOOLS)..\IDE\MSTest.exe - $(VS110COMNTOOLS)..\IDE\MSTest.exe - $(VS100COMNTOOLS)..\IDE\MSTest.exe - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + $(MSBuildProjectDirectory)\bin\%(Configuration.Identity)\ + $(CompileOutputFolder) + + + + + + + + + + + + + + $(MSBuildProjectDirectory)\bin\$(RedistConfiguration)\ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Temp + $(TempRedistRoot)\Client + $(TempRedistRoot)\Server + $(TempRedistRoot)\Localization + $(TempRedistRoot)\Compiledsite + + + + + + + + $(OutputRoot)\$(RedistConfiguration)\ + $(CustomRedistRoot) + $(DefaultVersionRedistRoot) + $(RedistRoot)\$(BuildDefinition)\$(Version) + $(RedistRoot)\$(Version) + $(VersionRedistRoot)\Packages + + + + + + + + + + *.* + $(VersionPrefix) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + $(VS120COMNTOOLS)..\IDE\MSTest.exe + $(VS110COMNTOOLS)..\IDE\MSTest.exe + $(VS100COMNTOOLS)..\IDE\MSTest.exe + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From 807ad82fdc0eadccb3bd5fa8c0316e37e49f7899 Mon Sep 17 00:00:00 2001 From: Alexander Powolozki Date: Tue, 16 Jun 2015 13:15:51 +0200 Subject: [PATCH 02/10] Line ending setting for target files --- .gitattributes | 1 + 1 file changed, 1 insertion(+) create mode 100644 .gitattributes diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..f38c8f0 --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +*.targets text eol=crlf \ No newline at end of file From 6798dd133725160d739ffb77f0ea3c8c42c7caf5 Mon Sep 17 00:00:00 2001 From: Alexander Powolozki Date: Tue, 16 Jun 2015 13:28:44 +0200 Subject: [PATCH 03/10] -Buildeploy.targets: converted line endings to crlf --- Buildeploy.targets | 854 ++++++++++++++++++++++----------------------- 1 file changed, 427 insertions(+), 427 deletions(-) diff --git a/Buildeploy.targets b/Buildeploy.targets index 93b20b9..b14c4b1 100644 --- a/Buildeploy.targets +++ b/Buildeploy.targets @@ -1,427 +1,427 @@ - - - - .\ - $(MSBuildThisFileDirectory)\buildeploy.dll - Release - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - $(MSBuildProjectDirectory)\bin\%(Configuration.Identity)\ - $(CompileOutputFolder) - - - - - - - - - - - - - - $(MSBuildProjectDirectory)\bin\$(RedistConfiguration)\ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Temp - $(TempRedistRoot)\Client - $(TempRedistRoot)\Server - $(TempRedistRoot)\Localization - $(TempRedistRoot)\Compiledsite - - - - - - - - $(OutputRoot)\$(RedistConfiguration)\ - $(CustomRedistRoot) - $(DefaultVersionRedistRoot) - $(RedistRoot)\$(BuildDefinition)\$(Version) - $(RedistRoot)\$(Version) - $(VersionRedistRoot)\Packages - - - - - - - - - - *.* - $(VersionPrefix) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - $(VS120COMNTOOLS)..\IDE\MSTest.exe - $(VS110COMNTOOLS)..\IDE\MSTest.exe - $(VS100COMNTOOLS)..\IDE\MSTest.exe - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + .\ + $(MSBuildThisFileDirectory)\buildeploy.dll + Release + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + $(MSBuildProjectDirectory)\bin\%(Configuration.Identity)\ + $(CompileOutputFolder) + + + + + + + + + + + + + + $(MSBuildProjectDirectory)\bin\$(RedistConfiguration)\ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Temp + $(TempRedistRoot)\Client + $(TempRedistRoot)\Server + $(TempRedistRoot)\Localization + $(TempRedistRoot)\Compiledsite + + + + + + + + $(OutputRoot)\$(RedistConfiguration)\ + $(CustomRedistRoot) + $(DefaultVersionRedistRoot) + $(RedistRoot)\$(BuildDefinition)\$(Version) + $(RedistRoot)\$(Version) + $(VersionRedistRoot)\Packages + + + + + + + + + + *.* + $(VersionPrefix) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + $(VS120COMNTOOLS)..\IDE\MSTest.exe + $(VS110COMNTOOLS)..\IDE\MSTest.exe + $(VS100COMNTOOLS)..\IDE\MSTest.exe + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From 4014ab7c3644ac6ec3f3b7d86b2db93a5e27c4b2 Mon Sep 17 00:00:00 2001 From: Alexander Powolozki Date: Wed, 17 Jun 2015 17:35:09 +0200 Subject: [PATCH 04/10] - Tasks/ResolveRedistAssemblies.cs: use RelativeDir metadata item on resolving assemblies paths for redistribution --- Tasks/ResolveRedistAssemblies.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Tasks/ResolveRedistAssemblies.cs b/Tasks/ResolveRedistAssemblies.cs index f69bd31..c382e70 100644 --- a/Tasks/ResolveRedistAssemblies.cs +++ b/Tasks/ResolveRedistAssemblies.cs @@ -34,7 +34,9 @@ public override bool Execute() { foreach (var item in Files) { - string fileName = Path.GetFullPath(Path.Combine(LookupPath, item.GetMetadata("filename") + item.GetMetadata("extension"))); + var filePath = Path.Combine(LookupPath, item.GetMetadata("RelativeDir")); + string fileName = Path.GetFullPath(Path.Combine(filePath, item.GetMetadata("filename") + item.GetMetadata("extension"))); + if (!CheckFileExists(fileName)) return false; resultFileNames.Add(fileName); if (string.Equals(item.GetMetadata("AddReferences"), "true", StringComparison.OrdinalIgnoreCase)) From 3af5fe032e9eb0ce413d873c3fefe643bf32ff4d Mon Sep 17 00:00:00 2001 From: Alexander Powolozki Date: Wed, 17 Jun 2015 17:36:06 +0200 Subject: [PATCH 05/10] Possibility to omit default excludes during NugetPackage Task --- Buildeploy.csproj | 1 + Buildeploy.targets | 12 +----------- Tasks/NugetPackage.cs | 11 +++++++++++ 3 files changed, 13 insertions(+), 11 deletions(-) diff --git a/Buildeploy.csproj b/Buildeploy.csproj index fd76964..6ae5f60 100644 --- a/Buildeploy.csproj +++ b/Buildeploy.csproj @@ -67,6 +67,7 @@ Always + Designer diff --git a/Buildeploy.targets b/Buildeploy.targets index b14c4b1..f7dfd80 100644 --- a/Buildeploy.targets +++ b/Buildeploy.targets @@ -204,6 +204,7 @@ PackageId="%(OctoConfig.PackageId)" PushLocation="%(OctoConfig.PushLocation)" ApiKey="%(OctoConfig.ApiKey)" + NoDefaultExcludes="%(OctoConfig.NoDefaultExcludes)" Condition="'%(OctoConfig.NuspecFile)'!=''" /> @@ -215,17 +216,6 @@ - - - - - - - diff --git a/Tasks/NugetPackage.cs b/Tasks/NugetPackage.cs index a8c8a56..f25023b 100644 --- a/Tasks/NugetPackage.cs +++ b/Tasks/NugetPackage.cs @@ -37,6 +37,8 @@ public class NugetPackage : PackageTaskBase public string PushLocation { get; set; } + public bool NoDefaultExcludes { get; set; } + protected override IPackageArchive CreatePackageArchive() { var archive = new NugetArchive(NugetExePath, Path.GetFullPath(NuspecFile), OutputDirectory, Version, Log); @@ -45,6 +47,8 @@ protected override IPackageArchive CreatePackageArchive() archive.ApiKey = ApiKey; archive.PushLocation = PushLocation; + archive.NoDefaultExcludes = this.NoDefaultExcludes; + return archive; } @@ -84,6 +88,9 @@ private static string CreateTempDirectory() internal string PushLocation { get; set; } internal string ApiKey { get; set; } + + internal bool NoDefaultExcludes { get; set; } + internal void AddProperty(string name, string value) { properties.Add(name, value); @@ -127,6 +134,10 @@ public bool Finish() { commandLine.AppendFormat(CultureInfo.InvariantCulture, "pack \"{0}\" -NoPackageAnalysis -BasePath \"{1}\" -OutputDirectory \"{2}\" -Version {3}", nuspecFile, tempPath, nupkgTempDirectory, version); + if (this.NoDefaultExcludes) + { + commandLine.Append(" -NoDefaultExcludes"); + } foreach (var fileName in Directory.GetFiles(nupkgTempDirectory)) File.Move(fileName, Path.Combine(outputDir, Path.GetFileName(fileName))); From ec25f40945d3869a405529dd4198f9807ea32843 Mon Sep 17 00:00:00 2001 From: Alexander Powolozki Date: Wed, 17 Jun 2015 18:55:48 +0200 Subject: [PATCH 06/10] Project file to build and package buildeploy from scratch updated to avoid the chicken or the egg problem --- build.proj | 57 ++++++++++++++++++++++++++++++++++-------------------- 1 file changed, 36 insertions(+), 21 deletions(-) diff --git a/build.proj b/build.proj index 6e241bc..6329618 100644 --- a/build.proj +++ b/build.proj @@ -1,23 +1,38 @@ - - bin\debug\buildeploy.dll - - - - packages\NuGet.CommandLine.2.8.2\tools\NuGet.exe - Debug - - - - - - - - - - - - - - + + bin\debug\buildeploy.dll + + + + + + packages\NuGet.CommandLine.2.8.2\tools\NuGet.exe + Debug + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file From f359b288a6499b34c2003e07a643bd7d818a270b Mon Sep 17 00:00:00 2001 From: Alexander Powolozki Date: Thu, 18 Jun 2015 11:22:49 +0200 Subject: [PATCH 07/10] NugetPackage Taks: rename property containing PackageId to Id as this token name is the original token name used by nuget for package identifier --- Tasks/NugetPackage.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tasks/NugetPackage.cs b/Tasks/NugetPackage.cs index f25023b..d2bb9ca 100644 --- a/Tasks/NugetPackage.cs +++ b/Tasks/NugetPackage.cs @@ -43,7 +43,7 @@ protected override IPackageArchive CreatePackageArchive() { var archive = new NugetArchive(NugetExePath, Path.GetFullPath(NuspecFile), OutputDirectory, Version, Log); if (!string.IsNullOrWhiteSpace(PackageId)) - archive.AddProperty("PackageId", PackageId); + archive.AddProperty("Id", PackageId); archive.ApiKey = ApiKey; archive.PushLocation = PushLocation; From 36489cb98bfc59f2d402096f8d4374747624307d Mon Sep 17 00:00:00 2001 From: Alexander Powolozki Date: Sat, 20 Jun 2015 13:18:56 +0200 Subject: [PATCH 08/10] Restoring backward compatibility on setting NuGet PackageId property --- Tasks/NugetPackage.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Tasks/NugetPackage.cs b/Tasks/NugetPackage.cs index d2bb9ca..a7f2d2d 100644 --- a/Tasks/NugetPackage.cs +++ b/Tasks/NugetPackage.cs @@ -43,7 +43,10 @@ protected override IPackageArchive CreatePackageArchive() { var archive = new NugetArchive(NugetExePath, Path.GetFullPath(NuspecFile), OutputDirectory, Version, Log); if (!string.IsNullOrWhiteSpace(PackageId)) + { archive.AddProperty("Id", PackageId); + archive.AddProperty("PackageId", PackageId); + } archive.ApiKey = ApiKey; archive.PushLocation = PushLocation; From 3193e1fa402892a90d7669e663587110a654be5c Mon Sep 17 00:00:00 2001 From: Alexander Powolozki Date: Sat, 20 Jun 2015 21:08:01 +0200 Subject: [PATCH 09/10] - Buildeploy.targets: removed not needed comments --- Buildeploy.targets | 4 ---- 1 file changed, 4 deletions(-) diff --git a/Buildeploy.targets b/Buildeploy.targets index f7dfd80..085ffdf 100644 --- a/Buildeploy.targets +++ b/Buildeploy.targets @@ -296,10 +296,6 @@ - - From 9d051d90d0a282db09432e29f0acd454a3beb8b4 Mon Sep 17 00:00:00 2001 From: Alexander Powolozki Date: Thu, 2 Jul 2015 17:24:52 +0200 Subject: [PATCH 10/10] - Refactoring of properties generation to use it by multiple targets - Refactoring of preparation and redistribution of binaries to be able to add and check additional binaries by probject --- Buildeploy.targets | 51 ++++++++++++++++++++++++++++++---------------- 1 file changed, 33 insertions(+), 18 deletions(-) diff --git a/Buildeploy.targets b/Buildeploy.targets index f7dfd80..196745f 100644 --- a/Buildeploy.targets +++ b/Buildeploy.targets @@ -48,7 +48,7 @@ + Outputs="target\%(Configuration.Identity)"> @@ -296,14 +296,10 @@ - - + - @@ -319,6 +315,32 @@ WorkingDirectory="bin\$(RedistConfiguration)" Category="$(MSTestCategory)"/> + + + + + + + + + + + + + + + + + + + + + + + + + @@ -327,6 +349,10 @@ + + + + @@ -341,21 +367,10 @@ - + - - - - - - - - - -