com.amanotes.gdk 0.2.81-a1 → 0.2.81-a3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +1 -1
- package/Editor/Extra/GDKCIBuildCommand.cs +46 -20
- package/Editor/Extra/GDKPostBuildAsset.cs +23 -10
- package/Runtime/AmaGDK.cs +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -24,32 +24,58 @@ namespace Amanotes.Core
|
|
|
24
24
|
private const string VERSION_NUMBER_VAR = "VERSION_NUMBER_VAR";
|
|
25
25
|
private const string VERSION_iOS = "VERSION_BUILD_VAR";
|
|
26
26
|
|
|
27
|
-
public static void InstallPod(EventHandler processExit)
|
|
27
|
+
public static void InstallPod(EventHandler processExit, string buildPath = null)
|
|
28
28
|
{
|
|
29
29
|
try
|
|
30
30
|
{
|
|
31
|
-
|
|
31
|
+
var arguments = $"-c \"/usr/local/bin/pod install --project-directory={buildPath}\"";
|
|
32
|
+
if (Application.isBatchMode && TryGetEnv("CI_SCRIPT_DIR", out string scriptDir))
|
|
32
33
|
{
|
|
33
|
-
|
|
34
|
-
{
|
|
35
|
-
FileName = "/bin/bash",
|
|
36
|
-
Arguments = $"{scriptDir}/utils.sh pod-install",
|
|
37
|
-
CreateNoWindow = true
|
|
38
|
-
};
|
|
39
|
-
var proc = new Process
|
|
40
|
-
{
|
|
41
|
-
StartInfo = startInfo,
|
|
42
|
-
EnableRaisingEvents = true
|
|
43
|
-
};
|
|
44
|
-
proc.Exited += processExit;
|
|
45
|
-
proc.Start();
|
|
46
|
-
proc.WaitForExit();
|
|
34
|
+
arguments = $"{scriptDir}/utils.sh pod-install";
|
|
47
35
|
}
|
|
48
|
-
|
|
36
|
+
|
|
37
|
+
// Configure process start info
|
|
38
|
+
var startInfo = new ProcessStartInfo
|
|
49
39
|
{
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
40
|
+
FileName = "/bin/zsh",
|
|
41
|
+
Arguments = arguments,
|
|
42
|
+
CreateNoWindow = false,
|
|
43
|
+
RedirectStandardOutput = true,
|
|
44
|
+
RedirectStandardError = true,
|
|
45
|
+
UseShellExecute = false
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
var proc = new Process
|
|
49
|
+
{
|
|
50
|
+
StartInfo = startInfo,
|
|
51
|
+
EnableRaisingEvents = true
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
// Attach event handlers
|
|
55
|
+
proc.OutputDataReceived += (sender, args) =>
|
|
56
|
+
{
|
|
57
|
+
if (args.Data == null) return; // End of the stream
|
|
58
|
+
Debug.Log(args.Data);
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
// proc.ErrorDataReceived += (sender, args) =>
|
|
62
|
+
// {
|
|
63
|
+
// if (args.Data == null) return; // End of the stream
|
|
64
|
+
// Debug.LogError(args.Data);
|
|
65
|
+
// };
|
|
66
|
+
|
|
67
|
+
proc.Exited += processExit;
|
|
68
|
+
|
|
69
|
+
// Start the process
|
|
70
|
+
proc.Start();
|
|
71
|
+
proc.BeginOutputReadLine();
|
|
72
|
+
proc.BeginErrorReadLine();
|
|
73
|
+
proc.WaitForExit();
|
|
74
|
+
|
|
75
|
+
// Log exit code
|
|
76
|
+
// Debug.LogWarning("Process exited with code: " + proc.ExitCode);
|
|
77
|
+
}
|
|
78
|
+
catch (Exception e)
|
|
53
79
|
{
|
|
54
80
|
Debug.LogError(e);
|
|
55
81
|
}
|
|
@@ -6,6 +6,7 @@ using System.Collections.Generic;
|
|
|
6
6
|
using UnityEditor.Callbacks;
|
|
7
7
|
|
|
8
8
|
#if UNITY_IOS
|
|
9
|
+
using Amanotes.Core;
|
|
9
10
|
using UnityEditor.iOS.Xcode;
|
|
10
11
|
using UnityEditor.iOS.Xcode.Extensions;
|
|
11
12
|
#endif
|
|
@@ -101,17 +102,21 @@ namespace Amanotes.Editor
|
|
|
101
102
|
[Header("Capabilities to Enable")]
|
|
102
103
|
public List<Capability> capabilities = new List<Capability>
|
|
103
104
|
{
|
|
104
|
-
new Capability { type = "com.apple.Push", entitlementFile = "
|
|
105
|
+
new Capability { type = "com.apple.Push", entitlementFile = "amanotes.entitlements", enable = true },
|
|
105
106
|
new Capability { type = "com.apple.InAppPurchase", entitlementFile = "", enable = true },
|
|
106
107
|
new Capability { type = "com.apple.BackgroundModes", entitlementFile = "", enable = true }
|
|
107
108
|
};
|
|
108
109
|
|
|
110
|
+
public string lastBuildPath;
|
|
111
|
+
|
|
109
112
|
#if UNITY_IOS
|
|
110
113
|
private const string PLIST_FILE = "Info.plist";
|
|
111
114
|
private const string EXIST_ON_SUSPEND_KEY = "UIApplicationExitsOnSuspend";
|
|
112
115
|
|
|
113
116
|
public void ExecutePostBuild(string pathToBuildProject)
|
|
114
117
|
{
|
|
118
|
+
lastBuildPath = pathToBuildProject;
|
|
119
|
+
|
|
115
120
|
if (string.IsNullOrEmpty(pathToBuildProject))
|
|
116
121
|
{
|
|
117
122
|
Debug.LogError("Path to build project is null or empty.");
|
|
@@ -144,15 +149,16 @@ namespace Amanotes.Editor
|
|
|
144
149
|
return;
|
|
145
150
|
}
|
|
146
151
|
|
|
147
|
-
Debug.Log($"Main Target GUID: {mainTargetGuid}");
|
|
148
|
-
|
|
149
152
|
SetBuildProperties(proj, mainTargetGuid);
|
|
150
153
|
AddCapabilities(proj, pathToBuildProject, mainTargetGuid);
|
|
151
154
|
AddFrameworks(proj, mainTargetGuid);
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
155
|
+
|
|
156
|
+
GDKCIBuildCommand.InstallPod((sender, e) =>
|
|
157
|
+
{
|
|
158
|
+
AddPodFrameworks(proj, pathToBuildProject, mainTargetGuid);
|
|
159
|
+
ModifyInfoPlist(pathToBuildProject);
|
|
160
|
+
proj.WriteToFile(projectPath);
|
|
161
|
+
}, pathToBuildProject);
|
|
156
162
|
}
|
|
157
163
|
|
|
158
164
|
private void RemoveDeprecatedInfoPListKeys(string pathToBuildProject)
|
|
@@ -327,7 +333,7 @@ namespace Amanotes.Editor
|
|
|
327
333
|
return null;
|
|
328
334
|
}
|
|
329
335
|
|
|
330
|
-
[PostProcessBuild]
|
|
336
|
+
[PostProcessBuild(999)]
|
|
331
337
|
public static void OnPostprocessBuild(BuildTarget target, string pathToBuildProject)
|
|
332
338
|
{
|
|
333
339
|
if (target != BuildTarget.iOS) return;
|
|
@@ -342,8 +348,15 @@ namespace Amanotes.Editor
|
|
|
342
348
|
[MenuItem("Window/AmaGDK/Postprocess Build iOS")]
|
|
343
349
|
public static void RunPostBuildIOS()
|
|
344
350
|
{
|
|
345
|
-
|
|
346
|
-
|
|
351
|
+
var buildAsset = FindGDKPostBuildAsset();
|
|
352
|
+
if (buildAsset == null) return;
|
|
353
|
+
|
|
354
|
+
if (string.IsNullOrEmpty(buildAsset.lastBuildPath))
|
|
355
|
+
{
|
|
356
|
+
buildAsset.lastBuildPath = Path.GetFullPath("../../_Build/XCode_PHB3_v2.13.3_b200611");
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
OnPostprocessBuild(BuildTarget.iOS, buildAsset.lastBuildPath);
|
|
347
360
|
}
|
|
348
361
|
|
|
349
362
|
public static GDKPostBuildAsset FindGDKPostBuildAsset()
|
package/Runtime/AmaGDK.cs
CHANGED
|
@@ -27,7 +27,7 @@ namespace Amanotes.Core
|
|
|
27
27
|
{
|
|
28
28
|
public partial class AmaGDK : MonoBehaviour
|
|
29
29
|
{
|
|
30
|
-
public const string VERSION = "0.2.81-
|
|
30
|
+
public const string VERSION = "0.2.81-a3";
|
|
31
31
|
|
|
32
32
|
internal static Status _status = Status.None;
|
|
33
33
|
internal static ConfigAsset _config = null;
|