forked from Particular/NServiceBus
-
Notifications
You must be signed in to change notification settings - Fork 0
/
default.ps1
228 lines (175 loc) · 8.43 KB
/
default.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
properties {
$base_dir = resolve-path .
$version = "1.0.0"
$release_dir = "$base_dir\Release"
$productVersion = "3.0"
$buildNumber = "0";
$packageNameSuffix = "-CI"
$release_dir = "$base_dir\release"
$artifacts_dir = "$base_dir\artifacts"
$tools_dir = "$base_dir\tools"
}
task default -depends CreatePackages
task CreatePackages {
import-module ./NuGet\packit.psm1
Write-Output "Loding the moduele for packing.............."
$packit.push_to_nuget = $true
$packit.framework_Isolated_Binaries_Loc = ".\release"
$packit.PackagingArtefactsRoot = ".\release\PackagingArtefacts"
$packit.packageOutPutDir = ".\release\packages"
#Get Build number from TC
$buildNumber = 0
if($env:BUILD_NUMBER -ne $null) {
$buildNumber = $env:BUILD_NUMBER
}
$productVersion = $buildNumber
$packit.targeted_Frameworks = "net40";
#region Packing NserviceBus
$packageNameNsb = "NServiceBus" + $packageNameSuffix
$packit.package_description = "The most popular open-source service bus for .net"
invoke-packit $packageNameNsb $productVersion @{log4net="1.2.10"} "binaries\NServiceBus.dll", "binaries\NServiceBus.pdb", "binaries\NServiceBus.Core.dll", "binaries\NServiceBus.Core.pdb" @{} @(@{"src"="..\..\..\src\**\*.cs";"target"="src\src";"exclude"="*.sln;*.csproj;*.config;*.cache"}) $true;
#endregion
#region Packing NServiceBus.Host
$packageName = "NServiceBus.Host" + $packageNameSuffix
$packit.package_description = "The hosting template for the nservicebus, The most popular open-source service bus for .net"
invoke-packit $packageName $productVersion @{$packageNameNsb=$productVersion} "" @{".\release\net40\binaries\NServiceBus.Host32.*"="lib\net40\x86";".\release\net40\binaries\NServiceBus.Host.*"="lib\net40\x64"} $null $true
#endregion
#region Packing NServiceBus.Testing
$packageName = "NServiceBus.Testing" + $packageNameSuffix
$packit.package_description = "The testing for the nservicebus, The most popular open-source service bus for .net"
invoke-packit $packageName $productVersion @{$packageNameNsb=$productVersion} "binaries\NServiceBus.Testing.dll", "binaries\NServiceBus.Testing.pdb" @{} $null $true
#endregion
#region Packing NServiceBus.Integration.WebServices
$packageName = "NServiceBus.Integration.WebServices" + $packageNameSuffix
$packit.package_description = "The WebServices Integration for the nservicebus, The most popular open-source service bus for .net"
invoke-packit $packageName $productVersion @{$packageNameNsb=$productVersion} "binaries\NServiceBus.Integration.WebServices.dll", "binaries\NServiceBus.Integration.WebServices.pdb" @{} $null $true
#endregion
#region Packing NServiceBus.Autofac
$packageName = "NServiceBus.Autofac" + $packageNameSuffix
$packit.package_description = "The Autofac Container for the nservicebus"
invoke-packit $packageName $productVersion @{"Autofac"="2.5.2.830"} "" @{".\release\net40\binaries\containers\autofac\*.*"="lib\net40"}
#endregion
#region Packing NServiceBus.CastleWindsor
$packageName = "NServiceBus.CastleWindsor" + $packageNameSuffix
$packit.package_description = "The CastleWindsor Container for the nservicebus"
invoke-packit $packageName $productVersion @{"Castle.Core"="3.0.0.2001";"Castle.Windsor"="3.0.0.2001"} "" @{".\release\net40\binaries\containers\castle\*.*"="lib\net40"}
#endregion
#region Packing NServiceBus.StructureMap
$packageName = "NServiceBus.StructureMap" + $packageNameSuffix
$packit.package_description = "The StructureMap Container for the nservicebus"
invoke-packit $packageName $productVersion @{"structuremap"="2.6.3"} "" @{".\release\net40\binaries\containers\StructureMap\*.*"="lib\net40"}
#endregion
#region Packing NServiceBus.Unity
$packageName = "NServiceBus.Unity" + $packageNameSuffix
$packit.package_description = "The Unity Container for the nservicebus"
invoke-packit $packageName $productVersion @{"CommonServiceLocator"="1.0";"Unity"="2.1.505.0";"Unity.Interception"="2.1.505.0"} "" @{".\release\net40\binaries\containers\Unity\*.*"="lib\net40"}
#endregion
#region Packing NServiceBus.Ninject
$packageName = "NServiceBus.Ninject" + $packageNameSuffix
$packit.package_description = "The Ninject Container for the nservicebus"
invoke-packit $packageName $productVersion @{"Ninject"="2.2.1.4";"Ninject.Extensions.ChildKernel"="2.2.0.5"} "" @{".\release\net40\binaries\containers\Ninject\*.*"="lib\net40"}
#endregion
#region Packing NServiceBus.Spring
$packageName = "NServiceBus.Spring" + $packageNameSuffix
$packit.package_description = "The Spring Container for the nservicebus"
invoke-packit $packageName $productVersion @{"Common.Logging"="2.0.0";"Spring.Core"="1.3.2"} "" @{".\release\net40\binaries\containers\spring\*.*"="lib\net40"}
#endregion
#region Packing NServiceBus.NHibernate
$packageNameNHibernate = "NServiceBus.NHibernate" + $packageNameSuffix
$packit.package_description = "The NHibernate for the NServicebus"
invoke-packit $packageNameNHibernate $productVersion @{"Iesi.Collections"="3.2.0.4000";"NHibernate"="3.2.0.4000"} "binaries\NServiceBus.NHibernate.dll"
#endregion
#region Packing NServiceBus.Azure
$packageName = "NServiceBus.Azure" + $packageNameSuffix
$packit.package_description = "The Azure for the NServicebus"
invoke-packit $packageName $productVersion @{$packageNameNsb=$productVersion; $packageNameNHibernate=$productVersion; "WindowsAzure.StorageClient.Library"="1.4";"Common.Logging"="2.0.0"} "binaries\NServiceBus.Azure.dll"
#endregion
remove-module packit
}
task GeneateCommonAssemblyInfo -depends InstallDependentPackages {
$buildNumber = 0
if($env:BUILD_NUMBER -ne $null) {
$buildNumber = $env:BUILD_NUMBER
}
Write-Output "Build Number: $buildNumber"
$fileVersion = $productVersion + "." + $buildNumber + ".0"
$asmVersion = $productVersion + ".0.0"
Generate-Assembly-Info true "release" "The most popular open-source service bus for .net" "NServiceBus" "NServiceBus" "Copyright © NServiceBus 2007-2011" $asmVersion $fileVersion ".\src\CommonAssemblyInfo.cs"
}
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 FinalizeAndClean -depends ZipOutput{
echo Finalize and Clean
if(Test-Path -Path $release_dir)
{
del -Path $release_dir -Force -recurse
}
echo Finalize and Clean
}
task ZipOutput -depends CreatePackages {
echo "Cleaning the Release dir before ziping"
$packagingArtefacts = ".\release\PackagingArtefacts"
$packageOutPutDir = ".\release\packages"
if(Test-Path -Path $packagingArtefacts){
del -Path $packagingArtefacts -Force -recurse
}
if(Test-Path -Path $packageOutPutDir){
del -Path $packageOutPutDir -Force -recurse
}
echo "Zip Output"
$buildNumber = 0
if($env:BUILD_NUMBER -ne $null) {
$buildNumber = $env:BUILD_NUMBER
}
$productVersion = $buildNumber
if((Test-Path -Path $artifacts_dir) -eq $true)
{
rmdir $artifacts_dir -Force -recurse
}
mkdir $artifacts_dir
$archive = "$artifacts_dir\NServiceBus.$productVersion.zip"
exec {
& $tools_dir\zip\7za.exe a -tzip $archive $release_dir\**
}
echo "Zip Output Over"
}
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: AssemblyVersion(""$version"")]
[assembly: AssemblyFileVersion(""$fileVersion"")]
[assembly: AssemblyCopyright(""$copyright"")]
[assembly: AssemblyProduct(""$product"")]
[assembly: AssemblyCompany(""$company"")]
[assembly: AssemblyConfiguration(""$configuration"")]
[assembly: AssemblyInformationalVersion(""$version"")]
[assembly: ComVisible(false)]
[assembly: CLSCompliantAttribute(true)]
"
$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
}