Merge pull request #246 from dotnet-maestro-bot/merge/release/2.2-to-master

[automated] Merge branch 'release/2.2' => 'master'
This commit is contained in:
Pavel Krymets 2018-10-26 10:09:00 -07:00 коммит произвёл GitHub
Родитель 4f78b9a327 f58d3d4e94
Коммит de39065c3d
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
10 изменённых файлов: 0 добавлений и 199 удалений

Просмотреть файл

@ -46,8 +46,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.AzureA
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Web.Xdt.Extensions.Tests", "test\Microsoft.Web.Xdt.Extensions.Tests\Microsoft.Web.Xdt.Extensions.Tests.csproj", "{809AEE05-1B28-4E31-8959-776B249BD725}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.AzureAppServices.SiteExtension.Tests", "test\Microsoft.AspNetCore.AzureAppServices.SiteExtension.Tests\Microsoft.AspNetCore.AzureAppServices.SiteExtension.Tests.csproj", "{491A857A-3529-4375-985D-D748F9F01476}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Extensions.ApplicationModelDetection", "src\Microsoft.Extensions.ApplicationModelDetection\Microsoft.Extensions.ApplicationModelDetection.csproj", "{F0CABFE8-A5B1-487B-A451-A486D26742D3}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Extensions.ApplicationModelDetection.Tests", "test\Microsoft.Extensions.ApplicationModelDetection.Tests\Microsoft.Extensions.ApplicationModelDetection.Tests.csproj", "{15664836-2B94-4D2D-AC18-6DED01FCCCBD}"
@ -108,10 +106,6 @@ Global
{809AEE05-1B28-4E31-8959-776B249BD725}.Debug|Any CPU.Build.0 = Debug|Any CPU
{809AEE05-1B28-4E31-8959-776B249BD725}.Release|Any CPU.ActiveCfg = Release|Any CPU
{809AEE05-1B28-4E31-8959-776B249BD725}.Release|Any CPU.Build.0 = Release|Any CPU
{491A857A-3529-4375-985D-D748F9F01476}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{491A857A-3529-4375-985D-D748F9F01476}.Debug|Any CPU.Build.0 = Debug|Any CPU
{491A857A-3529-4375-985D-D748F9F01476}.Release|Any CPU.ActiveCfg = Release|Any CPU
{491A857A-3529-4375-985D-D748F9F01476}.Release|Any CPU.Build.0 = Release|Any CPU
{F0CABFE8-A5B1-487B-A451-A486D26742D3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F0CABFE8-A5B1-487B-A451-A486D26742D3}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F0CABFE8-A5B1-487B-A451-A486D26742D3}.Release|Any CPU.ActiveCfg = Release|Any CPU
@ -141,7 +135,6 @@ Global
{0899A101-E451-40A4-81B0-7AA18202C25D} = {CD650B4B-81C2-4A44-AEF2-A251A877C1F0}
{2B2C37FF-9249-4EA4-9A7F-038B55A15C2C} = {CD650B4B-81C2-4A44-AEF2-A251A877C1F0}
{809AEE05-1B28-4E31-8959-776B249BD725} = {CD650B4B-81C2-4A44-AEF2-A251A877C1F0}
{491A857A-3529-4375-985D-D748F9F01476} = {CD650B4B-81C2-4A44-AEF2-A251A877C1F0}
{F0CABFE8-A5B1-487B-A451-A486D26742D3} = {FF9B744E-6C59-40CC-9E41-9D2EBD292435}
{15664836-2B94-4D2D-AC18-6DED01FCCCBD} = {CD650B4B-81C2-4A44-AEF2-A251A877C1F0}
{E1E9BC7A-6951-4B60-8DFB-DBB9AC3CDEB0} = {FF9B744E-6C59-40CC-9E41-9D2EBD292435}

Просмотреть файл

@ -12,16 +12,6 @@
<PackageId>Microsoft.AspNetCore.AzureAppServices.SiteExtension.$(TrimmedVersion)</PackageId>
</PropertyGroup>
<ItemGroup>
<Content Include="applicationHost.xdt" />
<Content Include="scmApplicationHost.xdt" />
<Content Include="bin\$(Configuration)\$(TargetFramework)\Microsoft.Web.Xdt.Extensions.dll" PackagePath="content" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\src\Microsoft.Web.Xdt.Extensions\Microsoft.Web.Xdt.Extensions.csproj" PrivateAssets="All" />
</ItemGroup>
<ItemGroup>
<HostingStartupPackageReference Include="Microsoft.AspNetCore.AzureAppServices.HostingStartup" Version="$(MicrosoftAspNetCoreAzureAppServicesHostingStartupPackageVersion)" />

Просмотреть файл

@ -1,16 +0,0 @@
<?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="DOTNET_ADDITIONAL_DEPS" value="%XDT_EXTENSIONPATH%\additionalDeps\Microsoft.AspNetCore.AzureAppServices.HostingStartup\;%ProgramFiles%\dotnet\additionalDeps\Microsoft.AspNetCore.AzureAppServices.HostingStartup\" xdt:Locator="Match(name)" xdt:Transform="InsertOrAppendAttribute(Attribute='value')" />
<add name="DOTNET_SHARED_STORE" value="%XDT_EXTENSIONPATH%\store" xdt:Locator="Match(name)" xdt:Transform="InsertOrAppendAttribute(Attribute='value')" />
<add name="ASPNETCORE_HOSTINGSTARTUPASSEMBLIES" value="Microsoft.AspNetCore.AzureAppServices.HostingStartup" xdt:Locator="Match(name)" xdt:Transform="InsertOrAppendAttribute(Attribute='value')" />
</environmentVariables>
</runtime>
</system.webServer>
</configuration>

Просмотреть файл

@ -1,5 +0,0 @@
<?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>

Просмотреть файл

@ -1,29 +0,0 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net461</TargetFramework>
</PropertyGroup>
<ItemGroup>
<Content Include="..\..\extensions\Microsoft.AspNetCore.AzureAppServices.SiteExtension\applicationHost.xdt" Link="applicationHost.xdt">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="config_empty.xml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="config_existingemptyvalue.xml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="config_existingline.xml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="config_existingvalue.xml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\src\Microsoft.Web.Xdt.Extensions\Microsoft.Web.Xdt.Extensions.csproj" />
</ItemGroup>
</Project>

Просмотреть файл

@ -1,93 +0,0 @@
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System;
using System.IO;
using System.Xml;
using Microsoft.Web.XmlTransform;
using Xunit;
namespace Microsoft.AspNetCore.AzureAppServices.SiteExtension
{
public class TransformTest
{
private static readonly string XdtExtensionPath = AppDomain.CurrentDomain.BaseDirectory;
[Theory]
[InlineData("config_empty.xml")]
[InlineData("config_existingline.xml")]
[InlineData("config_existingEmptyValue.xml")]
public void Transform_EmptyConfig_Added(string configFile)
{
var doc = LoadDocAndRunTransform(configFile);
Assert.Equal(2, doc.ChildNodes.Count);
var envNode = doc["configuration"]?["system.webServer"]?["runtime"]?["environmentVariables"];
Assert.NotNull(envNode);
Assert.Equal(3, envNode.ChildNodes.Count);
var depsElement = envNode.FirstChild;
Assert.Equal("add", depsElement.Name);
Assert.Equal("DOTNET_ADDITIONAL_DEPS", depsElement.Attributes["name"].Value);
Assert.Equal($@"{XdtExtensionPath}\additionalDeps\Microsoft.AspNetCore.AzureAppServices.HostingStartup\;" +
@"%ProgramFiles%\dotnet\additionalDeps\Microsoft.AspNetCore.AzureAppServices.HostingStartup\",
depsElement.Attributes["value"].Value);
var sharedStoreElement = depsElement.NextSibling;
Assert.Equal("add", sharedStoreElement.Name);
Assert.Equal("DOTNET_SHARED_STORE", sharedStoreElement.Attributes["name"].Value);
Assert.Equal($@"{XdtExtensionPath}\store", sharedStoreElement.Attributes["value"].Value);
var startupAssembliesElement = sharedStoreElement.NextSibling;
Assert.Equal("add", startupAssembliesElement.Name);
Assert.Equal("ASPNETCORE_HOSTINGSTARTUPASSEMBLIES", startupAssembliesElement.Attributes["name"].Value);
Assert.Equal("Microsoft.AspNetCore.AzureAppServices.HostingStartup", startupAssembliesElement.Attributes["value"].Value);
}
[Fact]
public void Transform_ExistingValue_AppendsValue()
{
var doc = LoadDocAndRunTransform("config_existingvalue.xml");
Assert.Equal(2, doc.ChildNodes.Count);
var envNode = doc["configuration"]?["system.webServer"]?["runtime"]?["environmentVariables"];
Assert.NotNull(envNode);
Assert.Equal(3, envNode.ChildNodes.Count);
var depsElement = envNode.FirstChild;
Assert.Equal("add", depsElement.Name);
Assert.Equal("DOTNET_ADDITIONAL_DEPS", depsElement.Attributes["name"].Value);
Assert.Equal(@"ExistingValue1;"+
$@"{XdtExtensionPath}\additionalDeps\Microsoft.AspNetCore.AzureAppServices.HostingStartup\;" +
@"%ProgramFiles%\dotnet\additionalDeps\Microsoft.AspNetCore.AzureAppServices.HostingStartup\",
depsElement.Attributes["value"].Value);
var sharedStoreElement = depsElement.NextSibling;
Assert.Equal("add", sharedStoreElement.Name);
Assert.Equal("DOTNET_SHARED_STORE", sharedStoreElement.Attributes["name"].Value);
Assert.Equal($@"ExistingValue3;{XdtExtensionPath}\store", sharedStoreElement.Attributes["value"].Value);
var startupAssembliesElement = sharedStoreElement.NextSibling;
Assert.Equal("add", startupAssembliesElement.Name);
Assert.Equal("ASPNETCORE_HOSTINGSTARTUPASSEMBLIES", startupAssembliesElement.Attributes["name"].Value);
Assert.Equal("ExistingValue2;Microsoft.AspNetCore.AzureAppServices.HostingStartup", startupAssembliesElement.Attributes["value"].Value);
}
private static XmlDocument LoadDocAndRunTransform(string docName)
{
// Microsoft.Web.Hosting.Transformers.ApplicationHost.SiteExtensionDefinition.Transform
// (See Microsoft.Web.Hosting, Version=7.1.0.0) replaces variables for you in Azure.
var transformFile = File.ReadAllText("applicationHost.xdt");
transformFile = transformFile.Replace("%XDT_EXTENSIONPATH%", XdtExtensionPath);
var transform = new XmlTransformation(transformFile, isTransformAFile: false, logger: null);
var doc = new XmlDocument();
doc.Load(docName);
Assert.True(transform.Apply(doc));
return doc;
}
}
}

Просмотреть файл

@ -1,3 +0,0 @@
<?xml version="1.0"?>
<configuration>
</configuration>

Просмотреть файл

@ -1,12 +0,0 @@
<?xml version="1.0"?>
<configuration>
<system.webServer>
<runtime>
<environmentVariables>
<add name="DOTNET_ADDITIONAL_DEPS" value="" />
<add name="DOTNET_SHARED_STORE" value="" />
<add name="ASPNETCORE_HOSTINGSTARTUPASSEMBLIES" value="" />
</environmentVariables>
</runtime>
</system.webServer>
</configuration>

Просмотреть файл

@ -1,12 +0,0 @@
<?xml version="1.0"?>
<configuration>
<system.webServer>
<runtime>
<environmentVariables>
<add name="DOTNET_ADDITIONAL_DEPS" />
<add name="DOTNET_SHARED_STORE" />
<add name="ASPNETCORE_HOSTINGSTARTUPASSEMBLIES" />
</environmentVariables>
</runtime>
</system.webServer>
</configuration>

Просмотреть файл

@ -1,12 +0,0 @@
<?xml version="1.0"?>
<configuration>
<system.webServer>
<runtime>
<environmentVariables>
<add name="DOTNET_ADDITIONAL_DEPS" value="ExistingValue1" />
<add name="DOTNET_SHARED_STORE" value="ExistingValue3" />
<add name="ASPNETCORE_HOSTINGSTARTUPASSEMBLIES" value="ExistingValue2" />
</environmentVariables>
</runtime>
</system.webServer>
</configuration>