Skip to content

Commit

Permalink
fix: Don't emit/merge empty substitutions file
Browse files Browse the repository at this point in the history
  • Loading branch information
ebariche committed Apr 26, 2024
1 parent ea348a1 commit f97079d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -204,13 +204,17 @@
</_UnoUpriResource>
</ItemGroup>

<PropertyGroup>
<_UnoUpriSubstitutionsFile>$(IntermediateOutputPath)\Substitutions\UpriResources.Substitutions.xml</_UnoUpriSubstitutionsFile>
</PropertyGroup>

<UpriSubstitutionsGeneratorTask_v0
AssemblyName="$(AssemblyName)"
Resources="@(_UnoUpriResource)"
OutputFile="$(IntermediateOutputPath)\Substitutions\UpriResources.Substitutions.xml" />
OutputFile="$(_UnoUpriSubstitutionsFile)" />

<ItemGroup>
<FileWrites Include="$(IntermediateOutputPath)\Substitutions\UpriResources.Substitutions.xml" />
<FileWrites Include="$(_UnoUpriSubstitutionsFile)" Condition="Exists('$(_UnoUpriSubstitutionsFile)')" />
</ItemGroup>

</Target>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public override bool Execute()
{
// Debugger.Launch();

if (!string.IsNullOrEmpty(AssemblyName) && Resources != null && !string.IsNullOrEmpty(OutputFile))
if (!string.IsNullOrEmpty(AssemblyName) && Resources?.Length > 0 && !string.IsNullOrEmpty(OutputFile))
{
var xml = new XmlDocument();

Expand Down

0 comments on commit f97079d

Please sign in to comment.