Bug 24129 - Ability to (optionally) run ANT in a separate JVM
Summary: Ability to (optionally) run ANT in a separate JVM
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Ant (show other bugs)
Version: 2.1   Edit
Hardware: PC other
: P2 enhancement with 4 votes (vote)
Target Milestone: 3.0 M3   Edit
Assignee: Darin Wright CLA
QA Contact:
URL:
Whiteboard:
Keywords: core
: 20443 25182 29247 30233 30684 32287 33946 36324 (view as bug list)
Depends on: 36870
Blocks: 26491
  Show dependency tree
 
Reported: 2002-09-26 09:09 EDT by Darin Swanson CLA
Modified: 2003-09-09 12:38 EDT (History)
19 users (show)

See Also:


Attachments
Sample Program external tool configuration for launching Ant in separate VM (1.20 KB, text/plain)
2003-02-05 10:53 EST, Darin Swanson CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Darin Swanson CLA 2002-09-26 09:09:18 EDT
From the newsgroup:

Ability to (optinally) run ANT in a seperate JVM (outside of Eclipse)
allowing control over classpath, vmargs, working directory, etc.
Comment 1 Darin Swanson CLA 2002-09-30 15:57:27 EDT
*** Bug 20443 has been marked as a duplicate of this bug. ***
Comment 2 Bob Foster CLA 2002-10-01 19:04:08 EDT
Here's a use case. I run Eclipse in 1.4, so my build scripts run in 1.4. But
MacOSX doesn't support 1.4, so I need to build for that platform in 1.3. (At
least, I think that's what UnsupportedClassVersionError is telling me.) My code
has no 1.4 dependencies, so I would be happy to build for all platforms in 1.3.
But I can't do it in Eclipse.
Comment 3 Darin Swanson CLA 2002-10-22 10:57:13 EDT
*** Bug 25182 has been marked as a duplicate of this bug. ***
Comment 4 Darin Swanson CLA 2002-11-05 10:16:23 EST
Current workaround for Bob's use case is to specify a javac target of "1.3"
Comment 5 Darin Wright CLA 2002-11-15 14:00:25 EST
Consider for 2.1
Comment 6 Darin Wright CLA 2002-12-05 09:32:57 EST
Moving to M5
Comment 7 Darin Swanson CLA 2003-01-09 17:08:08 EST
*** Bug 29247 has been marked as a duplicate of this bug. ***
Comment 8 Darin Wright CLA 2003-01-14 20:53:53 EST
Deferred for post 2.1 consideration.
Comment 9 Darin Swanson CLA 2003-01-27 10:03:10 EST
*** Bug 30233 has been marked as a duplicate of this bug. ***
Comment 10 Darin Swanson CLA 2003-02-05 10:53:20 EST
Created attachment 3299 [details]
Sample Program external tool configuration for launching Ant in separate VM

This .launch file is an example of how to launch Ant in a separte VM. It is
catered to solving the problem of bug 30353 but should could be modified to a
specific situation. The .launch should be placed in your project to be shared
by a team via a repository. 
As well you will need to create a "Jakarta" project that contains the necessary
JARs (ant, optional, junit, log4j, xerces, xml-apis etc.). This project can be
external to the workspace and shared by a team without having to put all the
JARs in a repository.
Comment 11 Darin Swanson CLA 2003-02-05 10:55:24 EST
*** Bug 30684 has been marked as a duplicate of this bug. ***
Comment 12 Darin Swanson CLA 2003-03-06 06:04:06 EST
*** Bug 33946 has been marked as a duplicate of this bug. ***
Comment 13 Darin Swanson CLA 2003-04-08 17:53:19 EDT
*** Bug 32287 has been marked as a duplicate of this bug. ***
Comment 14 Darin Swanson CLA 2003-04-10 10:53:47 EDT
*** Bug 36324 has been marked as a duplicate of this bug. ***
Comment 15 Darin Swanson CLA 2003-04-15 15:17:28 EDT
Reopening for investigation
Comment 16 Darin Swanson CLA 2003-04-22 15:23:55 EDT
After some initial investigation this is the current proposal:
make a (new) Ant UI plugin that is "Java" aware
this plugin will contain all of the current Ant support provided in the 
external tools plugin but also allow the user to specify whether to launch Ant 
in a separate VM.  The resolution of the JRE will make use of the existing jdt 
launching and jdt debug support.
Comment 17 Olivier Thomann CLA 2003-04-23 13:47:44 EDT
Will this new plugin be able to retrieve preferences from the Eclipse workspace?
See bug 25510.
Comment 18 Darin Swanson CLA 2003-04-23 13:56:00 EDT
The Ant UI plugin currently pre-reqs org.eclipse.jdt.core.
Comment 19 Darin Swanson CLA 2003-04-23 13:56:46 EDT
Added Olivier to see the last comment
Comment 20 Olivier Thomann CLA 2003-04-23 14:02:13 EDT
I was asking if it will be possible to access per project basis the preferences 
of the running workspace in which the ant script is started even if it is 
runnign on a separate VM.
This is useful to retrieve compiler settings on a project basis. The fact that 
the Ant plugin pre-req jdt.core doesn't garantee this.
Comment 21 Darin Swanson CLA 2003-04-23 14:10:32 EDT
Where and how are settings retrieved from..sorry I don't know this code? 

It would seem a little over zealous to always be setting all the compiler 
options as properties for all Ant builds? 
How are you going to let the user control this?
Comment 22 Olivier Thomann CLA 2003-04-23 15:52:57 EDT
The code is on IJavaProject. See getOption methods. The problem is to be able to
get the current instance of the java project inside an ant script. When it is
running on the same VM, this is easy, but we need a way to get the same
information when a script is running on a different VM. Setting properties is
one way, but it can become tedious if each preference becomes a property. The
worse is that we need preferences on a project basis. I don't see an easy way to
do that. The user could control that using a property. Same as
eclipse.isRunning. In fact, I wonder if we need to give control to the user. It
makes sense to reuse the same compiler settings inside a javac task if the
eclipse compiler adapter is used.
Comment 23 Darin Swanson CLA 2003-05-01 11:59:35 EDT
An alpha version of the ability to launch in a separate VM is available in 
I20030429. See the JRE tab of the Ant Launch Configuration Dialog.

Known problems:
no hyperlinks in output
no output coloring

I am sure there are other issues.
Comment 24 Olivier Thomann CLA 2003-05-01 12:07:54 EDT
Did you define a way to access the properties/preferences of the running 
workspace in the ant task when it is running on a separate VM?
Comment 25 Darin Swanson CLA 2003-05-01 12:19:57 EDT
No...alpha version.
Comment 26 Darin Swanson CLA 2003-07-14 13:46:16 EDT
Pushing back to M3.
Comment 27 Darin Swanson CLA 2003-08-01 20:22:29 EDT
Changes made to the AbstractVMRunner hierarchy to support a Java process 
masquerading as an Ant process to make use of the task linking support.
See AbstractVMRunner.getDefaultProcessMap(ILaunchConfiguration), 
VMRunnerConfiguration and JavaLocalApplicationLaunchConfiguration.

Changes to AntUtil, TaskLinkManager, AntLaunchDelegate and 
AntProcessBuildLogger.
Addition of RemoteAntBuildListener and RemoteAntBuildLogger and MessageIds

As well another external tool builder has been added to the org.eclipse.ant.ui 
project to build the remoteAnt.jar

What I would like to do is have the basic functionality verified: 
    you can launch Ant in a separate specified VM
    you get hyperlinks for the output
and then we can log new bugs for the specific problems.

I have logged bug 41068 for no color output.
Comment 28 Darin Swanson CLA 2003-08-01 20:23:13 EDT
Please verify DarinW.
Comment 29 Darin Wright CLA 2003-08-05 14:07:26 EDT
Verified.
Comment 30 Robert Krueger CLA 2003-08-22 08:39:54 EDT
Could you please add the possibility to specify VM arguments? One use case for
this is when the ant tasks you use need more than the default VM max heapsize.
We drive a code generation tool from ant tasks that runs out of memory with the
default VM max heapsize. Therefore we have to run it in the same VM as eclipse
and restart eclipse every now and then because of OutOfMemoryErrors because of
the ant memory leak.

Thanks

 
Comment 31 Darin Swanson CLA 2003-08-22 11:10:37 EDT
We have plans for your enhancement as your use case is not extraordinary.
We have bug 26491 .