Skip to content

Commit

Permalink
When using EnableRexCodeGenerator, this should Just Work
Browse files Browse the repository at this point in the history
Default to Just Works resources generation. See https://www.cazzulino.com/resources.html
  • Loading branch information
kzu authored Apr 10, 2023
1 parent 13d67e2 commit c7235d7
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,15 @@
<UpToDateCheck Include="@(None);@(Content);@(EmbeddedResource)" />
<!-- We'll typically use ThisAssembly.Strings instead of the built-in resource manager codegen -->
<EmbeddedResource Update="@(EmbeddedResource)" Generator="" Condition="'$(EnableRexCodeGenerator)' != 'true'" />
<EmbeddedResource Update="@(EmbeddedResource)" Condition="'$(EnableRexCodeGenerator)' == 'true'">
<!-- Default to Just Works resources generation. See https://www.cazzulino.com/resources.html -->
<Generator>MSBuild:Compile</Generator>
<StronglyTypedFileName>$(IntermediateOutputPath)\$([MSBuild]::ValueOrDefault('%(RelativeDir)', '').Replace('\', '.').Replace('/', '.'))%(Filename).g$(DefaultLanguageSourceExtension)</StronglyTypedFileName>
<StronglyTypedLanguage>$(Language)</StronglyTypedLanguage>
<StronglyTypedNamespace Condition="'%(RelativeDir)' == ''">$(RootNamespace)</StronglyTypedNamespace>
<StronglyTypedNamespace Condition="'%(RelativeDir)' != ''">$(RootNamespace).$([MSBuild]::ValueOrDefault('%(RelativeDir)', '').Replace('\', '.').Replace('/', '.').TrimEnd('.'))</StronglyTypedNamespace>
<StronglyTypedClassName>%(Filename)</StronglyTypedClassName>
</EmbeddedResource>
</ItemGroup>

<Target Name="IsPackable" Returns="@(IsPackable)">
Expand Down Expand Up @@ -161,4 +170,4 @@
<Import Project="Directory.targets" Condition="Exists('Directory.targets')"/>
<Import Project="Directory.targets.user" Condition="Exists('Directory.targets.user')" />

</Project>
</Project>

0 comments on commit c7235d7

Please sign in to comment.