From dcf6c427f56a1d1137cf5313f0be4fce240f7729 Mon Sep 17 00:00:00 2001 From: Cameron Taggart Date: Tue, 4 Nov 2014 10:18:37 -0800 Subject: [PATCH 1/7] add source indexing using SourceLink --- .gitignore | 1 + build.cmd | 1 + build.fsx | 32 +++++++++++++++++++++++++++++--- 3 files changed, 31 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index b9089361..46146168 100644 --- a/.gitignore +++ b/.gitignore @@ -69,4 +69,5 @@ nunit-*.xml *.userprefs packaging/ tools/FAKE.Core +tools/SourceLink.Fake *.ncrunch* \ No newline at end of file diff --git a/build.cmd b/build.cmd index 0689b3f0..35a9d8d7 100644 --- a/build.cmd +++ b/build.cmd @@ -1,6 +1,7 @@ @echo off "tools\nuget\nuget.exe" "install" "FAKE.Core" "-OutputDirectory" "tools" "-ExcludeVersion" "-version" "2.18.1" +"tools\nuget\nuget.exe" "install" "SourceLink.Fake" "-OutputDirectory" "tools" "-ExcludeVersion" "-version" "0.4.2" :Build cls diff --git a/build.fsx b/build.fsx index 07a73b1d..9ccf1652 100644 --- a/build.fsx +++ b/build.fsx @@ -1,6 +1,8 @@ #r @"tools\FAKE.Core\tools\FakeLib.dll" +#load "tools/SourceLink.Fake/tools/SourceLink.fsx" open Fake open System +open SourceLink let authors = ["GitHub"] @@ -94,6 +96,24 @@ Target "IntegrationTests" (fun _ -> |> traceImportant ) +Target "SourceLink" (fun _ -> + if Pdbstr.tryFind().IsSome then + use repo = new GitRepo(__SOURCE_DIRECTORY__) + [ "Octokit/Octokit.csproj" + "Octokit/Octokit-netcore45.csproj" + "Octokit/Octokit-Portable.csproj" + "Octokit.Reactive/Octokit.Reactive.csproj" ] + |> Seq.iter (fun pf -> + let proj = VsProj.LoadRelease pf + logfn "source linking %s" proj.OutputFilePdb + let files = (proj.Compiles -- "SolutionInfo.cs").SetBaseDirectory __SOURCE_DIRECTORY__ + repo.VerifyChecksums files + proj.VerifyPdbChecksums files + proj.CreateSrcSrv "https://raw.githubusercontent.com/octokit/octokit.net/{0}/%var2%" repo.Revision (repo.Paths files) + Pdbstr.exec proj.OutputFilePdb proj.OutputFilePdbSrcSrv + ) +) + Target "CreateOctokitPackage" (fun _ -> let net45Dir = packagingDir @@ "lib/net45/" let netcore45Dir = packagingDir @@ "lib/netcore45/" @@ -101,8 +121,11 @@ Target "CreateOctokitPackage" (fun _ -> CleanDirs [net45Dir; netcore45Dir; portableDir] CopyFile net45Dir (buildDir @@ "Release/Net45/Octokit.dll") + CopyFile net45Dir (buildDir @@ "Release/Net45/Octokit.pdb") CopyFile netcore45Dir (buildDir @@ "Release/NetCore45/Octokit.dll") + CopyFile netcore45Dir (buildDir @@ "Release/NetCore45/Octokit.pdb") CopyFile portableDir (buildDir @@ "Release/Portable/Octokit.dll") + CopyFile portableDir (buildDir @@ "Release/Portable/Octokit.pdb") CopyFiles packagingDir ["LICENSE.txt"; "README.md"; "ReleaseNotes.md"] NuGet (fun p -> @@ -124,6 +147,7 @@ Target "CreateOctokitReactivePackage" (fun _ -> CleanDirs [net45Dir] CopyFile net45Dir (reactiveBuildDir @@ "Release/Net45/Octokit.Reactive.dll") + CopyFile net45Dir (reactiveBuildDir @@ "Release/Net45/Octokit.Reactive.pdb") CopyFiles reactivePackagingDir ["LICENSE.txt"; "README.md"; "ReleaseNotes.md"] NuGet (fun p -> @@ -150,7 +174,7 @@ Target "CreatePackages" DoNothing "Clean" ==> "AssemblyInfo" ==> "CheckProjects" - ==> "BuildApp" + ==> "BuildApp" "UnitTests" ==> "Default" @@ -161,9 +185,11 @@ Target "CreatePackages" DoNothing "IntegrationTests" ==> "Default" -"CreateOctokitPackage" +"SourceLink" + ==> "CreateOctokitPackage" ==> "CreatePackages" -"CreateOctokitReactivePackage" +"SourceLink" + ==> "CreateOctokitReactivePackage" ==> "CreatePackages" RunTargetOrDefault "Default" From 124dd7f689d64c5e022c1816f84c1e0faa88d6b4 Mon Sep 17 00:00:00 2001 From: Cameron Taggart Date: Tue, 4 Nov 2014 11:24:57 -0800 Subject: [PATCH 2/7] add an appveyor.yml --- Octokit.sln | 3 ++- appveyor.yml | 11 +++++++++++ build.fsx | 6 ++---- 3 files changed, 15 insertions(+), 5 deletions(-) create mode 100644 appveyor.yml diff --git a/Octokit.sln b/Octokit.sln index d1b5316a..2ce3e07e 100644 --- a/Octokit.sln +++ b/Octokit.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 2013 -VisualStudioVersion = 12.0.21005.1 +VisualStudioVersion = 12.0.30723.0 MinimumVisualStudioVersion = 10.0.40219.1 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Octokit", "Octokit\Octokit.csproj", "{08DD4305-7787-4823-A53F-4D0F725A07F3}" EndProject @@ -11,6 +11,7 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Octokit.Tests.Integration", EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Build", "Build", "{CEC9D451-6291-4EDF-971A-D398144FBF96}" ProjectSection(SolutionItems) = preProject + appveyor.yml = appveyor.yml build.cmd = build.cmd build.fsx = build.fsx script\cibuild.ps1 = script\cibuild.ps1 diff --git a/appveyor.yml b/appveyor.yml new file mode 100644 index 00000000..67dcba0d --- /dev/null +++ b/appveyor.yml @@ -0,0 +1,11 @@ +init: + - git config --global core.autocrlf input +build_script: + - cmd: build.cmd BuildApp + - cmd: build.cmd UnitTests + #- cmd: build.cmd IntegrationTests + - cmd: build.cmd SourceLink + - cmd: build.cmd CreateOctokitPackage +test: off +artifacts: + - path: packaging\*.nupkg diff --git a/build.fsx b/build.fsx index 9ccf1652..f4000391 100644 --- a/build.fsx +++ b/build.fsx @@ -185,11 +185,9 @@ Target "CreatePackages" DoNothing "IntegrationTests" ==> "Default" -"SourceLink" - ==> "CreateOctokitPackage" +"CreateOctokitPackage" ==> "CreatePackages" -"SourceLink" - ==> "CreateOctokitReactivePackage" +"CreateOctokitReactivePackage" ==> "CreatePackages" RunTargetOrDefault "Default" From daa7f91425c153375f19c2d39dea354138dee178 Mon Sep 17 00:00:00 2001 From: Cameron Taggart Date: Tue, 4 Nov 2014 11:33:23 -0800 Subject: [PATCH 3/7] enable IntegrationTests --- appveyor.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 67dcba0d..c96785dc 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -3,9 +3,9 @@ init: build_script: - cmd: build.cmd BuildApp - cmd: build.cmd UnitTests - #- cmd: build.cmd IntegrationTests + - cmd: build.cmd IntegrationTests - cmd: build.cmd SourceLink - - cmd: build.cmd CreateOctokitPackage + - cmd: build.cmd CreatePackages test: off artifacts: - path: packaging\*.nupkg From 9bc1a256567422cd1cf37b72a558d0f48ac6fb06 Mon Sep 17 00:00:00 2001 From: Cameron Taggart Date: Tue, 4 Nov 2014 11:44:15 -0800 Subject: [PATCH 4/7] MSBuildVerbosity.Minimal --- build.fsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/build.fsx b/build.fsx index f4000391..d2b04114 100644 --- a/build.fsx +++ b/build.fsx @@ -29,6 +29,8 @@ let releaseNotes = let buildMode = getBuildParamOrDefault "buildMode" "Release" +MSBuildDefaults <- { MSBuildDefaults with Verbosity = Some MSBuildVerbosity.Minimal } + Target "Clean" (fun _ -> CleanDirs [buildDir; reactiveBuildDir; testResultsDir; packagingRoot; packagingDir; reactivePackagingDir] ) From 1ad87b552de03b5355ccb87ec5cad13d88b26187 Mon Sep 17 00:00:00 2001 From: Cameron Taggart Date: Tue, 4 Nov 2014 11:54:49 -0800 Subject: [PATCH 5/7] don't buildapp again when creatin the packages --- appveyor.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index c96785dc..3547da5a 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -5,7 +5,9 @@ build_script: - cmd: build.cmd UnitTests - cmd: build.cmd IntegrationTests - cmd: build.cmd SourceLink - - cmd: build.cmd CreatePackages + #- cmd: build.cmd CreatePackages + - cmd: build.cmd CreateOctokitPackage + - cmd: build.cmd CreateOctokitReactivePackage test: off artifacts: - path: packaging\*.nupkg From 20249c237f129d7794c0e5554111825d09b36734 Mon Sep 17 00:00:00 2001 From: Cameron Taggart Date: Tue, 4 Nov 2014 12:29:13 -0800 Subject: [PATCH 6/7] pass in auth variables for integration tests --- appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index 3547da5a..8032b982 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -3,7 +3,7 @@ init: build_script: - cmd: build.cmd BuildApp - cmd: build.cmd UnitTests - - cmd: build.cmd IntegrationTests + - cmd: build.cmd IntegrationTests -ev OCTOKIT_GITHUBUSERNAME "%OCTOKIT_GITHUBUSERNAME%" -ev OCTOKIT_GITHUBPASSWORD "%OCTOKIT_GITHUBPASSWORD%" - cmd: build.cmd SourceLink #- cmd: build.cmd CreatePackages - cmd: build.cmd CreateOctokitPackage From d0fffd4f7ccc5b72b46b4774df4f2c53a04930ef Mon Sep 17 00:00:00 2001 From: Cameron Taggart Date: Wed, 5 Nov 2014 14:47:56 -0800 Subject: [PATCH 7/7] don't skip running SourceLink silently --- build.fsx | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/build.fsx b/build.fsx index d2b04114..4a734ea6 100644 --- a/build.fsx +++ b/build.fsx @@ -99,21 +99,20 @@ Target "IntegrationTests" (fun _ -> ) Target "SourceLink" (fun _ -> - if Pdbstr.tryFind().IsSome then - use repo = new GitRepo(__SOURCE_DIRECTORY__) - [ "Octokit/Octokit.csproj" - "Octokit/Octokit-netcore45.csproj" - "Octokit/Octokit-Portable.csproj" - "Octokit.Reactive/Octokit.Reactive.csproj" ] - |> Seq.iter (fun pf -> - let proj = VsProj.LoadRelease pf - logfn "source linking %s" proj.OutputFilePdb - let files = (proj.Compiles -- "SolutionInfo.cs").SetBaseDirectory __SOURCE_DIRECTORY__ - repo.VerifyChecksums files - proj.VerifyPdbChecksums files - proj.CreateSrcSrv "https://raw.githubusercontent.com/octokit/octokit.net/{0}/%var2%" repo.Revision (repo.Paths files) - Pdbstr.exec proj.OutputFilePdb proj.OutputFilePdbSrcSrv - ) + use repo = new GitRepo(__SOURCE_DIRECTORY__) + [ "Octokit/Octokit.csproj" + "Octokit/Octokit-netcore45.csproj" + "Octokit/Octokit-Portable.csproj" + "Octokit.Reactive/Octokit.Reactive.csproj" ] + |> Seq.iter (fun pf -> + let proj = VsProj.LoadRelease pf + logfn "source linking %s" proj.OutputFilePdb + let files = (proj.Compiles -- "SolutionInfo.cs").SetBaseDirectory __SOURCE_DIRECTORY__ + repo.VerifyChecksums files + proj.VerifyPdbChecksums files + proj.CreateSrcSrv "https://raw.githubusercontent.com/octokit/octokit.net/{0}/%var2%" repo.Revision (repo.Paths files) + Pdbstr.exec proj.OutputFilePdb proj.OutputFilePdbSrcSrv + ) ) Target "CreateOctokitPackage" (fun _ ->