|
2 | 2 | using UnityEditor; |
3 | 3 | using UnityEditor.Callbacks; |
4 | 4 | using UnityEditor.iOS.Xcode; |
| 5 | +using System; |
| 6 | +using System.Diagnostics; |
5 | 7 | using System.IO; |
6 | 8 | using UnityEditor.iOS.Xcode.Extensions; |
7 | 9 | using UnityEngine; |
@@ -31,10 +33,12 @@ public static void OnPostProcessBuild(BuildTarget buildTarget, string buildPath) |
31 | 33 | EnableBitcode(pbxProject, unityProjectGuid, false); |
32 | 34 |
|
33 | 35 | string bridgePath="Libraries/ConsentManagementProvider/Plugins/iOS/Source/SwiftBridge.swift"; |
| 36 | + string newBridgePath="Pods/ConsentViewController/ConsentViewController/Classes/SwiftBridge.swift"; |
34 | 37 | RemoveBridge(pbxProject,bridgePath); |
| 38 | + ExecuteProcessTerminal("mv "+buildPath+"/"+bridgePath+" "+buildPath+"/"+newBridgePath); |
35 | 39 | pbxProject.WriteToFile(projPath); |
36 | 40 |
|
37 | | - AddBridgeToPods(buildPath, bridgePath); |
| 41 | + AddBridgeToPods(buildPath, newBridgePath); |
38 | 42 |
|
39 | 43 | string plistPath = buildPath + "/Info.plist"; |
40 | 44 | AddParameterToInfoPlist(plistPath); |
@@ -120,5 +124,34 @@ static void EnableSwift(PBXProject pbxProject, string targetGuid) |
120 | 124 | pbxProject.AddBuildProperty(targetGuid, "COREML_CODEGEN_LANGUAGE", "Swift"); |
121 | 125 | pbxProject.AddBuildProperty(targetGuid, "ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES", "YES"); |
122 | 126 | } |
| 127 | + |
| 128 | + private static void ExecuteProcessTerminal(string argument) |
| 129 | + { |
| 130 | + try |
| 131 | + { |
| 132 | + UnityEngine.Debug.Log("============== Start Executing [" + argument + "] ==============="); |
| 133 | + ProcessStartInfo startInfo = new ProcessStartInfo() |
| 134 | + { |
| 135 | + FileName = "/bin/bash", |
| 136 | + UseShellExecute = false, |
| 137 | + RedirectStandardError = true, |
| 138 | + RedirectStandardInput = true, |
| 139 | + RedirectStandardOutput = true, |
| 140 | + CreateNoWindow = true, |
| 141 | + Arguments = " -c \"" + argument + " \"" |
| 142 | + }; |
| 143 | + Process myProcess = new Process |
| 144 | + { |
| 145 | + StartInfo = startInfo |
| 146 | + }; |
| 147 | + myProcess.Start(); |
| 148 | + myProcess.WaitForExit(); |
| 149 | + UnityEngine.Debug.Log("============== End ==============="); |
| 150 | + } |
| 151 | + catch (Exception e) |
| 152 | + { |
| 153 | + UnityEngine.Debug.Log("Excetion on CMPPostProcessBuild"); |
| 154 | + } |
| 155 | + } |
123 | 156 | } |
124 | 157 | #endif |
0 commit comments