fix(ios): validate resources/ and warn if assets/ shadows it
Point iOS asset checks at resources/ and document that a leftover assets/ directory makes @capacitor/assets ignore the canonical sources.
This commit is contained in:
@@ -1604,6 +1604,11 @@ Use the commands above to check and fix code quality issues.
|
|||||||
4. **Native Build**: Platform-specific compilation
|
4. **Native Build**: Platform-specific compilation
|
||||||
5. **Package Creation**: APK/IPA generation
|
5. **Package Creation**: APK/IPA generation
|
||||||
|
|
||||||
|
`resources/` is the canonical source for app icons and splash screens.
|
||||||
|
Do not keep a legacy top-level `assets/` directory unless it is intentionally
|
||||||
|
used: `@capacitor/assets` prioritizes `assets/` over `resources/`, which can
|
||||||
|
prevent the canonical assets from being discovered.
|
||||||
|
|
||||||
## Architecture Environment Configuration
|
## Architecture Environment Configuration
|
||||||
|
|
||||||
### Environment Files
|
### Environment Files
|
||||||
|
|||||||
@@ -56,7 +56,10 @@ npx capacitor-assets generate --web
|
|||||||
|
|
||||||
## Configuration
|
## Configuration
|
||||||
|
|
||||||
Asset generation is configured in `capacitor-assets.config.json` at the project root.
|
`resources/` is this project's canonical asset source. `@capacitor/assets`
|
||||||
|
prioritizes a top-level `assets/` directory over `resources/`, so a legacy
|
||||||
|
`assets/` directory can prevent these assets from being discovered. Remove that
|
||||||
|
directory when it is empty or obsolete.
|
||||||
|
|
||||||
## Version Control
|
## Version Control
|
||||||
|
|
||||||
|
|||||||
@@ -172,12 +172,12 @@ check_ios_resources() {
|
|||||||
log_info "Checking iOS resources..."
|
log_info "Checking iOS resources..."
|
||||||
|
|
||||||
# Check for required assets
|
# Check for required assets
|
||||||
if [ ! -f "assets/icon.png" ]; then
|
if [ ! -f "resources/icon.png" ]; then
|
||||||
log_warn "App icon not found at assets/icon.png"
|
log_warn "App icon not found at resources/icon.png"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ ! -f "assets/splash.png" ]; then
|
if [ ! -f "resources/splash.png" ]; then
|
||||||
log_warn "Splash screen not found at assets/splash.png"
|
log_warn "Splash screen not found at resources/splash.png"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Check for iOS-specific files
|
# Check for iOS-specific files
|
||||||
@@ -295,6 +295,11 @@ apply_ios_app_icon_appearances() {
|
|||||||
# Generate iOS assets (capacitor-assets), then apply optional appearance variants.
|
# Generate iOS assets (capacitor-assets), then apply optional appearance variants.
|
||||||
generate_ios_assets() {
|
generate_ios_assets() {
|
||||||
ensure_ios_capacitor_asset_directories
|
ensure_ios_capacitor_asset_directories
|
||||||
|
if [ -d "assets" ]; then
|
||||||
|
log_warn "@capacitor/assets prioritizes the top-level assets/ directory over resources/."
|
||||||
|
log_warn "This project intentionally uses resources/ as the canonical asset source."
|
||||||
|
log_warn "Remove the legacy assets/ directory if it is empty or obsolete."
|
||||||
|
fi
|
||||||
npx capacitor-assets generate --ios
|
npx capacitor-assets generate --ios
|
||||||
apply_ios_app_icon_appearances
|
apply_ios_app_icon_appearances
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user