Преглед изворни кода

Duplicate productVersion.txt with repo-specific name

In our efforts to unify the build access story using aka.ms links, we have found that there are certain files that share the same name in multiple different repositories, most importantly, productVersion.txt. As part of the work to move to aka.ms links, we will be flattening the short link paths, so rather than having a runtime-specific, aspnetcore-specific, etc. full path to the files generated by each of the repos, they will all go to the same short link location. This means that the path to productVersion.txt will collide in the aka.ms links (the backing locations are not changing and will be unaffected). To combat this, we will add a duplicate of each of the product repos productVersion.txt, renamed to indicate which product repo it came from, in this case aspnetcore-productVersion.txt. The original will remane so that we do not break existing scenarios that do not use the aka.ms links.
Michelle McDaniel пре 5 година
родитељ
комит
995edccf5d
1 измењених фајлова са 14 додато и 2 уклоњено
  1. 14 2
      eng/Publishing.props

+ 14 - 2
eng/Publishing.props

@@ -8,7 +8,9 @@
 
     <_UploadPathRoot>aspnetcore</_UploadPathRoot>
     <ProductVersionFileName>productVersion.txt</ProductVersionFileName>
+    <RepoProductVersionFileName>$(_UploadPathRoot)-$(ProductVersionFileName)</RepoProductVersionFileName>
     <ProductVersionFileLocation>$(ArtifactsShippingPackagesDir)$(ProductVersionFileName)</ProductVersionFileLocation>
+    <RepoProductVersionFileLocation>$(ArtifactsShippingPackagesDir)$(RepoProductVersionFileName)</RepoProductVersionFileLocation>
   </PropertyGroup>
 
   <!-- $(InstallersOutputPath), $(SymbolsOutputPath), and $(ChecksumExtensions) are not defined. Root Directory.Build.props is not imported. -->
@@ -33,7 +35,7 @@
     <_ChecksumsToPublish Include="$(ArtifactsDir)**\*.sha512" />
   </ItemGroup>
 
-  <Target 
+  <Target
     Name="_PublishInstallersAndChecksumsAndProductVersion"
     DependsOnTargets="_WriteProductVersionFile">
     <!--
@@ -74,10 +76,15 @@
         <PublishFlatContainer>true</PublishFlatContainer>
         <RelativeBlobPath>$(_UploadPathRoot)/Runtime/$(_PackageVersion)/$(ProductVersionFileName)</RelativeBlobPath>
       </ItemsToPushToBlobFeed>
+
+      <ItemsToPushToBlobFeed Include="$(RepoProductVersionFileLocation)" Condition=" '$(PublishInstallerBaseVersion)' == 'true'">
+        <PublishFlatContainer>true</PublishFlatContainer>
+        <RelativeBlobPath>$(_UploadPathRoot)/Runtime/$(_PackageVersion)/$(RepoProductVersionFileName)</RelativeBlobPath>
+      </ItemsToPushToBlobFeed>
     </ItemGroup>
   </Target>
 
-  <Target 
+  <Target
     Name="_WriteProductVersionFile"
     Condition=" '$(PublishInstallerBaseVersion)' == 'true'">
     <!--
@@ -102,5 +109,10 @@
       Lines="$(_ProductVersion)"
       Overwrite="true"
       Encoding="ASCII" />
+    <WriteLinesToFile
+      File="$(RepoProductVersionFileLocation)"
+      Lines="$(_ProductVersion)"
+      Overwrite="true"
+      Encoding="ASCII" />
   </Target>
 </Project>