|
| 1 | +<!-- |
| 2 | + This file is automatically imported by NuGet into a user's project |
| 3 | + when it targets a single framework, or in classic (pre 2017) csproj projects. |
| 4 | +--> |
| 5 | + |
| 6 | +<Project> |
| 7 | + <Target Name="GenerateHostingStartupDeps" Condition="'@(HostingStartupPackageReference->Count())' != '0'" BeforeTargets="_GetPackageFiles" > |
| 8 | + |
| 9 | + <PropertyGroup> |
| 10 | + <_TemplatesDirectory>$(MSBuildThisFileDirectory)..\content\</_TemplatesDirectory> |
| 11 | + <_DepsOutputDirectory>$(RepositoryRoot).w\se\</_DepsOutputDirectory> |
| 12 | + <_WorkingDirectory>$(_DepsOutputDirectory)\depswork</_WorkingDirectory> |
| 13 | + <_BasePackagePath>content\additionaldeps\</_BasePackagePath> |
| 14 | + <_RuntimeStoreManifestFile>$(_DepsOutputDirectory)\rs.csproj</_RuntimeStoreManifestFile> |
| 15 | + <_RuntimeStoreOutput>$(_DepsOutputDirectory)\rs\</_RuntimeStoreOutput> |
| 16 | + <ManifestFileContents> |
| 17 | + <![CDATA[ |
| 18 | +<Project Sdk="Microsoft.NET.Sdk"> |
| 19 | + <ItemGroup> |
| 20 | + <PackageReference Remove="Internal.AspNetCore.Sdk" /> |
| 21 | + <PackageReference Include="Microsoft.AspNetCore.App" Version="$(MicrosoftAspNetCoreAppPackageVersion)" IsImplicitlyDefined="true"/> |
| 22 | + <PackageReference Include="%(HostingStartupPackageReference.Identity)" Version="%(HostingStartupPackageReference.Version)" /> |
| 23 | + </ItemGroup> |
| 24 | +</Project> |
| 25 | + ]]> |
| 26 | + </ManifestFileContents> |
| 27 | + </PropertyGroup> |
| 28 | + |
| 29 | + <ItemGroup> |
| 30 | + <_TemplateFiles Include="$(MSBuildThisFileDirectory)\HostingStartup\*.cs*" /> |
| 31 | + <_HostingStartupPackageReference |
| 32 | + Include="%(HostingStartupPackageReference.Identity)" |
| 33 | + Source="%(HostingStartupPackageReference.Source)" |
| 34 | + Version="%(HostingStartupPackageReference.Version)" |
| 35 | + WorkingDirectory="$(_DepsOutputDirectory)%(HostingStartupPackageReference.Identity)" |
| 36 | + Project="$(_DepsOutputDirectory)%(HostingStartupPackageReference.Identity)\HostingStartup.csproj" |
| 37 | + DepsFile="$(_DepsOutputDirectory)%(HostingStartupPackageReference.Identity)\p\HostingStartup.deps.json" |
| 38 | + TrimmedDepsFile="$(_DepsOutputDirectory)%(HostingStartupPackageReference.Identity)\%(HostingStartupPackageReference.Identity).deps.json" |
| 39 | + PackagePath="$(_BasePackagePath)%(HostingStartupPackageReference.Identity)\shared\Microsoft.AspNetCore.App\$(MicrosoftAspNetCoreAppPackageVersion)\" |
| 40 | + /> |
| 41 | + </ItemGroup> |
| 42 | + <MakeDir Directories="$(_DepsOutputDirectory)" /> |
| 43 | + |
| 44 | + <!-- Generate runtime store --> |
| 45 | + <WriteLinesToFile File="$(_RuntimeStoreManifestFile)" Lines="$(ManifestFileContents)" Overwrite="true" Encoding="Unicode"/> |
| 46 | + |
| 47 | + <PropertyGroup> |
| 48 | + <_CommonProperties> |
| 49 | + AspNetUniverseBuildOffline=true; |
| 50 | + DotNetRestoreSourcePropsPath=$(DotNetRestoreSourcePropsPath); |
| 51 | + DotNetPackageVersionPropsPath=$(DotNetPackageVersionPropsPath); |
| 52 | + BuildNumber=$(BuildNumber); |
| 53 | + Configuration=$(Configuration); |
| 54 | + IsFinalBuild=$(IsFinalBuild); |
| 55 | + MicrosoftAspNetCoreAppPackageVersion=$(MicrosoftAspNetCoreAppPackageVersion); |
| 56 | + RuntimeFrameworkVersion=$(HostingStartupRuntimeFrameworkVersion); |
| 57 | + </_CommonProperties> |
| 58 | + </PropertyGroup> |
| 59 | + |
| 60 | + <MSBuild Projects="$(_RuntimeStoreManifestFile)" |
| 61 | + Targets="ComposeStore" |
| 62 | + Properties="TargetFramework=%(HostingStartupRuntimeStoreTargets.Identity);RuntimeIdentifier=%(HostingStartupRuntimeStoreTargets.Runtime);ComposeDir=$(_RuntimeStoreOutput)\%(HostingStartupRuntimeStoreTargets.Runtime);SkipOptimization=true;$(_CommonProperties)" /> |
| 63 | + <!-- Generate deps --> |
| 64 | + <RemoveDir Directories="%(_HostingStartupPackageReference.WorkingDirectory)" /> |
| 65 | + |
| 66 | + <Copy SourceFiles="@(_TemplateFiles)" DestinationFolder="%(_HostingStartupPackageReference.WorkingDirectory)" /> |
| 67 | + |
| 68 | + <MSBuild Projects="%(_HostingStartupPackageReference.Project)" |
| 69 | + Targets="Restore" |
| 70 | + Properties="HostingStartupPackageName=%(_HostingStartupPackageReference.Identity);HostingStartupPackageVersion=%(_HostingStartupPackageReference.Version);UseAppHost=false;NoBuild=false;$(_CommonProperties)" /> |
| 71 | + |
| 72 | + <MSBuild Projects="%(_HostingStartupPackageReference.Project)" |
| 73 | + Targets="Publish" |
| 74 | + Properties="PublishDir=%(_HostingStartupPackageReference.WorkingDirectory)\p;HostingStartupPackageName=%(_HostingStartupPackageReference.Identity);HostingStartupPackageVersion=%(_HostingStartupPackageReference.Version);UseAppHost=false;NoBuild=false;IncludeMainProjectInDepsFile=false;$(_CommonProperties)" /> |
| 75 | + <Copy SourceFiles="%(_HostingStartupPackageReference.DepsFile)" DestinationFiles="%(_HostingStartupPackageReference.TrimmedDepsFile)" /> |
| 76 | + |
| 77 | + <ItemGroup> |
| 78 | + <_RuntimeStoreFiles Include="$(_RuntimeStoreOutput)\%(HostingStartupRuntimeStoreTargets.Runtime)\**\*.dll" /> |
| 79 | + |
| 80 | + <Content Include="%(_RuntimeStoreFiles.Identity)" PackagePath="content\store\%(RecursiveDir)" /> |
| 81 | + <Content Include="%(_HostingStartupPackageReference.TrimmedDepsFile)" PackagePath="%(_HostingStartupPackageReference.PackagePath)" /> |
| 82 | + </ItemGroup> |
| 83 | + |
| 84 | + </Target> |
| 85 | + |
| 86 | +</Project> |
0 commit comments