Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 40186

Summary: external tools builder fails to expand variables
Product: [Eclipse Project] Platform Reporter: Nikolay Metchev <nikolaymetchev>
Component: AntAssignee: Jared Burns <jared_burns>
Status: RESOLVED DUPLICATE QA Contact:
Severity: normal    
Priority: P3    
Version: 3.0   
Target Milestone: ---   
Hardware: PC   
OS: Windows 2000   
Whiteboard:

Description Nikolay Metchev CLA 2003-07-16 06:22:44 EDT
I have defined an external tools builder which runs a batch file located within 
an eclipse project e.g. ${workspace_loc:/Bootstrap/CreateJavaDebugFile.cmd}.

That batch file takes some parameters but those paramaters use eclipse 
variables e.g.:
${project_loc}\Source\Java\Generated\Make ${project_name} -d

When I perform a rebuild all...all the projects that have this external tool 
builder report the following errors:
An error occurred attempting to expand the variable project_loc. No resource 
selected.
An error occurred attempting to expand the variable project_name. No resource 
selected.


and throw the following exception:
org.eclipse.core.runtime.CoreException: Could not resolve an argument.
	at 
org.eclipse.ui.externaltools.internal.launchConfigurations.ExternalToolsUtil.get
Arguments(Unknown Source)
	at 
org.eclipse.ui.externaltools.internal.program.launchConfigurations.ProgramLaunch
Delegate.launch(Unknown Source)
	at org.eclipse.debug.internal.core.LaunchConfiguration.launch(Unknown 
Source)
	at 
org.eclipse.ui.externaltools.internal.model.ExternalToolBuilder.launchBuild
(Unknown Source)
	at org.eclipse.ui.externaltools.internal.model.ExternalToolBuilder.build
(Unknown Source)
	at org.eclipse.core.internal.events.BuildManager$2.run(Unknown Source)
	at org.eclipse.core.internal.runtime.InternalPlatform.run(Unknown 
Source)
	at org.eclipse.core.runtime.Platform.run(Unknown Source)
	at org.eclipse.core.internal.events.BuildManager.basicBuild(Unknown 
Source)
	at org.eclipse.core.internal.events.BuildManager.basicBuild(Unknown 
Source)
	at org.eclipse.core.internal.events.BuildManager.basicBuild(Unknown 
Source)
	at org.eclipse.core.internal.events.BuildManager$1.run(Unknown Source)
	at org.eclipse.core.internal.runtime.InternalPlatform.run(Unknown 
Source)
	at org.eclipse.core.runtime.Platform.run(Unknown Source)
	at org.eclipse.core.internal.events.BuildManager.basicBuild(Unknown 
Source)
	at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(Unknown 
Source)
	at org.eclipse.core.internal.events.BuildManager.build(Unknown Source)
	at org.eclipse.core.internal.resources.Workspace.build(Unknown Source)
	at org.eclipse.ui.actions.GlobalBuildAction$1.run(Unknown Source)
	at org.eclipse.jface.operation.ModalContext$ModalContextThread.run
(Unknown Source)
Comment 1 Darin Wright CLA 2003-07-16 10:47:06 EDT
Please investigate, Jared.
Comment 2 Darin Swanson CLA 2003-07-16 11:35:18 EDT
When you do the rebuild all do you any resource selected?
Both project_loc and project_name rely on having a resource selected to do the 
variable expansion.
It is unlikely these variables will work correctly across multiple projects in 
an external tool builder situation. 
Do you want all of the builds to use the same project_name and project_loc?
Comment 3 Nikolay Metchev CLA 2003-07-16 11:39:56 EDT
I would have thought that project_loc and project_name would refer to the 
project that this external tools builder belongs to. I once submitted a request 
to allow external tools builders to be shared across projects and was told that 
it created more headache than is worth doing. So if external tools builders 
only apply to one project it would seem silly to have those variables refer to 
other projects. 

It doesn't matter which project I have selected the error occurs because I have 
several project that have exactly the same external tools builder defined.
Comment 4 Jared Burns CLA 2003-07-16 12:29:45 EDT

*** This bug has been marked as a duplicate of 37943 ***