com.amanotes.gdk 0.2.81-a1 → 0.2.81-a2

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  # Changelog
2
2
 
3
- ## [0.2.81-a1] - 2024-11-21
3
+ ## [0.2.81-a2] - 2024-11-21
4
4
  - [Dev] Add GDKPostBuild for iOS
5
5
  - [Dev] Improve GDK editor experience before config asset imported
6
6
  - [Dev] Analytics save file in async
@@ -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
- if (TryGetEnv("CI_SCRIPT_DIR", out string scriptDir))
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
- var startInfo = new ProcessStartInfo()
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
- else
36
+
37
+ // Configure process start info
38
+ var startInfo = new ProcessStartInfo
49
39
  {
50
- Debug.Log("Failed to run pod install: $CI_SCRIPT_DIR not found");
51
- }
52
- } catch (Exception e)
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 = "pamarollingtiles2.entitlements", enable = true },
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
- AddPodFrameworks(proj, pathToBuildProject, mainTargetGuid);
153
- ModifyInfoPlist(pathToBuildProject);
154
-
155
- proj.WriteToFile(projectPath);
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)
@@ -342,8 +348,15 @@ namespace Amanotes.Editor
342
348
  [MenuItem("Window/AmaGDK/Postprocess Build iOS")]
343
349
  public static void RunPostBuildIOS()
344
350
  {
345
- string exportPath = Path.GetFullPath("./XCode");
346
- OnPostprocessBuild(BuildTarget.iOS, exportPath);
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-a1";
30
+ public const string VERSION = "0.2.81-a2";
31
31
 
32
32
  internal static Status _status = Status.None;
33
33
  internal static ConfigAsset _config = null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "com.amanotes.gdk",
3
- "version": "0.2.81-a1",
3
+ "version": "0.2.81-a2",
4
4
  "displayName": "AmaGDK",
5
5
  "description": "Amanotes Game Development Kit",
6
6
  "unity": "2019.4",
@@ -1,8 +0,0 @@
1
- fileFormatVersion: 2
2
- guid: 556517e393f149748cf9890d5d436491
3
- folderAsset: yes
4
- DefaultImporter:
5
- externalObjects: {}
6
- userData:
7
- assetBundleName:
8
- assetBundleVariant:
@@ -1,8 +0,0 @@
1
- fileFormatVersion: 2
2
- guid: 19f1c4b4ece54d438bb89c63b87846bf
3
- folderAsset: yes
4
- DefaultImporter:
5
- externalObjects: {}
6
- userData:
7
- assetBundleName:
8
- assetBundleVariant: