Help With Content / Source Folders

I just started using build 818 (after being on 701 most recently -- IDEA version 3.0.4) and am very confused with this new "content" concept.

I have a directory structure such as:

C:\devl
/com
/ksystems
/seurat
/a
/b
/c

Well, you get the idea. I added "com" as my source folder. Now, nothing in the sub folders compiles as references are broken (i.e. "Cannot resolve symbol" errors).

What did I do wrong here? Surely, I can add the high level source folder to the content. I hope I don't have to add each and every low level source folder to the content.

28 comments
Comment actions Permalink

>

C:\devl
/com

>

Well, you get the idea. I added "com" as my source folder. Now, nothing in

the sub folders compiles as references are broken (i.e. "Cannot resolve
symbol" errors).

Add devl as the contents dir, not com.


0
Comment actions Permalink

I did add "devl" as the content, then added "com" as the source. But apparently, Aurora does not "drill down" the source directory. The only way I've been able to avoid the "Cannot resolve symbol" messages is to add each and every directory that contains a .java file. In my original example this means that I have to add "a", "b" and "c" as source folders. In reality, I had to do much more work than that has we have dozens of source folders on this project I'm on.

0
Comment actions Permalink

devl should be your content and your source directory. The source dir has to be one level above your package structure.

0
Comment actions Permalink

Kevin Shaughnessy wrote:

I have a directory structure such as:

C:\devl
/com
/ksystems
/seurat
/a
/b
/c


As others have pointed out, you should set C:\dev1 as your Content
directory and as a Source directory.

However, I would like to suggest that you improve your project directory
layout. A standard layout used by many projects is:

- src/ - java/ - com/ - ksystems/ - seurat/ - a/ - ... With this layout, you would specify as the Content directory for IDEA, and /src/java as a Source directory. Ciao, Gordon -- Gordon Tyler (Software Developer) Quest Software ]]>
260 King Street East, Toronto, Ontario M5A 4L5, Canada
Voice: 416-643-4846 | Fax: 416-594-1919

0
Comment actions Permalink

I agree that the directory structure is not good, but I just started this new job the other day and this is how they do things here. I have no say in the matter (yet).

So explain to me one more thing... Making \devl the content AND the source does work. But how is this any different than the way IDEA 3.0 worked? This the same directory that I would set as a source path in the old IDEA. What is the concept behind "content" and "source"?

0
Comment actions Permalink

It forces the developer to ponder the difference between the material and the quintessential... ;)

It's the same difference between the project roots and source folders in ariadne, except you are now restricted to only selecting source folders which are under one of your project roots ("content folders")

0
Comment actions Permalink

Sorry, I still don't get it.

In the old IDEA there were "Project Paths" and "Source Paths". Source paths were where the source code could be found, of course. Project paths were paths that were identified to IDEA so that it could find usages and do refactoring. A source path could be a project path for that purpose. In that case the source path and project path were at the same level.

But, it seems now that source paths are contained within "content" (whatever content is). So there is some sort of hierarchical relationship apparently. But I don't see how "content" equates to the old "project". Where do I specify in Aurora that code should or should not be refactored, etc?

0
Comment actions Permalink

Oh, I see your point. Hmm. I guess you'd have to use the library definitions. Put source code that you don't want included in the usages and refactorings into a library.

I guess I never played with that in ariadne, because I didn't realize that source paths defined in my projects, but not under project paths didn't get included in usages searches and refactorings.

0
Comment actions Permalink

FYI -- that is a good way to include 3rd party source code (Struts, Log4J, etc) in IDEA without worrying about it getting refactored. Just include it as a source path but leave it out of the project path.

0
Comment actions Permalink

Aidan Monroe wrote:

Sorry, I still don't get it.

In the old IDEA there were "Project Paths" and "Source Paths". Source paths were where the source code could be found, of course. Project paths were paths that were identified to IDEA so that it could find usages and do refactoring. A source path could be a project path for that purpose. In that case the source path and project path were at the same level.

But, it seems now that source paths are contained within "content" (whatever content is). So there is some sort of hierarchical relationship apparently. But I don't see how "content" equates to the old "project". Where do I specify in Aurora that code should or should not be refactored, etc?


"Content" identifies the entire contents of your project. Everything.
From shell scripts to HTML to Java source code, EVERYTHING.

Now within your project, IDEA needs to know which directories are roots
of Java source hierarchies so that it can do refactoring and stuff like
that.

Ciao,
Gordon

--
Gordon Tyler (Software Developer)
Quest Software <http://java.quest.com/>
260 King Street East, Toronto, Ontario M5A 4L5, Canada
Voice: 416-643-4846 | Fax: 416-594-1919

0
Comment actions Permalink

OK, so if I wanted to include Struts source code (for example) so I can compile it and debug it when necessary BUT NOT include it in refactorings I would add the Struts source root as "content" BUT NOT add the same root as "source"? Is this correct?

0
Comment actions Permalink

Well, I just tried the scenario I just described and am still confused.

In the "Project" pane there is a drop list (just like the old IDEA) that has 3 values: Project, SourcePath, and Classpath. I would expect that "Content" would now be there, but that's not the issue.

If I add the root to Struts source as "content" but not as "source" then this directory shows up when I select "Project" in the droplist but does not show up when I select "Sourcepath". This is exactly the opposite of what I wanted. I don't want it in the "project" because I don't want it to be considered for refactoring. I want it to be in the "source path" so I can compile it, etc.

0
Comment actions Permalink

Even more, if a folder is not identified as "source" then the .java files within it and its subdirectories are not displayed in the project pane.

This whole "content" approach is obviously not very well thought out and apparently functionality has been lost (or intentionally removed) by implementing it.

Can someone from IntelliJ please explain how this is supposed to work in relation to the old functionality?

0
Comment actions Permalink

Aidan Monroe wrote:

OK, so if I wanted to include Struts source code (for example) so I can compile it and debug it when necessary BUT NOT include it in refactorings I would add the Struts source root as "content" BUT NOT add the same root as "source"? Is this correct?


In your project, define a library for Struts with entries for the class
jar and the source jar/zip/directory.

Ciao,
Gordon

--
Gordon Tyler (Software Developer)
Quest Software <http://java.quest.com/>
260 King Street East, Toronto, Ontario M5A 4L5, Canada
Voice: 416-643-4846 | Fax: 416-594-1919

0
Comment actions Permalink

I second that motion. I must admit I totally agree with Aidan on this, the old mechanism in Ariadne was really very very intuitive and explicit!! You didn't even have to read the help files to figure out the purpose of all those tabs. In Aurora, project structure is beginning to look much more confused and counterintuitive just like in Eclipse...yikes Please could someone from JetBrains set us straight, or roll-back to the good ol' days.

Cheers

ghetto

0
Comment actions Permalink

+This whole "content" approach is obviously not very well thought out and apparently functionality has been lost (or intentionally removed) by implementing it. +

I was thinking much the same thing about a week ago, when I discovered that you couldn't sort the order that folders appeared in the project view anymore.

The argument was that it didn't make any sense to be able to do that anymore. But doesn't make sense for whom? The programmer? The IDE? The joy behind using IDEA was that it sort of understood the way I worked, but I'm a bit worried that we're losing that, especially with the new project structure. It may make sense from the IDE's point of view, but I can't say I'm impressed with it, in terms of simplicity and useability.

Still, it is still very much work in progress, so there is hope that it will improve.

0
Comment actions Permalink

the old mechanism in Ariadne was really very very intuitive and explicit!! You didn't even have to read the help files to figure out the purpose of all those tabs.

Yep.

In Aurora, project structure is beginning to look much more confused and counterintuitive just like in Eclipse...yikes!

Yes, I thought I recognised that feeling of confusion from somewhere .... :)

0
Comment actions Permalink

Aidan Monroe wrote:

Even more, if a folder is not identified as "source" then the .java files
within it and its subdirectories are not displayed in the project pane.

This whole "content" approach is obviously not very well thought out and
apparently functionality has been lost (or intentionally removed) by
implementing it.

Can someone from IntelliJ please explain how this is supposed to work in
relation to the old functionality?


Ok well then here I am :)

I will first critisize the old model, and then proceed to describing the new
one...

Well, there was something called "project path" in the old model. And
something called "source path". And refactorings and things worked in
your source file if the source file was under "source path" which was under
"project path". And if it was not in source path under project path, that
it was source but refactoring does not work, and if it is not under source
path, then you cannot edit it (and you do not even see it in project view).
Is this intuitive for you? If your intuition is so high above the average
that you think it is, answer a simple question: you have a jar in your
"project path" which contains a source for smth. You add this jar as a
source path. Will refactorings work there? :)

Moreover, there was no way to associate particular sources with particular
classpaths, so you could run one class and step by totally unrelated
source...

Consider also all those JavaDoc paths and exclude paths that all were
totally unrelated....

Ok, now for a new model:
First of all, what you see in "Main Module" tab is a configuration for just
one module. You'll be able to define more shortly.

Basically, a module is a collection of files. When you configure a module,
you specify its Content . A content of a module is a set of directories.
Some subdirectories of those directories are marked as "source folders" -
those are folders where you Java source and associated resources are (that
is, source folders are roots for Java packages).

Some subdirectories may be excluded from module content.

A module can have a set of libraries that are associated with it. A library
is a bundle of classes, their sources and their JavaDoc (much like JDK is).
You can configure list of libraries that your module use.

For example, you can define a JDOM library, which consists of:

  • jdom.jar - set of class files

  • jdom-src.zip - sources for JDOM

  • jdom-javadoc.zip - pre-generated javadoc for JDOM


Libraries can be stored on module level, on project level (shared between
modules), or separately (shared between projects).

I hope things are more clear now.

Cheers,
Dmitry


--
Dmitry Lomov
IntelliJ Labs / JetBrains Inc.
http://www.intellij.com
"Develop with pleasure!"

0
Comment actions Permalink

Why do you need the content level?

Couldn't you just stick stuff straight into the module?

0
Comment actions Permalink

Dmitry wrote:

First of all, what you see in "Main Module" tab is a configuration for
just one module. You'll be able to define more shortly.


More important (possibly) comments/questions below, but can you give us
any word on when? I'm just asking for a rough estimate (a week, a few
weeks, a month, a few months, etc) not a date.

Basically, a module is a collection of files. When you configure a
module, you specify its Content . A content of a module is a set of
directories. Some subdirectories of those directories are marked as
"source folders" - those are folders where you Java source and
associated resources are (that is, source folders are roots for Java
packages).


Okay, if a "content" is a form of root directory, then when I'm
specifying source/exclude/etc folders under that, why not root the
file/folder list at that folder? That would make things a bit more
intuitive. Or better yet, allow me to go into an "edit mode" on the
content folder that lets me mark all the folders all at once. (I think
someone else suggested something similar in a separate thread.) For
example, I add "C:\project\content_root1" as a content folder, then
right-click to edit it (or press the "edit" button or whatever). Now I
get a dialog that shows a tree view rooted at
"C:\project\content_root1". Then, I can select each folder (via combo
boxes or something) to be one of:
default - regular (non-source, not excluded) files
source - Java package root
exclude - self-explanatory

In fact, you might not even need the dialog. You could just do this in
the project properties/module definition panel. You would just have to
change the way you're presenting the content folders' contents and add
the combo-boxes.

Oh, and auto-detecting source folders again would be great. You could
also auto-detect test folders by expecting a few patterns. For example,
a folder named test or tst that is also a Java package root (which you
can already determine) is likely a test folder. It might not catch
everyone's patterns, but it would be better than nothing.

Anyway, let me know what you think and if you think I should post this
as a feature request or multiple requests or whatever.

One more thing on the use of the word "content". It doesn't really work.
What you're trying to say most of the time is "Module Contents".
However, you're not specifying arbitrary contents of a container, what
you're really specifying are "Module Directories" or something like
that. I think that's one source of the confusion about this.


~Mike

0
Comment actions Permalink

Mike Abney wrote:

Dmitry wrote:

>> First of all, what you see in "Main Module" tab is a configuration for
>> just one module. You'll be able to define more shortly.


More important (possibly) comments/questions below, but can you give us
any word on when? I'm just asking for a rough estimate (a week, a few
weeks, a month, a few months, etc) not a date.


I hope it will be there in a week or two. We are concetrating on generics
support right now - we need at least basic stuff to work, as we want to use
them ourselves.

>> Basically, a module is a collection of files. When you configure a
>> module, you specify its Content . A content of a module is a set of
>> directories. Some subdirectories of those directories are marked as
>> "source folders" - those are folders where you Java source and
>> associated resources are (that is, source folders are roots for Java
>> packages).


Okay, if a "content" is a form of root directory, then when I'm
specifying source/exclude/etc folders under that, why not root the
file/folder list at that folder? That would make things a bit more
intuitive. Or better yet, allow me to go into an "edit mode" on the
content folder that lets me mark all the folders all at once. (I think
someone else suggested something similar in a separate thread.) For
example, I add "C:\project\content_root1" as a content folder, then
right-click to edit it (or press the "edit" button or whatever). Now I
get a dialog that shows a tree view rooted at
"C:\project\content_root1". Then, I can select each folder (via combo
boxes or something) to be one of:
default - regular (non-source, not excluded) files
source - Java package root
exclude - self-explanatory

In fact, you might not even need the dialog. You could just do this in
the project properties/module definition panel. You would just have to
change the way you're presenting the content folders' contents and add
the combo-boxes.

Oh, and auto-detecting source folders again would be great. You could
also auto-detect test folders by expecting a few patterns. For example,
a folder named test or tst that is also a Java package root (which you
can already determine) is likely a test folder. It might not catch
everyone's patterns, but it would be better than nothing.


We are working on a better GUI for contents - something along the lines you
outlined. And autodetecting will be back too, of course.


One more thing on the use of the word "content". It doesn't really work.
What you're trying to say most of the time is "Module Contents".
However, you're not specifying arbitrary contents of a container, what
you're really specifying are "Module Directories" or something like
that. I think that's one source of the confusion about this.


Well, I am afraid I do not see your point here. Module consists of a set of
files. A set of files is a content of a module. I fail to understand what a
"module directory" is. I would think that module directory is something
that lists modules.


Friendly,
Dmitry
--
Dmitry Lomov
IntelliJ Labs / JetBrains Inc.
http://www.intellij.com
"Develop with pleasure!"

0
Comment actions Permalink

Dmitry wrote:

I hope it will be there in a week or two. We are concetrating on
generics support right now - we need at least basic stuff to work, as
we want to use them ourselves.


Fair enough. Can't wait to see how the multi-module stuff works with
regard to performance and memory. (Not to mention I'll be able to use
IntelliJ to build again rather than having to use Ant.)

We are working on a better GUI for contents - something along the
lines you outlined. And autodetecting will be back too, of course.


I had assumed both of these were the case. It's good to have that
confirmed, though.

>> One more thing on the use of the word "content". It doesn't really
>> work. What you're trying to say most of the time is "Module
>> Contents". However, you're not specifying arbitrary contents of a
>> container, what you're really specifying are "Module Directories" or
>> something like that. I think that's one source of the confusion about
>> this.


Well, I am afraid I do not see your point here. Module consists of a
set of files. A set of files is a content of a module. I fail to
understand what a "module directory" is. I would think that module
directory is something that lists modules.


It's just the use of the word content. For example, calling something "a
content" doesn't sound right (i.e. isn't common usage). For one thing
it's not that common to see "content" used singularly. It is more often
used in the plural: "contents". Regardless, I don't mean to be
nit-picking about grammar here; I'm not an English teacher.

I think the real problem is that the word is too general. I tried to
come up with something better and was attempting to say that the word
"directory" could replace the word "content". (E.G. the button on the
project properties module panel would say "Add Directory" rather than
"Add Content") If that doesn't work for you, how about using "file
folder" or at least expanding it to "content folder" or "content
directory". (E.G. the button would say "Add Content Folder".)

This would work especially well if the other "Add Source
Folder..." buttons were removed from that panel in favor of the
combo-box or some similar approach.

As always, thanks for taking the time to read and consider my input. You
IntelliJ folks almost always seem to do things better than I could hope
for, so it's actually nice when I have the chance to provide some input
that might make things even better.


~Mike

0
Comment actions Permalink

I'm still wondering, why you have fixed one that ain't broken? Any deal with my intuition? leave it to me, ok?

Content/Source/Exclude is very difficult to understand without reading forum topics. Moreover, Local VCS being unusable if I have to add a laaaarge project. I JUST DO NOT WANT TO WAIT HOURS while the LVCS will have to scan it.

Then, if I won't be able to create a valid project in a five minutes - I would throw the Aurora out.

0
Comment actions Permalink

Victor wrote:

I'm still wondering, why you have fixed one that ain't broken? Any deal
with my intuition? leave it to me, ok?

Content/Source/Exclude is very difficult to understand without reading
forum topics. Moreover, Local VCS being unusable if I have to add a
laaaarge project. I JUST DO NOT WANT TO WAIT HOURS while the LVCS will
have to scan it.

Then, if I won't be able to create a valid project in a five minutes - I
would throw the Aurora out.


Go ahead then. NOTE: THIS IS PREVIEW SOFTWARE AIMED AT PROVIDING YOU WITH AN OPPORTUNITY TO TEST THE NEWEST FEATURES SCHEDULED FOR THE NEXT MAJOR RELEASE. JetBrains, Inc. DOES NOT GUARANTEE THAT THIS SOFTWARE WILL RUN TROUBLE-FREE. USING THIS SOFTWARE IS AT YOUR OWN DISCRETION AND DOES NOT ENTITLE YOU TO ANY CUSTOMER SUPPORT (EVEN IF YOU OWN A SUPPORT CONTRACT). IF YOU ARE NOT WILLING OR ABLE TO ACCEPT THE ABOVE MENTIONED CONDITIONS, YOU ARE WELCOME AND ENCOURAGED TO USE THE LATEST RELEASED VERSION AVAILABLE FROM THE DOWNLOAD PAGE LOCATED OUR WEB-SITE (http://www.intellij.com) ]]>

Yours,
Dmitry
--
Dmitry Lomov
IntelliJ Labs / JetBrains Inc.
http://www.intellij.com
"Develop with pleasure!"

0
Comment actions Permalink

You r right of course. That post was a slightly expressive opinion about the improvement. I beg you a pardon about it.

But in any way, there is a little inconvenience. AFAIK, "New project" wizzard for now offers the old way for creation of the project. Meanwhile the items one have entered there, have a different meaning for new project structure. Thus following the new project wizzard, I've expected that the project would be created with no doubt valid as it was before. But I've got a lot of headache trying to fix the class/source path instead.

I guess it would be very nice for sake of continuity to have an alternative way to setup the content/source directory properly via old-style project wizzard.

Thanx

0
Comment actions Permalink

I'm glad to see I'm not the only one! Maybe if the help buttons worked I could figure it out. I'll give them that much. It was definitely easier/more intuitive in 3.0x.

The issue I am encountering, is that my JSPs are all in a completely separate directory structure apart from my code, so I am forced to create two Content folders, bleh, and exclude a lot more than I'd like to. This isn't too bad, but I fail to see any benefits.

0
Comment actions Permalink

Victor wrote:

You r right of course. That post was a slightly expressive opinion about
the improvement. I beg you a pardon about it.

But in any way, there is a little inconvenience. AFAIK, "New project"
wizzard for now offers the old way for creation of the project. Meanwhile
the items one have entered there, have a different meaning for new project
structure. Thus following the new project wizzard, I've expected that the
project would be created with no doubt valid as it was before. But I've
got a lot of headache trying to fix the class/source path instead.


That is quite correct. We will implement a new "New project" wizard shortly.
BTW, in the next EAP build there will be a long-awaited convertor from
Ariadna to Aurora project, which will try to map old concepts to
new ones.

Friendly,
Dmitry
--
Dmitry Lomov
IntelliJ Labs / JetBrains Inc.
http://www.intellij.com
"Develop with pleasure!"

0
Comment actions Permalink

Christopher Lamothe wrote:

I'm glad to see I'm not the only one! Maybe if the help buttons worked I
could figure it out. I'll give them that much. It was definitely
easier/more intuitive in 3.0x.

The issue I am encountering, is that my JSPs are all in a completely
separate directory structure apart from my code, so I am forced to create
two Content folders, bleh, and exclude a lot more than I'd like to. This
isn't too bad, but I fail to see any benefits.


Christopher,
could you elaborate on your project structure then? AFAIU, you needed two
'Project Paths' in Ariadna to support what you describe. Is that right?

Friendly,
Dmitry
--
Dmitry Lomov
IntelliJ Labs / JetBrains Inc.
http://www.intellij.com
"Develop with pleasure!"

0

Please sign in to leave a comment.