1
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3
<Import Project="Microsoft.Common.targets" />
4
<UsingTask TaskName="Microsoft.Build.Tasks.CreateCSharpManifestResourceName" AssemblyName="Microsoft.Build.Tasks, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
6
<MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildBinPath)\Microsoft.CSharp.targets</MSBuildAllProjects>
7
<DefaultLanguageSourceExtension>.cs</DefaultLanguageSourceExtension>
8
<Language>C#</Language>
12
The CreateManifestResourceNames target create the manifest resource names from the .RESX
16
@(ResxWithNoCulture) - The names the non-culture .RESX files.
17
@(ResxWithCulture) - The names the culture .RESX files.
18
@(NonResxWithNoCulture) - The names of the non-culture non-RESX files (like bitmaps, etc).
19
@(NonResxWithCulture) - The names of the culture non-RESX files (like bitmaps, etc).
22
@(ManifestResourceWithNoCultureName) - The corresponding manifest resource name (.RESOURCE)
23
@(ManifestResourceWithCultureName) - The corresponding manifest resource name (.RESOURCE)
24
@(ManifestNonResxWithNoCulture) - The corresponding manifest resource name.
25
@(ManifestNonResxWithCulture) - The corresponding manifest resource name.
27
For C# applications the transformation is like:
29
Resources1.resx => RootNamespace.Resources1 => Build into main assembly
30
SubFolder\Resources1.resx => RootNamespace.SubFolder.Resources1 => Build into main assembly
31
Resources1.fr.resx => RootNamespace.Resources1.fr => Build into satellite assembly
32
Resources1.notaculture.resx => RootNamespace.Resources1.notaculture => Build into main assembly
34
For other project systems, this transformation may be different.
37
<CreateManifestResourceNamesDependsOn></CreateManifestResourceNamesDependsOn>
40
Name="CreateManifestResourceNames"
41
Condition="'@(ResxWithNoCulture)@(ResxWithCulture)@(NonResxWithNoCulture)@(NonResxWithCulture)'!=''"
42
DependsOnTargets="$(CreateManifestResourceNamesDependsOn)"
45
<Message Text="(in) The names the non-culture .RESX files: '@(ResxWithNoCulture)'" Condition="'$(MSBuildTargetsVerbose)'=='true'"/>
46
<Message Text="(in) The names the culture .RESX files: '@(ResxWithCulture)'" Condition="'$(MSBuildTargetsVerbose)'=='true'"/>
47
<Message Text="(in) The names of the non-culture non-RESX files: '@(NonResxWithNoCulture)'" Condition="'$(MSBuildTargetsVerbose)'=='true'"/>
48
<Message Text="(in) The names of the culture non-RESX files: '@(NonResxWithCulture)'" Condition="'$(MSBuildTargetsVerbose)'=='true'"/>
50
<!-- Create the target resource names for non-culture resx files. -->
51
<CreateCSharpManifestResourceName Condition="'@(ResxWithNoCulture)'!=''"
52
ResourceFiles="@(ResxWithNoCulture)"
53
RootNamespace="$(RootNamespace)">
55
<Output TaskParameter="ManifestResourceNames" ItemName="ManifestResourceWithNoCultureName"/>
57
</CreateCSharpManifestResourceName>
58
<Message Text="(out) Manifest-named resx files files with no culture: '@(ManifestResourceWithNoCultureName)'" Condition="'$(MSBuildTargetsVerbose)'=='true'"/>
61
<!-- Create the target resource names for culture resx files. -->
62
<CreateCSharpManifestResourceName Condition="'@(ResxWithCulture)'!=''"
63
ResourceFiles="@(ResxWithCulture)"
64
RootNamespace="$(RootNamespace)">
66
<Output TaskParameter="ManifestResourceNames" ItemName="ManifestResourceWithCultureName"/>
68
</CreateCSharpManifestResourceName>
69
<Message Text="(out) Manifest-named resx files with culture: '@(ManifestResourceWithCultureName)'" Condition="'$(MSBuildTargetsVerbose)'=='true'"/>
71
<!-- Create the target resource names for non-culture non-resx files. -->
72
<CreateCSharpManifestResourceName Condition="'@(NonResxWithNoCulture)'!=''"
73
ResourceFiles="@(NonResxWithNoCulture)"
74
RootNamespace="$(RootNamespace)">
76
<Output TaskParameter="ManifestResourceNames" ItemName="ManifestNonResxWithNoCulture"/>
78
</CreateCSharpManifestResourceName>
79
<Message Text="(out) Manifest-named non-culture non-*.resx files: '@(ManifestNonResxWithNoCulture)'" Condition="'$(MSBuildTargetsVerbose)'=='true'"/>
81
<!-- Create the target resource names for culture non-resx files. -->
82
<CreateCSharpManifestResourceName Condition="'@(NonResxWithCulture)'!=''"
83
ResourceFiles="@(NonResxWithCulture)"
84
RootNamespace="$(RootNamespace)">
86
<Output TaskParameter="ManifestResourceNames" ItemName="ManifestNonResxWithCulture"/>
88
</CreateCSharpManifestResourceName>
89
<Message Text="(out) Manifest-named culture non-*.resx files: '@(ManifestNonResxWithCulture)'" Condition="'$(MSBuildTargetsVerbose)'=='true'"/>
94
<DocFile>$(DocumentationFile)</DocFile>
96
<!-- If we're building from inside VisualStudio, we want to always run the Compile target,
97
so that the IDE's compilers have a chance to compile even if MSBuild thinks that the
98
outputs on disk are up-to-date. This is because in the IDE, one does not have to save
99
the source files in the editors to disk before building. This trick forces the Compile
100
target to always run when inside the IDE. -->
101
<NonExistentFile Condition=" '$(BuildingInsideVisualStudio)' == 'true' " >__NonExistentSubDir__\__NonExistentFile__</NonExistentFile>
103
<!-- "None" is not technically a valid DebugType, so we can't pass it in as such
104
to the compiler. So here, we modify the properties so they make sense. -->
105
<DebugSymbols Condition=" '$(DebugType)' == 'none' ">false</DebugSymbols>
106
<DebugType Condition=" '$(DebugType)' == 'none' "></DebugType>
110
<CompileDependsOn>ResolveReferences;ResolveKeySource</CompileDependsOn>
114
Inputs="$(MSBuildAllProjects);
116
@(ManifestResourceWithNoCulture);
118
$(AssemblyOriginatorKeyFile);
119
@(ManifestNonResxWithNoCultureOnDisk);
121
@(CompiledLicenseFile)"
123
@(IntermediateAssembly);
125
DependsOnTargets="$(CompileDependsOn)"
127
<Delete Files="@(IntermediateAssembly->'%(RelativeDir)%(Filename).pdb')"
128
Condition=" '$(BuildingProject)' == 'true' "/>
131
AdditionalLibPaths="$(AdditionalLibPaths)"
132
AddModules="@(AddModules)"
133
AllowUnsafeBlocks="$(AllowUnsafeBlocks)"
134
BaseAddress="$(BaseAddress)"
135
CheckForOverflowUnderflow="$(CheckForOverflowUnderflow)"
136
CodePage="$(CodePage)"
137
DebugType="$(DebugType)"
138
DefineConstants="$(DefineConstants)"
139
DelaySign="$(DelaySign)"
140
DisabledWarnings="$(NoWarn)"
141
DocumentationFile="$(DocFile)"
142
EmitDebugInformation="$(DebugSymbols)"
143
ErrorReport="$(ErrorReport)"
144
FileAlignment="$(FileAlignment)"
145
GenerateFullPaths="$(GenerateFullPaths)"
146
KeyContainer="$(KeyContainerName)"
147
KeyFile="$(KeyOriginatorFile)"
148
LangVersion="$(LangVersion)"
149
MainEntryPoint="$(StartupObject)"
152
NoStandardLib="$(NoStdLib)"
153
Optimize="$(Optimize)"
154
OutputAssembly="@(IntermediateAssembly)"
155
Platform="$(PlatformTarget)"
156
References="@(ReferencePath)"
157
Resources="@(ManifestResourceWithNoCulture);@(ManifestNonResxWithNoCultureOnDisk);@(CompiledLicenseFile)"
158
ResponseFile="$(CompilerResponseFile)"
160
TargetType="$(OutputType)"
161
ToolPath="$(CscToolPath)"
162
TreatWarningsAsErrors="$(TreatWarningsAsErrors)"
163
UseHostCompilerIfAvailable="true"
164
Utf8Output="$(Utf8Output)"
165
WarningLevel="$(WarningLevel)"
166
WarningsAsErrors="$(WarningsAsErrors)"
167
WarningsNotAsErrors="$(WarningsNotAsErrors)"
168
Win32Icon="$(ApplicationIcon)"
169
Win32Resource="$(Win32Resource)"