dotnet-installer/build/GenerateResxSource.targets

50 lines
2.1 KiB
Text
Raw Normal View History

<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<UsingTask TaskName="GenerateResxSource" AssemblyFile="$(CLIBuildDll)" />
<Target Name="GenerateResxSource"
BeforeTargets="CoreCompile"
DependsOnTargets="PrepareResourceNames;
GetEmbeddedResourcesWithSourceGeneration;
BatchGenerateResxSource">
<ItemGroup>
<GeneratedResxSource Include="@(EmbeddedResourceSG->'%(SourceOutputPath)')" />
<FileWrites Include="@(GeneratedResxSource)" />
<Compile Include="@(GeneratedResxSource)" />
</ItemGroup>
</Target>
<Target Name="CustomizeResourceNames"
2017-06-07 23:37:04 +00:00
BeforeTargets="PrepareResourceNames;GatherXlf"
>
<ItemGroup>
2017-06-07 23:37:04 +00:00
<EmbeddedResource Condition="'%(EmbeddedResource.Namespace)' != ''">
<ManifestResourceName>%(EmbeddedResource.Namespace).%(EmbeddedResource.Filename)</ManifestResourceName>
</EmbeddedResource>
2017-06-07 23:37:04 +00:00
<XlfSource Condition="'%(XlfSource.Namespace)' != ''">
<ManifestResourceName>%(XlfSource.Namespace).%(XlfSource.Filename)</ManifestResourceName>
<XlfTranslatedFileName>%(XlfSource.Namespace).%(XlfSource.Filename)</XlfTranslatedFileName>
</XlfSource>
</ItemGroup>
</Target>
<Target Name="BatchGenerateResxSource"
Inputs="@(EmbeddedResourceSG)"
Outputs="%(EmbeddedResourceSG.SourceOutputPath)"
>
<GenerateResxSource ResxFile="%(EmbeddedResourceSG.FullPath)"
ResourceName="%(EmbeddedResourceSG.ManifestResourceName)"
SourceOutputPath="%(EmbeddedResourceSG.SourceOutputPath)" />
</Target>
<Target Name="GetEmbeddedResourcesWithSourceGeneration">
<ItemGroup>
2017-06-07 23:37:04 +00:00
<EmbeddedResourceSG Include="@(EmbeddedResource)" Condition="'%(EmbeddedResource.GenerateSource)' == 'true' and '%(EmbeddedResource.XlfLanguage)' == ''" />
<EmbeddedResourceSG>
<SourceOutputPath>$(IntermediateOutputPath)%(EmbeddedResourceSG.ManifestResourceName).cs</SourceOutputPath>
</EmbeddedResourceSG>
</ItemGroup>
</Target>
</Project>