Skip to content

Update dependencies and workaround dotnet/sdk#2976 #7844

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 11 commits into from
Feb 23, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .azure/pipelines/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ trigger:
include:
- master
- release/*
- internal/release/*
- ci/*

# Run PR validation on all branches
pr:
Expand Down
2 changes: 1 addition & 1 deletion build/Maestro/Maestro.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
Artifacts="@(PackageToPublish)"
OutputPath="$(ManifestsPath)aspnetcore-$(TargetRuntimeIdentifier)-$(PackageVersion).xml"
BuildId="$(PackageVersion)"
BuildData="Location=https://dotnet.myget.org/F/aspnetcore-dev/api/v3/index.json"
BuildData="Location=https://dotnetfeed.blob.core.windows.net/aspnet-aspnetcore/index.json"
RepoUri="$(RepositoryUrl)"
RepoBranch="$(BUILD_SOURCEBRANCH)"
RepoCommit="$(BUILD_SOURCEVERSION)" />
Expand Down
3 changes: 3 additions & 0 deletions build/sources.props
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@

<RestoreSources Condition=" '$(DotNetBuildOffline)' != 'true' ">
$(RestoreSources);
https://dotnetfeed.blob.core.windows.net/aspnet-extensions/index.json;
https://dotnetfeed.blob.core.windows.net/aspnet-entityframeworkcore/index.json;
https://dotnetfeed.blob.core.windows.net/aspnet-aspnetcore-tooling/index.json;
https://dotnetfeed.blob.core.windows.net/dotnet-core/index.json;
https://api.nuget.org/v3/index.json;
https://dotnet.myget.org/F/aspnetcore-dev/api/v3/index.json;
Expand Down
16 changes: 16 additions & 0 deletions dockerbuild.sh
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,22 @@ fi
dockerfile="$DIR/build/docker/$image.Dockerfile"
tagname="aspnetcore-build-$image"

# Use docker pull with retries to pre-pull the image need by the dockerfile
# docker build regularly fails with TLS handshake issues for unclear reasons.
base_imagename="$(grep -E -o 'FROM (.*)' $dockerfile | cut -c 6-)"
pull_retries=3
while [ $pull_retries -gt 0 ]; do
failed=false
docker pull $base_imagename || failed=true
if [ "$failed" = true ]; then
let pull_retries=pull_retries-1
echo -e "${YELLOW}Failed to pull $base_imagename Retries left: $pull_retries.${RESET}"
sleep 1
else
pull_retries=0
fi
done

docker build "$(dirname "$dockerfile")" \
--build-arg "USER=$(whoami)" \
--build-arg "USER_ID=$(id -u)" \
Expand Down
374 changes: 187 additions & 187 deletions eng/Version.Details.xml

Large diffs are not rendered by default.

188 changes: 94 additions & 94 deletions eng/Versions.props

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions eng/Workarounds.targets
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@
<BundledNETCorePlatformsPackageVersion>$(MicrosoftNETCorePlatformsPackageVersion)</BundledNETCorePlatformsPackageVersion>
</PropertyGroup>

<!-- Workaround https://github.com/dotnet/sdk/issues/2976 -->
<ItemGroup>
<PackageReference Update="Microsoft.NETCore.Platforms" PrivateAssets="All" />
</ItemGroup>

<!-- Workaround https://github.com/aspnet/AspNetCore/issues/7503. This chains GenerateSourceLinkFile before razor component targets run. -->
<Target Name="_EnsureSourceLinkHappensBeforeRazorComponentGeneration"
BeforeTargets="PrepareForRazorComponentGenerate"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,12 +104,15 @@ public async Task CheckAsync_CustomTest_Unhealthy()
}
}

// used to ensure each test uses a unique in-memory database
private static int _testDbCounter;

private static IServiceProvider CreateServices(
Func<TestDbContext, CancellationToken, Task<bool>> testQuery = null,
HealthStatus failureStatus = HealthStatus.Unhealthy)
{
var serviceCollection = new ServiceCollection();
serviceCollection.AddDbContext<TestDbContext>(o => o.UseInMemoryDatabase("Test"));
serviceCollection.AddDbContext<TestDbContext>(o => o.UseInMemoryDatabase("Test" + Interlocked.Increment(ref _testDbCounter)));

var builder = serviceCollection.AddHealthChecks();
builder.AddDbContextCheck<TestDbContext>("test", failureStatus, new[] { "tag1", "tag2", }, testQuery);
Expand Down
5 changes: 4 additions & 1 deletion src/Mvc/Mvc.Localization/src/HtmlLocalizer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -85,14 +85,17 @@ public virtual IEnumerable<LocalizedString> GetAllStrings(bool includeParentCult
_localizer.GetAllStrings(includeParentCultures);

/// <inheritdoc />
[Obsolete("This method is obsolete. Use `CurrentCulture` and `CurrentUICulture` instead.")]
public virtual IHtmlLocalizer WithCulture(CultureInfo culture)
{
if (culture == null)
{
throw new ArgumentNullException(nameof(culture));
}

#pragma warning disable CS0618 // Type or member is obsolete
return new HtmlLocalizer(_localizer.WithCulture(culture));
#pragma warning restore CS0618 // Type or member is obsolete
}

/// <summary>
Expand All @@ -105,4 +108,4 @@ protected virtual LocalizedHtmlString ToHtmlString(LocalizedString result) =>
protected virtual LocalizedHtmlString ToHtmlString(LocalizedString result, object[] arguments) =>
new LocalizedHtmlString(result.Name, result.Value, result.ResourceNotFound, arguments);
}
}
}
5 changes: 4 additions & 1 deletion src/Mvc/Mvc.Localization/src/HtmlLocalizerOfT.cs
Original file line number Diff line number Diff line change
Expand Up @@ -81,14 +81,17 @@ public virtual IEnumerable<LocalizedString> GetAllStrings(bool includeParentCult
_localizer.GetAllStrings(includeParentCultures);

/// <inheritdoc />
[Obsolete("This method is obsolete. Use `CurrentCulture` and `CurrentUICulture` instead.")]
public virtual IHtmlLocalizer WithCulture(CultureInfo culture)
{
if (culture == null)
{
throw new ArgumentNullException(nameof(culture));
}

#pragma warning disable CS0618 // Type or member is obsolete
return _localizer.WithCulture(culture);
#pragma warning restore CS0618 // Type or member is obsolete
}
}
}
}
4 changes: 3 additions & 1 deletion src/Mvc/Mvc.Localization/src/IHtmlLocalizer.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// 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.Collections.Generic;
using System.Globalization;
using Microsoft.Extensions.Localization;
Expand Down Expand Up @@ -58,6 +59,7 @@ public interface IHtmlLocalizer
/// </summary>
/// <param name="culture">The <see cref="CultureInfo"/> to use.</param>
/// <returns>A culture-specific <see cref="IHtmlLocalizer"/>.</returns>
[Obsolete("This method is obsolete. Use `CurrentCulture` and `CurrentUICulture` instead.")]
IHtmlLocalizer WithCulture(CultureInfo culture);
}
}
}
6 changes: 5 additions & 1 deletion src/Mvc/Mvc.Localization/src/ViewLocalizer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,11 @@ public virtual LocalizedHtmlString this[string key]
public LocalizedString GetString(string name, params object[] values) => _localizer.GetString(name, values);

/// <inheritdoc />
[Obsolete("This method is obsolete. Use `CurrentCulture` and `CurrentUICulture` instead.")]

#pragma warning disable CS0618 // Type or member is obsolete
public IHtmlLocalizer WithCulture(CultureInfo culture) => _localizer.WithCulture(culture);
#pragma warning restore CS0618 // Type or member is obsolete

/// <inheritdoc />
public IEnumerable<LocalizedString> GetAllStrings(bool includeParentCultures) =>
Expand Down Expand Up @@ -127,4 +131,4 @@ private string BuildBaseName(string path)
return builder.ToString();
}
}
}
}
2 changes: 2 additions & 0 deletions src/Mvc/Mvc.Localization/test/HtmlLocalizerTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,9 @@ public void HtmlLocalizer_WithCulture_ReturnsLocalizedHtmlString()
var htmlLocalizer = new HtmlLocalizer(stringLocalizer);

// Act
#pragma warning disable CS0618 // Type or member is obsolete
var actualLocalizedHtmlString = htmlLocalizer.WithCulture(new CultureInfo("fr"))["John"];
#pragma warning restore CS0618 // Type or member is obsolete

// Assert
Assert.Equal("Bonjour John", actualLocalizedHtmlString.Value);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ public IEnumerable<LocalizedString> GetAllStrings(bool includeParentCultures)
throw new NotImplementedException();
}

[Obsolete("This method is obsolete. Use `CurrentCulture` and `CurrentUICulture` instead.")]
public IHtmlLocalizer WithCulture(CultureInfo culture)
{
throw new NotImplementedException();
Expand Down Expand Up @@ -127,6 +128,7 @@ public IEnumerable<LocalizedString> GetAllStrings(bool includeParentCultures)
throw new NotImplementedException();
}

[Obsolete("This method is obsolete. Use `CurrentCulture` and `CurrentUICulture` instead.")]
public IHtmlLocalizer WithCulture(CultureInfo culture)
{
throw new NotImplementedException();
Expand Down
2 changes: 2 additions & 0 deletions src/Mvc/Mvc.Localization/test/TestStringLocalizer.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// 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.Collections.Generic;
using System.Globalization;
using Microsoft.Extensions.Localization;
Expand Down Expand Up @@ -67,6 +68,7 @@ public IEnumerable<LocalizedString> GetAllStrings(bool includeParentCultures)
return allStrings;
}

[Obsolete("This method is obsolete. Use `CurrentCulture` and `CurrentUICulture` instead.")]
public IStringLocalizer WithCulture(CultureInfo culture)
{
return new TestStringLocalizer(culture);
Expand Down
3 changes: 3 additions & 0 deletions src/Mvc/Mvc.Localization/test/ViewLocalizerTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,9 @@ public void ViewLocalizer_WithCulture_ReturnsLocalizedHtmlString()
viewLocalizer.Contextualize(viewContext);

// Act
#pragma warning disable CS0618 // Type or member is obsolete
var actualLocalizedString = viewLocalizer.WithCulture(new CultureInfo("fr"))["John"];
#pragma warning restore CS0618 // Type or member is obsolete

// Assert
Assert.Equal("Bonjour John", actualLocalizedString.Value);
Expand Down Expand Up @@ -325,6 +327,7 @@ public IEnumerable<LocalizedString> GetAllStrings(bool includeParentCultures)
return _stringLocalizer.GetAllStrings(includeParentCultures);
}

[Obsolete("This method is obsolete. Use `CurrentCulture` and `CurrentUICulture` instead.")]
public IHtmlLocalizer WithCulture(CultureInfo culture)
{
return new TestHtmlLocalizer(new TestStringLocalizer(culture));
Expand Down