-
-
Notifications
You must be signed in to change notification settings - Fork 213
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
roll back MauiTestUtils upstream update
- Loading branch information
Showing
65 changed files
with
2,784 additions
and
4,680 deletions.
There are no files selected for viewing
35 changes: 17 additions & 18 deletions
35
test/MauiTestUtils/DeviceTests.Runners.SourceGen/CodeBehindGenerator.cs
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,27 @@ | ||
using Microsoft.CodeAnalysis; | ||
|
||
namespace Microsoft.Maui.TestUtils.DeviceTests.Runners.SourceGen | ||
namespace Microsoft.Maui.TestUtils.DeviceTests.Runners.SourceGen; | ||
|
||
[Generator] | ||
public class CodeBehindGenerator : ISourceGenerator | ||
{ | ||
[Generator] | ||
public class CodeBehindGenerator : ISourceGenerator | ||
public void Initialize(GeneratorInitializationContext context) | ||
{ | ||
public void Initialize(GeneratorInitializationContext context) | ||
{ | ||
//#if DEBUG | ||
//if (!System.Diagnostics.Debugger.IsAttached) | ||
// System.Diagnostics.Debugger.Launch(); | ||
//#endif | ||
} | ||
//#if DEBUG | ||
//if (!System.Diagnostics.Debugger.IsAttached) | ||
// System.Diagnostics.Debugger.Launch(); | ||
//#endif | ||
} | ||
|
||
public void Execute(GeneratorExecutionContext context) | ||
{ | ||
if (!context.AnalyzerConfigOptions.GlobalOptions.TryGetValue("build_property.TargetFramework", out var targetFramework)) | ||
return; | ||
public void Execute(GeneratorExecutionContext context) | ||
{ | ||
if (!context.AnalyzerConfigOptions.GlobalOptions.TryGetValue("build_property.TargetFramework", out var targetFramework)) | ||
return; | ||
|
||
context.Log($"TargetFramework: {targetFramework}"); | ||
context.Log($"TargetFramework: {targetFramework}"); | ||
|
||
var generator = new RunnerGenerator(context, targetFramework); | ||
var generator = new RunnerGenerator(context, targetFramework); | ||
|
||
generator?.Generate(); | ||
} | ||
generator?.Generate(); | ||
} | ||
} |
27 changes: 13 additions & 14 deletions
27
test/MauiTestUtils/DeviceTests.Runners.SourceGen/GeneratorDiagnostics.cs
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,19 @@ | ||
using System.Diagnostics; | ||
using Microsoft.CodeAnalysis; | ||
|
||
namespace Microsoft.Maui.TestUtils.DeviceTests.Runners.SourceGen | ||
namespace Microsoft.Maui.TestUtils.DeviceTests.Runners.SourceGen; | ||
|
||
static class GeneratorDiagnostics | ||
{ | ||
static class GeneratorDiagnostics | ||
{ | ||
public static readonly DiagnosticDescriptor LoggingMessage = new DiagnosticDescriptor( | ||
id: "TST1001", | ||
title: "Logging Message", | ||
messageFormat: "{0}", | ||
category: "Logging", | ||
DiagnosticSeverity.Info, | ||
isEnabledByDefault: true); | ||
public static readonly DiagnosticDescriptor LoggingMessage = new DiagnosticDescriptor( | ||
id: "TST1001", | ||
title: "Logging Message", | ||
messageFormat: "{0}", | ||
category: "Logging", | ||
DiagnosticSeverity.Info, | ||
isEnabledByDefault: true); | ||
|
||
[Conditional("DEBUG")] | ||
public static void Log(this GeneratorExecutionContext context, string message) => | ||
context.ReportDiagnostic(Diagnostic.Create(LoggingMessage, Location.None, message)); | ||
} | ||
[Conditional("DEBUG")] | ||
public static void Log(this GeneratorExecutionContext context, string message) => | ||
context.ReportDiagnostic(Diagnostic.Create(LoggingMessage, Location.None, message)); | ||
} |
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
2 changes: 1 addition & 1 deletion
2
...auiTestUtils/DeviceTests.Runners.SourceGen/TestUtils.DeviceTests.Runners.SourceGen.csproj
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
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
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.