apply plugin: 'com.android.application' android { namespace = "fr.kyuno.batchcooking" compileSdk = rootProject.ext.compileSdkVersion defaultConfig { applicationId "fr.kyuno.batchcooking" minSdkVersion rootProject.ext.minSdkVersion targetSdkVersion rootProject.ext.targetSdkVersion versionCode 1 versionName "1.0" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" aaptOptions { // Files and dirs to omit from the packaged assets dir, modified to accommodate modern web apps. // Default: https://android.googlesource.com/platform/frameworks/base/+/282e181b58cf72b6ca770dc7ca5f91f135444502/tools/aapt/AaptAssets.cpp#61 ignoreAssetsPattern = '!.svn:!.git:!.ds_store:!*.scc:.*:!CVS:!thumbs.db:!picasa.ini:!*~' } } // Lu depuis l'environnement, jamais codé en dur — même règle que les // secrets de apps/api (JWT_SECRET, etc.) : aucune valeur par défaut // devinable. Le keystore lui-même (ANDROID_KEYSTORE_PATH) est un fichier // décodé à la volée depuis le secret CI ANDROID_KEYSTORE_BASE64, jamais // commité (voir apps/web/android/.gitignore) — généré une fois à la main, // voir la doc du README "Application mobile". N'affecte que // `assembleRelease` : `assembleDebug` continue d'utiliser le keystore de // debug généré automatiquement par Android, sans configuration. signingConfigs { release { storeFile System.getenv("ANDROID_KEYSTORE_PATH") ? file(System.getenv("ANDROID_KEYSTORE_PATH")) : null storePassword System.getenv("ANDROID_KEYSTORE_PASSWORD") keyAlias System.getenv("ANDROID_KEY_ALIAS") keyPassword System.getenv("ANDROID_KEY_PASSWORD") } } buildTypes { release { // `signingConfig` reste posé même quand les variables d'environnement // ci-dessus sont absentes (dev local) : Gradle accepte une // signingConfig aux champs `null`, la build échoue seulement au // moment de la signature effective (assembleRelease), jamais à la // configuration — un `assembleDebug` local n'en a jamais besoin. signingConfig signingConfigs.release minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } } repositories { flatDir{ dirs '../capacitor-cordova-android-plugins/src/main/libs', 'libs' } } dependencies { implementation fileTree(include: ['*.jar'], dir: 'libs') implementation "androidx.appcompat:appcompat:$androidxAppCompatVersion" implementation "androidx.coordinatorlayout:coordinatorlayout:$androidxCoordinatorLayoutVersion" implementation "androidx.core:core-splashscreen:$coreSplashScreenVersion" implementation project(':capacitor-android') testImplementation "junit:junit:$junitVersion" androidTestImplementation "androidx.test.ext:junit:$androidxJunitVersion" androidTestImplementation "androidx.test.espresso:espresso-core:$androidxEspressoCoreVersion" implementation project(':capacitor-cordova-android-plugins') } apply from: 'capacitor.build.gradle' try { def servicesJSON = file('google-services.json') if (servicesJSON.text) { apply plugin: 'com.google.gms.google-services' } } catch(Exception e) { logger.info("google-services.json not found, google-services plugin not applied. Push Notifications won't work") }