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

Smarter way to set Cordova platform version number #50

Open
brodycj opened this issue Nov 19, 2018 · 3 comments
Open

Smarter way to set Cordova platform version number #50

brodycj opened this issue Nov 19, 2018 · 3 comments
Labels
enhancement New feature or request

Comments

@brodycj
Copy link

brodycj commented Nov 19, 2018

I find it really unfortunate that we have to use tooling to set Cordova platform versions in multiple places such as package.json, generated cordova.js, VERSION file, Android Gradle file, etc.

I think it should be relatively straightforward to update the Cordova tooling so that we can mark the version in package.json and the scripts would generate the platform files with the correct version where it is needed whenever the user does cordova platform add.

And I suspect that in Gradle we should be able to define a constant or variable with the version in one place and reference it in the other places.

@janpio
Copy link
Member

janpio commented Nov 19, 2018

What does "mark a version" mean exactly? Set the version numbers?
Isn't there already a command that does all the replacing in coho?

@brodycj brodycj changed the title Smarter way to mark Cordova platform versions Smarter way to set Cordova platform version number Nov 19, 2018
@brodycj brodycj added the enhancement New feature or request label Nov 19, 2018
@brodycj
Copy link
Author

brodycj commented Nov 19, 2018

Set the version numbers?

Yes, just edited title & description to reflect the answer

Isn't there already a command that does all the replacing in coho?

Yes and I do not find it 100% satisfactory for the following reasons:

  • It updates cordova.js by regenerating it from the master branch of cordova-js. I would like to have better control over when it updates the behavior of cordova.js. For example, the master branch of cordova-js has changes to remove browserify, with version 5.0.0-dev, which I think is not wanted in a patch release. I have my own fork, with changes in [WIP] Platform Release: Improve patch and dev version support cordova-coho#188 (WIP PR) that I can use to generate from a specific cordova-js version but find this whole step to be a bit clumsy and non-intuitive.
  • cordova-coho seems to make the updates in multiple commits. While it would be straightforward for a developer to squash the commits I find this to be clumsy as well.

My idea is that we can set the desired version number in one place, and the scripts would generate the platform files with the right version numbers whenver the user does cordova platform add. I think this should be very straightforward with help from existing npm packages. I can raise a PR to demonstrate this idea if desired.

@janpio
Copy link
Member

janpio commented Nov 19, 2018

... generate the platform files with the right version numbers whenver the user does cordova platform add

Cordova platforms historically should also work as packaged downloads without using the CLI, so I think this is not really an option.

Looking at why we need those versions in so many places seems like a valid thing to do though.

brodycj pushed a commit to brodycj/cordova-android that referenced this issue Nov 19, 2018
NOTE: The version was manually updated in the following files:
* RELEASENOTES.md
* VERSION
* bin/templates/cordova/version
* bin/templates/project/assets/www/cordova.js
* framework/build.gradle
* framework/src/org/apache/cordova/CordovaWebView.java
* package.json

with help from git & bash tricks based on changes in the following
commits for 7.1.2 & 7.1.3-dev versions:
- 725e75f
- f86519b

FUTURE TBD: it is desired that we can set the version in
one place as discussed in: apache/cordova#50
erisu pushed a commit to erisu/cordova-android that referenced this issue Jul 21, 2021
NOTE: The version was manually updated in the following files:
* RELEASENOTES.md
* VERSION
* bin/templates/cordova/version
* bin/templates/project/assets/www/cordova.js
* framework/build.gradle
* framework/src/org/apache/cordova/CordovaWebView.java
* package.json

with help from git & bash tricks based on changes in the following
commits for 7.1.2 & 7.1.3-dev versions:
- 725e75f
- f86519b

FUTURE TBD: it is desired that we can set the version in
one place as discussed in: apache/cordova#50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants