Skip to content

Commit

Permalink
Merge branch 'v/2.3'
Browse files Browse the repository at this point in the history
  • Loading branch information
dwmkerr committed Apr 1, 2014
2 parents 95ce3f4 + 802e78a commit 972260b
Show file tree
Hide file tree
Showing 137 changed files with 5,461 additions and 3,279 deletions.
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright (c) 2014 Dave Kerr

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
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>
59 changes: 41 additions & 18 deletions release/BuildRelease.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -7,27 +7,28 @@ if ((Test-Path $msbuild) -eq $false) {

# Load useful functions.
. .\Resources\PowershellFunctions.ps1
. .\Resources\VsixTools.ps1

# Keep track of the 'release' folder location - it's the root of everything else.
# We can also build paths to the key locations we'll use.
$scriptParentPath = Split-Path -parent $MyInvocation.MyCommand.Definition
$folderReleaseRoot = $scriptParentPath
$folderSourceRoot = Split-Path -parent $folderReleaseRoot
$folderSolutionsRoot = Join-Path $folderSourceRoot "source\SharpGL"
$folderSharpGLRoot = Join-Path $folderSourceRoot "source\SharpGL"
$folderNuspecRoot = Join-Path $folderSourceRoot "build\nuspec"

# Part 1 - Build the core libraries.
Write-Host "Preparing to build the core libraries..."
$solutionCoreLibraries = Join-Path $folderSolutionsRoot "SharpGL.sln"
$solutionCoreLibraries = Join-Path $folderSharpGLRoot "SharpGL.sln"
. $msbuild $solutionCoreLibraries /p:Configuration=Release /verbosity:minimal

# Part 2 - Get the version number of the SharpGL core library, use this to build the destination release folder.
$folderBinariesSharpGL = Join-Path $folderSolutionsRoot "Core\SharpGL\bin\Release"
$folderBinariesSharpGLSceneGraph = Join-Path $folderSolutionsRoot "Core\SharpGL.SceneGraph\bin\Release"
$folderBinariesSharpGLSerialization = Join-Path $folderSolutionsRoot "Core\SharpGL.Serialization\bin\Release"
$folderBinariesSharpGLWinForms = Join-Path $folderSolutionsRoot "Core\SharpGL.WinForms\bin\Release"
$folderBinariesSharpGLWPF = Join-Path $folderSolutionsRoot "Core\SharpGL.WPF\bin\Release"
$releaseVersion = [Reflection.Assembly]::LoadFile((Join-Path $folderBinariesSharpGL "SharpGL.dll")).GetName().Version
$folderBinariesSharpGL = Join-Path $folderSharpGLRoot "Core\SharpGL\bin\Release"
$folderBinariesSharpGLSceneGraph = Join-Path $folderSharpGLRoot "Core\SharpGL.SceneGraph\bin\Release"
$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.ToString()
Write-Host "Built Core Libraries. Release Version: $releaseVersion"

# Part 3 - Copy the core libraries to the release.
Expand All @@ -42,13 +43,13 @@ CopyItems (Join-Path $folderBinariesSharpGLWPF "*.*") (Join-Path $folderReleaseC

# Part 4 - Build the Samples
Write-Host "Preparing to build the samples..."
$solutionSamples = Join-Path $folderSolutionsRoot "Samples.sln"
$solutionSamples = Join-Path $folderSharpGLRoot "Samples.sln"
. $msbuild $solutionSamples /p:Configuration=Release /verbosity:quiet

# Part 5 - Copy the samples to the release.
$folderReleaseSamples = Join-Path $folderRelease "Samples"
EnsureEmptyFolderExists($folderReleaseSamples)
$releaseFolders = gci (Join-Path $folderSolutionsRoot "Samples") -Recurse -Directory -filter "Release" | select FullName
$releaseFolders = gci (Join-Path $folderSharpGLRoot "Samples") -Recurse -Directory -filter "Release" | select FullName
$releaseFolders | ForEach {
$releaseFolder = $_.FullName
$sampleName = (Get-Item (Split-Path -parent (Split-Path -parent $releaseFolder))).Name
Expand All @@ -59,13 +60,13 @@ Write-Host "Built samples."

# Part 6 - Build the Tools
Write-Host "Preparing to build the tools..."
$solutionTools = Join-Path $folderSolutionsRoot "Tools.sln"
$solutionTools = Join-Path $folderSharpGLRoot "Tools.sln"
. $msbuild $solutionTools /p:Configuration=Release /verbosity:quiet

# Part 7 - Copy the tools to the release.
$folderReleaseTools = Join-Path $folderRelease "Tools"
EnsureEmptyFolderExists($folderReleaseTools)
$releaseFolders = gci (Join-Path $folderSolutionsRoot "Tools") -Recurse -Directory -filter "Release" | select FullName
$releaseFolders = gci (Join-Path $folderSharpGLRoot "Tools") -Recurse -Directory -filter "Release" | select FullName
$releaseFolders | ForEach {
$releaseFolder = $_.FullName
$toolName = (Get-Item (Split-Path -parent (Split-Path -parent $releaseFolder))).Name
Expand All @@ -76,7 +77,7 @@ Write-Host "Built tools."

# Part 8 - Move the core libraries to the dependencies folders of the extensions, then build the extensions.
Write-Host "Preparing to build the extensions..."
$folderExtensionsRoot = Join-Path $folderSolutionsRoot "Extensions"
$folderExtensionsRoot = Join-Path $folderSourceRoot "source\Extensions"
$dllSharpGL = Join-Path $folderReleaseCore "SharpGL\SharpGL.dll"
$dllSharpGLSceneGraph = Join-Path $folderReleaseCore "SharpGL.SceneGraph\SharpGL.SceneGraph.dll"
$dllSharpGLWPF = Join-Path $folderReleaseCore "SharpGL.WPF\SharpGL.WPF.dll"
Expand All @@ -86,6 +87,10 @@ Copy-Item $dllSharpGL -Destination (Join-Path $folderExtensionsRoot "WinformsTem
Copy-Item $dllSharpGLSceneGraph -Destination (Join-Path $folderExtensionsRoot "WinformsTemplate\Dependencies")
Copy-Item $dllSharpGLWinForms -Destination (Join-Path $folderExtensionsRoot "WinformsTemplate\Dependencies")

Copy-Item $dllSharpGL -Destination (Join-Path $folderExtensionsRoot "WinformsTemplateProject.2010\Dependencies")
Copy-Item $dllSharpGLSceneGraph -Destination (Join-Path $folderExtensionsRoot "WinformsTemplateProject.2010\Dependencies")
Copy-Item $dllSharpGLWinForms -Destination (Join-Path $folderExtensionsRoot "WinformsTemplateProject.2010\Dependencies")

Copy-Item $dllSharpGL -Destination (Join-Path $folderExtensionsRoot "WinformsTemplateProject\Dependencies")
Copy-Item $dllSharpGLSceneGraph -Destination (Join-Path $folderExtensionsRoot "WinformsTemplateProject\Dependencies")
Copy-Item $dllSharpGLWinForms -Destination (Join-Path $folderExtensionsRoot "WinformsTemplateProject\Dependencies")
Expand All @@ -94,18 +99,31 @@ Copy-Item $dllSharpGL -Destination (Join-Path $folderExtensionsRoot "WpfTemplate
Copy-Item $dllSharpGLSceneGraph -Destination (Join-Path $folderExtensionsRoot "WpfTemplate\Dependencies")
Copy-Item $dllSharpGLWPF -Destination (Join-Path $folderExtensionsRoot "WpfTemplate\Dependencies")

Copy-Item $dllSharpGL -Destination (Join-Path $folderExtensionsRoot "WpfTemplateProject.2010\Dependencies")
Copy-Item $dllSharpGLSceneGraph -Destination (Join-Path $folderExtensionsRoot "WpfTemplateProject.2010\Dependencies")
Copy-Item $dllSharpGLWPF -Destination (Join-Path $folderExtensionsRoot "WpfTemplateProject.2010\Dependencies")

Copy-Item $dllSharpGL -Destination (Join-Path $folderExtensionsRoot "WpfTemplateProject\Dependencies")
Copy-Item $dllSharpGLSceneGraph -Destination (Join-Path $folderExtensionsRoot "WpfTemplateProject\Dependencies")
Copy-Item $dllSharpGLWPF -Destination (Join-Path $folderExtensionsRoot "WpfTemplateProject\Dependencies")

$solutionExtensions = Join-Path $folderSolutionsRoot "Extensions.sln"
$solutionExtensions2010 = Join-Path $folderExtensionsRoot "Extensions.2010.sln"
. $msbuild $solutionExtensions2010 /p:Configuration=Release /verbosity:quiet
$solutionExtensions = Join-Path $folderExtensionsRoot "Extensions.sln"
. $msbuild $solutionExtensions /p:Configuration=Release /verbosity:quiet

# Part 9 - Copy the extensions to the release.
$folderReleaseExtensions = Join-Path $folderRelease "Extensions"
EnsureEmptyFolderExists($folderReleaseExtensions)
CopyItems (Join-Path $folderExtensionsRoot "SharpGL.2010\bin\Release\SharpGL.2010.vsix") $folderReleaseExtensions
CopyItems (Join-Path $folderExtensionsRoot "SharpGL\bin\Release\SharpGL.vsix") $folderReleaseExtensions
Write-Host "Built extensions."
Write-Host "Built extensions, updating VSIX files for the Visual Studio Gallery..."

# Now use vsix tools to tweak the extensions.
Vsix-SetVersion -VsixPath (Join-Path $folderReleaseExtensions "SharpGL.2010.vsix") -Version $releaseVersion
Vsix-SetVersion -VsixPath (Join-Path $folderReleaseExtensions "SharpGL.vsix") -Version $releaseVersion
Vsix-FixInvalidMultipleFiles -VsixPath (Join-Path $folderReleaseExtensions "SharpGL.2010.vsix")
Vsix-FixInvalidMultipleFiles -VsixPath (Join-Path $folderReleaseExtensions "SharpGL.vsix")

# Part 10 - Build the Nuget Packages
Write-Host "Preparing to build the Nuget Packages..."
Expand All @@ -114,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)
}
Loading

0 comments on commit 972260b

Please sign in to comment.