capacitor-assets
capacitor-assets copied to clipboard
Detect Cordova vs native projects
Remove --skip-config
and --copy
workflow and detect project type instead. For Capacitor projects, which are really just native projects, there is no need to have a resources/
directory. Generated resources can be written directly into place in their respective native projects.
If Cordova is detected, the config.xml
and resources/
directory workflow is used.
The --resources <path>
option can be kept to allow devs to specify where to write generated resources, but wouldn't do anything in "Capacitor/native mode".
The --ios-project <path>
and --android-project <path>
options can be kept to allow devs to specify where native projects exist relative to the current directory, but wouldn't do anything in the "Cordova mode".
Is there any plan to rename the tool from 'cordova-res' to something else? I guess there this would cause a ton of ripple, but the name of this tool is the reason why it took me as long as it did to find the switches I could use on it to work with capacitor projects. I was looking elsewhere thinking this tool didn't apply.
Yes, 1.0 will be called (most likely) @capacitor/assets
and we're dropping Cordova support which should make this moot
Closing as @capacitor/assets
is now a thing and Cordova support is gone
One issue related to this is that the new tool dies not delete any existing contents in the folder. This is particularly problematic if you had previously generated icons using Cordova or some other method because it creates a bunch of issues with having too many photos. It also doesn't overwrite an existing JSON file, so the old images remain the primary expected images. Maybe it's a good idea to wipe the folder before generating anything. I had to erase the whole ios folder and rerun npx cap add ios to get this to work, and even then the splash icons are not working. They get generated but they don't get detected it used.
Thanks,
Alex Morgan EcoRate
On Fri, Sep 23, 2022, 4:59 PM Max Lynch @.***> wrote:
Closed #113 https://github.com/ionic-team/capacitor-assets/issues/113 as completed.
— Reply to this email directly, view it on GitHub https://github.com/ionic-team/capacitor-assets/issues/113#event-7450286723, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAT3FWPRAGGACYLDTJQNPA3V7YK2JANCNFSM4MOYKA6A . You are receiving this because you are subscribed to this thread.Message ID: @.*** com>
Native projects in capacitor are part of your source tree so we can't delete the folder (you might have custom native code or plugins in there). That's a big difference from Cordova. However, for iOS I think we can be more aggressive/destructive about updating the asset Contents.json
files to reflect the new changes