You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by Nicolas Lalevée <ni...@hibnet.org> on 2010/07/16 15:25:48 UTC

Import and project helpers

Hi,

I did some other experiment with the groovy frontend to ant recently. And I 
would like to be able to make a groovy build file import an xml build file 
and vice versa.

As far as I can tell, in order to do this, a simple change would be needed in 
ImportTask. Rather than doing this in importResource:

helper.parse(getProject(), importedResource);

we would do something like:

ProjectHelper subHelper = 
ProjectHelperRepository.getInstance().getProjectHelperForBuildFile(
                    importedResource);

// push current stacks into the sub helper
subHelper.getImportStack().addAll(helper.getImportStack());
subHelper.getExtensionStack().addAll(helper.getExtensionStack());
getProject().addReference(ProjectHelper.PROJECTHELPER_REFERENCE, subHelper);

subHelper.parse(getProject(), importedResource);

// push back the stacks from the sub helper to the main one
getProject().addReference(ProjectHelper.PROJECTHELPER_REFERENCE, helper);
helper.getImportStack().clear();
helper.getImportStack().addAll(subHelper.getImportStack());
helper.getExtensionStack().clear();
helper.getExtensionStack().addAll(subHelper.getExtensionStack());


For the little tests I have done with the groovy frontend, it seems to work 
quite well.

Actually it seems so simple that I am wondering if I might have missed some 
side effect. Did I ?

At least the unit tests showed me that I did nothing that wrong.

Nicolas

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Re: Import and project helpers

Posted by Nicolas Lalevée <ni...@hibnet.org>.
On Monday 19 July 2010 20:45:48 Matt Benson wrote:
> On Jul 19, 2010, at 4:12 AM, Nicolas Lalevée wrote:
> > On Friday 16 July 2010 18:07:57 Matt Benson wrote:
> >> On Jul 16, 2010, at 8:25 AM, Nicolas Lalevée wrote:
> >>> Hi,
> >>>
> >>> I did some other experiment with the groovy frontend to ant
> >>> recently. And I
> >>> would like to be able to make a groovy build file import an xml
> >>> build file
> >>> and vice versa.
> >>>
> >>> As far as I can tell, in order to do this, a simple change would be
> >>> needed in
> >>> ImportTask. Rather than doing this in importResource:
> >>>
> >>> helper.parse(getProject(), importedResource);
> >>>
> >>> we would do something like:
> >>>
> >>> ProjectHelper subHelper =
> >>> ProjectHelperRepository.getInstance().getProjectHelperForBuildFile(
> >>>                     importedResource);
> >>>
> >>> // push current stacks into the sub helper
> >>> subHelper.getImportStack().addAll(helper.getImportStack());
> >>> subHelper.getExtensionStack().addAll(helper.getExtensionStack());
> >>> getProject().addReference(ProjectHelper.PROJECTHELPER_REFERENCE,
> >>> subHelper);
> >>>
> >>> subHelper.parse(getProject(), importedResource);
> >>>
> >>> // push back the stacks from the sub helper to the main one
> >>> getProject().addReference(ProjectHelper.PROJECTHELPER_REFERENCE,
> >>> helper);
> >>> helper.getImportStack().clear();
> >>> helper.getImportStack().addAll(subHelper.getImportStack());
> >>> helper.getExtensionStack().clear();
> >>> helper.getExtensionStack().addAll(subHelper.getExtensionStack());
> >>>
> >>>
> >>> For the little tests I have done with the groovy frontend, it seems
> >>> to work
> >>> quite well.
> >>>
> >>> Actually it seems so simple that I am wondering if I might have
> >>> missed some
> >>> side effect. Did I ?
> >>
> >> I suppose it's possible you missed something, but it seems okay.  If
> >> it were me, I might work out a way to make the subHelper send its
> >> imports/extensions directly back to the top-level ProjectHelper
> >> rather than so much clearing and replacing, but I'll admit to being
> >> somewhat paranoid.
> >
> > I think I got paranoid too but the other way: I didn't want to
> > change the API
> > of ProjectHelper that might be implemented around the world and bring
> > backward compatibility issues.
>
> I didn't actually pick up on where there was an actual API change?
> Being backward-compatibility-obsessed as a project, we should expand
> rather than change our APIs...

If you add a function to an extendable class, like a public 
setImportStack(Vector), it is possible to break an extending class which 
already defines a setImportStack(Vector) as private.

This is really unlikely to happen. But who knows. Furthermore considering the 
story about the zip task fixed by a thread local faced by Stefan. I always 
considered that kind of change safe. Now it seems to me that classes are not 
that much change safe than interfaces.

I think it is OK to "extend" the API to add features, like we did with the 
support of extension point. But as we can avoid it here, I prefer to do so.

Nicolas


>
> -Matt
>
> > Thanks for the review, I will commit that probably with some
> > additionnal unit
> > tests.
> >
> > Nicolas
> >
> >> -Matt
> >>
> >>> At least the unit tests showed me that I did nothing that wrong.
> >>>
> >>> Nicolas
> >>>
> >>> --------------------------------------------------------------------
> >>> -
> >>> To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
> >>> For additional commands, e-mail: dev-help@ant.apache.org
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
> >> For additional commands, e-mail: dev-help@ant.apache.org
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
> > For additional commands, e-mail: dev-help@ant.apache.org
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
> For additional commands, e-mail: dev-help@ant.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Re: Import and project helpers

Posted by Matt Benson <gu...@gmail.com>.
On Jul 19, 2010, at 4:12 AM, Nicolas Lalevée wrote:

> On Friday 16 July 2010 18:07:57 Matt Benson wrote:
>> On Jul 16, 2010, at 8:25 AM, Nicolas Lalevée wrote:
>>> Hi,
>>>
>>> I did some other experiment with the groovy frontend to ant
>>> recently. And I
>>> would like to be able to make a groovy build file import an xml
>>> build file
>>> and vice versa.
>>>
>>> As far as I can tell, in order to do this, a simple change would be
>>> needed in
>>> ImportTask. Rather than doing this in importResource:
>>>
>>> helper.parse(getProject(), importedResource);
>>>
>>> we would do something like:
>>>
>>> ProjectHelper subHelper =
>>> ProjectHelperRepository.getInstance().getProjectHelperForBuildFile(
>>>                     importedResource);
>>>
>>> // push current stacks into the sub helper
>>> subHelper.getImportStack().addAll(helper.getImportStack());
>>> subHelper.getExtensionStack().addAll(helper.getExtensionStack());
>>> getProject().addReference(ProjectHelper.PROJECTHELPER_REFERENCE,
>>> subHelper);
>>>
>>> subHelper.parse(getProject(), importedResource);
>>>
>>> // push back the stacks from the sub helper to the main one
>>> getProject().addReference(ProjectHelper.PROJECTHELPER_REFERENCE,
>>> helper);
>>> helper.getImportStack().clear();
>>> helper.getImportStack().addAll(subHelper.getImportStack());
>>> helper.getExtensionStack().clear();
>>> helper.getExtensionStack().addAll(subHelper.getExtensionStack());
>>>
>>>
>>> For the little tests I have done with the groovy frontend, it seems
>>> to work
>>> quite well.
>>>
>>> Actually it seems so simple that I am wondering if I might have
>>> missed some
>>> side effect. Did I ?
>>
>> I suppose it's possible you missed something, but it seems okay.  If
>> it were me, I might work out a way to make the subHelper send its
>> imports/extensions directly back to the top-level ProjectHelper
>> rather than so much clearing and replacing, but I'll admit to being
>> somewhat paranoid.
>
> I think I got paranoid too but the other way: I didn't want to  
> change the API
> of ProjectHelper that might be implemented around the world and bring
> backward compatibility issues.
>

I didn't actually pick up on where there was an actual API change?   
Being backward-compatibility-obsessed as a project, we should expand  
rather than change our APIs...

-Matt

> Thanks for the review, I will commit that probably with some  
> additionnal unit
> tests.
>
> Nicolas
>
>>
>> -Matt
>>
>>> At least the unit tests showed me that I did nothing that wrong.
>>>
>>> Nicolas
>>>
>>> -------------------------------------------------------------------- 
>>> -
>>> To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
>>> For additional commands, e-mail: dev-help@ant.apache.org
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
>> For additional commands, e-mail: dev-help@ant.apache.org
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
> For additional commands, e-mail: dev-help@ant.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Re: Import and project helpers

Posted by Nicolas Lalevée <ni...@hibnet.org>.
I have committed it.
Unit tests are showing me that is works quite well.

cheers,
Nicolas


Le 27 juil. 2010 à 10:12, Nicolas Lalevée a écrit :

> On Monday 19 July 2010 11:12:47 Nicolas Lalevée wrote:
>> On Friday 16 July 2010 18:07:57 Matt Benson wrote:
>>> On Jul 16, 2010, at 8:25 AM, Nicolas Lalevée wrote:
>>>> Hi,
>>>> 
>>>> I did some other experiment with the groovy frontend to ant
>>>> recently. And I
>>>> would like to be able to make a groovy build file import an xml
>>>> build file
>>>> and vice versa.
>>>> 
>>>> As far as I can tell, in order to do this, a simple change would be
>>>> needed in
>>>> ImportTask. Rather than doing this in importResource:
>>>> 
>>>> helper.parse(getProject(), importedResource);
>>>> 
>>>> we would do something like:
>>>> 
>>>> ProjectHelper subHelper =
>>>> ProjectHelperRepository.getInstance().getProjectHelperForBuildFile(
>>>>                    importedResource);
>>>> 
>>>> // push current stacks into the sub helper
>>>> subHelper.getImportStack().addAll(helper.getImportStack());
>>>> subHelper.getExtensionStack().addAll(helper.getExtensionStack());
>>>> getProject().addReference(ProjectHelper.PROJECTHELPER_REFERENCE,
>>>> subHelper);
>>>> 
>>>> subHelper.parse(getProject(), importedResource);
>>>> 
>>>> // push back the stacks from the sub helper to the main one
>>>> getProject().addReference(ProjectHelper.PROJECTHELPER_REFERENCE,
>>>> helper);
>>>> helper.getImportStack().clear();
>>>> helper.getImportStack().addAll(subHelper.getImportStack());
>>>> helper.getExtensionStack().clear();
>>>> helper.getExtensionStack().addAll(subHelper.getExtensionStack());
>>>> 
>>>> 
>>>> For the little tests I have done with the groovy frontend, it seems
>>>> to work
>>>> quite well.
>>>> 
>>>> Actually it seems so simple that I am wondering if I might have
>>>> missed some
>>>> side effect. Did I ?
>>> 
>>> I suppose it's possible you missed something, but it seems okay.  If
>>> it were me, I might work out a way to make the subHelper send its
>>> imports/extensions directly back to the top-level ProjectHelper
>>> rather than so much clearing and replacing, but I'll admit to being
>>> somewhat paranoid.
>> 
>> I think I got paranoid too but the other way: I didn't want to change the
>> API of ProjectHelper that might be implemented around the world and bring
>> backward compatibility issues.
>> 
>> Thanks for the review, I will commit that probably with some additionnal
>> unit tests.
> 
> In fact I got stuck in writing unit tests because I cannot control easily 
> what's in the ProjectHelperRepository. I think I will modify it so we can 
> modify its content in a live system: just like for the property helpers I 
> will introduce a task to install a project helper.
> So I will be able to do some ant unit tests.
> Unless there are some remarks or objections as always.
> 
> Nicolas
> 
> 
>> 
>> Nicolas
>> 
>>> -Matt
>>> 
>>>> At least the unit tests showed me that I did nothing that wrong.
>>>> 
>>>> Nicolas
>>>> 
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
>>>> For additional commands, e-mail: dev-help@ant.apache.org
>>> 
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
>>> For additional commands, e-mail: dev-help@ant.apache.org
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
>> For additional commands, e-mail: dev-help@ant.apache.org
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
> For additional commands, e-mail: dev-help@ant.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Re: Import and project helpers

Posted by Nicolas Lalevée <ni...@hibnet.org>.
On Monday 19 July 2010 11:12:47 Nicolas Lalevée wrote:
> On Friday 16 July 2010 18:07:57 Matt Benson wrote:
> > On Jul 16, 2010, at 8:25 AM, Nicolas Lalevée wrote:
> > > Hi,
> > >
> > > I did some other experiment with the groovy frontend to ant
> > > recently. And I
> > > would like to be able to make a groovy build file import an xml
> > > build file
> > > and vice versa.
> > >
> > > As far as I can tell, in order to do this, a simple change would be
> > > needed in
> > > ImportTask. Rather than doing this in importResource:
> > >
> > > helper.parse(getProject(), importedResource);
> > >
> > > we would do something like:
> > >
> > > ProjectHelper subHelper =
> > > ProjectHelperRepository.getInstance().getProjectHelperForBuildFile(
> > >                     importedResource);
> > >
> > > // push current stacks into the sub helper
> > > subHelper.getImportStack().addAll(helper.getImportStack());
> > > subHelper.getExtensionStack().addAll(helper.getExtensionStack());
> > > getProject().addReference(ProjectHelper.PROJECTHELPER_REFERENCE,
> > > subHelper);
> > >
> > > subHelper.parse(getProject(), importedResource);
> > >
> > > // push back the stacks from the sub helper to the main one
> > > getProject().addReference(ProjectHelper.PROJECTHELPER_REFERENCE,
> > > helper);
> > > helper.getImportStack().clear();
> > > helper.getImportStack().addAll(subHelper.getImportStack());
> > > helper.getExtensionStack().clear();
> > > helper.getExtensionStack().addAll(subHelper.getExtensionStack());
> > >
> > >
> > > For the little tests I have done with the groovy frontend, it seems
> > > to work
> > > quite well.
> > >
> > > Actually it seems so simple that I am wondering if I might have
> > > missed some
> > > side effect. Did I ?
> >
> > I suppose it's possible you missed something, but it seems okay.  If
> > it were me, I might work out a way to make the subHelper send its
> > imports/extensions directly back to the top-level ProjectHelper
> > rather than so much clearing and replacing, but I'll admit to being
> > somewhat paranoid.
>
> I think I got paranoid too but the other way: I didn't want to change the
> API of ProjectHelper that might be implemented around the world and bring
> backward compatibility issues.
>
> Thanks for the review, I will commit that probably with some additionnal
> unit tests.

In fact I got stuck in writing unit tests because I cannot control easily 
what's in the ProjectHelperRepository. I think I will modify it so we can 
modify its content in a live system: just like for the property helpers I 
will introduce a task to install a project helper.
So I will be able to do some ant unit tests.
Unless there are some remarks or objections as always.

Nicolas


>
> Nicolas
>
> > -Matt
> >
> > > At least the unit tests showed me that I did nothing that wrong.
> > >
> > > Nicolas
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
> > > For additional commands, e-mail: dev-help@ant.apache.org
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
> > For additional commands, e-mail: dev-help@ant.apache.org
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
> For additional commands, e-mail: dev-help@ant.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Re: Import and project helpers

Posted by Nicolas Lalevée <ni...@hibnet.org>.
On Friday 16 July 2010 18:07:57 Matt Benson wrote:
> On Jul 16, 2010, at 8:25 AM, Nicolas Lalevée wrote:
> > Hi,
> >
> > I did some other experiment with the groovy frontend to ant
> > recently. And I
> > would like to be able to make a groovy build file import an xml
> > build file
> > and vice versa.
> >
> > As far as I can tell, in order to do this, a simple change would be
> > needed in
> > ImportTask. Rather than doing this in importResource:
> >
> > helper.parse(getProject(), importedResource);
> >
> > we would do something like:
> >
> > ProjectHelper subHelper =
> > ProjectHelperRepository.getInstance().getProjectHelperForBuildFile(
> >                     importedResource);
> >
> > // push current stacks into the sub helper
> > subHelper.getImportStack().addAll(helper.getImportStack());
> > subHelper.getExtensionStack().addAll(helper.getExtensionStack());
> > getProject().addReference(ProjectHelper.PROJECTHELPER_REFERENCE,
> > subHelper);
> >
> > subHelper.parse(getProject(), importedResource);
> >
> > // push back the stacks from the sub helper to the main one
> > getProject().addReference(ProjectHelper.PROJECTHELPER_REFERENCE,
> > helper);
> > helper.getImportStack().clear();
> > helper.getImportStack().addAll(subHelper.getImportStack());
> > helper.getExtensionStack().clear();
> > helper.getExtensionStack().addAll(subHelper.getExtensionStack());
> >
> >
> > For the little tests I have done with the groovy frontend, it seems
> > to work
> > quite well.
> >
> > Actually it seems so simple that I am wondering if I might have
> > missed some
> > side effect. Did I ?
>
> I suppose it's possible you missed something, but it seems okay.  If
> it were me, I might work out a way to make the subHelper send its
> imports/extensions directly back to the top-level ProjectHelper
> rather than so much clearing and replacing, but I'll admit to being
> somewhat paranoid.

I think I got paranoid too but the other way: I didn't want to change the API 
of ProjectHelper that might be implemented around the world and bring 
backward compatibility issues.

Thanks for the review, I will commit that probably with some additionnal unit 
tests.

Nicolas

>
> -Matt
>
> > At least the unit tests showed me that I did nothing that wrong.
> >
> > Nicolas
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
> > For additional commands, e-mail: dev-help@ant.apache.org
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
> For additional commands, e-mail: dev-help@ant.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Re: Import and project helpers

Posted by Matt Benson <gu...@gmail.com>.
On Jul 16, 2010, at 8:25 AM, Nicolas Lalevée wrote:

> Hi,
>
> I did some other experiment with the groovy frontend to ant  
> recently. And I
> would like to be able to make a groovy build file import an xml  
> build file
> and vice versa.
>
> As far as I can tell, in order to do this, a simple change would be  
> needed in
> ImportTask. Rather than doing this in importResource:
>
> helper.parse(getProject(), importedResource);
>
> we would do something like:
>
> ProjectHelper subHelper =
> ProjectHelperRepository.getInstance().getProjectHelperForBuildFile(
>                     importedResource);
>
> // push current stacks into the sub helper
> subHelper.getImportStack().addAll(helper.getImportStack());
> subHelper.getExtensionStack().addAll(helper.getExtensionStack());
> getProject().addReference(ProjectHelper.PROJECTHELPER_REFERENCE,  
> subHelper);
>
> subHelper.parse(getProject(), importedResource);
>
> // push back the stacks from the sub helper to the main one
> getProject().addReference(ProjectHelper.PROJECTHELPER_REFERENCE,  
> helper);
> helper.getImportStack().clear();
> helper.getImportStack().addAll(subHelper.getImportStack());
> helper.getExtensionStack().clear();
> helper.getExtensionStack().addAll(subHelper.getExtensionStack());
>
>
> For the little tests I have done with the groovy frontend, it seems  
> to work
> quite well.
>
> Actually it seems so simple that I am wondering if I might have  
> missed some
> side effect. Did I ?
>

I suppose it's possible you missed something, but it seems okay.  If  
it were me, I might work out a way to make the subHelper send its  
imports/extensions directly back to the top-level ProjectHelper  
rather than so much clearing and replacing, but I'll admit to being  
somewhat paranoid.

-Matt

> At least the unit tests showed me that I did nothing that wrong.
>
> Nicolas
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
> For additional commands, e-mail: dev-help@ant.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Re: Import and project helpers

Posted by Nicolas Lalevée <ni...@hibnet.org>.
On Friday 16 July 2010 15:51:07 Martin Gainty wrote:
> dojo JavasScript library has similar interfaces to export key functions as
> extension points what i would like to see is a published set of common
> extension points which would be basically the same if you're using
> Groovy..Scriptaculous..JQuery or JoesGarageJavaScriptLibrary
>
>
>
> the extension points would cover the fundamentals of any JS library:
>
> form-creation
>
> ajax-enabled-select-box
> textfield
>
> label
>
> external-url-to-process-action
>
>
>
> this is for the revolving door of political managers who say I want to
> replace <Groovy-JS> libraries with JunkShotJSLibrary
>
> so all you back out Groovy..bring in JunkShotJSLibrary and reconfig the
> extension points If JunkShotJSLibrary doesnt support the core extension
> points you can find out quickly instead of endlessly agonising why it was
> never created
>
>
> Anyone know if there is anything like this in place?

humm... I don't understand how it is related to Ant. Does it ?

Nicolas

>
> Martin Gainty
> ______________________________________________
> Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité
>
> Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene
> Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte
> Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht
> dient lediglich dem Austausch von Informationen und entfaltet keine
> rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von
> E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
>
> Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le
> destinataire prévu, nous te demandons avec bonté que pour satisfaire
> informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie
> de ceci est interdite. Ce message sert à l'information seulement et n'aura
> pas n'importe quel effet légalement obligatoire. Étant donné que les email
> peuvent facilement être sujets à la manipulation, nous ne pouvons accepter
> aucune responsabilité pour le contenu fourni.
>
> > From: nicolas.lalevee@hibnet.org
> > To: dev@ant.apache.org
> > Subject: Import and project helpers
> > Date: Fri, 16 Jul 2010 15:25:48 +0200
> >
> > Hi,
> >
> > I did some other experiment with the groovy frontend to ant recently. And
> > I would like to be able to make a groovy build file import an xml build
> > file and vice versa.
> >
> > As far as I can tell, in order to do this, a simple change would be
> > needed in ImportTask. Rather than doing this in importResource:
> >
> > helper.parse(getProject(), importedResource);
> >
> > we would do something like:
> >
> > ProjectHelper subHelper =
> > ProjectHelperRepository.getInstance().getProjectHelperForBuildFile(
> > importedResource);
> >
> > // push current stacks into the sub helper
> > subHelper.getImportStack().addAll(helper.getImportStack());
> > subHelper.getExtensionStack().addAll(helper.getExtensionStack());
> > getProject().addReference(ProjectHelper.PROJECTHELPER_REFERENCE,
> > subHelper);
> >
> > subHelper.parse(getProject(), importedResource);
> >
> > // push back the stacks from the sub helper to the main one
> > getProject().addReference(ProjectHelper.PROJECTHELPER_REFERENCE, helper);
> > helper.getImportStack().clear();
> > helper.getImportStack().addAll(subHelper.getImportStack());
> > helper.getExtensionStack().clear();
> > helper.getExtensionStack().addAll(subHelper.getExtensionStack());
> >
> >
> > For the little tests I have done with the groovy frontend, it seems to
> > work quite well.
> >
> > Actually it seems so simple that I am wondering if I might have missed
> > some side effect. Did I ?
> >
> > At least the unit tests showed me that I did nothing that wrong.
> >
> > Nicolas
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
> > For additional commands, e-mail: dev-help@ant.apache.org
>
> _________________________________________________________________
> The New Busy think 9 to 5 is a cute idea. Combine multiple calendars with
> Hotmail.
> http://www.windowslive.com/campaign/thenewbusy?tile=multicalendar&ocid=PID2
>8326::T:WLMTAGL:ON:WL:en-US:WM_HMP:042010_5



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


RE: Import and project helpers

Posted by Martin Gainty <mg...@hotmail.com>.
dojo JavasScript library has similar interfaces to export key functions as extension points
what i would like to see is a published set of common extension points which would be basically the same if you're using Groovy..Scriptaculous..JQuery or JoesGarageJavaScriptLibrary

 

the extension points would cover the fundamentals of any JS library:

form-creation

ajax-enabled-select-box
textfield

label

external-url-to-process-action

 

this is for the revolving door of political managers who say I want to replace <Groovy-JS> libraries with JunkShotJSLibrary

so all you back out Groovy..bring in JunkShotJSLibrary and reconfig the extension points
If JunkShotJSLibrary doesnt support the core extension points you can find out quickly instead of endlessly agonising why it was never created


Anyone know if there is anything like this in place?

Martin Gainty 
______________________________________________ 
Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité

Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.

Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni.



 

> From: nicolas.lalevee@hibnet.org
> To: dev@ant.apache.org
> Subject: Import and project helpers
> Date: Fri, 16 Jul 2010 15:25:48 +0200
> 
> Hi,
> 
> I did some other experiment with the groovy frontend to ant recently. And I 
> would like to be able to make a groovy build file import an xml build file 
> and vice versa.
> 
> As far as I can tell, in order to do this, a simple change would be needed in 
> ImportTask. Rather than doing this in importResource:
> 
> helper.parse(getProject(), importedResource);
> 
> we would do something like:
> 
> ProjectHelper subHelper = 
> ProjectHelperRepository.getInstance().getProjectHelperForBuildFile(
> importedResource);
> 
> // push current stacks into the sub helper
> subHelper.getImportStack().addAll(helper.getImportStack());
> subHelper.getExtensionStack().addAll(helper.getExtensionStack());
> getProject().addReference(ProjectHelper.PROJECTHELPER_REFERENCE, subHelper);
> 
> subHelper.parse(getProject(), importedResource);
> 
> // push back the stacks from the sub helper to the main one
> getProject().addReference(ProjectHelper.PROJECTHELPER_REFERENCE, helper);
> helper.getImportStack().clear();
> helper.getImportStack().addAll(subHelper.getImportStack());
> helper.getExtensionStack().clear();
> helper.getExtensionStack().addAll(subHelper.getExtensionStack());
> 
> 
> For the little tests I have done with the groovy frontend, it seems to work 
> quite well.
> 
> Actually it seems so simple that I am wondering if I might have missed some 
> side effect. Did I ?
> 
> At least the unit tests showed me that I did nothing that wrong.
> 
> Nicolas
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
> For additional commands, e-mail: dev-help@ant.apache.org
> 
 		 	   		  
_________________________________________________________________
The New Busy think 9 to 5 is a cute idea. Combine multiple calendars with Hotmail. 
http://www.windowslive.com/campaign/thenewbusy?tile=multicalendar&ocid=PID28326::T:WLMTAGL:ON:WL:en-US:WM_HMP:042010_5