EddyVerbruggen / nativescript-plugin-firebase

:fire: NativeScript plugin for Firebase
https://firebase.google.com
MIT License
1.01k stars 445 forks source link

Plugin injects CODE_SIGN_ENTITLEMENTS into App_Resources/iOS/build.xcconfig #1769

Open jerbob92 opened 3 years ago

jerbob92 commented 3 years ago

Environment Provide version numbers for the following components (information can be retrieved by running tns info in your project folder or by inspecting the package.json of the project):

Describe the bug

We had some issues where developers had the app cloned into a different directory, and thus having a different folder name during the build/run. We have a custom app.entitlements in our App_Resources/iOS folder. According to the docs it should automatically pick it up (and it does), however, it then links it in the build.xcconfig in the App_Resources/iOS folder. It adds the following line:

CODE_SIGN_ENTITLEMENTS = {root-folder-name}/{root-folder-name}.entitlements

You probably already see when this will go wrong: another developer clones the repository with a different folder name, and the CODE_SIGN_ENTITLEMENTS reference isn't correct anymore. It also doesn't correct it resulting in an error/warning in the XCode build.

In my opinion it should not link it in the App_Resources/iOS folder, it should link it in the generated build.xcconfig somewhere in the platforms folder. I don't think NativeScript should edit files in App_Resources by itself.

To Reproduce

Expected behavior It should link CODE_SIGN_ENTITLEMENTS in the generated build.xcconfig somewhere in the platforms folder. I don't think this plugin should edit files in App_Resources by itself.

The code that's doing it is: https://github.com/EddyVerbruggen/nativescript-plugin-firebase/blob/master/src/scripts/entitlements-before-prepare.js

Why is this code needed since NS should pick up the entitlements automatically?