Project.subprojects iteration

View: New views
6 Messages — Rating Filter:   Alert me  

Project.subprojects iteration

by Steve Appling :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Both Project.subprojects and Project.allprojects take a closure and use it to
configure the requested set of projects.  Is there a good way to access the
project that is currently being configured from inside the closure?

The only way I saw to do this was to modify ConfigureUtil.configure to pass the
configured object to the closure as a parameter.  Then you could do:
allprojects { nextProject->
    // use nextProject
}
Does this seem like a good change to configure?

--
Steve Appling
Automated Logic Research Team

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

    http://xircles.codehaus.org/manage_email



Re: Project.subprojects iteration

by Steve Appling :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I was a little premature with my question.  I can reference the delegate to get
to this.  It still seems more obvious to use a closure parameter.  This makes
both allprojects.each { closure } and allprojects { closure } work more
consistently.

Steve Appling wrote:

> Both Project.subprojects and Project.allprojects take a closure and use
> it to configure the requested set of projects.  Is there a good way to
> access the project that is currently being configured from inside the
> closure?
>
> The only way I saw to do this was to modify ConfigureUtil.configure to
> pass the configured object to the closure as a parameter.  Then you
> could do:
> allprojects { nextProject->
>    // use nextProject
> }
> Does this seem like a good change to configure?
>

--
Steve Appling
Automated Logic Research Team

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

    http://xircles.codehaus.org/manage_email



Re: Project.subprojects iteration

by levi_h :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Doesn't "project" reference the current project as well?

Op 18 jun 2009 om 20:35 heeft Steve Appling <sajakarta@...>  
het volgende geschreven:\

> I was a little premature with my question.  I can reference the  
> delegate to get to this.  It still seems more obvious to use a  
> closure parameter.  This makes both allprojects.each { closure } and  
> allprojects { closure } work more consistently.
>
> Steve Appling wrote:
>> Both Project.subprojects and Project.allprojects take a closure and  
>> use it to configure the requested set of projects.  Is there a good  
>> way to access the project that is currently being configured from  
>> inside the closure?
>> The only way I saw to do this was to modify ConfigureUtil.configure  
>> to pass the configured object to the closure as a parameter.  Then  
>> you could do:
>> allprojects { nextProject->
>>   // use nextProject
>> }
>> Does this seem like a good change to configure?
>
> --
> Steve Appling
> Automated Logic Research Team
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>   http://xircles.codehaus.org/manage_email
>
>

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

    http://xircles.codehaus.org/manage_email



Re: Project.subprojects iteration

by John Murph :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Not in a subprojects { } or allprojects { } closure.  It's a bit confusing, and I'm hoping to look into a solution at some point.  But for now, it's not so straight-forward.


On Thu, Jun 18, 2009 at 3:01 PM, Levi Hoogenberg <levihoogenberg@...> wrote:
Doesn't "project" reference the current project as well?



--
John Murph
Automated Logic Research Team

Re: Project.subprojects iteration

by levi_h :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Are you sure? I'm fairly certain that I'm doing this (with a subprojects closure) in a 0.6.1 build script.

Op 18 jun 2009 om 21:41 heeft John Murph <jmurph.alc@...> het volgende geschreven:\

Not in a subprojects { } or allprojects { } closure.  It's a bit confusing, and I'm hoping to look into a solution at some point.  But for now, it's not so straight-forward.


On Thu, Jun 18, 2009 at 3:01 PM, Levi Hoogenberg <levihoogenberg@...> wrote:
Doesn't "project" reference the current project as well?



--
John Murph
Automated Logic Research Team

Re: Project.subprojects iteration

by Steve Appling :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Levi Hoogenberg wrote:

> Are you sure? I'm fairly certain that I'm doing this (with a subprojects
> closure) in a 0.6.1 build script.
>
> Op 18 jun 2009 om 21:41 heeft John Murph <jmurph.alc@...
> <mailto:jmurph.alc@...>> het volgende geschreven:\
>
>> Not in a subprojects { } or allprojects { } closure.  It's a bit
>> confusing, and I'm hoping to look into a solution at some point.  But
>> for now, it's not so straight-forward.
>>
>>
>> On Thu, Jun 18, 2009 at 3:01 PM, Levi Hoogenberg <
>> <mailto:levihoogenberg@...>levihoogenberg@...
>> <mailto:levihoogenberg@...>> wrote:
>>
>>     Doesn't "project" reference the current project as well?
>>
>>
>>
>> --
>> John Murph
>> Automated Logic Research Team

Levi, you are right.  I feel silly now.

That is exactly how I wanted it to work.  I thought I tried this in a previous
version and it didn't work (at least that will be my excuse).

--
Steve Appling
Automated Logic Research Team

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

    http://xircles.codehaus.org/manage_email