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

refactor!: do not copy JS lib to platform project #1269

Merged
merged 1 commit into from Jul 13, 2021

Conversation

raphinesse
Copy link
Contributor

Motivation and Context

Finally, the moment we've all been waiting for! πŸŽ‰ πŸ˜‰

This PR does away with the questionable practice of copying the entire JS lib of cordova-android into each generated platform project – which had caused several issues and complications in the past.

Description

  • create: do not copy our JS lib (or node_modules) to platform project
  • Move files around
    • bin/templates/cordova/lib/ to lib/
    • bin/templates/cordova/Api.js to lib/
    • bin/lib/create.js to lib/
    • bin/templates/cordova/lib/plugin-build.gradle to lib/builders

After these changes, the cordova/ folder of a generated project only contains the bare minimum to maintain compatibility with existing cordova CLI versions (plus defaults.xml which IMHO should be moved in another PR). All of the remaining JS files in that folder require their dependencies via the cordova-android module, so that needs to be resolvable somehow (which is the case for a platform project generated by the regular CLI workflow).

Testing

  • existing tests pass
  • I successfully created and built a cordova-android project using cordova@10

@codecov-commenter
Copy link

codecov-commenter commented Jul 13, 2021

Codecov Report

Merging #1269 (98cbe0c) into master (f6d1dee) will decrease coverage by 0.06%.
The diff coverage is 68.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1269      +/-   ##
==========================================
- Coverage   73.27%   73.20%   -0.07%     
==========================================
  Files          21       21              
  Lines        1650     1646       -4     
==========================================
- Hits         1209     1205       -4     
  Misses        441      441              
Impacted Files Coverage Ξ”
lib/Adb.js 100.00% <ΓΈ> (ΓΈ)
lib/AndroidManifest.js 100.00% <ΓΈ> (ΓΈ)
lib/AndroidProject.js 61.11% <ΓΈ> (ΓΈ)
lib/PackageType.js 100.00% <ΓΈ> (ΓΈ)
lib/android_sdk.js 96.00% <ΓΈ> (ΓΈ)
lib/build.js 39.60% <ΓΈ> (ΓΈ)
lib/builders/builders.js 100.00% <ΓΈ> (ΓΈ)
lib/check_reqs.js 70.37% <ΓΈ> (ΓΈ)
lib/config/GradlePropertiesParser.js 86.27% <ΓΈ> (ΓΈ)
lib/emulator.js 98.43% <ΓΈ> (ΓΈ)
... and 11 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Ξ” = absolute <relative> (impact), ΓΈ = not affected, ? = missing data
Powered by Codecov. Last update f6d1dee...98cbe0c. Read the comment docs.

Copy link
Member

@erisu erisu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • The changes LGTM
  • I confirmed that the tests are passing.
  • I created a new cordova app & added the platform.
  • I built the default project

@raphinesse raphinesse merged commit 16ff6e1 into apache:master Jul 13, 2021
@raphinesse raphinesse deleted the do-not-copy-js-lib branch July 13, 2021 09:01
zachawilson added a commit to SwitchCaseGroup/cordova-paramedic that referenced this pull request Aug 4, 2021
zachawilson added a commit to SwitchCaseGroup/cordova-paramedic that referenced this pull request Aug 26, 2021
wedgberto pushed a commit to wedgberto/cordova-android that referenced this pull request May 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants