1402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll#*******************************************************************************
2402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll# Copyright (c) 2005, 2006 IBM Corporation and others.
3402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll# All rights reserved. This program and the accompanying materials
4402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll# are made available under the terms of the Eclipse Public License v1.0
5402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll# which accompanies this distribution, and is available at
6402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll# http://www.eclipse.org/legal/epl-v10.html
7402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll#
8402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll# Contributors:
9402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll#     IBM Corporation - initial API and implementation
10402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll#*******************************************************************************
11402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll#!/bin/sh
12402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll
13402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Mollexport JAVA_HOME=/opt/sun-java2-5.0;
14402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Mollexport ANT_HOME=/opt/apache-ant-1.6;
15402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Mollexport ECLIPSE_HOME=/home/eclipse/eclipse;
16402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll
17402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll#ant with Eclipse - requires org.eclipse.ant.ui*.jar
18402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Molltmpfolder="/tmp/antrunner-"`date +%Y%m%d_%H%M%S`;
19402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Mollfor f in `find $ECLIPSE_HOME/plugins -maxdepth 1 -name "org.eclipse.ant.ui*.jar" -type f`; do unzip $f lib/*.jar -d $tmpfolder; done
20402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll
21402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael MollCLASSPATH="$JAVA_HOME/lib/rt.jar";
22402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Mollfor d in "$ANT_HOME/lib" "$tmpfolder/lib"; do
23402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll  # 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
24402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll  for f in `find $d  -maxdepth 1 -name "*.jar" -type f -not -name "xercesImpl.jar"`; do CLASSPATH=$CLASSPATH":"$f; done
25402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Molldone
26402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll
27402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Mollcmd="$JAVA_HOME/bin/java \
28402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll  -Dant.home=$ANT_HOME \
29402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll  -Dant.library.dir=$ANT_HOME/lib \
30402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll  -classpath $CLASSPATH \
31402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll  org.eclipse.ant.internal.ui.antsupport.InternalAntRunner \
32402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll  -buildfile feedManipulation.xml";
33402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll
34402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Mollecho "Running ...";
35402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll
36402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll#prettyprint the command
37402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Mollecho $cmd | sed -e 's/ \-/\n  \-/g' -e 's/:/\n    :/g'; echo "";
38402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll
39402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll# run the command
40402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll$cmd;
41402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll
42402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Mollrm -fr $tmpfolder;
43