Community
Participate
Working Groups
Version: 4.2.0 Build id: I20120306-2200 Steps: 1. open the Ant view 2. select the 'Add Buildfiles' view action 3. notice in the resulting dialog the checkbox that reads "Only show *.xml files" Since the idea of this dialog is to select a buildfile to add to the view and the checkbox is supposed to help you do that by applying some filtering, it would be better if it read "Only shown known build file types (*.xml, *.ent, etc)" - or something similar to express that .xml is not the only extension for a buildfile. Valid buildfiles can be named *.xml, *.ant, *.ent, *.macrodef
Created attachment 214059 [details] Code changes and associated JUnit test cases
The code changes contain the following: (1) Updated label for the check box in the 'Add Buildfiles' dialog (2) Enhanced file-filtering to accept *.xml, *.ant, *.ent, *.macrodef as build files There are two test cases (1) Just to ensure that 'Add Buildfiles' action exists (2) A unit test for the change to the file-filtering algorithm
(In reply to comment #1) > Created attachment 214059 [details] > Code changes and associated JUnit test cases Thanks for the patch + regression tests Pradeep! I would probably change the extension check code to use AntUtil.isKnownAntFile, that way if we extend the content description for known Ant file types we don't have to hunt down uses of Ant file extensions.
(In reply to comment #3) > > I would probably change the extension check code to use AntUtil.isKnownAntFile, Good point! Thanks for pointing me to AntUtil. Since the current set of extensions (which are considered to be ANT files) come from the ANT ContentType, we should use this instead of just checking the extensions explicitly (I just enhanced the existing piece of code there which was following a similar approach). I shall incorporate this change and post another patch.
Created attachment 214430 [details] Code changes and associated JUnit test cases after incorporating the review comments. Modified AntUtil to include a couple of helper routines to get the file extensions defined as build file extensions in the ANT content-type. Thus this patch is same as previous one except for the following: (1) Added a couple of helper routines to AntUtil (2) Modified AddBuildFileAction and AntViewTests to use helper routine.
Just to clarify, of the three code changes in AntUtil, only one is related to this bug while the other two are to fix potential NPEs that caught my attention.
Pushed patch + minor update to add isKnownAntFileName util method: http://git.eclipse.org/c/platform/eclipse.platform.git/commit/?id=23acda54cf28d69b78dc5aab8c5752424ee28908 Thanks Pradeep!
*** Bug 352376 has been marked as a duplicate of this bug. ***