Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

config resource-file is copied to the wrong target #1663

Open
3 tasks done
DavidWiesner opened this issue Sep 7, 2023 · 1 comment
Open
3 tasks done

config resource-file is copied to the wrong target #1663

DavidWiesner opened this issue Sep 7, 2023 · 1 comment

Comments

@DavidWiesner
Copy link
Contributor

Bug Report

Problem

when defining a <resource-file src="example.xml" target="res/values/example.xml" /> see cordova documentation config.xml the src-file is not copied into the application-resources folder <platform-dir>/app/src/main/, but instead to the <project-dir>. In contrast when defining the same <resource-file /> in a plugin.xml, the file will be copied to the right destination see

const dest = path.join('app', 'src', 'main', obj.target);

What is expected to happen?

The defined src should be copied within the application-resource folder <platform-dir>/app/src/main/

What does actually happen?

The src-file will be copied to the <project-dir>

Information

Command or Code

Environment, Platform, Device

Version information

Cordova Packages:

cli: 12.0.0
    common: 5.0.0
    create: 5.0.0
    lib: 12.0.1
        common: 5.0.0
        fetch: 4.0.0
        serve: 4.0.1

Project Installed Platforms:

android: 12.0.1

Ionic:

Ionic CLI : 7.1.1

Checklist

  • I searched for existing GitHub issues
  • I updated all Cordova tooling to most recent version
  • I included all the necessary information above
@jcesarmobile
Copy link
Member

I feel like the config.xml behavior is the correct behavior, since you might want to add files to other folders, not just to app/src/main.
In example a common case of usage for resource-file is to copy the google-services.json file, which needs to be inside app folder, not in app/src/main folder.
But changing the behavior for plugins at this point will break a lot of plugins, so I think we should document the difference of behavior when using it in config.xml vs plugin.xml

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants