From 5cdf7cb191f980fa1b503dfc87ee51f1f3bcd0ff Mon Sep 17 00:00:00 2001 From: Neil Campbell Date: Tue, 5 Sep 2017 21:57:55 +1000 Subject: [PATCH] Making the platform specific package names more .net semantic --- Build/Publish-StandaloneCore-Releases.ps1 | 7 +++---- ...nux-x64.nuspec => PactNet.Linux.x64.nuspec} | 6 +++--- ...x-x64.targets => PactNet.Linux.x64.targets} | 0 ...nux-x86.nuspec => PactNet.Linux.x86.nuspec} | 6 +++--- ...x-x86.targets => PactNet.Linux.x86.targets} | 0 .../{PactNet-OSX.nuspec => PactNet.OSX.nuspec} | 6 +++--- ...PactNet-OSX.targets => PactNet.OSX.targets} | 0 ...t-Windows.nuspec => PactNet.Windows.nuspec} | 6 +++--- ...Windows.targets => PactNet.Windows.targets} | 0 PactNet/Core/PactCoreHost.cs | 18 +++++++++--------- PactNet/PactNet.nuspec | 4 ++-- README.md | 16 ++++++++-------- 12 files changed, 34 insertions(+), 35 deletions(-) rename Build/linux-x64/{PactNet-Linux-x64.nuspec => PactNet.Linux.x64.nuspec} (86%) rename Build/linux-x64/{PactNet-Linux-x64.targets => PactNet.Linux.x64.targets} (100%) rename Build/linux-x86/{PactNet-Linux-x86.nuspec => PactNet.Linux.x86.nuspec} (86%) rename Build/linux-x86/{PactNet-Linux-x86.targets => PactNet.Linux.x86.targets} (100%) rename Build/osx/{PactNet-OSX.nuspec => PactNet.OSX.nuspec} (88%) rename Build/osx/{PactNet-OSX.targets => PactNet.OSX.targets} (100%) rename Build/windows/{PactNet-Windows.nuspec => PactNet.Windows.nuspec} (88%) rename Build/windows/{PactNet-Windows.targets => PactNet.Windows.targets} (100%) diff --git a/Build/Publish-StandaloneCore-Releases.ps1 b/Build/Publish-StandaloneCore-Releases.ps1 index 5ac1321e..0d0fe5b7 100644 --- a/Build/Publish-StandaloneCore-Releases.ps1 +++ b/Build/Publish-StandaloneCore-Releases.ps1 @@ -5,7 +5,7 @@ $ReleaseVersionNumber, [switch]$Push, - + [string]$ApiKey ) @@ -15,12 +15,12 @@ $BuildRoot = Split-Path -Path $PSScriptFilePath -Parent $SolutionRoot = Split-Path -Path $BuildRoot -Parent $NuGetExe = Join-Path $BuildRoot -ChildPath '..\.nuget\nuget.exe' -$StandaloneCoreReleases = @('PactNet-Windows','PactNet-OSX','PactNet-Linux-x64','PactNet-Linux-x86') +$StandaloneCoreReleases = @('PactNet.Windows','PactNet.OSX','PactNet.Linux.x64','PactNet.Linux.x86') foreach ($StandaloneCoreRelease in $StandaloneCoreReleases) { # Build the NuGet package - $ReleaseSource = $StandaloneCoreRelease.Replace('PactNet-', '').ToLower() + $ReleaseSource = $StandaloneCoreRelease.Replace('.', '-').Replace('PactNet-', '').ToLower() $ProjectPath = Join-Path -Path $SolutionRoot -ChildPath "Build\$ReleaseSource\$StandaloneCoreRelease.nuspec" & $NuGetExe pack $ProjectPath -Properties Configuration=Release -OutputDirectory $BuildRoot -Version $ReleaseVersionNumber -NoPackageAnalysis -NoDefaultExcludes if (-not $?) @@ -44,4 +44,3 @@ foreach ($StandaloneCoreRelease in $StandaloneCoreReleases) } } } - diff --git a/Build/linux-x64/PactNet-Linux-x64.nuspec b/Build/linux-x64/PactNet.Linux.x64.nuspec similarity index 86% rename from Build/linux-x64/PactNet-Linux-x64.nuspec rename to Build/linux-x64/PactNet.Linux.x64.nuspec index b15c22f2..3d8802a8 100644 --- a/Build/linux-x64/PactNet-Linux-x64.nuspec +++ b/Build/linux-x64/PactNet.Linux.x64.nuspec @@ -1,7 +1,7 @@ - PactNet-Linux-x64 + PactNet.Linux.x64 $version$ seek.com.au seek.com.au @@ -16,6 +16,6 @@ - + - \ No newline at end of file + diff --git a/Build/linux-x64/PactNet-Linux-x64.targets b/Build/linux-x64/PactNet.Linux.x64.targets similarity index 100% rename from Build/linux-x64/PactNet-Linux-x64.targets rename to Build/linux-x64/PactNet.Linux.x64.targets diff --git a/Build/linux-x86/PactNet-Linux-x86.nuspec b/Build/linux-x86/PactNet.Linux.x86.nuspec similarity index 86% rename from Build/linux-x86/PactNet-Linux-x86.nuspec rename to Build/linux-x86/PactNet.Linux.x86.nuspec index 5022d28d..7eecde05 100644 --- a/Build/linux-x86/PactNet-Linux-x86.nuspec +++ b/Build/linux-x86/PactNet.Linux.x86.nuspec @@ -1,7 +1,7 @@ - PactNet-Linux-x86 + PactNet.Linux.x86 $version$ seek.com.au seek.com.au @@ -16,6 +16,6 @@ - + - \ No newline at end of file + diff --git a/Build/linux-x86/PactNet-Linux-x86.targets b/Build/linux-x86/PactNet.Linux.x86.targets similarity index 100% rename from Build/linux-x86/PactNet-Linux-x86.targets rename to Build/linux-x86/PactNet.Linux.x86.targets diff --git a/Build/osx/PactNet-OSX.nuspec b/Build/osx/PactNet.OSX.nuspec similarity index 88% rename from Build/osx/PactNet-OSX.nuspec rename to Build/osx/PactNet.OSX.nuspec index 7e9866ef..b43137c8 100644 --- a/Build/osx/PactNet-OSX.nuspec +++ b/Build/osx/PactNet.OSX.nuspec @@ -1,7 +1,7 @@ - PactNet-OSX + PactNet.OSX $version$ seek.com.au seek.com.au @@ -16,6 +16,6 @@ - + - \ No newline at end of file + diff --git a/Build/osx/PactNet-OSX.targets b/Build/osx/PactNet.OSX.targets similarity index 100% rename from Build/osx/PactNet-OSX.targets rename to Build/osx/PactNet.OSX.targets diff --git a/Build/windows/PactNet-Windows.nuspec b/Build/windows/PactNet.Windows.nuspec similarity index 88% rename from Build/windows/PactNet-Windows.nuspec rename to Build/windows/PactNet.Windows.nuspec index a5424aeb..b459e74d 100644 --- a/Build/windows/PactNet-Windows.nuspec +++ b/Build/windows/PactNet.Windows.nuspec @@ -1,7 +1,7 @@ - PactNet-Windows + PactNet.Windows $version$ seek.com.au seek.com.au @@ -16,6 +16,6 @@ - + - \ No newline at end of file + diff --git a/Build/windows/PactNet-Windows.targets b/Build/windows/PactNet.Windows.targets similarity index 100% rename from Build/windows/PactNet-Windows.targets rename to Build/windows/PactNet.Windows.targets diff --git a/PactNet/Core/PactCoreHost.cs b/PactNet/Core/PactCoreHost.cs index 4c404a9a..3363aa9d 100644 --- a/PactNet/Core/PactCoreHost.cs +++ b/PactNet/Core/PactCoreHost.cs @@ -16,37 +16,37 @@ internal class PactCoreHost : IPactCoreHost where T : IPactCoreHostConfig public PactCoreHost(T config) { _config = config; - + var expectedPackage = String.Empty; #if USE_NET4X var pactCoreDir = $"{Constants.BuildDirectory}{Path.DirectorySeparatorChar}"; //OS specific version will be appended pactCoreDir += "pact-win32"; - expectedPackage = "PactNet-Windows"; + expectedPackage = "PactNet.Windows"; #else var pactCoreDir = $"{Constants.BuildDirectory}{Path.DirectorySeparatorChar}"; //OS specific version will be appended if (System.Runtime.InteropServices.RuntimeInformation.IsOSPlatform(System.Runtime.InteropServices.OSPlatform.Windows)) { pactCoreDir += "pact-win32"; - expectedPackage = "PactNet-Windows"; + expectedPackage = "PactNet.Windows"; } else if (System.Runtime.InteropServices.RuntimeInformation.IsOSPlatform(System.Runtime.InteropServices.OSPlatform.OSX)) { pactCoreDir += "pact-osx"; - expectedPackage = "PactNet-OSX"; + expectedPackage = "PactNet.OSX"; } else if (System.Runtime.InteropServices.RuntimeInformation.IsOSPlatform(System.Runtime.InteropServices.OSPlatform.Linux) && System.Runtime.InteropServices.RuntimeInformation.OSArchitecture == System.Runtime.InteropServices.Architecture.X86) { pactCoreDir += "pact-linux-x86"; - expectedPackage = "PactNet-Linux-x86"; + expectedPackage = "PactNet.Linux.x86"; } else if (System.Runtime.InteropServices.RuntimeInformation.IsOSPlatform(System.Runtime.InteropServices.OSPlatform.Linux) && System.Runtime.InteropServices.RuntimeInformation.OSArchitecture == System.Runtime.InteropServices.Architecture.X64) { pactCoreDir += "pact-linux-x86_64"; - expectedPackage = "PactNet-Linux-x64"; + expectedPackage = "PactNet.Linux.x64"; } else { @@ -181,9 +181,9 @@ private void WriteToOutputters(string line) private string ReplaceConfigParams(string input, string pactCoreDir, string script) { - return !String.IsNullOrEmpty(input) ? - input.Replace("{pactCoreDir}", pactCoreDir).Replace("{script}", script) : + return !String.IsNullOrEmpty(input) ? + input.Replace("{pactCoreDir}", pactCoreDir).Replace("{script}", script) : String.Empty; } } -} \ No newline at end of file +} diff --git a/PactNet/PactNet.nuspec b/PactNet/PactNet.nuspec index fb9bf690..779ea72c 100644 --- a/PactNet/PactNet.nuspec +++ b/PactNet/PactNet.nuspec @@ -8,7 +8,7 @@ https://github.com/SEEK-Jobs/pact-net/blob/master/LICENSE.txt https://github.com/SEEK-Jobs/pact-net false - A .NET version of Pact, which enables consumer driven contract testing. NOTE: For version 2 and above, you will need to install one of the following Nuget packages, depending on your target platform and architecture: PactNet-Windows, PactNet-OSX, PactNet-Linux-x86 or PactNet-Linux-x64. + A .NET version of Pact, which enables consumer driven contract testing. NOTE: For version 2 and above, you will need to install one of the following Nuget packages, depending on your target platform and architecture: PactNet.Windows, PactNet.OSX, PactNet.Linux.x86 or PactNet.Linux.x64. @@ -34,4 +34,4 @@ - \ No newline at end of file + diff --git a/README.md b/README.md index b4bef6dc..9ca28cf1 100644 --- a/README.md +++ b/README.md @@ -37,20 +37,20 @@ We have also written some `//NOTE:` comments inline in the code to help explain Via Nuget **Windows** -https://www.nuget.org/packages/PactNet-Windows -`Install-Package PactNet-Windows` +https://www.nuget.org/packages/PactNet.Windows +`Install-Package PactNet.Windows` **OSX** -https://www.nuget.org/packages/PactNet-OSX -`Install-Package PactNet-OSX` +https://www.nuget.org/packages/PactNet.OSX +`Install-Package PactNet.OSX` **Linux x64 (64-bit)** -https://www.nuget.org/packages/PactNet-Linux-x64 -`Install-Package PactNet-Linux-x64` +https://www.nuget.org/packages/PactNet.Linux.x64 +`Install-Package PactNet.Linux.x64` **Linux x86 (32-bit)** -https://www.nuget.org/packages/PactNet-Linux-x86 -`Install-Package PactNet-Linux-x86` +https://www.nuget.org/packages/PactNet.Linux.x86 +`Install-Package PactNet.Linux.x86` ### Service Consumer