From f05247070039318382f153561798194ddaaa1519 Mon Sep 17 00:00:00 2001 From: Mathieu Sanchez Date: Mon, 27 Apr 2020 17:01:53 +0200 Subject: [PATCH] Adding config for alpha and beta build --- app/build.gradle | 23 +++++++++++++++++-- .../res/layout/fragment_add_attestation.xml | 8 +++++-- app/src/main/res/values/errors.xml | 4 +++- build.gradle | 9 ++++++-- 4 files changed, 37 insertions(+), 7 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 5e02bdd..47a39d9 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -30,11 +30,28 @@ android { minifyEnabled true shrinkResources true proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' - buildConfigField "Integer", "DB_VERSION", "1" + buildConfigField "Integer", "DB_VERSION", db_version buildConfigField "Boolean", "TEST", "false" } + + beta { + minifyEnabled true + shrinkResources true + proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' + buildConfigField "Integer", "DB_VERSION", db_version + buildConfigField "Boolean", "TEST", "false" + } + + alpha { + minifyEnabled true + shrinkResources true + proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' + buildConfigField "Integer", "DB_VERSION", db_version + buildConfigField "Boolean", "TEST", "true" + } + debug { - buildConfigField "Integer", "DB_VERSION", "1" + buildConfigField "Integer", "DB_VERSION", db_version buildConfigField "Boolean", "TEST", "true" } } @@ -89,6 +106,8 @@ dependencies { //noinspection GradleDependency implementation 'com.journeyapps:zxing-android-embedded:3.6.0' + implementation 'com.github.Ilhasoft:data-binding-validator:2.0.0' + // Test testImplementation 'junit:junit:4.12' androidTestImplementation 'androidx.test.ext:junit:1.1.1' diff --git a/app/src/main/res/layout/fragment_add_attestation.xml b/app/src/main/res/layout/fragment_add_attestation.xml index 258b519..4ec5afc 100644 --- a/app/src/main/res/layout/fragment_add_attestation.xml +++ b/app/src/main/res/layout/fragment_add_attestation.xml @@ -88,7 +88,9 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:inputType="date" - android:text="@={viewModel.birthday}" /> + android:text="@={viewModel.birthday}" + app:validateDate='@{"dd/MM/yyyy"}' + app:validateDateMessage="@{@string/date_error_message}"/> @@ -163,7 +165,9 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:inputType="date" - android:text="@={viewModel.exitDate}" /> + android:text="@={viewModel.exitDate}" + app:validateDate='@{"dd/MM/yyyy"}' + app:validateDateMessage="@{@string/date_error_message}"/> diff --git a/app/src/main/res/values/errors.xml b/app/src/main/res/values/errors.xml index 066fca2..48b55f1 100644 --- a/app/src/main/res/values/errors.xml +++ b/app/src/main/res/values/errors.xml @@ -1,7 +1,9 @@ + + Votre date doit être au format 01/01/1970 + Erreur lors de la génération de l\'attestation, tout les champs ne sont pas compléter Erreur lors de la génération de l\'attestion, veuillez vérifiez vos champs ou contacter le développeur. - \ No newline at end of file diff --git a/build.gradle b/build.gradle index 84b783e..6c8070b 100644 --- a/build.gradle +++ b/build.gradle @@ -1,7 +1,12 @@ // Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { - ext.kotlin_version = '1.3.72' + ext { + kotlin_version = '1.3.72' + db_version = '1' + + } + repositories { google() jcenter() @@ -20,7 +25,7 @@ allprojects { repositories { google() jcenter() - + maven { url 'https://jitpack.io' } } } -- 2.34.1