Skip to content

Commit

Permalink
fix for global namespaces generated filename
Browse files Browse the repository at this point in the history
  • Loading branch information
neuecc committed Dec 15, 2021
1 parent 695d442 commit c4010f7
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/UnitGenerator/SourceGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,14 @@ public void Execute(GeneratorExecutionContext context)
};

var text = template.TransformText();
context.AddSource($"{template.Namespace}.{template.Name}.Generated.cs", text);
if (template.Namespace == null)
{
context.AddSource($"{template.Name}.Generated.cs", text);
}
else
{
context.AddSource($"{template.Namespace}.{template.Name}.Generated.cs", text);
}
}
}
catch (Exception ex)
Expand Down

0 comments on commit c4010f7

Please sign in to comment.