Skip to content

Commit 48553fa

Browse files
committed
Make TF redist project a normal MSBuild project
Remove the use of the SDK targets, and define our own build and clean.
1 parent a59b6be commit 48553fa

File tree

1 file changed

+11
-27
lines changed

1 file changed

+11
-27
lines changed

src/Redist/Microsoft.ML.TensorFlow.Redist/Microsoft.ML.Tensorflow.Redist.proj

Lines changed: 11 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
<Project Sdk="Microsoft.NET.Sdk" DefaultTargets="Restore;Build">
1+
<Project>
2+
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), Directory.Build.props))\Directory.Build.props" />
23

34
<PropertyGroup>
45
<TargetFramework>netstandard2.0</TargetFramework>
@@ -35,9 +36,7 @@
3536
<!-- DownloadFilesFromUrl requires Url metadata is set and ignores the identity of the item -->
3637
<_downloadFiles Include="@(TensorFlowArchive)" Url="%(Identity)" DestinationFile="%(DownloadFile)" />
3738
</ItemGroup>
38-
<DownloadFilesFromUrl Items="@(_downloadFiles)">
39-
<Output TaskParameter="FilesCreated" ItemName="FileWrites" />
40-
</DownloadFilesFromUrl>
39+
<DownloadFilesFromUrl Items="@(_downloadFiles)" />
4140
</Target>
4241

4342
<UsingTask TaskName="GenerateChecksums" AssemblyFile="$(ToolsDir)Microsoft.DotNet.Build.Tasks.dll"/>
@@ -51,9 +50,6 @@
5150
<_filesToCheckSum Include="@(TensorFlowArchive->'%(DownloadFile)')" DestinationPath="%(DownloadShaFile)" />
5251
</ItemGroup>
5352
<GenerateChecksums Items="@(_filesToCheckSum)" />
54-
<ItemGroup>
55-
<FileWrites Include="@(TensorFlowArchive->'%(DownloadShaFile)')" />
56-
</ItemGroup>
5753

5854
<!-- If specified we'll update the checked in SHAs with the downloaded ones. -->
5955
<Copy Condition="'$(UpdateSHA)' == 'true'"
@@ -75,24 +71,13 @@
7571
<!-- The archives are valid, lets extract them, ensuring an empty directory -->
7672
<RemoveDir Directories="@(TensorFlowArchive->'%(ExtractDirectory)')" />
7773
<MakeDir Directories="@(TensorFlowArchive->'%(ExtractDirectory)')" />
78-
<ZipFileExtractToDirectory Condition="'%(FileExtension)' == '.zip'"
74+
<ZipFileExtractToDirectory Condition="'%(TensorFlowArchive.FileExtension)' == '.zip'"
7975
SourceArchive="%(TensorFlowArchive.DownloadFile)"
8076
DestinationDirectory="%(TensorFlowArchive.ExtractDirectory)"
8177
OverwriteDestination="true" />
82-
<Exec Condition="'%(FileExtension)' == '.tar.gz'"
78+
<Exec Condition="'%(TensorFlowArchive.FileExtension)' == '.tar.gz'"
8379
Command="tar -xzmf &quot;%(TensorFlowArchive.DownloadFile)&quot; -C &quot;%(TensorFlowArchive.ExtractDirectory)&quot;" />
8480
<Touch Files="@(TensorFlowArchive->'%(ExtractSemaphore)')" AlwaysCreate="true" />
85-
86-
<ItemGroup>
87-
<FileWrites Include="%(TensorFlowArchive.ExtractDirectory)\**\*" />
88-
</ItemGroup>
89-
</Target>
90-
91-
<!-- Clean up empty directories left behind by clean, since it otherwise would not do this -->
92-
<Target Name="CleanExtractDirectories"
93-
BeforeTargets="AfterClean"
94-
DependsOnTargets="PrepareArchives">
95-
<RemoveDir Directories="@(TensorFlowArchive->'%(ExtractDirectory)')" />
9681
</Target>
9782

9883
<!-- Select the files we want to copy out of each archive. -->
@@ -119,15 +104,14 @@
119104
<Target Name="CopyFilesFromArchive"
120105
DependsOnTargets="GetFilesFromArchive">
121106
<Copy SourceFiles="@(FilesFromArchive)"
122-
DestinationFiles="@(FilesFromArchive->'%(TargetPath)')">
123-
<Output TaskParameter="DestinationFiles" ItemName="FileWrites" />
124-
</Copy>
107+
DestinationFiles="@(FilesFromArchive->'%(TargetPath)')" />
125108
</Target>
126109

127-
<!-- Define CoreCompile to do the work of downloading and copying assets -->
128-
<Target Name="CoreCompile"
110+
<!-- Define Build to do the work of downloading and copying assets -->
111+
<Target Name="Build"
129112
DependsOnTargets="CopyFilesFromArchive" />
130113

131-
<!-- required by common targets -->
132-
<Target Name="CreateManifestResourceNames" />
114+
<Target Name="Clean">
115+
<RemoveDir Directories="$(IntermediateOutputPath)" />
116+
</Target>
133117
</Project>

0 commit comments

Comments
 (0)