You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@avro.apache.org by bl...@apache.org on 2016/11/05 20:20:39 UTC

[22/35] avro git commit: AVRO-1919: Formalize the presence of build.sh. Contributed by Suraj Acharya.

AVRO-1919: Formalize the presence of build.sh.  Contributed by Suraj Acharya.


Project: http://git-wip-us.apache.org/repos/asf/avro/repo
Commit: http://git-wip-us.apache.org/repos/asf/avro/commit/322a0731
Tree: http://git-wip-us.apache.org/repos/asf/avro/tree/322a0731
Diff: http://git-wip-us.apache.org/repos/asf/avro/diff/322a0731

Branch: refs/heads/branch-1.8
Commit: 322a0731337b27f45a40b5f28d7afa2b1b844e4b
Parents: 651decf
Author: Doug Cutting <cu...@apache.org>
Authored: Mon Sep 26 14:21:58 2016 -0700
Committer: Ryan Blue <bl...@apache.org>
Committed: Sat Nov 5 13:18:16 2016 -0700

----------------------------------------------------------------------
 CHANGES.txt        |  2 ++
 build.sh           | 25 +++++++------------
 lang/java/build.sh | 66 +++++++++++++++++++++++++++++++++++++++++++++++++
 lang/perl/build.sh | 65 ++++++++++++++++++++++++++++++++++++++++++++++++
 lang/py/build.sh   | 60 ++++++++++++++++++++++++++++++++++++++++++++
 lang/py3/build.sh  | 65 ++++++++++++++++++++++++++++++++++++++++++++++++
 6 files changed, 267 insertions(+), 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/avro/blob/322a0731/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index d82a345..378db4f 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -24,6 +24,8 @@ Trunk (not yet released)
 
     AVRO-1879: Make conversions field static. (Michael Wong via blue)
 
+    AVRO-1919: Formalize the presence of build.sh. (Suraj Acharya via cutting)
+
   BUG FIXES
 
     AVRO-1741: Python3: Fix error when codec is not in the header.

http://git-wip-us.apache.org/repos/asf/avro/blob/322a0731/build.sh
----------------------------------------------------------------------
diff --git a/build.sh b/build.sh
index c0c31df..67f11a4 100755
--- a/build.sh
+++ b/build.sh
@@ -39,16 +39,16 @@ do
 
     test)
       # run lang-specific tests
-      (cd lang/java; mvn test)
-      (cd lang/py; ant test)
-      (cd lang/py3; python3 setup.py test)
+      (cd lang/java; ./build.sh test)
+      (cd lang/py; ./build.sh test)
+      (cd lang/py3; ./build.sh test)
       (cd lang/c; ./build.sh test)
       (cd lang/c++; ./build.sh test)
       (cd lang/csharp; ./build.sh test)
       (cd lang/js; ./build.sh test)
       (cd lang/ruby; ./build.sh test)
       (cd lang/php; ./build.sh test)
-      (cd lang/perl; perl ./Makefile.PL && make test)
+      (cd lang/perl; ./build.sh test)
 
       # create interop test data
       mkdir -p build/interop/data
@@ -105,15 +105,12 @@ do
 
       # build lang-specific artifacts
 
-      (cd lang/java; mvn package -DskipTests -Dhadoop.version=1;
-      rm -rf mapred/target/{classes,test-classes}/;
-      rm -rf trevni/avro/target/{classes,test-classes}/;
-      mvn -P dist package -DskipTests -Davro.version=$VERSION javadoc:aggregate)
+      (cd lang/java;./build.sh dist)
       (cd lang/java/trevni/doc; mvn site)
       (mvn -N -P copy-artifacts antrun:run)
 
-      (cd lang/py; ant dist)
-      (cd lang/py3; python3 setup.py sdist; cp -r dist ../../dist/py3)
+      (cd lang/py; ./build.sh dist)
+      (cd lang/py3; ./build.sh dist)
 
       (cd lang/c; ./build.sh dist)
 
@@ -128,7 +125,7 @@ do
       (cd lang/php; ./build.sh dist)
 
       mkdir -p dist/perl
-      (cd lang/perl; perl ./Makefile.PL && make dist)
+      (cd lang/perl; ./build.sh dist)
       cp lang/perl/Avro-$VERSION.tar.gz dist/perl/
 
       # build docs
@@ -194,11 +191,7 @@ do
 
       (cd lang/php; ./build.sh clean)
 
-      (cd lang/perl; [ ! -f Makefile ] || make clean)
-      rm -f  lang/perl/Avro-*.tar.gz
-      rm -f  lang/perl/META.yml
-      rm -f  lang/perl/Makefile.old
-      rm -rf lang/perl/inc/
+      (cd lang/perl; ./build.sh clean)
       ;;
 
     docker)

http://git-wip-us.apache.org/repos/asf/avro/blob/322a0731/lang/java/build.sh
----------------------------------------------------------------------
diff --git a/lang/java/build.sh b/lang/java/build.sh
new file mode 100755
index 0000000..40d32c5
--- /dev/null
+++ b/lang/java/build.sh
@@ -0,0 +1,66 @@
+#!/bin/bash
+
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+set -e # exit on error
+
+function usage {
+  echo "Usage: $0 {test|dist|clean}"
+  exit 1
+}
+
+if [ $# -eq 0 ]
+then
+  usage
+fi
+
+if [ -f VERSION.txt ]
+then
+  VERSION=`cat VERSION.txt`
+else
+  VERSION=`cat ../../share/VERSION.txt`
+fi
+
+for target in "$@"
+do
+
+function do_dist() {
+  mvn package -DskipTests -Dhadoop.version=1;
+  rm -rf mapred/target/{classes,test-classes}/;
+  rm -rf trevni/avro/target/{classes,test-classes}/;
+  mvn -P dist package -DskipTests -Davro.version=$VERSION javadoc:aggregate
+}
+
+case "$target" in
+  test)
+    mvn test
+    ;;
+
+  dist)
+    do_dist
+    ;;
+
+  clean)
+    mvn clean
+    ;;
+
+  *)
+    usage
+esac
+
+done
+
+exit 0

http://git-wip-us.apache.org/repos/asf/avro/blob/322a0731/lang/perl/build.sh
----------------------------------------------------------------------
diff --git a/lang/perl/build.sh b/lang/perl/build.sh
new file mode 100755
index 0000000..d2028ec
--- /dev/null
+++ b/lang/perl/build.sh
@@ -0,0 +1,65 @@
+#!/bin/bash
+
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+set -e # exit on error
+
+function usage {
+  echo "Usage: $0 {test|dist|clean}"
+  exit 1
+}
+
+if [ $# -eq 0 ]
+then
+  usage
+fi
+
+if [ -f VERSION.txt ]
+then
+  VERSION=`cat VERSION.txt`
+else
+  VERSION=`cat ../../share/VERSION.txt`
+fi
+
+for target in "$@"
+do
+
+function do_clean(){
+  [ ! -f Makefile ] || make clean
+  rm -f  Avro-*.tar.gz META.yml Makefile.old
+  rm -rf lang/perl/inc/
+}
+
+case "$target" in
+  test)
+    perl ./Makefile.PL && make test
+    ;;
+
+  dist)
+     perl ./Makefile.PL && make dist
+    ;;
+
+  clean)
+    do_clean
+    ;;
+
+  *)
+    usage
+esac
+
+done
+
+exit 0

http://git-wip-us.apache.org/repos/asf/avro/blob/322a0731/lang/py/build.sh
----------------------------------------------------------------------
diff --git a/lang/py/build.sh b/lang/py/build.sh
new file mode 100755
index 0000000..0169b0b
--- /dev/null
+++ b/lang/py/build.sh
@@ -0,0 +1,60 @@
+#!/bin/bash
+
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+set -e # exit on error
+
+function usage {
+  echo "Usage: $0 {test|dist|clean}"
+  exit 1
+}
+
+if [ $# -eq 0 ]
+then
+  usage
+fi
+
+if [ -f VERSION.txt ]
+then
+  VERSION=`cat VERSION.txt`
+else
+  VERSION=`cat ../../share/VERSION.txt`
+fi
+
+for target in "$@"
+do
+
+case "$target" in
+  test)
+    ant test
+    ;;
+
+  dist)
+     ant dist
+    ;;
+
+  clean)
+    ant clean
+    rm -rf userlogs/
+    ;;
+
+  *)
+    usage
+esac
+
+done
+
+exit 0

http://git-wip-us.apache.org/repos/asf/avro/blob/322a0731/lang/py3/build.sh
----------------------------------------------------------------------
diff --git a/lang/py3/build.sh b/lang/py3/build.sh
new file mode 100755
index 0000000..fdb457a
--- /dev/null
+++ b/lang/py3/build.sh
@@ -0,0 +1,65 @@
+#!/bin/bash
+
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+set -e # exit on error
+
+function usage {
+  echo "Usage: $0 {test|dist|clean}"
+  exit 1
+}
+
+if [ $# -eq 0 ]
+then
+  usage
+fi
+
+if [ -f VERSION.txt ]
+then
+  VERSION=`cat VERSION.txt`
+else
+  VERSION=`cat ../../share/VERSION.txt`
+fi
+
+for target in "$@"
+do
+
+function do_clean(){
+  python3 setup.py clean
+  rm -rvf dist avro_python3.egg-info avro/*.avsc avro/VERSION.txt avro/__pycache__/ avro/tests/interop.avsc avro/tests/__pycache__/
+}
+
+case "$target" in
+  test)
+    python3 setup.py test
+    ;;
+
+  dist)
+     python3 setup.py sdist
+     cp -r dist ../../dist/py3
+    ;;
+
+  clean)
+    do_clean
+    ;;
+
+  *)
+    usage
+esac
+
+done
+
+exit 0