Skip to content

Commit

Permalink
#1 #2 AppVeyor SourceLink
Browse files Browse the repository at this point in the history
  • Loading branch information
ctaggart committed Feb 27, 2014
1 parent 2cd6b9d commit ac35442
Show file tree
Hide file tree
Showing 5 changed files with 59 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Auto detect text files and perform LF normalization
* text=auto
* text=auto eol=lf

# Custom for Visual Studio
*.cs text diff=csharp
Expand Down
7 changes: 7 additions & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
build_script:
- cmd: build.cmd nuget
test: off
artifacts:
- path: bin\*.nupkg
environment:
gitHome: https://github.com/ctaggart
4 changes: 3 additions & 1 deletion build.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,7 @@
if not exist packages\FAKE\tools\Fake.exe (
.nuget\NuGet.exe install FAKE -OutputDirectory packages -ExcludeVersion
)
if not exist packages\SourceLink.Fake\tools\SourceLink.fsx (
.nuget\NuGet.exe install SourceLink.Fake -OutputDirectory packages -ExcludeVersion
)
packages\FAKE\tools\FAKE.exe build.fsx %*
pause
46 changes: 45 additions & 1 deletion build.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@

#I "packages/FAKE/tools"
#r "packages/FAKE/tools/FakeLib.dll"
#load "packages/SourceLink.Fake/tools/SourceLink.fsx"
open System
open Fake
open Fake.Git
open Fake.ReleaseNotesHelper
open Fake.AssemblyInfoFile
open SourceLink

// --------------------------------------------------------------------------------------
// Information about the project to be used at NuGet and in AssemblyInfo files
Expand All @@ -24,7 +26,7 @@ let description = """
interactive service that can be used for embedding F# scripting into your applications."""
let tags = "F# fsharp interactive compiler editor"

let gitHome = "https://github.com/fsharp"
let gitHome = environVarOrDefault "gitHome" "https://github.com/fsharp"
let gitName = "FSharp.Compiler.Service"
//let testAssemblies = ["tests/*/bin/Release/Deedle*Tests*.dll"]

Expand All @@ -35,6 +37,14 @@ let gitName = "FSharp.Compiler.Service"
// Read release notes & version info from RELEASE_NOTES.md
Environment.CurrentDirectory <- __SOURCE_DIRECTORY__
let release = parseReleaseNotes (IO.File.ReadAllLines "RELEASE_NOTES.md")
let isAppVeyorBuild = environVar "APPVEYOR" <> null
let nugetVersion =
if isAppVeyorBuild then sprintf "%s-a%s" release.NugetVersion (DateTime.UtcNow.ToString "yyMMddHHmm")
else release.NugetVersion

Target "BuildVersion" (fun _ ->
Shell.Exec("appveyor", sprintf "UpdateBuild -Version \"%s\"" nugetVersion) |> ignore
)

// Generate assembly info files with the right version & up-to-date information
Target "AssemblyInfo" (fun _ ->
Expand Down Expand Up @@ -82,6 +92,38 @@ Target "Build" (fun _ ->
|> Log "AppBuild-Output: "
)

Target "SourceLink" (fun _ ->
#if MONO
()
#else
let f = !! "src/fsharp/FSharp.Compiler.Service/FSharp.Compiler.Service.fsproj" |> Seq.head
use repo = new GitRepo(__SOURCE_DIRECTORY__)
let proj = VsProj.LoadRelease f
logfn "source linking %s" proj.OutputFilePdb
let compiles = proj.Compiles.SetBaseDirectory __SOURCE_DIRECTORY__
let gitFiles =
compiles
-- "src/assemblyinfo/assemblyinfo*.fs" // not source indexed
// generated and in fsproj as Compile, but in .gitignore, not source indexed
-- "src/fsharp/FSharp.Compiler.Service/illex.fs" // <FsLex Include="..\..\absil\illex.fsl">
-- "src/fsharp/FSharp.Compiler.Service/ilpars.fs"
-- "src/fsharp/FSharp.Compiler.Service/lex.fs"
-- "src/fsharp/FSharp.Compiler.Service/pars.fs"
repo.VerifyChecksums gitFiles
let pdbFiles =
compiles
// generated, not in the fsproj as Compile, not source indexed
++ "src/absil/illex.fsl"
++ "src/absil/ilpars.fsy"
++ "src/fsharp/fsharp.compiler.service/obj/x86/release/fscomp.fs"
++ "src/fsharp/fsharp.compiler.service/obj/x86/release/fsistrings.fs"
++ "src/fsharp/lex.fsl"
++ "src/fsharp/pars.fsy"
proj.VerifyPdbChecksums pdbFiles
proj.CreateSrcSrv (sprintf "%s/%s/{0}/%%var2%%" gitHome gitName) repo.Revision (repo.Paths gitFiles)
Pdbstr.exec proj.OutputFilePdb proj.OutputFilePdbSrcSrv
#endif
)

// --------------------------------------------------------------------------------------
// Run the unit tests using test runner & kill test runner when complete
Expand Down Expand Up @@ -158,11 +200,13 @@ Target "PrepareRelease" DoNothing
Target "All" DoNothing

"Clean"
=?> ("BuildVersion", isAppVeyorBuild)
==> "RestorePackages"
==> "AssemblyInfo"
==> "GenerateFSIStrings"
==> "Prepare"
==> "Build"
==> "SourceLink"
==> "RunTests"
==> "All"

Expand Down
3 changes: 3 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,7 @@
if [ ! -f packages/FAKE/tools/Fake.exe ]; then
mono .nuget/NuGet.exe install FAKE -OutputDirectory packages -ExcludeVersion
fi
if [ ! -f packages/SourceLink.Fake/tools/SourceLink.fsx ]; then
mono .nuget/NuGet.exe install SourceLink.Fake -OutputDirectory packages -ExcludeVersion
fi
mono packages/FAKE/tools/FAKE.exe build.fsx $@

0 comments on commit ac35442

Please sign in to comment.