godotengine / godot-ios-plugins

MIT License
126 stars 48 forks source link

Possibility to add other types of keys on [plist], such as Array #5

Closed gumaciel closed 3 years ago

gumaciel commented 3 years ago

For some Plugins this should be very good, one example is AdMob: https://developers.google.com/admob/ios/quick-start#update_your_infoplist

Needs to be placed three different type of keys: string, dict and array

Instead of [plist] it goes like this:

PlistKey = "Some Info.plist key you might need"

it could be like this:

<key>
     PlistKey
</key>
<string>
     Some Info.plist key you might need
</string>

So when exporting the project to iOS, the Engine will copy and paste what is in [plist] inside the Xcode project's .plist

naithar commented 3 years ago

I guess something like Key:type = "<Value>" could be done for this section, like

PlistKeyOld="value"
PlistKey1:string = "value"
PlistKey2:raw = "<key>PlistKey2</key><string>Some Info.plist key you might need</string>"

Maybe even something like PlistKey3:export="Value that can be set in export dialog" so users could set specific values directly in editor without modifying Xcode project.

gumaciel commented 3 years ago

Maybe i can help you do to that, the branch that i work for ios-plugins is this? https://github.com/naithar/godot/tree/fix/ios-plugin

Can you tell to me where is the part when read the .gdip file and write the .plist of project?

naithar commented 3 years ago

Maybe i can help you do to that, the branch that i work for ios-plugins is this? https://github.com/naithar/godot/tree/fix/ios-plugin

Can you tell to me where is the part when read the .gdip file and write the .plist of project?

You should branch out from current 3.x and master, not my fork. godot_plugin_config.h and export.cpp are files you are looking for. godot_plugin_config.h handles config parsing. export.cpp modifies Xcode project template at _fix_config_file method. This line parses config plist data to the string that _fix_config_file uses to actually replace templated plist strings.

gumaciel commented 3 years ago

Thanks, I will close the issue since the implementation has to be done in another repository, I will try to develop but I think I will not be able to because of the export templates, I find it very difficult to create these templates on mac.