From ad69ecbcc8aed7fc7cd0f76ec64112e417e90591 Mon Sep 17 00:00:00 2001 From: Eric Erhardt Date: Sun, 17 Mar 2019 10:08:13 +0900 Subject: [PATCH] ARROW-4839: [C#] Add NuGet package metadata and instructions. This change adds the necessary changes for creating the `Apache.Arrow` nuget package. 1. I've updated the `.csproj` with what I think is the correct package metadata. Please take a look and give any feedback on what I got wrong. 2. I've added instructions to the README on how to build the NuGet package. By default, this will produce a `-preview` version of the package. You need to explicitly opt into creating a "stable" version by passing in `-p:VersionSuffix=''`. 3. I've enabled strong naming on the library, which is a recommendation according to the [.NET Open-source library guidance](https://docs.microsoft.com/en-us/dotnet/standard/library-guidance/strong-naming). - Note that "strong naming" isn't a security feature - it is just about creating a unique identity for the library. /cc @stephentoub @ericstj @pgovind @chutchinson @wesm Author: Eric Erhardt Closes #3891 from eerhardt/NuGetPackage and squashes the following commits: 8c0f6805 PR feedback 89f630be Remove pack call from CI b3c6ab87 Respond to PR feedback. f4bb1938 fix up prepare script to escape correctly 1566f40a PR feedback c7a9d8da Enable strong naming on the Apache.Arrow C# library. 5c31e1da ARROW-4839: Add NuGet package metadata and instructions. --- csharp/ApacheArrow.snk | Bin 0 -> 596 bytes csharp/Directory.Build.props | 41 ++++++++++++++++++ csharp/README.md | 28 ++++++++++-- csharp/build/Common.props | 5 --- csharp/src/Apache.Arrow/Apache.Arrow.csproj | 21 +++------ .../Apache.Arrow.Benchmarks.csproj | 1 - .../Apache.Arrow.Tests.csproj | 3 -- csharp/test/Directory.Build.props | 9 ++++ dev/release/00-prepare.sh | 8 ++++ dev/release/rat_exclude_files.txt | 3 +- 10 files changed, 91 insertions(+), 28 deletions(-) create mode 100644 csharp/ApacheArrow.snk create mode 100644 csharp/Directory.Build.props delete mode 100644 csharp/build/Common.props create mode 100644 csharp/test/Directory.Build.props diff --git a/csharp/ApacheArrow.snk b/csharp/ApacheArrow.snk new file mode 100644 index 0000000000000000000000000000000000000000..68df43972d8d2810d8bd5bfc59928bd3e9a4503f GIT binary patch literal 596 zcmV-a0;~N80ssI2Bme+XQ$aES1ONa50098y1Q5+EU_*(r>PEbdaKig5!%G^U&{??8!Dn@kPGxJ=l29?{F!x8qz)bi zdA0?rAc&-4^2QbBtFG=4qGvpd^Log=$IcrTqs6(3qLHF(r4)xdTO+{F2nW z2#zqV8Z%e8+JOLid-mLU$Z}1f?|ieLss|u#p51%%o90py=buTu2hleEG1Ec5`Gaud zOl{%S2Q0@Dy#)B*p21I6*ibJ2mx!M=)L^!Vx5v)No;(B6ri=C zGK?m^h~%ko_$LMzmCCE~(>2Z;$m^Ya3ZtFaN}lj0Mb}0(28eL7?yvZ@0hEvl9s5VP zOzZmn*!oa6YdX)1kU$lo4MCW@1U$ZDf@9;m@c3syLJln*7tPW{3^c6@6eOk7KG44v zw}{~(-$)gq+F@T!J($SB{p4DHJd|~)ZA#JwB#1&< zjs|n6p7nLTt|kO2&&!dC!hcNRqk7P$2Hw^R+~%C=zni + + + + $(MSBuildThisFileDirectory)../ + $(MSBuildThisFileDirectory) + $(CSharpDir)/artifacts/$(MSBuildProjectName) + + + + + Apache Arrow library + 2018 Apache Software Foundation + Apache + 0.13.0-SNAPSHOT + + + + 7.2 + true + $(CSharpDir)ApacheArrow.snk + + + + + Apache + https://www.apache.org/images/feather.png + LICENSE.txt + https://arrow.apache.org/ + apache arrow + git + https://github.com/apache/arrow + true + snupkg + + + + + + + \ No newline at end of file diff --git a/csharp/README.md b/csharp/README.md index 121a4b25847bd..1eeec818a2e22 100644 --- a/csharp/README.md +++ b/csharp/README.md @@ -135,17 +135,39 @@ This implementation is under development and may not be suitable for use in prod # Build +Install the latest `.NET Core SDK` from https://dotnet.microsoft.com/download. + dotnet build -# Docker Build +## NuGet Build + +To build the NuGet package run the following command to build a debug flavor, preview package into the **artifacts** folder. + + dotnet pack + +When building the officially released version run: (see Note below about current `git` repository) + + dotnet pack -c Release + +Which will build the final/stable package. + +NOTE: When building the officially released version, ensure that your `git` repository has the `origin` remote set to `https://github.com/apache/arrow.git`, which will ensure Source Link is set correctly. See https://github.com/dotnet/sourcelink/blob/master/docs/README.md for more information. + +There are two output artifacts: +1. `Apache.Arrow..nupkg` - this contains the exectuable assemblies +2. `Apache.Arrow..snupkg` - this contains the debug symbols files + +Both of these artifacts can then be uploaded to https://www.nuget.org/packages/manage/upload. + +## Docker Build Build from the Apache Arrow project root. docker build -f csharp/build/docker/Dockerfile . -# Testing +## Testing - dotnet test test/Apache.Arrow.Tests + dotnet test All build artifacts are placed in the **artifacts** folder in the project root. diff --git a/csharp/build/Common.props b/csharp/build/Common.props deleted file mode 100644 index cebd07cf46157..0000000000000 --- a/csharp/build/Common.props +++ /dev/null @@ -1,5 +0,0 @@ - - - ../../artifacts/$(AssemblyName) - - \ No newline at end of file diff --git a/csharp/src/Apache.Arrow/Apache.Arrow.csproj b/csharp/src/Apache.Arrow/Apache.Arrow.csproj index fde9df7d5c61f..9086c83b3c207 100644 --- a/csharp/src/Apache.Arrow/Apache.Arrow.csproj +++ b/csharp/src/Apache.Arrow/Apache.Arrow.csproj @@ -1,28 +1,19 @@  - - netstandard1.3;netcoreapp2.1 - 7.2 true - Apache - Apache Arrow library - 2018 Apache Software Foundation - https://fzcorp.visualstudio.com/digital-products - https://fzcorp.visualstudio.com/digital-products/_git/fz-arrow - git - apache arrow - Apache - 0.0.1 $(DefineConstants);UNSAFE_BYTEBUFFER;BYTEBUFFER_NO_BOUNDS_CHECK;ENABLE_SPAN_T + + Apache Arrow is a cross-language development platform for in-memory data. It specifies a standardized language-independent columnar memory format for flat and hierarchical data, organized for efficient analytic operations on modern hardware. - - - + + + + diff --git a/csharp/test/Apache.Arrow.Benchmarks/Apache.Arrow.Benchmarks.csproj b/csharp/test/Apache.Arrow.Benchmarks/Apache.Arrow.Benchmarks.csproj index f74af09278070..c451bda71f21a 100644 --- a/csharp/test/Apache.Arrow.Benchmarks/Apache.Arrow.Benchmarks.csproj +++ b/csharp/test/Apache.Arrow.Benchmarks/Apache.Arrow.Benchmarks.csproj @@ -3,7 +3,6 @@ Exe netcoreapp2.1 - latest diff --git a/csharp/test/Apache.Arrow.Tests/Apache.Arrow.Tests.csproj b/csharp/test/Apache.Arrow.Tests/Apache.Arrow.Tests.csproj index d29279b330a9b..c8dd0de6c551a 100644 --- a/csharp/test/Apache.Arrow.Tests/Apache.Arrow.Tests.csproj +++ b/csharp/test/Apache.Arrow.Tests/Apache.Arrow.Tests.csproj @@ -1,12 +1,9 @@  - - netcoreapp2.1 true - 7.3 diff --git a/csharp/test/Directory.Build.props b/csharp/test/Directory.Build.props new file mode 100644 index 0000000000000..a643e49344b7a --- /dev/null +++ b/csharp/test/Directory.Build.props @@ -0,0 +1,9 @@ + + + + + + false + + + \ No newline at end of file diff --git a/dev/release/00-prepare.sh b/dev/release/00-prepare.sh index 8596892de5037..9e0a89b6e95e1 100755 --- a/dev/release/00-prepare.sh +++ b/dev/release/00-prepare.sh @@ -56,6 +56,14 @@ update_versions() { git add configure.ac meson.build cd - + cd "${SOURCE_DIR}/../../csharp" + sed -i.bak -E -e \ + "s/^ .+<\/Version>/ ${version}<\/Version>/" \ + Directory.Build.props + rm -f Directory.Build.props.bak + git add Directory.Build.props + cd - + # We can enable this when Arrow JS uses the same version. # cd "${SOURCE_DIR}/../../js" # sed -i.bak -E -e \ diff --git a/dev/release/rat_exclude_files.txt b/dev/release/rat_exclude_files.txt index dd6169e39906e..b0040eff2bf1e 100644 --- a/dev/release/rat_exclude_files.txt +++ b/dev/release/rat_exclude_files.txt @@ -166,14 +166,15 @@ c_glib/doc/plasma-glib/plasma-glib-overrides.txt c_glib/gtk-doc.make csharp/.gitattributes csharp/src/Apache.Arrow/Flatbuf/* -csharp/build/Common.props csharp/Apache.Arrow.sln +csharp/Directory.Build.props csharp/src/Apache.Arrow/Apache.Arrow.csproj csharp/src/Apache.Arrow/Properties/Resources.Designer.cs csharp/src/Apache.Arrow/Properties/Resources.resx csharp/test/Apache.Arrow.Benchmarks/Apache.Arrow.Benchmarks.csproj csharp/test/Apache.Arrow.Tests/Apache.Arrow.Tests.csproj csharp/test/Apache.Arrow.Tests/app.config +csharp/test/Directory.Build.props *.html *.sgml *.css