Skip to content

Commit bc7026f

Browse files
committed
Changed project file to use nuspec file
1 parent 1b5445c commit bc7026f

File tree

2 files changed

+47
-32
lines changed

2 files changed

+47
-32
lines changed

src/TensorFlowNET.Redist/TensorFlowNET.Redist.nupkgproj

Lines changed: 21 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -2,50 +2,38 @@
22

33
<PropertyGroup>
44
<ProjDir>$(MSBuildThisFileDirectory)</ProjDir>
5-
<BinDir>$(ProjRoot)bin\</BinDir>
6-
<ObjDir>$(ProjRoot)obj\</ObjDir>
7-
<PackageAssetsPath>$(BinDir)packages\</PackageAssetsPath>
8-
5+
<BinDir>$(ProjDir)bin\</BinDir>
6+
<ObjDir>$(ProjDir)obj\</ObjDir>
97

10-
<NoBuild>true</NoBuild>
11-
<IncludeBuildOutput>false</IncludeBuildOutput>
12-
138
<TargetArchitecture Condition="'$(TargetArchitecture)' == ''">x64</TargetArchitecture>
149
<TargetFramework>netstandard2.0</TargetFramework>
1510
<TensorFlowVersion>1.14.0</TensorFlowVersion>
1611
<TensorFlowMajorVersion>1</TensorFlowMajorVersion>
1712

13+
<PackageAssetsPath>$(BinDir)packages\</PackageAssetsPath>
14+
<PackageId>$(MSBuildProjectName)</PackageId>
15+
<PackageVersion>0.15.0</PackageVersion>
16+
17+
<NoBuild>true</NoBuild>
18+
<IncludeBuildOutput>false</IncludeBuildOutput>
19+
20+
<NuspecFile>Redist.nuspec</NuspecFile>
21+
<NuspecProperties>packageId=$(PackageId);version=$(PackageVersion)</NuspecProperties>
22+
<NuspecBasePath>$(ProjDir)</NuspecBasePath>
23+
1824
<GenerateNuspecDependsOn>CopyFilesFromArchive</GenerateNuspecDependsOn>
19-
25+
2026
<PackageRid Condition="'$(OS)' == 'Windows_NT'">win</PackageRid>
2127
<PackageRid Condition="'$(OS)' != 'Windows_NT'">linux</PackageRid>
2228
<PackageRid Condition="$([MSBuild]::IsOSPlatform('osx'))">osx</PackageRid>
2329
<PackageRid>$(PackageRid)-$(TargetArchitecture)</PackageRid>
2430

25-
<PackageId>TensorFlowNET.Redist</PackageId>
26-
<Authors>The TensorFlow Authors</Authors>
27-
<TargetFramework>netstandard2.0</TargetFramework>
28-
<PackageDescription>$(MSBuildProjectName) contains the TensorFlow C library version $(TensorFlowVersion) redistributed as a NuGet package.</PackageDescription>
29-
<PackageLicenseFile>LICENSE.txt</PackageLicenseFile>
30-
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
31-
<Copyright>Copyright 2019 The TensorFlow Authors. All rights reserved.</Copyright>
32-
<PackageProjectUrl>https://www.tensorflow.org</PackageProjectUrl>
33-
<PackageReleaseNotes>https://github.com/tensorflow/tensorflow/releases/tag/v$(TensorFlowVersion)</PackageReleaseNotes>
34-
<PackageTags>$(PackageTags) TensorFlow</PackageTags>
35-
<!-- TODO: consider PackageIconUrl -->
3631
</PropertyGroup>
3732

3833
<PropertyGroup>
3934
<IncludeMLNetNotices>false</IncludeMLNetNotices>
4035
</PropertyGroup>
4136

42-
<ItemGroup>
43-
<Content Include="CommonPackage.props" Pack="true" PackagePath="build\netstandard2.0\$(MSBuildProjectName).props" />
44-
<Content Include="$(PackageAssetsPath)$(PackageId)\LICENSE.txt" Pack="true" PackagePath="" />
45-
<Content Condition="Exists('$(PackageAssetsPath)\$(PackageId)\THIRD_PARTY_NOTICES.txt')" Include="$(PackageAssetsPath)\$(PackageId)\THIRD_PARTY_NOTICES.txt" Pack="true" PackagePath="" />
46-
<Content Include="$(PackageAssetsPath)$(PackageId)\runtimes\**\*" Pack="true" PackagePath="runtimes" />
47-
</ItemGroup>
48-
4937
<ItemGroup>
5038
<TensorFlowConfig Include="windows"
5139
FileExtension=".zip"
@@ -143,13 +131,13 @@
143131

144132
<Message Importance="High" Text="Decompressing '%(TensorFlowArchive.DownloadFile)' to '%(TensorFlowArchive.ExtractDirectory)'." />
145133

146-
<Unzip Condition="'$(PackageRid)' == 'win-x64'"
134+
<Unzip Condition="'%(TensorFlowArchive.FileExtension)' == '.zip'"
147135
SourceFiles="%(TensorFlowArchive.DownloadFile)"
148136
DestinationFolder="%(TensorFlowArchive.ExtractDirectory)" />
149137

150-
<Exec Condition="'$(OS)' != 'Windows_NT'"
151-
WorkingDirectory="%(TensorFlowArchive.ExtractDirectory)"
152-
Command="tar -xzmf %(TensorFlowArchive.DownloadFile) -C %(TensorFlowArchive.ExtractDirectory)" />
138+
<Exec Condition="'$(OS)' != 'Windows_NT' AND '%(TensorFlowArchive.FileExtension)' == '.tar.gz'"
139+
WorkingDirectory="$(MSBuildThisFileDirectory)"
140+
Command="tar -xzmv --hard-dereference -f %(TensorFlowArchive.DownloadFile) -C %(TensorFlowArchive.ExtractDirectory)" />
153141

154142
<Touch Files="@(TensorFlowArchive->'%(ExtractSemaphore)')" AlwaysCreate="true" />
155143
</Target>
@@ -174,14 +162,15 @@
174162
TargetPath="$(PackageAssetsPath)$(MSBuildProjectName)\LICENSE.txt" />
175163

176164
<!-- copy to NativeAssets location, only for current RID, so that they may be used by tests -->
177-
<FilesFromArchive Condition="'$(PackageRID)' == '%(_fileFromArchive.Runtime)'"
165+
<!--<FilesFromArchive Condition="'$(PackageRID)' == '%(_fileFromArchive.Runtime)'"
178166
Include="@(_fileFromArchive->'%(ExtractDirectory)\%(Identity)')"
179-
TargetPath="$(NativeAssetsBuiltPath)\%(_fileFromArchive.DestinationFile)" />
167+
TargetPath="$(NativeAssetsBuiltPath)\%(_fileFromArchive.DestinationFile)" />-->
180168
</ItemGroup>
181169
</Target>
182170

183171
<Target Name="CopyFilesFromArchive"
184172
DependsOnTargets="GetFilesFromArchive">
173+
185174
<Message Importance="High" Text="@(FilesFromArchive) -> %(FilesFromArchive.TargetPath)" />
186175
<Copy SourceFiles="@(FilesFromArchive)"
187176
DestinationFiles="@(FilesFromArchive->'%(TargetPath)')" />
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<package xmlns="http://schemas.microsoft.com/packaging/2012/06/nuspec.xsd">
3+
<metadata>
4+
<id>$packageId$</id>
5+
<version>$version$</version>
6+
<authors>The TensorFlow Authors</authors>
7+
<owners>The TensorFlow Authors</owners>
8+
<requireLicenseAcceptance>true</requireLicenseAcceptance>
9+
<license type="file">LICENSE.txt</license>
10+
<licenseUrl>https://aka.ms/deprecateLicenseUrl</licenseUrl>
11+
<projectUrl>https://www.tensorflow.org/</projectUrl>
12+
<description>TensorFlowNET.Redist contains the TensorFlow C library version 1.14.0 redistributed as a NuGet package.</description>
13+
<releaseNotes>https://github.com/tensorflow/tensorflow/releases/tag/v1.14.0</releaseNotes>
14+
<copyright>Copyright 2019 The TensorFlow Authors. All rights reserved.</copyright>
15+
<tags>TensorFlow</tags>
16+
<dependencies>
17+
<group targetFramework=".NETStandard2.0" />
18+
</dependencies>
19+
</metadata>
20+
<files>
21+
<file src="CommonPackage.props" target="build\netstandard2.0\TensorFlowNET.Redist.props" />
22+
<file src="bin\packages\TensorFlowNET.Redist\LICENSE.txt" target="LICENSE.txt" />
23+
<file src="bin\packages\TensorFlowNET.Redist\THIRD_PARTY_NOTICES.txt" target="THIRD_PARTY_NOTICES.txt" />
24+
<file src="bin\packages\TensorFlowNET.Redist\runtimes\**\*" target="runtimes" />
25+
</files>
26+
</package>

0 commit comments

Comments
 (0)