intellij deleting all files in compile output path

Answered

I've been having an issue with intellij for a while now, it is deleting all the files in my flex compile output path. I don't have to say what a huge problem that can create, thank god for git. Does anyone know why this could be happening? Or is this a legit intellij bug?

1
7 comments
Avatar
Permanently deleted user

Definitely not a bug. It is a much desired feature. IntelliJ IDEA is doing a clean build. A corner stone of good build practices. I guess I do not understand why you would have compiled output checked into version control. Typically version control only contains source code, not built artifacts.

Nevertheless, if you do not desire this behavior, go into Settings (File > Settings or ctrl+alt+S). Under Project Settings, select the "Compiler" node. On the left, uncheck "Clear output directory on rebuild". Note that this is a per project setting. You can, if desired, change it in the project template settigs (Settings > Other Settings > Template Settings).

0

believe me, you do NOT want to keep old files in your output path. the sources and the output *will* get out of sync, which will make you spent countless hours debugging magic code that doesn't do what the source says

0
Avatar
Permanently deleted user

Believe me, in some project I want to keep content of output folder. The output folder is source folder of another project, and it contains some assets.

0

you mean you want to mix the output folder and something else and use that as the input folder for a second project?

then wouldn't it be better if you had a dedicated folder for that?

0
Avatar
Permanently deleted user

Maybe it could work also other way, but I want avoid duplication of files, so I have some assets in output folder, where compiler outputs compiled .js files, and this folder is later packaged into other project that uses the .js and other stuff in the folder.

This works good for me, so I intentionally disable the Clear output directory on rebuild option.

 

0

I have the same issue on my mac (os 14.1). After compilation, files are deleted after a few seconds (maximum 1 minute). The problem appeared after updating the mac system. If you know how the InteliJ build process works, you will know that if there are no files in the output directory, the linking process does not work. So any further build will not work until you decide to rebuild the project. 

0

Which Build System your Project relies on (Gradle, Maven, IDEA Native)?

How do you trigger the build/compilation? Would you be able to share a screenshot of the corresponding Run/Debug Configuration?

0

Please sign in to leave a comment.