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/10/23 10:44:36 UTC
[avro] branch master updated: AVRO-2503: Add multiple arguments
support to all build scripts (#604)
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 d5cc3dd AVRO-2503: Add multiple arguments support to all build scripts (#604)
d5cc3dd is described below
commit d5cc3ddf3068c32e3b6048d2312f5833478842cb
Author: Kengo Seki <se...@apache.org>
AuthorDate: Wed Oct 23 19:44:27 2019 +0900
AVRO-2503: Add multiple arguments support to all build scripts (#604)
---
lang/c/build.sh | 95 ++++++++++++++++++++------------------
lang/csharp/build.sh | 128 +++++++++++++++++++++++++++------------------------
lang/js/build.sh | 43 +++++++++--------
lang/php/build.sh | 74 ++++++++++++++---------------
lang/ruby/build.sh | 7 ++-
5 files changed, 183 insertions(+), 164 deletions(-)
diff --git a/lang/c/build.sh b/lang/c/build.sh
index ff0c16f..6753e77 100755
--- a/lang/c/build.sh
+++ b/lang/c/build.sh
@@ -42,57 +42,62 @@ function clean {
rm -f examples/quickstop.db
}
-case "$1" in
+for target in "$@"
+do
- interop-data-generate)
- prepare_build
- make -C $build_dir
- $build_dir/tests/generate_interop_data "../../share/test/schemas/interop.avsc" "../../build/interop/data"
- ;;
+ case "$target" in
- interop-data-test)
- prepare_build
- make -C $build_dir
- $build_dir/tests/test_interop_data "../../build/interop/data"
- ;;
+ interop-data-generate)
+ prepare_build
+ make -C $build_dir
+ $build_dir/tests/generate_interop_data "../../share/test/schemas/interop.avsc" "../../build/interop/data"
+ ;;
- lint)
- echo 'This is a stub where someone can provide linting.'
- ;;
+ interop-data-test)
+ prepare_build
+ make -C $build_dir
+ $build_dir/tests/test_interop_data "../../build/interop/data"
+ ;;
- test)
- prepare_build
- make -C $build_dir
- make -C $build_dir test
- ;;
+ lint)
+ echo 'This is a stub where someone can provide linting.'
+ ;;
- dist)
- prepare_build
- cp ../../share/VERSION.txt $root_dir
- make -C $build_dir docs
- # This is a hack to force the built documentation to be included
- # in the source package.
- cp $build_dir/docs/*.html $root_dir/docs
- make -C $build_dir package_source
- rm $root_dir/docs/*.html
- if [ ! -d $dist_dir ]; then
- mkdir -p $dist_dir
- fi
- if [ ! -d $doc_dir ]; then
- mkdir -p $doc_dir
- fi
- mv $build_dir/$tarball $dist_dir
- cp $build_dir/docs/*.html $doc_dir
- clean
- ;;
+ test)
+ prepare_build
+ make -C $build_dir
+ make -C $build_dir test
+ ;;
- clean)
- clean
- ;;
+ dist)
+ prepare_build
+ cp ../../share/VERSION.txt $root_dir
+ make -C $build_dir docs
+ # This is a hack to force the built documentation to be included
+ # in the source package.
+ cp $build_dir/docs/*.html $root_dir/docs
+ make -C $build_dir package_source
+ rm $root_dir/docs/*.html
+ if [ ! -d $dist_dir ]; then
+ mkdir -p $dist_dir
+ fi
+ if [ ! -d $doc_dir ]; then
+ mkdir -p $doc_dir
+ fi
+ mv $build_dir/$tarball $dist_dir
+ cp $build_dir/docs/*.html $doc_dir
+ clean
+ ;;
- *)
- echo "Usage: $0 {interop-data-generate|interop-data-test|lint|test|dist|clean}"
- exit 1
-esac
+ clean)
+ clean
+ ;;
+
+ *)
+ echo "Usage: $0 {interop-data-generate|interop-data-test|lint|test|dist|clean}"
+ exit 1
+ esac
+
+done
exit 0
diff --git a/lang/csharp/build.sh b/lang/csharp/build.sh
index afa4859..37063be 100755
--- a/lang/csharp/build.sh
+++ b/lang/csharp/build.sh
@@ -23,64 +23,70 @@ cd `dirname "$0"` # connect to root
ROOT=../..
VERSION=`cat $ROOT/share/VERSION.txt`
-case "$1" in
-
- lint)
- echo 'This is a stub where someone can provide linting.'
- ;;
-
- test)
- dotnet build --configuration Release Avro.sln
-
- # AVRO-2442: Explictly set LANG to work around ICU bug in `dotnet test`
- LANG=en_US.UTF-8 dotnet test --configuration Release --no-build \
- --filter "TestCategory!=Interop" Avro.sln
- ;;
-
- perf)
- pushd ./src/apache/perf/
- dotnet run --configuration Release --framework netcoreapp2.2
- ;;
-
- dist)
- # pack NuGet packages
- dotnet pack --configuration Release Avro.sln
-
- # 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/
-
- # build the tarball
- mkdir -p ${ROOT}/dist/csharp
- (cd build; tar czf ${ROOT}/../dist/csharp/avro-csharp-${VERSION}.tar.gz main codegen LICENSE NOTICE)
-
- # build documentation
- doxygen Avro.dox
- mkdir -p ${ROOT}/build/avro-doc-${VERSION}/api/csharp
- cp -pr build/doc/* ${ROOT}/build/avro-doc-${VERSION}/api/csharp
- ;;
-
- interop-data-generate)
- dotnet run --project src/apache/test/Avro.test.csproj --framework netcoreapp2.2 ../../share/test/schemas/interop.avsc ../../build/interop/data
- ;;
-
- interop-data-test)
- LANG=en_US.UTF-8 dotnet test --filter "TestCategory=Interop"
- ;;
-
- clean)
- rm -rf src/apache/{main,test,codegen,ipc,msbuild,perf}/{obj,bin}
- rm -rf build
- rm -f TestResult.xml
- ;;
-
- *)
- echo "Usage: $0 {lint|test|clean|dist|perf|interop-data-generate|interop-data-test}"
- exit 1
-esac
+for target in "$@"
+do
+
+ case "$target" in
+
+ lint)
+ echo 'This is a stub where someone can provide linting.'
+ ;;
+
+ test)
+ dotnet build --configuration Release Avro.sln
+
+ # AVRO-2442: Explictly set LANG to work around ICU bug in `dotnet test`
+ LANG=en_US.UTF-8 dotnet test --configuration Release --no-build \
+ --filter "TestCategory!=Interop" Avro.sln
+ ;;
+
+ perf)
+ pushd ./src/apache/perf/
+ dotnet run --configuration Release --framework netcoreapp2.2
+ ;;
+
+ dist)
+ # pack NuGet packages
+ dotnet pack --configuration Release Avro.sln
+
+ # 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/
+
+ # build the tarball
+ mkdir -p ${ROOT}/dist/csharp
+ (cd build; tar czf ${ROOT}/../dist/csharp/avro-csharp-${VERSION}.tar.gz main codegen LICENSE NOTICE)
+
+ # build documentation
+ doxygen Avro.dox
+ mkdir -p ${ROOT}/build/avro-doc-${VERSION}/api/csharp
+ cp -pr build/doc/* ${ROOT}/build/avro-doc-${VERSION}/api/csharp
+ ;;
+
+ interop-data-generate)
+ dotnet run --project src/apache/test/Avro.test.csproj --framework netcoreapp2.2 ../../share/test/schemas/interop.avsc ../../build/interop/data
+ ;;
+
+ interop-data-test)
+ LANG=en_US.UTF-8 dotnet test --filter "TestCategory=Interop"
+ ;;
+
+ clean)
+ rm -rf src/apache/{main,test,codegen,ipc,msbuild,perf}/{obj,bin}
+ rm -rf build
+ rm -f TestResult.xml
+ ;;
+
+ *)
+ echo "Usage: $0 {lint|test|clean|dist|perf|interop-data-generate|interop-data-test}"
+ exit 1
+
+ esac
+
+done
diff --git a/lang/js/build.sh b/lang/js/build.sh
index a936a04..4d64146 100755
--- a/lang/js/build.sh
+++ b/lang/js/build.sh
@@ -19,23 +19,26 @@ set -e
cd `dirname "$0"`
-case "$1" in
- lint)
- npm run lint
- ;;
- test)
- npm install
- npm run cover
- ;;
- dist)
- npm pack
- mkdir -p ../../dist/js
- mv avro-js-*.tgz ../../dist/js
- ;;
- clean)
- rm -rf coverage
- ;;
- *)
- echo "Usage: $0 {lint|test|dist|clean}" >&2
- exit 1
-esac
+for target in "$@"
+do
+ case "$target" in
+ lint)
+ npm run lint
+ ;;
+ test)
+ npm install
+ npm run cover
+ ;;
+ dist)
+ npm pack
+ mkdir -p ../../dist/js
+ mv avro-js-*.tgz ../../dist/js
+ ;;
+ clean)
+ rm -rf coverage
+ ;;
+ *)
+ echo "Usage: $0 {lint|test|dist|clean}" >&2
+ exit 1
+ esac
+done
diff --git a/lang/php/build.sh b/lang/php/build.sh
index 96e011f..fa38cb8 100755
--- a/lang/php/build.sh
+++ b/lang/php/build.sh
@@ -44,41 +44,43 @@ function dist {
cp "$tarball" "../$dist_dir"
}
-case "$1" in
- interop-data-generate)
- php test/generate_interop_data.php
- ;;
-
- test-interop)
- phpunit test/InterOpTest.php
- ;;
-
- lint)
- echo 'This is a stub where someone can provide linting.'
- ;;
-
- test)
- phpunit -v test/AllTests.php
-
- # Check backward compatibility with PHP 5.x if both PHP 5.6 and PHPUnit 5.7 are installed.
- # TODO: remove this check when we drop PHP 5.x support in the future
- if command -v php5.6 > /dev/null && phpunit --version | grep -q 'PHPUnit 5.7'; then
- echo 'Checking backward compatibility with PHP 5.x'
- php5.6 $(which phpunit) -v test/AllTests.php
- fi
- ;;
-
- dist)
- dist
- ;;
-
- clean)
- clean
- ;;
-
- *)
- echo "Usage: $0 {interop-data-generate|test-interop|lint|test|dist|clean}"
-esac
-
+for target in "$@"
+do
+ case "$target" in
+ interop-data-generate)
+ php test/generate_interop_data.php
+ ;;
+
+ test-interop)
+ phpunit test/InterOpTest.php
+ ;;
+
+ lint)
+ echo 'This is a stub where someone can provide linting.'
+ ;;
+
+ test)
+ phpunit -v test/AllTests.php
+
+ # Check backward compatibility with PHP 5.x if both PHP 5.6 and PHPUnit 5.7 are installed.
+ # TODO: remove this check when we drop PHP 5.x support in the future
+ if command -v php5.6 > /dev/null && phpunit --version | grep -q 'PHPUnit 5.7'; then
+ echo 'Checking backward compatibility with PHP 5.x'
+ php5.6 $(which phpunit) -v test/AllTests.php
+ fi
+ ;;
+
+ dist)
+ dist
+ ;;
+
+ clean)
+ clean
+ ;;
+
+ *)
+ echo "Usage: $0 {interop-data-generate|test-interop|lint|test|dist|clean}"
+ esac
+done
exit 0
diff --git a/lang/ruby/build.sh b/lang/ruby/build.sh
index 3cb81c2..701d4ed 100755
--- a/lang/ruby/build.sh
+++ b/lang/ruby/build.sh
@@ -28,7 +28,9 @@ export PATH="$PATH:.gem/bin"
gem install --no-document -v 1.17.3 bundler
bundle install
-case "$1" in
+for target in "$@"
+do
+ case "$target" in
lint)
rubocop --lint
;;
@@ -49,4 +51,5 @@ case "$1" in
*)
echo "Usage: $0 {lint|test|dist|clean}"
exit 1
-esac
+ esac
+done