switch.xml 2.68 KB
<?xml version="1.0" encoding="UTF-8"?>
<project basedir="." default="help" name="HttpFileProxy - ADT - Switch">
		
	<property name="project.name" value="MWM_trunk" />
	
	<target name="help">
		<echo message="Help.." />


	</target>
	
	
	<target name=">> Switch to ADT - produzione (web77db12) - jcluster"  description="Cambia le configurazioni per lavorare su JCLUSTER">
		<antcall target="sub-switch">
			<param name="param.title" value="JCLUSTER (web77db12)"/>
			<param name="param.source" value="context-jcluster-web77db12.xml"/>
		</antcall>
	</target>

	<target name=">> Switch to ADT - sviluppo (web144db2) - liliana"  description="Cambia le configurazioni per lavorare su DEV">
		<antcall target="sub-switch">
			<param name="param.title" value="LILIANA (web144db2)"/>
			<param name="param.source" value="context-liliana-web144db2.xml"/>
		</antcall>
	</target>

	

	<target name="sub-switch">
		<echo>Switch context.xml to ${param.title}</echo>
		<copy file="${basedir}/conf/myMETA-INF/${param.source}" tofile="${basedir}/WebContent/META-INF/context.xml" overwrite="true" verbose="false"/>

		<delete>
			<fileset dir="${basedir}/WebContent/META-INF" includes="**.txt" excludes="."/>
		</delete>

		<property name="myfile" value="${basedir}/WebContent/META-INF/${param.title}.txt" />
		<echo file="${myfile}" append="true">context.xml from ${basedir}/conf/myMETA-INF/${param.source}&#xD;</echo>

		<antcall target="refresh" />
	</target>
	
	
	<target name="refresh" depends="subInclude_AntContrib"
		description="REFRESH di Eclipse">

		<trycatch reference="exception_ref">
			<try>
				<echo>Eclipse refresh in progress...</echo>

				<!-- Refresh del progetto Per funzionare deve essere impostato il seguente 
					flag in "External tool configuration" JRE > Run in the same JRE as the workspace -->
				<eclipse.refreshLocal resource="${project.name}"
					depth="infinite" />
				<echo>Eclipse refreshed!</echo>

			</try>
			<catch>
				<echo>Per funzionare deve essere impostato il seguente flag in
					"External tool configuration"
					JRE > Run in the same JRE as the
					workspace
				</echo>
			</catch>
			<finally>
				<!-- <echo>Finally</echo> -->
			</finally>
		</trycatch>
	</target>

	



	<target name="subInclude_AntContrib"
		description="Include le librerie (JAR) per gestire il TRY/CATCH/FINALLY">
		<echo>Include ANT-contrib JAR</echo>

		<!-- Include le librerie ant-contrib-0.6.jar http://ant-contrib.sourceforge.net/ -->
		<taskdef resource="net/sf/antcontrib/antcontrib.properties">
			<classpath>
				<pathelement location="${basedir}/lib/ant/ant-contrib-0.6.jar" />
			</classpath>
		</taskdef>
	</target>

	
</project>