Skip to content

Commit 38ff841

Browse files
authored
Add encode.bytes, and Azure.Generator bug (Azure#49692)
1 parent d542ae5 commit 38ff841

File tree

77 files changed

+4229
-7
lines changed

Some content is hidden

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

77 files changed

+4229
-7
lines changed

eng/packages/http-client-csharp-mgmt/eng/scripts/Generate.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ if (-not $LaunchOnly) {
2121

2222
$mgmtTypespecTestProject = Join-Path $testProjectsLocalDir "Mgmt-TypeSpec"
2323

24-
Invoke (Get-Mgmt-TspCommand "$mgmtTypespecTestProject/main.tsp" $mgmtTypespecTestProject -forceNewProject $ForceNewProject)
24+
Invoke (Get-Mgmt-TspCommand "$mgmtTypespecTestProject/main.tsp" $mgmtTypespecTestProject)
2525

2626
# exit if the generation failed
2727
if ($LASTEXITCODE -ne 0) {

eng/packages/http-client-csharp-mgmt/eng/scripts/Generation.psm1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ function Get-Mgmt-TspCommand {
4444
$command += " --option @azure-typespec/http-client-csharp-mgmt.api-version=$apiVersion"
4545
}
4646

47-
$command += " --option @azure-typespec/http-client-csharp-mgmt.new-project=true"
47+
#$command += " --option @azure-typespec/http-client-csharp-mgmt.new-project=true" TODO: https://github.com/Azure/azure-sdk-for-net/issues/49716
4848

4949
return $command
5050
}

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,12 @@
8686
<Compile Include="$(MSBuildThisFileDirectory)..\..\..\..\..\..\sdk\core\Azure.Core\src\Shared\FixedDelayWithNoJitterStrategy.cs" LinkBase="Shared/Core">
8787
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
8888
</Compile>
89+
<Compile Include="$(MSBuildThisFileDirectory)..\..\..\..\..\..\sdk\core\Azure.Core\src\Shared\TypeFormatters.cs" LinkBase="Shared/Core">
90+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
91+
</Compile>
92+
<Compile Include="$(MSBuildThisFileDirectory)..\..\..\..\..\..\sdk\core\Azure.Core\src\Shared\RequestHeaderExtensions.cs" LinkBase="Shared/Core">
93+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
94+
</Compile>
8995
</ItemGroup>
9096

9197
</Project>

eng/packages/http-client-csharp-mgmt/generator/TestProjects/Local.Tests/TestProjects.Local.Tests.csproj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@
4444
<Compile Include="$(MSBuildThisFileDirectory)../../../../../../sdk/core/Azure.Core/src/Shared/TaskExtensions.cs" LinkBase="Shared/Core" />
4545
<Compile Include="$(MSBuildThisFileDirectory)../../../../../../sdk/core/Azure.Core/src/Shared/TrimmingAttribute.cs" LinkBase="Shared/Core" />
4646
<Compile Include="$(MSBuildThisFileDirectory)../../../../../../sdk/core/Azure.Core/src/Shared/VoidValue.cs" LinkBase="Shared/Core" />
47+
<Compile Include="$(MSBuildThisFileDirectory)../../../../../../sdk/core/Azure.Core/src/Shared/TypeFormatters.cs" LinkBase="Shared/Core" />
48+
<Compile Include="$(MSBuildThisFileDirectory)../../../../../../sdk/core/Azure.Core/src/Shared/RequestHeaderExtensions.cs" LinkBase="Shared/Core" />
4749
</ItemGroup>
4850

4951
</Project>

eng/packages/http-client-csharp-mgmt/generator/TestProjects/Local/Mgmt-TypeSpec/src/MgmtTypeSpec.csproj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@
2727
<Compile Include="$(MSBuildThisFileDirectory)../../../../../../../../sdk/core/Azure.Core/src/Shared/TaskExtensions.cs" LinkBase="Shared/Core" />
2828
<Compile Include="$(MSBuildThisFileDirectory)../../../../../../../../sdk/core/Azure.Core/src/Shared/TrimmingAttribute.cs" LinkBase="Shared/Core" />
2929
<Compile Include="$(MSBuildThisFileDirectory)../../../../../../../../sdk/core/Azure.Core/src/Shared/VoidValue.cs" LinkBase="Shared/Core" />
30+
<Compile Include="$(MSBuildThisFileDirectory)../../../../../../../../sdk/core/Azure.Core/src/Shared/TypeFormatters.cs" LinkBase="Shared/Core" />
31+
<Compile Include="$(MSBuildThisFileDirectory)../../../../../../../../sdk/core/Azure.Core/src/Shared/RequestHeaderExtensions.cs" LinkBase="Shared/Core" />
3032
</ItemGroup>
3133

3234
<ItemGroup>

eng/packages/http-client-csharp/eng/scripts/Generate.ps1

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,6 @@ $failingSpecs = @(
6868
Join-Path 'http' 'client' 'structure' 'renamed-operation'
6969
Join-Path 'http' 'client' 'structure' 'multi-client'
7070
Join-Path 'http' 'client' 'structure' 'two-operation-group'
71-
Join-Path 'http' 'encode' 'bytes'
7271
Join-Path 'http' 'encode' 'datetime'
7372
Join-Path 'http' 'encode' 'duration'
7473
Join-Path 'http' 'parameters' 'collection-format'

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,12 @@
3434
<Compile Include="$(MSBuildThisFileDirectory)..\..\..\..\..\..\sdk\core\Azure.Core\src\Shared\RawRequestUriBuilder.cs" LinkBase="Shared/Core">
3535
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
3636
</Compile>
37+
<Compile Include="$(MSBuildThisFileDirectory)..\..\..\..\..\..\sdk\core\Azure.Core\src\Shared\TypeFormatters.cs" LinkBase="Shared/Core">
38+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
39+
</Compile>
40+
<Compile Include="$(MSBuildThisFileDirectory)..\..\..\..\..\..\sdk\core\Azure.Core\src\Shared\RequestHeaderExtensions.cs" LinkBase="Shared/Core">
41+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
42+
</Compile>
3743
</ItemGroup>
3844

3945
</Project>

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ public class NewAzureProjectScaffolding : NewProjectScaffolding
1818
private const string MSBuildThisFileDirectory = "$(MSBuildThisFileDirectory)";
1919
private const string RelativeCoreSegment = "sdk/core/Azure.Core/src/Shared/";
2020
private const string ParentDirectory = "../";
21+
private const string SharedSourceLinkBase = "Shared/Core";
2122

2223
/// <inheritdoc/>
2324
protected override string GetSourceProjectFileContent()
@@ -39,7 +40,7 @@ protected override string GetSourceProjectFileContent()
3940
int pathSegmentCount = GetPathSegmentCount();
4041
if (AzureClientGenerator.Instance.InputLibrary.InputNamespace.Auth?.ApiKey is not null)
4142
{
42-
builder.CompileIncludes.Add(new CSharpProjectWriter.CSProjCompileInclude(GetCompileInclude("AzureKeyCredentialPolicy.cs", pathSegmentCount), "Shared/Core"));
43+
builder.CompileIncludes.Add(new CSharpProjectWriter.CSProjCompileInclude(GetCompileInclude("AzureKeyCredentialPolicy.cs", pathSegmentCount), SharedSourceLinkBase));
4344
}
4445

4546
bool hasOperation = false;
@@ -51,7 +52,9 @@ protected override string GetSourceProjectFileContent()
5152

5253
if (hasOperation)
5354
{
54-
builder.CompileIncludes.Add(new CSharpProjectWriter.CSProjCompileInclude(GetCompileInclude("RawRequestUriBuilder.cs", pathSegmentCount), "Shared/Core"));
55+
builder.CompileIncludes.Add(new CSharpProjectWriter.CSProjCompileInclude(GetCompileInclude("RawRequestUriBuilder.cs", pathSegmentCount), SharedSourceLinkBase));
56+
builder.CompileIncludes.Add(new CSharpProjectWriter.CSProjCompileInclude(GetCompileInclude("TypeFormatters.cs", pathSegmentCount), SharedSourceLinkBase));
57+
builder.CompileIncludes.Add(new CSharpProjectWriter.CSProjCompileInclude(GetCompileInclude("RequestHeaderExtensions.cs", pathSegmentCount), SharedSourceLinkBase));
5558
}
5659

5760
if (hasLongRunningOperation)

eng/packages/http-client-csharp/generator/Azure.Generator/src/Properties/launchSettings.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,11 @@
4545
"commandName": "Executable",
4646
"executablePath": "dotnet"
4747
},
48+
"http-encode-bytes": {
49+
"commandLineArgs": "$(SolutionDir)/../dist/generator/Microsoft.TypeSpec.Generator.dll $(SolutionDir)/TestProjects/Spector/http/encode/bytes -g AzureStubGenerator",
50+
"commandName": "Executable",
51+
"executablePath": "dotnet"
52+
},
4853
"http-encode-numeric": {
4954
"commandLineArgs": "$(SolutionDir)/../dist/generator/Microsoft.TypeSpec.Generator.dll $(SolutionDir)/TestProjects/Spector/http/encode/numeric -g AzureStubGenerator",
5055
"commandName": "Executable",

eng/packages/http-client-csharp/generator/TestProjects/Local.Tests/TestProjects.Local.Tests.csproj

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,9 @@
2626
<ItemGroup>
2727
<Compile Include="$(MSBuildThisFileDirectory)../../../../../../sdk/core/Azure.Core/src/Shared/AzureKeyCredentialPolicy.cs" LinkBase="Shared/Core" />
2828
<Compile Include="$(MSBuildThisFileDirectory)../../../../../../sdk/core/Azure.Core/src/Shared/RawRequestUriBuilder.cs" LinkBase="Shared/Core" />
29-
<Compile Include="$(MSBuildThisFileDirectory)../../../../../../sdk/core/Azure.Core/src/Shared/AppContextSwitchHelper.cs" LinkBase="Shared/Core" />
29+
<Compile Include="$(MSBuildThisFileDirectory)../../../../../../sdk/core/Azure.Core/src/Shared/RequestHeaderExtensions.cs" LinkBase="Shared/Core" />
30+
<Compile Include="$(MSBuildThisFileDirectory)../../../../../../sdk/core/Azure.Core/src/Shared/TypeFormatters.cs" LinkBase="Shared/Core" />
31+
<Compile Include="$(MSBuildThisFileDirectory)../../../../../../sdk/core/Azure.Core/src/Shared/AppContextSwitchHelper.cs" LinkBase="Shared/Core" />
3032
<Compile Include="$(MSBuildThisFileDirectory)../../../../../../sdk/core/Azure.Core/src/Shared/AsyncLockWithValue.cs" LinkBase="Shared/Core" />
3133
<Compile Include="$(MSBuildThisFileDirectory)../../../../../../sdk/core/Azure.Core/src/Shared/FixedDelayWithNoJitterStrategy.cs" LinkBase="Shared/Core" />
3234
<Compile Include="$(MSBuildThisFileDirectory)../../../../../../sdk/core/Azure.Core/src/Shared/ClientDiagnostics.cs" LinkBase="Shared/Core" />

0 commit comments

Comments
 (0)