Skip to content

Commit 0017bd9

Browse files
committed
make PackagePublisher CI friendly
1 parent 222b032 commit 0017bd9

File tree

1 file changed

+18
-10
lines changed

1 file changed

+18
-10
lines changed

OneSignalExample/Assets/OneSignalPackager/Editor/OneSignalPackagePublisher.cs

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -45,27 +45,35 @@ public static void UpdateProjectVersion()
4545
[MenuItem("OneSignal/ExportUnityPackage")]
4646
public static void ExportUnityPackage()
4747
{
48+
Debug.Log("=== Starting Package Export ===");
4849
AssetDatabase.Refresh();
4950
var packageVersion = File.ReadAllText(VersionFilePath);
5051
var packageName = $"OneSignal-v{packageVersion}.unitypackage";
5152

52-
// detect CLI argument for exportPath
53-
string[] args = System.Environment.GetCommandLineArgs();
54-
string exportPathArg = args.FirstOrDefault(a => a.StartsWith("exportPath="));
53+
Debug.Log($"Package version: {packageVersion}");
54+
Debug.Log($"Package name: {packageName}");
5555

56-
string exportPath =
57-
exportPathArg != null
58-
? exportPathArg.Split('=')[1]
59-
: Path.Combine(Directory.GetCurrentDirectory(), packageName);
56+
var filePaths = _filePaths();
57+
Debug.Log($"File paths to export: {filePaths}");
6058

61-
if (!exportPath.EndsWith(".unitypackage"))
62-
exportPath = Path.Combine(exportPath, packageName);
59+
if (filePaths.Length == 0)
60+
{
61+
Debug.LogError("ERROR: No file paths returned by _filePaths()!");
62+
EditorApplication.Exit(1);
63+
return;
64+
}
65+
66+
Debug.Log("Starting AssetDatabase.ExportPackage...");
6367

6468
AssetDatabase.ExportPackage(
6569
_filePaths(),
66-
exportPath,
70+
packageName,
6771
ExportPackageOptions.Recurse | ExportPackageOptions.IncludeDependencies
6872
);
73+
74+
Debug.Log("ExportPackage completed");
75+
76+
EditorApplication.Exit(0);
6977
}
7078

7179
private static readonly string PackagePath = Path.Combine("Assets", "OneSignal");

0 commit comments

Comments
 (0)