Skip to content

Commit

Permalink
actions - add .net 8.0
Browse files Browse the repository at this point in the history
  • Loading branch information
NeVeSpl committed Feb 10, 2024
1 parent c2def77 commit 9c9a704
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ jobs:
uses: actions/setup-dotnet@v1
with:
dotnet-version: 7.0.x

- name: Setup .NET 8.0
uses: actions/setup-dotnet@v1
with:
dotnet-version: 8.0.x

- name: Restore dependencies
run: dotnet restore
Expand Down
2 changes: 1 addition & 1 deletion NTypewriter.Runtime/CodeModel/CodeModelBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public static async Task<ICodeModel> Build(Solution solution, IEnumerable<string

if ((project.SupportsCompilation) && (isProjectOnTheList))
{
Compilation compilation = await project.GetCompilationAsync().ConfigureAwait(false);
Compilation compilation = await project.GetCompilationAsync().ConfigureAwait(true);
var codeModel = Build(compilation, namespacesToBeSearched, searchInReferencedProjectsAndAssemblies);
compositeCodeModel.Add(codeModel);
}
Expand Down
6 changes: 4 additions & 2 deletions NTypewriter.SourceGenerator/SourceGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,8 @@ public void Execute(GeneratorExecutionContext context)
if (doRender == false) return;

try
{var templates = context.AdditionalFiles.Where(x => x.Path.EndsWith(".nt")).Select(x => new TemplateToRender(x.Path, context.Compilation.AssemblyName) {Content = x.GetText().ToString()}).ToList();
{
var templates = context.AdditionalFiles.Where(x => x.Path.EndsWith(".nt")).Select(x => new TemplateToRender(x.Path, context.Compilation.AssemblyName) {Content = x.GetText().ToString()}).ToList();
var userCodePaths = context.Compilation.SyntaxTrees.Where(x => x.FilePath?.EndsWith(".nt.cs") == true).Select(x => x.FilePath).ToList();

var userCodeProvider = new UserCodeProvider(userCodePaths);
Expand All @@ -106,7 +107,8 @@ public void Execute(GeneratorExecutionContext context)
File.WriteAllText(projectContext.LogFilePath, log);
}
catch (Exception ex)
{context.ReportDiagnostic(Diagnostic.Create(Diagnostics.Exception, Location.None, ex.ToString()));
{
context.ReportDiagnostic(Diagnostic.Create(Diagnostics.Exception, Location.None, ex.ToString()));
}
}

Expand Down

0 comments on commit 9c9a704

Please sign in to comment.