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 <aj...@sympatico.ca> on 2013/11/23 03:18:42 UTC

Short version of the ant version string?

Hi,

As part of my work on issue 55489, "Allow specifying of alternative user
agent for the 'get' task", I need to be able to include the Ant version
string in the user-agent (Apache Ant/0.0), but using the following:

getProject().getProperty(MagicNames.ANT_VERSION)

or 

Main.getVersion()

both returning a long version string of them form:

"Apache Ant(TM) version 1.9.3alpha compiled on November 22 2013"

From what I can see there is no method to get a 'short' version, unless
I am not looking in the right place.

If there isn't already something, would adding a Main.getShortVersion() be
acceptable?

Regards

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


Re: Short version of the ant version string?

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

> As part of my work on issue 55489, "Allow specifying of alternative user
> agent for the 'get' task", I need to be able to include the Ant version
> string in the user-agent (Apache Ant/0.0), but using the following:

> getProject().getProperty(MagicNames.ANT_VERSION)

> or

> Main.getVersion()

> both returning a long version string of them form:

> "Apache Ant(TM) version 1.9.3alpha compiled on November 22 2013"

> From what I can see there is no method to get a 'short' version, unless
> I am not looking in the right place.

You may want to look at the <antversion> Task which strips the alpha
designators and all that.

Stefan

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


Re: Short version of the ant version string?

Posted by Antoine Levy Lambert <an...@gmx.de>.
Hello Andre,

yes, adding a Main.getShortVersion() would be acceptable.

are you after a version string containing only digits and dots like what AntVersion.getVersion() is computing ?

The version from version.txt sometimes has an alphabetic suffix like "1.7.0beta" or "1.9.0alpha" or "1.9.0rc1".

Regards,

Antoine
On Nov 22, 2013, at 9:18 PM, Andre-John Mas wrote:

> Hi,
> 
> As part of my work on issue 55489, "Allow specifying of alternative user
> agent for the 'get' task", I need to be able to include the Ant version
> string in the user-agent (Apache Ant/0.0), but using the following:
> 
> getProject().getProperty(MagicNames.ANT_VERSION)
> 
> or 
> 
> Main.getVersion()
> 
> both returning a long version string of them form:
> 
> "Apache Ant(TM) version 1.9.3alpha compiled on November 22 2013"
> 
> From what I can see there is no method to get a 'short' version, unless
> I am not looking in the right place.
> 
> If there isn't already something, would adding a Main.getShortVersion() be
> acceptable?
> 
> Regards
> 
> Andre


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