Add support for autorest preview pipeline (#28042)

Add required overload in LanguageSettings.ps1 to support code generation
from the [autorest.typescript -
preview](https://dev.azure.com/azure-sdk/internal/_build?definitionId=6415)
pipeline
This commit is contained in:
Patrick Hallisey 2023-12-13 13:34:12 -08:00 коммит произвёл GitHub
Родитель 0d383f1fcf
Коммит b76acc8d8d
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
2 изменённых файлов: 45 добавлений и 0 удалений

5
.gitignore поставляемый
Просмотреть файл

@ -172,9 +172,14 @@ code-model-*
# CPU profiles
*.cpuprofile
# Temp typespec files
TempTypeSpecFiles/
# Symbolic link from project directory to recordings
_recordings
# CI generated artifacts
/artifacts
sdk/template/template-dpg/src/src

Просмотреть файл

@ -442,3 +442,43 @@ function Validate-javascript-DocMsPackages ($PackageInfo, $PackageInfos, $DocRep
return $allSucceeded
}
function Update-javascript-GeneratedSdks([string]$PackageDirectoriesFile) {
$moduleFolders = Get-Content $PackageDirectoriesFile | ConvertFrom-Json
$directoriesWithErrors = @()
foreach ($directory in $moduleFolders) {
$directoryPath = "$RepoRoot/sdk/$directory"
if (Test-Path "$directoryPath/tsp-location.yaml") {
Write-Host 'Generating project under folder ' -ForegroundColor Green -NoNewline
Write-Host "$directory" -ForegroundColor Yellow
Write-Host "Calling TypeSpec-Project-Sync.ps1 for $directory"
& $RepoRoot/eng/common/scripts/TypeSpec-Project-Sync.ps1 $directoryPath
if ($LASTEXITCODE) {
$directoriesWithErrors += $directory
continue
}
Write-Host "Calling TypeSpec-Project-Generate.ps1 for $directory"
& $RepoRoot/eng/common/scripts/TypeSpec-Project-Generate.ps1 $directoryPath
if ($LASTEXITCODE) {
$directoriesWithErrors += $directory
continue
}
}
else {
Write-Host "No tsp-location.yaml found in $directory"
}
}
if ($directoriesWithErrors.Count -gt 0) {
Write-Host "##[error]Generation errors found in $($directoriesWithErrors.Count) directories:"
foreach ($directory in $directoriesWithErrors) {
Write-Host " $directory"
}
exit 1
}
}