Bug 165371 - Add 'Build' tab and functionality to program external tools
Summary: Add 'Build' tab and functionality to program external tools
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Ant (show other bugs)
Version: 3.2.1   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: 3.4 M1   Edit
Assignee: Darin Swanson CLA
QA Contact:
URL:
Whiteboard:
Keywords: bugday, contributed, helpwanted
Depends on:
Blocks:
 
Reported: 2006-11-21 15:34 EST by Andre John Mas CLA
Modified: 2007-08-01 10:57 EDT (History)
2 users (show)

See Also:


Attachments
Patch against org.eclipse.ant.ui and org.eclipse.ui.externaltools (51.95 KB, patch)
2007-07-26 10:43 EDT, dakshinamurthy.karra CLA
no flags Details | Diff
Test workspace to check the program launch and ant launch (12.99 KB, application/octet-stream)
2007-07-26 10:54 EDT, dakshinamurthy.karra CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Andre John Mas CLA 2006-11-21 15:34:09 EST
The 'ant' external tool includes a 'build' tab, with settings that allow you to define whether you wish to 'build before launch'. The 'program' external tool does not, so when using this the project gets built before the tool gets run - at least this is the observation when using CDT. This is a bit of a pain, since we build an external library with this action.

I would like to see this option added to the 'program' external tool.

Currently a work around involves creating an ant-task call the tool.
Comment 1 dakshinamurthy.karra CLA 2007-07-25 11:19:48 EDT
Hello,

I signed this up for bugday and just had a look at it. I think the best way to approach this is to refactor the AntBuildTab to create a abstract BuildTab. This will be moved into the org.eclipse.ui.externaltools.internal.launchConfigurations package and AntBuildTab will derive from this. Further a ProgramBuildTab will be created that also derives from the BuildTab and added to the tab group. Override the getBuildOrder() in the ProgramLaunchDelegate that retrieves the projects from the BuildTab.

Am I in the right direction?

Comment 2 Darin Swanson CLA 2007-07-25 12:08:29 EDT
Thank you for signing up.
Your proposal seems reasonable to me.
Comment 3 Andre John Mas CLA 2007-07-25 18:15:22 EDT
Certainly sounds reasonable.
Comment 4 dakshinamurthy.karra CLA 2007-07-26 05:27:11 EDT
I started a little early, I hope it is OK ;-).

Few questions:

1. Backward compatibility: AntBuildTab is not dependent on Ant package at all. So the whole of it moved to external tools. The ids used in AntBuildTab are moved to a different prefix now. That means, all old ant launch configurations will fail with the new one. A solution is to still use AntBuildTab derived from ETBuildTab and override the IDs. IMO, this is not correct - however if the backward compatibility is important for Ant launch configurations this can be done.
2. The external tools have already a class named ExternalToolsBuilderTab. The name is close to ExternalToolsBuildTab that is refactored from AntBuildTab. IMO, the name ExternalToolsBuilderTab should have been ExternalToolsBuildOptionsTab. I am expected to do this refactoring? Or can I leave it at that?
3. Are there any other classes that are directly dependent on the AntBuildTab? I do not have the full sources checkedout - so I can't check this out. Can someone help me?
4. I am doing only manual testing to see that this works. The coding is almost complete, I am updating the java doc etc. before posting the patch.

Comment 5 Darin Swanson CLA 2007-07-26 09:44:46 EDT
It is great!
1. We must maintain backwards compatibility.
2. no
3. no
4. There are no automated tests for this functionality.
Comment 6 dakshinamurthy.karra CLA 2007-07-26 10:43:57 EDT
Created attachment 74694 [details]
Patch against org.eclipse.ant.ui and org.eclipse.ui.externaltools

See the followup post with a test workspace and instructions.
Comment 7 dakshinamurthy.karra CLA 2007-07-26 10:54:58 EDT
Created attachment 74697 [details]
Test workspace to check the program launch and ant launch

About the patch:

1. Patch includes a build_tab.gif file (binary). Depending on how you apply, you may have to copy it from the ant.ui plugin.
2. A External tool help context id is created for build tab. The help from Ant plugin should be moved into the appropriate place. Unfortunately, I don't know how to do this.
3. Backward compatibility is kept (see AntBuildTab.java). It is ugly :(

The testworkspace contains 4 projects that need to be imported into the eclipse workbench launched. There are 3 projects each with a ant build that just puts a message into a file. AntBuilderTest has external tool launchers for launching different scenarios. Run Setup.launch before using any of the other launches.

The tests:

AntBuilderTest_1 : tests that a given project (AntBuilder_1) is built before the antfile is launched.
AntBuilderTest_2: tests that a given project (AntBuilder_3) is built before the antfile is launched. AntBuilder_3 references AntBuilder_2, so both gets built.
AntBuilderTest_3: tests that the whole workspace is built before the antfile is launched

The ProgramLaunchTest_* are similar to the AntBuilderTest_* but launches a program (sh -c ls). You may need to change the external program if you are on a non-unix platform.

Please get back to me in case of problems. We still have time for bug day :)
Comment 8 Darin Swanson CLA 2007-07-26 12:43:51 EDT
Thank you. I will review either later today or tomorrow morning (Pacific Standard Time).
Comment 9 Chris Aniszczyk CLA 2007-07-27 17:31:21 EDT
poke
Comment 10 Darin Swanson CLA 2007-07-27 17:39:10 EDT
prod...today did not quite go as planned. Will try for Sunday night.
Comment 11 Darin Swanson CLA 2007-07-29 22:09:46 EDT
I have reviewed and made some slight changes.

I stayed with your name changes for the IExternalToolConstants but changed the string values to preserve backwards compatibility.

I removed the AntBuildTab class and moved the constants into AntLaunchDelegate since this was the only reason this class still existed.

Added copyright updates to the classes you contributed.

Removed the Ant UI declaration and usage of the build tab gif

Thanks!

Changes to:
AntUIImages - remove build tab gif
IAntUIConstants - remove build tab gif
AntBuildTab - deleted as functionality provided view ExternalToolsBuildTab
AntLaunchConfigurationMessages - removed AntBuildTab NLS
AntLaunchDelegate - adopt AntBuildTab constants and delegate to ExternalToolsBuildTab for build order
AntTabGroup - move to use ExternalToolsBuildTab
AntLaunchConfigurationMessages - removed AntBuildTab NLS

ExternalToolsBuilderTab - adapt to constant rename though value preserved for backwards compatibility
ExternalToolsBuildTab - generalized AntBuildTab
ExternalToolsLaunchConfigurationMessages - ExternalToolsBuildTab NLS
ExternalToolsUtil - adapt to constant rename though value preserved for backwards compatibility
ExternalToolsLaunchConfigurationMessages - ExternalToolsBuildTab NLS
ExternalToolsImages - build tab gif
IExternalToolsConstants - build tab gif

ProgramLaunchDelegate - add build order to program launches
ProgramTabGroup - add the build tab
Comment 12 Darin Swanson CLA 2007-07-29 22:18:56 EDT
released
Comment 13 dakshinamurthy.karra CLA 2007-07-29 23:54:47 EDT
(In reply to comment #12)
> released
> 

Thanks for giving the oppurtunity. It was pleasure taking part in the bugday. Will be looking forward to the next one :)

-- KD