Additional source folders within one content root

Hi

My source folders is located outside the project folder and shared by other projects. Is seems impossible to me to have several source folders within one content root, is that right and why??
The only solution i can find is to add a content root for each source folder which give millions (well not millions, but ;) of folders that uses space in the project explorer for no reason...

I tried for find some doc i the help folder of the idea installation, but the "project" folder is missing???

0
Avatar
Permanently deleted user

Frank Nielsen wrote:

Hi

My source folders is located outside the project folder and shared by
other projects. Is seems impossible to me to have several source folders
within one content root, is that right and why??


You can have several source folders within one content root.

The only solution i can
find is to add a content root for each source folder which give millions
(well not millions, but ;) of folders that uses space in the project
explorer for no reason...


It is possible to mark content root inself as source folder, so you will
have as many folders in Project view as you have source folders, which is
perfectly reasonable IMO.

Friendly,
Dmitry
--
Dmitry Lomov
Software Developer
JetBrains Inc.
http://www.jetbrains.com
"Develop with pleasure!"

0

Hi Dmitry

Thanks for your quick answer :D

My problem is that i want to have source "folders" in my projekt that is pointing outside the project folder.

Example:

project_home is "C:\Documents and Settings\fln\IdeaProjects\supercoolproject\**"

source_home is "p:\supercooljava\**"

So instead of creating a subfolder and mark it as source folder under the project_home i rather select a path to be the src folder.

Cheers, Frank

0
Avatar
Permanently deleted user

Sounds like you ought to look into using modules...

Vil.

Frank Nielsen wrote:

Hi Dmitry

Thanks for your quick answer :D

My problem is that i want to have source "folders" in my projekt that is pointing outside the project folder.

Example:

project_home is "C:\Documents and Settings\fln\IdeaProjects\supercoolproject\**"

source_home is "p:\supercooljava\**"

So instead of creating a subfolder and mark it as source folder under the project_home i rather select a path to be the src folder.

Cheers, Frank


--
Vilya Harvey
vilya.harvey@digitalsteps.com / digital steps /
(W) +44 (0)1483 469 480
(M) +44 (0)7816 678 457 http://www.digitalsteps.com/

0

Well, i have tested this module thing...

But the modules are still created under the content root, even though i have select the path to the source files which is on another drive. Then i can create a source folder, once again, under the content root. How is that going to help me????

either there is a bug or i am totally confused - or both ;)

also tested using build: 1113



Any help is usefull now, cheers Frank

0
Avatar
Permanently deleted user

I think you might be getting a bit confused. :)

When you create a module, the wizard lets you specify where it is to be
created. Once you've selected the type of module to create, the next screen
lets you choose the location. There is a label at the bottom of that screen
which tells you where the module file will be saved. This can be anywhere
you like; it doesn't have to be inside the content root.

Hope that helps,
Vil.

Frank Nielsen wrote:

Well, i have tested this module thing...

But the modules are still created under the content root, even though i have select the path to the source files which is on another drive. Then i can create a source folder, once again, under the content root. How is that going to help me????

either there is a bug or i am totally confused - or both ;)

also tested using build: 1113



Any help is usefull now, cheers Frank


--
Vilya Harvey
vilya.harvey@digitalsteps.com / digital steps /
(W) +44 (0)1483 469 480
(M) +44 (0)7816 678 457 http://www.digitalsteps.com/

0

Thanks, Vil.

But still, the problem is that my source folder is located else where from the content root.

So i have to create a module for each external source folder and redo this for each project.

Another thing about the module file. It points to the creator of the module - who can it be shared with other projects then??
Also it seems that i have to define a output path on each module?

Much overhead for actually doing nothing! It was so damn easy in IDEA 3.x.x - why is that wasted...

Some many questions, so little answers....

0
Avatar
Permanently deleted user

Ah, I think I see where you misunderstood me. I meant that you could create
a module for the external source folder. The module definition would be
saved at the root of the source folder, or wherever else was appropriate. So
the content root for this new module would be the external source folder.

Example:

"MyProject" has two modules: the main one which is created automatically
(I'll call it "Main" for now) and another for the external source called
"ExternalSource". They're set up as follows:

MyProject (saved as c:\projects\myproject\MyProject.ipr)
Project directory = c:\projects\myproject

Main (saved as c:\projects\myproject\Main.iml)
Content root = c:\projects\myproject
Source dir = c:\projects\myproject\src
Output dir = c:\projects\myproject\classes

ExternalSource (saved as e:\shared\ExternalSource.iml)
Content root = e:\shared
Source dir = e:\shared\src
Output dir = e:\shared\classes

Frank Nielsen wrote:

Thanks, Vil.

But still, the problem is that my source folder is located else where from the content root.


No, content roots are per-module. You would create a module specifically for
your external sources, whose content root would be the directory that
contains those sources (or some level above it in the directory tree). Your
source folder would be inside the content root for this module.

So i have to create a module for each external source folder and redo this for each project.


You only have to create the module once. You can add an existing module to a
new project very easily (File menu > New module..., then choose "Import
existing module" and enter the path to the module file).

Another thing about the module file. It points to the creator of the module - who can it be shared with other projects then??
Also it seems that i have to define a output path on each module?


I'm not sure what you've been looking at, but module files do not contain
any information like that. They can easily be shared with other projects
(that's one of the main things they're designed for!) as well as other
developers. Module files are the ones with the .iml extension. Perhaps
you've been looking at the project (.ipr) or workspace (.iws) files by mistake?

Much overhead for actually doing nothing! It was so damn easy in IDEA 3.x.x - why is that wasted...


Once you understand how modules work, you'll see that they actually provide
a lot more than what 3.0.x ever did. It actually makes it a lot easier to
share common code between projects.

Some many questions, so little answers....


If you want a (very) brief introduction into what modules are for and why
you'd want to use them, see this section in the Unofficial Aurora FAQ:
http://www.intellij.org/twiki/bin/view/Main/UnofficialAuroraFAQ#WhatAreModules

If you've been looking at the help files which are now being included in the
EAP releases, don't. They're quite out of date in a lot of areas and
although they mention web modules and EJB modules, there is not yet any
general discussion of modules and the concepts behind them.

If you're still stuck after reading this, email me directly and I'll send
you a sample project set up the way I suggested above. Cheerio,

Vil.
--
Vilya Harvey
vilya.harvey@digitalsteps.com / digital steps /
(W) +44 (0)1483 469 480
(M) +44 (0)7816 678 457 http://www.digitalsteps.com/

0

Thanks for the clear answer, i will look at it this evening and report back my experience :D

Thanks again, Frank

0

请先登录再写评论。