Skip to content

Instantly share code, notes, and snippets.

@jush
Forked from jpeddicord/build.gradle
Last active December 18, 2015 07:19
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jush/5745425 to your computer and use it in GitHub Desktop.
Save jush/5745425 to your computer and use it in GitHub Desktop.
// additional required configuration to hook into the build script
android {
signingConfigs {
release {
// specify signing properties on the command line
if (project.hasProperty('keyStore')) {
println 'Generating a signed package.'
storeFile file(keyStore)
storePassword storePass
keyAlias alias
keyPassword keyPass
}
}
}
buildTypes {
release {
if (project.hasProperty('keyStore')) {
signingConfig signingConfigs.release
}
}
}
}
#!/bin/bash
if [[ $# -ne 2 ]]; then
echo "Usage: $0 keystore keyalias"
exit 1
fi
if [[ ! -f $1 ]]; then
echo "$1 doesn't exist or isn't a keystore"
exit 1
fi
read -s -p "Keystore Password: " STORE_PASS
echo
read -s -p "Key Password: " KEY_PASS
echo
export ORG_GRADLE_PROJECT_keyStore="$1"
export ORG_GRADLE_PROJECT_storePass="$STORE_PASS"
export ORG_GRADLE_PROJECT_alias="$2"
export ORG_GRADLE_PROJECT_keyPass="$KEY_PASS"
./gradlew signingReport
read -p "Is this correct? [y/n] " -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]; then
./gradlew build
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment