Skip to content

Instantly share code, notes, and snippets.

@yukpiz
Created March 29, 2017 03:19
Show Gist options
  • Save yukpiz/0bec0bd6b69aa0bf02d49c196a04e136 to your computer and use it in GitHub Desktop.
Save yukpiz/0bec0bd6b69aa0bf02d49c196a04e136 to your computer and use it in GitHub Desktop.
Build for Android application and library.
#/bin/bash
if [ "${1}" == "app" ]; then
# Build application.
./gradlew clean installDebug >> build.log 2>&1
if [ $? == 0 ]; then
osascript -e 'display notification "Successfully build in Android application🐰 " with title "✅ Android Compile"'
else
osascript -e 'display notification "Failed to build in Android application🐰 " with title "❌ Android Compile"'
fi
elif [ "${1}" == "lib" ]; then
# Build library.
./gradlew clean assembleDebug archives >> build.log 2>&1
if [ $? == 0 ]; then
osascript -e 'display notification "Successfully build in Android library🐼 " with title "✅ Android Compile"'
else
osascript -e 'display notification "Failed to build in Android library🐼 " with title "❌ Android Compile"'
fi
else
echo "Invalid Argument: please args [app|lib]"
exit 0
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment