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

Few update on common process script #6250

Merged
merged 7 commits into from
May 31, 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
Prev Previous commit
Next Next commit
Added more output
raych1 committed May 30, 2023
commit d18f3c7087eaa695ddc31149ae6c8260022ca8e8
14 changes: 10 additions & 4 deletions eng/common/scripts/TypeSpec-Project-Process.ps1
Original file line number Diff line number Diff line change
@@ -59,11 +59,15 @@ function CreateUpdate-TspLocation([System.Object]$tspConfig, [string]$TypeSpecPr

# Update tsp-location.yaml
$tspLocationYaml["commit"] = $CommitHash
Write-Host "updated tsp-location.yaml commit to $CommitHash"
$tspLocationYaml["repo"] = $repo
Write-Host "updated tsp-location.yaml repo to $repo"
$tspLocationYaml["directory"] = $TypeSpecProjectDirectory
Write-Host "updated tsp-location.yaml directory to $TypeSpecProjectDirectory"
$tspLocationYaml["additionalDirectories"] = $additionalDirs
Write-Host "updated tsp-location.yaml additionalDirectories to $additionalDirs"
$tspLocationYaml |ConvertTo-Yaml | Out-File $tspLocationYamlPath
Write-Host "updated tsp-location.yaml in $packageDir"
Write-Host "finished updating tsp-location.yaml in $packageDir"
return $packageDir
}

@@ -116,7 +120,7 @@ if ($TypeSpecProjectDirectory -match '^https://github.com/(?<repo>Azure/azure-re
Write-Error "Failed to find tspconfig.yaml in '$TypeSpecProjectDirectory'"
exit 1
}
if ($TypeSpecProjectDirectory -match "^.*/(?<path>specification/.*)$") {
if ($TypeSpecProjectDirectory -match "^.*[\\/](?<path>specification[\\/].*)$") {
$TypeSpecProjectDirectory = $Matches["path"]
} else {
Write-Error "$TypeSpecProjectDirectory doesn't have 'specification' in path."
@@ -149,10 +153,12 @@ if (Test-Path $tmpTspConfigPath) {
$sdkProjectFolder = CreateUpdate-TspLocation $tspConfigYaml $TypeSpecProjectDirectory $CommitHash $repo $repoRootPath

# call TypeSpec-Project-Sync.ps1
& "$PSScriptRoot/TypeSpec-Project-Sync.ps1" $sdkProjectFolder
$syncScript = Join-Path $PSScriptRoot TypeSpec-Project-Sync.ps1
& $syncScript $sdkProjectFolder
if ($LASTEXITCODE) { exit $LASTEXITCODE }

# call TypeSpec-Project-Generate.ps1
& "$PSScriptRoot/TypeSpec-Project-Generate.ps1" $sdkProjectFolder
$generateScript = Join-Path $PSScriptRoot TypeSpec-Project-Generate.ps1
& $generateScript $sdkProjectFolder

return $sdkProjectFolder