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:
Родитель
0d383f1fcf
Коммит
b76acc8d8d
|
@ -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
|
||||
}
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче