Skip to content

Commit

Permalink
Merge branch 'feature/v3' of https://github.com/Azure/autorest.csharp
Browse files Browse the repository at this point in the history
…into text3816
  • Loading branch information
pshao25 committed Dec 25, 2023
2 parents 60f9380 + 99b4d10 commit 7436bb3
Show file tree
Hide file tree
Showing 226 changed files with 435 additions and 435 deletions.
2 changes: 1 addition & 1 deletion eng/GenerateAndExecuteMockTest.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ function MockTestInit {
Write-Host "Autorest build fail."
exit
}
$autorestVersion = Join-Path $projRoot "\artifacts\bin\AutoRest.CSharp\Debug\net6.0"
$autorestVersion = Join-Path $projRoot "\artifacts\bin\AutoRest.CSharp\Debug\net7.0"

# Clone Azure/azure-rest-api-specs and get latest commitId
& git clone https://github.com/Azure/azure-rest-api-specs.git $projRoot\azure-rest-api-specs
Expand Down
2 changes: 1 addition & 1 deletion eng/Generation.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ function Invoke-TypeSpec($baseOutput, $projectName, $mainFile, $arguments="", $s
$repoRootPath = Join-Path $PSScriptRoot ".."
$repoRootPath = Resolve-Path -Path $repoRootPath
Push-Location $repoRootPath
$autorestCsharpBinPath = Join-Path $repoRootPath "artifacts/bin/AutoRest.CSharp/Debug/net6.0/AutoRest.CSharp.dll"
$autorestCsharpBinPath = Join-Path $repoRootPath "artifacts/bin/AutoRest.CSharp/Debug/net7.0/AutoRest.CSharp.dll"
Try
{
$typespecFileName = $mainFile ? $mainFile : "$baseOutput/$projectName.tsp"
Expand Down
2 changes: 1 addition & 1 deletion eng/PackArtifacts.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ finally {
}

# Pack autorest.csharp npm package "@autorest/csharp"
$artifactsPath = Resolve-Path (Join-Path $repoRoot '/artifacts/bin/AutoRest.CSharp/Release/net6.0/')
$artifactsPath = Resolve-Path (Join-Path $repoRoot '/artifacts/bin/AutoRest.CSharp/Release/net7.0/')
Push-Location $artifactsPath
try {
npm version --no-git-tag-version $alphaVersion | Out-Null;
Expand Down
2 changes: 1 addition & 1 deletion eng/pipelines/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ stages:
- ${{if and(ne(variables['Build.Reason'], 'PullRequest'), eq(variables['System.TeamProject'], 'internal'))}}:
- pwsh: >
./eng/PublishRelease.ps1
-AutorestArtifactDirectory ./artifacts/bin/AutoRest.CSharp/Release/net6.0/
-AutorestArtifactDirectory ./artifacts/bin/AutoRest.CSharp/Release/net7.0/
-CoverageDirectory ./artifacts/coverage
-TypeSpecEmitterDirectory ./src/TypeSpec.Extension/Emitter.Csharp
-GitHubToken $(azuresdk-github-pat)
Expand Down
2 changes: 1 addition & 1 deletion eng/pipelines/sdk-update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ stages:
displayName: 'Publish @autorest/csharp'
inputs:
command: 'publish'
workingDir: '$(Build.SourcesDirectory)/autorest.csharp/artifacts/bin/AutoRest.CSharp/Release/net6.0'
workingDir: '$(Build.SourcesDirectory)/autorest.csharp/artifacts/bin/AutoRest.CSharp/Release/net7.0'
publishRegistry: 'useFeed'
publishFeed: '29ec6040-b234-4e31-b139-33dc4287b756/05efbea8-6e52-49dd-ad3d-ac3d4aa65036'
- pwsh: ./eng/PackEmitter.ps1 -BuildNumber $(Build.BuildNumber) -AutorestVersion $(Package.AutorestCSharpVersion) -StagingDirectory $(Build.ArtifactStagingDirectory)/packages
Expand Down
2 changes: 1 addition & 1 deletion eng/scripts/Build-Packages.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ finally
}

# pack the c# npm package
Push-Location "$artifactsPath/bin/AutoRest.CSharp/Release/net6.0/"
Push-Location "$artifactsPath/bin/AutoRest.CSharp/Release/net7.0/"
try {
Write-Host "Working in $PWD"
if ($BuildNumber) {
Expand Down
2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"sdk": {
"version": "7.0.101",
"version": "7.0.404",
"rollForward": "feature"
}
}
6 changes: 3 additions & 3 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ ___

:warning: We have updated the default generator used by `autorest --csharp` to the new version `V3`, which uses `@autorest/csharp` package and it will have few side effects:
- It will generate code based on the [.NET SDK guidelines](https://azure.github.io/azure-sdk/dotnet_introduction.html), which will be totally different than the code generated by `V2` version.
- The dotnet core runtime 3.1+ is required.
- The dotnet 7.0 or above is required.
- If you still want to generate code based on `V2` version, you can add `--legacy` flag to the command line to get the previous behavior.
___

Expand Down Expand Up @@ -57,7 +57,7 @@ ___
## Prerequisites

- [NodeJS (18.x.x)](https://nodejs.org/en/)
- [.NET Core SDK (5.0.100)](https://dotnet.microsoft.com/download/dotnet-core/5.0)
- [.NET Core SDK (7.0.404 or above)](https://dotnet.microsoft.com/download/dotnet/7.0)
- [PowerShell Core 7](https://github.com/PowerShell/PowerShell/releases/latest)
- `npm install` (at root)

Expand Down Expand Up @@ -1828,7 +1828,7 @@ namespace Azure.Service.Models
# autorest-core version
version: 3.9.7
save-inputs: true
use: $(this-folder)/artifacts/bin/AutoRest.CSharp/Debug/net6.0/
use: $(this-folder)/artifacts/bin/AutoRest.CSharp/Debug/net7.0/
clear-output-folder: true
public-clients: true
skip-csproj-packagereference: true
Expand Down
4 changes: 2 additions & 2 deletions samples/AnomalyDetector/src/Generated/Configuration.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions samples/AppConfiguration/Generated/Configuration.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions samples/Azure.AI.FormRecognizer/Generated/Configuration.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions samples/Azure.Storage.Tables/src/Generated/Configuration.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions samples/CognitiveSearch/Generated/Configuration.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/AutoRest.CSharp/AutoRest.CSharp.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<PackageId>Microsoft.Azure.AutoRest.CSharp</PackageId>
<OutputType>Exe</OutputType>
<Version>3.0.0</Version>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net7.0</TargetFramework>
<Nullable>enable</Nullable>
<ServerGarbageCollection>true</ServerGarbageCollection>
<SatelliteResourceLanguages>en-US</SatelliteResourceLanguages>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@ private string GetUnbrandedTestCSProj()
{
var writer = new CSProjWriter()
{
TargetFramework = "net6.0",
TargetFramework = "net7.0",
NoWarn = new("$(NoWarn);CS1591", "Ignore XML doc comments on test types and members")
};

Expand Down
2 changes: 1 addition & 1 deletion src/AutoRest.CSharp/Common/Input/Configuration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ public static void Initialize(
if (publicClients && generation1ConvenienceClient && isAzureProject)
{
var binaryLocation = typeof(Configuration).Assembly.Location;
if (!binaryLocation.EndsWith(Path.Combine("artifacts", "bin", "AutoRest.CSharp", "Debug", "net6.0", "AutoRest.CSharp.dll")))
if (!binaryLocation.EndsWith(Path.Combine("artifacts", "bin", "AutoRest.CSharp", "Debug", "net7.0", "AutoRest.CSharp.dll")))
{
if (_absoluteProjectFolder is not null)
{
Expand Down
6 changes: 3 additions & 3 deletions src/AutoRest.CSharp/build/CodeGeneration.targets
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<TypespecAdditionalOptions></TypespecAdditionalOptions>
Allows passing additional tsp command line arguments, for example to run special emitter
use the following command line: dotnet msbuild /t:GenerateCode /p:TypespecAdditionalOptions="csharpGeneratorPath=/absolute/path/to/artifacts/bin/AutoRest.CSharp/Debug/net6.0/AutoRest.CSharp.dll"
use the following command line: dotnet msbuild /t:GenerateCode /p:TypespecAdditionalOptions="csharpGeneratorPath=/absolute/path/to/artifacts/bin/AutoRest.CSharp/Debug/net7.0/AutoRest.CSharp.dll"
-->

<IncludeAzureCoreSharedCode Condition="'$(IncludeAzureCoreSharedCode)' == ''">true</IncludeAzureCoreSharedCode>
Expand All @@ -30,7 +30,7 @@

<_GenerateCode Condition="'$(AutoRestInput)' != '' OR '$(TypeSpecInput)' != ''">true</_GenerateCode>
<UseDefaultNamespaceAndOutputFolder Condition="'$(UseDefaultNamespaceAndOutputFolder)' == ''">true</UseDefaultNamespaceAndOutputFolder>
<_AutoRestCommand>npx autorest@$(AutoRestVersion) --max-memory-size=8192 --skip-csproj --skip-upgrade-check --version=$(AutoRestCoreVersion) $(AutoRestInput) $(AutoRestAdditionalParameters) --use=$(MSBuildThisFileDirectory)../tools/net6.0/any/ --clear-output-folder=true --shared-source-folders=&quot;$(AzureCoreSharedCodeDirectory);$(AutoRestSharedCodeDirectory)&quot;</_AutoRestCommand>
<_AutoRestCommand>npx autorest@$(AutoRestVersion) --max-memory-size=8192 --skip-csproj --skip-upgrade-check --version=$(AutoRestCoreVersion) $(AutoRestInput) $(AutoRestAdditionalParameters) --use=$(MSBuildThisFileDirectory)../tools/net7.0/any/ --clear-output-folder=true --shared-source-folders=&quot;$(AzureCoreSharedCodeDirectory);$(AutoRestSharedCodeDirectory)&quot;</_AutoRestCommand>
<_AutoRestCommand Condition="'$(UseDefaultNamespaceAndOutputFolder)' == 'true'">$(_AutoRestCommand) --output-folder=$(MSBuildProjectDirectory)/Generated --namespace=$(RootNamespace)</_AutoRestCommand>
<_SaveInputs Condition="'$(SaveInputs)' == 'true'">-SaveInputs</_SaveInputs>
<_TypespecAdditionalOptions Condition="'$(TypespecAdditionalOptions)' != ''">-TypespecAdditionalOptions "$(TypespecAdditionalOptions)"</_TypespecAdditionalOptions>
Expand Down Expand Up @@ -75,7 +75,7 @@

<Error Text="Following GitHub URLs do not contain commit hash: @(GithubUrlsWithoutHash) please use permalinks for code generation inputs (see https://help.github.com/en/github/managing-files-in-a-repository/getting-permanent-links-to-files) " Condition="'@(GithubUrlsWithoutHash)' != ''" />

<Exec Command="npx autorest@$(AutoRestVersion) --max-memory-size=8192 --skip-csproj --skip-upgrade-check --version=$(AutoRestCoreVersion) $(AutoRestInput) $(AutoRestAdditionalParameters) --use=$(MSBuildThisFileDirectory)../tools/net6.0/any/ --output-folder=$(MSBuildProjectDirectory)/Generated --clear-output-folder=false --shared-source-folders=&quot;$(AzureCoreSharedCodeDirectory);$(AutoRestSharedCodeDirectory)&quot; --testmodeler={} --mgmt-debug.skip-codegen=true"/>
<Exec Command="npx autorest@$(AutoRestVersion) --max-memory-size=8192 --skip-csproj --skip-upgrade-check --version=$(AutoRestCoreVersion) $(AutoRestInput) $(AutoRestAdditionalParameters) --use=$(MSBuildThisFileDirectory)../tools/net7.0/any/ --output-folder=$(MSBuildProjectDirectory)/Generated --clear-output-folder=false --shared-source-folders=&quot;$(AzureCoreSharedCodeDirectory);$(AutoRestSharedCodeDirectory)&quot; --testmodeler={} --mgmt-debug.skip-codegen=true"/>
</Target>

<PropertyGroup Condition="'$(_GenerateCode)' == 'true'">
Expand Down
2 changes: 1 addition & 1 deletion src/AutoRest.CodeModel/AutoRest.CodeModel.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net7.0</TargetFramework>
<Nullable>enable</Nullable>
</PropertyGroup>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net7.0</TargetFramework>
<IsPackable>false</IsPackable>
<Nullable>annotations</Nullable>
<NoWarn>SA1649;SA1633;CS0618;CS1591;</NoWarn>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net7.0</TargetFramework>
<IsPackable>false</IsPackable>
<Nullable>annotations</Nullable>
<NoWarn>SA1649;SA1633;CS0618</NoWarn>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net7.0</TargetFramework>
<IsPackable>false</IsPackable>
<Nullable>annotations</Nullable>
<NoWarn>SA1649;SA1633;CS0618</NoWarn>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net7.0</TargetFramework>
<IsPackable>false</IsPackable>
<Nullable>annotations</Nullable>
<NoWarn>SA1649;SA1633;CS0618</NoWarn>
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 7436bb3

Please sign in to comment.