maui/eng/Versions.targets

70 строки
2.9 KiB
XML

<Project>
<PropertyGroup>
<NightlyTag>nightly</NightlyTag>
</PropertyGroup>
<PropertyGroup>
<CoreCompileDependsOn>
SetVersions;
$(CoreCompileDependsOn);
</CoreCompileDependsOn>
<GenerateNuspecDependsOn>
SetVersions;
$(GenerateNuspecDependsOn);
</GenerateNuspecDependsOn>
<GetPackageVersionDependsOn>
SetVersions;
$(GetPackageVersionDependsOn);
</GetPackageVersionDependsOn>
<SetVersionsBefore>
GetAssemblyVersion;
$(SetVersionsBefore);
</SetVersionsBefore>
<SetVersionsDependsOn>
$(SetVersionsDependsOn);
</SetVersionsDependsOn>
</PropertyGroup>
<Target Name="SetVersions"
BeforeTargets="$(SetVersionsBefore)"
DependsOnTargets="$(SetVersionsDependsOn)"
Returns="$(Version)">
<PropertyGroup>
<PreReleaseVersionLabel Condition="$(CI) and '$(BUILD_REASON)' == 'Schedule'">$(NightlyTag)</PreReleaseVersionLabel>
</PropertyGroup>
<ItemGroup>
<VersionMetadata Condition="$(CI) and '$(BUILD_REASON)' == 'PullRequest'"
Include="pr.$(SYSTEM_PULLREQUEST_PULLREQUESTNUMBER)"/>
<VersionMetadata Condition="'$(SourceLinkId)' != ''" Include="sha.$(SourceLinkId)"/>
<VersionMetadata Condition="$(CI)"
Include="azdo.$(BUILD_BUILDID)"/>
</ItemGroup>
<PropertyGroup>
<PackageReferenceVersion>$(PackageVersion)</PackageReferenceVersion>
<VSComponentVersion Condition="'$(PreReleaseVersionLabel)' != ''">$(MajorVersion).$(MinorVersion).$(PatchVersion).$(BUILDVERSION)</VSComponentVersion>
<VSComponentVersion Condition="'$(PreReleaseVersionLabel)' == ''">$(MajorVersion).$(MinorVersion).$(PatchVersion).0</VSComponentVersion>
</PropertyGroup>
<PropertyGroup>
<_SkipUpdateBuildNumber Condition="'$(SampleProject)' == 'true' or '$(OutputType)' == 'Exe' or '$(OutputType)' == 'WinExe' or '$(AndroidApplication)' == 'true' or '$(IsTestProject)' == 'true' or '$(IsPackable)' == 'false' or '_SkipUpdateBuildNumber' == 'true' ">true</_SkipUpdateBuildNumber>
<_UpdateBuildNumber Condition="$(CI) and '$(BUILD_BUILDNUMBER)' != '$(PackageVersion)' AND '$(_SkipUpdateBuildNumber)' != 'true'">$(PackageVersion)</_UpdateBuildNumber>
</PropertyGroup>
<Error Condition="'$(_UpdateBuildNumber)' == '1.0.0'" Text="Unexpected _UpdateBuildNumber: '$(_UpdateBuildNumber)'" />
<PropertyGroup Condition="'$(_UpdateBuildNumber)' != ''">
<_UpdateBuildNumber Condition="'@(VersionMetadata)' != ''">$(_UpdateBuildNumber)+@(VersionMetadata -> '%(Identity)', '.')</_UpdateBuildNumber>
</PropertyGroup>
<Message Condition="$(CI) and '$(BUILD_REASON)' == 'Schedule'" Importance="high" Text="##vso[build.addbuildtag]$(NightlyTag)"/>
<Message Condition="'$(_UpdateBuildNumber)' != ''" Importance="high" Text="##vso[build.updatebuildnumber]$(_UpdateBuildNumber)"/>
</Target>
</Project>