Preserve original file timestamp on packaging

Answered

We have an Adobe AIR Actionscript project in IntelliJ IDEA.

When packaging the AIR application, we'd like the files copied from the source to keep their original timestamps, rather than all files being marked as created / modified at the time of packaging. Is there a way to achieve that?

According to our tests, we experienced mixed results, with one IntelliJ IDEA instance (Ultimate 2022.3.3) preserving the original timestamps, and another (Ultimate 2022.3.2) setting all timestamps to the time of packaging.

0
9 comments

Hi Denis Rionnet Could you clarify how do you build the project? Do you use any build system like Maven, Gradle?

Please share a screenshot from File | Project Structure | Artifacts | your_artifact_configuration | Packaging

If possible please share a small project sample reproducing the issue. The files can be uploaded at https://uploads.jetbrains.com (do not forget to specify the UploadID here)

Thank you!

0

Hi Egor Klepikov, thanks for your help!

how do you build the project?

We use Build > Package AIR Application... No Maven, Gradle...

Please share a screenshot from File | Project Structure | Artifacts | your_artifact_configuration | Packaging

This 'Artifacts' section is totally empty.

I'll make a smaller sample project to try & reproduce the issue, and will upload it.

0

I've just made a sample project from scratch, but the source files' timestamps ARE actually preserved in the output folder, so...

Going to look further for my actual project...

0

So far, I haven't been able to reproduce the issue with the sample project.

In my actual project, the issue is a bit random.
Below is a directory, as seen in the source folder (left), and in the output folder (right). All output files have a creation date set to the time of packaging (13/06/2023 18:24), but most files keep the original modification date (second column), except one (highlighted, 11th line) whose modification date is also set according to the packaging time.

For another directory in the same project, all output files (right) get marked with the time of packaging, both creation & modification date:

0

Thank you for the additional information. To verify whether the problem comes from the IDE or it is some project misconfiguration please check if it works in the same way if you build the application from the command line outside of the IDE

0

Thank you for your help. We're not quite familiar with the command line, since we've always used the IDE for that (IntelliJ, and previously FlashBuilder). With command line: many options & parameters... so many technical reasons for the process to fail...

What I can add so far:

  • The building process ("Run") copies source files to the output directory with the proper timestamps.
  • Only the packaging process ("Build > Package AIR Application") generates inaccurate timestamps for some files in the output directory.
0
  • Only the packaging process ("Build > Package AIR Application") generates inaccurate timestamps for some files in the output directory.

I'd like try to reproduce this problem from our side. Could you provide a screenshot from `Build | Package AIR Application` dialog? For now, I'm not sure the problem is directly related to IntelliJ IDEA as I don't see similar reports from our Flash/Adobe AIR users

FlashBuilder

Do you see the same problem when the project is built via FlashBuilder?

0

Here is the screenshot:

A specificity of our project is that we merge several assets folders into one.

I finally managed to reproduce the issue in my sample project. (First time I checked, I think it didn't have the issue, so either I didn't check properly, or something happened inbetween.) Here it is:

Upload id: 2023_06_20_RRvVWYk7mMSpadvndBmYxr (file: DateTest.zip)

It has a similar architecture (just much smaller and simpler), in that it merges 2 assets folders into one.
Here are some screenshots of the assets folders:

Source assets, folder #1:
File dates are years old (except for the creation date).

Source assets, folder #2:
File dates are years old (except for the creation date).

Output assets, merged folder:
The "Date" & "Modification date" are correct.

Output, target directory where the final bundle is packaged, along with the executable file, the "Adobe AIR" and "META-INF" directories:
All dates are set to the time of packaging.

I'm not sure if my project structure is 100% correct...? It works, but maybe it's not optimal?
Anyway, as I said, if nothing else works, we might use the first output directory to retrieve merged assets, rather than the packaged directory.

I haven't explained so far: the global idea is to put the packaged files to a remote server and have them synchronized to the users' device (Windows), rather than having users download the whole application every time it gets updated (since the project has a huge global file size). But of course, for this scheme to work, we need the file timestamps to be preserved all along the process:
Source => Packaging => Upload to server => Download from server => Write to user disk

Do you see the same problem when the project is built via FlashBuilder?

Actually, we love IntelliJ so much that we don't even have FlashBuilder installed any more, I'm afraid :)
(The ancestor of this project used to be packaged with FlashBuilder.)
 
Thank you again for your help.
0

Hi,
 
The mentioned behavior could be reproduced from our side, unfortunately, AIR-related fixes in IntelliJ IDEA are currently only done for major/security matters due to its popularity. Technically, the  Flex / AIR plugin is open-source and we are ready to review pull requests https://github.com/JetBrains/intellij-plugins/tree/master/flex so we would gladly review it if you found a fix.
 
As of now, our only recommendation would be to apply the workaround you mentioned and use the first output directory to retrieve merged assets, rather than the packaged directory.
 
Thank you for understanding.

1

Please sign in to leave a comment.