[Android] check for error

Thomas Guillem git at videolan.org
Fri Feb 6 09:38:45 CET 2015


vlc-ports/android | branch: master | Thomas Guillem <thomas at gllm.fr> | Fri Feb  6 09:38:42 2015 +0100| [f83bd29ec85cf74426f784fc51d6ae0cc935acbe] | committer: Thomas Guillem

check for error

> http://git.videolan.org/gitweb.cgi/vlc-ports/android.git/?a=commit;h=f83bd29ec85cf74426f784fc51d6ae0cc935acbe
---

 compile-simple.sh |   22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/compile-simple.sh b/compile-simple.sh
index 6f2fb9b..773ab2e 100755
--- a/compile-simple.sh
+++ b/compile-simple.sh
@@ -34,17 +34,38 @@ if [ -z "$ANDROID_ABI" ]; then
    ANDROID_ABI="armeabi-v7a"
 fi
 
+#############
+# FUNCTIONS #
+#############
+
+checkfail()
+{
+    if [ ! $? -eq 0 ];then
+        echo "$1"
+        exit 1
+    fi
+}
+
 ##########
 # GRADLE #
 ##########
+
 if [ ! -d "gradle/wrapper" ]; then
     GRADLE_VERSION=2.2.1
     GRADLE_URL=http://services.gradle.org/distributions/gradle-${GRADLE_VERSION}-all.zip
     wget ${GRADLE_URL}
+    checkfail "gradle: download failed"
+
     unzip gradle-${GRADLE_VERSION}-all.zip
+    checkfail "gradle: unzip failed"
+
     cd gradle-${GRADLE_VERSION}
+
     ./bin/gradle wrapper
+    checkfail "gradle: wrapper failed"
+
     ./gradlew -version
+    checkfail "gradle: wrapper failed"
     cd ..
     mkdir -p gradle
     mv gradle-${GRADLE_VERSION}/gradle/wrapper/ gradle
@@ -74,6 +95,7 @@ TESTED_HASH=18e445a
 if [ ! -d "vlc" ]; then
     echo "VLC source not found, cloning"
     git clone git://git.videolan.org/vlc.git vlc
+    checkfail "vlc source: git clone failed"
 else
     echo "VLC source found"
     cd vlc



More information about the Android mailing list