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 PathScript caching. #635

Merged
merged 3 commits into from
May 20, 2024
Merged

Fix PathScript caching. #635

merged 3 commits into from
May 20, 2024

Conversation

CedNaru
Copy link
Member

@CedNaru CedNaru commented May 14, 2024

We never properly cached the Kotlin and Java Scripts.
Each time you reload the .jar, new ones are created instead of updating the ones already here which triggers a nasty side effect.

The original Script is replaced inside the ResourceLoader by the new one. And its path taken as well.
The consequence is that if you got a Godot scene opened when reloading and then save, the script is no longer recognized as an external resource (because no path) and is stored as an internal script (which we don't support).

I also move the content of update_export to another method. The reason is that Godot calls that method whenever it detects a change in the source files, which is totally useless in our case because only the .jar matters.

This doesn't require testing on each OS, but I welcome if you can monkey proof the reloading behaviour with gdj and Kotlin scripts.

chippmann
chippmann previously approved these changes May 16, 2024
piiertho
piiertho previously approved these changes May 18, 2024
Copy link
Member

@piiertho piiertho left a comment

Choose a reason for hiding this comment

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

Only one comment otherwise that's LGTM

@CedNaru CedNaru dismissed stale reviews from piiertho and chippmann via aa16001 May 20, 2024 02:51
@CedNaru CedNaru merged commit 62e6edc into master May 20, 2024
24 of 25 checks passed
@CedNaru CedNaru deleted the fix/path_script_cache branch May 20, 2024 02:51
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.

None yet

3 participants