Skip to content

Commit 4c390c8

Browse files
Enable ReleaseNotes Extraction for Track 1 Libraries (Azure#10301)
1 parent b624e52 commit 4c390c8

3 files changed

+6
-7
lines changed

Directory.Build.props

-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
<RepoSdkPath>$(RepoRoot)src/SDKs</RepoSdkPath>
77
<IsClientLibrary Condition="'$(IsClientLibrary)' == '' and $(MSBuildProjectName.StartsWith('Azure.'))">true</IsClientLibrary>
88
<IsDataPlaneProject Condition="'$(IsDataPlaneProject)' == '' and '$(IsClientLibrary)' == 'true'">true</IsDataPlaneProject>
9-
<IsDataPlaneProject Condition="'$(IsDataPlaneProject)' == '' and $(MSBuildProjectDirectory.Contains('data-plane'))">true</IsDataPlaneProject>
109
</PropertyGroup>
1110

1211
<!-- Setup default project properties -->

eng/Directory.Build.Data.props

+1
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
<IsSamplesProject Condition="$(MSBuildProjectName.EndsWith('.Samples'))">true</IsSamplesProject>
4040
<IsTestSupportProject Condition="'$(IsTestProject)' != 'true' and ($(MSBuildProjectDirectory.Contains('/tests/')) or $(MSBuildProjectDirectory.Contains('\tests\')))">true</IsTestSupportProject>
4141
<IsShippingClientLibrary Condition="'$(IsClientLibrary)' == 'true' and '$(IsTestProject)' != 'true' and '$(IsTestSupportProject)' != 'true' and '$(IsSamplesProject)' != 'true'">true</IsShippingClientLibrary>
42+
<IsShippingDataPlaneLibrary Condition="'$(IsDataPlaneProject)' == 'true' and '$(IsTestProject)' != 'true' and '$(IsTestSupportProject)' != 'true' and '$(IsSamplesProject)' != 'true'">true</IsShippingDataPlaneLibrary>
4243

4344
<EnableClientSdkAnalyzers Condition="'$(IsShippingClientLibrary)' == 'true'">true</EnableClientSdkAnalyzers>
4445
<EnableFxCopAnalyzers Condition="'$(IsShippingClientLibrary)' == 'true'">true</EnableFxCopAnalyzers>

eng/Directory.Build.Data.targets

+5-6
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@
1111
</Target>
1212

1313
<!-- Set PackageProjectUrl and PackageReleaseNotes to the package README.md and CHANGELOG.md respectively for DataPlane Libraries -->
14-
<Target Name="SetPackageProjectUrlandReleaseNotes" BeforeTargets="GenerateNuspec" DependsOnTargets="InitializeSourceControlInformationFromSourceControlManager" Condition="'$(IsDataPlaneProject)' == 'true' and '$(IsTestProject)' != 'true' and
15-
'$(IsSamplesProject)' != 'true' and '$(IsTestSupportProject)' != 'true' and '$(SourceRevisionId)' != ''">
14+
<Target Name="SetPackageProjectUrlandReleaseNotes" BeforeTargets="GenerateNuspec" DependsOnTargets="InitializeSourceControlInformationFromSourceControlManager" Condition="'$(IsShippingDataPlaneLibrary)' == 'true' and '$(SourceRevisionId)' != ''">
1615
<Error Condition="'$(IsClientLibrary)' == 'true' and '$(PackageReleaseNotes)' != ''" Text="Do NOT set PackageReleaseNotes property in the project. Release notes are added automatically from package changelog" />
1716
<PropertyGroup>
1817
<PackageRootPath>$([MSBuild]::NormalizeDirectory($(MSBuildProjectDirectory)/../))</PackageRootPath>
@@ -24,19 +23,19 @@
2423
</Target>
2524

2625
<!--Extract release notes for the current version being built -->
27-
<Target Name="GetCurrentReleaseNotes" BeforeTargets="SetPackageProjectUrlandReleaseNotes" Condition="'$(SkipDevBuildNumber)' == 'true' and '$(IsShippingClientLibrary)' == 'true'" >
26+
<Target Name="GetCurrentReleaseNotes" BeforeTargets="SetPackageProjectUrlandReleaseNotes" Condition="'$(SkipDevBuildNumber)' == 'true' and '$(IsShippingDataPlaneLibrary)' == 'true'" >
2827
<PropertyGroup>
2928
<PowerShellExe Condition=" '$(PowerShellExe)'=='' ">"%ProgramFiles%\PowerShell\6\pwsh.exe"</PowerShellExe>
3029
<PowerShellExe Condition="!Exists('$(PowerShellExe)')">pwsh</PowerShellExe>
3130
<GetReleaseNotesScriptPath Condition=" '$(GetReleaseNotesScriptPath)'=='' ">$(MSBuildThisFileDirectory)/common/Extract-ReleaseNotes.ps1</GetReleaseNotesScriptPath>
3231
<ChangeLogPath>$([MSBuild]::NormalizeDirectory($(MSBuildProjectDirectory)/../))CHANGELOG.md</ChangeLogPath>
3332
</PropertyGroup>
34-
<Exec ContinueOnError="true" ConsoleToMSBuild="true" Command="$(PowerShellExe) -NonInteractive -executionpolicy Unrestricted -File $(GetReleaseNotesScriptPath) $(ChangeLogPath) $(Version)">
33+
<Exec Condition="Exists('$(ChangeLogPath)')" ContinueOnError="true" ConsoleToMSBuild="true" Command="$(PowerShellExe) -NonInteractive -executionpolicy Unrestricted -File $(GetReleaseNotesScriptPath) $(ChangeLogPath) $(Version)">
3534
<Output TaskParameter="ConsoleOutput" ItemName="ExtractedReleaseNotesTemp" />
3635
<Output TaskParameter="ExitCode" PropertyName="SetReleaseNotesErrorCode" />
3736
</Exec>
38-
<Error Condition="'$(SetReleaseNotesErrorCode)' != '0'" Text="Release Notes for the specified version was not found. @(ExtractedReleaseNotesTemp)" />
39-
<ItemGroup>
37+
<Error Condition="Exists('$(ChangeLogPath)') and '$(SetReleaseNotesErrorCode)' != '0'" Text="Release Notes for the specified version was not found. @(ExtractedReleaseNotesTemp)" />
38+
<ItemGroup Condition="Exists('$(ChangeLogPath)')">
4039
<ExtractedReleaseNotes Condition="'$(SetReleaseNotesErrorCode)'=='0'" Include="@(ExtractedReleaseNotesTemp)" />
4140
</ItemGroup>
4241
</Target>

0 commit comments

Comments
 (0)