Skip to content

[AutoPR Microsoft.Azure.Management.Network] [Test] Add properties in VirtualNetworkPeeringPropertiesFormat #1506

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

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
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
51 changes: 18 additions & 33 deletions eng/scripts/Invoke-GenerateAndBuildV2.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ foreach( $file in $inputFilePaths) {
$inputFileToGen += @($file)
}
}

}

if ($inputFileToGen) {
Expand All @@ -113,42 +113,27 @@ if ($inputFileToGen) {
if ($relatedTypeSpecProjectFolder) {
foreach ($typespecRelativeFolder in $relatedTypeSpecProjectFolder) {
$typespecFolder = Resolve-Path (Join-Path $swaggerDir $typespecRelativeFolder)
$newPackageOutput = "newPackageOutput.json"

$tspConfigYaml = Get-Content -Path (Join-Path "$typespecFolder" "tspconfig.yaml") -Raw

Install-ModuleIfNotInstalled "powershell-yaml" "0.4.1" | Import-Module
$yml = ConvertFrom-YAML $tspConfigYaml
$service = ""
$namespace = ""
if ($yml) {
if ($yml["parameters"] -And $yml["parameters"]["service-directory-name"]) {
$service = $yml["parameters"]["service-directory-name"]["default"];
}
if ($yml["options"] -And $yml["options"]["@azure-tools/typespec-csharp"] -And $yml["options"]["@azure-tools/typespec-csharp"]["namespace"]) {
$namespace = $yml["options"]["@azure-tools/typespec-csharp"]["namespace"]
}
}
if (!$service || !$namespace) {
throw "Not provide service name or namespace."
}
$projectFolder = (Join-Path $sdkPath "sdk" $service $namespace)
New-TypeSpecPackageFolder `
-service $service `
-namespace $namespace `
-sdkPath $sdkPath `
-relatedTypeSpecProjectFolder $typespecRelativeFolder `
-specRoot $swaggerDir `
-outputJsonFile $newpackageoutput
$newPackageOutputJson = Get-Content $newPackageOutput -Raw | ConvertFrom-Json
$relativeSdkPath = $newPackageOutputJson.path
GeneratePackage `
-projectFolder $projectFolder `
$curpath = Get-Location | Select-Object -ExpandProperty Path | Out-String -Stream
Write-Host "Current path is $curpath"
$processScript = Resolve-Path (Join-Path "./eng/common/scripts" "TypeSpec-Project-Process.ps1")
$sdkProjectFolder = & $processScript $typespecFolder $commitid $repoHttpsUrl -SkipSyncAndGenerate
if ($LASTEXITCODE) {
# If Process script call fails, then return with failure to CI and don't need to call GeneratePackage
$generatedSDKPackages = @{
result = "failed";
path=@("");
}
} else {
$relativeSdkPath = Resolve-Path $sdkProjectFolder -Relative
GeneratePackage `
-projectFolder $sdkProjectFolder `
-sdkRootPath $sdkPath `
-path $relativeSdkPath `
-downloadUrlPrefix $downloadUrlPrefix `
-serviceType "data-plane" `
-generatedSDKPackages $generatedSDKPackages
-generatedSDKPackages $generatedSDKPackages `
-specRepoRoot $swaggerDir
}
}
}
$outputJson = [PSCustomObject]@{
Expand Down
9 changes: 7 additions & 2 deletions eng/scripts/automation/GenerateAndBuildLib.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -722,7 +722,8 @@ function GeneratePackage()
[string]$downloadUrlPrefix="",
[string]$serviceType="data-plane",
[switch]$skipGenerate,
[object]$generatedSDKPackages
[object]$generatedSDKPackages,
[string]$specRepoRoot=""
)

$packageName = Split-Path $projectFolder -Leaf
Expand All @@ -740,7 +741,11 @@ function GeneratePackage()
Write-Host "Start to generate sdk $projectFolder"
$srcPath = Join-Path $projectFolder 'src'
if (!$skipGenerate) {
dotnet build /t:GenerateCode $srcPath
if($specRepoRoot -eq "") {
dotnet build /t:GenerateCode $srcPath
} else {
dotnet build /t:GenerateCode $srcPath /p:SpecRepoRoot=$specRepoRoot
}
}
if ( !$?) {
Write-Error "Failed to generate sdk. exit code: $?"
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.