/default.ps1

http://github.com/ayende/rhino-etl · Powershell · 197 lines · 173 code · 20 blank · 4 comment · 17 complexity · 0dc2e83eda8712ceeca1be9d6713b9e7 MD5 · raw file

  1. properties {
  2. $base_dir = resolve-path .
  3. $lib_dir = "$base_dir\SharedLibs"
  4. $sln_file = "$base_dir\Rhino.Etl.sln"
  5. $version = "1.3.1.0"
  6. $humanReadableversion = "1.3"
  7. $tools_dir = "$base_dir\Tools"
  8. $release_dir = "$base_dir\Release"
  9. $uploadCategory = "Rhino-ETL"
  10. $uploader = "..\Uploader\S3Uploader.exe"
  11. }
  12. task default -depends Release
  13. task Clean {
  14. remove-item -force -recurse $release_dir -ErrorAction SilentlyContinue
  15. }
  16. task Init -depends Clean {
  17. . .\psake_ext.ps1
  18. $infos = (
  19. "$base_dir\Rhino.Etl.Core\Properties\AssemblyInfo.cs",
  20. "$base_dir\Rhino.Etl.Dsl\Properties\AssemblyInfo.cs",
  21. "$base_dir\Rhino.Etl.Tests\Properties\AssemblyInfo.cs",
  22. "$base_dir\Rhino.Etl.Cmd\Properties\AssemblyInfo.cs"
  23. );
  24. $infos | foreach { Generate-Assembly-Info `
  25. -file $_ `
  26. -title "Rhino ETL $version" `
  27. -description "Developer freindly ETL Library for .NET" `
  28. -company "Hibernating Rhinos" `
  29. -product "Developer freindly ETL Library for .NET $version" `
  30. -version $version `
  31. -clsCompliant "false" `
  32. -copyright "Hibernating Rhinos, Ayende Rahien & Nathan Palmer 2007 - 2015"
  33. }
  34. new-item $release_dir -itemType directory
  35. }
  36. task Compile -depends Init {
  37. & msbuild "$sln_file" /p:Configuration=Release /v:Minimal
  38. if ($lastExitCode -ne 0) {
  39. throw "Error: Failed to execute msbuild"
  40. }
  41. }
  42. task Test -depends Compile {
  43. $old = pwd
  44. cd $tools_dir\XUnit\
  45. &.\xunit.console.exe "$base_dir\Rhino.Etl.Tests\bin\Release\Rhino.Etl.Tests.dll"
  46. if ($lastExitCode -ne 0) {
  47. throw "Error: Failed to execute tests"
  48. }
  49. cd $old
  50. }
  51. task Release -depends Test,DoRelease {
  52. }
  53. task Nuget {
  54. . .\psake_ext.ps1
  55. Generate-Nuget-Spec `
  56. -title "Rhino-Etl" `
  57. -version $version `
  58. -authors "Ayende Rahien, Nathan Palmer" `
  59. -description "Rhino Etl is a developer friendly Extract, transform and load (ETL) library for .NET" `
  60. -language "en-GB" `
  61. -projectURL "https://github.com/hibernating-rhinos/rhino-etl" `
  62. -licenceUrl "https://github.com/hibernating-rhinos/rhino-etl/blob/master/license.txt" `
  63. -iconUrl "https://raw.github.com/wiki/hibernating-rhinos/rhino-esb/images/rhino-icon.jpg" `
  64. -dependencies @( `
  65. @("Boo", "0.9.4"), `
  66. @("RhinoDSL", "1.0.0"), `
  67. @("Common.Logging", "3.0.0"), `
  68. @("Common.Logging.Core", "3.0.0"), `
  69. @("FileHelpers", "2.0.0.0") `
  70. ) `
  71. -files @( `
  72. @("$base_dir\Rhino.Etl.Dsl\bin\Release\Rhino.Etl.Core.dll","lib\net35"), `
  73. @("$base_dir\Rhino.Etl.Dsl\bin\Release\Rhino.Etl.Core.xml","lib\net35"), `
  74. @("$base_dir\Rhino.Etl.Dsl\bin\Release\Rhino.Etl.Core.pdb","lib\net35"), `
  75. @("$base_dir\Rhino.Etl.Dsl\bin\Release\Rhino.Etl.Dsl.dll","lib\net35"), `
  76. @("$base_dir\Rhino.Etl.Dsl\bin\Release\Rhino.Etl.Dsl.xml","lib\net35"), `
  77. @("$base_dir\Rhino.Etl.Dsl\bin\Release\Rhino.Etl.Dsl.pdb","lib\net35"), `
  78. @("$base_dir\Rhino.Etl.Dsl\**\*.cs","src\Rhino.Etl.Dsl"), `
  79. @("$base_dir\Rhino.Etl.Core\**\*.cs","src\Rhino.Etl.Core"), `
  80. @("license.txt",""), `
  81. @("acknowledgements.txt","") `
  82. ) `
  83. -file "$base_dir\Rhino.Etl.nuspec"
  84. .\Tools\NuGet.exe pack .\Rhino.Etl.nuspec -Symbols
  85. # Regular
  86. if (test-path ".\Release\Rhino-Etl.$version.nupkg") {
  87. del ".\Release\Rhino-Etl.$version.nupkg"
  88. }
  89. move "Rhino-Etl.$version.nupkg" .\Release
  90. # Symbol
  91. if (test-path ".\Release\Rhino-Etl.$version.symbols.nupkg") {
  92. del ".\Release\Rhino-Etl.$version.symbols.nupkg"
  93. }
  94. move "Rhino-Etl.$version.symbols.nupkg" .\Release
  95. Generate-Nuget-Spec `
  96. -title "Rhino-Etl-Cmd" `
  97. -version $version `
  98. -authors "Ayende Rahien, Nathan Palmer" `
  99. -description "Rhino Etl is a developer friendly Extract, transform and load (ETL) library for .NET" `
  100. -language "en-GB" `
  101. -projectURL "https://github.com/hibernating-rhinos/rhino-etl" `
  102. -licenceUrl "https://github.com/hibernating-rhinos/rhino-etl/blob/master/license.txt" `
  103. -iconUrl "https://raw.github.com/wiki/hibernating-rhinos/rhino-esb/images/rhino-icon.jpg" `
  104. -dependencies @( `
  105. @("Boo", "0.9.4"), `
  106. @("RhinoDSL", "1.0.0"), `
  107. @("Common.Logging", "3.0.0"), `
  108. @("Common.Logging.Core", "3.0.0"), `
  109. @("Common.Logging.Log4Net1210", "3.0.0"), `
  110. @("log4net", "1.2.10"), `
  111. @("FileHelpers", "2.0.0.0") `
  112. ) `
  113. -files @( `
  114. @("$base_dir\Rhino.Etl.Cmd\bin\Release\Rhino.Etl.Core.dll","lib\net35"), `
  115. @("$base_dir\Rhino.Etl.Cmd\bin\Release\Rhino.Etl.Core.xml","lib\net35"), `
  116. @("$base_dir\Rhino.Etl.Cmd\bin\Release\Rhino.Etl.Core.pdb","lib\net35"), `
  117. @("$base_dir\Rhino.Etl.Cmd\bin\Release\Rhino.Etl.Dsl.dll","lib\net35"), `
  118. @("$base_dir\Rhino.Etl.Cmd\bin\Release\Rhino.Etl.Dsl.xml","lib\net35"), `
  119. @("$base_dir\Rhino.Etl.Cmd\bin\Release\Rhino.Etl.Dsl.pdb","lib\net35"), `
  120. @("$base_dir\Rhino.Etl.Cmd\bin\Release\Rhino.Etl.Cmd.exe","lib\net35"), `
  121. @("$base_dir\Rhino.Etl.Cmd\bin\Release\Rhino.Etl.Cmd.pdb","lib\net35"), `
  122. @("$base_dir\Rhino.Etl.Dsl\**\*.cs","src\Rhino.Etl.Dsl"), `
  123. @("$base_dir\Rhino.Etl.Core\**\*.cs","src\Rhino.Etl.Core"), `
  124. @("$base_dir\Rhino.Etl.Cmd\**\*.cs","src\Rhino.Etl.Cmd"), `
  125. @("license.txt",""), `
  126. @("acknowledgements.txt","") `
  127. ) `
  128. -file "$base_dir\Rhino-Etl-Cmd.nuspec"
  129. .\Tools\NuGet.exe pack .\Rhino-Etl-Cmd.nuspec -Symbols
  130. # Regular
  131. if (test-path ".\Release\Rhino-Etl-Cmd.$version.nupkg") {
  132. del ".\Release\Rhino-Etl-Cmd.$version.nupkg"
  133. }
  134. move "Rhino-Etl-Cmd.$version.nupkg" .\Release
  135. # Symbol
  136. if (test-path ".\Release\Rhino-Etl-Cmd.$version.symbols.nupkg") {
  137. del ".\Release\Rhino-Etl-Cmd.$version.symbols.nupkg"
  138. }
  139. move "Rhino-Etl-Cmd.$version.symbols.nupkg" .\Release
  140. }
  141. task DoRelease -depends Compile,NuGet {
  142. & $tools_dir\zip.exe -9 -A -j $release_dir\Rhino.Etl-$humanReadableversion-Build-$env:ccnetnumericlabel.zip `
  143. $base_dir\Rhino.Etl.Cmd\bin\Release\Rhino.Etl.Core.dll `
  144. $base_dir\Rhino.Etl.Cmd\bin\Release\Rhino.Etl.Core.xml `
  145. $base_dir\Rhino.Etl.Cmd\bin\Release\Rhino.Etl.Dsl.dll `
  146. $base_dir\Rhino.Etl.Cmd\bin\Release\Rhino.Etl.Dsl.xml `
  147. $base_dir\Rhino.Etl.Cmd\bin\Release\Rhino.Etl.Cmd.exe `
  148. $base_dir\Rhino.Etl.Cmd\bin\Release\Rhino.DSL.dll `
  149. $base_dir\Rhino.Etl.Cmd\bin\Release\log4net.dll `
  150. $base_dir\Rhino.Etl.Cmd\bin\Release\Common.Logging.dll `
  151. $base_dir\Rhino.Etl.Cmd\bin\Release\Common.Logging.Core.dll `
  152. $base_dir\Rhino.Etl.Cmd\bin\Release\Common.Logging.Log4Net1210.dll `
  153. $base_dir\Rhino.Etl.Cmd\bin\Release\Boo.* `
  154. $base_dir\Rhino.Etl.Cmd\bin\Release\FileHelpers.dll `
  155. license.txt `
  156. acknowledgements.txt
  157. if ($lastExitCode -ne 0) {
  158. throw "Error: Failed to execute ZIP command"
  159. }
  160. }
  161. task Upload -depends DoRelease {
  162. Write-Host "Starting upload"
  163. if (Test-Path $uploader) {
  164. $log = $env:push_msg
  165. if($log -eq $null -or $log.Length -eq 0) {
  166. $log = git log -n 1 --oneline
  167. }
  168. &$uploader "$uploadCategory" "$release_dir\Rhino.Etl-$humanReadableversion-Build-$env:ccnetnumericlabel.zip" "$log"
  169. if ($lastExitCode -ne 0) {
  170. write-host "Failed to upload to S3: $lastExitCode"
  171. throw "Error: Failed to publish build"
  172. }
  173. }
  174. else {
  175. Write-Host "could not find upload script $uploadScript, skipping upload"
  176. }
  177. }