Repository: godotengine/godot (language: cpp)

Issue:
macOS editor app bundle uses old and constant "Date Created" and "Date Modified" values
### Tested versions

- Reproducible in v4.4.beta.custom_build [b15b24b08] and previous

### System information

macOS Sequoia 15.2

### Issue description

When building the Godot editor for macOS without an .app bundle, the modification/creation date is correct. However, when it is built with the `generate_bundle=yes` argument, the resulting bundle has a "Date Created" and "Date Modified" value of March 14, 2024 at 9:00 PM PT. This makes it difficult to tell at a glance which bundled builds of Godot are newer than others.

![Image](https://github.com/user-attachments/assets/10d7b0dc-1d0e-401c-9230-d4c162e70029)

### Steps to reproduce

Build Godot on macOS without generating a bundle:
```
scons generate_bundle=no
```
The resulting executable will have the correct "Date Created" and "Date Modified" information.

Next, build it and generate a bundle:
```
scons generate_bundle=yes
```
The .app bundle will have a "Date Created" and "Date Modified" value of March 14, 2024 at 9:00 PM PT (I gather the exact time/date will differ based on your timezone).

### Minimal reproduction project (MRP)

N/A


Discussion / hints:

Fix patch:
diff --git a/platform/macos/SCsub b/platform/macos/SCsub
index 429cec22344e..9efb1a66b289 100644
--- a/platform/macos/SCsub
+++ b/platform/macos/SCsub
@@ -33,7 +33,16 @@ 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"))
+
+        # Create the .app bundle directory itself from scratch so that the creation
+        # date is accurate, but copy the rest of the template over.
+        os.mkdir(app_dir)
+        shutil.copytree(
+            os.path.join(templ, "Contents"),
+            os.path.join(app_dir, "Contents"),
+            ignore=shutil.ignore_patterns("Info.plist"),
+        )
+
         if not os.path.isdir(app_dir + "/Contents/MacOS"):
             os.mkdir(app_dir + "/Contents/MacOS")
         if target_bin != "":
@@ -66,6 +75,7 @@ def generate_bundle(target, source, env):
                 sign_command += [Dir("#misc/dist/macos").abspath + "/editor.entitlements"]
             sign_command += [app_dir]
             subprocess.run(sign_command)
+
     else:
         # Template bundle.
         app_prefix = "godot." + env["platform"]


Test patch: