Skip to content

Commit

Permalink
Rename Azure.Core.Extensions to Microsoft.Extensions.Azure (Azure#7047)
Browse files Browse the repository at this point in the history
  • Loading branch information
pakrym authored Jul 30, 2019
1 parent c97f44d commit bc63040
Show file tree
Hide file tree
Showing 37 changed files with 59 additions and 38 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -150,3 +150,6 @@ pingme.txt
# TS/Node files
dist/
node_modules/

# MSBuild binary log files
msbuild.binlog
3 changes: 0 additions & 3 deletions sdk/core/Azure.Core.Extensions/src/Properties/AssemblyInfo.cs

This file was deleted.

6 changes: 3 additions & 3 deletions sdk/core/Azure.Core/Azure.Core.All.sln
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Azure.ApplicationModel.Conf
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Azure.Core", "src\Azure.Core.csproj", "{CA90A9FA-F955-49DC-A191-6DEE6FA2E493}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Azure.Core.Extensions", "..\Azure.Core.Extensions\src\Azure.Core.Extensions.csproj", "{F8B2A9A5-1730-4EC6-B2E5-9029F1066D4D}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Extensions.Azure", "..\Microsoft.Extensions.Azure\src\Microsoft.Extensions.Azure.csproj", "{F8B2A9A5-1730-4EC6-B2E5-9029F1066D4D}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Azure.Core.Extensions.Tests", "..\Azure.Core.Extensions\tests\Azure.Core.Extensions.Tests.csproj", "{30AAFF15-4204-493D-9E61-407194FF2330}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Extensions.Azure.Tests", "..\Microsoft.Extensions.Azure\tests\Microsoft.Extensions.Azure.Tests.csproj", "{30AAFF15-4204-493D-9E61-407194FF2330}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Azure.Core.Tests", "tests\Azure.Core.Tests.csproj", "{84491222-6C36-4FA7-BBAE-1FA804129151}"
EndProject
Expand Down Expand Up @@ -61,7 +61,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Azure.Storage.Queues.Tests"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{1BC0D7C7-2E71-4CAA-830C-856E9E2D71A4}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Azure.Core.Extensions.Samples", "..\Azure.Core.Extensions\samples\Azure.Core.Extensions.Samples.csproj", "{C772E341-1EC6-451A-BDAB-647B02BF262B}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Extensions.Azure.Samples", "..\Microsoft.Extensions.Azure\samples\Microsoft.Extensions.Azure.Samples.csproj", "{C772E341-1EC6-451A-BDAB-647B02BF262B}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down
4 changes: 2 additions & 2 deletions sdk/core/Azure.Core/Azure.Core.sln
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Azure.Core", "src\Azure.Cor
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Azure.Core.Tests", "tests\Azure.Core.Tests.csproj", "{84491222-6C36-4FA7-BBAE-1FA804129151}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Azure.Core.Extensions", "..\Azure.Core.Extensions\src\Azure.Core.Extensions.csproj", "{F8945D73-B000-4129-AF58-896EC3DB49AC}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Extensions.Azure", "..\Microsoft.Extensions.Azure\src\Microsoft.Extensions.Azure.csproj", "{F8945D73-B000-4129-AF58-896EC3DB49AC}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Azure.Core.Extensions.Tests", "..\Azure.Core.Extensions\tests\Azure.Core.Extensions.Tests.csproj", "{5B093527-8B04-4D2B-B23D-441D4B5EE305}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Extensions.Azure.Tests", "..\Microsoft.Extensions.Azure\tests\Microsoft.Extensions.Azure.Tests.csproj", "{5B093527-8B04-4D2B-B23D-441D4B5EE305}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down
7 changes: 7 additions & 0 deletions sdk/core/Microsoft.Extensions.Azure/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<IsClientLibrary>true</IsClientLibrary>
</PropertyGroup>

<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory)..\, Directory.Build.props))\Directory.Build.props" />
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using Azure.Core.Pipeline;
using Microsoft.AspNetCore.Hosting;

namespace Azure.Core.Extensions.Samples
namespace Microsoft.Extensions.Azure.Samples
{
internal class DependencyInjectionEnabledPolicy : SynchronousHttpPipelinePolicy
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@
<PackageReference Include="Microsoft.AspNetCore.App" IsImplicitlyDefined="true" />
<ProjectReference Include="..\..\..\keyvault\Azure.Security.KeyVault.Secrets\src\Azure.Security.KeyVault.Secrets.csproj" />
<ProjectReference Include="..\..\..\storage\Azure.Storage.Blobs\src\Azure.Storage.Blobs.csproj" />
<ProjectReference Include="..\src\Azure.Core.Extensions.csproj" />
<ProjectReference Include="..\src\Microsoft.Extensions.Azure.csproj" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using Microsoft.AspNetCore;
using Microsoft.AspNetCore.Hosting;

namespace Azure.Core.Extensions.Samples
namespace Microsoft.Extensions.Azure.Samples
{
public class Program
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,14 @@
using Azure.Core.Pipeline;
using Azure.Identity;
using Azure.Security.KeyVault.Secrets;
using Azure.Storage;
using Azure.Storage.Blobs;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;

namespace Azure.Core.Extensions.Samples
namespace Microsoft.Extensions.Azure.Samples
{
public class Startup
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

using System;
using Azure.Core;
using Azure.Core.Extensions;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Options;
using System;

namespace Azure.Core.Extensions
namespace Microsoft.Extensions.Azure
{
public static class AzureClientBuilderExtensions
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

using System;
using Azure.Core;
using Azure.Core.Extensions;
using Azure.Core.Pipeline;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.DependencyInjection.Extensions;
using Microsoft.Extensions.Options;
using System;

namespace Azure.Core.Extensions
namespace Microsoft.Extensions.Azure
{
public sealed class AzureClientFactoryBuilder : IAzureClientFactoryBuilderWithConfiguration<IConfiguration>, IAzureClientFactoryBuilderWithCredential
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

using System;
using Microsoft.Extensions.DependencyInjection;
using System;

namespace Azure.Core.Extensions
namespace Microsoft.Extensions.Azure
{
public static class AzureClientServiceCollectionExtensions
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

namespace Azure.Core
namespace Microsoft.Extensions.Azure
{
public interface IAzureClientFactory<TClient>
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

using Azure.Core.Extensions;
using Microsoft.Extensions.DependencyInjection;

namespace Azure.Core.Extensions
namespace Microsoft.Extensions.Azure
{
internal sealed class AzureClientBuilder<TClient, TOptions>: IAzureClientBuilder<TClient, TOptions> where TOptions : class
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
using System.Collections.Generic;
using Microsoft.Extensions.Options;

namespace Azure.Core.Extensions
namespace Microsoft.Extensions.Azure
{
internal class AzureClientFactory<TClient, TOptions>: IAzureClientFactory<TClient>
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
// Licensed under the MIT License.

using System;
using Azure.Core;

namespace Azure.Core.Extensions
namespace Microsoft.Extensions.Azure
{
internal class AzureClientCredentialOptions<TClient>
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@

using System;
using System.Collections.Generic;
using Azure.Core;
using Azure.Core.Pipeline;
using Azure.Identity;

namespace Azure.Core.Extensions
namespace Microsoft.Extensions.Azure
{
internal class AzureClientsGlobalOptions
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@

using System;
using System.Runtime.ExceptionServices;
using Azure.Core;

namespace Azure.Core.Extensions
namespace Microsoft.Extensions.Azure
{
internal class ClientRegistration<TClient, TOptions>
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
using System.Reflection;
using Microsoft.Extensions.Options;

namespace Azure.Core.Extensions
namespace Microsoft.Extensions.Azure
{
// Slightly adjusted copy of https://github.com/aspnet/Extensions/blob/master/src/Options/Options/src/OptionsFactory.cs
internal class ClientOptionsFactory<TClient, TOptions> where TOptions : class
Expand Down Expand Up @@ -82,7 +82,7 @@ public TOptions Create(string name)
{
namedSetup.Configure(name, options);
}
else if (name == Options.DefaultName)
else if (name == Microsoft.Extensions.Options.Options.DefaultName)
{
setup.Configure(options);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
using Microsoft.Extensions.Options;
using Microsoft.Extensions.Primitives;

namespace Azure.Core.Extensions
namespace Microsoft.Extensions.Azure
{
// Slightly adjusted copy of https://github.com/aspnet/Extensions/blob/master/src/Options/Options/src/OptionsMonitor.cs
internal class ClientOptionsMonitor<TClient, TOptions> : IOptionsMonitor<TOptions>, IDisposable where TOptions : class
Expand Down Expand Up @@ -36,7 +36,7 @@ public ClientOptionsMonitor(ClientOptionsFactory<TClient, TOptions> factory, IEn

private void InvokeChanged(string name)
{
name = name ?? Options.DefaultName;
name = name ?? Microsoft.Extensions.Options.Options.DefaultName;
_cache.TryRemove(name);
var options = Get(name);
if (_onChange != null)
Expand All @@ -50,15 +50,15 @@ private void InvokeChanged(string name)
/// </summary>
public TOptions CurrentValue
{
get => Get(Options.DefaultName);
get => Get(Microsoft.Extensions.Options.Options.DefaultName);
}

/// <summary>
/// Returns a configured <typeparamref name="TOptions"/> instance with the given <paramref name="name"/>.
/// </summary>
public virtual TOptions Get(string name)
{
name = name ?? Options.DefaultName;
name = name ?? Microsoft.Extensions.Options.Options.DefaultName;
return _cache.GetOrAdd(name, () => _factory.Create(name));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,11 @@
using System.Reflection;
using System.Security.Cryptography.X509Certificates;
using System.Text;
using Azure.Core;
using Azure.Identity;
using Microsoft.Extensions.Configuration;

namespace Azure.Core.Extensions
namespace Microsoft.Extensions.Azure
{
internal static class ClientFactory
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@
// Licensed under the MIT License.

using System;
using Azure.Core;
using Microsoft.Extensions.Options;

namespace Azure.Core.Extensions
namespace Microsoft.Extensions.Azure
{
internal class ConfigureClientCredentials<TClient, TOptions> : IConfigureNamedOptions<AzureClientCredentialOptions<TClient>>
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using System;
using Microsoft.Extensions.Options;

namespace Azure.Core.Extensions
namespace Microsoft.Extensions.Azure
{
internal class ConfigureClientOptions<TClient, TOptions> : IConfigureNamedOptions<TOptions> where TOptions : class
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
using Azure.Core.Pipeline;
using Microsoft.Extensions.Options;

namespace Azure.Core.Extensions
namespace Microsoft.Extensions.Azure
{
internal class DefaultClientOptionsSetup<T> : IConfigureNamedOptions<T> where T : class
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

using Microsoft.Extensions.Options;

namespace Azure.Core.Extensions
namespace Microsoft.Extensions.Azure
{
internal class DefaultCredentialClientOptionsSetup<T> : IConfigureNamedOptions<AzureClientCredentialOptions<T>>
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
using System.Text;
using Microsoft.Extensions.Logging;

namespace Azure.Core.Extensions
namespace Microsoft.Extensions.Azure
{
internal class EventSourceLogForwarder: EventListener
{
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
using System.Runtime.CompilerServices;

[assembly:InternalsVisibleTo("Microsoft.Extensions.Azure.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100d15ddcb29688295338af4b7686603fe614abd555e09efba8fb88ee09e1f7b1ccaeed2e8f823fa9eef3fdd60217fc012ea67d2479751a0b8c087a4185541b851bd8b16f8d91b840e51b1cb0ba6fe647997e57429265e85ef62d565db50a69ae1647d54d7bd855e4db3d8a91510e5bcbd0edfbbecaa20a7bd9ae74593daa7b11b4")]
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using System;
using System.Collections.Generic;
using Azure.Identity;
using Microsoft.Extensions.Azure;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using NUnit.Framework;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using System.Collections.Generic;
using System.Security.Cryptography.X509Certificates;
using Azure.Identity;
using Microsoft.Extensions.Azure;
using Microsoft.Extensions.Configuration;
using NUnit.Framework;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\src\Azure.Core.Extensions.csproj" />
<ProjectReference Include="..\src\Microsoft.Extensions.Azure.csproj" />
</ItemGroup>
</Project>

0 comments on commit bc63040

Please sign in to comment.