Skip to content

Commit 2fb24b9

Browse files
authored
Update to latest MGC and set namespace of model and enum for Azure (Azure#48197)
1 parent fefa057 commit 2fb24b9

File tree

321 files changed

+8201
-3035
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

321 files changed

+8201
-3035
lines changed

eng/Packages.Data.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@
262262
</ItemGroup>
263263

264264
<ItemGroup Condition="'$(IsGeneratorLibrary)' == 'true'">
265-
<PackageReference Update="Microsoft.Generator.CSharp.ClientModel" Version="1.0.0-alpha.20250205.1" />
265+
<PackageReference Update="Microsoft.TypeSpec.Generator.ClientModel" Version="1.0.0-alpha.20250211.5" />
266266
</ItemGroup>
267267

268268
<!--

eng/packages/http-client-csharp/generator/Azure.Generator.StubLibrary/src/Azure.Generator.StubLibrary.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
<ItemGroup>
99
<PackageReference Include="System.ClientModel" />
10-
<PackageReference Include="Microsoft.Generator.CSharp.ClientModel" />
10+
<PackageReference Include="Microsoft.TypeSpec.Generator.ClientModel" />
1111
</ItemGroup>
1212

1313
<ItemGroup>

eng/packages/http-client-csharp/generator/Azure.Generator.StubLibrary/src/AzureStubPlugin.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Copyright (c) Microsoft Corporation. All rights reserved.
22
// Licensed under the MIT License.
33

4-
using Microsoft.Generator.CSharp;
4+
using Microsoft.TypeSpec.Generator;
55
using System.ComponentModel.Composition;
66

77
namespace Azure.Generator.StubLibrary

eng/packages/http-client-csharp/generator/Azure.Generator.StubLibrary/src/AzureStubVisitor.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@
44
using System;
55
using System.ClientModel.Primitives;
66
using System.Linq;
7-
using Microsoft.Generator.CSharp.ClientModel;
8-
using Microsoft.Generator.CSharp.ClientModel.Providers;
9-
using Microsoft.Generator.CSharp.Expressions;
10-
using Microsoft.Generator.CSharp.Primitives;
11-
using Microsoft.Generator.CSharp.Providers;
12-
using static Microsoft.Generator.CSharp.Snippets.Snippet;
7+
using Microsoft.TypeSpec.Generator.ClientModel;
8+
using Microsoft.TypeSpec.Generator.ClientModel.Providers;
9+
using Microsoft.TypeSpec.Generator.Expressions;
10+
using Microsoft.TypeSpec.Generator.Primitives;
11+
using Microsoft.TypeSpec.Generator.Providers;
12+
using static Microsoft.TypeSpec.Generator.Snippets.Snippet;
1313

1414
namespace Azure.Generator.StubLibrary
1515
{

eng/packages/http-client-csharp/generator/Azure.Generator/src/Azure.Generator.csproj

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,12 @@
88
<ItemGroup>
99
<PackageReference Include="Azure.Core" />
1010
<PackageReference Include="Azure.ResourceManager" />
11-
<PackageReference Include="Microsoft.Generator.CSharp.ClientModel" />
11+
<PackageReference Include="Microsoft.TypeSpec.Generator.ClientModel" />
1212
</ItemGroup>
1313

1414
<Target Name="CheckEmitterBuild" BeforeTargets="Build">
1515
<!-- Check if the folder does not exist -->
16-
<Error Condition="!Exists('..\..\..\node_modules\@typespec\http-client-csharp')"
17-
Text="Emitter has not been built please run `npm ci` followed by `npm run build` from ./eng/packages/http-client-csharp folder." />
16+
<Error Condition="!Exists('..\..\..\node_modules\@typespec\http-client-csharp')" Text="Emitter has not been built please run `npm ci` followed by `npm run build` from ./eng/packages/http-client-csharp folder." />
1817
</Target>
1918

2019
<!-- Copy output to package dist path for local execution -->
@@ -24,7 +23,7 @@
2423
<SourceDir Include="$(OutputPath)**\*.*" />
2524
</ItemGroup>
2625
<Copy SourceFiles="@(SourceDir)" DestinationFolder="$(MSBuildThisFileDirectory)..\..\..\dist\generator\%(RecursiveDir)" />
27-
<Copy SourceFiles="..\..\..\node_modules\@typespec\http-client-csharp\dist\generator\Microsoft.Generator.CSharp.runtimeconfig.json" DestinationFolder="$(MSBuildThisFileDirectory)..\..\..\dist\generator" />
26+
<Copy SourceFiles="..\..\..\node_modules\@typespec\http-client-csharp\dist\generator\Microsoft.TypeSpec.Generator.runtimeconfig.json" DestinationFolder="$(MSBuildThisFileDirectory)..\..\..\dist\generator" />
2827
</Target>
2928

3029
<!-- Include shared code from Azure.Core -->

eng/packages/http-client-csharp/generator/Azure.Generator/src/AzureClientPlugin.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,8 @@
33

44
using Azure.Generator.Utilities;
55
using Microsoft.CodeAnalysis;
6-
using Microsoft.Generator.CSharp;
7-
using Microsoft.Generator.CSharp.ClientModel;
8-
using Microsoft.Generator.CSharp.Input;
6+
using Microsoft.TypeSpec.Generator;
7+
using Microsoft.TypeSpec.Generator.ClientModel;
98
using System;
109
using System.ComponentModel.Composition;
1110
using System.IO;
@@ -53,9 +52,10 @@ public override void Configure()
5352
AddMetadataReference(MetadataReference.CreateFromFile(typeof(Response).Assembly.Location));
5453
var sharedSourceDirectory = Path.Combine(Path.GetDirectoryName(typeof(AzureClientPlugin).Assembly.Location)!, "Shared", "Core");
5554
AddSharedSourceDirectory(sharedSourceDirectory);
55+
AddVisitor(new NamespaceVisitor());
5656
if (IsAzureArm.Value)
5757
{
58-
AddVisitor(new AzureArmVisitor());
58+
AddVisitor(new RestClientVisitor());
5959
}
6060
}
6161

eng/packages/http-client-csharp/generator/Azure.Generator/src/AzureOutputLibrary.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
using Azure.Generator.Mgmt.Models;
55
using Azure.Generator.Providers;
66
using Azure.Generator.Utilities;
7-
using Microsoft.Generator.CSharp.ClientModel;
8-
using Microsoft.Generator.CSharp.Providers;
7+
using Microsoft.TypeSpec.Generator.ClientModel;
8+
using Microsoft.TypeSpec.Generator.Providers;
99
using System.Collections.Generic;
1010

1111
namespace Azure.Generator

eng/packages/http-client-csharp/generator/Azure.Generator/src/AzureTypeFactory.cs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@
55
using Azure.Generator.Primitives;
66
using Azure.Generator.Providers;
77
using Azure.Generator.Providers.Abstraction;
8-
using Microsoft.Generator.CSharp.ClientModel;
9-
using Microsoft.Generator.CSharp.ClientModel.Providers;
10-
using Microsoft.Generator.CSharp.Expressions;
11-
using Microsoft.Generator.CSharp.Input;
12-
using Microsoft.Generator.CSharp.Primitives;
13-
using Microsoft.Generator.CSharp.Providers;
14-
using Microsoft.Generator.CSharp.Snippets;
15-
using Microsoft.Generator.CSharp.Statements;
8+
using Microsoft.TypeSpec.Generator.ClientModel;
9+
using Microsoft.TypeSpec.Generator.ClientModel.Providers;
10+
using Microsoft.TypeSpec.Generator.Expressions;
11+
using Microsoft.TypeSpec.Generator.Input;
12+
using Microsoft.TypeSpec.Generator.Primitives;
13+
using Microsoft.TypeSpec.Generator.Providers;
14+
using Microsoft.TypeSpec.Generator.Snippets;
15+
using Microsoft.TypeSpec.Generator.Statements;
1616
using System;
1717
using System.ClientModel.Primitives;
1818
using System.Collections.Generic;

eng/packages/http-client-csharp/generator/Azure.Generator/src/InputTransformation/InputClientTransformer.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Copyright (c) Microsoft Corporation. All rights reserved.
22
// Licensed under the MIT License.
33

4-
using Microsoft.Generator.CSharp.Input;
4+
using Microsoft.TypeSpec.Generator.Input;
55
using System;
66
using System.Collections.Generic;
77

@@ -26,7 +26,7 @@ internal static class InputClientTransformer
2626
// There is no need to check sub-clients or custom code since it is specific to handle the above removing
2727
if (operationsToKeep.Count == 0) return null;
2828

29-
return new InputClient(client.Name, client.Summary, client.Doc, operationsToKeep, client.Parameters, client.Parent);
29+
return new InputClient(client.Name, client.Namespace, client.Summary, client.Doc, operationsToKeep, client.Parameters, client.Parent);
3030
}
3131

3232
private static IReadOnlyList<InputParameter> TransformInputOperationParameters(InputOperation operation)

eng/packages/http-client-csharp/generator/Azure.Generator/src/Mgmt/Models/OperationSet.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
using Azure.Core;
55
using Azure.Generator.Utilities;
6-
using Microsoft.Generator.CSharp.Input;
6+
using Microsoft.TypeSpec.Generator.Input;
77
using System;
88
using System.Collections;
99
using System.Collections.Generic;

0 commit comments

Comments
 (0)