【包配置】修改专服包的母包功能

dev_chengFeng
gaoxin 2021-08-31 15:26:22 +08:00
parent 8a0b1c80a2
commit 6e79e38b75
2 changed files with 29 additions and 33 deletions

View File

@ -15,7 +15,7 @@ public class AutoPack : EditorWindow
// 专服
new string[]{ "C轮v2", "Logo_gm_nosdk", "TCX_TEST_C_V2", "china/zf_test"},
new string[]{ "灵动专服-测试", "Logo_gn_zf_test", "MHT_GN_ZF_TEST" , "china/zf_test"},
new string[]{ "灵动专服-正式", "Logo_gn_zf_release", "MHT_GN_ZF_RELEASE" , "china/zf_test"},
new string[]{ "灵动专服-正式", "Logo_gn_zf_release", "MHT_GN_ZF_RELEASE3" , "china/zf_test"},
new string[]{ "喜扑", "Logo_cn_xipu", "MHT_CN_XIPU", "china/zf_test"},
new string[]{ "草花", "Logo_cn_caohua", "MHT_CN_MIDDLE_WARE" , "china/zf_test"},
new string[]{ "游心", "Logo_cn_youxin", "MHT_CN_YOUXIN", "china/zf_test"},

View File

@ -32,9 +32,7 @@ using UnityEngine;
#if UNITY_EDITOR
using UnityEditor;
using UnityEditor.Callbacks;
#endif
#if UNITY_IOS
using UnityEditor.iOS.Xcode;
//using UnityEditor.iOS.Xcode;
#endif
using System.IO;
using ThinkingAnalytics.TaException;
@ -290,42 +288,40 @@ namespace ThinkingAnalytics
[PostProcessBuildAttribute(88)]
public static void onPostProcessBuild(BuildTarget target, string targetPath)
{
#if EDITOR_IOS
if (target != BuildTarget.iOS)
{
Debug.LogWarning("Target is not iPhone. XCodePostProcess will not run");
return;
}
// if (target != BuildTarget.iOS)
// {
// Debug.LogWarning("Target is not iPhone. XCodePostProcess will not run");
// return;
// }
string projPath = Path.GetFullPath(targetPath) + "/Unity-iPhone.xcodeproj/project.pbxproj";
// string projPath = Path.GetFullPath(targetPath) + "/Unity-iPhone.xcodeproj/project.pbxproj";
UnityEditor.iOS.Xcode.PBXProject proj = new UnityEditor.iOS.Xcode.PBXProject();
proj.ReadFromFile(projPath);
#if UNITY_2019_3_OR_NEWER
string targetGuid = proj.GetUnityFrameworkTargetGuid();
#else
string targetGuid = proj.TargetGuidByName(PBXProject.GetUnityTargetName());
#endif
// UnityEditor.iOS.Xcode.PBXProject proj = new UnityEditor.iOS.Xcode.PBXProject();
// proj.ReadFromFile(projPath);
//#if UNITY_2019_3_OR_NEWER
// string targetGuid = proj.GetUnityFrameworkTargetGuid();
//#else
// string targetGuid = proj.TargetGuidByName(PBXProject.GetUnityTargetName());
//#endif
//Build Property
proj.SetBuildProperty(targetGuid, "ENABLE_BITCODE", "NO");//BitCode NO
proj.SetBuildProperty(targetGuid, "GCC_ENABLE_OBJC_EXCEPTIONS", "YES");//Enable Objective-C Exceptions
// //Build Property
// proj.SetBuildProperty(targetGuid, "ENABLE_BITCODE", "NO");//BitCode NO
// proj.SetBuildProperty(targetGuid, "GCC_ENABLE_OBJC_EXCEPTIONS", "YES");//Enable Objective-C Exceptions
string[] headerSearchPathsToAdd = { "$(SRCROOT)/Libraries/Plugins/iOS/ThinkingSDK/Source/main", "$(SRCROOT)/Libraries/Plugins/iOS/ThinkingSDK/Source/common" };
proj.UpdateBuildProperty(targetGuid, "HEADER_SEARCH_PATHS", headerSearchPathsToAdd, null);// Header Search Paths
// string[] headerSearchPathsToAdd = { "$(SRCROOT)/Libraries/Plugins/iOS/ThinkingSDK/Source/main", "$(SRCROOT)/Libraries/Plugins/iOS/ThinkingSDK/Source/common" };
// proj.UpdateBuildProperty(targetGuid, "HEADER_SEARCH_PATHS", headerSearchPathsToAdd, null);// Header Search Paths
//Add Frameworks
proj.AddFrameworkToProject(targetGuid, "WebKit.framework", true);
proj.AddFrameworkToProject(targetGuid, "CoreTelephony.framework", true);
proj.AddFrameworkToProject(targetGuid, "SystemConfiguration.framework", true);
proj.AddFrameworkToProject(targetGuid, "Security.framework", true);
// //Add Frameworks
// proj.AddFrameworkToProject(targetGuid, "WebKit.framework", true);
// proj.AddFrameworkToProject(targetGuid, "CoreTelephony.framework", true);
// proj.AddFrameworkToProject(targetGuid, "SystemConfiguration.framework", true);
// proj.AddFrameworkToProject(targetGuid, "Security.framework", true);
//Add Lib
proj.AddFileToBuild(targetGuid, proj.AddFile("usr/lib/libsqlite3.tbd", "libsqlite3.tbd", PBXSourceTree.Sdk));
proj.AddFileToBuild(targetGuid, proj.AddFile("usr/lib/libz.tbd", "libz.tbd", PBXSourceTree.Sdk));
// //Add Lib
// proj.AddFileToBuild(targetGuid, proj.AddFile("usr/lib/libsqlite3.tbd", "libsqlite3.tbd", PBXSourceTree.Sdk));
// proj.AddFileToBuild(targetGuid, proj.AddFile("usr/lib/libz.tbd", "libz.tbd", PBXSourceTree.Sdk));
proj.WriteToFile(projPath);
#endif
// proj.WriteToFile(projPath);
}
#endif