diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Data/generate-from-private-spec.cmd b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Data/generate-from-private-spec.cmd deleted file mode 100644 index 4603db346e11..000000000000 --- a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Data/generate-from-private-spec.cmd +++ /dev/null @@ -1,13 +0,0 @@ -:: -:: Microsoft Azure SDK for Net - Generate library code -:: Copyright (C) Microsoft Corporation. All Rights Reserved. -:: -:: This generates the SDK code from a private Swagger spec -:: hosted in your private fork of Azure/azure-rest-api-specs -:: -:: Paramters: -:: 1. Your GitHub user name -:: 2. Your remote branch name - -@echo off -call .\generate.cmd latest %1 %2 diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Data/generate.cmd b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Data/generate.cmd deleted file mode 100644 index 2271fff6d32b..000000000000 --- a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Data/generate.cmd +++ /dev/null @@ -1,20 +0,0 @@ -:: -:: Microsoft Azure SDK for Net - Generate library code -:: Copyright (C) Microsoft Corporation. All Rights Reserved. -:: - -@echo off -set repoRoot=%~dp0..\..\..\..\.. -set generateFolder=%~dp0Generated - -if exist %generateFolder% rd /S /Q %generateFolder% -call %repoRoot%\tools\generate.cmd search/data-plane/Microsoft.Azure.Search.Data %* - -:: Delete any extra files generated for types that are shared between SearchServiceClient and SearchIndexClient. -del "%generateFolder%\Models\SearchRequestOptions.cs" - -:: Delete extra files we don't need. -del "%generateFolder%\DocumentsProxyOperationsExtensions.cs" - -:: Make any necessary modifications -powershell.exe .\Fix-GeneratedCode.ps1 diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Data/generate.ps1 b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Data/generate.ps1 new file mode 100644 index 000000000000..871c815880d1 --- /dev/null +++ b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Data/generate.ps1 @@ -0,0 +1,46 @@ +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# ---------------------------------------------------------------------------------- + +<# + +.SYNOPSIS + Powershell script that generates the C# SDK code for Microsoft.Azure.Search.Data from a Swagger spec + +.DESCRIPTION + This script: + - fetches the config file from user/branch provided + - Generates code based off the config file provided + +.PARAMETER SpecsRepoFork + The Rest Spec repo fork which contains the config file; the default is Azure. + +.PARAMETER SpecsRepoBranch + The Branch which contains the config file; the default is master. + +#> + +Param( + [string] $SpecsRepoFork = "Azure", + [string] $SpecsRepoBranch = "master" +) + +$repoRoot = "$PSScriptRoot\..\..\..\..\.." +$generateFolder = "$PSScriptRoot\Generated" + +powershell.exe -ExecutionPolicy Bypass -NoLogo -NonInteractive -NoProfile -File "$repoRoot\tools\generateTool.ps1" -ResourceProvider "search/data-plane/Microsoft.Azure.Search.Data" -PowershellInvoker -AutoRestVersion "latest" -SpecsRepoFork $SpecsRepoFork -SpecsRepoBranch $SpecsRepoBranch + +Write-Output "Deleting extra files and cleaning up..." + +# Delete any extra files generated for types that are shared between SearchServiceClient and SearchIndexClient. +Remove-Item "$generateFolder\Models\SearchRequestOptions.cs" + +# Delete extra files we don't need. +Remove-Item "$generateFolder\DocumentsProxyOperationsExtensions.cs" + +# Make any necessary modifications +powershell.exe -ExecutionPolicy Bypass -NoLogo -NonInteractive -NoProfile -File .\Fix-GeneratedCode.ps1 + +Write-Output "Finished cleanup." diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/generate-from-private-spec.cmd b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/generate-from-private-spec.cmd deleted file mode 100644 index 4603db346e11..000000000000 --- a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/generate-from-private-spec.cmd +++ /dev/null @@ -1,13 +0,0 @@ -:: -:: Microsoft Azure SDK for Net - Generate library code -:: Copyright (C) Microsoft Corporation. All Rights Reserved. -:: -:: This generates the SDK code from a private Swagger spec -:: hosted in your private fork of Azure/azure-rest-api-specs -:: -:: Paramters: -:: 1. Your GitHub user name -:: 2. Your remote branch name - -@echo off -call .\generate.cmd latest %1 %2 diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/generate.cmd b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/generate.cmd deleted file mode 100644 index 34ef2258f8c0..000000000000 --- a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/generate.cmd +++ /dev/null @@ -1,17 +0,0 @@ -:: -:: Microsoft Azure SDK for Net - Generate library code -:: Copyright (C) Microsoft Corporation. All Rights Reserved. -:: - -@echo off -set repoRoot=%~dp0..\..\..\..\.. -set generateFolder=%~dp0Generated -set sharedGenerateFolder=%generateFolder%\..\..\Microsoft.Azure.Search.Common\Generated - -if exist %generateFolder% rd /S /Q %generateFolder% -call %repoRoot%\tools\generate.cmd search/data-plane/Microsoft.Azure.Search.Service %* - -:: Move any extra files generated for types that are shared between SearchServiceClient and SearchIndexClient to Common. -if exist %sharedGenerateFolder% rd /S /Q %sharedGenerateFolder% -mkdir %sharedGenerateFolder% -move "%generateFolder%\Models\SearchRequestOptions.cs" %sharedGenerateFolder% diff --git a/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/generate.ps1 b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/generate.ps1 new file mode 100644 index 000000000000..b010500e05a2 --- /dev/null +++ b/src/SDKs/Search/DataPlane/Microsoft.Azure.Search.Service/generate.ps1 @@ -0,0 +1,47 @@ +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# ---------------------------------------------------------------------------------- + +<# + +.SYNOPSIS + Powershell script that generates the C# SDK code for Microsoft.Azure.Search.Service from a Swagger spec + +.DESCRIPTION + This script: + - fetches the config file from user/branch provided + - Generates code based off the config file provided + +.PARAMETER SpecsRepoFork + The Rest Spec repo fork which contains the config file; the default is Azure. + +.PARAMETER SpecsRepoBranch + The Branch which contains the config file; the default is master. + +#> + +Param( + [string] $SpecsRepoFork = "Azure", + [string] $SpecsRepoBranch = "master" +) + +$repoRoot = "$PSScriptRoot\..\..\..\..\.." +$generateFolder = "$PSScriptRoot\Generated" +$sharedGenerateFolder = "$generateFolder\..\..\Microsoft.Azure.Search.Common\Generated" + +powershell.exe -ExecutionPolicy Bypass -NoLogo -NonInteractive -NoProfile -File "$repoRoot\tools\generateTool.ps1" -ResourceProvider "search/data-plane/Microsoft.Azure.Search.Service" -PowershellInvoker -AutoRestVersion "latest" -SpecsRepoFork $SpecsRepoFork -SpecsRepoBranch $SpecsRepoBranch + +Write-Output "Deleting extra files and cleaning up..." + +# Move any extra files generated for types that are shared between SearchServiceClient and SearchIndexClient to Common. +if (Test-Path -Path $sharedGenerateFolder) +{ + Remove-Item -Recurse -Force $sharedGenerateFolder +} + +New-Item -ItemType Directory $sharedGenerateFolder +Move-Item "$generateFolder\Models\SearchRequestOptions.cs" $sharedGenerateFolder + +Write-Output "Finished cleanup." diff --git a/src/SDKs/Search/Management/Management.Search/generate-from-private-spec.cmd b/src/SDKs/Search/Management/Management.Search/generate-from-private-spec.cmd deleted file mode 100644 index 4603db346e11..000000000000 --- a/src/SDKs/Search/Management/Management.Search/generate-from-private-spec.cmd +++ /dev/null @@ -1,13 +0,0 @@ -:: -:: Microsoft Azure SDK for Net - Generate library code -:: Copyright (C) Microsoft Corporation. All Rights Reserved. -:: -:: This generates the SDK code from a private Swagger spec -:: hosted in your private fork of Azure/azure-rest-api-specs -:: -:: Paramters: -:: 1. Your GitHub user name -:: 2. Your remote branch name - -@echo off -call .\generate.cmd latest %1 %2 diff --git a/src/SDKs/Search/Management/Management.Search/generate.cmd b/src/SDKs/Search/Management/Management.Search/generate.cmd deleted file mode 100644 index 75f650dcb04e..000000000000 --- a/src/SDKs/Search/Management/Management.Search/generate.cmd +++ /dev/null @@ -1,7 +0,0 @@ -:: -:: Microsoft Azure SDK for Net - Generate library code -:: Copyright (C) Microsoft Corporation. All Rights Reserved. -:: - -@echo off -call %~dp0..\..\..\..\..\tools\generate.cmd search/resource-manager %* diff --git a/src/SDKs/Search/Management/Management.Search/generate.ps1 b/src/SDKs/Search/Management/Management.Search/generate.ps1 new file mode 100644 index 000000000000..b77863666824 --- /dev/null +++ b/src/SDKs/Search/Management/Management.Search/generate.ps1 @@ -0,0 +1,32 @@ +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# ---------------------------------------------------------------------------------- + +<# + +.SYNOPSIS + Powershell script that generates the C# SDK code for Microsoft.Azure.Management.Search from a Swagger spec + +.DESCRIPTION + This script: + - fetches the config file from user/branch provided + - Generates code based off the config file provided + +.PARAMETER SpecsRepoFork + The Rest Spec repo fork which contains the config file; the default is Azure. + +.PARAMETER SpecsRepoBranch + The Branch which contains the config file; the default is master. + +#> + +Param( + [string] $SpecsRepoFork = "Azure", + [string] $SpecsRepoBranch = "master" +) + +$repoRoot = "$PSScriptRoot\..\..\..\..\.." + +powershell.exe -ExecutionPolicy Bypass -NoLogo -NonInteractive -NoProfile -File "$repoRoot\tools\generateTool.ps1" -ResourceProvider "search/resource-manager" -PowershellInvoker -AutoRestVersion "latest" -SpecsRepoFork $SpecsRepoFork -SpecsRepoBranch $SpecsRepoBranch diff --git a/src/SDKs/_metadata/search_data-plane_Microsoft.Azure.Search.Data.txt b/src/SDKs/_metadata/search_data-plane_Microsoft.Azure.Search.Data.txt index 2420a6ff2ef4..8645a6d0c601 100644 --- a/src/SDKs/_metadata/search_data-plane_Microsoft.Azure.Search.Data.txt +++ b/src/SDKs/_metadata/search_data-plane_Microsoft.Azure.Search.Data.txt @@ -1,10 +1,17 @@ -2018-03-02 03:24:06 UTC - +Executing AutoRest command +cmd.exe /c autorest.cmd https://github.com/Azure/azure-rest-api-specs/blob/master/specification/search/data-plane/Microsoft.Azure.Search.Data/readme.md --csharp --csharp-sdks-folder=E:\github\azure-sdk-for-net\tools\..\src\SDKs\ --version=latest --reflect-api-versions +2018-04-09 20:46:41 UTC 1) azure-rest-api-specs repository information -GitHub user: Azure +GitHub fork: Azure Branch: master +Commit: f6b39d9c8f634b48af01d44ab66ba2585b40c49c 2) AutoRest information Requested version: latest -Bootstrapper version: C:\Users\brjohnst\AppData\Roaming\npm `-- autorest@2.0.4245 +Bootstrapper version: C:\Users\brjohnst\AppData\Roaming\npm `-- autorest@2.0.4262 + + Latest installed version: +.\tools\generate.ps1 was invoked by generate.ps1 + + diff --git a/src/SDKs/_metadata/search_data-plane_Microsoft.Azure.Search.Service.txt b/src/SDKs/_metadata/search_data-plane_Microsoft.Azure.Search.Service.txt index 8c0f6917343e..c857ac4e58da 100644 --- a/src/SDKs/_metadata/search_data-plane_Microsoft.Azure.Search.Service.txt +++ b/src/SDKs/_metadata/search_data-plane_Microsoft.Azure.Search.Service.txt @@ -1,11 +1,17 @@ -2018-04-06 17:10:40 UTC - +Executing AutoRest command +cmd.exe /c autorest.cmd https://github.com/Azure/azure-rest-api-specs/blob/master/specification/search/data-plane/Microsoft.Azure.Search.Service/readme.md --csharp --csharp-sdks-folder=E:\github\azure-sdk-for-net\tools\..\src\SDKs\ --version=latest --reflect-api-versions +2018-04-09 20:58:00 UTC 1) azure-rest-api-specs repository information -GitHub user: Azure +GitHub fork: Azure Branch: master -Commit: bcb73c4629b948c5a6010e3c0e8cbd3196e8ae09 +Commit: f6b39d9c8f634b48af01d44ab66ba2585b40c49c 2) AutoRest information Requested version: latest -Bootstrapper version: C:\Users\natinimn\AppData\Roaming\npm `-- autorest@2.0.4262 +Bootstrapper version: C:\Users\brjohnst\AppData\Roaming\npm `-- autorest@2.0.4262 + + Latest installed version: +.\tools\generate.ps1 was invoked by generate.ps1 + + diff --git a/src/SDKs/_metadata/search_resource-manager.txt b/src/SDKs/_metadata/search_resource-manager.txt index e24b45ae1149..9bc6b8eabe3d 100644 --- a/src/SDKs/_metadata/search_resource-manager.txt +++ b/src/SDKs/_metadata/search_resource-manager.txt @@ -1,11 +1,17 @@ -2018-01-11 02:33:03 UTC - +Executing AutoRest command +cmd.exe /c autorest.cmd https://github.com/Azure/azure-rest-api-specs/blob/master/specification/search/resource-manager/readme.md --csharp --csharp-sdks-folder=E:\github\azure-sdk-for-net\tools\..\src\SDKs\ --version=latest --reflect-api-versions +2018-04-09 21:04:22 UTC 1) azure-rest-api-specs repository information -GitHub user: Azure +GitHub fork: Azure Branch: master -Commit: 6b8130960809d1685744222300de051f4e785bda +Commit: f6b39d9c8f634b48af01d44ab66ba2585b40c49c 2) AutoRest information Requested version: latest -Bootstrapper version: C:\Users\brjohnst\AppData\Roaming\npm `-- autorest@2.0.4215 +Bootstrapper version: C:\Users\brjohnst\AppData\Roaming\npm `-- autorest@2.0.4262 + + Latest installed version: +.\tools\generate.ps1 was invoked by generate.ps1 + +