forked from dotnet/runtime
-
Notifications
You must be signed in to change notification settings - Fork 0
/
resources.targets
34 lines (30 loc) · 2.23 KB
/
resources.targets
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<Project>
<PropertyGroup>
<ResourcesSourceFileExtension Condition="'$(MSBuildProjectExtension)' == '.csproj'">.cs</ResourcesSourceFileExtension>
<ResourcesSourceFileExtension Condition="'$(MSBuildProjectExtension)' == '.vbproj'">.vb</ResourcesSourceFileExtension>
<StringResourcesPath Condition="'$(StringResourcesPath)' == '' and Exists('$(MSBuildProjectDirectory)/Resources/Strings.resx')">$(MSBuildProjectDirectory)/Resources/Strings.resx</StringResourcesPath>
<StringResourcesNamespace Condition="'$(StringResourcesNamespace)' == ''">System</StringResourcesNamespace>
<StringResourcesClassName Condition="'$(StringResourcesClassName)' == ''">SR</StringResourcesClassName>
<StringResourcesName Condition="'$(StringResourcesName)' == ''">FxResources.$(AssemblyName).$(StringResourcesClassName)</StringResourcesName>
<!-- We define our own implementation of GetResourceString -->
<GenerateResxSourceOmitGetResourceString>true</GenerateResxSourceOmitGetResourceString>
<!-- For debug builds we include the full value string so that we get actual resources, even in the case the toolchain strips the resources file -->
<GenerateResxSourceIncludeDefaultValues Condition="'$(Configuration)' == 'Debug'">true</GenerateResxSourceIncludeDefaultValues>
</PropertyGroup>
<!-- Include files under StringResourcesPath by convention unless OmitResources is set. -->
<ItemGroup Condition="'$(StringResourcesPath)' != '' and '$(OmitResources)' != 'true'">
<EmbeddedResource Include="$(StringResourcesPath)">
<Visible>true</Visible>
<ManifestResourceName>$(StringResourcesName)</ManifestResourceName>
<GenerateSource>true</GenerateSource>
<ClassName>$(StringResourcesNamespace).$(StringResourcesClassName)</ClassName>
</EmbeddedResource>
</ItemGroup>
<!-- Include common SR helper when resources are included unless SkipCommonResourcesIncludes is set. -->
<ItemGroup Condition="Exists('$(StringResourcesPath)') and '$(OmitResources)' != 'true' and '$(SkipCommonResourcesIncludes)' == ''">
<Compile Include="$(CommonPath)/System/SR$(ResourcesSourceFileExtension)">
<Visible>true</Visible>
<Link>Resources/Common/SR$(ResourcesSourceFileExtension)</Link>
</Compile>
</ItemGroup>
</Project>