Skip to content

Commit

Permalink
Making the platform specific package names more .net semantic
Browse files Browse the repository at this point in the history
  • Loading branch information
neilcampbell committed Sep 5, 2017
1 parent 0a71b7d commit 5cdf7cb
Show file tree
Hide file tree
Showing 12 changed files with 34 additions and 35 deletions.
7 changes: 3 additions & 4 deletions Build/Publish-StandaloneCore-Releases.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
$ReleaseVersionNumber,

[switch]$Push,

[string]$ApiKey
)

Expand All @@ -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 $?)
Expand All @@ -44,4 +44,3 @@ foreach ($StandaloneCoreRelease in $StandaloneCoreReleases)
}
}
}

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0"?>
<package>
<metadata>
<id>PactNet-Linux-x64</id>
<id>PactNet.Linux.x64</id>
<version>$version$</version>
<authors>seek.com.au</authors>
<owners>seek.com.au</owners>
Expand All @@ -16,6 +16,6 @@
<files>
<file src="..\tools\pact-linux-x86_64\**" target="tools\pact-linux-x86_64\" />
<file src="config.json" target="tools\pact-linux-x86_64\config.json" />
<file src="PactNet-Linux-x64.targets" target="build\PactNet-Linux-x64.targets" />
<file src="PactNet.Linux.x64.targets" target="build\PactNet.Linux.x64.targets" />
</files>
</package>
</package>
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0"?>
<package>
<metadata>
<id>PactNet-Linux-x86</id>
<id>PactNet.Linux.x86</id>
<version>$version$</version>
<authors>seek.com.au</authors>
<owners>seek.com.au</owners>
Expand All @@ -16,6 +16,6 @@
<files>
<file src="..\tools\pact-linux-x86\**" target="tools\pact-linux-x86\" />
<file src="config.json" target="tools\pact-linux-x86\config.json" />
<file src="PactNet-Linux-x86.targets" target="build\PactNet-Linux-x86.targets" />
<file src="PactNet.Linux.x86.targets" target="build\PactNet.Linux.x86.targets" />
</files>
</package>
</package>
File renamed without changes.
6 changes: 3 additions & 3 deletions Build/osx/PactNet-OSX.nuspec → Build/osx/PactNet.OSX.nuspec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0"?>
<package>
<metadata>
<id>PactNet-OSX</id>
<id>PactNet.OSX</id>
<version>$version$</version>
<authors>seek.com.au</authors>
<owners>seek.com.au</owners>
Expand All @@ -16,6 +16,6 @@
<files>
<file src="..\tools\pact-osx\**" target="tools\pact-osx\" />
<file src="config.json" target="tools\pact-osx\config.json" />
<file src="PactNet-OSX.targets" target="build\PactNet-OSX.targets" />
<file src="PactNet.OSX.targets" target="build\PactNet.OSX.targets" />
</files>
</package>
</package>
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0"?>
<package>
<metadata>
<id>PactNet-Windows</id>
<id>PactNet.Windows</id>
<version>$version$</version>
<authors>seek.com.au</authors>
<owners>seek.com.au</owners>
Expand All @@ -16,6 +16,6 @@
<files>
<file src="..\tools\pact-win32\**" target="tools\pact-win32\" />
<file src="config.json" target="tools\pact-win32\config.json" />
<file src="PactNet-Windows.targets" target="build\PactNet-Windows.targets" />
<file src="PactNet.Windows.targets" target="build\PactNet.Windows.targets" />
</files>
</package>
</package>
File renamed without changes.
18 changes: 9 additions & 9 deletions PactNet/Core/PactCoreHost.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,37 +16,37 @@ internal class PactCoreHost<T> : 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
{
Expand Down Expand Up @@ -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;
}
}
}
}
4 changes: 2 additions & 2 deletions PactNet/PactNet.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<licenseUrl>https://github.com/SEEK-Jobs/pact-net/blob/master/LICENSE.txt</licenseUrl>
<projectUrl>https://github.com/SEEK-Jobs/pact-net</projectUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>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.</description>
<description>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.</description>
<dependencies>
<group targetFramework="net45">
<dependency id="Newtonsoft.Json" version="10.0.3" />
Expand All @@ -34,4 +34,4 @@
<file src="bin\Release\net45\PactNet.xml" target="lib\net45" />
<file src="readme.txt" target="" />
</files>
</package>
</package>
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 5cdf7cb

Please sign in to comment.