forked from Particular/NServiceBus
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The changes are the first step towards moving the build process to psake
1) Installing necessary packages 2) creating commonassembyinfo.cs Rest of the code to create some nuget packages is done but commented for the time being (They are tested localy and working fine)
- Loading branch information
Joseph Thomas
committed
Aug 22, 2011
1 parent
b1d9b57
commit 1ac4453
Showing
2 changed files
with
128 additions
and
40 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
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,49 +1,130 @@ | ||
task default -depends CreatePackage | ||
|
||
task CreatePackage -depends BuildOnNet35, BuildOnNet40 { | ||
import-module ./NuGet\packit.psm1 | ||
Write-Output "Loding the moduele for packing.............." | ||
$packit.push_to_nuget = $false | ||
|
||
#region Packing NserviceBusWithSymb | ||
$packit.package_description = "The most popular open-source service bus for .net" | ||
invoke-packit "NserviceBusWithSymb" "" @{log4net="1.2.10"} "NServiceBus.dll", "NServiceBus.Core.dll","NServiceBus.pdb","NServiceBus.Core.pdb" @{".\src\core\NServiceBus\*.cs"="src\core\NServiceBus";".\src\core\NServiceBus\Properties\*cs"="src\core\NServiceBus\Properties"} $true | ||
#endregion | ||
|
||
#region Packing NserviceBus | ||
$packit.package_description = "The most popular open-source service bus for .net" | ||
invoke-packit "NServiceBus" "" @{log4net="1.2.10"} "NServiceBus.dll", "NServiceBus.Core.dll","NServiceBus.pdb","NServiceBus.Core.pdb" @{".\src\core\NServiceBus\*.cs"="src\core\NServiceBus";".\src\core\NServiceBus\Properties\*cs"="src\core\NServiceBus\Properties"} | ||
#endregion | ||
properties { | ||
$productVersion = "5.0" | ||
$buildNumber = "0"; | ||
$versionFile = ".\version.txt" | ||
|
||
#region Packing NServiceBus.Host | ||
$packit.package_description = "The hosting template for the nservicebus, The most popular open-source service bus for .net" | ||
invoke-packit "NServiceBus.Host" "" @{NServiceBus="<version>"} "NServiceBus.Host.exe" | ||
#endregion | ||
|
||
#region Packing NServiceBus.Testing | ||
$packit.package_description = "The testing for the nservicebus, The most popular open-source service bus for .net" | ||
invoke-packit "NServiceBus.Testing" "" @{NServiceBus="<version>"} "NServiceBus.Testing.dll" | ||
#endregion | ||
} | ||
|
||
|
||
task default -depends CreatePackages | ||
|
||
|
||
task CreatePackages -depends InstallDependentPackages, GeneateCommonAssemblyInfo, BuildOnNet35, BuildOnNet40 { | ||
# import-module ./NuGet\packit.psm1 | ||
# Write-Output "Loding the moduele for packing.............." | ||
# $packit.push_to_nuget = $false | ||
# | ||
# | ||
# $packit.framework_Isolated_Binaries_Loc = ".\outdir\lib" | ||
# | ||
# $versionFileFullPath = Resolve-Path $versionFile | ||
# $productVersion = Get-Content $versionFileFullPath; | ||
# #Get Build number from TC | ||
# $buildNumber = 0 | ||
# if($env:BUILD_NUMBER -ne $null) { | ||
# $buildNumber = $env:BUILD_NUMBER | ||
# } | ||
# $productVersion = $productVersion + "." + $buildNumber | ||
# | ||
# #region Packing NserviceBus | ||
# $packit.package_description = "The most popular open-source service bus for .net" | ||
# invoke-packit "NServiceBus" $productVersion @{log4net="1.2.10"} "NServiceBus.dll", "NServiceBus.Core.dll","NServiceBus.pdb","NServiceBus.Core.pdb" @{".\src\core\NServiceBus\*.cs"="src\core\NServiceBus";".\src\core\NServiceBus\Properties\*cs"="src\core\NServiceBus\Properties"} | ||
# #endregion | ||
# | ||
# #region Packing NServiceBus.Host | ||
# $packit.package_description = "The hosting template for the nservicebus, The most popular open-source service bus for .net" | ||
# invoke-packit "NServiceBus.Host" $productVersion @{NServiceBus=$productVersion} "NServiceBus.Host.exe" | ||
# #endregion | ||
# | ||
# #region Packing NServiceBus.Testing | ||
# $packit.package_description = "The testing for the nservicebus, The most popular open-source service bus for .net" | ||
# invoke-packit "NServiceBus.Testing" $productVersion @{NServiceBus=$productVersion} "NServiceBus.Testing.dll" | ||
# #endregion | ||
|
||
#region Packing NServiceBus.Tools | ||
$packit.package_description = "The tools for configure the nservicebus, The most popular open-source service bus for .net" | ||
invoke-packit "NServiceBus.Tools" "" @{} "" @{".\tools\msmqutils\*.*"="tools\msmqutils";".\tools\RunMeFirst.bat"="tools";".\tools\install.ps1"="tools"} | ||
#endregion | ||
# #region Packing NServiceBus.Tools | ||
# $packit.package_description = "The tools for configure the nservicebus, The most popular open-source service bus for .net" | ||
# invoke-packit "NServiceBus.Tools" $version @{} "" @{".\tools\msmqutils\*.*"="tools\msmqutils";".\tools\RunMeFirst.bat"="tools";".\tools\install.ps1"="tools"} | ||
# #endregion | ||
|
||
#region Packing NServiceBus.Autofac2 | ||
$packit.package_description = "The Autofac Container for the nservicebus, The most popular open-source service bus for .net" | ||
invoke-packit "NServiceBus.Autofac2" "" @{Autofac="2.3.2.632"} "containers\autofac\NServiceBus.ObjectBuilder.Autofac.dll" | ||
#endregion | ||
# #region Packing NServiceBus.Autofac2 | ||
# $packit.package_description = "The Autofac Container for the nservicebus, The most popular open-source service bus for .net" | ||
# invoke-packit "NServiceBus.Autofac2" $productVersion @{Autofac="2.3.2.632"} "containers\autofac\NServiceBus.ObjectBuilder.Autofac.dll" | ||
# #endregion | ||
|
||
remove-module packit | ||
# remove-module packit | ||
} | ||
|
||
task BuildOnNet35 { | ||
.\tools\nant\nant.exe -D:targetframework=net-3.5 | ||
XCopy binaries\* build\lib\net35\ /S /Y | ||
# .\tools\nant\nant.exe -D:targetframework=net-3.5 | ||
# XCopy .\binaries\* .\outdir\lib\net35\ /S /Y | ||
} | ||
|
||
task BuildOnNet40 { | ||
.\tools\nant\nant.exe -D:targetframework=net-4.0 | ||
XCopy binaries\* build\lib\net40\ /S /Y | ||
} | ||
# .\tools\nant\nant.exe -D:targetframework=net-4.0 | ||
# XCopy .\binaries\* .\outdir\lib\net40\ /S /Y | ||
} | ||
|
||
task InstallDependentPackages { | ||
dir -recurse -include ('packages.config') |ForEach-Object { | ||
$packageconfig = [io.path]::Combine($_.directory,$_.name) | ||
|
||
write-host $packageconfig | ||
|
||
.\tools\NuGet\NuGet.exe install $packageconfig -o packages | ||
} | ||
} | ||
|
||
task GeneateCommonAssemblyInfo { | ||
$versionFileFullPath = Resolve-Path $versionFile | ||
$productVersion = Get-Content $versionFileFullPath; | ||
$buildNumber = 0 | ||
if($env:BUILD_NUMBER -ne $null) { | ||
$buildNumber = $env:BUILD_NUMBER | ||
} | ||
|
||
$productVersion = $productVersion + "." + $buildNumber | ||
Generate-Assembly-Info true "release" "The most popular open-source service bus for .net" "NServiceBus" "NServiceBus" "Copyright © NServiceBus 2007-2011" $productVersion $productVersion ".\src\CommonAssemblyInfo.cs" | ||
} | ||
|
||
function Generate-Assembly-Info | ||
{ | ||
param( | ||
[string]$clsCompliant = "true", | ||
[string]$configuration, | ||
[string]$description, | ||
[string]$company, | ||
[string]$product, | ||
[string]$copyright, | ||
[string]$version, | ||
[string]$fileVersion, | ||
[string]$file = $(throw "file is a required parameter.") | ||
) | ||
$asmInfo = "using System; | ||
using System.Reflection; | ||
using System.Runtime.InteropServices; | ||
using System.Security; | ||
[assembly: AssemblyVersionAttribute(""$version"")] | ||
[assembly: AssemblyFileVersionAttribute(""$fileVersion"")] | ||
[assembly: AssemblyCopyrightAttribute(""$copyright"")] | ||
[assembly: AssemblyProductAttribute(""$product"")] | ||
[assembly: AssemblyCompanyAttribute(""$company"")] | ||
[assembly: AssemblyConfigurationAttribute(""$configuration"")] | ||
[assembly: AssemblyInformationalVersionAttribute(""$fileVersion"")] | ||
#if NET35 | ||
[assembly: AllowPartiallyTrustedCallersAttribute(true)] | ||
#endif | ||
[assembly: ComVisibleAttribute(false)] | ||
" | ||
|
||
$dir = [System.IO.Path]::GetDirectoryName($file) | ||
|
||
if ([System.IO.Directory]::Exists($dir) -eq $false) | ||
{ | ||
Write-Host "Creating directory $dir" | ||
[System.IO.Directory]::CreateDirectory($dir) | ||
} | ||
Write-Host "Generating assembly info file: $file" | ||
Write-Output $asmInfo > $file | ||
} | ||
|