1 #******************************************************************************* 2 # Copyright (c) 2005, 2006 IBM Corporation and others. 3 # All rights reserved. This program and the accompanying materials 4 # are made available under the terms of the Eclipse Public License v1.0 5 # which accompanies this distribution, and is available at 6 # http://www.eclipse.org/legal/epl-v10.html 7 # 8 # Contributors: 9 # IBM Corporation - initial API and implementation 10 #******************************************************************************* 11 #!/bin/sh 12 13 export JAVA_HOME=/opt/sun-java2-5.0; 14 export ANT_HOME=/opt/apache-ant-1.6; 15 export ECLIPSE_HOME=/home/eclipse/eclipse; 16 17 #ant with Eclipse - requires org.eclipse.ant.ui*.jar 18 tmpfolder="/tmp/antrunner-"`date +%Y%m%d_%H%M%S`; 19 for f in `find $ECLIPSE_HOME/plugins -maxdepth 1 -name "org.eclipse.ant.ui*.jar" -type f`; do unzip $f lib/*.jar -d $tmpfolder; done 20 21 CLASSPATH="$JAVA_HOME/lib/rt.jar"; 22 for d in "$ANT_HOME/lib" "$tmpfolder/lib"; do 23 # note that com.sun.org.apache.xerces (Sun JDK 1.5, rt.jar) != org.apache.xerces (Ant 1.6.5, xercesImpl.jar) so must remove from classpath 24 for f in `find $d -maxdepth 1 -name "*.jar" -type f -not -name "xercesImpl.jar"`; do CLASSPATH=$CLASSPATH":"$f; done 25 done 26 27 cmd="$JAVA_HOME/bin/java \ 28 -Dant.home=$ANT_HOME \ 29 -Dant.library.dir=$ANT_HOME/lib \ 30 -classpath $CLASSPATH \ 31 org.eclipse.ant.internal.ui.antsupport.InternalAntRunner \ 32 -buildfile feedManipulation.xml"; 33 34 echo "Running ..."; 35 36 #prettyprint the command 37 echo $cmd | sed -e 's/ \-/\n \-/g' -e 's/:/\n :/g'; echo ""; 38 39 # run the command 40 $cmd; 41 42 rm -fr $tmpfolder; 43