Skip to content

Commit

Permalink
Update build script
Browse files Browse the repository at this point in the history
  • Loading branch information
Krzysztof-Cieslak committed Oct 14, 2015
1 parent 55eabbb commit 42c5fa6
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 7 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,4 @@ TestResults.xml
.fake/

fsautocomplete.zip
fsautocomplete.suave.zip
44 changes: 37 additions & 7 deletions build.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,24 @@ let project = "FsAutoComplete"
let summary = "A command line tool for interfacing with FSharp.Compiler.Service over a pipe."

// Read additional information from the release notes document
let releaseNotesData =
let releaseNotesData =
File.ReadAllLines "RELEASE_NOTES.md"
|> parseAllReleaseNotes

let release = List.head releaseNotesData


let buildDir = project + "/bin/Debug/"
let buildReleaseDir = project + "/bin/Release/"
let integrationTestDir = project + "/test/integration/"
let releaseArchive = "fsautocomplete.zip"

let suaveSummary = "A Suave web server for interfacing with FSharp.Compiler.Service over a HTTP."
let suaveProject = "FsAutoComplete.Suave"
let suaveBuildDebugDir = suaveProject + "/bin/Release"
let suaveBuildReleaseDir = suaveProject + "/bin/Release"
let suaveReleaseArchive = "fsautocomplete.suave.zip"

// Pattern specifying assemblies to be tested using NUnit
let testAssemblies = "**/bin/*/*Tests*.dll"

Expand Down Expand Up @@ -80,6 +86,8 @@ Target "UnitTest" (fun _ ->
OutputFile = "TestResults.xml" })
)



Target "AssemblyInfo" (fun _ ->
let fileName = project + "/AssemblyInfo.fs"
CreateFSharpAssemblyInfo fileName
Expand All @@ -90,13 +98,30 @@ Target "AssemblyInfo" (fun _ ->
Attribute.FileVersion release.AssemblyVersion ]
)

Target "SuaveAssemblyInfo" (fun _ ->
let fileName = suaveProject + "/AssemblyInfo.fs"
CreateFSharpAssemblyInfo fileName
[ Attribute.Title suaveProject
Attribute.Product suaveProject
Attribute.Description suaveSummary
Attribute.Version release.AssemblyVersion
Attribute.FileVersion release.AssemblyVersion ]
)

Target "ReleaseArchive" (fun _ ->
Zip buildReleaseDir
releaseArchive
( !! (buildReleaseDir + "/*.dll")
++ (buildReleaseDir + "/*.exe"))
)

Target "SuaveReleaseArchive" (fun _ ->
Zip suaveBuildReleaseDir
suaveReleaseArchive
( !! (suaveBuildReleaseDir + "/*.dll")
++ (suaveBuildReleaseDir + "/*.exe"))
)

#load "lib/Octokit.fsx"
open Octokit

Expand All @@ -116,18 +141,19 @@ Target "Release" (fun _ ->

Branches.tag "" release.NugetVersion
Branches.pushTag "" remote release.NugetVersion

// release on github
createClient user pw
|> createDraft githubOrg project release.NugetVersion (release.SemVer.PreRelease <> None) release.Notes
|> createDraft githubOrg project release.NugetVersion (release.SemVer.PreRelease <> None) release.Notes
|> uploadFile releaseArchive
|> uploadFile suaveReleaseArchive
|> releaseDraft
|> Async.RunSynchronously
)

Target "Clean" (fun _ ->
CleanDirs [ buildDir; buildReleaseDir ]
DeleteFile releaseArchive
CleanDirs [ buildDir; buildReleaseDir; suaveBuildDebugDir; suaveBuildReleaseDir ]
DeleteFiles [releaseArchive; suaveReleaseArchive ]
)

Target "Build" id
Expand All @@ -153,5 +179,9 @@ Target "All" id
==> "ReleaseArchive"
==> "Release"

RunTargetOrDefault "BuildDebug"
"SuaveAssemblyInfo"
==> "BuildRelease"
==> "SuaveReleaseArchive"
==> "Release"

RunTargetOrDefault "BuildDebug"

0 comments on commit 42c5fa6

Please sign in to comment.