~nunit-core/nunitv2/2.5

« back to all changes in this revision

Viewing changes to tools/MutantBuild/Microsoft.CSharp.targets

  • Committer: jcansdale
  • Date: 2004-10-09 13:02:14 UTC
  • Revision ID: vcs-imports@canonical.com-20041009130214-5liblibdfltxqlwa
Tool for building VS2003 projects with MSBuild.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
 
2
 
 
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"/>
 
5
    <PropertyGroup>
 
6
        <MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildBinPath)\Microsoft.CSharp.targets</MSBuildAllProjects>
 
7
        <DefaultLanguageSourceExtension>.cs</DefaultLanguageSourceExtension>
 
8
        <Language>C#</Language>
 
9
    </PropertyGroup>
 
10
 
 
11
    <!--
 
12
    The CreateManifestResourceNames target create the manifest resource names from the .RESX
 
13
    files.
 
14
 
 
15
        [IN]
 
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).
 
20
 
 
21
        [OUT]
 
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.
 
26
 
 
27
    For C# applications the transformation is like:
 
28
 
 
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
 
33
 
 
34
    For other project systems, this transformation may be different.
 
35
    -->
 
36
    <PropertyGroup>
 
37
        <CreateManifestResourceNamesDependsOn></CreateManifestResourceNamesDependsOn>
 
38
    </PropertyGroup>
 
39
    <Target
 
40
        Name="CreateManifestResourceNames"
 
41
        Condition="'@(ResxWithNoCulture)@(ResxWithCulture)@(NonResxWithNoCulture)@(NonResxWithCulture)'!=''"
 
42
        DependsOnTargets="$(CreateManifestResourceNamesDependsOn)"
 
43
        >
 
44
 
 
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'"/>
 
49
 
 
50
        <!-- Create the target resource names for non-culture resx files. -->
 
51
        <CreateCSharpManifestResourceName Condition="'@(ResxWithNoCulture)'!=''"
 
52
              ResourceFiles="@(ResxWithNoCulture)"
 
53
              RootNamespace="$(RootNamespace)">
 
54
 
 
55
            <Output TaskParameter="ManifestResourceNames" ItemName="ManifestResourceWithNoCultureName"/>
 
56
 
 
57
        </CreateCSharpManifestResourceName>
 
58
        <Message Text="(out) Manifest-named resx files files with no culture: '@(ManifestResourceWithNoCultureName)'" Condition="'$(MSBuildTargetsVerbose)'=='true'"/>
 
59
 
 
60
 
 
61
        <!-- Create the target resource names for culture resx files. -->
 
62
        <CreateCSharpManifestResourceName Condition="'@(ResxWithCulture)'!=''"
 
63
              ResourceFiles="@(ResxWithCulture)"
 
64
              RootNamespace="$(RootNamespace)">
 
65
 
 
66
            <Output TaskParameter="ManifestResourceNames" ItemName="ManifestResourceWithCultureName"/>
 
67
 
 
68
        </CreateCSharpManifestResourceName>
 
69
        <Message Text="(out) Manifest-named resx files with culture: '@(ManifestResourceWithCultureName)'" Condition="'$(MSBuildTargetsVerbose)'=='true'"/>
 
70
 
 
71
        <!-- Create the target resource names for non-culture non-resx files. -->
 
72
        <CreateCSharpManifestResourceName Condition="'@(NonResxWithNoCulture)'!=''"
 
73
              ResourceFiles="@(NonResxWithNoCulture)"
 
74
              RootNamespace="$(RootNamespace)">
 
75
 
 
76
            <Output TaskParameter="ManifestResourceNames" ItemName="ManifestNonResxWithNoCulture"/>
 
77
 
 
78
        </CreateCSharpManifestResourceName>
 
79
        <Message Text="(out) Manifest-named non-culture non-*.resx files: '@(ManifestNonResxWithNoCulture)'" Condition="'$(MSBuildTargetsVerbose)'=='true'"/>
 
80
 
 
81
        <!-- Create the target resource names for culture non-resx files. -->
 
82
        <CreateCSharpManifestResourceName Condition="'@(NonResxWithCulture)'!=''"
 
83
              ResourceFiles="@(NonResxWithCulture)"
 
84
              RootNamespace="$(RootNamespace)">
 
85
 
 
86
            <Output TaskParameter="ManifestResourceNames" ItemName="ManifestNonResxWithCulture"/>
 
87
 
 
88
        </CreateCSharpManifestResourceName>
 
89
        <Message Text="(out) Manifest-named culture non-*.resx files: '@(ManifestNonResxWithCulture)'" Condition="'$(MSBuildTargetsVerbose)'=='true'"/>
 
90
 
 
91
    </Target>
 
92
 
 
93
    <PropertyGroup>
 
94
        <DocFile>$(DocumentationFile)</DocFile>
 
95
 
 
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>
 
102
        
 
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>
 
107
    </PropertyGroup>
 
108
 
 
109
    <PropertyGroup>
 
110
        <CompileDependsOn>ResolveReferences;ResolveKeySource</CompileDependsOn>
 
111
    </PropertyGroup>
 
112
    <Target
 
113
        Name="Compile"
 
114
        Inputs="$(MSBuildAllProjects);
 
115
                @(Compile);
 
116
                @(ManifestResourceWithNoCulture);
 
117
                $(ApplicationIcon);
 
118
                $(AssemblyOriginatorKeyFile);
 
119
                @(ManifestNonResxWithNoCultureOnDisk);
 
120
                @(ReferencePath);
 
121
                @(CompiledLicenseFile)"
 
122
        Outputs="$(DocFile);
 
123
                 @(IntermediateAssembly);
 
124
                 $(NonExistentFile)"
 
125
        DependsOnTargets="$(CompileDependsOn)"
 
126
    >
 
127
        <Delete Files="@(IntermediateAssembly->'%(RelativeDir)%(Filename).pdb')"
 
128
                Condition=" '$(BuildingProject)' == 'true' "/>
 
129
        
 
130
        <Csc
 
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)"
 
150
              NoConfig="true"
 
151
              NoLogo="$(NoLogo)"
 
152
              NoStandardLib="$(NoStdLib)"
 
153
              Optimize="$(Optimize)"
 
154
              OutputAssembly="@(IntermediateAssembly)"
 
155
              Platform="$(PlatformTarget)"
 
156
              References="@(ReferencePath)"
 
157
              Resources="@(ManifestResourceWithNoCulture);@(ManifestNonResxWithNoCultureOnDisk);@(CompiledLicenseFile)"
 
158
              ResponseFile="$(CompilerResponseFile)"
 
159
              Sources="@(Compile)"
 
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)"
 
170
              />
 
171
 
 
172
    </Target>
 
173
 
 
174
 
 
175
</Project>