Skip to content

Commit c0a67ea

Browse files
author
Gilad Levi
committed
for packing win/linux nuget
1 parent 1176fcf commit c0a67ea

4 files changed

Lines changed: 14 additions & 27 deletions

File tree

RocksDbNative/RocksDbNative.csproj

Lines changed: 12 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<Import Project="..\Versions.targets.include"/>
33
<PropertyGroup>
44
<Title>RocksDbNative</Title>
5-
<TargetFrameworks>netstandard1.6;net40;net45</TargetFrameworks>
5+
<TargetFrameworks>netstandard1.6</TargetFrameworks>
66
<Version>$(RocksDbVersion).$(RocksDbNativeBuild)</Version>
77
<AssemblyVersion>$(Version)</AssemblyVersion>
88
<FileVersion>$(Version)</FileVersion>
@@ -21,9 +21,9 @@
2121
</PropertyGroup>
2222
<!-- "DispatchToInnerBuilds" will cause this to run in the outer build (i.e. once regardless of number of frameworks) -->
2323
<!-- Condition="!Exists('rocksdb-$(RocksDbVersion)\runtimes\win-x64\native\rocksdb.dll') and !Exists('$(BaseIntermediateOutputPath)\rocksdb-v$(RocksDbVersion)-win-x64.zip')" -->
24-
<Target Name="DownloadNativeLibs" BeforeTargets="DispatchToInnerBuilds">
24+
<!--Target Name="DownloadNativeLibs" BeforeTargets="DispatchToInnerBuilds"-->
2525
<!-- Here we download the native libraries from the rocksdb-sharp-native project releases according to the version number, if they don't exist -->
26-
<DownloadFile
26+
<!--DownloadFile
2727
Condition="!Exists('$(BaseIntermediateOutputPath)rocksdb-$(RocksDbVersion)\runtimes\%(NativeLib.RuntimeId)\native\%(NativeLib.Lib)') And !Exists('$(BaseIntermediateOutputPath)rocksdb-v$(RocksDbVersion)-%(NativeLib.RuntimeId).zip')"
2828
SourceUrl="https://github.com/warrenfalk/rocksdb-sharp-native/releases/download/v$(RocksDbVersion)/rocksdb-v$(RocksDbVersion)-%(NativeLib.RuntimeId).zip"
2929
DestinationFolder="$(BaseIntermediateOutputPath)">
@@ -33,36 +33,27 @@
3333
SourceFiles="$(BaseIntermediateOutputPath)rocksdb-v$(RocksDbVersion)-%(NativeLib.RuntimeId).zip"
3434
DestinationFolder="$(BaseIntermediateOutputPath)rocksdb-$(RocksDbVersion)\runtimes\%(NativeLib.RuntimeId)\native\">
3535
</Unzip>
36-
</Target>
36+
</Target-->
3737
<ItemGroup>
3838
<!-- Define the native libraries here -->
3939
<!-- The "Include" attribute is a required attribute in ItemGroups outside of Targets, but I don't know why -->
40-
<NativeLib Include="%(RuntimeId)-%(Lib)" RuntimeId="win-x64" Lib="rocksdb.dll" />
41-
<NativeLib Include="%(RuntimeId)-%(Lib)" RuntimeId="linux-x64" Lib="librocksdb.so" />
42-
<NativeLib Include="%(RuntimeId)-%(Lib)" RuntimeId="osx-x64" Lib="librocksdb.dylib" />
40+
<!--NativeLib Include="%(RuntimeId)-%(Lib)" RuntimeId="win-x64" Lib="rocksdb.dll" /-->
41+
<!--NativeLib Include="%(RuntimeId)-%(Lib)" RuntimeId="osx-x64" Lib="librocksdb.dylib" /-->
4342
<!-- This "Content" is applied for all "NativeLib" and ensures that it is packaged into the correct folder -->
4443
<!-- This also will cause it to be copied to the output directory, which was so far the only way to get it
4544
to work correctly when referenced using a ProjectReference. When packaged as a nupkg and referenced
4645
with PackageReference, then these go to the runtimes folders in the nuget cache, which is enough for
4746
standard consumers, but framework consumers get them copied from the nuget cache to the output via
4847
the .targets files for those frameworks.-->
49-
<Content
50-
Include="@(NativeLib -> '$(BaseIntermediateOutputPath)rocksdb-$(RocksDbVersion)\runtimes\%(RuntimeId)\native\%(Lib)')"
51-
PackagePath="runtimes\%(RuntimeId)\native\%(Lib)"
52-
Link="runtimes\%(RuntimeId)\native\%(Lib)">
48+
<None Include="librocksdb.so">
5349
<Pack>true</Pack>
54-
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
55-
</Content>
56-
<!-- These target files take care of copying from the nuget cache area into the output folder as required
57-
by the .Net Framework frameworks -->
58-
<None Remove="build\**" />
59-
<None Include="build\net40\RocksDbNative.targets">
60-
<Pack>true</Pack>
61-
<PackagePath>build/net40</PackagePath>
50+
<PackagePath>runtimes/linux-x64/native</PackagePath>
6251
</None>
63-
<None Include="build\net45\RocksDbNative.targets">
52+
53+
<None Include="rocksdb.dll">
6454
<Pack>true</Pack>
65-
<PackagePath>build/net45</PackagePath>
55+
<PackagePath>runtimes/win-x64/native</PackagePath>
6656
</None>
57+
6758
</ItemGroup>
6859
</Project>

RocksDbNative/rocksdb.dll

5.4 MB
Binary file not shown.

RocksDbSharp/RocksDbSharp.csproj

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<Import Project="..\Versions.targets.include"/>
33
<PropertyGroup>
44
<Title>RocksDbSharp</Title>
5-
<TargetFrameworks>netstandard1.6;net40;net45</TargetFrameworks>
5+
<TargetFrameworks>netstandard1.6</TargetFrameworks>
66
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
77
<Version>$(RocksDbVersion).$(RocksDbSharpBuild)</Version>
88
<AssemblyVersion>$(Version)</AssemblyVersion>
@@ -32,10 +32,6 @@
3232
<DefineConstants>TRACE</DefineConstants>
3333
</PropertyGroup>
3434

35-
<ItemGroup Condition="'$(TargetFramework)' == 'net40'">
36-
<Reference Include="Microsoft.CSharp" />
37-
</ItemGroup>
38-
3935
<!-- Move all packages here that complain about compatibility with net40 -->
4036
<ItemGroup Condition="'$(TargetFramework)' != 'net40'">
4137
<PackageReference Include="Microsoft.CSharp" Version="4.3.0" />

Versions.targets.include

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<Project>
22
<PropertyGroup>
3-
<RocksDbVersion>6.2.2</RocksDbVersion>
3+
<RocksDbVersion>6.6.3</RocksDbVersion>
44
<RocksDbSharpBuild>0</RocksDbSharpBuild>
55
<RocksDbNativeBuild>0</RocksDbNativeBuild>
66
</PropertyGroup>

0 commit comments

Comments
 (0)