Ant und if-Abfragen

eagle

Mitglied
Hallo

Ich möchte ein File in einem Antscript kopieren.
Je nach OS heisst dieses File jedoch anderst.
Wie kann ich im Antspricpt nun folgendes realisieren:
if OS=Linux
then
...
else if OS=Windos
then
...
else
fehler

hat da jemand eine Ahnung?
 
Hallo!

Schau mal hier:
Code:
 <?xml version="1.0"?>
 <!-- ====================================================================== 
 	 06.07.2005 21:18:45													    
 
 	 project	
 	 description
 				   
 	 Tom															    
 	 ====================================================================== -->
 <project name="project" default="default">
 	<description>
 			description
 	</description>
 
 	<!-- ================================= 
 		  target: default			  
 		 ================================= -->
 	<target name="default" description="--> description">
 		<condition property="isWindows">
 			<os family="windows" />
 		</condition>
 		<condition property="isUnix">
 			<os family="unix" />
 		</condition>
 		<antcall target="os-independent"/>
 	</target>
 
 	<!-- - - - - - - - - - - - - - - - - - 
 		  target: os-independent					  
 		 - - - - - - - - - - - - - - - - - -->
 	<target name="os-independent" depends="linux,win32">
 		<echo>OS-Independent</echo>
 	</target>
 
 	<!-- - - - - - - - - - - - - - - - - - 
 		  target: linux					  
 		 - - - - - - - - - - - - - - - - - -->
 	<target name="linux" if="isUnix">
 		<echo>Linux</echo>
 	</target>
 
 	<!-- - - - - - - - - - - - - - - - - - 
 		  target: Win32					  
 		 - - - - - - - - - - - - - - - - - -->
 	<target name="win32" if="isWindows">
 		<echo>Windows</echo>
 	</target>
 
 </project>

Gruß Tom
 

Neue Beiträge

Zurück