You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by Andre-John Mas <an...@gmail.com> on 2013/12/09 20:08:00 UTC

Ant Version

Hi,

I recently made a code contribution and had the task get the version from the Main class. I appreciate this probably want the best approach and I am trying to consider options going forward. I had looked at the ant.version property, but the is only available in the project scope and also limited to the 'long' version. 

Some possibilities I am thinking of going forward:
 - Version class
 - AntRuntime class

Does anyone else have suggestions or preferences as to the best way going forward?

André-John

Sent from my phone. Envoyé depuis mon téléphone. 
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Re: Ant Version

Posted by Andre-John mas <an...@gmail.com>.

On 2013-12-10, at 0:18, Stefan Bodewig <bo...@apache.org> wrote:

> On 2013-12-09, Andre-John Mas wrote:
> 
>> It is what I used and how the patch was accepted, but since I was told
>> it wasn't ideal I wanted to see if there were ways to deal with this
>> going forward.
> 
> It was me who said it wasn't ideal.  My concern is IDE integration which
> might start Ant differently and bypass Main so the static methods on
> Main don't work properly.
> 
> Andre-John's contribution made me look at the implementation again and
> since the methods are static and only rely on ther version.txt file
> being present, I no longer see a problem.  An implementation outside of
> Main wouldn't look any different and I highly doubt an IDE integration
> would remove the Main class completely.
> 
> Stefan

Thanks for the insight. At the same time your original comment got me thinking about class dependencies on whether it would make better architectural sense to have a class that represents the application's environment, to avoid any potential two way dependencies with Main?

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


Re: Ant Version

Posted by Stefan Bodewig <bo...@apache.org>.
On 2013-12-09, Andre-John Mas wrote:

> It is what I used and how the patch was accepted, but since I was told
> it wasn't ideal I wanted to see if there were ways to deal with this
> going forward.

It was me who said it wasn't ideal.  My concern is IDE integration which
might start Ant differently and bypass Main so the static methods on
Main don't work properly.

Andre-John's contribution made me look at the implementation again and
since the methods are static and only rely on ther version.txt file
being present, I no longer see a problem.  An implementation outside of
Main wouldn't look any different and I highly doubt an IDE integration
would remove the Main class completely.

Stefan

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


Re: Ant Version

Posted by Andre-John Mas <an...@gmail.com>.
Covered in this ticket:

https://issues.apache.org/bugzilla/show_bug.cgi?id=55489

On 9-Dec-2013, at 17:00, Matt Benson wrote:

> Do you have a link to that discussion?  I'd be interested to catch up the
> context here.
> 
> Thanks,
> Matt
> 
> 
> On Mon, Dec 9, 2013 at 3:01 PM, Andre-John Mas <an...@gmail.com>wrote:
> 
>> It is what I used and how the patch was accepted, but since I was told it
>> wasn't ideal I wanted to see if there were ways to deal with this going
>> forward.
>> 
>> André-John
>> 
>> Sent from my phone. Envoyé depuis mon téléphone.
>> 
>>> On Dec 9, 2013, at 15:56, Matt Benson <gu...@gmail.com> wrote:
>>> 
>>> Looks like Main.getAntVersion() is your friend.
>>> 
>>> Matt
>>> 
>>> 
>>> On Mon, Dec 9, 2013 at 2:50 PM, Andre-John Mas <andrejohn.mas@gmail.com
>>> wrote:
>>> 
>>>> Hi,
>>>> 
>>>> This was the Get Task, whereby I was getting the ant version for use in
>>>> the user-agent response. I am using the value uninterpreted.
>>>> 
>>>> André-John
>>>> 
>>>> Sent from my phone. Envoyé depuis mon téléphone.
>>>> 
>>>>> On Dec 9, 2013, at 14:23, Matt Benson <gu...@gmail.com> wrote:
>>>>> 
>>>>> Are you looking for compatibility with the version?  I.e., this task
>> will
>>>>> work on versions >= n?  A commonly taken approach there is to use the
>>>>> presence of some particular class introduced in the target version,
>>>> rather
>>>>> than fiddling with version numbers per se.
>>>>> 
>>>>> HTH,
>>>>> Matt
>>>>> 
>>>>> 
>>>>> On Mon, Dec 9, 2013 at 1:08 PM, Andre-John Mas <
>> andrejohn.mas@gmail.com
>>>>> wrote:
>>>>> 
>>>>>> Hi,
>>>>>> 
>>>>>> I recently made a code contribution and had the task get the version
>>>> from
>>>>>> the Main class. I appreciate this probably want the best approach and
>> I
>>>> am
>>>>>> trying to consider options going forward. I had looked at the
>>>> ant.version
>>>>>> property, but the is only available in the project scope and also
>>>> limited
>>>>>> to the 'long' version.
>>>>>> 
>>>>>> Some possibilities I am thinking of going forward:
>>>>>> - Version class
>>>>>> - AntRuntime class
>>>>>> 
>>>>>> Does anyone else have suggestions or preferences as to the best way
>>>> going
>>>>>> forward?
>>>>>> 
>>>>>> André-John
>>>>>> 
>>>>>> Sent from my phone. Envoyé depuis mon téléphone.
>>>>>> ---------------------------------------------------------------------
>>>>>> 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: Ant Version

Posted by Matt Benson <gu...@gmail.com>.
Do you have a link to that discussion?  I'd be interested to catch up the
context here.

Thanks,
Matt


On Mon, Dec 9, 2013 at 3:01 PM, Andre-John Mas <an...@gmail.com>wrote:

> It is what I used and how the patch was accepted, but since I was told it
> wasn't ideal I wanted to see if there were ways to deal with this going
> forward.
>
> André-John
>
> Sent from my phone. Envoyé depuis mon téléphone.
>
> > On Dec 9, 2013, at 15:56, Matt Benson <gu...@gmail.com> wrote:
> >
> > Looks like Main.getAntVersion() is your friend.
> >
> > Matt
> >
> >
> > On Mon, Dec 9, 2013 at 2:50 PM, Andre-John Mas <andrejohn.mas@gmail.com
> >wrote:
> >
> >> Hi,
> >>
> >> This was the Get Task, whereby I was getting the ant version for use in
> >> the user-agent response. I am using the value uninterpreted.
> >>
> >> André-John
> >>
> >> Sent from my phone. Envoyé depuis mon téléphone.
> >>
> >>> On Dec 9, 2013, at 14:23, Matt Benson <gu...@gmail.com> wrote:
> >>>
> >>> Are you looking for compatibility with the version?  I.e., this task
> will
> >>> work on versions >= n?  A commonly taken approach there is to use the
> >>> presence of some particular class introduced in the target version,
> >> rather
> >>> than fiddling with version numbers per se.
> >>>
> >>> HTH,
> >>> Matt
> >>>
> >>>
> >>> On Mon, Dec 9, 2013 at 1:08 PM, Andre-John Mas <
> andrejohn.mas@gmail.com
> >>> wrote:
> >>>
> >>>> Hi,
> >>>>
> >>>> I recently made a code contribution and had the task get the version
> >> from
> >>>> the Main class. I appreciate this probably want the best approach and
> I
> >> am
> >>>> trying to consider options going forward. I had looked at the
> >> ant.version
> >>>> property, but the is only available in the project scope and also
> >> limited
> >>>> to the 'long' version.
> >>>>
> >>>> Some possibilities I am thinking of going forward:
> >>>> - Version class
> >>>> - AntRuntime class
> >>>>
> >>>> Does anyone else have suggestions or preferences as to the best way
> >> going
> >>>> forward?
> >>>>
> >>>> André-John
> >>>>
> >>>> Sent from my phone. Envoyé depuis mon téléphone.
> >>>> ---------------------------------------------------------------------
> >>>> 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: Ant Version

Posted by Andre-John Mas <an...@gmail.com>.
It is what I used and how the patch was accepted, but since I was told it wasn't ideal I wanted to see if there were ways to deal with this going forward. 

André-John

Sent from my phone. Envoyé depuis mon téléphone. 

> On Dec 9, 2013, at 15:56, Matt Benson <gu...@gmail.com> wrote:
> 
> Looks like Main.getAntVersion() is your friend.
> 
> Matt
> 
> 
> On Mon, Dec 9, 2013 at 2:50 PM, Andre-John Mas <an...@gmail.com>wrote:
> 
>> Hi,
>> 
>> This was the Get Task, whereby I was getting the ant version for use in
>> the user-agent response. I am using the value uninterpreted.
>> 
>> André-John
>> 
>> Sent from my phone. Envoyé depuis mon téléphone.
>> 
>>> On Dec 9, 2013, at 14:23, Matt Benson <gu...@gmail.com> wrote:
>>> 
>>> Are you looking for compatibility with the version?  I.e., this task will
>>> work on versions >= n?  A commonly taken approach there is to use the
>>> presence of some particular class introduced in the target version,
>> rather
>>> than fiddling with version numbers per se.
>>> 
>>> HTH,
>>> Matt
>>> 
>>> 
>>> On Mon, Dec 9, 2013 at 1:08 PM, Andre-John Mas <andrejohn.mas@gmail.com
>>> wrote:
>>> 
>>>> Hi,
>>>> 
>>>> I recently made a code contribution and had the task get the version
>> from
>>>> the Main class. I appreciate this probably want the best approach and I
>> am
>>>> trying to consider options going forward. I had looked at the
>> ant.version
>>>> property, but the is only available in the project scope and also
>> limited
>>>> to the 'long' version.
>>>> 
>>>> Some possibilities I am thinking of going forward:
>>>> - Version class
>>>> - AntRuntime class
>>>> 
>>>> Does anyone else have suggestions or preferences as to the best way
>> going
>>>> forward?
>>>> 
>>>> André-John
>>>> 
>>>> Sent from my phone. Envoyé depuis mon téléphone.
>>>> ---------------------------------------------------------------------
>>>> 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: Ant Version

Posted by Matt Benson <gu...@gmail.com>.
Looks like Main.getAntVersion() is your friend.

Matt


On Mon, Dec 9, 2013 at 2:50 PM, Andre-John Mas <an...@gmail.com>wrote:

> Hi,
>
> This was the Get Task, whereby I was getting the ant version for use in
> the user-agent response. I am using the value uninterpreted.
>
> André-John
>
> Sent from my phone. Envoyé depuis mon téléphone.
>
> > On Dec 9, 2013, at 14:23, Matt Benson <gu...@gmail.com> wrote:
> >
> > Are you looking for compatibility with the version?  I.e., this task will
> > work on versions >= n?  A commonly taken approach there is to use the
> > presence of some particular class introduced in the target version,
> rather
> > than fiddling with version numbers per se.
> >
> > HTH,
> > Matt
> >
> >
> > On Mon, Dec 9, 2013 at 1:08 PM, Andre-John Mas <andrejohn.mas@gmail.com
> >wrote:
> >
> >> Hi,
> >>
> >> I recently made a code contribution and had the task get the version
> from
> >> the Main class. I appreciate this probably want the best approach and I
> am
> >> trying to consider options going forward. I had looked at the
> ant.version
> >> property, but the is only available in the project scope and also
> limited
> >> to the 'long' version.
> >>
> >> Some possibilities I am thinking of going forward:
> >> - Version class
> >> - AntRuntime class
> >>
> >> Does anyone else have suggestions or preferences as to the best way
> going
> >> forward?
> >>
> >> André-John
> >>
> >> Sent from my phone. Envoyé depuis mon téléphone.
> >> ---------------------------------------------------------------------
> >> 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: Ant Version

Posted by Andre-John Mas <an...@gmail.com>.
Hi,

This was the Get Task, whereby I was getting the ant version for use in the user-agent response. I am using the value uninterpreted. 

André-John

Sent from my phone. Envoyé depuis mon téléphone. 

> On Dec 9, 2013, at 14:23, Matt Benson <gu...@gmail.com> wrote:
> 
> Are you looking for compatibility with the version?  I.e., this task will
> work on versions >= n?  A commonly taken approach there is to use the
> presence of some particular class introduced in the target version, rather
> than fiddling with version numbers per se.
> 
> HTH,
> Matt
> 
> 
> On Mon, Dec 9, 2013 at 1:08 PM, Andre-John Mas <an...@gmail.com>wrote:
> 
>> Hi,
>> 
>> I recently made a code contribution and had the task get the version from
>> the Main class. I appreciate this probably want the best approach and I am
>> trying to consider options going forward. I had looked at the ant.version
>> property, but the is only available in the project scope and also limited
>> to the 'long' version.
>> 
>> Some possibilities I am thinking of going forward:
>> - Version class
>> - AntRuntime class
>> 
>> Does anyone else have suggestions or preferences as to the best way going
>> forward?
>> 
>> André-John
>> 
>> Sent from my phone. Envoyé depuis mon téléphone.
>> ---------------------------------------------------------------------
>> 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: Ant Version

Posted by Matt Benson <gu...@gmail.com>.
Are you looking for compatibility with the version?  I.e., this task will
work on versions >= n?  A commonly taken approach there is to use the
presence of some particular class introduced in the target version, rather
than fiddling with version numbers per se.

HTH,
Matt


On Mon, Dec 9, 2013 at 1:08 PM, Andre-John Mas <an...@gmail.com>wrote:

> Hi,
>
> I recently made a code contribution and had the task get the version from
> the Main class. I appreciate this probably want the best approach and I am
> trying to consider options going forward. I had looked at the ant.version
> property, but the is only available in the project scope and also limited
> to the 'long' version.
>
> Some possibilities I am thinking of going forward:
>  - Version class
>  - AntRuntime class
>
> Does anyone else have suggestions or preferences as to the best way going
> forward?
>
> André-John
>
> Sent from my phone. Envoyé depuis mon téléphone.
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
> For additional commands, e-mail: dev-help@ant.apache.org
>
>