Skip to content
This repository has been archived by the owner on Nov 13, 2023. It is now read-only.

Commit

Permalink
Build only a single, signed package
Browse files Browse the repository at this point in the history
  • Loading branch information
reisenberger committed May 3, 2018
1 parent 2766cea commit ef951e9
Show file tree
Hide file tree
Showing 10 changed files with 10 additions and 147 deletions.
60 changes: 6 additions & 54 deletions build.cake
Original file line number Diff line number Diff line change
Expand Up @@ -38,17 +38,14 @@ var testResultsDir = artifactsDir + Directory("test-results");

// NuGet
var nuspecExtension = ".nuspec";
var signed = "-Signed";
var nuspecFolder = "nuget-package";
var nuspecSrcFile = srcDir + File(projectName + nuspecExtension);
var nuspecDestFile = buildDir + File(projectName + nuspecExtension);
var nuspecSignedDestFile = buildDir + File(projectName + signed + nuspecExtension);
var nupkgDestDir = artifactsDir + Directory(nuspecFolder);
var snkFile = srcDir + File(keyName);

var projectToNugetFolderMap = new Dictionary<string, string[]>() {
{ "NetStandard11", new [] {"netstandard1.1"} },
{ "NetStandard11-Signed", new [] {"netstandard1.1"} },
};

// Gitversion
Expand Down Expand Up @@ -189,31 +186,12 @@ Task("__RunTests")
}
});

Task("__CopyNonSignedOutputToNugetFolder")
.Does(() =>
{
foreach(var project in projectToNugetFolderMap.Keys
.Where(p => !p.Contains(signed))
) {
var sourceDir = srcDir + Directory(projectName + "." + project) + Directory("bin") + Directory(configuration);

foreach(var targetFolder in projectToNugetFolderMap[project]) {
var destDir = buildDir + Directory("lib");

Information("Copying {0} -> {1}.", sourceDir, destDir);
CopyDirectory(sourceDir, destDir);
}
}

CopyFile(nuspecSrcFile, nuspecDestFile);
});

Task("__CopySignedOutputToNugetFolder")
Task("__CopyOutputToNugetFolder")
.Does(() =>
{
foreach(var project in projectToNugetFolderMap.Keys
.Where(p => p.Contains(signed))
) {
foreach(var project in projectToNugetFolderMap.Keys)
{
var sourceDir = srcDir + Directory(projectName + "." + project) + Directory("bin") + Directory(configuration);

foreach(var targetFolder in projectToNugetFolderMap[project]) {
Expand All @@ -224,16 +202,10 @@ Task("__CopySignedOutputToNugetFolder")
}
}

CopyFile(nuspecSrcFile, nuspecSignedDestFile);

var replacedFiles = ReplaceTextInFiles(nuspecSignedDestFile, "dependency id=\"Polly\"", "dependency id=\"Polly-Signed\"");
if (!replacedFiles.Any())
{
throw new Exception("Could not set Polly dependency to Polly-Signed, for -Signed nuget package.");
}
CopyFile(nuspecSrcFile, nuspecDestFile);
});

Task("__CreateNonSignedNugetPackage")
Task("__CreateSignedNugetPackage")
.Does(() =>
{
var nugetVersion = gitVersionOutput["NuGetVersion"].ToString();
Expand All @@ -251,24 +223,6 @@ Task("__CreateNonSignedNugetPackage")
NuGetPack(nuspecDestFile, nuGetPackSettings);
});

Task("__CreateSignedNugetPackage")
.Does(() =>
{
var nugetVersion = gitVersionOutput["NuGetVersion"].ToString();
var packageName = projectName + "-Signed";

Information("Building {0}.{1}.nupkg", packageName, nugetVersion);

var nuGetPackSettings = new NuGetPackSettings {
Id = packageName,
Title = packageName,
Version = nugetVersion,
OutputDirectory = nupkgDestDir
};

NuGetPack(nuspecSignedDestFile, nuGetPackSettings);
});

Task("__StronglySignAssemblies")
.Does(() =>
{
Expand Down Expand Up @@ -297,9 +251,7 @@ Task("Build")
.IsDependentOn("__UpdateAppVeyorBuildNumber")
.IsDependentOn("__BuildSolutions")
.IsDependentOn("__RunTests")
.IsDependentOn("__CopyNonSignedOutputToNugetFolder")
.IsDependentOn("__CreateNonSignedNugetPackage")
.IsDependentOn("__CopySignedOutputToNugetFolder")
.IsDependentOn("__CopyOutputToNugetFolder")
.IsDependentOn("__StronglySignAssemblies")
.IsDependentOn("__CreateSignedNugetPackage");

Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<ItemGroup>
<PackageReference Include="FluentAssertions" Version="5.2.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.0.0" />
<PackageReference Include="Polly" Version="5.9.0" />
<PackageReference Include="Polly" Version="6.0.0-v6alpha0001" />
<PackageReference Include="xunit" Version="2.3.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.3.1" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
</Compile>
</ItemGroup>
<ItemGroup>
<PackageReference Include="Polly" Version="5.9.0" />
<PackageReference Include="Polly" Version="6.0.0-v6alpha0001" />
</ItemGroup>
<Import Project="..\Polly.Extensions.Http.Shared\Polly.Extensions.Http.Shared.projitems" Label="Shared" />
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
using System.Runtime.CompilerServices;

[assembly: AssemblyTitle("Polly.Extensions.Http")]
[assembly: AssemblyVersion("1.0.3.0")]
[assembly: AssemblyVersion("1.0.4.0")]
[assembly: CLSCompliant(true)]

[assembly: InternalsVisibleTo("Polly.Extensions.Http.NetStandard11.Specs")]
2 changes: 1 addition & 1 deletion src/Polly.Extensions.Http.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
</releaseNotes>
<dependencies>
<group targetFramework="netstandard1.1">
<dependency id="Polly" version="5.9.0" />
<dependency id="Polly" version="6.0.0-v6alpha0001" />
<dependency id="NETStandard.Library" version="1.6.1" />
</group>
</dependencies>
Expand Down
12 changes: 0 additions & 12 deletions src/Polly.Extensions.Http.sln
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Polly.Extensions.Http.NetSt
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Polly.Extensions.Http.NetStandard11.Specs", "Polly.Extensions.Http.NetStandard11.Specs\Polly.Extensions.Http.NetStandard11.Specs.csproj", "{615C92EC-5921-40F4-A690-C66B1587C08E}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Polly.Extensions.Http.NetStandard11-Signed", "Polly.Extensions.Http.NetStandard11-Signed\Polly.Extensions.Http.NetStandard11-Signed.csproj", "{1CFC0F44-E534-4F9F-B916-F408244356B4}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Polly.Extensions.Http.NetStandard11-Signed.Specs", "Polly.Extensions.Http.NetStandard11-Signed.Specs\Polly.Extensions.Http.NetStandard11-Signed.Specs.csproj", "{A69B39A4-158C-41C0-9144-E49503FE7A8D}"
EndProject
Global
GlobalSection(SharedMSBuildProjectFiles) = preSolution
Polly.Extensions.Http.Shared\Polly.Extensions.Http.Shared.projitems*{23fa87f9-c77d-4c67-a0b0-2901de51b3ff}*SharedItemsImports = 13
Expand All @@ -40,14 +36,6 @@ Global
{615C92EC-5921-40F4-A690-C66B1587C08E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{615C92EC-5921-40F4-A690-C66B1587C08E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{615C92EC-5921-40F4-A690-C66B1587C08E}.Release|Any CPU.Build.0 = Release|Any CPU
{1CFC0F44-E534-4F9F-B916-F408244356B4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1CFC0F44-E534-4F9F-B916-F408244356B4}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1CFC0F44-E534-4F9F-B916-F408244356B4}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1CFC0F44-E534-4F9F-B916-F408244356B4}.Release|Any CPU.Build.0 = Release|Any CPU
{A69B39A4-158C-41C0-9144-E49503FE7A8D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A69B39A4-158C-41C0-9144-E49503FE7A8D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A69B39A4-158C-41C0-9144-E49503FE7A8D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A69B39A4-158C-41C0-9144-E49503FE7A8D}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down

0 comments on commit ef951e9

Please sign in to comment.