Multiproject with eclipse

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Multiproject with eclipse

Ignacio Coloma
Hi, I know this may have been asked previously but I could not find it in the forums or elsewhere.

How is it expected to integrate gradle multiproject with eclipse? Say I have "myproject", "myproject/A" and "myproject/B", which are fine with gradle, but eclipse needs all projects as direct children of the workspace, so you should checkout "A" and "B" directly into the workspace, where "myproject" files are _not_ located.

Am I missing something?

Thanks in advance,

Ignacio.
Reply | Threaded
Open this post in threaded view
|

Re: Multiproject with eclipse

hans_d
Administrator
Hi Ignacio,

On Jul 14, 2008, at 6:01 PM, Ignacio Coloma wrote:

>
> Hi, I know this may have been asked previously but I could not find  
> it in the
> forums or elsewhere.

You are the first one on this list :)

>
> How is it expected to integrate gradle multiproject with eclipse?  
> Say I have
> "myproject", "myproject/A" and "myproject/B", which are fine with  
> gradle,
> but eclipse needs all projects as direct children of the workspace,  
> so you
> should checkout "A" and "B" directly into the workspace, where  
> "myproject"
> files are _not_ located.
>
> Am I missing something?

No. This is in fact a problem. Not just for Gradle, also for a couple  
of Maven plugins. There are two ways to deal with this:

- Change the multi-project layout: Right now Gradle only accepts  
hierarchical layouts. In the near future we want to support arbitrary  
multi-project layout. But right now you can't change the layout.

- Tweak Eclipse: I have done this in in a large enterprise Maven  
build and it has worked reliably. It works like this:
Provided there is a hierarchical project in svn. You check out the  
top level dir into Eclipse as a non Java Project (Simple project). If  
the .project Eclipse files are not in svn you have to generate them.  
As we don't provide a plugin for generating Eclipse project files yet  
this has to be done by hand. If the Eclipse project files of the  
subprojects are created you delete the .project file of the top level  
project. Than you are able to import the subprojects. After the  
import, as soon as you do some operations on the top-level project,  
Eclipse creates the .project file again automatically. But this is no  
problem, as you have already imported your subprojects. Without  
deleting the .project file, Eclipse would not allow to import the  
subprojects. It is big limitation of Eclipse not to support  
hierarchical layouts.

I can't offer you anything better at the moment.

- Hans

>
> Thanks in advance,
>
> Ignacio.
> --
> View this message in context: http://www.nabble.com/Multiproject- 
> with-eclipse-tp18447030p18447030.html
> Sent from the gradle-user mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>     http://xircles.codehaus.org/manage_email
>
>

--
Hans Dockter
Gradle Project lead
http://www.gradle.org





---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|

Re: Multiproject with eclipse

Ignacio Coloma
Thanks for the reply. I'm afraid the process is too much error-prone for me. I have been considering commiting the entire eclipse workspace to subversion, but that has obvious issues as it currently has open source and proprietary projects, for which I would have to use separate workspaces.

Right now, I think I will wait. I really don't miss a eclipse plugin at all, but I could not work without a flexible folder layout.

Other than that, I tested gradle and I really like it! I will definitely try again later.

BTW: Please consider including a typical java tutorial to help with the learning curve. With the current examples, I didn't know where to start :)
Reply | Threaded
Open this post in threaded view
|

Re: Multiproject with eclipse

diongillard
In reply to this post by hans_d
Please, please don't propagate the Maven 'best practice' hierarchical
only project layout. It's got nothing to do with eclipse itself, but
the layouts of your projects in version control shouldn't be defined
by your build tool.

I'm happy to set up svn:externals to let the build tool have the
structure it wants, but it shouldn't force you to layout projects a
particular way. Isn't that what the Convention should specify?

On Tue, Jul 15, 2008 at 7:05 AM, Hans Dockter <[hidden email]> wrote:

> Hi Ignacio,
>
> On Jul 14, 2008, at 6:01 PM, Ignacio Coloma wrote:
>
>>
>> Hi, I know this may have been asked previously but I could not find it in
>> the
>> forums or elsewhere.
>
> You are the first one on this list :)
>
>>
>> How is it expected to integrate gradle multiproject with eclipse? Say I
>> have
>> "myproject", "myproject/A" and "myproject/B", which are fine with gradle,
>> but eclipse needs all projects as direct children of the workspace, so you
>> should checkout "A" and "B" directly into the workspace, where "myproject"
>> files are _not_ located.
>>
>> Am I missing something?
>
> No. This is in fact a problem. Not just for Gradle, also for a couple of
> Maven plugins. There are two ways to deal with this:
>
> - Change the multi-project layout: Right now Gradle only accepts
> hierarchical layouts. In the near future we want to support arbitrary
> multi-project layout. But right now you can't change the layout.
>
> - Tweak Eclipse: I have done this in in a large enterprise Maven build and
> it has worked reliably. It works like this:
> Provided there is a hierarchical project in svn. You check out the top level
> dir into Eclipse as a non Java Project (Simple project). If the .project
> Eclipse files are not in svn you have to generate them. As we don't provide
> a plugin for generating Eclipse project files yet this has to be done by
> hand. If the Eclipse project files of the subprojects are created you delete
> the .project file of the top level project. Than you are able to import the
> subprojects. After the import, as soon as you do some operations on the
> top-level project, Eclipse creates the .project file again automatically.
> But this is no problem, as you have already imported your subprojects.
> Without deleting the .project file, Eclipse would not allow to import the
> subprojects. It is big limitation of Eclipse not to support hierarchical
> layouts.
>
> I can't offer you anything better at the moment.
>
> - Hans
>
>>
>> Thanks in advance,
>>
>> Ignacio.
>> --
>> View this message in context:
>> http://www.nabble.com/Multiproject-with-eclipse-tp18447030p18447030.html
>> Sent from the gradle-user mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe from this list, please visit:
>>
>>    http://xircles.codehaus.org/manage_email
>>
>>
>
> --
> Hans Dockter
> Gradle Project lead
> http://www.gradle.org
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>   http://xircles.codehaus.org/manage_email
>
>
>



--
dIon Gillard
There are only two kinds of programming languages: those people always
bitch about and those nobody uses. (Bjarne Stroustrup)

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|

Re: Multiproject with eclipse

hans_d
Administrator
Hi Dion,

On Jul 15, 2008, at 9:52 AM, Dion Gillard wrote:

> Please, please don't propagate the Maven 'best practice' hierarchical
> only project layout. It's got nothing to do with eclipse itself, but
> the layouts of your projects in version control shouldn't be defined
> by your build tool.

I completely agree. Although the hierarchical layout is often a good  
fit and it is unfortunate that this is not supported by Eclipse.

>
> I'm happy to set up svn:externals to let the build tool have the
> structure it wants, but it shouldn't force you to layout projects a
> particular way. Isn't that what the Convention should specify?

Again I agree. Our aim for the near future is to allow a completely  
arbitrary layout. One will be able to assemble a multi-project build  
from any set of locations (e.g. svn). A subproject can then also  
easily take part in different multi-project builds.

- Hans

>
> On Tue, Jul 15, 2008 at 7:05 AM, Hans Dockter <[hidden email]>  
> wrote:
>> Hi Ignacio,
>>
>> On Jul 14, 2008, at 6:01 PM, Ignacio Coloma wrote:
>>
>>>
>>> Hi, I know this may have been asked previously but I could not  
>>> find it in
>>> the
>>> forums or elsewhere.
>>
>> You are the first one on this list :)
>>
>>>
>>> How is it expected to integrate gradle multiproject with eclipse?  
>>> Say I
>>> have
>>> "myproject", "myproject/A" and "myproject/B", which are fine with  
>>> gradle,
>>> but eclipse needs all projects as direct children of the  
>>> workspace, so you
>>> should checkout "A" and "B" directly into the workspace, where  
>>> "myproject"
>>> files are _not_ located.
>>>
>>> Am I missing something?
>>
>> No. This is in fact a problem. Not just for Gradle, also for a  
>> couple of
>> Maven plugins. There are two ways to deal with this:
>>
>> - Change the multi-project layout: Right now Gradle only accepts
>> hierarchical layouts. In the near future we want to support arbitrary
>> multi-project layout. But right now you can't change the layout.
>>
>> - Tweak Eclipse: I have done this in in a large enterprise Maven  
>> build and
>> it has worked reliably. It works like this:
>> Provided there is a hierarchical project in svn. You check out the  
>> top level
>> dir into Eclipse as a non Java Project (Simple project). If  
>> the .project
>> Eclipse files are not in svn you have to generate them. As we  
>> don't provide
>> a plugin for generating Eclipse project files yet this has to be  
>> done by
>> hand. If the Eclipse project files of the subprojects are created  
>> you delete
>> the .project file of the top level project. Than you are able to  
>> import the
>> subprojects. After the import, as soon as you do some operations  
>> on the
>> top-level project, Eclipse creates the .project file again  
>> automatically.
>> But this is no problem, as you have already imported your  
>> subprojects.
>> Without deleting the .project file, Eclipse would not allow to  
>> import the
>> subprojects. It is big limitation of Eclipse not to support  
>> hierarchical
>> layouts.
>>
>> I can't offer you anything better at the moment.
>>
>> - Hans
>>
>>>
>>> Thanks in advance,
>>>
>>> Ignacio.
>>> --
>>> View this message in context:
>>> http://www.nabble.com/Multiproject-with-eclipse- 
>>> tp18447030p18447030.html
>>> Sent from the gradle-user mailing list archive at Nabble.com.
>>>
>>>
>>> --------------------------------------------------------------------
>>> -
>>> To unsubscribe from this list, please visit:
>>>
>>>    http://xircles.codehaus.org/manage_email
>>>
>>>
>>
>> --
>> Hans Dockter
>> Gradle Project lead
>> http://www.gradle.org
>>
>>
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe from this list, please visit:
>>
>>   http://xircles.codehaus.org/manage_email
>>
>>
>>
>
>
>
> --
> dIon Gillard
> There are only two kinds of programming languages: those people always
> bitch about and those nobody uses. (Bjarne Stroustrup)
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>     http://xircles.codehaus.org/manage_email
>
>

--
Hans Dockter
Gradle Project lead
http://www.gradle.org





---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|

Re: Multiproject with eclipse

Russel Winder-2
On Tue, 2008-07-15 at 10:09 +0200, Hans Dockter wrote:
[ . . . ]
> Again I agree. Our aim for the near future is to allow a completely  
> arbitrary layout. One will be able to assemble a multi-project build  
> from any set of locations (e.g. svn). A subproject can then also  
> easily take part in different multi-project builds.

Can I chip in that Subversion is not the only version control system
that needs to be catered for.  Bazaar, Mercurial and Git are the way
forward for project version control, so build systems must support these
as first class citizens.

--
Russel.
====================================================
Dr Russel Winder                 Partner

Concertant LLP                   t: +44 20 7585 2200, +44 20 7193 9203
41 Buckmaster Road,              f: +44 8700 516 084
London SW11 1EN, UK.             m: +44 7770 465 077

signature.asc (196 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Multiproject with eclipse

hans_d
Administrator
In reply to this post by Ignacio Coloma
Hi Ignacio,

On Jul 15, 2008, at 9:05 AM, Ignacio Coloma wrote:

>
> Thanks for the reply. I'm afraid the process is too much error-
> prone for me.
> I have been considering commiting the entire eclipse workspace to
> subversion, but that has obvious issues as it currently has open  
> source and
> proprietary projects, for which I would have to use separate  
> workspaces.

I was suspicious myself when I first tried this out. But it has been  
working reliably.

>
> Right now, I think I will wait. I really don't miss a eclipse  
> plugin at all,
> but I could not work without a flexible folder layout.

Fair enough. I can understand your point. You might watch: http://
jira.codehaus.org/browse/GRADLE-158

>
> Other than that, I tested gradle and I really like it! I will  
> definitely try
> again later.
>
> BTW: Please consider including a typical java tutorial to help with  
> the
> learning curve. With the current examples, I didn't know where to  
> start :)

That would make sense. I try my best :)

- Hans

--
Hans Dockter
Gradle Project lead
http://www.gradle.org





---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email