Merge branch 'rel/2.0.0-preview1' into dev
This commit is contained in:
commit
b19dd5c4da
|
|
@ -3,6 +3,7 @@
|
|||
<packageSources>
|
||||
<add key="AspNetCore" value="https://dotnet.myget.org/F/aspnetcore-ci-dev/api/v3/index.json" />
|
||||
<add key="AspNetCoreTools" value="https://dotnet.myget.org/F/aspnetcore-tools/api/v3/index.json" />
|
||||
<add key="msbuild" value="https://dotnet.myget.org/F/msbuild/api/v3/index.json" />
|
||||
<add key="NuGet" value="https://api.nuget.org/v3/index.json" />
|
||||
</packageSources>
|
||||
</configuration>
|
||||
|
|
|
|||
|
|
@ -11,14 +11,11 @@
|
|||
<SignAssembly>true</SignAssembly>
|
||||
<PublicSign Condition="'$(OS)' != 'Windows_NT'">true</PublicSign>
|
||||
<OriginalVersionSuffix>$(VersionSuffix)</OriginalVersionSuffix>
|
||||
|
||||
<!-- Don't mess with VersionSuffix, we need to use it unmodified in other targets -->
|
||||
<BuildVersionSuffix>$(VersionSuffix)</BuildVersionSuffix>
|
||||
<BuildVersionSuffix Condition="'$(BuildNumber)' != ''">$(VersionSuffix)-$(BuildNumber)</BuildVersionSuffix>
|
||||
<VersionSuffix Condition="'$(BuildNumber)' != ''">$(VersionSuffix)-$(BuildNumber)</VersionSuffix>
|
||||
|
||||
<!-- Pin versions to work around CLI bug -->
|
||||
<AspNetCoreVersion Condition="'$(BUILD_PACKAGE_CACHE)' == 'true'">2.0.0-$(BuildVersionSuffix)</AspNetCoreVersion>
|
||||
<AspNetCoreIdentityServiceVersion Condition="'$(BUILD_PACKAGE_CACHE)' == 'true'">1.0.0-$(BuildVersionSuffix)</AspNetCoreIdentityServiceVersion>
|
||||
<AspNetCoreVersion Condition="'$(BUILD_PACKAGE_CACHE)' == 'true'">2.0.0-$(VersionSuffix)</AspNetCoreVersion>
|
||||
<AspNetCoreIdentityServiceVersion Condition="'$(BUILD_PACKAGE_CACHE)' == 'true'">1.0.0-$(VersionSuffix)</AspNetCoreIdentityServiceVersion>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
|
|
|||
|
|
@ -100,6 +100,8 @@
|
|||
<Error Text="AspNetPackageVersion must be specified" Condition=" '$(AspNetPackageVersion)' == '' " />
|
||||
<Error Text="PackageSource must be specified" Condition=" '$(PackageSource)' == '' " />
|
||||
<Error Text="OutputPackageName must be specified" Condition=" '$(OutputPackageName)' == '' " />
|
||||
<Error Text="ArchiverPath must be specified" Condition=" '$(ArchiverPath)' == '' " />
|
||||
<Error Text="Archiver not found at $(ArchiverPath)" Condition="!Exists('$(ArchiverPath)')" />
|
||||
|
||||
<!-- Clear the directories -->
|
||||
<RemoveDir Directories="$(FallbackArchiveDir)bin" />
|
||||
|
|
@ -125,9 +127,8 @@
|
|||
<MSBuild Projects="$(FallbackArchiveProj)" Targets="Restore" Properties="RestorePackagesPath=$(FallbackStagingDir);AspNetPackageVersion=$(AspNetPackageVersion);RestoreConfigFile=$(FallbackRestoreConfigFile)" />
|
||||
|
||||
<!-- Create the archive -->
|
||||
<Error Text="Archiver failed to build? Could not find it at $(ArchiverBinary)" Condition="!Exists('$(ArchiverBinary)')" />
|
||||
<Message Text="Producing LZMA Archive, this may take a while..." Importance="high" />
|
||||
<Exec Command="dotnet $(ArchiverBinary) -a $(FallbackOutputArchive) $(FallbackStagingDir)" />
|
||||
<Exec Command="$(ArchiverPath) -a $(FallbackOutputArchive) $(FallbackStagingDir)" />
|
||||
</Target>
|
||||
|
||||
<Target Name="BuildFallbackArchive">
|
||||
|
|
@ -141,8 +142,8 @@
|
|||
<NoTimestampSuffix Condition="'$(TIMESTAMP_FREE_VERSION)' != ''">$(TIMESTAMP_FREE_VERSION)</NoTimestampSuffix>
|
||||
<NoTimestampSuffix Condition="'$(NoTimestampSuffix)' == ''">final</NoTimestampSuffix>
|
||||
|
||||
<NoTimestampVersion>$(VersionPrefix)-$(VersionSuffix)-$(NoTimestampSuffix)</NoTimestampVersion>
|
||||
<TimestampVersion>$(VersionPrefix)-$(VersionSuffix)-$(BuildNumber)</TimestampVersion>
|
||||
<NoTimestampVersion>$(VersionPrefix)-$(OriginalVersionSuffix)-$(NoTimestampSuffix)</NoTimestampVersion>
|
||||
<TimestampVersion>$(VersionPrefix)-$(OriginalVersionSuffix)-$(BuildNumber)</TimestampVersion>
|
||||
|
||||
<NoTimestampSource>$(COHERENCE_SIGNED_DROP_LOCATION)\Signed\Packages-NoTimeStamp</NoTimestampSource>
|
||||
<TimestampSource>$(COHERENCE_SIGNED_DROP_LOCATION)\Signed\Packages</TimestampSource>
|
||||
|
|
@ -155,14 +156,14 @@
|
|||
<!-- Run the actual target twice, once for timestamped packages, once for non-timestamped packages -->
|
||||
<!-- Here, we're re-invoking KoreBuild, but limiting it to a specific target. -->
|
||||
<!-- This won't rerun the whole build, but it ensures that the necessary MSBuild Tasks and Properties are initialized -->
|
||||
<MSBuild Projects="$(ProjectPath)" Targets="_BuildFallbackArchive" Properties="AspNetPackageVersion=$(TimestampVersion);PackageSource=$(TimestampSource);OutputPackageName=nuGetPackagesArchive.timestamped" />
|
||||
<MSBuild Projects="$(ProjectPath)" Targets="_BuildFallbackArchive" Properties="AspNetPackageVersion=$(NoTimestampVersion);PackageSource=$(NoTimestampSource);OutputPackageName=nuGetPackagesArchive.notimestamp" />
|
||||
<MSBuild Projects="$(ProjectPath)" Targets="_BuildFallbackArchive" Properties="AspNetPackageVersion=$(TimestampVersion);PackageSource=$(TimestampSource);OutputPackageName=nuGetPackagesArchive.timestamped;ArchiverPath=$(ArchiverPath)" />
|
||||
<MSBuild Projects="$(ProjectPath)" Targets="_BuildFallbackArchive" Properties="AspNetPackageVersion=$(NoTimestampVersion);PackageSource=$(NoTimestampSource);OutputPackageName=nuGetPackagesArchive.notimestamp;ArchiverPath=$(ArchiverPath)" />
|
||||
|
||||
<!-- Copy LZMA archives to Coherence-Signed drop location -->
|
||||
<PropertyGroup>
|
||||
<PublishDir Condition="'$(PublishShare)' != ''">$(PublishShare)\fallbackArchives</PublishDir>
|
||||
</PropertyGroup>
|
||||
<Copy SourceFiles="$(RepositoryRoot)artifacts\nuGetPackagesArchive.timestamped.lzma;$(RepositoryRoot)artifacts\nuGetPackagesArchive..notimestamp.lzma" DestinationFolder="$(PublishDir)" Condition="'$(PublishDir)' != ''" />
|
||||
<Copy SourceFiles="$(RepositoryRoot)artifacts\nuGetPackagesArchive.timestamped.lzma;$(RepositoryRoot)artifacts\nuGetPackagesArchive.notimestamp.lzma" DestinationFolder="$(PublishDir)" Condition="'$(PublishDir)' != ''" />
|
||||
</Target>
|
||||
|
||||
<Target Name="AddManifestsToNupkg">
|
||||
|
|
|
|||
|
|
@ -4,28 +4,22 @@
|
|||
<TargetFramework>netcoreapp2.0</TargetFramework>
|
||||
<PackageTargetFallback>$(PackageTargetFallback);portable-net45+win8+wp8+wpa81;</PackageTargetFallback>
|
||||
<EnableApiCheck>false</EnableApiCheck>
|
||||
<DotnetCliToolTargetFramework>netcoreapp2.0</DotnetCliToolTargetFramework>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<!-- Something simple to get it working right now -->
|
||||
<PackageReference Include="Microsoft.Extensions.ObjectPool" Version="$(AspNetPackageVersion)" />
|
||||
|
||||
<!-- Our packages are broken right now :(
|
||||
<PackageReference Include="Microsoft.AspNetCore.All" Version="$(AspNetPackageVersion)" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="$(AspNetPackageVersion)" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite.Design" Version="$(AspNetPackageVersion)" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer.Design" Version="$(AspNetPackageVersion)" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="$(AspNetPackageVersion)" />
|
||||
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="$(AspNetPackageVersion)" />
|
||||
-->
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<!-- Tools don't work right now
|
||||
<DotNetCliToolReference Include="Microsoft.EntityFrameworkCore.Tools.DotNet" Version="$(AspNetPackageVersion)" />
|
||||
<DotNetCliToolReference Include="Microsoft.Extensions.SecretManager.Tools" Version="$(AspNetPackageVersion)" />
|
||||
<DotNetCliToolReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Tools" Version="$(AspNetPackageVersion)" />
|
||||
-->
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
|
|
|||
|
|
@ -175,8 +175,9 @@ namespace Microsoft.AspNetCore
|
|||
config.AddCommandLine(args);
|
||||
}
|
||||
})
|
||||
.ConfigureLogging(logging =>
|
||||
.ConfigureLogging((hostingContext, logging) =>
|
||||
{
|
||||
logging.UseConfiguration(hostingContext.Configuration.GetSection("Logging"));
|
||||
logging.AddConsole();
|
||||
logging.AddDebug();
|
||||
})
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@
|
|||
<TargetFramework>netcoreapp2.0</TargetFramework>
|
||||
<OutputType>Exe</OutputType>
|
||||
<EnableApiCheck>false</EnableApiCheck>
|
||||
<RuntimeIdentifier>win7-x64</RuntimeIdentifier>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
|
|
|||
|
|
@ -200,6 +200,47 @@ namespace Microsoft.AspNetCore.Tests
|
|||
}
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void LoggingConfigurationSectionPassedToLoggerByDefault()
|
||||
{
|
||||
try
|
||||
{
|
||||
File.WriteAllText("appsettings.json", @"
|
||||
{
|
||||
""Logging"": {
|
||||
""LogLevel"": {
|
||||
""Default"": ""Warning""
|
||||
}
|
||||
}
|
||||
}
|
||||
");
|
||||
using (var webHost = WebHost.Start(context => context.Response.WriteAsync("Hello, World!")))
|
||||
{
|
||||
var factory = (ILoggerFactory)webHost.Services.GetService(typeof(ILoggerFactory));
|
||||
var logger = factory.CreateLogger("Test");
|
||||
|
||||
logger.Log(LogLevel.Information, 0, "Message", null, (s, e) =>
|
||||
{
|
||||
Assert.True(false);
|
||||
return string.Empty;
|
||||
});
|
||||
|
||||
var logWritten = false;
|
||||
logger.Log(LogLevel.Warning, 0, "Message", null, (s, e) =>
|
||||
{
|
||||
logWritten = true;
|
||||
return string.Empty;
|
||||
});
|
||||
|
||||
Assert.True(logWritten);
|
||||
}
|
||||
}
|
||||
finally
|
||||
{
|
||||
File.Delete("appsettings.json");
|
||||
}
|
||||
}
|
||||
|
||||
private async Task ExecuteStartOrStartWithTest(Func<DeploymentResult, Task<HttpResponseMessage>> getResponse, string applicationName)
|
||||
{
|
||||
await ExecuteTestApp(applicationName, async (deploymentResult, logger) =>
|
||||
|
|
|
|||
|
|
@ -24,7 +24,6 @@ namespace CreateDefaultBuilderApp
|
|||
string responseMessage = string.Empty;
|
||||
|
||||
WebHost.CreateDefaultBuilder(new[] { "--cliKey", "cliValue" })
|
||||
.UseLoggerFactory(new TestLoggerFactory())
|
||||
.ConfigureServices((context, services) =>
|
||||
{
|
||||
responseMessage = GetResponseMessage(context, services);
|
||||
|
|
@ -77,34 +76,11 @@ namespace CreateDefaultBuilderApp
|
|||
return $"Command line arguments not loaded into Configuration.";
|
||||
}
|
||||
|
||||
var testLoggerFactory = (TestLoggerFactory)context.LoggerFactory;
|
||||
|
||||
// Verify AddConsole called
|
||||
if (!testLoggerFactory.Providers.Any(provider => provider is ConsoleLoggerProvider))
|
||||
{
|
||||
return $"Console logger not added to ILoggerFactory.";
|
||||
}
|
||||
|
||||
// Verify AddDebug called
|
||||
if (!testLoggerFactory.Providers.Any(provider => provider is DebugLoggerProvider))
|
||||
{
|
||||
return $"Debug logger not added to ILoggerFactory.";
|
||||
}
|
||||
|
||||
// TODO: Verify AddConsole called
|
||||
// TODO: Verify AddDebug called
|
||||
// TODO: Verify UseIISIntegration called
|
||||
|
||||
return context.HostingEnvironment.ApplicationName;
|
||||
}
|
||||
|
||||
private class TestLoggerFactory : ILoggerFactory
|
||||
{
|
||||
public IList<ILoggerProvider> Providers { get; } = new List<ILoggerProvider>();
|
||||
|
||||
public void AddProvider(ILoggerProvider provider) => Providers.Add(provider);
|
||||
|
||||
public ILogger CreateLogger(string categoryName) => NullLogger.Instance;
|
||||
|
||||
public void Dispose() { }
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue