diff --git a/.gitignore b/.gitignore index ec08cf361..4f26b49cd 100644 --- a/.gitignore +++ b/.gitignore @@ -9,4 +9,5 @@ _ReSharper.* *.vspcc *.vscc *.vssscc -*ncrunch* \ No newline at end of file +*ncrunch* +BuildArtifacts \ No newline at end of file diff --git a/BuildScripts/build.ps1 b/BuildScripts/build.ps1 new file mode 100644 index 000000000..5c4424675 --- /dev/null +++ b/BuildScripts/build.ps1 @@ -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 \ No newline at end of file diff --git a/BuildScripts/default.ps1 b/BuildScripts/default.ps1 new file mode 100644 index 000000000..53a2919f3 --- /dev/null +++ b/BuildScripts/default.ps1 @@ -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 } +} \ No newline at end of file diff --git a/Chocolatey Explorer/Chocolatey.Explorer.csproj b/Chocolatey Explorer/Chocolatey.Explorer.csproj index 8c97bcab2..7040b7375 100644 --- a/Chocolatey Explorer/Chocolatey.Explorer.csproj +++ b/Chocolatey Explorer/Chocolatey.Explorer.csproj @@ -1,269 +1,275 @@ - - - - Debug - x86 - 8.0.30703 - 2.0 - {44D4BF09-B14F-4241-9CB7-02B26027F4AB} - WinExe - Properties - Chocolatey.Explorer - ChocolateyGUI - v4.0 - - - 512 - publish\ - true - Disk - false - Foreground - 7 - Days - false - false - true - 0 - 1.0.0.%2a - false - false - true - - - x86 - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - x86 - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - true - bin\Debug\ - DEBUG;TRACE - full - AnyCPU - bin\Debug\Chocolatey.Explorer.exe.CodeAnalysisLog.xml - true - GlobalSuppressions.cs - prompt - MinimumRecommendedRules.ruleset - ;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\\Rule Sets - false - ;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules - true - - - bin\Release\ - TRACE - true - pdbonly - AnyCPU - bin\Release\Chocolatey.Explorer.exe.CodeAnalysisLog.xml - true - GlobalSuppressions.cs - prompt - MinimumRecommendedRules.ruleset - ;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\\Rule Sets - false - ;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules - true - - - chocolateyicon.ico - - - - packages\log4net.1.2.10\lib\2.0\log4net.dll - - - False - packages\structuremap.2.6.4.1\lib\net40\StructureMap.dll - - - - - False - ..\..\..\..\..\Program Files (x86)\Reference Assemblies\Microsoft\WindowsPowerShell\v1.0\System.Management.Automation.dll - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - True - True - strings.resx - - - Form - - - About.cs - - - Form - - - Help.cs - - - - Form - - - PackageManager.cs - - - Form - - - Settings.cs - - - UserControl - - - PackageVersionPanel.cs - - - ResXFileCodeGenerator - Resources.Designer.cs - Designer - - - True - Resources.resx - True - - - ResXFileCodeGenerator - strings.Designer.cs - Designer - - - About.cs - - - Help.cs - - - PackageManager.cs - - - Settings.cs - - - PackageVersionPanel.cs - - - - Always - - - - SettingsSingleFileGenerator - Settings.Designer.cs - - - True - Settings.settings - True - - - - - - - - - - - - - - - - - - - Always - - - - - False - Microsoft .NET Framework 4 %28x86 und x64%29 - true - - - False - .NET Framework 3.5 SP1 Client Profile - false - - - False - .NET Framework 3.5 SP1 - false - - - False - Windows Installer 3.1 - true - - - + + + + Debug + x86 + 8.0.30703 + 2.0 + {44D4BF09-B14F-4241-9CB7-02B26027F4AB} + WinExe + Properties + Chocolatey.Explorer + ChocolateyGUI + v4.0 + + + 512 + publish\ + true + Disk + false + Foreground + 7 + Days + false + false + true + 0 + 1.0.0.%2a + false + false + true + + + x86 + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + x86 + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + true + bin\Debug\ + DEBUG;TRACE + full + AnyCPU + bin\Debug\Chocolatey.Explorer.exe.CodeAnalysisLog.xml + true + GlobalSuppressions.cs + prompt + MinimumRecommendedRules.ruleset + ;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\\Rule Sets + false + ;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules + true + + + bin\Release\ + TRACE + true + pdbonly + AnyCPU + bin\Release\Chocolatey.Explorer.exe.CodeAnalysisLog.xml + true + GlobalSuppressions.cs + prompt + MinimumRecommendedRules.ruleset + ;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\\Rule Sets + false + ;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules + true + + + chocolateyicon.ico + + + + packages\log4net.1.2.10\lib\2.0\log4net.dll + + + False + packages\structuremap.2.6.4.1\lib\net40\StructureMap.dll + + + + + False + ..\..\..\..\..\Program Files (x86)\Reference Assemblies\Microsoft\WindowsPowerShell\v1.0\System.Management.Automation.dll + + + + + + + + + + + + + + Properties\CommonAssemblyVersion.cs + + + Properties\CommonCopyrightInfo.cs + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + True + True + strings.resx + + + Form + + + About.cs + + + Form + + + Help.cs + + + + Form + + + PackageManager.cs + + + Form + + + Settings.cs + + + UserControl + + + PackageVersionPanel.cs + + + ResXFileCodeGenerator + Resources.Designer.cs + Designer + + + True + Resources.resx + True + + + ResXFileCodeGenerator + strings.Designer.cs + Designer + + + About.cs + + + Help.cs + + + PackageManager.cs + + + Settings.cs + + + PackageVersionPanel.cs + + + + Always + + + + SettingsSingleFileGenerator + Settings.Designer.cs + + + True + Settings.settings + True + + + + + + + + + + + + + + + + + + + Always + + + + + False + Microsoft .NET Framework 4 %28x86 und x64%29 + true + + + False + .NET Framework 3.5 SP1 Client Profile + false + + + False + .NET Framework 3.5 SP1 + false + + + False + Windows Installer 3.1 + true + + + + --> \ No newline at end of file diff --git a/Chocolatey Explorer/Properties/AssemblyInfo.cs b/Chocolatey Explorer/Properties/AssemblyInfo.cs index ede53e40d..6336b0689 100644 --- a/Chocolatey Explorer/Properties/AssemblyInfo.cs +++ b/Chocolatey Explorer/Properties/AssemblyInfo.cs @@ -1,18 +1,12 @@ using System.Reflection; -using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("ChocolateyGUI")] -[assembly: AssemblyDescription("GUI for chocolatey")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("Christiaan Baes ")] +[assembly: AssemblyDescription("GUI for chocolatey")] [assembly: AssemblyProduct("ChocolateyGUI")] -[assembly: AssemblyCopyright("Copyright © Christiaan Baes 2011")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from @@ -22,15 +16,4 @@ // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("37cbac12-c5b9-42be-8b8d-777bcd3347d4")] -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// 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("0.0.6.*")] -[assembly: AssemblyFileVersion("0.0.6.*")] +[assembly: AssemblyFileVersion("1.0.0")] \ No newline at end of file diff --git a/Chocolatey.Explorer.Test/Chocolatey.Explorer.Test.csproj b/Chocolatey.Explorer.Test/Chocolatey.Explorer.Test.csproj index f12fb742c..753016b70 100644 --- a/Chocolatey.Explorer.Test/Chocolatey.Explorer.Test.csproj +++ b/Chocolatey.Explorer.Test/Chocolatey.Explorer.Test.csproj @@ -88,6 +88,12 @@ + + CommonAssemblyVersion.cs + + + CommonCopyrightInfo.cs + diff --git a/Chocolatey.Explorer.Test/Properties/AssemblyInfo.cs b/Chocolatey.Explorer.Test/Properties/AssemblyInfo.cs index 891acf2d5..8df45641b 100644 --- a/Chocolatey.Explorer.Test/Properties/AssemblyInfo.cs +++ b/Chocolatey.Explorer.Test/Properties/AssemblyInfo.cs @@ -1,18 +1,12 @@ using System.Reflection; -using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("Chocolatey.Explorer.Test")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("Microsoft")] +[assembly: AssemblyDescription("")] [assembly: AssemblyProduct("Chocolatey.Explorer.Test")] -[assembly: AssemblyCopyright("Copyright © Microsoft 2011")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from @@ -22,15 +16,4 @@ // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("2c9b0b00-9658-4f5f-aecd-c455dbd0752c")] -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// 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("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0")] \ No newline at end of file diff --git a/ChocolateyPackage/ChocolateyGUI/ChocolateyGUI.nuspec b/ChocolateyPackage/ChocolateyGUI/ChocolateyGUI.nuspec index 245686d14..d8e2b306b 100644 --- a/ChocolateyPackage/ChocolateyGUI/ChocolateyGUI.nuspec +++ b/ChocolateyPackage/ChocolateyGUI/ChocolateyGUI.nuspec @@ -2,7 +2,7 @@ ChocolateyGUI - 0.1.4 + $version$ ChocolateyGUI Christiaan Baes Christiaan Baes diff --git a/Setup_ChocolateyGUI/Product.wxs b/Setup_ChocolateyGUI/Product.wxs index 20895df39..79a71d68e 100644 --- a/Setup_ChocolateyGUI/Product.wxs +++ b/Setup_ChocolateyGUI/Product.wxs @@ -1,6 +1,8 @@ - + + + diff --git a/Setup_ChocolateyGUI/Setup_ChocolateyGUI.wixproj b/Setup_ChocolateyGUI/Setup_ChocolateyGUI.wixproj index 14c28694a..c4791fdad 100644 --- a/Setup_ChocolateyGUI/Setup_ChocolateyGUI.wixproj +++ b/Setup_ChocolateyGUI/Setup_ChocolateyGUI.wixproj @@ -1,54 +1,59 @@ - - - - SharedBinaries\WiX\Current\ - .\..\$(WIXRoot) - $(SolutionRoot)\$(WIXRoot) - $(WIX)Wix.targets - $(WIX)Wix.ca.targets - $(WIX)tools\ - - tools\WixTasks.dll - - - Debug - x86 - 3.7 - 1772c1e5-8896-4e28-933a-9413eb588a82 - 2.0 - Setup_ChocolateyGUI - Package - - - bin\$(Configuration)\ - obj\$(Configuration)\ - Debug - - - ..\ChocolateyPackage\ChocolateyGUI\tools\ - obj\$(Configuration)\ - True - - - - - - - Chocolatey.Explorer - {44d4bf09-b14f-4241-9cb7-02b26027f4ab} - True - True - Binaries;Content;Satellites - INSTALLFOLDER - - - - - $(WixExtDir)\WixNetFxExtension.dll - WixNetFxExtension - - - + + + + SharedBinaries\WiX\Current\ + .\..\$(WIXRoot) + $(SolutionRoot)\$(WIXRoot) + $(WIX)Wix.targets + $(WIX)Wix.ca.targets + $(WIX)tools\ + + tools\WixTasks.dll + + + Debug + x86 + 3.7 + 1772c1e5-8896-4e28-933a-9413eb588a82 + 2.0 + Setup_ChocolateyGUI + Package + + + ..\ChocolateyPackage\ChocolateyGUI\tools\ + obj\$(Configuration)\ + Debug + + + ..\ChocolateyPackage\ChocolateyGUI\tools\ + obj\$(Configuration)\ + True + + + + + + + Chocolatey.Explorer + {44d4bf09-b14f-4241-9cb7-02b26027f4ab} + True + True + Binaries;Content;Satellites + INSTALLFOLDER + + + + + $(WixExtDir)\WixNetFxExtension.dll + WixNetFxExtension + + + + + CommonWixInfo.wxi + + + + --> \ No newline at end of file diff --git a/SharedSource/Common/CommonAssemblyVersion.cs b/SharedSource/Common/CommonAssemblyVersion.cs new file mode 100644 index 000000000..b4e67cb24 --- /dev/null +++ b/SharedSource/Common/CommonAssemblyVersion.cs @@ -0,0 +1,3 @@ +using System.Reflection; + +[assembly: AssemblyVersion("0.1.5")] diff --git a/SharedSource/Common/CommonCopyrightInfo.cs b/SharedSource/Common/CommonCopyrightInfo.cs new file mode 100644 index 000000000..b9ded3867 --- /dev/null +++ b/SharedSource/Common/CommonCopyrightInfo.cs @@ -0,0 +1,7 @@ +using System.Reflection; + +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("Christiaan Baes ")] +[assembly: AssemblyCopyright("Copyright © Christiaan Baes 2011")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] \ No newline at end of file diff --git a/SharedSource/Common/CommonWixInfo.wxi b/SharedSource/Common/CommonWixInfo.wxi new file mode 100644 index 000000000..c627f5d73 --- /dev/null +++ b/SharedSource/Common/CommonWixInfo.wxi @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/build.bat b/build.bat new file mode 100644 index 000000000..da1cf5aff --- /dev/null +++ b/build.bat @@ -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" \ No newline at end of file