Skip to content

Commit e8f244b

Browse files
committed
C#: Relax dotnet rule.
1 parent 6f74387 commit e8f244b

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

csharp/autobuilder/Semmle.Autobuild.CSharp/DotNetRule.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public BuildScript Analyse(IAutobuilder<CSharpAutobuildOptions> builder, bool au
3232
NotDotNetProjects = builder.ProjectsOrSolutionsToBuild
3333
.SelectMany(p => new[] { p }.Concat(p.IncludedProjects))
3434
.OfType<Project<CSharpAutobuildOptions>>()
35-
.Where(p => !p.DotNetProject);
35+
.Where(p => !p.MaybeDotNetProject);
3636
var notDotNetProject = NotDotNetProjects.FirstOrDefault();
3737

3838
if (notDotNetProject is not null)

csharp/autobuilder/Semmle.Autobuild.Shared/Project.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public class Project<TAutobuildOptions> : ProjectOrSolution<TAutobuildOptions> w
1717
/// <summary>
1818
/// Holds if this project is for .Net core.
1919
/// </summary>
20-
public bool DotNetProject { get; private set; }
20+
public bool MaybeDotNetProject { get; init; }
2121

2222
public bool ValidToolsVersion { get; private set; }
2323

@@ -32,7 +32,11 @@ public Project(Autobuilder<TAutobuildOptions> builder, string path) : base(build
3232
includedProjectsLazy = new Lazy<List<Project<TAutobuildOptions>>>(() => new List<Project<TAutobuildOptions>>());
3333

3434
if (!builder.Actions.FileExists(FullPath))
35+
{
36+
// We can't out-rule that this is a dotnet project.
37+
MaybeDotNetProject = true;
3538
return;
39+
}
3640

3741
XmlDocument projFile;
3842
try
@@ -51,7 +55,7 @@ public Project(Autobuilder<TAutobuildOptions> builder, string path) : base(build
5155
{
5256
if (root.HasAttribute("Sdk"))
5357
{
54-
DotNetProject = true;
58+
MaybeDotNetProject = true;
5559
return;
5660
}
5761

0 commit comments

Comments
 (0)