-
-
Save andreikastsiuk/4bed3cbdcd9e9b1ed3eba04c3826e2ef to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| * Automates generation of Release APK | |
| * ./gradlew assembleRelease | |
| * */ | |
| Properties props = new Properties() | |
| def userHome = Paths.get(System.getProperty('user.home')); | |
| def propFile = file(userHome.resolve('PATH_TO_SIGNING_CONFIG_PROPERTIES_FILE.properties')) | |
| if (propFile.canRead()) { | |
| props.load(new FileInputStream(propFile)) | |
| if (props != null && props.containsKey('STORE_FILE') && props.containsKey('KEY_STORE_PASSWORD') | |
| && props.containsKey('KEY_ALIAS') && props.containsKey('KEY_PASSWORD')) { | |
| android.signingConfigs.release.storeFile = file(props['STORE_FILE']) | |
| android.signingConfigs.release.storePassword = props['KEY_STORE_PASSWORD'] | |
| android.signingConfigs.release.keyAlias = props['KEY_ALIAS'] | |
| android.signingConfigs.release.keyPassword = props['KEY_PASSWORD'] | |
| } else { | |
| println 'signing.properties found but some entries are missing' | |
| android.buildTypes.release.signingConfig = null | |
| } | |
| } else { | |
| println 'signing.properties not found' | |
| android.buildTypes.release.signingConfig = null | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment