Image

Imagelexicore wrote in Imageru_java

Ant: set path conditionally

Как можно в Ant условно инициализировать переменную пути?

Грубо говоря, хочется сделать следующее:


	<condition property="jaxbcommons.integrated">
		<available file="${jaxbcommons.dir}/classes/org/jvnet/jaxbcommons"/>
	</condition>
	
	<target name="jaxbcommons.path.set.integrated" if="jaxbcommons.integrated">
		<path id="jaxbcommons.path">
			<pathelement location="${jaxbcommons.dir}/classes"/>
		</path>
	</target>
	
	<target name="jaxbcommons.path.set.standalone" unless="jaxbcommons.integrated">
		<path id="jaxbcommons.path">
			<fileset dir="${jaxbcommons.dist.dir}">
				<include name="jaxbcommons.jar"/>
			</fileset>
		</path>
	</target>

Но без target.