Skip to content

Commit

Permalink
Enable FAKE script to generate release archive
Browse files Browse the repository at this point in the history
  • Loading branch information
rneatherway committed May 21, 2015
1 parent 97aace1 commit 962c4fc
Show file tree
Hide file tree
Showing 5 changed files with 78 additions and 5 deletions.
12 changes: 12 additions & 0 deletions FSharp.AutoComplete/AssemblyInfo.fs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
namespace System
open System.Reflection

[<assembly: AssemblyTitleAttribute("FSharp.AutoComplete")>]
[<assembly: AssemblyProductAttribute("FSharp.AutoComplete")>]
[<assembly: AssemblyDescriptionAttribute("A command line tool for interfacing with FSharp.Compiler.Service over a pipe.")>]
[<assembly: AssemblyVersionAttribute("0.15.0")>]
[<assembly: AssemblyFileVersionAttribute("0.15.0")>]
do ()

module internal AssemblyVersionInformation =
let [<Literal>] Version = "0.15.0"
3 changes: 2 additions & 1 deletion FSharp.AutoComplete/FSharp.AutoComplete.fsproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
Expand Down Expand Up @@ -57,6 +57,7 @@
<Import Project="$(FSharpTargetsPath)" Condition="Exists('$(FSharpTargetsPath)')" />
-->
<ItemGroup>
<Compile Include="AssemblyInfo.fs" />
<Compile Include="Debug.fs" />
<Compile Include="Options.fs" />
<Compile Include="TipFormatter.fs" />
Expand Down
4 changes: 3 additions & 1 deletion FSharp.AutoComplete/Options.fs
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@
namespace FSharp.InteractiveAutocomplete

open System
open System.Diagnostics
open System.Reflection

module Version =
let string = "FSharp.AutoComplete 0.14.0"
let string = "FSharp.AutoComplete " + AssemblyVersionInformation.Version

module Options =

Expand Down
3 changes: 3 additions & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#### 0.15.0 - 20.05.2015

* Add Glyphs to completion responses - https://github.com/fsharp/FSharp.AutoComplete/pull/1
61 changes: 58 additions & 3 deletions build.fsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,31 @@
// include Fake lib
#r @"packages/FAKE/tools/FakeLib.dll"
open Fake
open Fake.Git
open Fake.ReleaseNotesHelper
open Fake.ZipHelper
open Fake.AssemblyInfoFile
open System
open System.IO
open System.Text.RegularExpressions

let buildDir = "./FSharp.AutoComplete/bin/Debug/"
let buildReleaseDir = "./FSharp.AutoComplete/bin/Release/"
let integrationTestDir = "./FSharp.AutoComplete/test/integration/"
let project = "FSharp.AutoComplete"
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 =
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"



Target "BuildDebug" (fun _ ->
MSBuildDebug buildDir "Build" ["./FSharp.AutoComplete.sln"]
Expand Down Expand Up @@ -82,13 +100,44 @@ Target "IntegrationTest" (fun _ ->
failwithf "Integration tests failed:\n%s" err
)

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

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

Target "ReleaseInstructions"
(fun _ ->
printfn "Go to https://github.com/fsharp/FSharp.AutoComplete/releases/new"
printfn "Enter the following information:\n"
printfn "\tTag version: %s" release.AssemblyVersion
printfn "\tRelease title: %s" release.AssemblyVersion
printfn "\tNotes:\n"
for note in release.Notes do
printfn "%s" note
printfn "\n\nAttach the archive '%s'" releaseArchive
)

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

Target "Build" id
Target "Test" id
Target "All" id
Target "Release" id

"BuildDebug"
==> "Build"
Expand All @@ -99,5 +148,11 @@ Target "All" id
"BuildDebug" ==> "All"
"Test" ==> "All"

"AssemblyInfo"
==> "BuildRelease"
==> "ReleaseArchive"
==> "ReleaseInstructions"
==> "Release"

RunTargetOrDefault "BuildDebug"

0 comments on commit 962c4fc

Please sign in to comment.