Win a copy of Machine Learning for Business: Using Amazon SageMaker and JupyterE this week in the Jython/Python forum
or Object Design Style Guide in the Object-Oriented programming forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Paul Clapham
  • Jeanne Boyarsky
  • Knute Snortum
Sheriffs:
  • Liutauras Vilda
  • Tim Cooke
  • Junilu Lacar
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Joe Ess
  • salvin francis
  • fred rosenberger

ant "os"-condition value with cygwin

 
Ranch Hand
Posts: 111
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am trying to test the OS, I am on (Win2000) but I am running the cygwin unix emulator.
Here is my target :

And here is the outcome :

Can someone tell me which value I could exepect ?
I would also be interested to have the content of the <os> value being deplayed.
Is that possible ?
Rgds,
Thomas,
[ February 28, 2003: Message edited by: Thomas SMETS ]
 
Sheriff
Posts: 3034
12
Mac IntelliJ IDE Python VI Editor Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I haven't used the os task yet, but I think what you want to use is the "family" attribute, rather than the "name" attribute.
 
Thomas Smets
Ranch Hand
Posts: 111
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well if you do that you will have a value like "sparc" or "i386" displayed but nothing related to the fact that the OS is either Win2000 or Unix-like.
What bothers me is that NO value is defined (really).
Thomas,
 
Ranch Hand
Posts: 82
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
you can use
<echo message="${os.name}" />
to get the OS name.
 
Greg Charles
Sheriff
Posts: 3034
12
Mac IntelliJ IDE Python VI Editor Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Really? According to the ant docs:
Supported values for the family attribute are:
windows (for all versions of Microsoft Windows)
dos (for all Microsoft DOS based operating systems including Microsoft Windows and OS/2)
mac (for all Apple Macintosh systems)
unix (for all Unix and Unix-like operating systems)
netware (for Novell NetWare)
os/2 (for OS/2)
win9x for Microsoft Windows 95 and 98
z/os for z/OS and OS/390

In fact, when I use:
<condition property="myprop">
<os family="windows" />
</condition>
on my Windows 2000 machine, the property is set to true. When I set the family to dos, the property is also true, but when I set it to unix, the property is unset.
 
Thomas Smets
Ranch Hand
Posts: 111
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Same for me but in "DOS" (a normal shell prompt)... not a bash prompt from cygwin
As far as I know
Thomas,
 
Greg Charles
Sheriff
Posts: 3034
12
Mac IntelliJ IDE Python VI Editor Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not sure what you mean by, "As far as I know." However, I got the same results you did from a CygWin bash prompt, but when I changed "name" to "family" viz:

I got:
 
Everyone is a villain in someone else's story. Especially this devious tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!