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.
Squashed commit of the following: commit 6f8e2eb57dca93fc8d61c0496d8c3cb7eddff004 Author: Joseph Thomas <joseph.pattom@gmailcom> Date: Fri Jul 15 23:34:36 2011 +0530 puting back the removed file commit eeddb43fae49df9a9c53ef9726579572c0710719 Author: Joseph Thomas <joseph.pattom@gmailcom> Date: Tue Jul 12 00:41:05 2011 +0530 added delete package fuctionality commit fddd3a6745523f2cd285676afd5dba1ee3261ef1 Author: Joseph Thomas <joseph.pattom@gmailcom> Date: Sat Jul 2 10:34:16 2011 +0530 removing libs for tools from source repository made necessary chnges packing script for the same ie fixing the issue Particular#83 in suggested way added parameter to add source target while invoking packit commit 001b3b409ba180945edab3e179a479a2d20ff2de Author: Joseph Thomas <joseph.pattom@gmailcom> Date: Fri Jul 1 00:43:58 2011 +0530 Fixing Issues Particular#83 and some refactoring done according to http://lostechies.com/joshuaflanagan/2011/06/23/tips-for-building-nuget-packages/ commit 7b15647d06ef09abb50f7d04936c70362453425a Author: Joseph Thomas <joseph.pattom@gmailcom> Date: Mon Jun 27 00:18:01 2011 +0530 fixing issue Particular#73 commit ccb633be78e12a8af5484f23b5eca4740381c9eb Author: Joseph Thomas <joseph.pattom@gmailcom> Date: Sun Jun 26 18:16:21 2011 +0530 Moving Nuget and package utlities to root commit c3a7e8e07edfc693db3670a8451d6e6836803ed3 Author: Joseph Thomas <joseph.pattom@gmailcom> Date: Tue Jun 21 21:19:46 2011 +0530 fixed Particular#66, adding new nuGet.exe to tools commit 2cfd8dbcaba8c772b590386131670c6f7d362cf5 Author: jpattom <[email protected]> Date: Sat Jun 11 16:24:01 2011 +0530 reverted the script to copy files to build\lib\net35\ commit ed4f3c272e15852c3b823465c54e43fb7303f76d Author: jpattom <[email protected]> Date: Sat Jun 11 16:18:32 2011 +0530 removing build-net4.0.bat commit cff485c483f9be29235ca87048f68b942501cfb2 Author: jpattom <[email protected]> Date: Sat Jun 11 16:09:16 2011 +0530 Adding psake to tools and Creating package in psake way.. First Draft need refactoring commit 8c127809c2d8d179c10402b398681ab269416ff4 Author: jpattom <[email protected]> Date: Fri Jun 10 00:31:50 2011 +0530 Cleaned Both packages NServiceBus and NServiceBus.Host commit 15db21f266ca6d1d5d280534fe0ef7b33503d0ab Author: jpattom <[email protected]> Date: Sun Jun 5 00:31:17 2011 +0530 Fix for issue Particular#52 NServiceBus package will get added with all the binaries Tested for All and passing only specific libs to add. The Fix will be applicable only if builds are created using build-net3.5.bat and build-net4.0.bat commit d619a1469fe197cad7e9b317dec4700e010f02a9 Author: jpattom <[email protected]> Date: Sat Jun 4 00:36:29 2011 +0530 Code Changed as the Nuget.exe is taken from tools. commit a65efa52f52ebb7b3cc0db4834ddc43ec39134a9 Author: jpattom <[email protected]> Date: Sat Jun 4 00:32:27 2011 +0530 Adding Nuget exe to tools Fixing issue Particular#50 Add nuget.exe to the tools directory commit f16367c80c6d012c6b67a137a4ba319db9b0d516 Author: jpattom <[email protected]> Date: Sat Jun 4 00:27:07 2011 +0530 Fixed Some issues in packing NServiceBus.Host commit f5c9886af80b04132fb8cfadfeb37a0d77e96b4f Author: jpattom <[email protected]> Date: Sun May 29 01:32:00 2011 +0530 changed writing xml to XmlWriter with proper XmlWriterSettings commit 158322b2c3a4d62b8090ec7767138f1d9c874820 Author: jpattom <[email protected]> Date: Sat May 28 22:25:17 2011 +0530 Made the checking of Nuget and .netframework proper commit 720df041dc8495eaa27dcf0169bafab6ac86e2bb Author: jpattom <[email protected]> Date: Sat May 28 15:48:25 2011 +0530 Adding Files for Creating The NServiceBus packages -RuNOnce required only once to make the Pakaging Machine's Powershell to Use latest .net framework Other Folders and files are for the Pakage NServiceBus.Host commit 9c68c2e85fdb7ef2b1ed453c40d56c6c1344e0bb Author: jpattom <[email protected]> Date: Sat May 28 15:21:22 2011 +0530 Fixed the issues on fie=rst draft, ready for the package NServiceBus.Host --Pending: PAcking of Library and Executables to pack commit d4fb4c7cdc2ef81bc6a01b5da1e48f032a80bb8c Author: jpattom <[email protected]> Date: Tue May 24 21:41:31 2011 +0530 No change oly line is changed commit 91fa1ff91ffce987317ab8c721ed5777f887383d Author: jpattom <[email protected]> Date: Tue May 24 01:48:36 2011 +0530 Adding the first version of the powershell script to create Packages
- Loading branch information
andreasohlund
committed
Jul 23, 2011
1 parent
0099153
commit 6b37ca3
Showing
10 changed files
with
1,551 additions
and
95 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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
reg add hklm\software\microsoft\.netframework /v OnlyUseLatestCLR /t REG_DWORD /d 1 | ||
reg add hklm\software\wow6432node\microsoft\.netframework /v OnlyUseLatestCLR /t REG_DWORD /d 1 | ||
Copy-Item .\powershell_ise.exe.config $PSHOME | ||
Rename-Item ./RunOnce.ps1 NeverRunMeAgain.txt |
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,276 @@ | ||
#region Public Module Variables | ||
$script:packit = @{} | ||
$script:packit.push_to_nuget = $false # Set the variable to true to push the package to NuGet galary. | ||
|
||
$script:packit.default_package = "NServiceBus" | ||
$script:packit.package_owners = "Udi Dahan, Andreas Ohlund, Matt Burton, Jonathan Oliver et al" | ||
$script:packit.package_authors = "Udi Dahan, Andreas Ohlund, Matt Burton, Jonathan Oliver et al" | ||
$script:packit.package_description = "The most popular open-source service bus for .net" | ||
$script:packit.package_language = "en-US" | ||
$script:packit.package_licenseUrl = "http://nservicebus.com/license.aspx" | ||
$script:packit.package_projectUrl = "http://nservicebus.com/" | ||
$script:packit.package_requireLicenseAcceptance = $true; | ||
$script:packit.package_tags = "nservicebus servicebus msmq cqrs publish subscribe" | ||
$script:packit.package_version = "2.5" | ||
$script:packit.package_iconUrl = "http://a2.twimg.com/profile_images/1203939022/nServiceBus_Twitter_Logo_reasonably_small.png" | ||
$script:packit.binaries_Location = ".\binaries" | ||
$script:packit.framework_Isolated_Binaries_Loc = ".\build\lib" | ||
$script:packit.targeted_Frameworks = "net35","net40" | ||
$script:packit.versionAssemblyName = $script:packit.binaries_Location + "\NServiceBus.dll" | ||
$script:packit.packageOutPutDir = ".\packages" | ||
$script:packit.PackagingArtefactsRoot = ".\NuGet\PackagingArtefacts" | ||
$script:packit.nugetCommand = ".\tools\Nuget\NuGet.exe" | ||
$script:packit.nugetKey = ".\tools\Nuget\NuGetKey.txt" | ||
|
||
Export-ModuleMember -Variable "packit" | ||
#endregion | ||
|
||
$VesionPlaceHolder = "<version>" | ||
|
||
function DeletePackage($packageId , $ver ) | ||
{ | ||
$keyfile = resolve-path $script:packit.nugetKey | ||
$nugetExcec = resolve-path $script:packit.nugetCommand | ||
|
||
if(-not (test-path $keyfile)) | ||
{ | ||
throw "Could not find the NuGet access key at $keyfile." | ||
} | ||
|
||
$key = get-content $keyfile | ||
$key = $key.Trim() | ||
|
||
write-host "Package to Delete:" | ||
Write-Host $packageId + $ver | ||
&$nugetExcec delete $packageId $ver $key | ||
write-host "" | ||
} | ||
|
||
Export-ModuleMember -Function "DeletePackage" | ||
|
||
function PushPackage($packageName) | ||
{ | ||
$keyfile = resolve-path $script:packit.nugetKey | ||
$packagespath = resolve-path $script:packit.packageOutPutDir | ||
$nugetExcec = resolve-path $script:packit.nugetCommand | ||
if(-not (test-path $keyfile)) | ||
{ | ||
throw "Could not find the NuGet access key at $keyfile." | ||
} | ||
pushd $packagespath | ||
|
||
# get our secret key. | ||
$key = get-content $keyfile | ||
$key = $key.Trim() | ||
|
||
# Find all the packages and display them for confirmation | ||
$packages = dir $packageName | ||
write-host "Packages to upload:" | ||
$packages | % { write-host $_.Name } | ||
|
||
$packages | % { | ||
$package = $_.Name | ||
write-host "Uploading $package" | ||
#&$nugetExcec push -source "http://packages.nuget.org/v1/" $package $key | ||
write-host "" | ||
} | ||
popd | ||
} | ||
|
||
Export-ModuleMember -Function "PushPackage" | ||
|
||
function Invoke-Packit | ||
{ | ||
|
||
[CmdletBinding( | ||
SupportsShouldProcess=$False, | ||
SupportsTransactions=$False, | ||
ConfirmImpact="None", | ||
DefaultParameterSetName="")] | ||
|
||
param( | ||
[Parameter(Position=0,Mandatory=0)] | ||
[string]$packageName = $script:packit.default_package, | ||
[Parameter(Position=1,Mandatory=0)] | ||
[string]$packageVersion = "", | ||
[Parameter(Position=2,Mandatory=0)] | ||
[System.Collections.Hashtable]$dependencies = @{}, | ||
[Parameter(Position=3, Mandatory=0)] | ||
[System.Collections.ArrayList]$assemblyNames, | ||
[Parameter(Position=4, Mandatory=0)] | ||
[System.Collections.Hashtable]$files = @{}, | ||
[Parameter(Position=5, Mandatory=0)] | ||
[bool]$createWithSymbol = $false | ||
) | ||
|
||
begin | ||
{ | ||
|
||
} | ||
process | ||
{ | ||
|
||
[string]$version = $packageVersion | ||
if($version -eq "") | ||
{ | ||
try | ||
{ | ||
$versionAssemblyLocation = Resolve-Path -Path $script:packit.versionAssemblyName | ||
[System.Reflection.Assembly]$versionAssembly = [System.Reflection.Assembly]::Loadfile($versionAssemblyLocation) | ||
if($versionAssembly -ne $null) | ||
{ | ||
$assmName = $versionAssembly.GetName(); | ||
if($assmName -ne $null){ | ||
$version = $assmName.version | ||
} | ||
} | ||
} | ||
catch | ||
{ | ||
"Unable to Find the Version from assembly due to the Error:- `n $_" | ||
$version = $script:packit.package_version | ||
} | ||
} | ||
|
||
if((Test-Path -Path $script:packit.packageOutPutDir) -ne $true) | ||
{ | ||
mkdir $script:packit.packageOutPutDir | ||
} | ||
|
||
$packageDir = $script:packit.PackagingArtefactsRoot + "\" + $packageName | ||
if((Test-Path -Path $script:packit.PackagingArtefactsRoot) -ne $true) | ||
{ | ||
mkdir $script:packit.PackagingArtefactsRoot | ||
} | ||
|
||
if((Test-Path -Path $packageDir) -ne $true) | ||
{ | ||
mkdir $packageDir | ||
} | ||
|
||
|
||
$packagePath = $packageDir + "\" + $packageName | ||
&$script:packit.nugetCommand spec $packagePath -Force | ||
$nuGetSpecFile = $packagePath + ".nuspec" | ||
[xml] $nuGetSpecContent= Get-Content $nuGetSpecFile | ||
$nuGetSpecContent.package.metadata.Id = $packageName | ||
$nuGetSpecContent.package.metadata.version = $version | ||
$nuGetSpecContent.package.metadata.authors = $script:packit.package_authors | ||
$nuGetSpecContent.package.metadata.owners = $script:packit.package_owners | ||
$nuGetSpecContent.package.metadata.licenseUrl = $script:packit.package_licenseUrl | ||
$nuGetSpecContent.package.metadata.projectUrl = $script:packit.package_projectUrl | ||
$nuGetSpecContent.package.metadata.requireLicenseAcceptance = "true" | ||
$nuGetSpecContent.package.metadata.description = $script:packit.package_description | ||
$nuGetSpecContent.package.metadata.tags = $script:packit.package_tags | ||
$nuGetSpecContent.package.metadata.iconUrl = $script:packit.package_iconUrl; | ||
$dependencyInnerXml = "" | ||
if($dependencies.Count -gt 0) | ||
{ | ||
$dependencies | Foreach-Object { | ||
$p = $_ | ||
@($p.GetEnumerator()) | Where-Object { | ||
($_.Value | Out-String) | ||
} | Foreach-Object { | ||
$dependencyPackage = $_.Key | ||
$dependencyPackageVersion = $_.Value | ||
if($dependencyPackageVersion -eq $VesionPlaceHolder) | ||
{ | ||
$dependencyPackageVersion = $version | ||
} | ||
$dependencyInnerXml = "{0}<dependency id=""{1}"" version=""{2}"" />" -f | ||
$dependencyInnerXml,$dependencyPackage,$dependencyPackageVersion | ||
} | ||
} | ||
$nuGetSpecContent.package.metadata.dependencies.set_InnerXML($dependencyInnerXml) | ||
} | ||
else | ||
{ | ||
$nuGetSpecContent.package.metadata.RemoveChild($nuGetSpecContent.package.metadata.dependencies) | ||
} | ||
$filesNode = $nuGetSpecContent.CreateElement("files") | ||
$fileElement = "" | ||
if($assemblyNames.Count -gt 0) | ||
{ | ||
$libPath = "lib" | ||
foreach ($assemblyName in $assemblyNames) | ||
{ | ||
if($assemblyName -ne "") | ||
{ | ||
foreach($framework in $script:packit.targeted_Frameworks) | ||
{ | ||
$source = $script:packit.framework_Isolated_Binaries_Loc + "\" + $framework + "\" + $assemblyName | ||
$source = Resolve-Path $source | ||
$destination = $libPath + "\" + $framework +"\" | ||
$directoryName = [system.io.Path]::GetDirectoryName($assemblyName) | ||
if($directoryName -ne "") | ||
{ | ||
$destination += $directoryName + "\" | ||
} | ||
$fileElement = "{0}<file src=""{1}"" target=""{2}""/>" -f | ||
$fileElement, $source, $destination | ||
} | ||
} | ||
} | ||
} | ||
|
||
if($files.Count -gt 0) | ||
{ | ||
$files.Keys | Foreach-Object { | ||
$srcResolved = Resolve-Path $_ | ||
$target = $files[$_] | ||
foreach($src in $srcResolved) | ||
{ | ||
$fileElement = "{0}<file src=""{1}"" target=""{2}""/>" -f | ||
$fileElement, $src, $target | ||
} | ||
} | ||
} | ||
|
||
# $packageContentPath = ".\Content" + $packageName | ||
# if(Test-Path $packageContentPath) | ||
# { | ||
# $contentPath = $packageDir + "\Content" | ||
# mkdir $contentPath | ||
# $packageContentPath += "\*.*" | ||
# copy $packageContentPath $contentPath | ||
# } | ||
# $packageToolsPath = ".\Tools" + $packageName | ||
# if(Test-Path $packageToolsPath) | ||
# { | ||
# $toolsPath = $packageDir + "\tools" | ||
# mkdir $toolsPath | ||
# $packageToolsPath += "\*.*" | ||
# copy $packageToolsPath $toolsPath | ||
# } | ||
|
||
|
||
|
||
if($fileElement -ne "") | ||
{ | ||
$filesNode.set_InnerXML($fileElement) | ||
$nuGetSpecContent.package.AppendChild($filesNode) | ||
} | ||
$writerSettings = new-object System.Xml.XmlWriterSettings | ||
$writerSettings.OmitXmlDeclaration = $true | ||
$writerSettings.NewLineOnAttributes = $true | ||
$writerSettings.Indent = $true | ||
$nuGetSpecFilePath = Resolve-Path -Path $nuGetSpecFile | ||
$writer = [System.Xml.XmlWriter]::Create($nuGetSpecFilePath, $writerSettings) | ||
|
||
$nuGetSpecContent.WriteTo($writer) | ||
$writer.Flush() | ||
$writer.Close() | ||
|
||
|
||
if($createWithSymbol){&$script:packit.nugetCommand pack $nuGetSpecFile -OutputDirectory $script:packit.packageOutPutDir -Verbose -Symbols} | ||
else{&$script:packit.nugetCommand pack $nuGetSpecFile -OutputDirectory $script:packit.packageOutPutDir -Verbose} | ||
|
||
if($script:packit.push_to_nuget){ PushPackage($packName) } | ||
} | ||
end | ||
{ | ||
|
||
} | ||
} | ||
|
||
Export-ModuleMember -Function "Invoke-Packit" |
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,6 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<configuration> | ||
<startup> | ||
<supportedRuntime version="v4.0.30319" /> | ||
</startup> | ||
</configuration> |
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 @@ | ||
Import-Module .\tools\psake\psake.psm1 | ||
Invoke-Psake | ||
Remove-Module psake |
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,49 @@ | ||
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 | ||
|
||
#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 | ||
|
||
#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.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 | ||
|
||
remove-module packit | ||
} | ||
|
||
task BuildOnNet35 { | ||
.\tools\nant\nant.exe -D:targetframework=net-3.5 | ||
XCopy binaries\* build\lib\net35\ /S /Y | ||
} | ||
|
||
task BuildOnNet40 { | ||
.\tools\nant\nant.exe -D:targetframework=net-4.0 | ||
XCopy binaries\* build\lib\net40\ /S /Y | ||
} |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.