dalexeev / gdscript-preprocessor

An export plugin for stripping comments and "conditional compilation" of GDScript.
MIT License
78 stars 1 forks source link

Code is exported in both pre-processed and original version. #4

Closed Pshy0 closed 5 months ago

Pshy0 commented 5 months ago

Plugin version: 1.1-dev Godot version: 4.2.2.rc1

When exporting the project, editing the exported binary shows that the scripts are exported in both their preprocessed and original version.

image

Pshy0 commented 5 months ago

Maybe you are not remapping the file you export, and maybe you also need to use skip().

dalexeev commented 5 months ago

Thank you for this valuable issue! I assumed that PCK cannot have two files with the same path and that the contents of the PCK are equivalent to ZIP. So I didn't call skip(), figuring Godot would just replace the file or at least report an error (we should report this to the Godot repo).

Unfortunately, remaps do not work well with GDScript (global names and preload). I'll try adding skip().

Pshy0 commented 5 months ago

Actually this is what I see when exporting to zip: image Perhaps your zip explorer program does not show when a zip contains two files with the same file name?

Pshy0 commented 5 months ago

I didnt know it was possible btw, and apparently my computer neither, I can only open the later...

Pshy0 commented 5 months ago

Unfortunately, remaps do not work well with GDScript (global names and preload). I'll try adding skip().

I think it will be fine if you remap (using add_file) to the same path and then skip the currently being exported script, it works in my plugin.

dalexeev commented 5 months ago

Fixed in 461016c29c418713028e797822ab04b83d51fa50. Thanks for testing! Please let me know if you find any new issues.