-
Notifications
You must be signed in to change notification settings - Fork 255
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Issue #24 - First attempt at common version
- This is the first attempt to use a common version number for all projects, msi, and nuget packages. Won't be able to test this properly until all tests pass. - Updated gitignore file to not check in BuildArtefacts - Updated projects to use CommonAssemblyVersion and CommonWixInfo files - Added psake build scripts - Added build.bat file that will be used by MyGet Build Services
- Loading branch information
Showing
14 changed files
with
425 additions
and
355 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,4 +9,5 @@ _ReSharper.* | |
*.vspcc | ||
*.vscc | ||
*.vssscc | ||
*ncrunch* | ||
*ncrunch* | ||
BuildArtifacts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
param ( | ||
[string]$Action="default", | ||
[switch]$Help | ||
) | ||
$here = "$(Split-Path -parent $MyInvocation.MyCommand.Definition)" | ||
|
||
if($Help){ | ||
try { | ||
Get-Help "$($MyInvocation.MyCommand.Definition)" -full | Out-Host -paging | ||
Write-Host "Available build tasks:" | ||
psake -nologo -docs | Out-Host -paging | ||
} catch {} | ||
return | ||
} | ||
|
||
psake "$here/default.ps1" $Action |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
$psake.use_exit_on_error = $true | ||
properties { | ||
$baseDir = (Split-Path -parent $psake.build_script_dir) | ||
#$versionTag = git describe --abbrev=0 --tags | ||
#$version = $versionTag + "." | ||
#$version += (git log $($version + '..') --pretty=oneline | measure-object).Count | ||
$version = "0.1.5" | ||
$nugetExe = "$env:ChocolateyInstall\ChocolateyInstall\nuget" | ||
$assemblyVersionPattern = 'AssemblyVersion\("[0-9]+(\.([0-9]+|\*)){1,3}"\)' | ||
$assemblyVersion = 'AssemblyVersion("' + $version + '")' | ||
$wixVersionPattern = 'VersionNumber="[0-9]+(\.([0-9]+|\*)){1,3}"' | ||
$wivVersion = 'VersionNumber="' + $version + '"' | ||
} | ||
|
||
Task default -depends Build | ||
Task Build -depends Package -description 'Versions and packages' | ||
Task Package -depends Version-Files, Build-Solution, Pack-Nuget -description 'Versions the CommonAssemblyInfo and WiX files, builds the solution, and packs the msi' | ||
|
||
Task Version-Files -description 'Stamps the common file with the version' { | ||
(Get-Content "$baseDir\SharedSource\Common\CommonAssemblyVersion.cs") | % {$_ -replace $assemblyVersionPattern, $assemblyVersion } | Set-Content "$baseDir\SharedSource\Common\CommonAssemblyVersion.cs" | ||
(Get-Content "$baseDir\SharedSource\Common\CommonWixInfo.wxi") | % {$_ -replace $wixVersionPattern, $wivVersion } | Set-Content "$baseDir\SharedSource\Common\CommonWixInfo.wxi" | ||
} | ||
|
||
Task Build-Solution -description 'Builds the main solution for the package' { | ||
exec { msbuild "$baseDir\Chocolatey Explorer\Chocolatey Explorer.sln" } | ||
} | ||
|
||
|
||
Task Pack-Nuget -description 'Packs the module and example package' { | ||
if (Test-Path "$baseDir\BuildArtifacts") { | ||
Remove-Item "$baseDir\BuildArtifacts" -Recurse -Force | ||
} | ||
if (Test-Path "$baseDir\buildPackages\*.nupkg") { | ||
Remove-Item "$baseDir\buildPackages\*.nupkg" -Force | ||
} | ||
|
||
mkdir "$baseDir\BuildArtifacts" | ||
exec { .$nugetExe pack "$baseDir\ChocolateyPackage\ChocolateyGUI\ChocolateyGUI.nuspec" -OutputDirectory "$baseDir\BuildArtifacts" -NoPackageAnalysis -version $version } | ||
} |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,60 +1,65 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
<PropertyGroup> | ||
<WIXRoot>SharedBinaries\WiX\Current\</WIXRoot> | ||
<WIX Condition="'$(SolutionRoot)' == ''">.\..\$(WIXRoot)</WIX> | ||
<WIX Condition="'$(SolutionRoot)' != ''">$(SolutionRoot)\$(WIXRoot)</WIX> | ||
<WixTargetsPath Condition="'$(WixTargetsPath)' == ''">$(WIX)Wix.targets</WixTargetsPath> | ||
<WixCATargetsPath Condition="'$(WixCATargetsPath)' == ''">$(WIX)Wix.ca.targets</WixCATargetsPath> | ||
<WixToolPath Condition="'$(WixToolPath)' == ''">$(WIX)tools\</WixToolPath> | ||
<!-- Relative to the targets file that defines the UsingTask element is defined --> | ||
<WixTasksPath>tools\WixTasks.dll</WixTasksPath> | ||
</PropertyGroup> | ||
<PropertyGroup> | ||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> | ||
<Platform Condition=" '$(Platform)' == '' ">x86</Platform> | ||
<ProductVersion>3.7</ProductVersion> | ||
<ProjectGuid>1772c1e5-8896-4e28-933a-9413eb588a82</ProjectGuid> | ||
<SchemaVersion>2.0</SchemaVersion> | ||
<OutputName>Setup_ChocolateyGUI</OutputName> | ||
<OutputType>Package</OutputType> | ||
</PropertyGroup> | ||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' "> | ||
<OutputPath>bin\$(Configuration)\</OutputPath> | ||
<IntermediateOutputPath>obj\$(Configuration)\</IntermediateOutputPath> | ||
<DefineConstants>Debug</DefineConstants> | ||
</PropertyGroup> | ||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' "> | ||
<OutputPath>..\ChocolateyPackage\ChocolateyGUI\tools\</OutputPath> | ||
<IntermediateOutputPath>obj\$(Configuration)\</IntermediateOutputPath> | ||
<SuppressPdbOutput>True</SuppressPdbOutput> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<Compile Include="Product.wxs" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<ProjectReference Include="..\Chocolatey Explorer\Chocolatey.Explorer.csproj"> | ||
<Name>Chocolatey.Explorer</Name> | ||
<Project>{44d4bf09-b14f-4241-9cb7-02b26027f4ab}</Project> | ||
<Private>True</Private> | ||
<DoNotHarvest>True</DoNotHarvest> | ||
<RefProjectOutputGroups>Binaries;Content;Satellites</RefProjectOutputGroups> | ||
<RefTargetDir>INSTALLFOLDER</RefTargetDir> | ||
</ProjectReference> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<WixExtension Include="WixNetFxExtension"> | ||
<HintPath>$(WixExtDir)\WixNetFxExtension.dll</HintPath> | ||
<Name>WixNetFxExtension</Name> | ||
</WixExtension> | ||
</ItemGroup> | ||
<Import Project="$(WixTargetsPath)" /> | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
<PropertyGroup> | ||
<WIXRoot>SharedBinaries\WiX\Current\</WIXRoot> | ||
<WIX Condition="'$(SolutionRoot)' == ''">.\..\$(WIXRoot)</WIX> | ||
<WIX Condition="'$(SolutionRoot)' != ''">$(SolutionRoot)\$(WIXRoot)</WIX> | ||
<WixTargetsPath Condition="'$(WixTargetsPath)' == ''">$(WIX)Wix.targets</WixTargetsPath> | ||
<WixCATargetsPath Condition="'$(WixCATargetsPath)' == ''">$(WIX)Wix.ca.targets</WixCATargetsPath> | ||
<WixToolPath Condition="'$(WixToolPath)' == ''">$(WIX)tools\</WixToolPath> | ||
<!-- Relative to the targets file that defines the UsingTask element is defined --> | ||
<WixTasksPath>tools\WixTasks.dll</WixTasksPath> | ||
</PropertyGroup> | ||
<PropertyGroup> | ||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> | ||
<Platform Condition=" '$(Platform)' == '' ">x86</Platform> | ||
<ProductVersion>3.7</ProductVersion> | ||
<ProjectGuid>1772c1e5-8896-4e28-933a-9413eb588a82</ProjectGuid> | ||
<SchemaVersion>2.0</SchemaVersion> | ||
<OutputName>Setup_ChocolateyGUI</OutputName> | ||
<OutputType>Package</OutputType> | ||
</PropertyGroup> | ||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' "> | ||
<OutputPath>..\ChocolateyPackage\ChocolateyGUI\tools\</OutputPath> | ||
<IntermediateOutputPath>obj\$(Configuration)\</IntermediateOutputPath> | ||
<DefineConstants>Debug</DefineConstants> | ||
</PropertyGroup> | ||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' "> | ||
<OutputPath>..\ChocolateyPackage\ChocolateyGUI\tools\</OutputPath> | ||
<IntermediateOutputPath>obj\$(Configuration)\</IntermediateOutputPath> | ||
<SuppressPdbOutput>True</SuppressPdbOutput> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<Compile Include="Product.wxs" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<ProjectReference Include="..\Chocolatey Explorer\Chocolatey.Explorer.csproj"> | ||
<Name>Chocolatey.Explorer</Name> | ||
<Project>{44d4bf09-b14f-4241-9cb7-02b26027f4ab}</Project> | ||
<Private>True</Private> | ||
<DoNotHarvest>True</DoNotHarvest> | ||
<RefProjectOutputGroups>Binaries;Content;Satellites</RefProjectOutputGroups> | ||
<RefTargetDir>INSTALLFOLDER</RefTargetDir> | ||
</ProjectReference> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<WixExtension Include="WixNetFxExtension"> | ||
<HintPath>$(WixExtDir)\WixNetFxExtension.dll</HintPath> | ||
<Name>WixNetFxExtension</Name> | ||
</WixExtension> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<Content Include="..\SharedSource\Common\CommonWixInfo.wxi"> | ||
<Link>CommonWixInfo.wxi</Link> | ||
</Content> | ||
</ItemGroup> | ||
<Import Project="$(WixTargetsPath)" /> | ||
<!-- | ||
To modify your build process, add your task inside one of the targets below and uncomment it. | ||
Other similar extension points exist, see Wix.targets. | ||
<Target Name="BeforeBuild"> | ||
</Target> | ||
<Target Name="AfterBuild"> | ||
</Target> | ||
--> | ||
--> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
using System.Reflection; | ||
|
||
[assembly: AssemblyVersion("0.1.5")] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
using System.Reflection; | ||
|
||
[assembly: AssemblyConfiguration("")] | ||
[assembly: AssemblyCompany("Christiaan Baes ")] | ||
[assembly: AssemblyCopyright("Copyright © Christiaan Baes 2011")] | ||
[assembly: AssemblyTrademark("")] | ||
[assembly: AssemblyCulture("")] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Include> | ||
<?define VersionNumber="0.1.5" ?> | ||
<?define UpgradeCode="f8164f91-fa5c-4789-b68d-9beb5b146155" ?> | ||
<?define ProductName="ChocolateyGUI" ?> | ||
<?define Language="1033" ?> | ||
<?define Manufacturer="Baes Christiaan"?> | ||
</Include> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
@echo off | ||
|
||
if '%1'=='/?' goto help | ||
if '%1'=='-help' goto help | ||
if '%1'=='-h' goto help | ||
|
||
powershell -NoProfile -ExecutionPolicy bypass -Command "%~dp0buildscripts\build.ps1 %*" | ||
goto :eof | ||
|
||
:help | ||
powershell -NoProfile -ExecutionPolicy Bypass -Command "& '%~dp0buildscripts\build.ps1' -help" |