[Android] [PATCH 3/5] compile.sh: move functions to the top of the file

Filip Roséen filip at atch.se
Tue Aug 9 04:01:49 CEST 2016


Given that it is always nice to have helper functions declared in the
same area, these changes makes it so that "diagnostic" and "checkfail"
is defined at the same place.
---
 compile.sh | 24 ++++++++++++------------
 1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/compile.sh b/compile.sh
index 029464f..64c86c2 100755
--- a/compile.sh
+++ b/compile.sh
@@ -1,11 +1,23 @@
 #! /bin/sh
 set -e
 
+#############
+# FUNCTIONS #
+#############
+
 diagnostic()
 {
     echo "$@" 1>&2;
 }
 
+checkfail()
+{
+    if [ ! $? -eq 0 ];then
+        diagnostic "$1"
+        exit 1
+    fi
+}
+
 # Read the Android Wiki http://wiki.videolan.org/AndroidCompile
 # Setup all that stuff correctly.
 # Get the latest Android SDK Platform or modify numbers in configure.sh and libvlc/default.properties.
@@ -68,18 +80,6 @@ if [ -z "$ANDROID_ABI" ]; then
    ANDROID_ABI="armeabi-v7a"
 fi
 
-#############
-# FUNCTIONS #
-#############
-
-checkfail()
-{
-    if [ ! $? -eq 0 ];then
-        echo "$1"
-        exit 1
-    fi
-}
-
 ##########
 # GRADLE #
 ##########
-- 
2.9.2



More information about the Android mailing list