MCC/b2uploader: b2uploader - backup to server - SVN.BY: Go Git Service

b2uploader - backup to server

build.fsx 2.2KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. //include fake lib
  2. #r @"tools\FAKE\tools\Fakelib.dll"
  3. open Fake
  4. open System
  5. open Fake.AssemblyInfoFile
  6. let buildDir = @".\build"
  7. let deployDir = @".\deploy"
  8. let date = DateTime.UtcNow
  9. let version = String.Format("{0}.{1}.{2}.{3:0.#}", date.Year, date.Month, date.Day, date.TimeOfDay.TotalMinutes.ToString("F0"))
  10. let copyright = "TIernan OToole 2016"
  11. let productName = "B2 Uploader"
  12. let companyName = "Tiernan OToole"
  13. let buildMode = getBuildParamOrDefault "buildMode" "Releasex64"
  14. let setParams defaults =
  15. { defaults with
  16. Verbosity = Some(Quiet)
  17. Targets = ["Build"]
  18. Properties =
  19. [
  20. "Optimize", "True"
  21. "DebugSymbols", "True"
  22. "Configuration", buildMode
  23. ]
  24. }
  25. Target "SetAssemblyInfo" (fun _ ->
  26. CreateCSharpAssemblyInfo "B2Classes/Properties/AssemblyInfo.cs"
  27. [Attribute.Title "B2Classes"
  28. Attribute.Guid "fe353639-3b33-44de-9147-45b63818d8a7"
  29. Attribute.Product productName
  30. Attribute.Company companyName
  31. Attribute.Copyright copyright
  32. Attribute.Version version
  33. Attribute.FileVersion version
  34. ]
  35. CreateCSharpAssemblyInfo "B2Uploader/Properties/AssemblyInfo.cs"
  36. [Attribute.Title "B2Uploader"
  37. Attribute.Guid "a5d41169-c2ee-4b5e-a2d8-b63e485597a6"
  38. Attribute.Product productName
  39. Attribute.Company companyName
  40. Attribute.Copyright copyright
  41. Attribute.Version version
  42. Attribute.FileVersion version
  43. ]
  44. )
  45. RestorePackages()
  46. Target "Clean" (fun _ ->
  47. CleanDir buildDir
  48. )
  49. Target "Classes" (fun _ ->
  50. !! @"B2Classes\B2Classes.csproj"
  51. |> MSBuildReleaseExt buildDir setParams.Properties "Build"
  52. |> Log "AppBuild-Output: "
  53. )
  54. Target "Uploader" (fun _ ->
  55. !! @"B2Uploader\B2Uploader.csproj"
  56. |> MSBuildReleaseExt buildDir setParams.Properties "Build"
  57. |> Log "AppBuild-Output: "
  58. )
  59. Target "Zip" (fun _ ->
  60. !! (buildDir + "\**\*.*")
  61. -- "*.zip"
  62. |> Zip buildDir (deployDir + "\B2Uploader." + version + ".zip")
  63. )
  64. "Clean"
  65. ==> "SetAssemblyInfo"
  66. ==> "Classes"
  67. ==> "Uploader"
  68. ==> "Zip"
  69. RunTargetOrDefault "Zip"