Skip to content

Commit 6dda4cd

Browse files
authored
Merge pull request #72 from SourcePointUSA/DIA-5912-fix
DIA-5912 In `CMPPostProcessBuild.cs`, during `OnPostProcessBuild`, move `SwiftBridge.swift` to the `Pod/ConsentViewController` folder.
2 parents 332a26d + 071ce3e commit 6dda4cd

File tree

3 files changed

+35
-2
lines changed

3 files changed

+35
-2
lines changed

Assets/ConsentManagementProvider/Editor/CMPPostProcessBuild.cs

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
using UnityEditor;
33
using UnityEditor.Callbacks;
44
using UnityEditor.iOS.Xcode;
5+
using System;
6+
using System.Diagnostics;
57
using System.IO;
68
using UnityEditor.iOS.Xcode.Extensions;
79
using UnityEngine;
@@ -31,10 +33,12 @@ public static void OnPostProcessBuild(BuildTarget buildTarget, string buildPath)
3133
EnableBitcode(pbxProject, unityProjectGuid, false);
3234

3335
string bridgePath="Libraries/ConsentManagementProvider/Plugins/iOS/Source/SwiftBridge.swift";
36+
string newBridgePath="Pods/ConsentViewController/ConsentViewController/Classes/SwiftBridge.swift";
3437
RemoveBridge(pbxProject,bridgePath);
38+
ExecuteProcessTerminal("mv "+buildPath+"/"+bridgePath+" "+buildPath+"/"+newBridgePath);
3539
pbxProject.WriteToFile(projPath);
3640

37-
AddBridgeToPods(buildPath, bridgePath);
41+
AddBridgeToPods(buildPath, newBridgePath);
3842

3943
string plistPath = buildPath + "/Info.plist";
4044
AddParameterToInfoPlist(plistPath);
@@ -120,5 +124,34 @@ static void EnableSwift(PBXProject pbxProject, string targetGuid)
120124
pbxProject.AddBuildProperty(targetGuid, "COREML_CODEGEN_LANGUAGE", "Swift");
121125
pbxProject.AddBuildProperty(targetGuid, "ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES", "YES");
122126
}
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+
}
123156
}
124157
#endif

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "com.sourcepoint.unitycmp",
33
"displayName": "Sourcepoint Consent Message Plugin",
4-
"version": "3.1.0",
4+
"version": "3.1.1",
55
"unity": "2022.3",
66
"description": "Native UI Privacy Manager for both GDPR and CCPA legislations.",
77
"author": {
105 KB
Binary file not shown.

0 commit comments

Comments
 (0)