diff --git a/Assets/ConsentManagementProvider/Editor/CMPPostProcessBuild.cs b/Assets/ConsentManagementProvider/Editor/CMPPostProcessBuild.cs index 1a2042e8..8bcf35e3 100644 --- a/Assets/ConsentManagementProvider/Editor/CMPPostProcessBuild.cs +++ b/Assets/ConsentManagementProvider/Editor/CMPPostProcessBuild.cs @@ -2,6 +2,8 @@ using UnityEditor; using UnityEditor.Callbacks; using UnityEditor.iOS.Xcode; +using System; +using System.Diagnostics; using System.IO; using UnityEditor.iOS.Xcode.Extensions; using UnityEngine; @@ -31,10 +33,12 @@ public static void OnPostProcessBuild(BuildTarget buildTarget, string buildPath) EnableBitcode(pbxProject, unityProjectGuid, false); string bridgePath="Libraries/ConsentManagementProvider/Plugins/iOS/Source/SwiftBridge.swift"; + string newBridgePath="Pods/ConsentViewController/ConsentViewController/Classes/SwiftBridge.swift"; RemoveBridge(pbxProject,bridgePath); + ExecuteProcessTerminal("mv "+buildPath+"/"+bridgePath+" "+buildPath+"/"+newBridgePath); pbxProject.WriteToFile(projPath); - AddBridgeToPods(buildPath, bridgePath); + AddBridgeToPods(buildPath, newBridgePath); string plistPath = buildPath + "/Info.plist"; AddParameterToInfoPlist(plistPath); @@ -120,5 +124,34 @@ static void EnableSwift(PBXProject pbxProject, string targetGuid) pbxProject.AddBuildProperty(targetGuid, "COREML_CODEGEN_LANGUAGE", "Swift"); pbxProject.AddBuildProperty(targetGuid, "ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES", "YES"); } + + private static void ExecuteProcessTerminal(string argument) + { + try + { + UnityEngine.Debug.Log("============== Start Executing [" + argument + "] ==============="); + ProcessStartInfo startInfo = new ProcessStartInfo() + { + FileName = "/bin/bash", + UseShellExecute = false, + RedirectStandardError = true, + RedirectStandardInput = true, + RedirectStandardOutput = true, + CreateNoWindow = true, + Arguments = " -c \"" + argument + " \"" + }; + Process myProcess = new Process + { + StartInfo = startInfo + }; + myProcess.Start(); + myProcess.WaitForExit(); + UnityEngine.Debug.Log("============== End ==============="); + } + catch (Exception e) + { + UnityEngine.Debug.Log("Excetion on CMPPostProcessBuild"); + } + } } #endif diff --git a/package.json b/package.json index c38542ce..0a1862b7 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "com.sourcepoint.unitycmp", "displayName": "Sourcepoint Consent Message Plugin", - "version": "3.1.0", + "version": "3.1.1", "unity": "2022.3", "description": "Native UI Privacy Manager for both GDPR and CCPA legislations.", "author": { diff --git a/unitypackage/ConsentManagementProvider.unitypackage b/unitypackage/ConsentManagementProvider.unitypackage index 6295e17a..627fba60 100644 Binary files a/unitypackage/ConsentManagementProvider.unitypackage and b/unitypackage/ConsentManagementProvider.unitypackage differ