Skip to content
Merged
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
18 changes: 18 additions & 0 deletions eng/Directory.Build.Common.targets
Original file line number Diff line number Diff line change
Expand Up @@ -264,5 +264,23 @@
<Target Name="RunApiCompat" DependsOnTargets="ValidateApiCompatForSrc" Condition="'$(ApiCompatVersion)' != ''">
</Target>

<Target Name="GetPackageInfo">
<PropertyGroup>
<PackageIsNewSdk>false</PackageIsNewSdk>
<PackageIsNewSdk Condition="'$(IsClientLibrary)' == 'true'">true</PackageIsNewSdk>

<PackageSdkType>data</PackageSdkType>
<PackageSdkType Condition="'$(IsClientLibrary)' == 'true'">client</PackageSdkType>
<PackageSdkType Condition="'$(IsMgmtLibrary)' == 'true'">mgmt</PackageSdkType>

<PackageRootDirectory>$([MSBuild]::NormalizeDirectory($(MSBuildProjectDirectory)/../).Trim("/").Trim("\\"))</PackageRootDirectory>

<!-- Parse out the service directory based on the relative path to the sdk folder -->
<ServiceDirectory><![CDATA[$([System.Text.RegularExpressions.Regex]::Replace($(PackageRootDirectory), '^.*[\\/]+sdk[\\/]+([^\\/]+).*$', '$1'))]]></ServiceDirectory>
</PropertyGroup>

<Message Condition="'$(IsShippingLibrary)' == 'true'" Text="'$(PackageRootDirectory)' '$(ServiceDirectory)' '$(PackageId)' '$(_VersionInProject)' '$(PackageSdkType)' '$(PackageIsNewSdk)'" Importance="High" />
Comment thread
pakrym marked this conversation as resolved.
</Target>

<Import Project="$(CentralPackageVersionPackagePath)\Sdk.targets" />
</Project>
40 changes: 10 additions & 30 deletions eng/scripts/Language-Settings.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -6,46 +6,26 @@ $packagePattern = "*.nupkg"
$MetadataUri = "https://raw.githubusercontent.com/Azure/azure-sdk/main/_data/releases/latest/dotnet-packages.csv"
$BlobStorageUrl = "https://azuresdkdocs.blob.core.windows.net/%24web?restype=container&comp=list&prefix=dotnet%2F&delimiter=%2F"

function Get-dotnet-PackageInfoFromRepo ($pkgPath, $serviceDirectory)
function Get-AllPackageInfoFromRepo($serviceDirectory)
{
$projDirPath = (Join-Path $pkgPath "src")
$allPackageProps = @()
$msbuildOutput = dotnet msbuild /nologo /t:GetPackageInfo $EngDir/service.proj /p:ServiceDirectory=$serviceDirectory

if (!(Test-Path $projDirPath))
foreach ($projectOutput in $msbuildOutput)
{
return $null
}

$projectPaths = @(Resolve-Path (Join-Path $projDirPath "*.csproj"))
if (!$projectOutput) { continue }

if ($projectpaths.Count -ge 1) {
$projectPath = $projectPaths[0].path
if ($projectPaths.Count -gt 1) {
LogWarning "There is more than on csproj file in the projectpath/src directory. First project picked."
}
}
else {
return $null
}
$pkgPath, $serviceDirectory, $pkgName, $pkgVersion, $sdkType, $isNewSdk = $projectOutput.Split(' ',[System.StringSplitOptions]::RemoveEmptyEntries).Trim("'")
Comment thread
weshaggard marked this conversation as resolved.

if ($projectPath -and (Test-Path $projectPath))
{
$pkgName = Split-Path -Path $projectPath -LeafBase
$projectData = New-Object -TypeName XML
$projectData.load($projectPath)
$pkgVersion = Select-XML -Xml $projectData -XPath '/Project/PropertyGroup/Version'
$sdkType = "client"
if ($pkgName -match "\.ResourceManager\." -or $pkgName -match "\.Management\.")
{
$sdkType = "mgmt"
}
$pkgProp = [PackageProps]::new($pkgName, $pkgVersion, $pkgPath, $serviceDirectory)
$pkgProp.SdkType = $sdkType
$pkgProp.IsNewSdk = $pkgName.StartsWith("Azure")
$pkgProp.IsNewSdk = ($isNewSdk -eq 'true')
$pkgProp.ArtifactName = $pkgName
return $pkgProp

$allPackageProps += $pkgProp
}

return $null
return $allPackageProps
}

# Returns the nuget publish status of a package id and version.
Expand Down
8 changes: 8 additions & 0 deletions eng/service.proj
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,12 @@
<Message Text="Final Build References:" Importance="high"/>
<Message Text=" %(ProjectReference.Identity)" Importance="high"/>
</Target>

<Target Name="GetPackageInfo">
<MSBuild Projects="@(ProjectReference)"
Targets="GetPackageInfo"
BuildInParallel="$(BuildInParallel)"
SkipNonexistentProjects="false"
SkipNonexistentTargets="true" />
</Target>
</Project>