瀏覽代碼

Updating to flatten Ix.NET

Matthew Podwysocki 11 年之前
父節點
當前提交
b6d399ca2d
共有 1 個文件被更改,包括 49 次插入15 次删除
  1. 49 15
      Ix.NET/Source/Import.targets

+ 49 - 15
Ix.NET/Source/Import.targets

@@ -2,10 +2,9 @@
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
 
   <!-- Non-Portable Library build -->
-  <Import 
-	Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" 
-	Condition=" '$(TargetFrameworkIdentifier)' != '.NETPortable' And '$(BuildPlatform)' == 'DESKTOPCLR' " />
-
+  <Import Project="$(MSBuildExtensionsPath)\Microsoft\WindowsXaml\v11.0\Microsoft.Windows.UI.Xaml.CSharp.targets" Condition=" '$(TargetFrameworkIdentifier)' == '.NETCore' " />
+  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" Condition=" '$(TargetFrameworkIdentifier)' != '.NETPortable' And ('$(BuildPlatform)' == 'DESKTOPCLR' Or '$(BuildPlatform)' == 'XNA') " />
+  
   <!-- Silverlight ONLY (i.e., not phone) -->
   <Import Project="$(MSBuildExtensionsPath32)\Microsoft\Silverlight\$(SilverlightVersion)\Microsoft.Silverlight.CSharp.targets" Condition=" '$(TargetFrameworkIdentifier)' != '.NETPortable' And '$(BuildPlatform)' == 'SILVERLIGHT' AND !('$(BuildFlavor)' == 'SILVERLIGHTM7') " />
   
@@ -13,20 +12,55 @@
   <Import Project="$(MSBuildExtensionsPath)\Microsoft\Silverlight for Phone\$(TargetFrameworkVersion)\Microsoft.Silverlight.$(TargetFrameworkProfile).Overrides.targets" Condition=" '$(TargetFrameworkIdentifier)' != '.NETPortable' And '$(BuildFlavor)' == 'SILVERLIGHTM7' " />
   <Import Project="$(MSBuildExtensionsPath)\Microsoft\Silverlight for Phone\$(TargetFrameworkVersion)\Microsoft.Silverlight.CSharp.targets" Condition=" '$(TargetFrameworkIdentifier)' != '.NETPortable' And '$(BuildFlavor)' == 'SILVERLIGHTM7' " />
   
-  
-<!--   <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\Microsoft.Xna.GameStudio.targets" Condition=" '$(TargetFrameworkIdentifier)' != '.NETPortable' And '$(BuildPlatform)' == 'XNA' "/>
- -->
-  
+  <!-- Windows Phone 8 -->
+  <Import Project="$(MSBuildExtensionsPath)\Microsoft\$(TargetFrameworkIdentifier)\$(TargetFrameworkVersion)\Microsoft.$(TargetFrameworkIdentifier).$(TargetFrameworkVersion).Overrides.targets" Condition=" '$(TargetFrameworkIdentifier)' != '.NETPortable' And '$(BuildFlavor)' == 'WINDOWS_PHONE8' "/>
+  <Import Project="$(MSBuildExtensionsPath)\Microsoft\$(TargetFrameworkIdentifier)\$(TargetFrameworkVersion)\Microsoft.$(TargetFrameworkIdentifier).CSharp.targets" Condition=" '$(TargetFrameworkIdentifier)' != '.NETPortable' And '$(BuildFlavor)' == 'WINDOWS_PHONE8' "/>
+ 
   <!-- Portable Library Build -->
   <Import Project="$(MSBuildExtensionsPath32)\Microsoft\Portable\$(TargetFrameworkVersion)\Microsoft.Portable.CSharp.targets" Condition=" '$(TargetFrameworkIdentifier)' == '.NETPortable' " />
-  
-  <!-- If "Sign" is set and assembly should be signed, generate a .sign file-->
-  <Target Name="AfterBuild"
-          Condition=" '$(ProductSignAssembly)' == 'true' AND '$(Sign)' == 'Sign' ">
-    <WriteLinesToFile
+
+
+  <!-- If "Sign" is set and assembly should be signed, generate a .sign file-->  
+  <Target Name="AfterBuild">
+    
+    <WriteLinesToFile Condition=" '$(ProductSignAssembly)' == 'true' AND '$(Sign)' == 'Sign' "
         File="$(OutDir)\$(TargetFileName).sign"
         Overwrite="true"
-        Lines="Auto-generated file, indicates the corresponding binary file needs to be signed." />
+        Lines="Auto-generated file, indicates the corresponding binary file needs to be signed.">
+    </WriteLinesToFile>
+
+    <!-- Hack for Metro; for some reason the XAML build creates intermediary folders, so we flatten the hierarchy for consumption by the setup build at a later stage -->
+ 
+    <!-- For some reason, using a plain <ItemGroup> does not fill in the list correctly, so we must use <CreateItem> -->
+    <CreateItem Include="$(OutDir)\*.sign;$(OutDir)\*.xml" Condition=" '$(TargetFrameworkIdentifier)' == '.NETCore' Or '$(TargetFrameworkIdentifier)' == '.NETPortable'">
+      <Output TaskParameter="Include" ItemName="CanaryFiles" />
+    </CreateItem>
+
+    <Message Text="-- Canary files: @(CanaryFiles)" Importance="high"/>
+    <Move
+        SourceFiles="@(CanaryFiles)"
+        DestinationFolder="$(OutDir)\.."
+        Condition=" '$(TargetFrameworkIdentifier)' == '.NETCore' Or '$(TargetFrameworkIdentifier)' == '.NETPortable' " />
+
+    <!-- For some reason, using a plain <ItemGroup> does not fill in the list correctly, so we must use <CreateItem> -->
+    <CreateItem Include="$(OutDir)\*.*" Condition=" '$(TargetFrameworkIdentifier)' == '.NETCore' Or '$(TargetFrameworkIdentifier)' == '.NETPortable' ">
+      <Output TaskParameter="Include" ItemName="BuiltFilesInOutDir" />
+    </CreateItem>
+
+    <Message Text="-- Built files: @(BuiltFilesInOutDir)" Importance="high"/>
+    <Copy
+        SourceFiles="@(BuiltFilesInOutDir)"
+        DestinationFolder="$(OutDir)\.."
+        Condition=" '$(TargetFrameworkIdentifier)' == '.NETCore' Or '$(TargetFrameworkIdentifier)' == '.NETPortable' " />
   </Target>
   
-</Project>
+  <!--  MICROSOFT BCL ASYNC CONFIGURATION -->
+  <!-- TODO: Add acondition to only load it when required? -->
+  
+   <!-- Skip validation of packages.config since we are manageing the packages manuallt  --> 
+   <PropertyGroup>
+      <SkipValidatePackageReferences>true</SkipValidatePackageReferences>
+   </PropertyGroup>
+  <Import Project="packages\Microsoft.Bcl.Build.1.0.4\tools\Microsoft.Bcl.Build.targets"   Condition=" '$(BuildTarget)' == 'PLLITE' Or '$(BuildTarget)' == '40' " />
+  
+</Project>