ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dave Townsend" <dave.towns...@bigfoot.com>
Subject Setting properties depending on the os
Date Thu, 17 May 2001 22:32:58 GMT
I am trying to set some properties depending on what the os is. The main
reason is that the user.home property does not properly reflect the users
home directory (for files) on a windows machine. Instead you need the "My
Documents" subdirectory of this. I attempted to do this as follows:

<target name="basic">
	<tstamp/>
	<antcall target="${os.name}"/>
</target>

<target name="Linux">
	<property name="homedir" value="${os.name}"/>
</target>

<target name="Windows">
	<property name="homedir" value="${os.name}"/>
</target>

<target name="Windows 2000" depends="Windows">
</target>

<target name="Windows 98" depends="Windows">
</target>

<target name="Windows 95" depends="Windows">
</target>

Unfortunatley from what I can tell, the property homedir no longer exists
after the antcall task is complete. Is there any way to pass these back, or
another way of doing what I am trying to achieve? The only other thought I
had was to put ${os.name} in as a dependency to the basic target, but it
seems that properties cant be used there.

Dave Townsend <dave.townsend@bigfoot.com>

"Vital papers will demonstrate their vitality by spontaneously moving from
where you left them to where you can't find them."



Mime
View raw message