Remove s_isProcessExiting and Clear of ALC list at exit
[platform/upstream/coreclr.git] / build.proj
index 3889d1c..429b152 100644 (file)
@@ -1,5 +1,6 @@
 <?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+<Project ToolsVersion="12.0" DefaultTargets="Build"
+  xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
   <Import Project="dir.props" />
 
   <ItemGroup>
@@ -11,6 +12,8 @@
 
   <Import Project="dir.traversal.targets" />
 
+  <Import Project="$(ToolsDir)clean.targets" />
+
   <!-- The following properties are in place to keep the behavior of build.cmd while we work on the dev workflow steps. -->
   <PropertyGroup>
     <!-- To disable the restoration of packages, set RestoreDuringBuild=false or pass /p:RestoreDuringBuild=false.-->
     <Delete Files="$(BinDir)SOS.NETCore.*" />
     <Delete Files="$(BinDir)mscorlib.*" />
     <Delete Files="$(BinDir)System.Private.CoreLib.*" />
-  </Target>
-
-  <Target Name="RestoreOptData">
-    <Exec Command="$(DotnetRestoreCommand) $(SourceDir).nuget/optdata/optdata.csproj"
-          StandardOutputImportance="Low" />
+    <Delete Files="$(BinDir)netcoreapp2.0/R2RDump.*" />
   </Target>
 
   <!--
     target, which runs automatically before "Sync". Since no "Sync" target actually exists, go ahead and define one now so that
     the tools are fetched before "Build".
   -->
-  <Target Name="Sync" BeforeTargets="Build" />
+  <Target Name="Sync" BeforeTargets="Build" DependsOnTargets="RestoreOptData;RestoreNETCorePlatforms" />
+
+  <Target Name="RestoreOptData" Condition="'$(RestoreDuringBuild)'=='true' and '$(BuildType)'=='Release'">
+    <Exec Command="$(DotnetRestoreCommand) $(SourceDir).nuget/optdata/optdata.csproj" StandardOutputImportance="Low" />
+  </Target>
+
+  <Target Name="RestoreNETCorePlatforms" Condition="'$(RestoreDuringBuild)'=='true'">
+    <Exec Command="$(DotnetRestoreCommand) $(SourceDir).nuget/init/init.csproj" StandardOutputImportance="Low" />
+  </Target>
 
-  <Target Name="RestoreNETCorePlatforms" AfterTargets="Build" Condition="'$(RestoreDuringBuild)'=='true'">
-    <Exec Command="$(DotnetRestoreCommand) $(SourceDir).nuget/init/init.csproj"
-          StandardOutputImportance="Low" />
+  <Target Name="CleanAllProjects">
+    <Message Condition="Exists($(RootBinDir))" Importance="High" Text="Removing $(RootBinDir)"/>
+    <RemoveDir Directories="$(RootBinDir)" />
   </Target>
-  
+
 </Project>