apache / cordova-paramedic

Apache Cordova - Paramedic
https://cordova.apache.org/
Apache License 2.0
36 stars 53 forks source link

fix(android): change order of project setup & plugin install #253

Closed erisu closed 1 year ago

erisu commented 1 year ago

Motivation and Context

Various Android tests are failing because of the config munging order.

This PR changes the order of the project setup and the plugin install as a temporary workaround for Android plugin testing.

This change does not resolve the underlining issue.

Description

Example issue

Current Order of Paramedic for Reference:

Some plugins and the test plugins will inject elements into the AndroidManifest with config-file. For example, let us say the provider node is injected into the path of /manifest/application.

Next, the CI testing plugin attempts to update the /manifest/application node by appending attributes with edit-config.

Because the CI is trying to update the same node that had already been modified with config-file, it fails to merge with conflicts, even if the changes do not affect each other.

Example Solution

New Order of Paramedic for Reference:

If edit-config is applied first and then config-file is applied last, will not fail because config-file only uses the node path as a reference to where it needs to inject.

Final Note

Even though we change the order for the paramedic to resolve the issue, it only tests as if the project was being built up from scratch.

If we looked at the issue from a CI perspective, all the plugins and platforms are usually defined in package.json, and running cordova prepare could trigger the same issue as the order for installation might not be guaranteed.

More investigation into a proper solution should be performed within the cordova-common repo.

Testing

Checklist

erisu commented 1 year ago

Camera Plugin Test Results:

erisu commented 1 year ago

File Plugin Test Results: