Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix plugins not being embedded when path contains spaces #44

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Xaverix
Copy link

@Xaverix Xaverix commented Nov 13, 2024

When building for macOS, Unity generates Xcode project folder based on the Product Name. If Product Name contains spaces then the path will contain them too. Currently the script does not handle paths with spaces and will return exit code 1 during its build phase.

There are already some other Pull Requests (#31 or #38) that address this issue but they only focus on changing $APPLE_PLUGIN_LIBRARY_ROOT, the build then runs fine (exit code of the build phase is 0) but the libraries are not getting embedded because of the error when running ditto command.

@Xaverix Xaverix changed the title Fixed plugins not being embedded when path contains spaces Fix plugins not being embedded when path contains spaces Nov 13, 2024
@VMaldecoasago
Copy link

Up @AdamSzApple

+ " for folder in \"$APPLE_PLUGIN_LIBRARY_ROOT\"/*; do\n"
+ " if [ -d \"$folder\" ]; then\n"
+ " for item in \"$folder\"/*; do\n"
+ " if [[ $item = *'.dSYM' ]]; then\n"
+ " continue\n"
+ " elif [[ $item = *'.framework' ]]; then\n"
+ " filename=$(basename $item)\n"
+ " filename=$(basename \"$item\")\n"
+ " echo \" Embedding Apple plug-in framework $filename\"\n"
+ " echo \" Source: $item\"\n"
+ " echo \" Destination: $dstFrameworkFolder/$filename\"\n"
+ " if [ ! -z \"$EXPANDED_CODE_SIGN_IDENTITY\" ]; then\n"
+ " echo \" Code signing identity: $EXPANDED_CODE_SIGN_IDENTITY\"\n"
+ " codesign --force --sign $EXPANDED_CODE_SIGN_IDENTITY --timestamp\\=none --generate-entitlement-der $item\n"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Xaverix this line (and others) also reference $item directly, could that cause problems too? If so, can you please also fix this and the other lines that reference $item without the double quotes??

@Xaverix
Copy link
Author

Xaverix commented Nov 27, 2024

@VMaldecoasago I have added quotes around the $item in the missing places. Some of them I left on purpose as they're already in string.

Tested it both on path with and without spaces. There still was an issue with codesigning. For some reason the app uploaded and worked properly. Now the codesigning is fixed too.

@VMaldecoasago
Copy link

That's amazing, thank you @Xaverix !
@AdamSzApple , can you please take a look?

@AdamSzApple
Copy link
Collaborator

That's amazing, thank you @Xaverix ! @AdamSzApple , can you please take a look?

Thanks, we are aware of this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants