{"id":19220065,"url":"https://github.com/nativescript-community/set-version","last_synced_at":"2025-05-13T01:10:58.807Z","repository":{"id":54284348,"uuid":"221942587","full_name":"nativescript-community/set-version","owner":"nativescript-community","description":null,"archived":false,"fork":false,"pushed_at":"2024-10-19T07:40:03.000Z","size":155,"stargazers_count":4,"open_issues_count":7,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-20T21:36:03.176Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nativescript-community.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2019-11-15T14:41:23.000Z","updated_at":"2024-10-19T07:40:06.000Z","dependencies_parsed_at":"2024-07-10T23:14:36.899Z","dependency_job_id":"af898ff3-b353-4191-89d5-73d4cf8164c9","html_url":"https://github.com/nativescript-community/set-version","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nativescript-community%2Fset-version","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nativescript-community%2Fset-version/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nativescript-community%2Fset-version/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nativescript-community%2Fset-version/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nativescript-community","download_url":"https://codeload.github.com/nativescript-community/set-version/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253851070,"owners_count":21973674,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-09T14:33:52.006Z","updated_at":"2025-05-13T01:10:58.787Z","avatar_url":"https://github.com/nativescript-community.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# nativescript-set-version\n\n [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\nThis tool allows you to easily update the version of a Nativescript application.\nIt will update the following files if found:\n\n- **./package.json**\n- **./app/App_Resources/Android/src/main/AndroidManifest.xml**\n- **./app/App_Resources/Android/app/app.gradle**\n- **./app/App_Resources/iOS/Info.plist**\n\n## Version number format\n\nIn order to use this package, your project version must comply with the format described on [semver.org](https://semver.org/).\n\n## Setup and Usage\n\nThere are two ways to install nativescript-set-version: globally and locally.\n\n### Local Installation\n\nThis is the recommended way to install nativescript-set-version.\n\nnpm:\n\n```bash\nnpm install nativescript-set-version --save-dev\n```\n\nyarn:\n\n```bash\nyarn add nativescript-set-version --dev\n```\n\nYou can then use this command in your project directory to run nativescript-set-version:\n\nnpm:\n\n```bash\n$ npm run setVersion \u003cversion\u003e\n-- or --\n$ npm run set-version \u003cversion\u003e\n```\n\nyarn:\n\n```bash\n$ yarn setVersion \u003cversion\u003e\n-- or --\n$ yarn set-version \u003cversion\u003e\n```\n\n### Global Installation\n\nThis installation method allows you to use nativescript-set-version in any project.\n\nnpm:\n\n```bash\nnpm install -g nativescript-set-version\n```\n\nyarn:\n\n```bash\nyarn global add nativescript-set-version\n```\n\nYou can then use this command in your project directory to run nativescript-set-version:\n\n```bash\nsetVersion \u003cversion\u003e\n-- or --\nset-version \u003cversion\u003e\n```\n\n## Behaviour\n\nWhen invoked, nativescript-set-version will make the following changes to your project files:\n\n### Update Package Version\n\nThe **version** attribute in `package.json` will be updated with the specified version.\n\n### Update Android Project Version\n\nIt will update the **version name** and the **version code** in both `app.gradle` and `AndroidManifest.xml`.\n\n#### About AndroidManifest.xml\n\nVersion information should not be in the `AndroidManifest.xml` since this information is overridden by `app.gradle`.\n\nSee https://developer.android.com/studio/publish/versioning for further informations.\n\nFor that reason `nativescript-set-version` will only write in the `AndroidManifest.xml` if `android:versionCode` and/or `android:versionName` are already in the file.\n\n### Update iOS Project Version\n\nIt will update the **CFBundleShortVersionString** and the **CFBundleVersion** in `Info.plist`.\n\n### How the version code and CFBundleVersion are updated\n\nThe Android version code represents your version number as an integer. This\npackage uses the following format to generate this integer:\n\n```\n\u003cMAJOR\u003e\u003cMINOR ON 2 DIGITS\u003e\u003cPATCH ON 2 DIGITS\u003e\u003cBUILD NUMBER\u003e\n```\n\nFor instance, the first time you call `set-version 3.1.4`, it will produce the version code `301041`.\n\nIf you call the command with the same version a second time, it will increment the build number, to produce `301042`.\n\nThis also applies if, for instance, you call `set-version 3.1.4-rc.1`, and then `set-version 3.1.4-rc.2`.\n\nAs for the `CFBundleVersion` on iOS, it will produce a string in the format `\u003cMAJOR\u003e.\u003cMINOR\u003e.\u003cPATCH\u003e.\u003cBUILD NUMBER\u003e`.\n\nExample:\n\n```bash\n$ yarn set-version 1.0.0-rc.1\n# Output\n# ...\n# Will set android version code to 100001\n# ...\n# Will set CFBundleVersion to 1.0.0.1\n$ yarn set-version 1.0.0-rc.2\n# Output\n# ...\n# Will set android version code to 100002\n# ...\n# Will set CFBundleVersion to 1.0.0.2\n$ yarn set-version 1.0.0\n# Output\n# ...\n# Will set android version code to 100003\n# ...\n# Will set CFBundleVersion to 1.0.0.3\n```\n\n## License\n\nThis software uses the [MIT license](LICENSE.txt).\n\n## Contributing\n\nYou must use the following style guide:\n\n- [Airbnb JavaScript Style Guide](https://github.com/airbnb/javascript)\n\nThis project contains a linting config, you should setup `eslint` into your IDE with `.eslintrc.js`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnativescript-community%2Fset-version","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnativescript-community%2Fset-version","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnativescript-community%2Fset-version/lists"}