File-based vs Directory-based Projects. Which way to go?

Answered

Hi all,

IntelliJ noob here. I'm just wanting to find out why there are these two different approaches to managing projects, what the relative merits are, and why, in particular, IntelliJ defaults to the directory-based option when creating a new project (That's what appears to happen when I create a new project using the wizard). I come from a VS background so I'm used to file-based solutions and projects, and in some sense I feel more secure with that...like it's more tightly managed and controlled. Directory-based management seems "loose" to me and prone to integrity cock up, but I'm happy to be shown wrong. I would like to know what the more popular approach is in the IntelliJ and OSS communities.

Thanks in advance.

0
11 comments

Directory based format is preferred, we have plans to deprecate the file based format at some point.

1
Avatar
Permanently deleted user

Short and sweet. Thanks! :)

0
Avatar
Permanently deleted user

Hi Mark,

Just in case you you're interested in why .idea is preferred to *.ipr, here is the main difference - there is a number of settings relevant to particular user (e.g. whether to show line numbers in editor). All that 'local settings' are stored in *.ipr, hence, it shows conflicts if stored in vcs.

However, you can store only relevant .idea files in vcs (files which hold 'shared project settings'), so, there are no vcs conflicts for the ide config.

Denis

0
Avatar
Permanently deleted user

Ah ok. I assume some of the xml files in .idea also contain local settings though (e.g. workspace)? How does IDEA know to exclude these from commits?

0
Avatar
Permanently deleted user

Yes, .idea directory contains 'local settings' files as well, and it's up to end-user to decide what files should be kept and synced via vcs

Denis

0
Avatar
Permanently deleted user

I see. Which of the xml files contain local settings in .idea?

0
Avatar
Permanently deleted user

OK. Thanks Serge and Denis for your help.

0

@Serge: If you deprecate file based projects, please fix the directory based projects first that they are *completely relative* to their project folder, and can be copied around and still keep on working, just like file based projects now. Thanks in advance. :)

0

Directory based projects should work exactly the same as the file based in terms of using the relative paths where possible. If it doesn't work for you, please report a bug with more details: https://youtrack.jetbrains.com/newIssue?project=IDEA .

0

Thanks for your answer.

I've tried to reproduce  the error I got earlier with a simple new project, but could not.

I now suspect the error was caused by some Gradle configuration in the original project, now removed.

When I use only IntelliJ projects it works fine indeed.

 

0

Please sign in to leave a comment.