2021-07-21 16:45:56 +08:00
|
|
|
|
using System.IO;
|
|
|
|
|
using TapTap.Common.Editor;
|
|
|
|
|
using UnityEditor;
|
|
|
|
|
using UnityEditor.Callbacks;
|
|
|
|
|
using UnityEngine;
|
|
|
|
|
|
|
|
|
|
namespace TapTap.Login.Editor
|
|
|
|
|
{
|
|
|
|
|
public static class TapLoginIOSProcessor
|
|
|
|
|
{
|
|
|
|
|
// 添加标签,unity导出工程后自动执行该函数
|
|
|
|
|
[PostProcessBuild(103)]
|
|
|
|
|
public static void OnPostprocessBuild(BuildTarget buildTarget, string path)
|
|
|
|
|
{
|
|
|
|
|
if (buildTarget != BuildTarget.iOS) return;
|
|
|
|
|
|
|
|
|
|
// 获得工程路径
|
|
|
|
|
var projPath = TapCommonCompile.GetProjPath(path);
|
|
|
|
|
var proj = TapCommonCompile.ParseProjPath(projPath);
|
|
|
|
|
var target = TapCommonCompile.GetUnityTarget(proj);
|
|
|
|
|
|
|
|
|
|
if (TapCommonCompile.CheckTarget(target))
|
|
|
|
|
{
|
|
|
|
|
Debug.LogError("Unity-iPhone is NUll");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var parentFolder = Directory.GetParent(Application.dataPath)?.FullName;
|
|
|
|
|
var plistFile = TapFileHelper.RecursionFilterFile(parentFolder + "/Assets/Plugins/", "TDS-Info.plist");
|
|
|
|
|
|
|
|
|
|
if (!plistFile.Exists)
|
|
|
|
|
{
|
|
|
|
|
Debug.LogError("TapSDK Can't find TDS-Info.plist in Project/Assets/Plugins/!");
|
|
|
|
|
}
|
2021-10-15 14:54:44 +08:00
|
|
|
|
|
2021-07-21 16:45:56 +08:00
|
|
|
|
TapCommonCompile.HandlerPlist(path, plistFile.FullName);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|