Skip to content
This repository was archived by the owner on Feb 12, 2023. It is now read-only.

Commit

Permalink
Merge pull request #184 from AArnott/NoWarnOnIntermediateSource
Browse files Browse the repository at this point in the history
Suppress warning for source files that fall under intermediate output path
  • Loading branch information
GeertvanHorrik authored Dec 12, 2017
2 parents b289fb6 + bed2eb6 commit bfc7543
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/GitLink/LinkOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,7 @@ public struct LinkOptions
public string GitWorkingDirectory { get; set; }

public bool IndexAllDepotFiles { get; set; }

public string IntermediateOutputPath { get; set; }
}
}
4 changes: 3 additions & 1 deletion src/GitLink/Linker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,9 @@ public static class Linker
try
{
Repository repo = repository.Value;
repoSourceFiles = sourceFiles.ToDictionary(e => e, e => repo.GetNormalizedPath(e));
repoSourceFiles = sourceFiles
.Where(f => !f.StartsWithIgnoreCase(options.IntermediateOutputPath))
.ToDictionary(e => e, e => repo.GetNormalizedPath(e));
}
catch (RepositoryNotFoundException)
{
Expand Down
11 changes: 11 additions & 0 deletions src/GitLinkTask/LinkPdbToGitRemote.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
namespace GitLinkTask
{
using System;
using System.IO;
using Catel.Logging;
using global::GitLink;
using Microsoft.Build.Framework;
Expand All @@ -31,6 +32,8 @@ public string Method

public string GitWorkingDirectory { get; set; }

public string IntermediateOutputPath { get; set; }

private LinkMethod MethodEnum { get; set; }

public override bool Execute()
Expand All @@ -45,12 +48,20 @@ public override bool Execute()
CommitId = GitCommitId,
GitWorkingDirectory = GitWorkingDirectory,
IndexAllDepotFiles = IndexAllDepotFiles,
IntermediateOutputPath = Path.GetFullPath(AddTrailingSlash(IntermediateOutputPath)),
};
bool success = Linker.Link(PdbFile.GetMetadata("FullPath"), options);

return success && !Log.HasLoggedErrors;
}

private static string AddTrailingSlash(string path)
{
return path.EndsWith(Path.DirectorySeparatorChar.ToString())
? path
: path + Path.DirectorySeparatorChar;
}

private class MSBuildListener : LogListenerBase
{
private readonly TaskLoggingHelper _log;
Expand Down
1 change: 1 addition & 0 deletions src/GitLinkTask/build/GitLink.targets
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
GitRemoteUrl="$(GitLinkGitRemoteUrl)"
GitWorkingDirectory="$(GitWorkingDirectory)"
GitCommitId="$(GitCommitId)"
IntermediateOutputPath="$(IntermediateOutputPath)"
ContinueOnError="$(GitLinkContinueOnError)" />
</Target>
</Project>

0 comments on commit bfc7543

Please sign in to comment.