Dernière étape du portage mobile #39 : génère et versionne le projet natif Android (`npx cap add android`) que les phases 1 à 3 (jeton Bearer, passe responsive, plomberie web) préparaient déjà. - `apps/web/android/` — projet natif Capacitor 8.5. Permission `INTERNET` présente par défaut, `applicationId` = `fr.kyuno.batchcooking`. - Thème natif aligné sur la palette « Mise en Place » (`_theme.scss`) : `colors.xml` redéfinit `colorPrimary`/`Dark`/`Accent` (basilic/vermillon) par-dessus les défauts Material de la lib capacitor-android ; barre de statut basilic foncé, fond de fenêtre « porcelaine » pour ne pas flasher blanc au démarrage à froid ; `postSplashScreenTheme` pour la transition. - Icône adaptative + splash (clair et sombre, toutes densités) générés depuis `apps/web/assets/logo.svg` (monogramme « bC », géométrie seule, pas de `<text>`) via `@capacitor/assets` ; sources et commande de régénération documentées dans `apps/web/assets/README.md`. `@capacitor/assets` n'est pas ajouté aux dépendances (il tire `sharp`, hors `onlyBuiltDependencies`) — lancé via `npx`. - `.gitignore` racine : ignore `/.idea/` (Android Studio ouvre désormais le dépôt comme projet). `biome.json` : exclut `apps/web/android` du lint. - README : section « Application mobile (Android) » (prérequis + flux de build `build:capacitor` → `cap sync` → Android Studio). Le bundle web copié sous `android/app/src/main/assets/public/` reste git-ignoré (régénéré par `pnpm build:capacitor && npx cap sync android`). Build de l'APK + test sur appareil : à finir dans Android Studio — la CI self-hosted ne build pas Android. Vérifs : `pnpm build` + `pnpm lint` OK ; `npx cap sync android` OK ; tous les XML natifs bien formés. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
54 lines
2.1 KiB
Groovy
54 lines
2.1 KiB
Groovy
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:!*~'
|
|
}
|
|
}
|
|
buildTypes {
|
|
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")
|
|
}
|