Navigation Menu

Skip to content
This repository has been archived by the owner on Jun 12, 2021. It is now read-only.

Commit

Permalink
Merge pull request #357 from CaringDev/298_source-stepping
Browse files Browse the repository at this point in the history
add source server support
  • Loading branch information
adamralph committed Dec 21, 2016
2 parents 66797a4 + 811553a commit 11160b9
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 1 deletion.
30 changes: 29 additions & 1 deletion build.csx
Expand Up @@ -15,9 +15,37 @@ targets.Add("restore", () => Cmd("dotnet", "restore"));
targets.Add("build", () => Cmd("dotnet", $"build ./**/project.json -c Release"));

targets.Add(
"pack",
"sourcelink",
DependsOn("build"),
() =>
{
var projects = new[] { "Xbehave.Core", "Xbehave.Execution" };
var url = "https://raw.githubusercontent.com/xbehave/xbehave.net/{0}/%var2%";
foreach (var project in projects)
{
var pdbs =
Directory.EnumerateFiles($"./src/{project}/bin/Release", $"{project}*.pdb", SearchOption.AllDirectories)
.Where(_ => !File.Exists($"{_}.srcsrv") || File.GetLastWriteTime(_) > File.GetLastWriteTime($"{_}.srcsrv"))
.ToList();
if (pdbs.Any())
{
var pdbArg = string.Join(" -p ", pdbs);
var include = $"./src/{project}/**/*.cs";
var exclude = $"./src/{project}/obj/**";
Cmd("./packages/SourceLink.1.1.0/tools/SourceLink.exe", $"index -p {pdbArg} -u {url} -f {include} -nf {exclude}");
foreach (var pdb in pdbs)
{
File.SetLastWriteTime($"{pdb}.srcsrv", File.GetLastWriteTime(pdb));
}
}
}
});

targets.Add(
"pack",
DependsOn("sourcelink"),
() =>
{
var versionSuffix = Environment.GetEnvironmentVariable("VERSION_SUFFIX") ?? "-adhoc";
var buildNumber = Environment.GetEnvironmentVariable("BUILD_NUMBER") ?? "000000";
Expand Down
1 change: 1 addition & 0 deletions packages.config
@@ -1,4 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="simple-targets-csx" version="5.0.0" />
<package id="SourceLink" version="1.1.0" />
</packages>

0 comments on commit 11160b9

Please sign in to comment.