importing messaging-2008 branch to trunk, going on.
[mono.git] / mcs / tools / xbuild / xbuild / Microsoft.Common.targets
1 <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2
3         <PropertyGroup>
4                 <TargetExt Condition="'$(OutputType)' == 'Winexe'">.exe</TargetExt>
5                 <TargetExt Condition="'$(OutputType)' == 'Exe'">.exe</TargetExt>
6                 <TargetExt Condition="'$(OutputType)' == 'Library'">.dll</TargetExt>
7                 <TargetExt Condition="'$(OutputType)' == 'Netmodule'">.netmodule</TargetExt>
8         </PropertyGroup>
9
10         <PropertyGroup>
11                 <ProjectDir Condition="'$(ProjectDir)' == ''">$(MSBuildProjectDirectory)\</ProjectDir>
12         </PropertyGroup>
13
14         <PropertyGroup>
15                 <AllowUnsafeBlocks Condition="'$(AllowUnsafeBlocks)' == ''">false</AllowUnsafeBlocks>
16                 <AssemblyName Condition="'$(AssemblyName)' == ''">$(RootNamespace)</AssemblyName>
17                 <!--<OutputPath Condition="'$(OutputPath)' != ''">$(OutputPath)\</OutputPath>-->
18                 <WarningLevel Condition="'$(WarningLevel)' == ''" >2</WarningLevel>
19         </PropertyGroup>
20
21         <Target Name="PrepareForBuild">
22                 <Message Importance="High" Text="Configuration: $(Configuration) Platform: $(Platform)"/>
23                 
24                 <MakeDir 
25                         Condition="'$(OutputPath)' != ''"
26                         Directories="$(OutputPath)"
27                 />
28         </Target>
29
30         <Target Name="ResolveAssemblyReferences">
31                 <ResolveAssemblyReference
32                         Assemblies="@(Reference)"
33                         SearchPaths=" "
34                 >
35                         <Output TaskParameter="ResolvedFiles" ItemName="ResolvedFiles"/>
36                 </ResolveAssemblyReference>
37         </Target>
38
39         <Target
40                 Name="ResolveProjectReferences"
41                 Condition=" '@(ProjectReference)' != ''"
42                 Inputs="@(ProjectReference)"
43                 Outputs="@(ChildProjectReferences)"
44         >
45                 <MSBuild
46                         Projects="@(ProjectReference)"
47                         Targets="Build"
48                         RebaseOutputs="true"
49                 >
50                         <Output TaskParameter="TargetOutputs" ItemName="ChildProjectReferences" />
51                 </MSBuild>
52         </Target>
53
54 <!--
55         Not needed at the moment
56         <Target Name="_ComputeNonExistentFileProperty" Condition='false'>
57                 <CreateProperty Value="__NonExistentSubDir__\__NonExistentFile__">
58                         <Output TaskParameter="Value" PropertyName="NonExistentFile"/>
59                 </CreateProperty>
60         </Target>
61 -->
62
63         <Target
64                 Name="Build"
65                 DependsOnTargets="PrepareForBuild;ResolveAssemblyReferences;ResolveProjectReferences;CoreCompile"
66                 Outputs="$(OutputPath)$(AssemblyName)$(TargetExt)"
67         />
68
69 <!--
70         Doesn't work because it treats every property in Delete.Files as separate ITaskItem
71         <Target Name="Clean">
72                 <Message Text="Trying to delete $(OutputPath)$(AssemblyName)$(TargetExt)"/>
73                 <Delete Files="$(OutputPath)$(AssemblyName)$(TargetExt)" />
74         </Target>
75 -->
76
77 </Project>