-
-
Notifications
You must be signed in to change notification settings - Fork 22k
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
Update the app bundle's access and modified times to match the build time on macOS #102003
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changing the "Date Created" date appears to be less trivial - I think the easiest way to go about that would be to create the .app directory itself from scratch, then copy all subdirectories from the template bundle into this newly-created directory.
This seems to be the easiest way to do it, and since .app
bundle always contain only a single Content
folder should be as easy as:
diff --git a/platform/macos/SCsub b/platform/macos/SCsub
index 429cec2234..cdeb02675e 100644
--- a/platform/macos/SCsub
+++ b/platform/macos/SCsub
@@ -33,7 +33,8 @@ def generate_bundle(target, source, env):
templ = Dir("#misc/dist/macos_tools.app").abspath
if os.path.exists(app_dir):
shutil.rmtree(app_dir)
- shutil.copytree(templ, app_dir, ignore=shutil.ignore_patterns("Contents/Info.plist"))
+ os.mkdir(app_dir)
+ shutil.copytree(templ + "/Contents", app_dir + "/Contents")
if not os.path.isdir(app_dir + "/Contents/MacOS"):
os.mkdir(app_dir + "/Contents/MacOS")
if target_bin != "":
It did occur to me last night that the structure of the app bundle, with the sole "Contents" folder, would make it a lot easier to do. I presume we'd want to keep the original shutil.copytree(templ + "/Contents", app_dir + "/Contents", ignore=shutil.ignore_patterns("Info.plist")) |
Co-authored-by: bruvzg <7645683+bruvzg@users.noreply.github.com>
46d17ba
to
998e3df
Compare
I've made the changes now, so that it creates the app directory itself and copies over the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's probably a more SCons-specific way of doing this, but that's not a dealbreaker
Thanks! |
(Mostly) closes #102001 .
This adds a step to the bundle-generation script that updates the access and modification times for the macOS Godot editor .app bundle, so that it appears in the filesystem as having been last accessed and modified when the bundle was built, rather than when the original app template was created back in March 2024.
In the orange box here, the executable and app bundle were both just built, while the top two app bundles were built a while time ago. You can see that with this PR, the new app bundle has an accurate "Date Modified" time.
Changing the "Date Created" date appears to be less trivial - I think the easiest way to go about that would be to create the .app directory itself from scratch, then copy all subdirectories from the template bundle into this newly-created directory. If you think that'd be a good idea to pursue, I can update my branch to try to implement that.