Skip to content
Snippets Groups Projects

Resolve "Improve signing process and get application version"

3 files
+ 19
9
Compare changes
  • Side-by-side
  • Inline
Files
3
+ 16
8
@@ -6,19 +6,27 @@ if (localPropertiesFile.exists()) {
@@ -6,19 +6,27 @@ if (localPropertiesFile.exists()) {
}
}
}
}
 
def gradleProperties = new Properties()
 
def gradlePropertiesFile = rootProject.file('gradle.properties')
 
if (gradlePropertiesFile.exists()) {
 
gradlePropertiesFile.withReader('UTF-8') { reader ->
 
gradleProperties.load(reader)
 
}
 
}
 
def flutterRoot = localProperties.getProperty('flutter.sdk')
def flutterRoot = localProperties.getProperty('flutter.sdk')
if (flutterRoot == null) {
if (flutterRoot == null) {
throw new FileNotFoundException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
throw new FileNotFoundException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
}
}
def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
def appVersionCode = gradleProperties.getProperty('app.versionCode')
if (flutterVersionCode == null) {
if (appVersionCode == null) {
flutterVersionCode = '1'
appVersionCode = '1'
}
}
def flutterVersionName = localProperties.getProperty('flutter.versionName')
def appVersionName = gradleProperties.getProperty('app.versionName')
if (flutterVersionName == null) {
if (appVersionName == null) {
flutterVersionName = '1.0'
appVersionName = '1.0'
}
}
apply plugin: 'com.android.application'
apply plugin: 'com.android.application'
@@ -41,8 +49,8 @@ android {
@@ -41,8 +49,8 @@ android {
applicationId "org.benoitharrault.hangman"
applicationId "org.benoitharrault.hangman"
minSdkVersion 21
minSdkVersion 21
targetSdkVersion 29
targetSdkVersion 29
versionCode flutterVersionCode.toInteger()
versionCode appVersionCode.toInteger()
versionName flutterVersionName
versionName appVersionName
archivesBaseName = "$applicationId" + "_" + "$versionCode"
archivesBaseName = "$applicationId" + "_" + "$versionCode"
}
}
Loading