Skip to content
This repository was archived by the owner on Jan 18, 2022. It is now read-only.

Commit 44fe08d

Browse files
zeroZshadowPaul Balaji
andauthored
Fix mac launcher (#1142)
* Workaround Launcher hardcoded filename now that 2019.2 changed names of executable * Changelog * Update CHANGELOG.md Co-Authored-By: Paul Balaji <[email protected]>
1 parent 97a4cc6 commit 44fe08d

File tree

2 files changed

+31
-0
lines changed

2 files changed

+31
-0
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@
2020
- Any fields in a schema type that are a recursive option will now be _skipped_.
2121
- This is a workaround until full recursive option support is implemented.
2222

23+
### Internal
24+
25+
- Work-around for Mac Launcher using wrong executable name. Generating hardcoded `launcher_client_config.json` for Mac builds. [#1142](https://github.com/spatialos/gdk-for-unity/pull/1142)
26+
2327
## `0.2.7` - 2019-08-19
2428

2529
### Breaking Changes

workers/unity/Packages/io.improbable.gdk.buildsystem/WorkerBuilder.cs

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -330,12 +330,39 @@ private static bool BuildWorkerForTarget(
330330
return true;
331331
}
332332

333+
if (buildTarget == BuildTarget.StandaloneOSX)
334+
{
335+
// Unity executable name has changed on MacOS
336+
// This is a temp work around our Launcher trying to run the wrong file.
337+
// See [UTY-2294]
338+
CreateLaunchJson(workerBuildData.PackageName, Application.productName);
339+
}
340+
333341
var zipPath = Path.Combine(PlayerBuildDirectory, workerBuildData.PackageName);
334342
var basePath = Path.Combine(Common.BuildScratchDirectory, workerBuildData.PackageName);
335343
Zip(zipPath, basePath, targetEnvironment == BuildEnvironment.Cloud);
336344
return true;
337345
}
338346

347+
private static void CreateLaunchJson(string packageName, string productName)
348+
{
349+
var basePath = Path.Combine(Common.BuildScratchDirectory, packageName);
350+
using (var jsonWriter = File.CreateText(Path.Combine(basePath, "launcher_client_config.json")))
351+
{
352+
var json = @"{
353+
""command"": " + $"\"./{packageName}.app/Contents/MacOS/{productName}\"," + @"
354+
""arguments"": [
355+
""+projectName"", ""${IMPROBABLE_PROJECT_NAME}"",
356+
""+deploymentName"", ""${IMPROBABLE_DEPLOYMENT_NAME}"",
357+
""+loginToken"", ""${IMPROBABLE_LOGIN_TOKEN}"",
358+
""+playerIdentityToken"", ""${IMPROBABLE_PLAYER_IDENTITY_TOKEN}"",
359+
""+locatorHost"", ""${IMPROBABLE_LOCATOR_HOSTNAME}""
360+
]
361+
}";
362+
jsonWriter.Write(json);
363+
}
364+
}
365+
339366
private static void Zip(string zipAbsolutePath, string basePath, bool useCompression)
340367
{
341368
using (new ShowProgressBarScope($"Package {basePath}"))

0 commit comments

Comments
 (0)