添加测试打包脚本及代码
parent
ad3099ca40
commit
6ad2a13133
|
|
@ -363,6 +363,88 @@ internal class BatchBuild
|
|||
throw;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 批处理构建Resources和Player 测试YAML TODO:合并删除
|
||||
/// jenkins打包新包时使用该方法
|
||||
/// </summary>
|
||||
public static void BuildContentAndPlayerYamlTest()
|
||||
{
|
||||
try
|
||||
{
|
||||
InitChannelConfigFromYaml();
|
||||
|
||||
bool enableHotUpdate = YooAssetBuildBase.Init();
|
||||
string bundleVersionCode = GetBundleVersionCode();
|
||||
|
||||
// 写入版本信息到Resources/LocalInfo.json
|
||||
UpdateLocalInfo info = new()
|
||||
{
|
||||
workSpace = YooAssetBuildBase.workSpace,
|
||||
accessKeyId = YooAssetBuildBase.appConfigAccessKeyId,
|
||||
accessKeySecret = YooAssetBuildBase.appConfigAccessKeySecret,
|
||||
bucketName = YooAssetBuildBase.appConfigBucketName,
|
||||
configOriginalUrl = YooAssetBuildBase.appConfigURL,
|
||||
//httpUrl = YooAssetBuildBase.httpURL,
|
||||
httpAccessKey = YooAssetBuildBase.httpAccessKey,
|
||||
httpKey = YooAssetBuildBase.httpKey,
|
||||
version = YooAssetBuildBase.appVersion,
|
||||
isDev = YooAssetBuildBase.isDev,
|
||||
buildTicks = DateTime.Now.Ticks,
|
||||
buildCode = bundleVersionCode,
|
||||
};
|
||||
PackDataInst.CreateResourceJson(info);
|
||||
|
||||
BuildTargetGroup currentTargetGroup =
|
||||
BuildPipeline.GetBuildTargetGroup(EditorUserBuildSettings.activeBuildTarget);
|
||||
string defines = PlayerSettings.GetScriptingDefineSymbolsForGroup(currentTargetGroup);
|
||||
|
||||
// 写入打包信息到Yoo_Build_Cache
|
||||
#if DEVELOPMENT_BUILD || DEBUG
|
||||
ExtBuildInfoHelper.CreateFirstExtBuildInfo(info.buildTicks, info.workSpace, info.version, info.buildCode,
|
||||
true, defines);
|
||||
#else
|
||||
ExtBuildInfoHelper.CreateFirstExtBuildInfo(info.buildTicks, info.workSpace, info.version, false, defines);
|
||||
#endif
|
||||
|
||||
BuildLauncher.SetEnableHotUpdate(enableHotUpdate);
|
||||
if (enableHotUpdate)
|
||||
BuildLauncher.BuildHotUpdateDlls();
|
||||
|
||||
YooAssetBuildBase.BuildContentAndPlayer();
|
||||
|
||||
// 写入打包信息到Yoo_Build_Cache
|
||||
ExtBuildInfoHelper.CreateVertifyBuildInfo(info.workSpace, info.version);
|
||||
|
||||
// 还原宏
|
||||
_RevertScriptDefines();
|
||||
|
||||
#region 打整包时缓存当前版本的AotDll
|
||||
|
||||
string aotDllStorePath = GetAotDllStorePath(info.workSpace, info.version);
|
||||
string aotDllPath = SettingsUtil.GetAssembliesPostIl2CppStripDir(EditorUserBuildSettings.activeBuildTarget);
|
||||
DirectoryInfo dir = new(aotDllPath);
|
||||
if (Directory.Exists(aotDllStorePath))
|
||||
Directory.Delete(aotDllStorePath, true);
|
||||
|
||||
Directory.CreateDirectory(aotDllStorePath);
|
||||
|
||||
FileInfo[] files = dir.GetFiles();
|
||||
foreach (FileInfo file in files)
|
||||
{
|
||||
file.CopyTo(Path.Combine(aotDllStorePath, file.Name), false);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
PostLoginKey(info.workSpace, info.buildTicks, info.version); // 上传Aot loginKey
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
//Build Exception用于在日志文件中定位此次打包的异常
|
||||
Debug.LogError($"[Build Exception]:{e.Message} \r\n {e.StackTrace}");
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 批处理增量更新资源
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
Subproject commit 068a38ac5346d9eeb2bd317689c5fdc5b0546400
|
||||
Subproject commit 652eba482a256718ae763d23941d66832e45a507
|
||||
Loading…
Reference in New Issue