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 13export JAVA_HOME=/opt/sun-java2-5.0; 14export ANT_HOME=/opt/apache-ant-1.6; 15export ECLIPSE_HOME=/home/eclipse/eclipse; 16 17#ant with Eclipse - requires org.eclipse.ant.ui*.jar 18tmpfolder="/tmp/antrunner-"`date +%Y%m%d_%H%M%S`; 19for 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 21CLASSPATH="$JAVA_HOME/lib/rt.jar"; 22for 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 25done 26 27cmd="$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 34echo "Running ..."; 35 36#prettyprint the command 37echo $cmd | sed -e 's/ \-/\n \-/g' -e 's/:/\n :/g'; echo ""; 38 39# run the command 40$cmd; 41 42rm -fr $tmpfolder; 43