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

build: improve cordova-js version ID in built file #230

Merged
merged 1 commit into from
Dec 1, 2020

Conversation

raphinesse
Copy link
Contributor

@raphinesse raphinesse commented Sep 19, 2020

Motivation and Context

Currently the SHA of the commit pointed to by HEAD is included in the built cordova.js file to identify the version of cordova-js used to build it. If platforms depend on cordova-js in the future (see #169 & #229), they will most likely depend on published packages. Consequently there will be no cordova-js repo to get aforementioned information from.

To make things worse, git will automatically use a repo in any parent dir. So if you have cordova-android/ containing .git/ and node_modules/cordova-js/, the old implementation would use the HEAD of cordova-android/.git/ to describe cordova-js.

Thus, we now include the version from package.json instead in that case.

Description

  • uses git describe instead of git rev-parse HEAD if in a cordova-js repo
  • fall back to version from package.json if not in a cordova-js repo
  • rename and factor out build-id

Testing

Manually tested both cases.

@raphinesse

This comment has been minimized.

Copy link
Member

@timbru31 timbru31 left a comment

Choose a reason for hiding this comment

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

LGTM, I'd like to have a second pair of eyes though.

- uses `git describe` instead of `git rev-parse HEAD`
- fallback to version from package.json if not in a cordova-js repo
- rename and factor out buildId
@codecov-io
Copy link

codecov-io commented Dec 1, 2020

Codecov Report

Merging #230 (b49e90b) into master (f1ec5af) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #230   +/-   ##
=======================================
  Coverage   84.23%   84.23%           
=======================================
  Files          14       14           
  Lines         539      539           
=======================================
  Hits          454      454           
  Misses         85       85           

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 f1ec5af...b49e90b. Read the comment docs.

@raphinesse
Copy link
Contributor Author

Since the second pair of eyes never came I'm just going to merge this now 😉

@raphinesse raphinesse merged commit ad5b74a into apache:master Dec 1, 2020
@raphinesse raphinesse deleted the better-build-id branch December 1, 2020 09:21
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.

3 participants