Add Microsoft.NET.CoreRuntime.appx to UWPCoreRuntimeSdk package (dotnet/core-setup...
authorZach Montoya <zamont@microsoft.com>
Tue, 27 Jun 2017 21:45:11 +0000 (14:45 -0700)
committerWes Haggard <weshaggard@users.noreply.github.com>
Tue, 27 Jun 2017 21:45:11 +0000 (14:45 -0700)
* Add all files except for Microsoft.Build.Net.CoreRuntimeTask.dll which Microsoft.Net.CoreRuntime.targets will rely upon when implemented

* Move targets files into a subdirectory that better maps to final NuGet package contents

* Update Microsoft.Net.UWPCoreRuntimeSdk package so the identity package carries the necessary .props/.targets files for VS and the RID-specific packages carry the binaries and appx package. Right now the VS files are not complete, but merely mocked up to achieve right structure

* Clean up some unnecessary changes

* Fix build ordering issue

Work-around the packaging for UWPCoreRuntimeSdk requiring the appx from
the Microsoft.NET.CoreRuntime sister project by serializing the
packaging projects. This takes advantage of the OS API returning
directory contents in lexicographical order - alternatively we could
manually enumerate the list of projects.

* CR Feedback

Factor path to Microsoft.Net.CoreRuntime.2.1.appx into props so both uses refer to the same thing
Fix up unix build failures

* Make project list explicit

Commit migrated from https://github.com/dotnet/core-setup/commit/c24f25b2ccb0163c5d8933bb5fe6b88c9f1f1db9

12 files changed:
src/installer/pkg/packages.builds
src/installer/pkg/projects/Microsoft.Net.UWPCoreRuntimeSdk/Microsoft.Net.UWPCoreRuntimeSdk.builds
src/installer/pkg/projects/Microsoft.Net.UWPCoreRuntimeSdk/Microsoft.Net.UWPCoreRuntimeSdk.pkgproj
src/installer/pkg/projects/Microsoft.Net.UWPCoreRuntimeSdk/dir.props
src/installer/pkg/projects/Microsoft.Net.UWPCoreRuntimeSdk/files/build/Microsoft.Net.UWPCoreRuntimeSdk.props [moved from src/installer/pkg/projects/Microsoft.Net.UWPCoreRuntimeSdk/files/Microsoft.Net.UWPCoreRuntimeSdk.props with 100% similarity]
src/installer/pkg/projects/Microsoft.Net.UWPCoreRuntimeSdk/files/build/Microsoft.Net.UWPCoreRuntimeSdk.targets [moved from src/installer/pkg/projects/Microsoft.Net.UWPCoreRuntimeSdk/files/Microsoft.Net.UWPCoreRuntimeSdk.targets with 100% similarity]
src/installer/pkg/projects/Microsoft.Net.UWPCoreRuntimeSdk/files/tools/CoreRuntime/Microsoft.Net.CoreRuntime.settings.targets [new file with mode: 0644]
src/installer/pkg/projects/Microsoft.Net.UWPCoreRuntimeSdk/files/tools/CoreRuntime/Microsoft.Net.CoreRuntime.targets [new file with mode: 0644]
src/installer/pkg/projects/Microsoft.Net.UWPCoreRuntimeSdk/src/Microsoft.Net.UWPCoreRuntimeSdk.builds [new file with mode: 0644]
src/installer/pkg/projects/Microsoft.Net.UWPCoreRuntimeSdk/src/Microsoft.Net.UWPCoreRuntimeSdk.depproj [new file with mode: 0644]
src/installer/pkg/projects/Microsoft.Net.UWPCoreRuntimeSdk/uwpcoreruntimesdkRIDs.props [new file with mode: 0644]
src/installer/publish/dir.props

index 8dcb242..4c804cf 100644 (file)
@@ -6,15 +6,52 @@
     <!-- don't build project references from pkgprojs during the packages build phase,
          they will be built during the source build phase -->
     <AdditionalProperties>BuildPackageLibraryReferences=false</AdditionalProperties>
+    <ProjectsBasePath>$(MSBuildThisFileDirectory)\projects</ProjectsBasePath>
+  </PropertyGroup>
+  
+  <!-- required to build the projects in their specified order -->
+  <!-- This ensures the MakeAppx target in Microsoft.NET.CoreRuntime runs before
+       Microsoft.Net.UWPCoreRuntimeSdk's packaging targets -->
+  <PropertyGroup>
+    <SerializeProjects>true</SerializeProjects>
   </PropertyGroup>
 
-  <ItemGroup>
-    <ProjectExclusions Include="$(MSBuildThisFileDirectory)\projects\*\Microsoft.NETCore.UniversalWindowsPlatform.builds" Condition="'$(OSEnvironment)' != 'Windows_NT' or '$(Platform)' == 'arm64'" />
-    <ProjectExclusions Include="$(MSBuildThisFileDirectory)\projects\*\Microsoft.NET.CoreRuntime.builds" Condition="'$(OSEnvironment)' != 'Windows_NT' or '$(Platform)' == 'arm64'" />
-    <Project Include="$(MSBuildThisFileDirectory)\projects\*\*.builds" Exclude="@(ProjectExclusions)">
+  <!-- Projects exluded from Unix / Arm64 -->
+  <ItemGroup Condition="'$(OSEnvironment)' == 'Windows_NT' and '$(Platform)' != 'arm64'">
+    <Project Include="$(ProjectsBasePath)\Microsoft.NET.CoreRuntime\Microsoft.NET.CoreRuntime.builds">
+      <AdditionalProperties>$(AdditionalProperties)</AdditionalProperties>
+    </Project>
+    
+    <Project Include="$(ProjectsBasePath)\Microsoft.Net.UWPCoreRuntimeSdk\Microsoft.Net.UWPCoreRuntimeSdk.builds">
+      <AdditionalProperties>$(AdditionalProperties)</AdditionalProperties>
+    </Project>
+    
+    <Project Include="$(ProjectsBasePath)\Microsoft.NETCore.UniversalWindowsPlatform\Microsoft.NETCore.UniversalWindowsPlatform.builds">
       <AdditionalProperties>$(AdditionalProperties)</AdditionalProperties>
     </Project>
   </ItemGroup>
 
+  <ItemGroup>
+    <Project Include="$(ProjectsBasePath)\Microsoft.NETCore.App\Microsoft.NETCore.App.builds">
+      <AdditionalProperties>$(AdditionalProperties)</AdditionalProperties>
+    </Project>
+    
+    <Project Include="$(ProjectsBasePath)\Microsoft.NETCore.DotNetAppHost\Microsoft.NETCore.DotNetAppHost.builds">
+      <AdditionalProperties>$(AdditionalProperties)</AdditionalProperties>
+    </Project>
+    
+    <Project Include="$(ProjectsBasePath)\Microsoft.NETCore.DotNetHost\Microsoft.NETCore.DotNetHost.builds">
+      <AdditionalProperties>$(AdditionalProperties)</AdditionalProperties>
+    </Project>
+    
+    <Project Include="$(ProjectsBasePath)\Microsoft.NETCore.DotNetHostPolicy\Microsoft.NETCore.DotNetHostPolicy.builds">
+      <AdditionalProperties>$(AdditionalProperties)</AdditionalProperties>
+    </Project>
+    
+    <Project Include="$(ProjectsBasePath)\Microsoft.NETCore.DotNetHostResolver\Microsoft.NETCore.DotNetHostResolver.builds">
+      <AdditionalProperties>$(AdditionalProperties)</AdditionalProperties>
+    </Project>
+  </ItemGroup>
+  
   <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.traversal.targets))\dir.traversal.targets" />
 </Project>
index 0caa797..aa4bfd5 100644 (file)
@@ -3,7 +3,7 @@
   <Import Project="dir.props" />
 
   <ItemGroup>
-    <Project Include="Microsoft.Net.UWPCoreRuntimeSdk.pkgproj" />
+    <Project Include="Microsoft.Net.UWPCoreRuntimeSdk.pkgproj" Condition="'$(Platform)' != 'arm64'"/>
   </ItemGroup>
 
   <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.traversal.targets))\dir.traversal.targets" />
index 0b6ea18..a5bfa8e 100644 (file)
@@ -6,12 +6,20 @@
     <Version>$(ProductVersion)</Version>
   </PropertyGroup>
 
+  <!-- Redistributed package content from other nuget packages-->
   <ItemGroup>
-    <File Include="files\Microsoft.Net.UWPCoreRuntimeSdk.props">
+    <ProjectReference Include="src\Microsoft.Net.UWPCoreRuntimeSdk.depproj">
+      <AdditionalProperties Condition="'$(PackageTargetRuntime)' != ''">NuGetRuntimeIdentifier=$(PackageTargetRuntime)</AdditionalProperties>
+    </ProjectReference>
+  </ItemGroup>
+
+  <!-- Identity / Reference package content -->
+  <ItemGroup Condition="'$(PackageTargetRuntime)' == ''">
+    <File Include="files\build\*">
       <TargetPath>build</TargetPath>
     </File>
-    <File Include="files\Microsoft.Net.UWPCoreRuntimeSdk.targets">
-      <TargetPath>build</TargetPath>
+    <File Include="files\tools\CoreRuntime\*">
+      <TargetPath>tools/CoreRuntime</TargetPath>
     </File>
   </ItemGroup>
 
index 4fb2170..dfa0c82 100644 (file)
@@ -1,11 +1,7 @@
 <?xml version="1.0" encoding="utf-8"?>
 <Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
   <PropertyGroup>
-    <HasRuntimePackages>false</HasRuntimePackages>
+    <RIDPropsFile>$(MSBuildThisFileDirectory)\uwpcoreruntimesdkRIDs.props</RIDPropsFile>
   </PropertyGroup>
   <Import Project="..\dir.props" />
-  <PropertyGroup>
-    <IncludeRuntimeJson>false</IncludeRuntimeJson>
-    <IsLineupPackage>false</IsLineupPackage>
-  </PropertyGroup>
 </Project>
\ No newline at end of file
diff --git a/src/installer/pkg/projects/Microsoft.Net.UWPCoreRuntimeSdk/files/tools/CoreRuntime/Microsoft.Net.CoreRuntime.settings.targets b/src/installer/pkg/projects/Microsoft.Net.UWPCoreRuntimeSdk/files/tools/CoreRuntime/Microsoft.Net.CoreRuntime.settings.targets
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/src/installer/pkg/projects/Microsoft.Net.UWPCoreRuntimeSdk/files/tools/CoreRuntime/Microsoft.Net.CoreRuntime.targets b/src/installer/pkg/projects/Microsoft.Net.UWPCoreRuntimeSdk/files/tools/CoreRuntime/Microsoft.Net.CoreRuntime.targets
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/src/installer/pkg/projects/Microsoft.Net.UWPCoreRuntimeSdk/src/Microsoft.Net.UWPCoreRuntimeSdk.builds b/src/installer/pkg/projects/Microsoft.Net.UWPCoreRuntimeSdk/src/Microsoft.Net.UWPCoreRuntimeSdk.builds
new file mode 100644 (file)
index 0000000..f0350d3
--- /dev/null
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <PropertyGroup>
+    <BuildOnUnknownPlatforms>false</BuildOnUnknownPlatforms>
+  </PropertyGroup>
+
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+
+  <ItemGroup>
+    <Project Include="Microsoft.Net.UWPCoreRuntimeSdk.depproj" Condition="'$(Platform)' != 'arm64'" />
+  </ItemGroup>
+
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.traversal.targets))\dir.traversal.targets" />
+</Project>
diff --git a/src/installer/pkg/projects/Microsoft.Net.UWPCoreRuntimeSdk/src/Microsoft.Net.UWPCoreRuntimeSdk.depproj b/src/installer/pkg/projects/Microsoft.Net.UWPCoreRuntimeSdk/src/Microsoft.Net.UWPCoreRuntimeSdk.depproj
new file mode 100644 (file)
index 0000000..e0e76e3
--- /dev/null
@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" DefaultTargets="Build">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <!-- we intentionally don't want to produce output -->
+    <OutputPath>unused</OutputPath>
+    <!-- we don't want any analyzers by ResolveNuGetPackageAssets 
+         null-refs when this isn't set and an analyzer is in the packages -->
+    <Language>unused</Language>
+    <NuGetTargetMoniker>UAP,Version=v10.1</NuGetTargetMoniker>
+    <NuGetTargetMonikerShort>uap10.1</NuGetTargetMonikerShort>
+    <PackageTargetFramework>uap10.1</PackageTargetFramework>
+    <ContainsPackageReferences>false</ContainsPackageReferences>
+    <RidSpecificAssets Condition="'$(NuGetRuntimeIdentifier)' != ''">true</RidSpecificAssets>
+    <IntermediateOutputPath>$(IntermediateOutputPath)$(NuGetRuntimeIdentifier)</IntermediateOutputPath>
+    <RestoreOutputPath>$(IntermediateOutputPath)</RestoreOutputPath>
+  </PropertyGroup>
+
+  <ItemGroup>
+    <ProjectReference Include="..\..\Microsoft.Net.CoreRuntime\Microsoft.Net.CoreRuntime.depproj" />
+  </ItemGroup>
+
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+
+  <Target Name="GetFilesToPackage" AfterTargets="Build" Returns="@(FilesToPackage)">
+    <ItemGroup Condition="'$(NuGetRuntimeIdentifier)' != ''">
+      <!-- RID-specific: include all runtime files -->
+      <FilesToPackage Include="$(UWPOutputDir)\copywin32resources.exe">
+        <TargetPath>tools/CoreRuntime</TargetPath>
+      </FilesToPackage>
+      <FilesToPackage Include="$(UWPOutputDir)\uwpshim.exe">
+        <TargetPath>tools/AppLocal</TargetPath>
+      </FilesToPackage>
+      <FilesToPackage Include="$(MicrosoftNetCoreRuntimeAppxOutputPath)">
+        <TargetPath>tools/Appx</TargetPath>
+      </FilesToPackage>
+    </ItemGroup>
+  </Target>
+  <!-- only calculate paths from this project, don't copy -->
+  <Target Name="Build" />
+  
+  <!-- remove when fixing https://github.com/dotnet/buildtools/issues/1273 -->
+  <Target Name="DetermineRuntimeDependencies" />
+</Project>
diff --git a/src/installer/pkg/projects/Microsoft.Net.UWPCoreRuntimeSdk/uwpcoreruntimesdkRIDs.props b/src/installer/pkg/projects/Microsoft.Net.UWPCoreRuntimeSdk/uwpcoreruntimesdkRIDs.props
new file mode 100644 (file)
index 0000000..bff38bb
--- /dev/null
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <PropertyGroup Condition="'$(PackageRID)' == ''">
+    <PackageRID>win10-$(Platform)</PackageRID>
+  </PropertyGroup>
+
+  <ItemGroup>
+    <OfficialBuildRID Include="win-x86">
+      <Platform>x86</Platform>
+    </OfficialBuildRID>
+    <OfficialBuildRID Include="win-x64"/>
+    <OfficialBuildRID Include="win-arm">
+      <Platform>arm</Platform>
+    </OfficialBuildRID>
+  </ItemGroup>
+</Project>
index 592035d..454fb84 100644 (file)
@@ -22,7 +22,7 @@
     <RuntimePackageFile Include="$(PackagesOutDir)**/runtime.*.nupkg" >
       <RelativeBlobPath>$(BinariesRelativePath)</RelativeBlobPath>
     </RuntimePackageFile>
-    <UWPArtifactsToUpload Include="$(UWPOutputDir)Microsoft.NET.CoreRuntime.2.0*.appx" >
+    <UWPArtifactsToUpload Include="$(MicrosoftNetCoreRuntimeAppxOutputPath)" >
       <RelativeBlobPath>$(BinariesRelativePath)</RelativeBlobPath>
     </UWPArtifactsToUpload>
     <RidAgnosticPackageFile Include="$(PackagesOutDir)**/*.nupkg" Exclude="@(RuntimePackageFile)" >