[tauri] TauriPlatforms: The shell around the built game, the Android privacy patch, the shell build of the game, and the device check

This commit is contained in:
2026-11-17 18:45:37 +01:00
parent 3f95a1b37d
commit a93ef09956
33 changed files with 5902 additions and 86 deletions
+27
View File
@@ -0,0 +1,27 @@
/**
* The app's icons, made from the PWA's icon (`apps/rosea/public/icon.svg`) before every build
* (tauri-platforms.md D8). They are build output, never committed: the only images in git are
* the source SVG and optimised art under art/final/ (CLAUDE.md §5.2). The icon is still a
* placeholder; the real one comes through the art pipeline (GAP_ANALYSIS G0.21).
*
* tsx scripts/icons.ts makes them when missing or older than the SVG
*/
import { existsSync, statSync } from 'node:fs';
import { join } from 'node:path';
import { PACKAGE, SRC_TAURI, tauri } from './tauri.js';
const SOURCE = join(PACKAGE, '..', 'rosea', 'public', 'icon.svg');
const MARK = join(SRC_TAURI, 'icons', 'icon.ico');
const ANDROID = join(SRC_TAURI, 'gen', 'android');
const ANDROID_MARK = join(ANDROID, 'app', 'src', 'main', 'res', 'mipmap-mdpi', 'ic_launcher.png');
const stale = (file: string): boolean => !existsSync(file) || statSync(file).mtimeMs < statSync(SOURCE).mtimeMs;
// `tauri icon` writes the Android launcher icons into gen/android only when that exists, so it
// runs again after `tauri android init` (which puts Tauri's own logo there).
if (stale(MARK) || (existsSync(ANDROID) && stale(ANDROID_MARK))) {
tauri('icon', SOURCE);
console.log('icons: made from apps/rosea/public/icon.svg');
} else {
console.log('icons: up to date');
}