Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ant machine name property

Tags:

linux

windows

ant

Is there a way to get the machine name as ant property, for both Linux and Windows OS.

like image 219
Drejc Avatar asked Jul 28 '09 21:07

Drejc


People also ask

What Ant properties file?

Ant properties files let you move properties out of your build. xml file. You create . properties file for all the properties that are defined outside the build file.

Are properties immutable in ant?

Properties are immutable: whoever sets a property first freezes it for the rest of the build; they are most definitely not variables. There are seven ways to set properties: By supplying both the name and one of value or location attributes.

How do I override property value in ant?

Ant Properties are set once and then can never be overridden. That's why setting any property on the command line via a -Dproperty=value will always override anything you've set in the file; the property is set and then nothing can override it. This way: Anything set at the command line takes precedence over build.


1 Answers

<exec executable="hostname" outputproperty="computer.hostname"/> 

will work on linux and windows

like image 99
Rebse Avatar answered Oct 02 '22 15:10

Rebse