我们构建了一个工具来同步程序集、Android 和 iOS 之间的版本;我刚刚将其推送到我们的 GitHub 存储库:https://github.com/soltechinc/soltechxf/ https://github.com/soltechinc/soltechxf/。如果您克隆该存储库并构建 UpdateVersionInfo,它应该可以满足您的要求。
UpdateVersionInfo.exe:
-? Shows help/usage information.
-v, --major=VALUE A numeric major version number greater than zero.
-m, --minor=VALUE A numeric minor number greater than zero.
-b, --build=VALUE A numeric build number greater than zero.
-r, --revision=VALUE A numeric revision number greater than zero.
-p, --path=VALUE The path to a C# file to update with version
information.
-a, --androidManifest=VALUE The path to an android manifest file to update
with version information.
-t, --touchPlist=VALUE The path to an iOS plist file to update with
version information.
默认版本(即,如果您未提供任何参数,您将获得的版本)是 1.0.0.0。
该工具可以使用文件的相对或绝对路径,我的建议是遵循听起来像您正在使用的方法:拥有一个作为链接文件(或在共享项目中)包含的 version.cs 文件,并删除该 Version.cs 文件中包含的任何 AssemblyInfo 属性。
我应该补充一下;该工具当前假设您将更新 iOS 和 Android 项目以及 C# 代码。 (我刚刚给自己添加了一张便利贴,使这些成为可选的。)
编辑:刚刚注意到过去的安迪已经注意到了这一点并处理了它(这是一个惊喜;我通常对过去的安迪大喊脏话......)。如果您不提供 Android 清单或 iOS Info.plist 的路径,它将跳过它们。