Skip to content

Commit

Permalink
Updated the scripts so that the nuget package dependencies are set co…
Browse files Browse the repository at this point in the history
…rrectly
  • Loading branch information
dwmkerr committed Apr 1, 2014
1 parent 85b3098 commit 802e78a
Show file tree
Hide file tree
Showing 5 changed files with 60 additions and 37 deletions.
30 changes: 15 additions & 15 deletions build/nuspec/SharpGLforWPF/SharpGLforWPF.nuspec
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
<metadata>
<id>SharpGLforWPF</id>
<version>2.1.0</version>
<title>SharpGL for WPF</title>
<authors>Dave Kerr</authors>
<owners />
<projectUrl>http://sharpgl.codeplex.com</projectUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>SharpGL wraps the popular OpenGL library. This package installs SharpGL and the WPF controls.</description>
<summary>SharpGL wraps the popular OpenGL library. This package installs SharpGL and the WPF controls.</summary>
<copyright>Copyright © Dave Kerr 2013</copyright>
<dependencies>
<dependency id="SharpGLCore" version="2.1.0" />
</dependencies>
</metadata>
<metadata>
<id>SharpGLforWPF</id>
<version>2.1.0</version>
<title>SharpGL for WPF</title>
<authors>Dave Kerr</authors>
<owners />
<projectUrl>http://sharpgl.codeplex.com</projectUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>SharpGL wraps the popular OpenGL library. This package installs SharpGL and the WPF controls.</description>
<summary>SharpGL wraps the popular OpenGL library. This package installs SharpGL and the WPF controls.</summary>
<copyright>Copyright © Dave Kerr 2013</copyright>
<dependencies>
<dependency id="SharpGLCore" version="2.3.0.1" />
</dependencies>
</metadata>
</package>
30 changes: 15 additions & 15 deletions build/nuspec/SharpGLforWinForms/SharpGLforWinForms.nuspec
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
<metadata>
<id>SharpGLforWinForms</id>
<version>2.1.0</version>
<title>SharpGL for WinForms</title>
<authors>Dave Kerr</authors>
<owners />
<projectUrl>http://sharpgl.codeplex.com</projectUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>SharpGL wraps the popular OpenGL library. This package installs SharpGL and the WinForms controls.</description>
<summary>SharpGL wraps the popular OpenGL library. This package installs SharpGL and the WinForms controls.</summary>
<copyright>Copyright © Dave Kerr 2013</copyright>
<dependencies>
<dependency id="SharpGLCore" version="2.1.0" />
</dependencies>
</metadata>
<metadata>
<id>SharpGLforWinForms</id>
<version>2.1.0</version>
<title>SharpGL for WinForms</title>
<authors>Dave Kerr</authors>
<owners />
<projectUrl>http://sharpgl.codeplex.com</projectUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>SharpGL wraps the popular OpenGL library. This package installs SharpGL and the WinForms controls.</description>
<summary>SharpGL wraps the popular OpenGL library. This package installs SharpGL and the WinForms controls.</summary>
<copyright>Copyright © Dave Kerr 2013</copyright>
<dependencies>
<dependency id="SharpGLCore" version="2.3.0.1" />
</dependencies>
</metadata>
</package>
13 changes: 9 additions & 4 deletions release/BuildRelease.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ $folderBinariesSharpGLSceneGraph = Join-Path $folderSharpGLRoot "Core\SharpGL.Sc
$folderBinariesSharpGLSerialization = Join-Path $folderSharpGLRoot "Core\SharpGL.Serialization\bin\Release"
$folderBinariesSharpGLWinForms = Join-Path $folderSharpGLRoot "Core\SharpGL.WinForms\bin\Release"
$folderBinariesSharpGLWPF = Join-Path $folderSharpGLRoot "Core\SharpGL.WPF\bin\Release"
$releaseVersion = [Reflection.Assembly]::LoadFile((Join-Path $folderBinariesSharpGL "SharpGL.dll")).GetName().Version
$releaseVersion = [Reflection.Assembly]::LoadFile((Join-Path $folderBinariesSharpGL "SharpGL.dll")).GetName().Version.ToString()
Write-Host "Built Core Libraries. Release Version: $releaseVersion"

# Part 3 - Copy the core libraries to the release.
Expand Down Expand Up @@ -132,13 +132,18 @@ EnsureEmptyFolderExists($folderReleasePackages)
$nuget = Join-Path $scriptParentPath "Resources\nuget.exe"

CopyItems (Join-Path $folderReleaseCore "SharpGL.SceneGraph\*.*") (Join-Path $folderNuspecRoot "SharpGLCore\lib\net40")
. $nuget pack (Join-Path $folderNuspecRoot "SharpGLCore\SharpGLCore.nuspec") -Version $releaseVersion -OutputDirectory $folderReleasePackages
$nuspecPath = (Join-Path $folderNuspecRoot "SharpGLCore\SharpGLCore.nuspec")
. $nuget pack $nuspecPath -Version $releaseVersion -OutputDirectory $folderReleasePackages

CopyItems (Join-Path $folderReleaseCore "SharpGL.WinForms\SharpGL.WinForms.*") (Join-Path $folderNuspecRoot "SharpGLforWinForms\lib\net40")
. $nuget pack (Join-Path $folderNuspecRoot "SharpGLforWinForms\SharpGLforWinForms.nuspec") -Version $releaseVersion -OutputDirectory $folderReleasePackages
$nuspecPath = (Join-Path $folderNuspecRoot "SharpGLforWinForms\SharpGLforWinForms.nuspec")
SetNuspecDependencyVersion $nuspecPath "SharpGLCore" $releaseVersion
. $nuget pack $nuspecPath -Version $releaseVersion -OutputDirectory $folderReleasePackages

CopyItems (Join-Path $folderReleaseCore "SharpGL.WPF\SharpGL.WPF.*") (Join-Path $folderNuspecRoot "SharpGLforWPF\lib\net40")
. $nuget pack (Join-Path $folderNuspecRoot "SharpGLforWPF\SharpGLforWPF.nuspec") -Version $releaseVersion -OutputDirectory $folderReleasePackages
$nuspecPath = (Join-Path $folderNuspecRoot "SharpGLforWPF\SharpGLforWPF.nuspec")
SetNuspecDependencyVersion $nuspecPath "SharpGLCore" $releaseVersion
. $nuget pack $nuspecPath -Version $releaseVersion -OutputDirectory $folderReleasePackages

# We're done!
Write-Host "Successfully built version: $releaseVersion"
20 changes: 19 additions & 1 deletion release/Resources/PowershellFunctions.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ function EnsureFolderExists($folder) {

# Create the any folders or subfolders up to the destination that don't exist.
if (!(Test-Path -path $folder)) {
New-Item $folder -Type Directory
New-Item $folder -Type Directory | Out-Null
}
}

Expand All @@ -22,4 +22,22 @@ function EnsureEmptyFolderExists($folder) {
EnsureFolderExists($folder)
Remove-Item -Recurse -Force $folder
EnsureFolderExists($folder)
}

# Sets the version of a dependency in a nuspec.
# e.g:
# SetNuspecDependencyVersion "SharpGLforWinForms.nuspec" "SharpGLCore" "2.3.0.1"
function SetNuspecDependencyVersion($nuspecPath, $dependencyId, $version) {

$nuspecXml = New-Object XML
$nuspecXml.Load($nuspecPath)

# Loop through the dependencies, looking for the one with the specfied id.
foreach($dependency in $nuspecXml.package.metadata.dependencies.ChildNodes) {
if($dependency.id -eq $dependencyId) {
$dependency.version = $version
}
}

$nuspecXml.Save($nuspecPath)
}
4 changes: 2 additions & 2 deletions source/SharpGL/SharedAssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2.3.0.0")]
[assembly: AssemblyFileVersion("2.3.0.0")]
[assembly: AssemblyVersion("2.3.0.1")]
[assembly: AssemblyFileVersion("2.3.0.1")]

0 comments on commit 802e78a

Please sign in to comment.