Move runtime site extension to installers (#3954)

This commit is contained in:
Pavel Krymets 2018-11-08 14:13:07 -08:00 committed by GitHub
parent 416d8cd1ea
commit 89a3526769
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 144 additions and 1 deletions

View File

@ -6,6 +6,7 @@
<BuildSharedFxDependsOn>_BuildSharedFxProjects;TestSharedFx</BuildSharedFxDependsOn>
<BuildSharedFxDependsOn Condition="'$(TestOnly)' != 'true'">$(BuildSharedFxDependsOn);CodeSign</BuildSharedFxDependsOn>
<RedistNetCorePath>$(IntermediateDir)ar\$(SharedFxRid)\</RedistNetCorePath>
<BuildRuntimeSiteExtension Condition="'$(SharedFxRid)' == 'win-x64' OR '$(SharedFxRid)' == 'win-x86'">true</BuildRuntimeSiteExtension>
</PropertyGroup>
<ItemGroup>
@ -13,6 +14,7 @@
<ProjectToBuild Include="$(RepositoryRoot)src\Framework\**\*.shfxproj" />
<ProjectToBuild Include="$(UnitTestFxProject)" />
<ProjectToBuild Condition=" '$(BuildRuntimeArchive)' != 'false' " Include="$(RepositoryRoot)src\Installers\Archive\*.*proj" />
<ProjectToBuild Condition=" '$(BuildRuntimeSiteExtension)' == 'true' " Include="$(RepositoryRoot)src\Installers\RuntimeSiteExtension\Microsoft.AspNetCore.Runtime.SiteExtension.pkgproj" />
<ProjectToBuild Condition=" '$(SharedFxRid)' == 'linux-x64' AND '$(LinuxInstallerType)' == 'deb' " Include="$(RepositoryRoot)src\Installers\Debian\*.*proj" />
<ProjectToBuild Condition=" '$(SharedFxRid)' == 'linux-x64' AND '$(LinuxInstallerType)' == 'rpm' " Include="$(RepositoryRoot)src\Installers\Rpm\*.*proj" />
</ItemGroup>
@ -26,6 +28,7 @@
<FilesToSign Include="$(BuildDir)Microsoft.AspNetCore.App.$(PackageVersion).nupkg" Certificate="$(PackageSigningCertName)" />
<FilesToSign Include="$(BuildDir)runtime.$(SharedFxRid).Microsoft.AspNetCore.App.$(PackageVersion).nupkg" Certificate="$(PackageSigningCertName)" />
<FilesToSign Include="$(BuildDir)runtime.$(SharedFxRid).Microsoft.AspNetCore.App.$(PackageVersion).symbols.nupkg" Certificate="$(PackageSigningCertName)" />
<FilesToSign Include="$(BuildDir)AspNetCoreRuntime.3.0.$(SharedFxArchitecture).$(PackageVersion).nupkg" Condition=" '$(BuildRuntimeSiteExtension)' == 'true' " Certificate="$(PackageSigningCertName)" />
</ItemGroup>
<!-- These files should already be signed by the .NET Core team. They have to be listed again here because we recreate a redistributable which includes the Microsoft.NETCore.App runtime. -->
@ -44,8 +47,10 @@
<SharedFxBuildProperties>
$(BuildProperties);
SharedFxRid=$(SharedFxRid);
SharedFxArchitecture=$(SharedFxArchitecture);
DotNetRestoreSourcePropsPath=$(GeneratedRestoreSourcesPropsPath);
DotNetPackageVersionPropsPath=$(GeneratedPackageVersionPropsPath)
DotNetPackageVersionPropsPath=$(GeneratedPackageVersionPropsPath);
PackageVersion=$(PackageVersion)
</SharedFxBuildProperties>
</PropertyGroup>

View File

@ -13,6 +13,7 @@
</ItemDefinitionGroup>
<ItemGroup>
<PackageArtifact Include="AspNetCoreRuntime.3.0.$(SharedFxArchitecture)" Category="noship" Condition=" '$(OS)' == 'Windows_NT' " />
<PackageArtifact Include="dotnet-dev-certs" Category="ship" />
<PackageArtifact Include="dotnet-sql-cache" Category="ship" />
<PackageArtifact Include="dotnet-user-secrets" Category="ship" />

View File

@ -6,6 +6,8 @@
<SharedFxRid Condition=" '$(SharedFxRid)' == '' AND $([MSBuild]::IsOSPlatform('OSX'))">osx-x64</SharedFxRid>
<SharedFxRid Condition=" '$(SharedFxRid)' == '' AND $([MSBuild]::IsOSPlatform('Linux'))">linux-x64</SharedFxRid>
<SharedFxArchitecture Condition="'$(SharedFxArchitecture)' == ''">$(SharedFxRid.Substring($([MSBuild]::Add($(SharedFxRid.LastIndexOf('-')), 1))))</SharedFxArchitecture>
<!-- Defines the default RID of the platform currently running the build. -->
<HostRid Condition=" '$(HostRid)' == '' AND $([MSBuild]::IsOSPlatform('Windows'))">win-x64</HostRid>
<HostRid Condition=" '$(HostRid)' == '' AND $([MSBuild]::IsOSPlatform('OSX'))">osx-x64</HostRid>

View File

@ -0,0 +1,38 @@
<Project>
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory)..\, Directory.Build.targets))\Directory.Build.targets" />
<PropertyGroup>
<!-- There is no build output -->
<IncludeBuildOutput>false</IncludeBuildOutput>
<!-- There are no symbols. -->
<IncludeSymbols>false</IncludeSymbols>
<!-- There is no API to check -->
<EnableApiCheck>false</EnableApiCheck>
<!-- Manually control dependencies -->
<DisableImplicitFrameworkReferences>true</DisableImplicitFrameworkReferences>
<!-- The only build output of a pkgproj is the project -->
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<!-- There is no documentation -->
<GenerateDocumentationFile>false</GenerateDocumentationFile>
<!-- There is no documentation -->
<RunPackageAnalysis>false</RunPackageAnalysis>
</PropertyGroup>
<Target Name="GetArtifactInfo" Returns="@(ArtifactInfo)">
<ItemGroup>
<ArtifactInfo Include="$(TargetPath)">
<ArtifactType>NuGetPackage</ArtifactType>
<PackageId>$(PackageId)</PackageId>
<Version>$(PackageVersion)</Version>
</ArtifactInfo>
</ItemGroup>
</Target>
<Import Project="$(RepositoryRoot)build\tasks\RepoTasks.tasks" />
<Target Name="CopyFilesToOutputDirectory" />
<Target Name="CoreCompile" />
<Target Name="CreateManifestResourceNames" />
</Project>

View File

@ -0,0 +1,47 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net461</TargetFramework>
<PackageType>AzureSiteExtension</PackageType>
<ContentTargetFolders>content</ContentTargetFolders>
<TrimmedVersion>$(VersionPrefix.Substring(0, $(VersionPrefix.LastIndexOf('.'))))</TrimmedVersion>
<Title>ASP.NET Core $(TrimmedVersion) ($(SharedFxArchitecture)) Runtime </Title>
<Description>This site extension installs Microsoft.AspNetCore.All, Microsoft.AspNetCore.App and Microsoft.NetCore.App shared runtimes.</Description>
<PackageTags>aspnetcore;AzureSiteExtension</PackageTags>
<PackageId>AspNetCoreRuntime.$(TrimmedVersion).$(SharedFxArchitecture)</PackageId>
<NoPackageAnalysis>true</NoPackageAnalysis>
<DotNetUnpackFolder>$(RepositoryRoot)obj\ar\$(SharedFxRid)\</DotNetUnpackFolder>
</PropertyGroup>
<ItemGroup>
<Content Include="applicationHost.xdt" />
<Content Include="scmApplicationHost.xdt" />
<Content Include="install.cmd" />
<Content Include="..\..\SiteExtensions\src\Microsoft.Web.Xdt.Extensions\bin\$(Configuration)\net461\Microsoft.Web.Xdt.Extensions.dll" PackagePath="content" />
<Content Include="$(DotNetUnpackFolder)\**\*.*" Condition="$(DotNetAssetRootUrl) != ''" PackagePath="content\%(RecursiveDir)%(FileName)%(Extension)" />
</ItemGroup>
<ItemGroup Condition="'$(SharedFxArchitecture)' == 'x86'">
<Content Include="$(AspNetCoreModuleX86Location)" PackagePath="content\ancm" />
<Content Include="$(OutOfProcessRequestHandlerX86Location)" PackagePath="content\ancm\$(AspNetCoreModuleOutOfProcessVersion)" />
</ItemGroup>
<ItemGroup Condition="'$(SharedFxArchitecture)' == 'x64'">
<Content Include="$(AspNetCoreModuleX64Location)" PackagePath="content\ancm" />
<Content Include="$(OutOfProcessRequestHandlerX64Location)" PackagePath="content\ancm\$(AspNetCoreModuleOutOfProcessVersion)" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\SiteExtensions\src\Microsoft.Web.Xdt.Extensions\Microsoft.Web.Xdt.Extensions.csproj" PrivateAssets="All" ReferenceOutputAssembly="False"/>
<!-- Make sure redist folder is built and ready -->
<ProjectReference Include="..\Archive\Archive.Redist.zipproj" PrivateAssets="All" ReferenceOutputAssembly="False" />
<PackageReference Include="Microsoft.AspNetCore.AspNetCoreModuleV2" Version="$(PackageVersion)" />
</ItemGroup>
<Target Name="CopyFilesToOutputDirectory" />
<Target Name="CoreCompile" />
<Target Name="CreateManifestResourceNames" />
</Project>

View File

@ -0,0 +1,29 @@
<?xml version="1.0"?>
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
<xdt:Import path="%XDT_EXTENSIONPATH%\Microsoft.Web.Xdt.Extensions.dll"
namespace="Microsoft.Web.Xdt.Extensions" />
<system.webServer xdt:Transform="InsertIfMissing">
<runtime xdt:Transform="InsertIfMissing" >
<environmentVariables xdt:Transform="InsertIfMissing">
<add name="PATH" value="%XDT_EXTENSIONPATH%;%USERPROFILE%\.dotnet\tools;%PATH%" xdt:Locator="Match(name)" xdt:Transform="InsertIfMissing" />
<add name="DOTNET_SKIP_FIRST_TIME_EXPERIENCE" value="1" xdt:Locator="Match(name)" xdt:Transform="InsertIfMissing" />
<add name="DOTNET_ROOT" value="%XDT_EXTENSIONPATH%" xdt:Locator="Match(name)" xdt:Transform="InsertIfMissing" />
</environmentVariables>
</runtime>
<globalModules>
<add name="AspNetCoreModuleV2" image="%XDT_EXTENSIONPATH%\ancm\aspnetcorev2.dll" xdt:Locator="Match(name)" xdt:Transform="InsertIfMissing" />
</globalModules>
</system.webServer>
<location>
<system.webServer>
<modules>
<add name="AspNetCoreModuleV2" lockItem="true" xdt:Locator="Match(name)" xdt:Transform="InsertIfMissing" />
</modules>
</system.webServer>
</location>
</configuration>

View File

@ -0,0 +1,16 @@
FOR /R %%x IN (*.nupkg_) DO REN "%%x" "*.nupkg"
SET DOTNET=D:\Program Files (x86)\dotnet
SET RUNTIMES=%DOTNET%\shared\Microsoft.NETCore.App
IF "%ASPNETCORE_COPY_EXISTING_RUNTIMES%" NEQ "1" EXIT /b 0
robocopy "%DOTNET%" "." /E /XC /XN /XO /NFL /NDL ^
/XD "%DOTNET%\sdk" ^
/XD "%RUNTIMES%\1.0.8" ^
/XD "%RUNTIMES%\1.1.5" ^
/XD "%RUNTIMES%\2.0.3"
IF %errorlevel% geq 8 EXIT /b 1
EXIT /b 0

View File

@ -0,0 +1,5 @@
<?xml version="1.0"?>
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
<!-- This file exists to prevent applicationHost.xdt from being applied to scm host that runs
other dotnet processes (dotnet build, csc etc. )-->
</configuration>