c4cb2cfe53a534b6e661e587f94b410b5df37769
[mono.git] / mcs / tools / xbuild / xbuild / Microsoft.CSharp.targets
1 <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2
3         <!--    xbuild Import support is flawed so we need to put everything into one file. -->
4         <!-- COMMON -->
5
6         <PropertyGroup>
7                 <TargetExt Condition="'$(OutputType)' == 'Winexe'">.exe</TargetExt>
8                 <TargetExt Condition="'$(OutputType)' == 'Exe'">.exe</TargetExt>
9                 <TargetExt Condition="'$(OutputType)' == 'Library'">.dll</TargetExt>
10                 <TargetExt Condition="'$(OutputType)' == 'Netmodule'">.netmodule</TargetExt>
11         </PropertyGroup>
12
13         <PropertyGroup>
14                 <AllowUnsafeBlocks Condition="'$(AllowUnsafeBlocks)' == ''">false</AllowUnsafeBlocks>
15                 <AssemblyName Condition="'$(AssemblyName)' == ''">$(RootNamespace)</AssemblyName>
16                 <!--<OutputPath Condition="'$(OutputPath)' != ''">$(OutputPath)\</OutputPath>-->
17                 <WarningLevel Condition="'$(WarningLevel)' == ''" >2</WarningLevel>
18         </PropertyGroup>
19
20         <Target Name="PrepareForBuild">
21                 <Message Importance="High" Text="Configuration: $(Configuration) Platform: $(Platform)"/>
22                 
23                 <MakeDir 
24                         Condition="'$(OutputPath)' != ''"
25                         Directories="$(OutputPath)"
26                 />
27         </Target>
28
29         <Target Name="ResolveAssemblyReferences">
30                 <ResolveAssemblyReference
31                         Assemblies="@(Reference)"
32                         SearchPaths=" "
33                 >
34                         <Output TaskParameter="ResolvedFiles" ItemName="ResolvedFiles"/>
35                 </ResolveAssemblyReference>
36         </Target>
37
38         <Target Name="Build" DependsOnTargets="PrepareForBuild;ResolveAssemblyReferences;CoreCompile"/>
39
40         <!-- END OF COMMON -->
41
42
43         <PropertyGroup>
44                 <DefaultLanguageSourceExtension>.cs</DefaultLanguageSourceExtension>
45                 <Language>C#</Language>
46         </PropertyGroup>
47
48         <PropertyGroup>
49                 <DebugSymbols Condition=" '$(DebugType)' == 'none' ">false</DebugSymbols>
50                 <DebugType    Condition=" '$(DebugType)' == 'none' "></DebugType>
51         </PropertyGroup>
52
53         <ItemGroup>
54                 <DocFileItem Include="$(DocumentationFile)" Condition="'$(DocumentationFile)' != ''"/>
55         </ItemGroup>
56
57         <Target
58                 Name="CoreCompile"
59                 Inputs="@(Compile)"
60                 Outputs="$(OutputPath)$(AssemblyName)$(TargetExt)"
61         >
62                 <Csc
63                         AdditionalLibPaths="$(AdditionalLibPaths)"
64                         AddModules="@(AddModules)"
65                         AllowUnsafeBlocks="$(AllowUnsafeBlocks)"
66                         BaseAddress="$(BaseAddress)"
67                         CheckForOverflowUnderflow="$(CheckForOverflowUnderflow)"
68                         CodePage="$(CodePage)"
69                         DebugType="$(DebugType)"
70                         DefineConstants="$(DefineConstants)"
71                         DelaySign="$(DelaySign)"
72                         DisabledWarnings="$(_DisabledWarnings)"
73                         DocumentationFile="@(DocFileItem)"
74                         EmitDebugInformation="$(DebugSymbols)"
75                         ErrorReport="$(ErrorReport)"
76                         FileAlignment="$(FileAlignment)"
77                         GenerateFullPaths="$(GenerateFullPaths)"
78                         KeyContainer="$(KeyContainerName)"
79                         KeyFile="$(KeyOriginatorFile)"
80                         LangVersion="$(LangVersion)"
81                         MainEntryPoint="$(StartupObject)"
82                         ModuleAssemblyName="$(ModuleAssemblyName)"
83                         NoConfig="true"
84                         NoLogo="$(NoLogo)"
85                         NoStandardLib="$(NoStdLib)"
86                         Optimize="$(Optimize)"
87                         OutputAssembly="$(OutputPath)$(AssemblyName)$(TargetExt)"
88                         PdbFile="$(PdbFile)" 
89                         Platform="$(PlatformTarget)"
90                         References="@(ResolvedFiles)"
91                         ResponseFiles="$(CompilerResponseFile)"
92                         Sources="@(Compile)"
93                         TargetType="$(OutputType)"
94                         TreatWarningsAsErrors="$(TreatWarningsAsErrors)"
95                         UseHostCompilerIfAvailable="$(UseHostCompilerIfAvailable)"
96                         Utf8Output="$(Utf8Output)"
97                         WarningLevel="$(WarningLevel)"
98                         WarningsAsErrors="$(WarningsAsErrors)"
99                         Win32Icon="$(Win32Icon)"
100                         Win32Resource="$(Win32Resource)"
101                 />
102                         <!-- Resources="@(ManifestResourceWithNoCulture);@(ManifestNonResxWithNoCultureOnDisk);@(CompiledLicenseFile)" -->
103                         <!-- ToolPath="$(CscToolPath)" -->
104
105         </Target>
106
107 </Project>