| | |
| | | switch (m_UserData.m_BuildTarget)
|
| | | {
|
| | | case ValidBuildTarget.Android:
|
| | | return StringUtility.Contact("Assets/StreamingAssets", "/android");
|
| | | return StringUtility.Concat("Assets/StreamingAssets", "/android");
|
| | | case ValidBuildTarget.iOS:
|
| | | return StringUtility.Contact("Assets/StreamingAssets", "/ios");
|
| | | return StringUtility.Concat("Assets/StreamingAssets", "/ios");
|
| | | case ValidBuildTarget.StandaloneWindows:
|
| | | case ValidBuildTarget.StandaloneWindows64:
|
| | | return StringUtility.Contact("Assets/StreamingAssets", "/standalone");
|
| | | return StringUtility.Concat("Assets/StreamingAssets", "/standalone");
|
| | | default:
|
| | | return "Assets/StreamingAssets";
|
| | | }
|
| | |
| | | {
|
| | | UpdateScriptableObjectsSetting.SetAllScriptableObjectAssetBundleName();
|
| | | ExcuteBuildAsset("config");
|
| | | TableTool.CopyConfigsToOutPutPath(StringUtility.Contact(m_UserData.m_OutputPath, "/config"));
|
| | | TableTool.CopyConfigsToOutPutPath(StringUtility.Concat(m_UserData.m_OutputPath, "/config"));
|
| | | Debug.Log("config 处理完成");
|
| | | }
|
| | | //发包时获取热更dll和裁剪AOT
|
| | |
| | | PrebuildCommand.GenerateAll();
|
| | | // 输出到AssetBundles目录
|
| | | var outputPath = Application.dataPath.Replace("Assets", m_UserData.m_OutputPath);
|
| | | outputPath = StringUtility.Contact(outputPath, "/logicbytes");
|
| | | outputPath = StringUtility.Concat(outputPath, "/logicbytes");
|
| | | if (Directory.Exists(outputPath))
|
| | | Directory.Delete(outputPath, true);
|
| | | //复制新生成的AOT dll到指定路径
|
| | |
| | | }
|
| | | // 输出到AssetBundles目录
|
| | | var outputPath = Application.dataPath.Replace("Assets", m_UserData.m_OutputPath);
|
| | | outputPath = StringUtility.Contact(outputPath, "/logicbytes");
|
| | | outputPath = StringUtility.Concat(outputPath, "/logicbytes");
|
| | | CopyHotUpdateDll(outputPath);
|
| | | MakeBytesVersionFile();
|
| | | AssetDatabase.Refresh();
|
| | |
| | | private void MakeBytesVersionFile()
|
| | | {
|
| | | var fileInfos = new List<FileInfo>();
|
| | | FileExtersion.GetAllDirectoryFileInfos(StringUtility.Contact(m_UserData.m_OutputPath, "/logicbytes"), fileInfos);
|
| | | FileExtersion.GetAllDirectoryFileInfos(StringUtility.Concat(m_UserData.m_OutputPath, "/logicbytes"), fileInfos);
|
| | | BytesVersionMaker.WriteAssetsVersionFile(Path.Combine(Directory.GetParent(Application.dataPath).FullName, m_UserData.m_OutputPath), fileInfos);
|
| | | Debug.Log("热更新代码更新完毕,生成md5文件");
|
| | | }
|
| | |
| | | //HybridCLR Settings面板上设置的裁减后AOT dll输出根目录
|
| | | string strippedAOTDllOutputRootDir = "/" + HybridCLRSettings.Instance.strippedAOTDllOutputRootDir;
|
| | | //重新生成的AOT所在路径
|
| | | string aotDir = StringUtility.Contact(rootDir, strippedAOTDllOutputRootDir, platformName);
|
| | | string aotDir = StringUtility.Concat(rootDir, strippedAOTDllOutputRootDir, platformName);
|
| | |
|
| | | if (Directory.Exists(checkAotDir))
|
| | | {
|
| | |
| | |
|
| | | for (int i = 0; i < AOTGenericReferences.PatchedAOTAssemblyList.Count; i++)
|
| | | {
|
| | | string dllFile = StringUtility.Contact(aotDir, AOTGenericReferences.PatchedAOTAssemblyList[i]);
|
| | | string dllFile = StringUtility.Concat(aotDir, AOTGenericReferences.PatchedAOTAssemblyList[i]);
|
| | | var outDllFile = outputPath + "/" + AOTGenericReferences.PatchedAOTAssemblyList[i] + ".bytes";
|
| | | if (!File.Exists(dllFile))
|
| | | {
|
| | |
| | | //HybridCLR Settings面板上设置的热更新dll编译输出根目录
|
| | | string hotUpdateDllCompileOutputRootDir = "/" + HybridCLRSettings.Instance.hotUpdateDllCompileOutputRootDir;
|
| | | //热更DLL生成目录
|
| | | string hotDllDir = StringUtility.Contact(rootDir, hotUpdateDllCompileOutputRootDir, platformName);
|
| | | string hotDllDir = StringUtility.Concat(rootDir, hotUpdateDllCompileOutputRootDir, platformName);
|
| | | //HybridCLR的Settings面板上设置的热更新Assembly Definitions 资源
|
| | | var assemblyDefinitionAsset = HybridCLRSettings.Instance.hotUpdateAssemblyDefinitions;
|
| | | for (int i = 0; i < assemblyDefinitionAsset.Length; i++)
|
| | |
| | | string assemblyPath = AssetDatabase.GetAssetPath(assemblyDefinitionAsset[i]);
|
| | | string assemblyName = Path.GetFileNameWithoutExtension(assemblyPath);
|
| | |
|
| | | string dllFile = StringUtility.Contact(hotDllDir, assemblyName, ".dll");
|
| | | string dllFile = StringUtility.Concat(hotDllDir, assemblyName, ".dll");
|
| | | var outDllFile = outputPath + "/" + assemblyName + ".dll.bytes";
|
| | | if (!File.Exists(dllFile))
|
| | | {
|
| | |
| | | string[] hotUpdateAssemblies = HybridCLRSettings.Instance.hotUpdateAssemblies;
|
| | | for (int i = 0; i < hotUpdateAssemblies.Length; i++)
|
| | | {
|
| | | string dllFile = StringUtility.Contact(hotDllDir, hotUpdateAssemblies[i], ".dll");
|
| | | string dllFile = StringUtility.Concat(hotDllDir, hotUpdateAssemblies[i], ".dll");
|
| | | var outDllFile = outputPath + "/" + hotUpdateAssemblies[i] + ".dll.bytes";
|
| | | if (!File.Exists(dllFile))
|
| | | {
|
| | |
| | | string[] preserveHotUpdateAssemblies = HybridCLRSettings.Instance.preserveHotUpdateAssemblies;
|
| | | for (int i = 0; i < preserveHotUpdateAssemblies.Length; i++)
|
| | | {
|
| | | string dllFile = StringUtility.Contact(hotDllDir, preserveHotUpdateAssemblies[i], ".dll");
|
| | | string dllFile = StringUtility.Concat(hotDllDir, preserveHotUpdateAssemblies[i], ".dll");
|
| | | var outDllFile = outputPath + "/" + preserveHotUpdateAssemblies[i] + ".dll.bytes";
|
| | | if (!File.Exists(dllFile))
|
| | | {
|
| | |
| | |
|
| | | private void ExecuteSwitchVersionConfig()
|
| | | {
|
| | | var newVersionConfigPath = StringUtility.Contact("Assets/Resources/ScriptableObject/Config/VersionConfig", ".asset");
|
| | | var newVersionConfigPath = StringUtility.Concat("Assets/Resources/ScriptableObject/Config/VersionConfig", ".asset");
|
| | | var versionsFilePath = Application.dataPath + Path.DirectorySeparatorChar + "Editor/VersionConfigs/Versions.txt";
|
| | |
|
| | | var lines = File.ReadAllLines(versionsFilePath);
|