fix: 版本号规则更新
This commit is contained in:
@@ -22,8 +22,17 @@ public class VersionIncrementer : IPreprocessBuildWithReport
|
||||
int build = int.Parse(versionParts[3]);
|
||||
|
||||
// 更新版本号
|
||||
string date = DateTime.Now.ToString("yyyyMMdd-HHmmss");
|
||||
PlayerSettings.bundleVersion = $"{major}.{minor}.{revision}.{build + 1}-{date}";
|
||||
string incrementedVersion = $"{major}.{minor}.{revision}.{build + 1}";
|
||||
bool isDevelopmentBuild = (report.summary.options & BuildOptions.Development) != 0;
|
||||
|
||||
if (isDevelopmentBuild)
|
||||
{
|
||||
string timestamp = DateTime.Now.ToString("yyyyMMdd-HHmmss");
|
||||
incrementedVersion = $"{incrementedVersion}-{timestamp}-DEV";
|
||||
}
|
||||
|
||||
PlayerSettings.bundleVersion = incrementedVersion;
|
||||
Debug.Log($"[VersionIncrementer] bundleVersion: {incrementedVersion}");
|
||||
|
||||
if (report.summary.platform == BuildTarget.Android)
|
||||
{
|
||||
@@ -32,4 +41,4 @@ public class VersionIncrementer : IPreprocessBuildWithReport
|
||||
Debug.Log($"[VersionIncrementer] Android versionCode: {versionCode} -> {versionCode + 1}");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user