@vulksoft/nativescript-hook-versioning
处理您的清单和 plist 版本。
npm i --save @vulksoft/nativescript-hook-versioning

Nativescript Hook Versioning

npm

此插件添加了一个钩子,执行以下操作

  • nativescript.config.ts 获取您的 version 并将其作为 versionName 放入您的 AndroidManifest.xml,并作为 CFBundleShortVersionString 放入您的 Info.plist
  • 选择一个环境变量并将其作为 versionCode 放入您的 AndroidManifest.xml,并作为 CFBundleVersion 放入您的 Info.plist。这允许您从 CICD 中使用环境变量并自动增加版本代码。

安装

ns plugin add nativescript-hook-versioning

用法

您可以将以下配置添加到您的 nativescript.config.ts

nativescriptHookVersioning: {
versionName: true,
versionCode: {
enabled: true,
content: 'BUNDLE_VERSION_CODE', // This can contains '+ANY_NUMBER' if you need to increment your versionCode.
},
},

以根据您的喜好进行配置。