This is an automated email from the ASF dual-hosted git repository. kou pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/arrow.git
The following commit(s) were added to refs/heads/master by this push: new ad69ecb ARROW-4839: [C#] Add NuGet package metadata and instructions. ad69ecb is described below commit ad69ecbcc8aed7fc7cd0f76ec64112e417e90591 Author: Eric Erhardt <eric.erha...@microsoft.com> AuthorDate: Sun Mar 17 10:08:13 2019 +0900 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 <eric.erha...@microsoft.com> Closes #3891 from eerhardt/NuGetPackage and squashes the following commits: 8c0f6805 <Eric Erhardt> PR feedback 89f630be <Eric Erhardt> Remove pack call from CI b3c6ab87 <Eric Erhardt> Respond to PR feedback. f4bb1938 <Eric Erhardt> fix up prepare script to escape correctly 1566f40a <Eric Erhardt> PR feedback c7a9d8da <Eric Erhardt> Enable strong naming on the Apache.Arrow C# library. 5c31e1da <Eric Erhardt> 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/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(-) diff --git a/csharp/ApacheArrow.snk b/csharp/ApacheArrow.snk new file mode 100644 index 0000000..68df439 Binary files /dev/null and b/csharp/ApacheArrow.snk differ diff --git a/csharp/Directory.Build.props b/csharp/Directory.Build.props new file mode 100644 index 0000000..1917fb6 --- /dev/null +++ b/csharp/Directory.Build.props @@ -0,0 +1,41 @@ +<Project> + + <!-- Common repo directories --> + <PropertyGroup> + <RepoRoot>$(MSBuildThisFileDirectory)../</RepoRoot> + <CSharpDir>$(MSBuildThisFileDirectory)</CSharpDir> + <BaseOutputPath>$(CSharpDir)/artifacts/$(MSBuildProjectName)</BaseOutputPath> + </PropertyGroup> + + <!-- AssemblyInfo properties --> + <PropertyGroup> + <Product>Apache Arrow library</Product> + <Copyright>2018 Apache Software Foundation</Copyright> + <Company>Apache</Company> + <Version>0.13.0-SNAPSHOT</Version> + </PropertyGroup> + + <PropertyGroup> + <LangVersion>7.2</LangVersion> + <SignAssembly>true</SignAssembly> + <AssemblyOriginatorKeyFile>$(CSharpDir)ApacheArrow.snk</AssemblyOriginatorKeyFile> + </PropertyGroup> + + <!-- NuGet properties --> + <PropertyGroup> + <Authors>Apache</Authors> + <PackageIconUrl>https://www.apache.org/images/feather.png</PackageIconUrl> + <PackageLicenseFile>LICENSE.txt</PackageLicenseFile> + <PackageProjectUrl>https://arrow.apache.org/</PackageProjectUrl> + <PackageTags>apache arrow</PackageTags> + <RepositoryType>git</RepositoryType> + <RepositoryUrl>https://github.com/apache/arrow</RepositoryUrl> + <IncludeSymbols>true</IncludeSymbols> + <SymbolPackageFormat>snupkg</SymbolPackageFormat> + </PropertyGroup> + + <ItemGroup Condition="'$(IsPackable)' == 'true'"> + <Content Include="$(RepoRoot)LICENSE.txt" Pack="true" PackagePath="" /> + </ItemGroup> + +</Project> \ No newline at end of file diff --git a/csharp/README.md b/csharp/README.md index 121a4b2..1eeec81 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.<version>.nupkg` - this contains the exectuable assemblies +2. `Apache.Arrow.<version>.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 cebd07c..0000000 --- a/csharp/build/Common.props +++ /dev/null @@ -1,5 +0,0 @@ -<Project> - <PropertyGroup> - <BaseOutputPath>../../artifacts/$(AssemblyName)</BaseOutputPath> - </PropertyGroup> -</Project> \ 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 fde9df7..9086c83 100644 --- a/csharp/src/Apache.Arrow/Apache.Arrow.csproj +++ b/csharp/src/Apache.Arrow/Apache.Arrow.csproj @@ -1,28 +1,19 @@ <Project Sdk="Microsoft.NET.Sdk"> - <Import Project="../../build/Common.props" /> - <PropertyGroup> <TargetFrameworks>netstandard1.3;netcoreapp2.1</TargetFrameworks> - <LangVersion>7.2</LangVersion> <AllowUnsafeBlocks>true</AllowUnsafeBlocks> - <Authors>Apache</Authors> - <Product>Apache Arrow library</Product> - <Copyright>2018 Apache Software Foundation</Copyright> - <PackageProjectUrl>https://fzcorp.visualstudio.com/digital-products</PackageProjectUrl> - <RepositoryUrl>https://fzcorp.visualstudio.com/digital-products/_git/fz-arrow</RepositoryUrl> - <RepositoryType>git</RepositoryType> - <PackageTags>apache arrow</PackageTags> - <Company>Apache</Company> - <Version>0.0.1</Version> <DefineConstants>$(DefineConstants);UNSAFE_BYTEBUFFER;BYTEBUFFER_NO_BOUNDS_CHECK;ENABLE_SPAN_T</DefineConstants> + + <Description>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.</Description> </PropertyGroup> <ItemGroup> <PackageReference Include="System.Buffers" Version="4.5.0" /> - <PackageReference Include="System.Memory" Version="4.5.1" /> - <PackageReference Include="System.Runtime.CompilerServices.Unsafe" Version="4.5.1" /> - <PackageReference Include="System.Text.Encoding" Version="4.3.0" /> + <PackageReference Include="System.Memory" Version="4.5.2" /> + <PackageReference Include="System.Runtime.CompilerServices.Unsafe" Version="4.5.2" /> + + <PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0-beta2-18618-05" PrivateAssets="All" /> </ItemGroup> <ItemGroup> diff --git a/csharp/test/Apache.Arrow.Benchmarks/Apache.Arrow.Benchmarks.csproj b/csharp/test/Apache.Arrow.Benchmarks/Apache.Arrow.Benchmarks.csproj index f74af09..c451bda 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 @@ <PropertyGroup> <OutputType>Exe</OutputType> <TargetFramework>netcoreapp2.1</TargetFramework> - <LangVersion>latest</LangVersion> </PropertyGroup> <ItemGroup> diff --git a/csharp/test/Apache.Arrow.Tests/Apache.Arrow.Tests.csproj b/csharp/test/Apache.Arrow.Tests/Apache.Arrow.Tests.csproj index d29279b..c8dd0de 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 @@ <?xml version="1.0" encoding="utf-8"?> <Project Sdk="Microsoft.NET.Sdk"> - <Import Project="../../build/Common.props" /> - <PropertyGroup> <TargetFramework>netcoreapp2.1</TargetFramework> <AllowUnsafeBlocks>true</AllowUnsafeBlocks> - <LangVersion>7.3</LangVersion> </PropertyGroup> <ItemGroup> diff --git a/csharp/test/Directory.Build.props b/csharp/test/Directory.Build.props new file mode 100644 index 0000000..a643e49 --- /dev/null +++ b/csharp/test/Directory.Build.props @@ -0,0 +1,9 @@ +<Project> + + <Import Project="..\Directory.Build.props" /> + + <PropertyGroup> + <IsPackable>false</IsPackable> + </PropertyGroup> + +</Project> \ No newline at end of file diff --git a/dev/release/00-prepare.sh b/dev/release/00-prepare.sh index 8596892..9e0a89b 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>${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 dd6169e..b0040ef 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