Community
Participate
Working Groups
From the newsgroup: Ability to (optinally) run ANT in a seperate JVM (outside of Eclipse) allowing control over classpath, vmargs, working directory, etc.
*** Bug 20443 has been marked as a duplicate of this bug. ***
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.
*** Bug 25182 has been marked as a duplicate of this bug. ***
Current workaround for Bob's use case is to specify a javac target of "1.3"
Consider for 2.1
Moving to M5
*** Bug 29247 has been marked as a duplicate of this bug. ***
Deferred for post 2.1 consideration.
*** Bug 30233 has been marked as a duplicate of this bug. ***
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.
*** Bug 30684 has been marked as a duplicate of this bug. ***
*** Bug 33946 has been marked as a duplicate of this bug. ***
*** Bug 32287 has been marked as a duplicate of this bug. ***
*** Bug 36324 has been marked as a duplicate of this bug. ***
Reopening for investigation
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.
Will this new plugin be able to retrieve preferences from the Eclipse workspace? See bug 25510.
The Ant UI plugin currently pre-reqs org.eclipse.jdt.core.
Added Olivier to see the last comment
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.
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?
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.
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.
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?
No...alpha version.
Pushing back to M3.
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.
Please verify DarinW.
Verified.
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
We have plans for your enhancement as your use case is not extraordinary. We have bug 26491 .