Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add parameter to set cadl emitter options #5540

Merged
3 commits merged into from
Mar 1, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion eng/common/scripts/Cadl-Project-Generate.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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
chunyu3 marked this conversation as resolved.
Show resolved Hide resolved
)

$ErrorActionPreference = "Stop"
Expand Down Expand Up @@ -78,6 +80,12 @@ try {
}
}
$cadlCompileCommand = "npx cadl compile $mainCadlFile --emit $emitterName$emitterAdditionalOptions"
if ($CadlAdditionalOptions) {
$options = $CadlAdditionalOptions.Split(";");
foreach ($option in $options) {
$cadlCompileCommand += " --option $option"
}
}
Write-Host($cadlCompileCommand)
Invoke-Expression $cadlCompileCommand

Expand Down