Skip to content

Commit 7790c2c

Browse files
authored
Verify dependency versions for release packages (Azure#16687)
1 parent fdfd44a commit 7790c2c

File tree

3 files changed

+26
-2
lines changed

3 files changed

+26
-2
lines changed

eng/Directory.Build.Data.targets

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,30 @@
176176
Text="When UseProjectReferenceToAzureClients=true all Azure.* references should be Project References, but the following are not [@(ShouldBeProjectReference)]" />
177177
</Target>
178178

179+
<!-- Added layer of checks to make sure release packages don't have preview dependencies -->
180+
<Target Name="VerifyProjectReferencesReferences" Condition="'$(HasReleaseVersion)' == 'true' AND '$(IsPackable)' == 'true'" BeforeTargets="GenerateNuspec">
181+
182+
<Msbuild
183+
Projects="@(_ProjectReferencesFromAssetsFile)"
184+
Targets="_GetProjectVersion"
185+
SkipNonexistentTargets="true"
186+
SkipNonexistentProjects="true"
187+
Properties="BuildProjectReferences=false;SkipDevBuildNumber=true">
188+
<Output
189+
TaskParameter="TargetOutputs"
190+
ItemName="_ProjectReferencesWithoutDevVersions"/>
191+
</Msbuild>
192+
193+
<ItemGroup>
194+
<_AllReferencesWithVersions Include="@(_ProjectReferencesWithoutDevVersions)" Version="%(ProjectVersion)" />
195+
<_AllReferencesWithVersions Include="@(PackageReference)" Condition="!$([System.String]::Copy('%(PackageReference.PrivateAssets)').ToLower().Equals('all'))"/>
196+
197+
<PreviewPackageReferences Include="@(_AllReferencesWithVersions)" Condition="$([System.String]::Copy('%(Version)').Contains('-'))" />
198+
</ItemGroup>
199+
200+
<Error Condition="'@(PreviewPackageReferences)' != ''" Text="When the project has a release version it shouldn't reference any pre-release libraries. Found the following pre-release references: @(PreviewPackageReferences, ', ')" />
201+
</Target>
202+
179203
<PropertyGroup>
180204
<ApiCompatExcludeAttributeList>$(MSBuildThisFileDirectory)ApiListing.exclude-attributes.txt</ApiCompatExcludeAttributeList>
181205
</PropertyGroup>
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
## 0.5.6 (Unreleased)
1+
## 0.5.6-beta.1 (Unreleased)
22

33

sdk/eventhub/Microsoft.Azure.EventHubs.ServiceFabricProcessor/src/Microsoft.Azure.EventHubs.ServiceFabricProcessor.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
33
<Description>This is the next generation Azure Event Hubs .NET Standard Service Fabric Processor library, which integrates Event Hub event consumption with Service Fabric. For more information about Event Hubs, see https://azure.microsoft.com/en-us/services/event-hubs/</Description>
4-
<Version>0.5.6</Version>
4+
<Version>0.5.6-beta.1</Version>
55
<PackageTags>Azure;Event Hubs;EventHubs;.NET;AMQP;IoT</PackageTags>
66
<PackageReleaseNotes>https://github.com/Azure/azure-sdk-for-net/releases</PackageReleaseNotes>
77
<DocumentationFile>$(OutputPath)$(TargetFramework)Microsoft.Azure.EventHubs.Processor.xml</DocumentationFile>

0 commit comments

Comments
 (0)