C#: Recognize .proj files in autobuilder#512
Conversation
|
This pull request introduces 1 alert and fixes 1 when merging 1afc529 into 4e2d40a - view on LGTM.com new alerts:
fixed alerts:
Comment posted by LGTM.com |
calumgrant
left a comment
There was a problem hiding this comment.
Overall extremely nice, and I think the new logic is easier to defend and probably builds more stuff. Just some trivial comments.
| Select(f => f.ProjectOrSolution); | ||
| Log(Severity.Info, $"Found multiple '{extension}' files, giving up: {string.Join(", ", candidates)}."); | ||
| files = new IProjectOrSolution[0]; | ||
| return true; |
There was a problem hiding this comment.
This return value is a bit weird - false means carry on and true means stop success or failure.
There was a problem hiding this comment.
The return value behaves like e.g. the return value of int.TryParse(string s, out int i); the output parameter contains valid data iff the return value is true.
There was a problem hiding this comment.
But actually there is no need to have both the Boolean and the enumerable, so I will rewrite.
| ThenBy(s => s.Path.Length). | ||
| bool FindFiles(string extension, Func<string, ProjectOrSolution> create, out IEnumerable<IProjectOrSolution> files) | ||
| { | ||
| var allFiles = GetExtensions(extension). |
There was a problem hiding this comment.
allFiles -> matchingFiles ?
| Where(s => s.ProjectCount > 0). | ||
| OrderByDescending(s => s.ProjectCount). | ||
| ThenBy(s => s.Path.Length). | ||
| bool FindFiles(string extension, Func<string, ProjectOrSolution> create, out IEnumerable<IProjectOrSolution> files) |
There was a problem hiding this comment.
I don't think this particularly needs to be a local function.
There was a problem hiding this comment.
I think local functions are nice (as opposed to private static methods) when they are only used inside one particular callable, as in this case.
| /// <summary> | ||
| /// Gets the directory of <paramref name="path"/>, Path.GetDirectoryName(). | ||
| /// </summary> | ||
| string GetDirectoryName(string path); |
There was a problem hiding this comment.
This probably doesn't need to be stubbed out as it doesn't touch the filesystem.
|
This pull request introduces 1 alert and fixes 1 when merging fb463ae into 1739cab - view on LGTM.com new alerts:
fixed alerts:
Comment posted by LGTM.com |
|
This pull request introduces 1 alert and fixes 1 when merging 8648c8e into e062851 - view on LGTM.com new alerts:
fixed alerts:
Comment posted by LGTM.com |
jf205
left a comment
There was a problem hiding this comment.
One tiny comment, otherwise all good 👍
| /// <summary> | ||
| /// Full file paths of files found in the project directory. | ||
| /// Full file paths of files found in the project directory, as well | ||
| /// their distance from the project root folder. The list is sorted |
There was a problem hiding this comment.
as well as their distance....? (same thing for three summaries below)
|
This pull request introduces 1 alert and fixes 1 when merging 9d0cd1a into 201f64e - view on LGTM.com new alerts:
fixed alerts:
Comment posted by LGTM.com |
9d0cd1a to
743fc85
Compare
|
Rebased. |
|
This pull request introduces 1 alert and fixes 1 when merging 743fc85 into 201f64e - view on LGTM.com new alerts:
fixed alerts:
Comment posted by LGTM.com |
When determining the target of `msbuild` or `dotnet build`, first look for `.proj` files, then `.sln` files, and finally `.csproj`/`.vcxproj` files. In all three cases, choose the project/solution file closest to the root.
743fc85 to
1939773
Compare
|
Rebased again. |
|
This pull request introduces 1 alert and fixes 1 when merging 1939773 into 4ad5923 - view on LGTM.com new alerts:
fixed alerts:
Comment posted by LGTM.com |
adityasharad
left a comment
There was a problem hiding this comment.
Approved by reviewers, and internal PR has passed tests.
…ix-onto-rc-31 Apply package perf fix to rc/3.1
When determining the target of
msbuildordotnet build, first look for.projfiles, then.slnfiles, and finally.csproj/.vcxprojfiles. In all three cases, choose the project/solution file closest to the root.@calumgrant @jf205