Release 6.0.0.14934
[platform/core/csapi/tizenfx.git] / build / build.proj
1 <Project DefaultTargets="Build">
2
3   <Import Project="$(MSBuildThisFileDirectory)directories.props" />
4
5   <!-- Build Properties -->
6   <PropertyGroup>
7     <Configuration Condition="'$(Configuration)' == ''">Release</Configuration>
8     <BuildWithAnalyzer Condition="'$(BuildWithAnalyzer)' == ''">False</BuildWithAnalyzer>
9     <BuildDesignAssembly Condition="'$(BuildDesignAssembly)' == ''">False</BuildDesignAssembly>
10   </PropertyGroup>
11
12   <!-- Projects to build -->
13   <ItemGroup>
14     <DesignProject Include="$(ProjectSrcDir)**\*.Design.csproj" />
15     <DesignProject Include="$(InternalProjectSrcDir)**\*.Design.csproj" />
16
17     <PublicProject Include="$(ProjectSrcDir)**\*.csproj" Condition="'$(Project)' == ''" />
18     <PublicProject Include="$(ProjectSrcDir)\$(Project)\$(Project).csproj"
19                    Condition="'$(Project)' != '' And Exists('$(ProjectSrcDir)\$(Project)\$(Project).csproj') " />
20     <PublicProject Remove="@(DesignProject)" />
21
22     <InternalProject Include="$(InternalProjectSrcDir)**\*.csproj" Condition="'$(Project)' == '' " />
23     <InternalProject Include="$(InternalProjectSrcDir)\$(Project)\$(Project).csproj"
24                      Condition="'$(Project)' != ''  And Exists('$(InternalProjectSrcDir)\$(Project)\$(Project).csproj')  " />
25     <InternalProject Remove="@(DesignProject)" />
26
27     <ProjectToBuild Include="@(DesignProject)" Condition="'$(BuildDesignAssembly)' == 'True' " />
28     <ProjectToBuild Include="@(PublicProject);@(InternalProject)" Condition="'$(BuildDesignAssembly)' != 'True' " />
29   </ItemGroup>
30
31   <!-- Nuspec files to pack -->
32   <ItemGroup>
33     <NuspecFiles Include="$(ProjectRootDir)pkg\**\*.nuspec" />
34   </ItemGroup>
35
36   <!--
37     Target : Clean
38     ==============
39     Delete all artifacts,
40     including the Artifacts/ directory and the obj and bin directories of all projects.
41   -->
42   <Target Name="Clean">
43
44     <ItemGroup>
45       <ProjectIntermediateAllFiles Include="$(ProjectSrcDir)**\obj\**" />
46       <ProjectIntermediateAllFiles Include="$(ProjectSrcDir)**\bin\**" />
47       <ProjectIntermediateAllFiles Include="$(InternalProjectSrcDir)**\obj\**" />
48       <ProjectIntermediateAllFiles Include="$(InternalProjectSrcDir)**\bin\**" />
49       <ProjectIntermediateDir Include="@(ProjectIntermediateAllFiles->'%(RootDir)%(Directory)'->Distinct())" />
50     </ItemGroup>
51
52     <ItemGroup>
53       <DirToRemove Include="$(OutputBaseDir)" />
54       <DirToRemove Include="@(ProjectIntermediateDir)" />
55     </ItemGroup>
56
57     <RemoveDir Directories="@(DirToRemove)" />
58
59   </Target>
60
61   <!--
62     Target : Restore
63     ==============
64     Restore all projects.
65   -->
66   <Target Name="Restore">
67
68     <MSBuild Projects="@(ProjectToBuild)"
69              Properties="Configuration=$(Configuration);RestoreSources=$(RestoreSources);BuildWithAnalyzer=$(BuildWithAnalyzer)"
70              BuildInParallel="false"
71              Targets="Restore" />
72
73   </Target>
74
75   <!--
76     Target : Build
77     ==============
78     Build all projects.
79   -->
80   <Target Name="Build">
81
82     <MSBuild Projects="@(ProjectToBuild)"
83              Properties="Configuration=$(Configuration);BuildWithAnalyzer=$(BuildWithAnalyzer)"
84              BuildInParallel="true"
85              UseResultsCache="true"
86              Targets="Rebuild" />
87
88     <MSBuild Projects="@(ProjectToBuild)"
89              Properties="Configuration=$(Configuration)"
90              BuildInParallel="false"
91              Targets="CopyToArtifactsDirectory" />
92
93   </Target>
94
95   <!--
96     Target : Pack
97     ==============
98     Generate nuget packages.
99   -->
100   <Target Name="Pack">
101
102     <MSBuild Projects="$(MSBuildThisFileDirectory)pack.csproj"
103              Properties="NoBuild=True"
104              Targets="Restore" />
105
106     <MSBuild Projects="$(MSBuildThisFileDirectory)pack.csproj"
107              Properties="NoBuild=True;Version=$(Version);NuspecFile=%(NuspecFiles.Identity)"
108              Targets="Pack" />
109
110   </Target>
111
112   <!--
113     Target : Dummy
114     ==============
115     Generate dummy assemblies of all projects.
116   -->
117   <Target Name="Dummy">
118
119     <PropertyGroup>
120       <APIToolPath>$(MSBuildThisFileDirectory)..\tools\bin\APITool.dll</APIToolPath>
121     </PropertyGroup>
122
123     <MakeDir Directories="$(OutputDummyDir)" />
124     <Exec Command="dotnet $([System.IO.Path]::GetFullPath('$(APIToolPath)')) dummy $(OutputPublicDir)ref $(OutputDummyDir) " />
125
126   </Target>
127
128 </Project>