|
102 | 102 | ItemName="FilesWithHashes" /> |
103 | 103 | </GetFileHash> |
104 | 104 |
|
105 | | - <Message Importance="High" |
106 | | - Text="%(FilesWithHashes.Identity): %(FilesWithHashes.FileHash)" /> |
| 105 | + <WriteLinesToFile File="%(FilesWithHashes.Identity).sha" Lines="%(FilesWithHashes.FileHash)" Overwrite="true"/> |
| 106 | + |
| 107 | + <!-- If specified we'll update the checked in SHAs with the downloaded ones. --> |
| 108 | + <Copy Condition="'$(UpdateSHA)' == 'true'" |
| 109 | + SourceFiles="@(TensorFlowArchive->'%(DownloadShaFile)')" |
| 110 | + DestinationFiles="@(TensorFlowArchive->'%(LocalShaFile)')" /> |
107 | 111 |
|
108 | 112 | <ItemGroup> |
109 | 113 | <TensorFlowArchive> |
110 | 114 | <DownloadSha>@(FilesWithHashes->'%(FileHash)')</DownloadSha> |
111 | | - <LocalSha>$([System.IO.File]::ReadAllText('%(LocalShaFile)'))</LocalSha> |
| 115 | + <LocalSha>$([System.IO.File]::ReadAllText('%(LocalShaFile)').Replace("%0A", "").Replace("%0D", ""))</LocalSha> |
112 | 116 | </TensorFlowArchive> |
113 | 117 | </ItemGroup> |
114 | 118 |
|
115 | | - <!-- If specified we'll update the checked in SHAs with the downloaded ones. --> |
116 | | - <!--<WriteLinesToFile Condition="'$(UpdateSHA)' == 'true'" |
117 | | - File="@(TensorFlowArchive->'%(LocalShaFile)')" |
118 | | - Lines="@(TensorFlowArchive->'%(LocalShaFile)')" />--> |
119 | | - |
120 | 119 | <Error Condition="!Exists('%(TensorFlowArchive.LocalShaFile)')" Text="SHA file '%(TensorFlowArchive.LocalShaFile)' does not exist. Build with /p:UpdateSHA=true to save it." /> |
121 | 120 |
|
122 | 121 | <Message Importance="High" Text="@TensorFlowArchive->'%(TensorFlowArchive.DownloadFile) - %(TensorFlowArchive.LocalSha) - %(TensorFlowArchive.DownloadSha)"/> |
123 | 122 |
|
124 | 123 | <!-- Validate that the downloaded SHAs match the expected checked in SHAs --> |
125 | | - <Error Condition="'%(TensorFlowArchive.LocalSha)' != '%(TensorFlowArchive.DownloadSha)'" Text="Downloaded file '%(TensorFlowArchive.DownloadFile)' has unexpected SHA.%0A expected: %(_downloadedTensorFlowArchive.LocalSha)%0A actual: %(_downloadedTensorFlowArchive.DownloadSha)%0ABuild with /p:UpdateSHA=true if you intentionally changed the URL and wish to update the SHAs, otherwise this could indicate an incomplete download or intercerpted URL and should be examined." /> |
| 124 | + <Error Condition="'%(TensorFlowArchive.LocalSha)' != '%(TensorFlowArchive.DownloadSha)'" Text="Downloaded file '%(TensorFlowArchive.DownloadFile)' has unexpected SHA.%0A expected: %(TensorFlowArchive.LocalSha)%0A --actual: %(TensorFlowArchive.DownloadSha)%0ABuild with /p:UpdateSHA=true if you intentionally changed the URL and wish to update the SHAs, otherwise this could indicate an incomplete download or intercerpted URL and should be examined." /> |
126 | 125 |
|
127 | 126 |
|
128 | 127 | <!-- The archives are valid, lets extract them, ensuring an empty directory --> |
|
0 commit comments