Last active
January 4, 2016 21:39
-
-
Save ctaggart/8682871 to your computer and use it in GitHub Desktop.
SourceLink CodePlex TFS/SVN Demo using SLNTools
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#r "packages/FAKE/tools/FakeLib.dll" | |
#load "packages/SourceLink.Fake/tools/Fake.fsx" | |
open System | |
open System.IO | |
open Fake | |
open Fake.AssemblyInfoFile | |
open SourceLink | |
let revision = "72529" | |
let versionAssembly = "1.1.2.0" | |
let versionFile = "1.1.2.1" | |
Target "Clean" (fun _ -> !! "**/bin/" ++ "**/obj/" |> CleanDirs) | |
Target "AssemblyInfo" (fun _ -> | |
CreateCSharpAssemblyInfo "AssemblyInfoCommon.cs" | |
[ Attribute.Version versionAssembly | |
Attribute.FileVersion versionFile ] | |
) | |
Target "Build" (fun _ -> | |
!! "CWDev.SLNTools.Core.dll/CWDev.SLNTools.Core.dll.csproj" | |
|> MSBuildRelease "" "Rebuild" |> ignore | |
) | |
Target "SourceLink" (fun _ -> | |
use repo = new GitRepo(__SOURCE_DIRECTORY__) | |
!! "CWDev.SLNTools.Core.dll/CWDev.SLNTools.Core.dll.csproj" | |
|> Seq.iter (fun f -> | |
let proj = VsProj.LoadRelease f | |
logfn "source linking %s" proj.OutputFilePdb | |
let files = proj.Compiles -- "../AssemblyInfoCommon.cs" | |
repo.VerifyChecksums files | |
proj.VerifyPdbChecksums files | |
proj.CreateSrcSrv "https://slntools.svn.codeplex.com/svn/!svn/bc/{0}/Main/%var2%" revision (repo.Paths files) | |
Pdbstr.exec proj.OutputFilePdb proj.OutputFilePdbSrcSrv | |
) | |
) | |
Target "NuGet" (fun _ -> | |
let bin = if isTfsBuild then "../bin" else "bin" | |
Directory.CreateDirectory bin |> ignore | |
NuGet (fun p -> | |
{ p with | |
Version = versionFile | |
WorkingDir = "CWDev.SLNTools.Core.dll/bin/Release" | |
OutputPath = bin | |
}) "CWDev.SLNTools.Core.dll/CWDev.SLNTools.Core.nuspec" | |
) | |
"Clean" | |
==> "AssemblyInfo" | |
==> "Build" | |
==> "SourceLink" | |
==> "NuGet" | |
RunTargetOrDefault "NuGet" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
nuget.exe restore | |
if not exist packages\FAKE\tools\Fake.exe ( | |
nuget.exe install FAKE -OutputDirectory packages -ExcludeVersion | |
) | |
if not exist packages\SourceLink.Fake\tools\Fake.fsx ( | |
nuget.exe install SourceLink.Fake -OutputDirectory packages -ExcludeVersion -Prerelease | |
) | |
packages\FAKE\tools\FAKE.exe build.fsx %* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0"?> | |
<package > | |
<metadata> | |
<id>SLNTools.Core</id> | |
<version>1.1.2.1</version> | |
<authors>Christian Warren</authors> | |
<licenseUrl>http://slntools.codeplex.com/license</licenseUrl> | |
<projectUrl>http://slntools.codeplex.com</projectUrl> | |
<requireLicenseAcceptance>false</requireLicenseAcceptance> | |
<description>'Tools for SLN File' make it easier for developers to compare, merge or filter the ".sln" files generated by Visual Studio.</description> | |
</metadata> | |
<files> | |
<file src="CWDev.SLNTools.Core.dll" target="lib\net20" /> | |
<file src="CWDev.SLNTools.Core.pdb" target="lib\net20" /> | |
<file src="CWDev.SLNTools.Core.xml" target="lib\net20" /> | |
</files> | |
</package> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment