[Build] Fix nightly package naming (#6429)
authorRui Marinho <me@ruimarinho.net>
Thu, 6 Jun 2019 13:24:00 +0000 (14:24 +0100)
committerGitHub <noreply@github.com>
Thu, 6 Jun 2019 13:24:00 +0000 (14:24 +0100)
Version.targets

index dd2992e..d6a4736 100644 (file)
@@ -1,10 +1,14 @@
 <Project>
  <PropertyGroup>
+    <NightlyTag>nightly</NightlyTag>
+ </PropertyGroup>
+ <PropertyGroup>
     <GitBranch Condition="'$(SYSTEM_PULLREQUEST_TARGETBRANCH)' != ''">$(SYSTEM_PULLREQUEST_TARGETBRANCH)</GitBranch>
     <GitBranch Condition="'$(SYSTEM_PULLREQUEST_TARGETBRANCH)' == '' and '$(BUILD_SOURCEBRANCHNAME)' != ''">$(BUILD_SOURCEBRANCHNAME)</GitBranch>
   </PropertyGroup>
-  <PropertyGroup Condition="'$(GitSemVerLabel)' == ''">
-    <GitSemVerLabel Condition="$(CI) and '$(BUILD_REASON)' == 'Schedule'">nightly</GitSemVerLabel>
+  <PropertyGroup>
+    <GitSemVerLabel  Condition="$(CI) and '$(BUILD_REASON)' == 'Schedule'">$(NightlyTag)</GitSemVerLabel>
+    <GitSemVerDashLabel  Condition="$(CI) and '$(BUILD_REASON)' == 'Schedule'">-$(GitSemVerLabel)</GitSemVerDashLabel>
   </PropertyGroup>
 
   <Target Name="SetVersions"
@@ -28,8 +32,6 @@
     <PropertyGroup>
       <VersionMetadataLabel>@(VersionMetadata -> '%(Identity)', '-')</VersionMetadataLabel>
       <VersionMetadataPlusLabel Condition="'$(VersionMetadataLabel)' != ''">+$(VersionMetadataLabel)</VersionMetadataPlusLabel>
-
-      <GitSemVerDashLabel Condition="'$(GitSemVerDashLabel)' != '' and '$(GitCommits)' != '0'">$(GitSemVerDashLabel).$(GitCommits)</GitSemVerDashLabel>
       <Version>$(GitBaseVersionMajor).$(GitBaseVersionMinor).$(GitBaseVersionPatch)</Version>
       <PackageVersion>$(GitSemVerMajor).$(GitSemVerMinor).$(GitSemVerPatch)$(GitSemVerDashLabel)$(VersionMetadataPlusLabel)</PackageVersion>
       <PackageVersion Condition="$(CI)">$(GitSemVerMajor).$(GitSemVerMinor).$(GitBaseVersionPatch).$(BUILDVERSION)$(GitSemVerDashLabel)$(VersionMetadataPlusLabel)</PackageVersion>
@@ -52,6 +54,7 @@
       </AssemblyAttribute>
     </ItemGroup>
 
+    <Message Condition="$(CI) and '$(BUILD_REASON)' == 'Schedule'" Importance="high" Text="Building $(BUILD_REASON) nightly $(PackageVersion)"/>
     <Message Condition="$(CI)" Importance="high" Text="##vso[build.updatebuildnumber]$(PackageVersion)"/>
     <Message Condition="$(CI)" Importance="high" Text="##vso[task.setvariable variable=XamarinFormsPackageVersion;isOutput=true;]$(PackageVersion)"/>
   </Target>