You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@avro.apache.org by fo...@apache.org on 2019/01/19 14:05:44 UTC
[avro] branch master updated: AVRO-2303: Build and test against
.NET SDK instead of Mono (#431)
This is an automated email from the ASF dual-hosted git repository.
fokko pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/avro.git
The following commit(s) were added to refs/heads/master by this push:
new 2eea14c AVRO-2303: Build and test against .NET SDK instead of Mono (#431)
2eea14c is described below
commit 2eea14c10f87029dfe89e7575fbd587cb23b812d
Author: Brian Lachniet <bl...@gmail.com>
AuthorDate: Sat Jan 19 09:05:39 2019 -0500
AVRO-2303: Build and test against .NET SDK instead of Mono (#431)
AVRO-2303 Build and test against .NET SDK instead of Mono
---
lang/csharp/README.md | 17 +++++++----------
lang/csharp/build.sh | 25 ++++++++++++++++++-------
share/docker/Dockerfile | 18 ++++++++++--------
3 files changed, 35 insertions(+), 25 deletions(-)
diff --git a/lang/csharp/README.md b/lang/csharp/README.md
index 35d1976..8286591 100644
--- a/lang/csharp/README.md
+++ b/lang/csharp/README.md
@@ -7,20 +7,17 @@
1. Install [Microsoft Visual Studio Community 2017](https://www.visualstudio.com/downloads/)
2. `./build.ps1 Test`
-### Linux with Mono
+### Linux with .NET SDK
-1. Install [Mono v5.18+](https://www.mono-project.com/download/stable/). Install the **mono-devel**
- and **mono-complete** packages.
+1. Install [.NET Core SDK 2.1+](https://www.microsoft.com/net/download/linux)
2. `./build.sh test`
-### Linux with .NET Core SDK
+### Linux with Mono
-1. Install [.NET Core SDK 2.1+](https://www.microsoft.com/net/download/linux)
-2. Build and run unit tests:
- ```
- cd src/apache/test
- dotnet test --framework netcoreapp2.0
- ```
+1. Install [Mono v5.18+](https://www.mono-project.com/download/stable/). Install the **mono-devel**
+ and **mono-complete** packages.
+2. Build: `msbuild /t:"restore;build" /p:"Configuration=Release"`
+3. Test: `mono ~/.nuget/packages/nunit.consolerunner/3.9.0/tools/nunit3-console.exe src/apache/test/bin/Release/net40/Avro.test.dll`
## Target Frameworks
diff --git a/lang/csharp/build.sh b/lang/csharp/build.sh
index b84d3ad..2ee988b 100755
--- a/lang/csharp/build.sh
+++ b/lang/csharp/build.sh
@@ -26,22 +26,33 @@ VERSION=`cat $ROOT/share/VERSION.txt`
case "$1" in
test)
- msbuild /t:"restore;build" /p:"Configuration=Release"
- mono ${HOME}/.nuget/packages/nunit.consolerunner/3.9.0/tools/nunit3-console.exe \
- --noheader --labels=All \
- src/apache/test/bin/Release/net40/Avro.test.dll
+ dotnet build --configuration Release --framework netcoreapp2.0 ./src/apache/codegen/Avro.codegen.csproj
+ dotnet build --configuration Release --framework netstandard2.0 ./src/apache/msbuild/Avro.msbuild.csproj
+ dotnet test --configuration Release --framework netcoreapp2.0 ./src/apache/test/Avro.test.csproj
;;
perf)
- msbuild /t:"restore;build" /p:"Configuration=Release"
- mono build/perf/Release/Avro.perf.exe
+ pushd ./src/apache/perf/
+ dotnet run --configuration Release --framework netcoreapp2.0
;;
dist)
# build binary tarball
msbuild /t:"restore;build" /p:"Configuration=Release"
+
# add the binary LICENSE and NOTICE to the tarball
+ mkdir build/
cp LICENSE NOTICE build/
+
+ # add binaries to the tarball
+ mkdir build/main/
+ cp -R src/apache/main/bin/Release/* build/main/
+ mkdir build/codegen/
+ cp -R src/apache/codegen/bin/Release/* build/codegen/
+ mkdir build/ipc/
+ cp -R src/apache/ipc/bin/Release/* build/ipc/
+
+ # build the tarball
mkdir -p $ROOT/dist/csharp
(cd build; tar czf $ROOT/../dist/csharp/avro-csharp-$VERSION.tar.gz main codegen ipc LICENSE NOTICE)
@@ -52,7 +63,7 @@ case "$1" in
;;
clean)
- rm -rf src/apache/{main,test,codegen,ipc,msbuild,perf}/obj
+ rm -rf src/apache/{main,test,codegen,ipc,msbuild,perf}/{obj,bin}
rm -rf build
rm -f TestResult.xml
;;
diff --git a/share/docker/Dockerfile b/share/docker/Dockerfile
index ca27195..3588b77 100644
--- a/share/docker/Dockerfile
+++ b/share/docker/Dockerfile
@@ -26,14 +26,17 @@ SHELL ["/bin/bash", "-o", "pipefail", "-c"]
# Add the repository for node.js 4.x
RUN curl -sL https://deb.nodesource.com/setup_4.x | bash -
+# Register Microsoft key and feed for .NET SDK
+# https://dotnet.microsoft.com/download/linux-package-manager/debian8/sdk-current
+RUN wget -qO- https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.asc.gpg && \
+ mv microsoft.asc.gpg /etc/apt/trusted.gpg.d/ && \
+ wget -q https://packages.microsoft.com/config/debian/8/prod.list && \
+ mv prod.list /etc/apt/sources.list.d/microsoft-prod.list && \
+ chown root:root /etc/apt/trusted.gpg.d/microsoft.asc.gpg && \
+ chown root:root /etc/apt/sources.list.d/microsoft-prod.list
+
# Install dependencies from packages
RUN apt-get -qq update && \
- # Add the repository for Mono (https://www.mono-project.com/download/stable/#download-lin-debian)
- apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF && \
- apt-get -qq install -y apt-transport-https && \
- echo "deb https://download.mono-project.com/repo/debian stable-jessie main" | tee /etc/apt/sources.list.d/mono-official-stable.list && \
- apt-get -qq update && \
- # END Add the repository for Mono
apt-get -qq install --no-install-recommends -y \
ant \
asciidoc \
@@ -41,6 +44,7 @@ RUN apt-get -qq update && \
bzip2 \
cmake \
curl \
+ dotnet-sdk-2.1 \
doxygen \
flex \
g++ \
@@ -55,8 +59,6 @@ RUN apt-get -qq update && \
libsnappy1 \
make \
maven \
- mono-devel \
- mono-complete \
nodejs \
perl \
php5 \