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

Storing Versions #24

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions storing-versions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Storing Versions

Usually npm based packages, as Apache Cordova uses to distribute its components, store the version in a `version` field of the `package.json` file. For various reasons, some of Cordova's packages also store the version string in other locations:

## Details

### Platforms

- `VERSION` file in the root of the repository or native library. When a platform is installed, `package.json` is not copied over, so `VERSION` is used to find out what version of a platform is actually installed
- `bin/templates/scripts/cordova/version` (or equivalent script per platform) has another copy
- Platform specific:
- Android
- `build.gradle` has `version` or similar
- `.java` file that has a `CORDOVA_VERSION`
- iOS
- `CDVAvailability.h` has two `#define` lines that list the version

### Plugins

- `plugin.xml`, `version` attribute of `plugin` tag
- Plugins contains a `tests` "plugin" that has its own `package.json` and `plugin.xml` that has a synchronized version string as the main plugin

## Automation

- Updating of these version strings should be automated and not a manual task
- `updateRepoVersion` method of `cordova-coho` contains a list of locations that are updated by tooling
- https://github.com/apache/cordova-coho/blob/master/src/versionutil.js#L90
- Also other method
- https://github.com/apache/cordova-coho/blob/master/src/platform-release.js#L107