From c1f3c25834f6f5f6bdb90e9fa291c800bb27f9af Mon Sep 17 00:00:00 2001 From: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> Date: Tue, 28 Feb 2023 19:55:43 -0800 Subject: [PATCH] Sync eng/common directory with azure-sdk-tools for PR 5540 (#25037) Sync eng/common directory with azure-sdk-tools for PR https://github.com/Azure/azure-sdk-tools/pull/5540 See [eng/common workflow](https://github.com/Azure/azure-sdk-tools/blob/main/eng/common/README.md#workflow) --------- Co-authored-by: chunyu3 --- eng/common/scripts/Cadl-Project-Generate.ps1 | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/eng/common/scripts/Cadl-Project-Generate.ps1 b/eng/common/scripts/Cadl-Project-Generate.ps1 index d6adc59cefe8..3e7ee781b053 100644 --- a/eng/common/scripts/Cadl-Project-Generate.ps1 +++ b/eng/common/scripts/Cadl-Project-Generate.ps1 @@ -4,7 +4,9 @@ param ( [Parameter(Position=0)] [ValidateNotNullOrEmpty()] - [string] $ProjectDirectory + [string] $ProjectDirectory, + [Parameter(Position=1)] + [string] $CadlAdditionalOptions ## addtional cadl emitter options, separated by semicolon if more than one, e.g. option1=value1;option2=value2 ) $ErrorActionPreference = "Stop" @@ -78,6 +80,12 @@ try { } } $cadlCompileCommand = "npx cadl compile $mainCadlFile --emit $emitterName$emitterAdditionalOptions" + if ($CadlAdditionalOptions) { + $options = $CadlAdditionalOptions.Split(";"); + foreach ($option in $options) { + $cadlCompileCommand += " --option $emitterName.$option" + } + } Write-Host($cadlCompileCommand) Invoke-Expression $cadlCompileCommand