Skip to content

Commit

Permalink
Bumped to v2.2, created basic release script, built new release.
Browse files Browse the repository at this point in the history
  • Loading branch information
dwmkerr committed Nov 30, 2014
1 parent b3307c7 commit b709f11
Show file tree
Hide file tree
Showing 14 changed files with 136 additions and 3 deletions.
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,8 @@ SharpShell/.nuget
SharpShell/ipch/
*.sdf
*.opensdf
Build/Tools/ServerManager.vshost.exe.manifest
Build/Tools/ServerManager.vshost.exe.manifest
!Release/
Release/2.*
Release/nuspec/SharpShell/lib
Release/nuspec/SharpShellTools/lib
Binary file removed Build/Packages/SharpShell.1.9.0.nupkg
Binary file not shown.
Binary file removed Build/Packages/SharpShell.2.0.nupkg
Binary file not shown.
Binary file removed Build/Packages/SharpShell.2.1.nupkg
Binary file not shown.
Binary file removed Build/Packages/SharpShellTools.1.9.0.nupkg
Binary file not shown.
Binary file removed Build/Packages/SharpShellTools.2.0.0.nupkg
Binary file not shown.
Binary file removed Build/Packages/SharpShellTools.2.1.0.nupkg
Binary file not shown.
64 changes: 64 additions & 0 deletions Release/BuildRelease.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# IMPORTANT: Make sure that the path to msbuild is correct!
$msbuild = "C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe"
if ((Test-Path $msbuild) -eq $false) {
Write-Host "Cannot find msbuild at '$msbuild'."
Break
}

# Load useful functions.
. .\Resources\PowershellFunctions.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 "SharpShell"
$folderNuspecRoot = Join-Path $folderSourceRoot "release\nuspec"

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

# Part 2 - Get the version number of the core library, use this to build the destination release folder.
$folderBuild = Join-Path $folderSourceRoot "Build"
$releaseVersion = [Reflection.Assembly]::LoadFile((Join-Path $folderBuild "Core\SharpShell.dll")).GetName().Version
Write-Host "Built SharpShell. Release Version: $releaseVersion"

# Part 3 - Copy the core, tools and samples to the release.
$folderRelease = Join-Path $folderReleaseRoot $releaseVersion
Copy-Item "$folderBuild\Core" "$folderRelease\Core" -Force -Recurse
Copy-Item "$folderBuild\Samples" "$folderRelease\Samples" -Force -Recurse
Copy-Item "$folderBuild\Tools" "$folderRelease\Tools" -Force -Recurse

# Part 4 - Build the SharpShell Nuget Package
Write-Host "Preparing to build the SharpShell Nuget Package..."
$folderReleasePackage = Join-Path $folderRelease "Package"
EnsureEmptyFolderExists $folderReleasePackage
$nuget = Join-Path $scriptParentPath "Resources\nuget.exe"
CopyItems (Join-Path "$folderRelease\Core" "*.*") (Join-Path $folderNuspecRoot "SharpShell\lib\net40")
. $nuget pack (Join-Path $folderNuspecRoot "SharpShell\SharpShell.nuspec") -Version $releaseVersion -OutputDirectory $folderReleasePackage
$packagePath = (Join-Path $folderReleasePackage "SharpShell.$releaseVersion.nupkg")

# Part 5 - Build the SharpShell Tools Nuget Package
Write-Host "Preparing to build the SharpShell Tools Nuget Package..."
CopyItems (Join-Path "$folderRelease\Tools" "*.*") (Join-Path $folderNuspecRoot "SharpShellTools\lib")
. $nuget pack (Join-Path $folderNuspecRoot "SharpShellTools\SharpShellTools.nuspec") -Version $releaseVersion -OutputDirectory $folderReleasePackage
$packagePathTools = (Join-Path $folderReleasePackage "SharpShell.$releaseVersion.nupkg")

# Part 6 - Zip up the Core.
# TODO

# Part 7 - Zip up the Server Manager.
# TODO

# Part 8 - Zip up the SRM.
# TODO

# We're done!
Write-Host "Successfully built version: $releaseVersion"

# If the user wants, we can also publish.
# . $nuget push $packagePath
# . $nuget push $packagePathTools
25 changes: 25 additions & 0 deletions Release/Resources/PowershellFunctions.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Copy items to a destination folder, creating the folder if needed.
function CopyItems($source, $destinationFolder) {

# Create the any folders or subfolders up to the destination that don't exist.
EnsureFolderExists($destinationFolder)

# Now copy the items.
Copy-Item $source -Destination $destinationFolder
}

# Ensures that a folder exists.
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
}
}

# Ensures that a folder exists and deletes anything in it.
function EnsureEmptyFolderExists($folder) {
EnsureFolderExists($folder)
Remove-Item -Recurse -Force $folder
EnsureFolderExists($folder)
}
Binary file added Release/Resources/nuget.exe
Binary file not shown.
20 changes: 20 additions & 0 deletions Release/nuspec/SharpShell/SharpShell.nuspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
<metadata>
<id>SharpShell</id>
<version>2.2</version>
<title>SharpShell</title>
<authors>Dave Kerr</authors>
<owners>Dave Kerr</owners>
<projectUrl>https://github.com/dwmkerr/sharpshell</projectUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>SharpShell is a framework that lets you build Windows Shell Extensions using the .NET Framework.</description>
<summary>SharpShell is a framework that lets you build Windows Shell Extensions using the .NET Framework.</summary>
<copyright>Copyright © Dave Kerr 2014</copyright>
<tags>Shell,SharpShell,COM,Context Menu,Icon Handler</tags>
<frameworkAssemblies>
<frameworkAssembly assemblyName="System.Windows.Forms" targetFramework="" />
<frameworkAssembly assemblyName="System.Drawing" targetFramework="" />
</frameworkAssemblies>
</metadata>
</package>
20 changes: 20 additions & 0 deletions Release/nuspec/SharpShellTools/SharpShellTools.nuspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
<metadata>
<id>SharpShellTools</id>
<version>2.2.0.0</version>
<title>SharpShell Tools</title>
<authors>Dave Kerr</authors>
<owners>Dave Kerr</owners>
<projectUrl>https://github.com/dwmkerr/sharpshell</projectUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>SharpShell is a framework that lets you build Windows Shell Extensions using the .NET Framework. The SharpShell Tools are a set of tools for working with these extensions.</description>
<summary>SharpShell is a framework that lets you build Windows Shell Extensions using the .NET Framework. The SharpShell Tools are a set of tools for working with these extensions.</summary>
<copyright>Copyright © Dave Kerr 2014</copyright>
<tags>Shell,SharpShell,COM,Context Menu,Icon Handler</tags>
<frameworkAssemblies>
<frameworkAssembly assemblyName="System.Windows.Forms" targetFramework="" />
<frameworkAssembly assemblyName="System.Drawing" targetFramework="" />
</frameworkAssemblies>
</metadata>
</package>
4 changes: 2 additions & 2 deletions SharpShell/SharedAssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,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.1.0.0")]
[assembly: AssemblyFileVersion("2.1.0.0")]
[assembly: AssemblyVersion("2.2.0.0")]
[assembly: AssemblyFileVersion("2.2.0.0")]
Binary file not shown.

0 comments on commit b709f11

Please sign in to comment.