From 5c31e1daab80f128f989d9ca4e7dc97852cafb4a Mon Sep 17 00:00:00 2001 From: Eric Erhardt Date: Tue, 12 Mar 2019 22:18:15 -0500 Subject: [PATCH 1/7] ARROW-4839: [C#] Add NuGet package metadata and instructions. --- ci/appveyor-csharp-build.bat | 2 ++ csharp/README.md | 28 +++++++++++++++-- csharp/src/Apache.Arrow/Apache.Arrow.csproj | 35 ++++++++++++++++----- csharp/test/Directory.Build.props | 5 +++ 4 files changed, 60 insertions(+), 10 deletions(-) create mode 100644 csharp/test/Directory.Build.props diff --git a/ci/appveyor-csharp-build.bat b/ci/appveyor-csharp-build.bat index 14dc71d61cc..4f1d6d44c7a 100644 --- a/ci/appveyor-csharp-build.bat +++ b/ci/appveyor-csharp-build.bat @@ -21,4 +21,6 @@ pushd csharp dotnet test || exit /B +dotnet pack -c Release || exit /B + popd diff --git a/csharp/README.md b/csharp/README.md index 121a4b25847..1d8dbf8399e 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 -p:VersionSuffix='' + +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/src/Apache.Arrow/Apache.Arrow.csproj b/csharp/src/Apache.Arrow/Apache.Arrow.csproj index fde9df7d5c6..1c55f11efe1 100644 --- a/csharp/src/Apache.Arrow/Apache.Arrow.csproj +++ b/csharp/src/Apache.Arrow/Apache.Arrow.csproj @@ -2,20 +2,35 @@ + netstandard1.3;netcoreapp2.1 7.2 true - Apache + $(DefineConstants);UNSAFE_BYTEBUFFER;BYTEBUFFER_NO_BOUNDS_CHECK;ENABLE_SPAN_T + + + + 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 + 0.13.0 + preview + + + + + Apache + 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. It also provides computational libraries and zero-copy streaming messaging and interprocess communication. + https://www.apache.org/images/feather.png + LICENSE.txt + https://arrow.apache.org/ + apache arrow + git + https://github.com/apache/arrow + true + snupkg @@ -23,6 +38,8 @@ + + @@ -40,6 +57,10 @@ + + + + diff --git a/csharp/test/Directory.Build.props b/csharp/test/Directory.Build.props new file mode 100644 index 00000000000..a2119370ed1 --- /dev/null +++ b/csharp/test/Directory.Build.props @@ -0,0 +1,5 @@ + + + false + + \ No newline at end of file From c7a9d8dab2f16bdb9bd0de91eae0ab1fc6dd7abb Mon Sep 17 00:00:00 2001 From: Eric Erhardt Date: Wed, 13 Mar 2019 13:03:40 -0500 Subject: [PATCH 2/7] Enable strong naming on the Apache.Arrow C# library. --- csharp/ApacheArrow.snk | Bin 0 -> 596 bytes csharp/src/Apache.Arrow/Apache.Arrow.csproj | 2 ++ 2 files changed, 2 insertions(+) create mode 100644 csharp/ApacheArrow.snk 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=zni7.2 true $(DefineConstants);UNSAFE_BYTEBUFFER;BYTEBUFFER_NO_BOUNDS_CHECK;ENABLE_SPAN_T + true + ..\..\ApacheArrow.snk From 1566f40a05afe693ae79206c91a68fa10cc5cf0e Mon Sep 17 00:00:00 2001 From: Eric Erhardt Date: Thu, 14 Mar 2019 11:00:50 -0500 Subject: [PATCH 3/7] PR feedback - Add csharp version update to the prepare script. To do this correctly, I decided to refactor the .csproj and .props files so the common msbuild properties are in a root Directory.Build.props file. - Adjust the Description of the Apache.Arrow library. - Add the new xml files to the rat_exclude list. --- csharp/Directory.Build.props | 42 +++++++++++++++++++ csharp/build/Common.props | 5 --- csharp/src/Apache.Arrow/Apache.Arrow.csproj | 35 +--------------- .../Apache.Arrow.Benchmarks.csproj | 1 - .../Apache.Arrow.Tests.csproj | 3 -- csharp/test/Directory.Build.props | 4 ++ dev/release/00-prepare.sh | 8 ++++ dev/release/rat_exclude_files.txt | 3 +- 8 files changed, 58 insertions(+), 43 deletions(-) create mode 100644 csharp/Directory.Build.props delete mode 100644 csharp/build/Common.props diff --git a/csharp/Directory.Build.props b/csharp/Directory.Build.props new file mode 100644 index 00000000000..fde2ea8181b --- /dev/null +++ b/csharp/Directory.Build.props @@ -0,0 +1,42 @@ + + + + + $(MSBuildThisFileDirectory)../ + $(MSBuildThisFileDirectory) + $(CSharpDir)/artifacts/$(AssemblyName) + + + + + Apache Arrow library + 2018 Apache Software Foundation + Apache + 0.13.0 + preview + + + + 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/build/Common.props b/csharp/build/Common.props deleted file mode 100644 index cebd07cf461..00000000000 --- 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 32b0ad31209..7534cd84b9c 100644 --- a/csharp/src/Apache.Arrow/Apache.Arrow.csproj +++ b/csharp/src/Apache.Arrow/Apache.Arrow.csproj @@ -1,38 +1,11 @@  - - - netstandard1.3;netcoreapp2.1 - 7.2 true $(DefineConstants);UNSAFE_BYTEBUFFER;BYTEBUFFER_NO_BOUNDS_CHECK;ENABLE_SPAN_T - true - ..\..\ApacheArrow.snk - - - - - Apache Arrow library - 2018 Apache Software Foundation - Apache - 0.13.0 - preview - - - - - Apache - 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. It also provides computational libraries and zero-copy streaming messaging and interprocess communication. - https://www.apache.org/images/feather.png - LICENSE.txt - https://arrow.apache.org/ - apache arrow - git - https://github.com/apache/arrow - true - snupkg + + 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. @@ -59,10 +32,6 @@ - - - - diff --git a/csharp/test/Apache.Arrow.Benchmarks/Apache.Arrow.Benchmarks.csproj b/csharp/test/Apache.Arrow.Benchmarks/Apache.Arrow.Benchmarks.csproj index f74af092780..c451bda71f2 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 d29279b330a..c8dd0de6c55 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 index a2119370ed1..a643e49344b 100644 --- a/csharp/test/Directory.Build.props +++ b/csharp/test/Directory.Build.props @@ -1,5 +1,9 @@ + + + false + \ No newline at end of file diff --git a/dev/release/00-prepare.sh b/dev/release/00-prepare.sh index 8596892de50..181e24b331b 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/^ .+/set ${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 dd6169e3990..b0040eff2bf 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 From f4bb1938ceebd10430640ec212b4deb210daaf51 Mon Sep 17 00:00:00 2001 From: Eric Erhardt Date: Thu, 14 Mar 2019 11:54:39 -0500 Subject: [PATCH 4/7] fix up prepare script to escape correctly --- dev/release/00-prepare.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev/release/00-prepare.sh b/dev/release/00-prepare.sh index 181e24b331b..f8a5eddff8b 100755 --- a/dev/release/00-prepare.sh +++ b/dev/release/00-prepare.sh @@ -58,7 +58,7 @@ update_versions() { cd "${SOURCE_DIR}/../../csharp" sed -i.bak -E -e \ - "s/^ .+/set ${version}/" \ + "s/^ .+<\/VersionPrefix>/ ${version}<\/VersionPrefix>/" \ Directory.Build.props rm -f Directory.Build.props.bak git add Directory.Build.props From b3c6ab872625f20e7def7a6cb791e28fdd9a1f86 Mon Sep 17 00:00:00 2001 From: Eric Erhardt Date: Thu, 14 Mar 2019 12:47:19 -0500 Subject: [PATCH 5/7] Respond to PR feedback. - Use latest serviced version for dependencies. - Remove one unnecessary dependency. --- csharp/src/Apache.Arrow/Apache.Arrow.csproj | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/csharp/src/Apache.Arrow/Apache.Arrow.csproj b/csharp/src/Apache.Arrow/Apache.Arrow.csproj index 7534cd84b9c..9086c83b3c2 100644 --- a/csharp/src/Apache.Arrow/Apache.Arrow.csproj +++ b/csharp/src/Apache.Arrow/Apache.Arrow.csproj @@ -10,9 +10,8 @@ - - - + + From 89f630bed07980e1e9f76dd3043e684838f14134 Mon Sep 17 00:00:00 2001 From: Eric Erhardt Date: Fri, 15 Mar 2019 09:50:59 -0500 Subject: [PATCH 6/7] Remove pack call from CI Work around https://github.com/NuGet/Home/issues/7591 until CI gets the updated SDK version. --- ci/appveyor-csharp-build.bat | 2 -- 1 file changed, 2 deletions(-) diff --git a/ci/appveyor-csharp-build.bat b/ci/appveyor-csharp-build.bat index 4f1d6d44c7a..14dc71d61cc 100644 --- a/ci/appveyor-csharp-build.bat +++ b/ci/appveyor-csharp-build.bat @@ -21,6 +21,4 @@ pushd csharp dotnet test || exit /B -dotnet pack -c Release || exit /B - popd From 8c0f68056a620f1dfc53f31bd38bc128109dbdd3 Mon Sep 17 00:00:00 2001 From: Eric Erhardt Date: Fri, 15 Mar 2019 10:10:00 -0500 Subject: [PATCH 7/7] PR feedback - Handle csharp versioning like the rest of the project using SNAPSHOT suffix for non-release commits, and no suffix for release tags. - Also, fixing a small error with the artifacts folder, AssemblyName isn't set at this time, so use MSBuildProjectName. --- csharp/Directory.Build.props | 5 ++--- csharp/README.md | 2 +- dev/release/00-prepare.sh | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/csharp/Directory.Build.props b/csharp/Directory.Build.props index fde2ea8181b..1917fb6786d 100644 --- a/csharp/Directory.Build.props +++ b/csharp/Directory.Build.props @@ -4,7 +4,7 @@ $(MSBuildThisFileDirectory)../ $(MSBuildThisFileDirectory) - $(CSharpDir)/artifacts/$(AssemblyName) + $(CSharpDir)/artifacts/$(MSBuildProjectName) @@ -12,8 +12,7 @@ Apache Arrow library 2018 Apache Software Foundation Apache - 0.13.0 - preview + 0.13.0-SNAPSHOT diff --git a/csharp/README.md b/csharp/README.md index 1d8dbf8399e..1eeec818a2e 100644 --- a/csharp/README.md +++ b/csharp/README.md @@ -147,7 +147,7 @@ To build the NuGet package run the following command to build a debug flavor, pr When building the officially released version run: (see Note below about current `git` repository) - dotnet pack -c Release -p:VersionSuffix='' + dotnet pack -c Release Which will build the final/stable package. diff --git a/dev/release/00-prepare.sh b/dev/release/00-prepare.sh index f8a5eddff8b..9e0a89b6e95 100755 --- a/dev/release/00-prepare.sh +++ b/dev/release/00-prepare.sh @@ -58,7 +58,7 @@ update_versions() { cd "${SOURCE_DIR}/../../csharp" sed -i.bak -E -e \ - "s/^ .+<\/VersionPrefix>/ ${version}<\/VersionPrefix>/" \ + "s/^ .+<\/Version>/ ${version}<\/Version>/" \ Directory.Build.props rm -f Directory.Build.props.bak git add Directory.Build.props