Commit 29db1bb5 authored by Geoffrey Métais's avatar Geoffrey Métais

Pass keystore password to gradlew env

parent df0ae30f
......@@ -49,19 +49,6 @@ if [ -z "$ANDROID_ABI" ]; then
ANDROID_ABI="armeabi-v7a"
fi
if [ -z "$KEYSTORE_FILE" ]; then
KEYSTORE_FILE="$HOME/.android/debug.keystore"
PASSWORD_KEYSTORE="android"
STOREALIAS="androiddebugkey"
else
if [ -z "$PASSWORD_KEYSTORE" ]; then
echo "No password"
exit 1
fi
rm -f gradle.properties
STOREALIAS="vlc"
fi
#############
# FUNCTIONS #
#############
......@@ -105,10 +92,24 @@ fi
# Configure gradle #
####################
if [ -z "$KEYSTORE_FILE" ]; then
KEYSTORE_FILE="$HOME/.android/debug.keystore"
STOREALIAS="androiddebugkey"
else
if [ -z "$PASSWORD_KEYSTORE" ]; then
echo "No password"
exit 1
fi
rm -f gradle.properties
STOREALIAS="vlc"
fi
if [ ! -f gradle.properties ]; then
echo keyStoreFile=$KEYSTORE_FILE > gradle.properties
echo storealias=$STOREALIAS >> gradle.properties
echo storepwd=$PASSWORD_KEYSTORE >> gradle.properties
if [ -z PASSWORD_KEYSTORE ]; then
echo storepwd=android >> gradle.properties
fi
fi
if [ ! -f local.properties ]; then
echo sdk.dir=$ANDROID_SDK > local.properties
......@@ -168,7 +169,7 @@ else
fi
fi
./gradlew $TARGET
PASSWORD_KEYSTORE="$PASSWORD_KEYSTORE" ./gradlew $TARGET
#######
# RUN #
......
......@@ -36,9 +36,14 @@ android {
storepwd=android
*/
storeFile file(keyStoreFile)
storePassword storepwd
keyAlias storealias
keyPassword storepwd
if (System.getenv('PASSWORD_KEYSTORE') != null){
storePassword = System.getenv('PASSWORD_KEYSTORE')
keyPassword = System.getenv('PASSWORD_KEYSTORE')
} else {
storePassword storepwd
keyPassword storepwd
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment