Skip to content

Commit

Permalink
Add macos native bundle
Browse files Browse the repository at this point in the history
  • Loading branch information
melekr committed Aug 30, 2024
1 parent 5ceddbf commit dce9ddf
Show file tree
Hide file tree
Showing 7 changed files with 243 additions and 40 deletions.
74 changes: 74 additions & 0 deletions Mac/Backtrace-Unity-Mac-bundle.bundle.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

48 changes: 48 additions & 0 deletions Mac/Backtrace-Unity-Mac-bundle.bundle/Contents/Info.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>BuildMachineOSBuild</key>
<string>23F79</string>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>Backtrace-Unity-Mac-bundle</string>
<key>CFBundleIdentifier</key>
<string>Backtrace.Backtrace-Unity-Mac-bundle</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>Backtrace-Unity-Mac-bundle</string>
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSupportedPlatforms</key>
<array>
<string>MacOSX</string>
</array>
<key>CFBundleVersion</key>
<string>1</string>
<key>DTCompiler</key>
<string>com.apple.compilers.llvm.clang.1_0</string>
<key>DTPlatformBuild</key>
<string></string>
<key>DTPlatformName</key>
<string>macosx</string>
<key>DTPlatformVersion</key>
<string>14.5</string>
<key>DTSDKBuild</key>
<string>23F73</string>
<key>DTSDKName</key>
<string>macosx14.5</string>
<key>DTXcode</key>
<string>1540</string>
<key>DTXcodeBuild</key>
<string>15F31d</string>
<key>LSMinimumSystemVersion</key>
<string>12.3</string>
<key>NSHumanReadableCopyright</key>
<string>Copyright © 2024 Backtrace. All rights reserved.</string>
</dict>
</plist>
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>files</key>
<dict/>
<key>files2</key>
<dict/>
<key>rules</key>
<dict>
<key>^Resources/</key>
<true/>
<key>^Resources/.*\.lproj/</key>
<dict>
<key>optional</key>
<true/>
<key>weight</key>
<real>1000</real>
</dict>
<key>^Resources/.*\.lproj/locversion.plist$</key>
<dict>
<key>omit</key>
<true/>
<key>weight</key>
<real>1100</real>
</dict>
<key>^Resources/Base\.lproj/</key>
<dict>
<key>weight</key>
<real>1010</real>
</dict>
<key>^version.plist$</key>
<true/>
</dict>
<key>rules2</key>
<dict>
<key>.*\.dSYM($|/)</key>
<dict>
<key>weight</key>
<real>11</real>
</dict>
<key>^(.*/)?\.DS_Store$</key>
<dict>
<key>omit</key>
<true/>
<key>weight</key>
<real>2000</real>
</dict>
<key>^(Frameworks|SharedFrameworks|PlugIns|Plug-ins|XPCServices|Helpers|MacOS|Library/(Automator|Spotlight|LoginItems))/</key>
<dict>
<key>nested</key>
<true/>
<key>weight</key>
<real>10</real>
</dict>
<key>^.*</key>
<true/>
<key>^Info\.plist$</key>
<dict>
<key>omit</key>
<true/>
<key>weight</key>
<real>20</real>
</dict>
<key>^PkgInfo$</key>
<dict>
<key>omit</key>
<true/>
<key>weight</key>
<real>20</real>
</dict>
<key>^Resources/</key>
<dict>
<key>weight</key>
<real>20</real>
</dict>
<key>^Resources/.*\.lproj/</key>
<dict>
<key>optional</key>
<true/>
<key>weight</key>
<real>1000</real>
</dict>
<key>^Resources/.*\.lproj/locversion.plist$</key>
<dict>
<key>omit</key>
<true/>
<key>weight</key>
<real>1100</real>
</dict>
<key>^Resources/Base\.lproj/</key>
<dict>
<key>weight</key>
<real>1010</real>
</dict>
<key>^[^/]+$</key>
<dict>
<key>nested</key>
<true/>
<key>weight</key>
<real>10</real>
</dict>
<key>^embedded\.provisionprofile$</key>
<dict>
<key>weight</key>
<real>20</real>
</dict>
<key>^version\.plist$</key>
<dict>
<key>weight</key>
<real>20</real>
</dict>
</dict>
</dict>
</plist>
Binary file removed Mac/libBacktrace-Unity-Cocoa-Mac.a
Binary file not shown.
34 changes: 0 additions & 34 deletions Mac/libBacktrace-Unity-Cocoa-Mac.a.meta

This file was deleted.

12 changes: 6 additions & 6 deletions Runtime/Native/OSX/NativeClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,22 +24,22 @@ internal struct Entry
public string Value;
}

[DllImport("__Internal", EntryPoint = "StartBacktraceIntegration")]
[DllImport("Backtrace-Unity-Mac-bundle", EntryPoint = "StartBacktraceIntegration")]
private static extern void Start(string plCrashReporterUrl, string[] attributeKeys, string[] attributeValues, int attributesSize, bool enableOomSupport, string[] attachments, int attachmentSize, bool enableClientSideUnwinding);

[DllImport("__Internal", EntryPoint = "NativeReport")]
[DllImport("Backtrace-Unity-Mac-bundle", EntryPoint = "NativeReport")]
private static extern void NativeReport(string message, bool setMainThreadAsFaultingThread, bool ignoreIfDebugger);

[DllImport("__Internal", EntryPoint = "Crash")]
[DllImport("Backtrace-Unity-Mac-bundle", EntryPoint = "Crash")]
private static extern string Crash();

[DllImport("__Internal", EntryPoint = "GetAttributes")]
[DllImport("Backtrace-Unity-Mac-bundle", EntryPoint = "GetAttributes")]
private static extern void GetNativeAttributes(out IntPtr attributes, out int keysCount);

[DllImport("__Internal", EntryPoint = "AddAttribute")]
[DllImport("Backtrace-Unity-Mac-bundle", EntryPoint = "AddAttribute")]
private static extern void AddAttribute(string key, string value);

[DllImport("__Internal", EntryPoint = "Disable")]
[DllImport("Backtrace-Unity-Mac-bundle", EntryPoint = "Disable")]
private static extern void DisableNativeIntegration();

private static bool INITIALIZED = false;
Expand Down

0 comments on commit dce9ddf

Please sign in to comment.