From 9e221e70fa9ee9cd5b2999471d58740e86ddeba2 Mon Sep 17 00:00:00 2001 From: nadia Date: Fri, 25 Oct 2024 13:05:46 +0200 Subject: [PATCH] =?UTF-8?q?A=C3=B1adido=20engitignore=20el=20key.propertie?= =?UTF-8?q?s=20y=20cambios=20en=20build.gradle=20para=20publicacion?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 4 +++- android/app/build.gradle | 28 ++++++++++++++++++++-------- 2 files changed, 23 insertions(+), 9 deletions(-) diff --git a/.gitignore b/.gitignore index cc2cc7e..b35b8a1 100644 --- a/.gitignore +++ b/.gitignore @@ -43,4 +43,6 @@ app.*.map.json /android/app/release #keystore -clave-crcivan.jks \ No newline at end of file +clave-crcivan.jks +keystore-crcivan.jks +key.properties \ No newline at end of file diff --git a/android/app/build.gradle b/android/app/build.gradle index 15b21f5..32231a2 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -4,6 +4,12 @@ plugins { id "dev.flutter.flutter-gradle-plugin" } +def keystoreProperties = new Properties() +def keystorePropertiesFile = rootProject.file('key.properties') +if (keystorePropertiesFile.exists()) { + keystoreProperties.load(new FileInputStream(keystorePropertiesFile)) +} + def localProperties = new Properties() def localPropertiesFile = rootProject.file('local.properties') if (localPropertiesFile.exists()) { @@ -26,7 +32,21 @@ android { namespace "com.asociacionador.crcivan" compileSdk flutter.compileSdkVersion ndkVersion flutter.ndkVersion + signingConfigs { + release { + keyAlias = keystoreProperties['keyAlias'] + keyPassword = keystoreProperties['keyPassword'] + storeFile = keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null + storePassword = keystoreProperties['storePassword'] + } + } + buildTypes { + release { + signingConfig = signingConfigs.release + debuggable false + } + } compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 @@ -50,14 +70,6 @@ android { versionCode flutterVersionCode.toInteger() versionName flutterVersionName } - - buildTypes { - release { - // TODO: Add your own signing config for the release build. - // Signing with the debug keys for now, so `flutter run --release` works. - signingConfig signingConfigs.debug - } - } } flutter {