• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

ant "os"-condition value with cygwin

 
Ranch Hand
Posts: 111
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 3063
12
Mac IntelliJ IDE Python VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
you can use
<echo message="${os.name}" />
to get the OS name.
 
Greg Charles
Sheriff
Posts: 3063
12
Mac IntelliJ IDE Python VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 3063
12
Mac IntelliJ IDE Python VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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:
 
reply
    Bookmark Topic Watch Topic
  • New Topic