Modules system question

Hello-

In Aurora's upcoming modules system, how will a project (.ipr) refer to
modules (.iml)- by absolute path or by $PROJECT_DIR$-relative path?

Thanks-

Danny

12 comments
Comment actions Permalink


Daniel Burkes wrote:

In Aurora's upcoming modules system, how will a project (.ipr) refer to
modules (.iml)- by absolute path or by $PROJECT_DIR$-relative path?


I added a project's .iml file to another project by editing the .ipr file and added
a relative reference to the iml file. After loading that project, the reference all
of a sudden was absolute (c:/...). However, I think that with the official release
of the module system it will be possible to store relative paths.

See this SCR: http://www.intellij.net/tracker/idea/viewSCR?publicId=16156


Sascha


0
Comment actions Permalink

Daniel Burkes wrote:

Hello-

In Aurora's upcoming modules system, how will a project (.ipr) refer to
modules (.iml)- by absolute path or by $PROJECT_DIR$-relative path?

Thanks-

Danny


It will depend on 'Relative Paths' settings that will soon find it way back
into Project Properties.

Friendly,
Dmitry

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

0
Comment actions Permalink

In article <blc9dl$91r$2@is.intellij.net>, Dmitry.Lomov@jetbrains.com
says...

Daniel Burkes wrote:

Hello-

In Aurora's upcoming modules system, how will a project (.ipr) refer to
modules (.iml)- by absolute path or by $PROJECT_DIR$-relative path?

Thanks-

Danny


It will depend on 'Relative Paths' settings that will soon find it way back
into Project Properties.

Friendly,
Dmitry

Thank you, Dmitry. I have a few related questions:

When I create a project P1, this creates files like P1.ipr, P1.iml, and
P1.iws. If I then define and use a project library PL1 within P1, the
definition for PL1 is stored in P1.ipr, and a reference to it is stored
in P1.iml.

Now, in some other project P2, I want to include the P1 module. So, in
the upcoming module UI, I indicate that P2 should include P1. This
writes a reference to P1.iml into P2.ipr.

Now, my questions are:

1. Since PL1 is referred to by P1.iml, but defined in P1.ipr, I guess
IDEA must read P1.ipr to find the definition of this library, correct?

2. IDEA must place PL1 on the classpath when some Run or Debug
configuration of P2 is executed, correct?

3. Does IDEA place PL1 on the classpath when P2's module is building,
or only when P1's module is building?

4. Can P2 refer directly to PL1? That is, can I add a project library
from P1 directly into the library list in P2, once I indicate that P2
requires P1?

Thanks for you time-

Danny

0
Comment actions Permalink

Daniel Burkes wrote:

In article <blc9dl$91r$2@is.intellij.net>, Dmitry.Lomov@jetbrains.com
says...

>> Daniel Burkes wrote:
>>
>> > Hello-
>> >
>> > In Aurora's upcoming modules system, how will a project (.ipr) refer to
>> > modules (.iml)- by absolute path or by $PROJECT_DIR$-relative path?
>> >
>> > Thanks-
>> >
>> > Danny
>>
>> It will depend on 'Relative Paths' settings that will soon find it way
>> back into Project Properties.
>>
>> Friendly,
>> Dmitry
>>
>>

Thank you, Dmitry. I have a few related questions:

When I create a project P1, this creates files like P1.ipr, P1.iml, and
P1.iws. If I then define and use a project library PL1 within P1, the
definition for PL1 is stored in P1.ipr, and a reference to it is stored
in P1.iml.


P1.iml is just a module which is one of the modules your project may
include.


Now, in some other project P2, I want to include the P1 module. So, in
the upcoming module UI, I indicate that P2 should include P1. This
writes a reference to P1.iml into P2.ipr.

Now, my questions are:

1. Since PL1 is referred to by P1.iml, but defined in P1.ipr, I guess
IDEA must read P1.ipr to find the definition of this library, correct?


You need to define a library named PL1 in project P2. P1 module will use
that library when included in P2.


2. IDEA must place PL1 on the classpath when some Run or Debug
configuration of P2 is executed, correct?


Yes.


3. Does IDEA place PL1 on the classpath when P2's module is building,
or only when P1's module is building?


PL1 library from project P2 will be included.


4. Can P2 refer directly to PL1? That is, can I add a project library
from P1 directly into the library list in P2, once I indicate that P2
requires P1?


I guess I answered that before.

Friendly,
Dmitry

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

0
Comment actions Permalink



>>1. Since PL1 is referred to by P1.iml, but defined in P1.ipr, I guess
>>IDEA must read P1.ipr to find the definition of this library, correct?


You need to define a library named PL1 in project P2. P1 module will use
that library when included in P2.


I'm somewhat confused about this point.

I have define a module. That module defines it dependencies
(via a library defined in what scope?). Now I want to use that module in
another project. Do I:

a) Have to "know" the dependencies of reused module and redefine
a library in the reusing project?
b) Have to "know" the names of libraries used by reused module and
include them in the reusing project?
c) Idea automatically makes available to the reusing project the
dependent libraries of the reused module?

0
Comment actions Permalink

1. Since PL1 is referred to by P1.iml, but defined in P1.ipr, I guess
IDEA must read P1.ipr to find the definition of this library, correct?


You need to define a library named PL1 in project P2. P1 module will use
that library when included in P2.


If that's true, then it sounds really bad! It would mean that an iml
file doesn't represent something self-contained and reusable.

In such a system, if I want to include the module P1 in some other
project P2, then I have to discover all the dependencies of P1 myself,
and add a whole bunch of duplicate library definitions to P2, even
though I already defined them somewhere else.

Don't you think a module should be completely self-contained? That is,
shouldn't it completely specify its source directories, output
directories, compile-time dependencies, etc?

In the system you described, if I have 25 projects that use module P1, I
have to define the project libraries used by P1 25 times. That's not
"developing with pleasure"- it's more like developing a migraine :)

- Danny

0
Comment actions Permalink

Daniel Burkes wrote:
>>>1. Since PL1 is referred to by P1.iml, but defined in P1.ipr, I guess
>>>IDEA must read P1.ipr to find the definition of this library, correct?
>>
>>You need to define a library named PL1 in project P2. P1 module will use
>>that library when included in P2.
>>


If that's true, then it sounds really bad!


I'm worried about that too. I want to see the implementation once the UI
comes out in case there is some reasonable alternative, but if there
isn't... we'll need to file a new SCR.

Jon

0
Comment actions Permalink

Daniel Burkes wrote:

>> > 1. Since PL1 is referred to by P1.iml, but defined in P1.ipr, I guess
>> > IDEA must read P1.ipr to find the definition of this library, correct?
>>
>> You need to define a library named PL1 in project P2. P1 module will use
>> that library when included in P2.
>>


If that's true, then it sounds really bad! It would mean that an iml
file doesn't represent something self-contained and reusable.

In such a system, if I want to include the module P1 in some other
project P2, then I have to discover all the dependencies of P1 myself,
and add a whole bunch of duplicate library definitions to P2, even
though I already defined them somewhere else.


No you do not. As for libraries, you have the following options:
1. You can put library definition to a module ("module-level" library)
It will be visible only in this module and will be stored in .iml file
2. You can put library definition to a project ("project-level" library).
It will be visible to all modules in this project, will be strored in
.iml file and will be referenced from .imls by name
3. You can have a global library - that is, a library that can be shared
between projects. Its definition is stored separately and can be put to
your VCS.

Don't you think a module should be completely self-contained? That is,
shouldn't it completely specify its source directories, output
directories, compile-time dependencies, etc?

In the system you described, if I have 25 projects that use module P1, I
have to define the project libraries used by P1 25 times. That's not
"developing with pleasure"- it's more like developing a migraine :)


Do not put too many harsh words in until you see the whole picture.
We all here can do with a little bit more of open mind. :)

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

0
Comment actions Permalink

In article <ble0n1$t6o$1@is.intellij.net>, Dmitry.Lomov@jetbrains.com
says...

No you do not. As for libraries, you have the following options:
1. You can put library definition to a module ("module-level" library)
It will be visible only in this module and will be stored in .iml file


Oh, I didn't know about "module-level" libraries, thanks for informing
me. Just one question- are the paths in module-level libraries stored
as relative paths or absolute paths? If they are relative paths, what
are they relative to?

2. You can put library definition to a project ("project-level" library).
It will be visible to all modules in this project, will be strored in
.iml file and will be referenced from .imls by name


I assume you meant "stored in .ipr file" rather than "stored in .iml
file", correct?

Also, my understanding is that project-level libraries can be stored as
absolute or relative paths, depending on the "Store all paths relative"
setting in the project properties- is this correct?

3. You can have a global library - that is, a library that can be shared
between projects. Its definition is stored separately and can be put to
your VCS.


Are the paths in global libraries stored as relative paths or absolute
paths? If they are relative paths, what are they relative to?

In the system you described, if I have 25 projects that use module P1, I
have to define the project libraries used by P1 25 times. That's not
"developing with pleasure"- it's more like developing a migraine :)


Do not put too many harsh words in until you see the whole picture.
We all here can do with a little bit more of open mind. :)


I meant the "migrane" part as a joke, not a jab :) If you think those
were harsh words, you should start reading BileBlog :-D

Regards,

Danny

0
Comment actions Permalink

In article <MPG.19e432b9cebe17e4989691@news.intellij.net>,
i@dont.want.spam says...

In article <ble0n1$t6o$1@is.intellij.net>, Dmitry.Lomov@jetbrains.com
says...

No you do not. As for libraries, you have the following options:
1. You can put library definition to a module ("module-level" library)
It will be visible only in this module and will be stored in .iml file


Oh, I didn't know about "module-level" libraries, thanks for informing
me. Just one question- are the paths in module-level libraries stored
as relative paths or absolute paths? If they are relative paths, what
are they relative to?

2. You can put library definition to a project ("project-level" library).
It will be visible to all modules in this project, will be strored in
.iml file and will be referenced from .imls by name


I assume you meant "stored in .ipr file" rather than "stored in .iml
file", correct?

Also, my understanding is that project-level libraries can be stored as
absolute or relative paths, depending on the "Store all paths relative"
setting in the project properties- is this correct?

3. You can have a global library - that is, a library that can be shared
between projects. Its definition is stored separately and can be put to
your VCS.


Are the paths in global libraries stored as relative paths or absolute
paths? If they are relative paths, what are they relative to?

In the system you described, if I have 25 projects that use module P1, I
have to define the project libraries used by P1 25 times. That's not
"developing with pleasure"- it's more like developing a migraine :)


Do not put too many harsh words in until you see the whole picture.
We all here can do with a little bit more of open mind. :)


I meant the "migrane" part as a joke, not a jab :) If you think those
were harsh words, you should start reading BileBlog :-D

Regards,

Danny


Could Dmitry (or anyone from Jetbrains) answer the follow-up questions I
posed above?

Thanks-

Danny

0
Comment actions Permalink

Daniel Burkes wrote:

In article <ble0n1$t6o$1@is.intellij.net>, Dmitry.Lomov@jetbrains.com
says...

>> No you do not. As for libraries, you have the following options:
>> 1. You can put library definition to a module ("module-level" library)
>> It will be visible only in this module and will be stored in .iml file


Oh, I didn't know about "module-level" libraries, thanks for informing
me. Just one question- are the paths in module-level libraries stored
as relative paths or absolute paths? If they are relative paths, what
are they relative to?


To .iml file location.

>> 2. You can put library definition to a project ("project-level" library).
>> It will be visible to all modules in this project, will be strored in
>> .iml file and will be referenced from .imls by name


I assume you meant "stored in .ipr file" rather than "stored in .iml
file", correct?


Yes, sorry.


Also, my understanding is that project-level libraries can be stored as
absolute or relative paths, depending on the "Store all paths relative"
setting in the project properties- is this correct?


Yes.

>> 3. You can have a global library - that is, a library that can be shared
>> between projects. Its definition is stored separately and can be put
>> to your VCS.


Are the paths in global libraries stored as relative paths or absolute
paths? If they are relative paths, what are they relative to?


They are absolute. See
http://www.intellij.net/tracker/idea/viewSCR?publicId=10474 though.

>> > In the system you described, if I have 25 projects that use module P1,
>> > I
>> > have to define the project libraries used by P1 25 times. That's not
>> > "developing with pleasure"- it's more like developing a migraine :)
>>
>> Do not put too many harsh words in until you see the whole picture.
>> We all here can do with a little bit more of open mind. :)
>>


I meant the "migrane" part as a joke, not a jab :) If you think those
were harsh words, you should start reading BileBlog :-D


I do read bile blog - but I am quite used to Hani's personal style after 1.5
years of reading his EAP posts :)

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

0
Comment actions Permalink

Thanks for your answers, Dmitry- they were all excellent news! It seems
like with Aurora we will finally be able to encapsulate our build
dependencies in a way that is independent of where a developer placed
the source tree on his local machine.

Regards,

Danny

0

Please sign in to leave a comment.