Skip to content

Commit 748041d

Browse files
Add alternative code paths depending on parameters (Azure#19001)
1 parent b02300d commit 748041d

File tree

2 files changed

+32
-8
lines changed

2 files changed

+32
-8
lines changed

eng/scripts/Language-Settings.ps1

Lines changed: 30 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,35 @@ $BlobStorageUrl = "https://azuresdkdocs.blob.core.windows.net/%24web?restype=con
88

99
function Get-dotnet-PackageInfoFromRepo ($pkgPath, $serviceDirectory, $pkgName)
1010
{
11-
$projectPath = Join-Path $pkgPath "src" "$pkgName.csproj"
12-
if (Test-Path $projectPath)
11+
$projDirPath = (Join-Path $pkgPath "src")
12+
13+
if (!(Test-Path $projDirPath))
14+
{
15+
return $null
16+
}
17+
18+
if ($pkgName)
19+
{
20+
$projectPath = Join-Path $projDirPath "$pkgName.csproj"
21+
}
22+
else
23+
{
24+
$projectPaths = (Resolve-Path (Join-Path $projDirPath "*.csproj")).path
25+
if ($projectPaths.Count -gt 1)
26+
{
27+
LogWarning "There is more than on csproj file in the projectpath/src directory. First project picked."
28+
$projectPath = $projectPaths[0]
29+
}
30+
else {
31+
$projectPath = $projectPaths
32+
}
33+
}
34+
35+
36+
37+
if ($projectPath -and (Test-Path $projectPath))
1338
{
39+
$pkgName = Split-Path -Path $projectPath -LeafBase
1440
$projectData = New-Object -TypeName XML
1541
$projectData.load($projectPath)
1642
$pkgVersion = Select-XML -Xml $projectData -XPath '/Project/PropertyGroup/Version'
@@ -25,10 +51,8 @@ function Get-dotnet-PackageInfoFromRepo ($pkgPath, $serviceDirectory, $pkgName)
2551
$pkgProp.ArtifactName = $pkgName
2652
return $pkgProp
2753
}
28-
else
29-
{
30-
return $null
31-
}
54+
55+
return $null
3256
}
3357

3458
# Returns the nuget publish status of a package id and version.

sdk/mediaservices/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ trigger:
44
branches:
55
include:
66
- master
7-
- main
7+
- main
88
- hotfix/*
99
- release/*
1010
paths:
@@ -15,7 +15,7 @@ pr:
1515
branches:
1616
include:
1717
- master
18-
- main
18+
- main
1919
- feature/*
2020
- hotfix/*
2121
- release/*

0 commit comments

Comments
 (0)