I'm trying to set up Gradle to have different settings for release and debug builds.
Use case: developers do not need the signing file and configs to build a debug version.
But gradle refuses to sync/build a debug
version because a file is missing (def keystorePropertiesFile = rootProject.file("keystore.properties")
- but those settings are for release build only.
What am I doing wrong?
...
android {
...
defaultConfig {
...
}
buildTypes {
release {
...
signingConfigs {
def keystorePropertiesFile = rootProject.file("keystore.properties")
// Initialize a new Properties() object called keystoreProperties.
def keystoreProperties = new Properties()
// Load your keystore.properties file into the keystoreProperties object.
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
keyAlias keystoreProperties['keyAlias']
keyPassword keystoreProperties['keyPassword']
storeFile file(keystoreProperties['storeFile'])
storePassword keystoreProperties['storePassword']
}
}
debug {
...
}
}
...
}
...