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/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..8032b982 --- /dev/null +++ b/appveyor.yml @@ -0,0 +1,13 @@ +init: + - git config --global core.autocrlf input +build_script: + - cmd: build.cmd BuildApp + - cmd: build.cmd UnitTests + - 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 + - cmd: build.cmd CreateOctokitReactivePackage +test: off +artifacts: + - path: packaging\*.nupkg 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..4a734ea6 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"] @@ -27,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] ) @@ -94,6 +98,23 @@ Target "IntegrationTests" (fun _ -> |> traceImportant ) +Target "SourceLink" (fun _ -> + 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 +122,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 +148,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 +175,7 @@ Target "CreatePackages" DoNothing "Clean" ==> "AssemblyInfo" ==> "CheckProjects" - ==> "BuildApp" + ==> "BuildApp" "UnitTests" ==> "Default"