-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
com.unity.xr.magicleap@4.2.0-preview.3
## [4.2.0-preview.3] - 2020-08-19 - Fix issue causing CI testing to fail erroneously. ## [4.2.0-preview.2] - 2020-08-17 - Update the target Unity version to 2019.4f4.4 ## [4.2.0-preview.1] - 2020-04-14 - Update XR Management Dependency to 3.2.10 - Added manifest setting to enable background music privileges - APIs added for `QuerySupportedTrackingOriginModes`, `QueryTrackingOriginMode`, and `SetTrackingOriginMode` - Fixed issue where controller state information was incorrectly surfaced from the companion application - Fixed issue where Zero Iteration libraries where incorrectly imported for MacOS - Fixed issue where using `NativeArrayUnsafeUtility.ConvertExistingDataToNativeArray` resulted in an error while running in the Editor - Fix issue where UnityMagicLeap libraries were included in Standalone Desktop builds when using Magic Leap Zero Iteration Plugin Provider from XR Management (The intent of the Standalone Desktop provider is to allow rapid iteration from the Unity Editor with Magic Leap's The Lab Zero Iteration module and not for use in standalone builds)
- Loading branch information
Unity Technologies
committed
Aug 19, 2020
1 parent
795f959
commit b7deb2e
Showing
24 changed files
with
390 additions
and
144 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,124 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Diagnostics; | ||
using System.IO; | ||
using System.Text.RegularExpressions; | ||
|
||
using UnityDebug = UnityEngine.Debug; | ||
|
||
namespace UnityEditor.XR.MagicLeap | ||
{ | ||
#if UNITY_EDITOR_OSX | ||
class MacOSDependencyChecker | ||
{ | ||
const string kRegexPattern = @"\t(.+) \(compatibility version \d{1,4}\.\d{1,4}\.\d{1,4}, current version \d{1,4}\.\d{1,4}\.\d{1,4}\)"; | ||
|
||
public class DependencyMap | ||
{ | ||
public string file = null; | ||
public List<string> dependencies = new List<string>(); | ||
} | ||
|
||
internal static IEnumerable<string> LaunchOtool(string filepath) | ||
{ | ||
var psi = new ProcessStartInfo { | ||
FileName = "/usr/bin/otool", | ||
Arguments = string.Format("-L {0}", filepath), | ||
WindowStyle = ProcessWindowStyle.Hidden, | ||
CreateNoWindow = true, | ||
RedirectStandardError = true, | ||
RedirectStandardOutput = true, | ||
UseShellExecute = false | ||
}; | ||
using (Process p = Process.Start(psi)) | ||
{ | ||
var output = p.StandardOutput.ReadToEnd(); | ||
var error = p.StandardError.ReadToEnd(); | ||
p.WaitForExit(); | ||
return output.Split(new string[] { Environment.NewLine }, StringSplitOptions.None); | ||
} | ||
} | ||
|
||
internal static DependencyMap GetDependencies(string file) | ||
{ | ||
var regex = new Regex(kRegexPattern); | ||
var dm = new DependencyMap { file = file }; | ||
var output = LaunchOtool(file); | ||
foreach (var line in output) | ||
{ | ||
var m = regex.Match(line); | ||
if (m.Success) | ||
{ | ||
var dep_path = m.Groups[1].Value; | ||
foreach (var prefix in new string[] { "@loader_path", "@rpath"} ) | ||
dep_path = dep_path.Replace(prefix, Path.GetDirectoryName(file)); | ||
dm.dependencies.Add(dep_path); | ||
} | ||
} | ||
return dm; | ||
} | ||
|
||
internal static void Migrate(string src, string dest) | ||
{ | ||
var dir = Path.GetDirectoryName(dest); | ||
using (new WorkingDirectoryShift(dir)) | ||
{ | ||
var psi = new ProcessStartInfo { | ||
FileName = "lipo", | ||
Arguments = string.Format("-create {0} -output {1}", src, Path.GetFileName(dest)), | ||
WindowStyle = ProcessWindowStyle.Hidden, | ||
CreateNoWindow = true | ||
}; | ||
using (Process p = Process.Start(psi)) | ||
p.WaitForExit(); | ||
|
||
psi = new ProcessStartInfo { | ||
FileName = "install_name_tool", | ||
Arguments = string.Format("-id {0} {0}", Path.GetFileName(dest)), | ||
WindowStyle = ProcessWindowStyle.Hidden, | ||
CreateNoWindow = true | ||
}; | ||
using (Process p = Process.Start(psi)) | ||
p.WaitForExit(); | ||
|
||
} | ||
|
||
} | ||
|
||
internal static void MigrateWithDependencies(string src, string dest) | ||
{ | ||
var original_deps = GetDependencies(src); | ||
Migrate(src, dest); | ||
var new_deps = GetDependencies(dest); | ||
var missing = new List<string>(); | ||
using (new WorkingDirectoryShift(Path.GetDirectoryName(dest))) | ||
{ | ||
foreach (var dep in new_deps.dependencies) | ||
{ | ||
if (File.Exists(dep)) | ||
continue; | ||
else | ||
missing.Add(dep); | ||
} | ||
} | ||
foreach (var item in missing) | ||
{ | ||
var dep_path = Path.GetFullPath(item); | ||
if (!File.Exists(dep_path)) | ||
{ | ||
var dep_file = Path.GetFileName(item); | ||
foreach (var old_dep in original_deps.dependencies) | ||
{ | ||
if (Path.GetFileName(old_dep) == dep_file) | ||
{ | ||
Directory.CreateDirectory(Path.GetDirectoryName(dep_path)); | ||
if (File.Exists(old_dep)) | ||
File.Copy(old_dep, dep_path); | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
#endif | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.