jruaux 2003/02/24 08:48:33
Modified: integration/eclipse/src/java/org/apache/cactus/eclipse/containers/ant
GenericAntProvider.java
Log:
Library path lookup for EclipseRunTests Ant task
Revision Changes Path
1.6 +28 -9
jakarta-cactus/integration/eclipse/src/java/org/apache/cactus/eclipse/containers/ant/GenericAntProvider.java
Index: GenericAntProvider.java
===================================================================
RCS file:
/home/cvs/jakarta-cactus/integration/eclipse/src/java/org/apache/cactus/eclipse/containers/ant/GenericAntProvider.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- GenericAntProvider.java 24 Feb 2003 13:56:57 -0000 1.5
+++ GenericAntProvider.java 24 Feb 2003 16:48:33 -0000 1.6
@@ -69,6 +69,8 @@
import org.eclipse.ant.core.AntRunner;
import org.eclipse.core.boot.BootLoader;
import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.ILibrary;
+import org.eclipse.core.runtime.IPluginDescriptor;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.SubProgressMonitor;
@@ -187,6 +189,20 @@
public void start(ContainerInfo theContainerInfo, IProgressMonitor thePM)
throws CoreException
{
+ IPluginDescriptor descriptor =
+ CactusPlugin.getDefault().getDescriptor();
+ ILibrary[] pluginLibraries = descriptor.getRuntimeLibraries();
+ ILibrary lib = pluginLibraries[0];
+ URL libURL = descriptor.find(lib.getPath());
+ if (libURL == null)
+ {
+ throw CactusPlugin.createCoreException(
+ "CactusLaunch.message.prepare.error.plugin.lib",
+ " : " + lib.toString(),
+ null);
+ }
+ antArguments.add(
+ "-Dcactus.eclipseintegration.jar.name=" + libURL.getPath());
thePM.subTask(CactusMessages.getString("CactusLaunch.message.start"));
String[] targets = getMasked("cactus.run.");
AntRunner runner = createAntRunner(targets);
@@ -238,16 +254,19 @@
throws CoreException
{
thePM.subTask(CactusMessages.getString("CactusLaunch.message.stop"));
- eclipseRunner.finish();
- while (!serverStopped)
+ if (eclipseRunner != null)
{
- try
- {
- Thread.sleep(50);
- }
- catch (InterruptedException e)
+ eclipseRunner.finish();
+ while (!serverStopped)
{
- // Do nothing
+ try
+ {
+ Thread.sleep(50);
+ }
+ catch (InterruptedException e)
+ {
+ // Do nothing
+ }
}
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]