Merge pull request #17132 from dotnet-bot/from-tfs
[platform/upstream/coreclr.git] / src / mscorlib / GenerateSplitStringResources.targets
1 <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2   <PropertyGroup>
3     <PrepareResourcesDependsOn>GenerateSplitStringResources;$(PrepareResourcesDependsOn)</PrepareResourcesDependsOn>
4   </PropertyGroup>
5
6   <PropertyGroup>
7     <PreprocessFileTaskAsssemblyPath Condition="'$(PreprocessFileTaskAsssemblyPath)' == ''">$(BuildToolsTaskDir)Microsoft.DotNet.Build.Tasks.dll</PreprocessFileTaskAsssemblyPath>
8   </PropertyGroup>
9
10   <UsingTask TaskName="PreprocessFile" AssemblyFile="$(PreprocessFileTaskAsssemblyPath)" />
11
12   <Target Name="GenerateSplitStringResources"
13           Inputs="@(SplitTextStringResource)"
14           Outputs="@(SplitTextStringResource->'$(IntermediateOutputPath)%(Filename).txt')">
15          
16     <ItemGroup>
17       <Internal_ResGenDefines Remove="@(Internal_ResGenDefines)" />
18       <Internal_ResGenDefines Include="INCLUDE_DEBUG" />
19       <Internal_ResGenDefines Include="INCLUDE_RUNTIME" />
20       <Internal_ResGenDefines Include="%(SplitTextStringResource.ResGenDefines)" />
21     </ItemGroup>    
22
23     <PreprocessFile SourceFile="%(SplitTextStringResource.Identity)" OutputFile="$(IntermediateOutputPath)%(SplitTextStringResource.Filename).txt" Defines="@(Internal_ResGenDefines)" />
24
25     <GenerateResource Sources="$(IntermediateOutputPath)%(SplitTextStringResource.Filename).txt"
26                       OutputResources="$(IntermediateOutputPath)%(SplitTextStringResource.Filename).resources"
27                       ExecuteAsTool="false" />
28
29     <ItemGroup>
30       <EmbeddedResource Include="@(SplitTextStringResource->'$(IntermediateOutputPath)%(Filename).resources')">
31         <WithCulture>false</WithCulture>
32         <ManifestResourceName>%(Filename)</ManifestResourceName>
33       </EmbeddedResource>
34       <Clean Include="$(IntermediateOutputPath)%(SplitTextStringResource.Filename).txt" />
35       <Clean Include="$(IntermediateOutputPath)%(SplitTextStringResource.Filename).resources" />
36     </ItemGroup>
37
38     <ItemGroup>
39       <Internal_ResGenDefines Remove="@(Internal_ResGenDefines)" />
40     </ItemGroup>    
41   </Target>
42 </Project>